WP Embed Facebook - Version 3.0.5

Version Description

Download this release

Release Info

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

Code changes from version 3.0.4 to 3.0.5

Files changed (4) hide show
  1. inc/FB_API.php +10 -10
  2. inc/Plugin.php +1 -1
  3. readme.txt +1 -1
  4. wp-embed-facebook.php +1 -1
inc/FB_API.php CHANGED
@@ -37,20 +37,22 @@ class FB_API {
37
  protected static $instance = null;
38
 
39
  /**
 
 
40
  * @return FB_API
41
  */
42
- static function instance($app_id = null, $app_secret = null) {
43
  if ( static::$instance === null ) {
44
- static::$instance = new static($app_id,$app_secret);
45
  }
46
 
47
  return static::$instance;
48
  }
49
 
50
- protected function __construct($app_id = null,$app_secret = null) {
51
- $this->app_id = $app_id === null ? Plugin::get_option( 'app_id' ) : $app_id;
52
- $this->app_secret = $app_secret === null ? Plugin::get_option( 'app_secret' ) : $app_secret;
53
- $this->app_access_token = "{$this->app_id}|{$this->app_secret}";
54
  $this->access_token = strlen( $this->app_access_token ) > 5 ? $this->app_access_token : null;
55
  }
56
 
@@ -170,8 +172,7 @@ class FB_API {
170
  }
171
 
172
  if ( is_wp_error( $response ) ) {
173
- throw new \Exception( $response->get_error_code() . '=>'
174
- . $response->get_error_message(), 500 );
175
  }
176
 
177
  $response_code = wp_remote_retrieve_response_code( $response );
@@ -204,8 +205,7 @@ class FB_API {
204
  }
205
 
206
  if ( 200 != $response_code || ! is_array( $data ) || empty( $data ) ) {
207
- throw new \Exception( __( 'Unknown error occurred', 'wp-embed-facebook' ),
208
- (int) $response_code );
209
  }
210
 
211
  return $data;
37
  protected static $instance = null;
38
 
39
  /**
40
+ * Default instance created with plugin options.
41
+ *
42
  * @return FB_API
43
  */
44
+ static function instance() {
45
  if ( static::$instance === null ) {
46
+ static::$instance = new static( Plugin::get_option( 'app_id' ), Plugin::get_option( 'app_secret' ) );
47
  }
48
 
49
  return static::$instance;
50
  }
51
 
52
+ public function __construct( $app_id = '', $app_secret = '' ) {
53
+ $this->app_id = $app_id;
54
+ $this->app_secret = $app_secret;
55
+ $this->app_access_token = "$app_id|$app_secret";
56
  $this->access_token = strlen( $this->app_access_token ) > 5 ? $this->app_access_token : null;
57
  }
58
 
172
  }
173
 
174
  if ( is_wp_error( $response ) ) {
175
+ throw new \Exception( $response->get_error_code() . '=>' . $response->get_error_message(), 500 );
 
176
  }
177
 
178
  $response_code = wp_remote_retrieve_response_code( $response );
205
  }
206
 
207
  if ( 200 != $response_code || ! is_array( $data ) || empty( $data ) ) {
208
+ throw new \Exception( __( 'Unknown error occurred', 'wp-embed-facebook' ), (int) $response_code );
 
209
  }
210
 
211
  return $data;
inc/Plugin.php CHANGED
@@ -19,7 +19,7 @@ if ( ! defined( 'WPINC' ) ) {
19
  */
20
  final class Plugin extends Framework {
21
 
22
- const VER = '3.0.4';
23
 
24
  static $option = 'wpemfb_options';
25
  static $menu_slug = 'embedfacebook';
19
  */
20
  final class Plugin extends Framework {
21
 
22
+ const VER = '3.0.5';
23
 
24
  static $option = 'wpemfb_options';
25
  static $menu_slug = 'embedfacebook';
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: Facebook, Social Plugins, embed facebook, facebook video, facebook posts,
5
  Requires at least: 4.5
6
  Tested up to: 5.0
7
  Requires PHP: 5.4
8
- Stable tag: 3.0.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  Embed any public Facebook video, page, comment, event, album, photo, profile. Add Facebook comments to all your site or embed any Social Plugin.
5
  Requires at least: 4.5
6
  Tested up to: 5.0
7
  Requires PHP: 5.4
8
+ Stable tag: 3.0.5
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  Embed any public Facebook video, page, comment, event, album, photo, profile. Add Facebook comments to all your site or embed any Social Plugin.
wp-embed-facebook.php CHANGED
@@ -9,7 +9,7 @@ Plugin Name: WP Embed Facebook
9
  Plugin URI: http://www.wpembedfb.com
10
  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="https://wpembedfb.com/features" title="plugin website" target="_blank">features</a>.
11
  Author: Miguel Sirvent
12
- Version: 3.0.4
13
  Author URI: http://www.wpembedfb.com
14
  Text Domain: wp-embed-facebook
15
  GitHub Plugin URI: sigami/wp-embed-facebook
9
  Plugin URI: http://www.wpembedfb.com
10
  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="https://wpembedfb.com/features" title="plugin website" target="_blank">features</a>.
11
  Author: Miguel Sirvent
12
+ Version: 3.0.5
13
  Author URI: http://www.wpembedfb.com
14
  Text Domain: wp-embed-facebook
15
  GitHub Plugin URI: sigami/wp-embed-facebook