WP Embed Facebook - Version 2.0.7

Version Description

  • Settings translation link
  • Improved object id identification for fan pages and posts
  • Video download option
Download this release

Release Info

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

Code changes from version 2.0.6 to 2.0.7

lib/admin/ic_image_settings.png CHANGED
File without changes
lib/admin/ic_setting.png CHANGED
File without changes
lib/class-wp-embed-fb-admin.php CHANGED
@@ -45,12 +45,19 @@ class WP_Embed_FB_Admin {
45
  </script>
46
  <?php
47
  endif;
48
- if(get_option('wpemfb_close_warning') == 'false') :
49
  ?>
50
  <script type="text/javascript">
51
  jQuery(document).on( 'click', '.wpemfb_warning .notice-dismiss', function() {
52
  jQuery.post(ajaxurl, { action: 'wpemfb_close_warning' });
53
  });
 
 
 
 
 
 
 
54
  </script>
55
  <?php
56
  endif;
@@ -58,7 +65,7 @@ class WP_Embed_FB_Admin {
58
  }
59
 
60
  static function add_action_link($links){
61
- array_unshift( $links, '<a href="'.admin_url("options-general.php?page=embedfacebook").'">Settings</a>' );
62
  return $links;
63
  }
64
 
45
  </script>
46
  <?php
47
  endif;
48
+ if(get_option('wpemfb_close_warning1','false') == 'false') :
49
  ?>
50
  <script type="text/javascript">
51
  jQuery(document).on( 'click', '.wpemfb_warning .notice-dismiss', function() {
52
  jQuery.post(ajaxurl, { action: 'wpemfb_close_warning' });
53
  });
54
+ jQuery(document).on( 'click', '#wef-video-down', function(e) {
55
+ e.preventDefault();
56
+ jQuery.post(ajaxurl, { action: 'wpemfb_video_down' },function(){
57
+ window.location = "<?php echo admin_url("options-general.php?page=embedfacebook"); ?>"
58
+ });
59
+
60
+ });
61
  </script>
62
  <?php
63
  endif;
65
  }
66
 
67
  static function add_action_link($links){
68
+ array_unshift( $links, '<a href="'.admin_url("options-general.php?page=embedfacebook").'">'.__("Settings").'</a>' );
69
  return $links;
70
  }
71
 
lib/class-wp-embed-fb-plugin.php CHANGED
@@ -23,7 +23,7 @@ class WP_Embed_FB_Plugin {
23
  * Delete all plugin options on uninstall
24
  */
25
  static function uninstall(){
26
- $deprecated = array('wpemfb_show_posts'=>'');
27
  $defaults = self::getdefaults() + $deprecated;
28
  if ( is_multisite() ) {
29
  $sites = wp_get_sites();
@@ -80,7 +80,7 @@ class WP_Embed_FB_Plugin {
80
  'wpemfb_page_hide_cover' => 'false',
81
  'wpemfb_page_show_posts' => 'false',
82
  'wpemfb_sdk_lang' => array_key_exists( $locale, self::get_fb_locales()) ? $locale : 'en_US',
83
- 'wpemfb_close_warning' => 'false',
84
  'wpemfb_force_app_token' => 'true',
85
  'wpemfb_video_download' => 'false',
86
  );
@@ -163,12 +163,12 @@ class WP_Embed_FB_Plugin {
163
  }
164
  static function admin_notices(){
165
  if(!self::has_fb_app()){
166
- if(get_option('wpemfb_close_warning') == 'false') :
167
  ?>
168
  <div class="notice wpemfb_warning is-dismissible">
169
  <h2>WP Embed Facebook</h2>
170
  <p>Hey! The last step.</p>
171
- <p><img src="<?php echo WP_Embed_FB_Plugin::get_url().'lib/admin/ic_setting.png' ?>">&nbsp;Turn on <a href="<?php echo admin_url("options-general.php?page=embedfacebook") ?>">Video Download Option</a> in WP Embed Facebook settings.</p>
172
  <small><?php _e('To embed albums, events, profiles and video as HTML5 you will need a Facebook App','wp-embed-facebook') ?>
173
  </small>
174
  <p>
@@ -186,7 +186,14 @@ class WP_Embed_FB_Plugin {
186
  }
187
  static function wpemfb_close_warning(){
188
  if(current_user_can('manage_options'))
189
- update_option('wpemfb_close_warning','true');
 
 
 
 
 
 
 
190
  die;
191
  }
192
  static function has_fb_app(){
23
  * Delete all plugin options on uninstall
24
  */
25
  static function uninstall(){
26
+ $deprecated = array('wpemfb_show_posts'=>'','wpemfb_close_warning'=>'');
27
  $defaults = self::getdefaults() + $deprecated;
28
  if ( is_multisite() ) {
29
  $sites = wp_get_sites();
80
  'wpemfb_page_hide_cover' => 'false',
81
  'wpemfb_page_show_posts' => 'false',
82
  'wpemfb_sdk_lang' => array_key_exists( $locale, self::get_fb_locales()) ? $locale : 'en_US',
83
+ 'wpemfb_close_warning1' => 'false',
84
  'wpemfb_force_app_token' => 'true',
85
  'wpemfb_video_download' => 'false',
86
  );
163
  }
164
  static function admin_notices(){
165
  if(!self::has_fb_app()){
166
+ if(get_option('wpemfb_close_warning1','false') == 'false' && !self::has_fb_app()) :
167
  ?>
168
  <div class="notice wpemfb_warning is-dismissible">
169
  <h2>WP Embed Facebook</h2>
170
  <p>Hey! The last step.</p>
171
+ <p><img src="<?php echo WP_Embed_FB_Plugin::get_url().'lib/admin/ic_setting.png' ?>">&nbsp;Turn on <a id="wef-video-down" href="<?php echo admin_url("options-general.php?page=embedfacebook") ?>">Video Download Option</a> in settings.</p>
172
  <small><?php _e('To embed albums, events, profiles and video as HTML5 you will need a Facebook App','wp-embed-facebook') ?>
173
  </small>
174
  <p>
186
  }
187
  static function wpemfb_close_warning(){
188
  if(current_user_can('manage_options'))
189
+ update_option('wpemfb_close_warning1','true');
190
+ die;
191
+ }
192
+ static function wpemfb_video_down(){
193
+ if(current_user_can('manage_options')){
194
+ update_option('wpemfb_close_warning1','true');
195
+ update_option('wpemfb_video_download','true');
196
+ }
197
  die;
198
  }
199
  static function has_fb_app(){
lib/class-wp-embed-fb.php CHANGED
@@ -178,6 +178,13 @@ class WP_Embed_FB {
178
  $type = 'page';
179
  }
180
  }
 
 
 
 
 
 
 
181
  $fb_id = apply_filters('wpemfb_embed_fb_id',$fb_id, $juiceArray);
182
  return array('type'=>$type,'fb_id'=>$fb_id);
183
  }
178
  $type = 'page';
179
  }
180
  }
181
+ if(!is_int($fb_id)){
182
+ $fb_id = str_replace(':0','',$fb_id);
183
+ $fb_id_array = explode('-',$fb_id);
184
+ if( !empty($fb_id_array) && is_int(end($fb_id_array)) ){
185
+ $fb_id = end($fb_id_array);
186
+ }
187
+ }
188
  $fb_id = apply_filters('wpemfb_embed_fb_id',$fb_id, $juiceArray);
189
  return array('type'=>$type,'fb_id'=>$fb_id);
190
  }
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.4.1
7
- Stable tag: 2.0.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -79,6 +79,11 @@ This can only be achieved using the premium version
79
 
80
  == Changelog ==
81
 
 
 
 
 
 
82
  = 2.0.6 =
83
  * Added new filter "wpemfb_embed_fb_id"
84
  * Added Download Video option
@@ -267,5 +272,5 @@ This can only be achieved using the premium version
267
 
268
  == Upgrade Notice ==
269
 
270
- = 2.0.6 =
271
- * Improved type and fb_id recognition
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.1
7
+ Stable tag: 2.0.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
79
 
80
  == Changelog ==
81
 
82
+ = 2.0.7 =
83
+ * Settings translation link
84
+ * Improved object id identification for fan pages and posts
85
+ * Video download option
86
+
87
  = 2.0.6 =
88
  * Added new filter "wpemfb_embed_fb_id"
89
  * Added Download Video option
272
 
273
  == Upgrade Notice ==
274
 
275
+ = 2.0.7 =
276
+ * Improved object id identification for fan pages and posts
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.6
8
  Author URI: http://www.wpembedfb.com
9
  Text Domain: wp-embed-facebook
10
  Domain Path: /lang
@@ -19,6 +19,7 @@ add_action('init',array('WP_Embed_FB_Plugin','init'));
19
  add_action('plugins_loaded',array('WP_Embed_FB_Plugin','plugins_loaded'));
20
  add_action('admin_notices',array('WP_Embed_FB_Plugin','admin_notices'));
21
  add_action('wp_ajax_wpemfb_close_warning',array('WP_Embed_FB_Plugin','wpemfb_close_warning'));
 
22
 
23
  register_activation_hook(__FILE__, array('WP_Embed_FB_Plugin', 'install') );
24
  register_uninstall_hook(__FILE__, array('WP_Embed_FB_Plugin', 'uninstall') );
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.7
8
  Author URI: http://www.wpembedfb.com
9
  Text Domain: wp-embed-facebook
10
  Domain Path: /lang
19
  add_action('plugins_loaded',array('WP_Embed_FB_Plugin','plugins_loaded'));
20
  add_action('admin_notices',array('WP_Embed_FB_Plugin','admin_notices'));
21
  add_action('wp_ajax_wpemfb_close_warning',array('WP_Embed_FB_Plugin','wpemfb_close_warning'));
22
+ add_action('wp_ajax_wpemfb_video_down',array('WP_Embed_FB_Plugin','wpemfb_video_down'));
23
 
24
  register_activation_hook(__FILE__, array('WP_Embed_FB_Plugin', 'install') );
25
  register_uninstall_hook(__FILE__, array('WP_Embed_FB_Plugin', 'uninstall') );