Version Description
- Fixed: Open settings page after activation.
- Fixed: Border radius in Blog style view.
- Fixed: Expired token issue.
Download this release
Release Info
Developer | 10web |
Plugin | WD Facebook Feed – Custom Facebook Feed Plugin |
Version | 1.1.31 |
Comparing to | |
See all releases |
Code changes from version 1.1.30 to 1.1.31
- admin/controllers/FFWDControllerOptions_ffwd.php +7 -2
- admin/controllers/FFWDControllerUninstall_ffwd.php +1 -7
- admin/models/FFWDModelUninstall_ffwd.php +2 -3
- admin/views/FFWDViewOptions_ffwd.php +12 -0
- admin/views/FFWDViewUninstall_ffwd.php +5 -1
- css/ffwd_tables.css +22 -2
- facebook-feed-wd.php +69 -29
- framework/WDFacebookFeed.php +58 -29
- frontend/views/FFWDViewBlog_style.php +1 -0
- js/ffwd_embed.js +0 -455
- readme.txt +6 -1
admin/controllers/FFWDControllerOptions_ffwd.php
CHANGED
@@ -28,8 +28,13 @@ class FFWDControllerOptions_ffwd {
|
|
28 |
}
|
29 |
|
30 |
if(isset($_GET['ffwd_code']) && !empty($_GET['ffwd_code'])){
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
|
35 |
if (method_exists($this, $task)) {
|
28 |
}
|
29 |
|
30 |
if(isset($_GET['ffwd_code']) && !empty($_GET['ffwd_code'])){
|
31 |
+
$save_pages = WDFacebookFeed::save_pages(sanitize_text_field($_GET['ffwd_code']));
|
32 |
+
if ( $save_pages ) {
|
33 |
+
die('<script>window.location.href="admin.php?page=options_ffwd&success=1"</script>');
|
34 |
+
}
|
35 |
+
else{
|
36 |
+
die('<script>window.location.href="admin.php?page=options_ffwd&success=0"</script>');
|
37 |
+
}
|
38 |
}
|
39 |
|
40 |
if (method_exists($this, $task)) {
|
admin/controllers/FFWDControllerUninstall_ffwd.php
CHANGED
@@ -37,12 +37,6 @@ class FFWDControllerUninstall_ffwd
|
|
37 |
public function execute()
|
38 |
{
|
39 |
$task = ((isset($_POST['task'])) ? sanitize_text_field(stripslashes($_POST['task'])) : '');
|
40 |
-
$ffwd_uninstall = get_option("ffwd_uninstall");
|
41 |
-
if(isset($ffwd_uninstall) && $ffwd_uninstall ==="1"){
|
42 |
-
$task = 'uninstall';
|
43 |
-
$this->$task();
|
44 |
-
return;
|
45 |
-
}
|
46 |
if ($task != '') {
|
47 |
if (!WDW_FFWD_Library::verify_nonce('uninstall_ffwd')) {
|
48 |
die('Sorry, your nonce did not verify.');
|
@@ -83,4 +77,4 @@ class FFWDControllerUninstall_ffwd
|
|
83 |
////////////////////////////////////////////////////////////////////////////////////////
|
84 |
// Listeners //
|
85 |
////////////////////////////////////////////////////////////////////////////////////////
|
86 |
-
}
|
37 |
public function execute()
|
38 |
{
|
39 |
$task = ((isset($_POST['task'])) ? sanitize_text_field(stripslashes($_POST['task'])) : '');
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
if ($task != '') {
|
41 |
if (!WDW_FFWD_Library::verify_nonce('uninstall_ffwd')) {
|
42 |
die('Sorry, your nonce did not verify.');
|
77 |
////////////////////////////////////////////////////////////////////////////////////////
|
78 |
// Listeners //
|
79 |
////////////////////////////////////////////////////////////////////////////////////////
|
80 |
+
}
|
admin/models/FFWDModelUninstall_ffwd.php
CHANGED
@@ -28,6 +28,7 @@ class FFWDModelUninstall_ffwd
|
|
28 |
$wpdb->query("DROP TABLE " . $wpdb->prefix . "wd_fb_option");
|
29 |
$wpdb->query("DROP TABLE " . $wpdb->prefix . "wd_fb_theme");
|
30 |
$wpdb->query("DROP TABLE " . $wpdb->prefix . "wd_fb_shortcode");
|
|
|
31 |
delete_option('tenweb_notice_status');
|
32 |
delete_option('ffwd_admin_notice');
|
33 |
delete_option("ffwd_version");
|
@@ -35,8 +36,6 @@ class FFWDModelUninstall_ffwd
|
|
35 |
delete_option('wds_bk_notice_status');
|
36 |
delete_option('ffwd_old_version');
|
37 |
delete_option('ffwd_pages_list');
|
38 |
-
add_option('ffwd_uninstall', '1');
|
39 |
-
|
40 |
}
|
41 |
////////////////////////////////////////////////////////////////////////////////////////
|
42 |
// Getters & Setters //
|
@@ -47,4 +46,4 @@ class FFWDModelUninstall_ffwd
|
|
47 |
////////////////////////////////////////////////////////////////////////////////////////
|
48 |
// Listeners //
|
49 |
////////////////////////////////////////////////////////////////////////////////////////
|
50 |
-
}
|
28 |
$wpdb->query("DROP TABLE " . $wpdb->prefix . "wd_fb_option");
|
29 |
$wpdb->query("DROP TABLE " . $wpdb->prefix . "wd_fb_theme");
|
30 |
$wpdb->query("DROP TABLE " . $wpdb->prefix . "wd_fb_shortcode");
|
31 |
+
$wpdb->query("DROP TABLE " . $wpdb->prefix . "wd_fb_shortcode");
|
32 |
delete_option('tenweb_notice_status');
|
33 |
delete_option('ffwd_admin_notice');
|
34 |
delete_option("ffwd_version");
|
36 |
delete_option('wds_bk_notice_status');
|
37 |
delete_option('ffwd_old_version');
|
38 |
delete_option('ffwd_pages_list');
|
|
|
|
|
39 |
}
|
40 |
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
// Getters & Setters //
|
46 |
////////////////////////////////////////////////////////////////////////////////////////
|
47 |
// Listeners //
|
48 |
////////////////////////////////////////////////////////////////////////////////////////
|
49 |
+
}
|
admin/views/FFWDViewOptions_ffwd.php
CHANGED
@@ -60,11 +60,23 @@ class FFWDViewOptions_ffwd
|
|
60 |
<?php
|
61 |
$pages = get_option('ffwd_pages_list');
|
62 |
?>
|
|
|
63 |
<a id="ffwd_login_button" class="ffwd_login_button" href="#">
|
64 |
<?php
|
65 |
echo (empty($pages)) ? "Log in and get my Access Token" : "Reauthenticate"
|
66 |
?>
|
67 |
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
<div id="ffwd_login_popup" style="display: none;">
|
69 |
<div class="ffwd_login_popup_content">
|
70 |
<p>Log into your Facebook account using the button below and approve the plugin to connect your
|
60 |
<?php
|
61 |
$pages = get_option('ffwd_pages_list');
|
62 |
?>
|
63 |
+
<div class="ffwd-access-token-missing">
|
64 |
<a id="ffwd_login_button" class="ffwd_login_button" href="#">
|
65 |
<?php
|
66 |
echo (empty($pages)) ? "Log in and get my Access Token" : "Reauthenticate"
|
67 |
?>
|
68 |
</a>
|
69 |
+
<?php if (empty($pages)) { ?>
|
70 |
+
<p><?php _e("To use Facebook API, you need an Access Token.","ffwd");?></p>
|
71 |
+
<p><?php _e("Click on the Log in and get my Access Token button, to generate your token.","ffwd");?></p>
|
72 |
+
<?php
|
73 |
+
}
|
74 |
+
else { ?>
|
75 |
+
<p><?php _e("If there is an issue with the Access Token, please click on Reauthenticate button.","ffwd");?></p>
|
76 |
+
<?php
|
77 |
+
}
|
78 |
+
?>
|
79 |
+
</div>
|
80 |
<div id="ffwd_login_popup" style="display: none;">
|
81 |
<div class="ffwd_login_popup_content">
|
82 |
<p>Log into your Facebook account using the button below and approve the plugin to connect your
|
admin/views/FFWDViewUninstall_ffwd.php
CHANGED
@@ -104,6 +104,10 @@ class FFWDViewUninstall_ffwd {
|
|
104 |
<p><strong><a href="<?php echo $deactivate_url; ?>" class="ffwd_deactivate_link" data-uninstall="1">Click Here</a> To Finish the Uninstallation and Facebook Feed by 10Web will be Deactivated Automatically.</strong></p>
|
105 |
<input id="task" name="task" type="hidden" value="" />
|
106 |
</div>
|
|
|
|
|
|
|
|
|
107 |
<?php
|
108 |
}
|
109 |
|
@@ -116,4 +120,4 @@ class FFWDViewUninstall_ffwd {
|
|
116 |
////////////////////////////////////////////////////////////////////////////////////////
|
117 |
// Listeners //
|
118 |
////////////////////////////////////////////////////////////////////////////////////////
|
119 |
-
}
|
104 |
<p><strong><a href="<?php echo $deactivate_url; ?>" class="ffwd_deactivate_link" data-uninstall="1">Click Here</a> To Finish the Uninstallation and Facebook Feed by 10Web will be Deactivated Automatically.</strong></p>
|
105 |
<input id="task" name="task" type="hidden" value="" />
|
106 |
</div>
|
107 |
+
<script>
|
108 |
+
jQuery("#toplevel_page_info_ffwd ul").remove()
|
109 |
+
jQuery("#toplevel_page_info_ffwd a").attr("href", "admin.php?page=options_ffwd")
|
110 |
+
</script>
|
111 |
<?php
|
112 |
}
|
113 |
|
120 |
////////////////////////////////////////////////////////////////////////////////////////
|
121 |
// Listeners //
|
122 |
////////////////////////////////////////////////////////////////////////////////////////
|
123 |
+
}
|
css/ffwd_tables.css
CHANGED
@@ -293,10 +293,11 @@
|
|
293 |
.uninstall_icon {
|
294 |
background-image: url("../images/uninstall-icon.png");
|
295 |
background-repeat: no-repeat;
|
|
|
296 |
border: none;
|
297 |
float: left;
|
298 |
-
height:
|
299 |
-
margin:
|
300 |
width: 32px;
|
301 |
}
|
302 |
|
@@ -1218,3 +1219,22 @@ div.ffwd_error {
|
|
1218 |
#wpbody-content>div:not(.wrap):not(.wd_topic), .wrap .notice:not(.wd-notice) {
|
1219 |
display: none;
|
1220 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
.uninstall_icon {
|
294 |
background-image: url("../images/uninstall-icon.png");
|
295 |
background-repeat: no-repeat;
|
296 |
+
background-size: contain;
|
297 |
border: none;
|
298 |
float: left;
|
299 |
+
height: 25px;
|
300 |
+
margin: 0;
|
301 |
width: 32px;
|
302 |
}
|
303 |
|
1219 |
#wpbody-content>div:not(.wrap):not(.wd_topic), .wrap .notice:not(.wd-notice) {
|
1220 |
display: none;
|
1221 |
}
|
1222 |
+
#wpbody-content .notice.notice-error,
|
1223 |
+
#wpbody-content .notice.notice-success{
|
1224 |
+
display: block !important;
|
1225 |
+
}
|
1226 |
+
|
1227 |
+
#toplevel_page_options_ffwd.current a div img { /*conflict with single item menu*/
|
1228 |
+
opacity: 1;
|
1229 |
+
}
|
1230 |
+
|
1231 |
+
.ffwd-access-token-missing {
|
1232 |
+
margin: 10px 0 50px 0;
|
1233 |
+
line-height: 17px;
|
1234 |
+
font-size: 13px;
|
1235 |
+
color: rgba(50, 58, 69, 1);
|
1236 |
+
}
|
1237 |
+
|
1238 |
+
.ffwd-access-token-missing p {
|
1239 |
+
margin: 0;
|
1240 |
+
}
|
facebook-feed-wd.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: 10Web Social Feed
|
5 |
* Plugin URI: https://10web.io/plugins/wordpress-facebook-feed/?utm_source=facebook_feed&utm_medium=free_plugin
|
6 |
* Description: 10Web Social Feed is a completely customizable, responsive solution to help you display your Facebook feed on your WordPress website.
|
7 |
-
* Version: 1.1.
|
8 |
* Author: 10Web
|
9 |
* Author URI: https://10web.io/plugins/?utm_source=facebook_feed&utm_medium=free_plugin
|
10 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -15,7 +15,7 @@ define( 'WD_FFWD_URL', plugins_url( plugin_basename( dirname( __FILE__ ) ) ) );
|
|
15 |
define( 'WD_FB_PREFIX', 'ffwd' );
|
16 |
define( 'WD_FB_IS_FREE', TRUE );
|
17 |
if (! defined( 'FFWD_VERSION' ) ){
|
18 |
-
define ('FFWD_VERSION',"1.1.
|
19 |
}
|
20 |
add_action( 'admin_init', 'ffwd_init' );
|
21 |
|
@@ -95,32 +95,44 @@ function ffwd_silent_update(){
|
|
95 |
|
96 |
// Plugin menu.
|
97 |
function ffwd_menu_panel() {
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
'
|
118 |
-
'manage_options',
|
119 |
-
$
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
}
|
125 |
add_action( 'admin_menu', 'ffwd_menu_panel', 9);
|
126 |
|
@@ -573,7 +585,6 @@ function ffwd_activate() {
|
|
573 |
update_option('ffwd_autoupdate_time',$autoupdate_interval*60+$current_time);
|
574 |
|
575 |
|
576 |
-
delete_option("ffwd_uninstall");
|
577 |
global $wpdb;
|
578 |
$charset_collate = $wpdb->get_charset_collate();
|
579 |
$wd_fb_shortcode = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "wd_fb_shortcode` (
|
@@ -1090,6 +1101,35 @@ function wd_fb_update($from_plugin=0) {
|
|
1090 |
|
1091 |
}
|
1092 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1093 |
// Facebook Feed by 10Web Widget.
|
1094 |
if ( class_exists( 'WP_Widget' ) ) {
|
1095 |
add_action('wp_enqueue_scripts', 'ffwd_front_end_scripts');
|
4 |
* Plugin Name: 10Web Social Feed
|
5 |
* Plugin URI: https://10web.io/plugins/wordpress-facebook-feed/?utm_source=facebook_feed&utm_medium=free_plugin
|
6 |
* Description: 10Web Social Feed is a completely customizable, responsive solution to help you display your Facebook feed on your WordPress website.
|
7 |
+
* Version: 1.1.31
|
8 |
* Author: 10Web
|
9 |
* Author URI: https://10web.io/plugins/?utm_source=facebook_feed&utm_medium=free_plugin
|
10 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
15 |
define( 'WD_FB_PREFIX', 'ffwd' );
|
16 |
define( 'WD_FB_IS_FREE', TRUE );
|
17 |
if (! defined( 'FFWD_VERSION' ) ){
|
18 |
+
define ('FFWD_VERSION',"1.1.31");
|
19 |
}
|
20 |
add_action( 'admin_init', 'ffwd_init' );
|
21 |
|
95 |
|
96 |
// Plugin menu.
|
97 |
function ffwd_menu_panel() {
|
98 |
+
if(empty(get_option('ffwd_pages_list'))){
|
99 |
+
$parent_slug = "options_ffwd";
|
100 |
+
add_menu_page('Facebook Feed', 'Facebook Feed', 'manage_options', $parent_slug, 'ffwd_menu', WD_FFWD_URL . '/images/ffwd/ffwd_logo_small.png');
|
101 |
+
$galleries_page = add_submenu_page($parent_slug, 'Options', 'Options', 'manage_options', 'options_ffwd', 'ffwd_menu');
|
102 |
+
add_action('admin_print_styles-' . $galleries_page, 'ffwd_styles');
|
103 |
+
add_action('admin_print_scripts-' . $galleries_page, 'ffwd_scripts');
|
104 |
+
add_action('load-' . $galleries_page, 'ffwd_add_themes_per_page_option');
|
105 |
+
$uninstall_page = add_submenu_page($parent_slug, 'Uninstall', 'Uninstall', 'manage_options', 'uninstall_ffwd', 'ffwd_menu');
|
106 |
+
add_action('admin_print_styles-' . $uninstall_page, 'ffwd_styles');
|
107 |
+
add_action('admin_print_scripts-' . $uninstall_page, 'ffwd_admin_scripts');
|
108 |
+
} else {
|
109 |
+
$parent_slug = "info_ffwd";
|
110 |
+
add_menu_page('Facebook Feed', 'Facebook Feed', 'manage_options', $parent_slug, 'ffwd_menu', WD_FFWD_URL . '/images/ffwd/ffwd_logo_small.png');
|
111 |
+
$galleries_page = add_submenu_page($parent_slug, 'Feeds', 'Feeds', 'manage_options', 'info_ffwd', 'ffwd_menu');
|
112 |
+
add_action('admin_print_styles-' . $galleries_page, 'ffwd_styles');
|
113 |
+
add_action('admin_print_scripts-' . $galleries_page, 'ffwd_scripts');
|
114 |
+
add_action('load-' . $galleries_page, 'ffwd_add_ffwd_info_per_page_option');
|
115 |
+
$options_page = add_submenu_page($parent_slug, 'Options', 'Options', 'manage_options', 'options_ffwd', 'ffwd_menu');
|
116 |
+
add_action('admin_print_styles-' . $options_page, 'ffwd_styles');
|
117 |
+
add_action('admin_print_scripts-' . $options_page, 'ffwd_admin_scripts');
|
118 |
+
$themes_page = add_submenu_page($parent_slug, 'Themes', 'Themes', 'manage_options', 'themes_ffwd', 'ffwd_menu');
|
119 |
+
add_action('admin_print_styles-' . $themes_page, 'ffwd_styles');
|
120 |
+
add_action('admin_print_scripts-' . $themes_page, 'ffwd_admin_scripts');
|
121 |
+
add_action('load-' . $themes_page, 'ffwd_add_themes_per_page_option');
|
122 |
+
$licensing_page = add_submenu_page($parent_slug, 'Get Premium', 'Get Premium', 'manage_options', 'ffwd_licensing', 'ffwd_licensing_page');
|
123 |
+
add_action('admin_print_styles-' . $licensing_page, 'ffwd_styles');
|
124 |
+
/* Custom link to wordpress.org*/
|
125 |
+
global $submenu;
|
126 |
+
$url = 'https://wordpress.org/support/plugin/wd-facebook-feed/#new-post';
|
127 |
+
$submenu[$parent_slug][] = array(
|
128 |
+
'<div id="ffwd_ask_question">' . __('Ask a question', 'ffwd_menu') . '</div>',
|
129 |
+
'manage_options',
|
130 |
+
$url,
|
131 |
+
);
|
132 |
+
$uninstall_page = add_submenu_page($parent_slug, 'Uninstall', 'Uninstall', 'manage_options', 'uninstall_ffwd', 'ffwd_menu');
|
133 |
+
add_action('admin_print_styles-' . $uninstall_page, 'ffwd_styles');
|
134 |
+
add_action('admin_print_scripts-' . $uninstall_page, 'ffwd_admin_scripts');
|
135 |
+
}
|
136 |
}
|
137 |
add_action( 'admin_menu', 'ffwd_menu_panel', 9);
|
138 |
|
585 |
update_option('ffwd_autoupdate_time',$autoupdate_interval*60+$current_time);
|
586 |
|
587 |
|
|
|
588 |
global $wpdb;
|
589 |
$charset_collate = $wpdb->get_charset_collate();
|
590 |
$wd_fb_shortcode = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "wd_fb_shortcode` (
|
1101 |
|
1102 |
}
|
1103 |
|
1104 |
+
// Check Valid Token and show message
|
1105 |
+
$ffwd_token_error_flag = get_option("ffwd_token_error_flag");
|
1106 |
+
$ffwd_option_reauth_success = ((isset($_GET['success'])) ? $_GET["success"] : '');
|
1107 |
+
if($ffwd_token_error_flag === "1" || $ffwd_option_reauth_success!=""){
|
1108 |
+
add_action('admin_notices', 'ffwd_token_error_flag_notice');
|
1109 |
+
}
|
1110 |
+
|
1111 |
+
function ffwd_token_error_flag_notice(){
|
1112 |
+
global $ffwd_token_error_flag, $ffwd_option_reauth_success;
|
1113 |
+
$screen_base = get_current_screen()->base;
|
1114 |
+
if($ffwd_token_error_flag === "1"){
|
1115 |
+
if($screen_base === "dashboard" || $screen_base === "toplevel_page_info_ffwd" || $screen_base === "facebook-feed_page_options_ffwd" || $screen_base === "facebook-feed_page_themes_ffwd" || $screen_base === "facebook-feed_page_uninstall_ffwd" || $screen_base === "facebook-feed_page_ffwd_licensing" ){
|
1116 |
+
$link_to_reset = "<a href='".site_url()."/wp-admin/admin.php?page=options_ffwd' >reset token</a>";
|
1117 |
+
if($screen_base === "facebook-feed_page_options_ffwd"){
|
1118 |
+
$link_to_reset = "reset token";
|
1119 |
+
}
|
1120 |
+
echo "<div class='notice notice-error'><p>Facebook token is invalid or expired. Please ". $link_to_reset ." and sign-in again to get new one.</p></div>";
|
1121 |
+
}
|
1122 |
+
}
|
1123 |
+
if($screen_base === "facebook-feed_page_options_ffwd" && $ffwd_option_reauth_success !=""){
|
1124 |
+
if($ffwd_option_reauth_success==1){
|
1125 |
+
echo "<div class='notice notice-success'><p>The Access Token Successfully saved.</p></div>";
|
1126 |
+
}
|
1127 |
+
else{
|
1128 |
+
echo "<div class='notice notice-error'><p>Something wrong. Please try again.</p></div>";
|
1129 |
+
}
|
1130 |
+
}
|
1131 |
+
}
|
1132 |
+
|
1133 |
// Facebook Feed by 10Web Widget.
|
1134 |
if ( class_exists( 'WP_Widget' ) ) {
|
1135 |
add_action('wp_enqueue_scripts', 'ffwd_front_end_scripts');
|
framework/WDFacebookFeed.php
CHANGED
@@ -742,30 +742,39 @@ $ffwd_info_options[$ffwd_option_db] =((isset($_POST[$ffwd_option_db])) ? sanitiz
|
|
742 |
);
|
743 |
|
744 |
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
if (self::$auto_update_feed == 1) {
|
749 |
-
global $wpdb;
|
750 |
-
|
751 |
-
$id = self::$fb_id;
|
752 |
-
$update_ids = array();
|
753 |
-
$rows = $wpdb->get_results($wpdb->prepare('SELECT object_id,id FROM ' . $wpdb->prefix . 'wd_fb_data WHERE fb_id="%d" ORDER BY `created_time_number` ASC ', $id));
|
754 |
-
foreach ($rows as $row) {
|
755 |
-
$update_ids[$row->object_id] = $row->id;
|
756 |
-
}
|
757 |
-
$fb_graph_url_update = str_replace(
|
758 |
-
array('{FB_ID}', '{EDGE}', '{ACCESS_TOKEN}', '{FIELDS}', '{LIMIT}', '{OTHER}'),
|
759 |
-
|
760 |
-
array('', '', 'ids=' . implode(',', array_keys($update_ids)) . '&access_token=' . self::$access_token . '&', $fields, 'locale=' . get_locale() . '&', ''),
|
761 |
-
self::$graph_url
|
762 |
-
);
|
763 |
-
|
764 |
-
$update_data = self::decap_do_curl($fb_graph_url_update);
|
765 |
-
self::update_wd_fb_data($update_data, $update_ids);
|
766 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
767 |
}
|
768 |
|
|
|
769 |
|
770 |
$data['data'] = self::complite_timeline($fb_graph_url);
|
771 |
self::$data = $data;
|
@@ -1026,15 +1035,28 @@ $ffwd_info_options[$ffwd_option_db] =((isset($_POST[$ffwd_option_db])) ? sanitiz
|
|
1026 |
foreach ($rows as $row) {
|
1027 |
$update_ids[$row->object_id] = $row->id;
|
1028 |
}
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1035 |
$update_data = self::decap_do_curl($fb_graph_url_update);
|
1036 |
-
self::update_wd_fb_data($update_data, $
|
1037 |
-
|
1038 |
}
|
1039 |
$data = self::decap_do_curl($fb_graph_url);
|
1040 |
|
@@ -1271,6 +1293,7 @@ $ffwd_info_options[$ffwd_option_db] =((isset($_POST[$ffwd_option_db])) ? sanitiz
|
|
1271 |
'fb_page_id' =>$ffwd_info_options['fb_page_id'],
|
1272 |
), array(
|
1273 |
'%s',//name
|
|
|
1274 |
'%s',//type
|
1275 |
'%s',//content_type
|
1276 |
'%s',//content
|
@@ -1663,10 +1686,14 @@ $ffwd_info_options[$ffwd_option_db] =((isset($_POST[$ffwd_option_db])) ? sanitiz
|
|
1663 |
}
|
1664 |
$facebook_graph_results = json_decode($facebook_graph_results, true);
|
1665 |
if (array_key_exists("error", $facebook_graph_results)) {
|
|
|
1666 |
if ($facebook_graph_results['error']['code'] == 2) {
|
1667 |
return self::decap_do_curl($facebook_graph_url);
|
1668 |
}
|
1669 |
}
|
|
|
|
|
|
|
1670 |
/* if(isset($facebook_graph_results["error"]) && isset($facebook_graph_results["error"]['code']) && $facebook_graph_results["error"]['code']===190){
|
1671 |
if(self::$exist_access){
|
1672 |
$fb_option_data = self::get_fb_option_data();
|
@@ -1736,6 +1763,7 @@ $ffwd_info_options[$ffwd_option_db] =((isset($_POST[$ffwd_option_db])) ? sanitiz
|
|
1736 |
|
1737 |
update_option('ffwd_pages_list', $datas);
|
1738 |
update_option("ffwd_pages_list_success", "1");
|
|
|
1739 |
self::update_access_tokens();
|
1740 |
|
1741 |
}
|
@@ -1784,6 +1812,7 @@ $ffwd_info_options[$ffwd_option_db] =((isset($_POST[$ffwd_option_db])) ? sanitiz
|
|
1784 |
$pages = json_decode($response['body']);
|
1785 |
update_option('ffwd_pages_list', $pages->data);
|
1786 |
update_option("ffwd_pages_list_success", "1");
|
|
|
1787 |
self::update_access_tokens();
|
1788 |
return true;
|
1789 |
}
|
742 |
);
|
743 |
|
744 |
|
745 |
+
if (self::$auto_update_feed == 1) {
|
746 |
+
global $wpdb;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
747 |
|
748 |
+
$id = self::$fb_id;
|
749 |
+
$update_ids = array();
|
750 |
+
$rows = $wpdb->get_results($wpdb->prepare('SELECT object_id,id FROM ' . $wpdb->prefix . 'wd_fb_data WHERE fb_id="%d" ORDER BY `created_time_number` ASC ', $id));
|
751 |
+
foreach ($rows as $row) {
|
752 |
+
$update_ids[$row->object_id] = $row->id;
|
753 |
+
}
|
754 |
+
/* max ids count for endpoint is 50 */
|
755 |
+
$update_ids_parts = array_chunk($update_ids, 50, true);
|
756 |
+
foreach ( $update_ids_parts as $update_ids_part ) {
|
757 |
+
$update_ids = implode(',', array_keys($update_ids_part));
|
758 |
+
$fb_graph_url_update = str_replace(array(
|
759 |
+
'{FB_ID}',
|
760 |
+
'{EDGE}',
|
761 |
+
'{ACCESS_TOKEN}',
|
762 |
+
'{FIELDS}',
|
763 |
+
'{LIMIT}',
|
764 |
+
'{OTHER}'
|
765 |
+
), array(
|
766 |
+
'',
|
767 |
+
'',
|
768 |
+
'ids=' . $update_ids . '&access_token=' . self::$access_token . '&',
|
769 |
+
$fields,
|
770 |
+
'locale=' . get_locale() . '&',
|
771 |
+
''
|
772 |
+
), self::$graph_url);
|
773 |
+
$update_data = self::decap_do_curl($fb_graph_url_update);
|
774 |
+
self::update_wd_fb_data($update_data, $update_ids_part);
|
775 |
}
|
776 |
|
777 |
+
}
|
778 |
|
779 |
$data['data'] = self::complite_timeline($fb_graph_url);
|
780 |
self::$data = $data;
|
1035 |
foreach ($rows as $row) {
|
1036 |
$update_ids[$row->object_id] = $row->id;
|
1037 |
}
|
1038 |
+
/* max ids count for endpoint is 50 */
|
1039 |
+
$update_ids_parts = array_chunk($update_ids, 50, true);
|
1040 |
+
foreach ( $update_ids_parts as $update_ids_part ) {
|
1041 |
+
$update_ids = implode(',', array_keys($update_ids_part));
|
1042 |
+
$fb_graph_url_update = str_replace(array(
|
1043 |
+
'{FB_ID}',
|
1044 |
+
'{EDGE}',
|
1045 |
+
'{ACCESS_TOKEN}',
|
1046 |
+
'{FIELDS}',
|
1047 |
+
'{LIMIT}',
|
1048 |
+
'{OTHER}'
|
1049 |
+
), array(
|
1050 |
+
'',
|
1051 |
+
'',
|
1052 |
+
'ids=' . $update_ids . '&access_token=' . self::$access_token . '&',
|
1053 |
+
$fields,
|
1054 |
+
'locale=' . get_locale() . '&',
|
1055 |
+
''
|
1056 |
+
), self::$graph_url);
|
1057 |
$update_data = self::decap_do_curl($fb_graph_url_update);
|
1058 |
+
self::update_wd_fb_data($update_data, $update_ids_part);
|
1059 |
+
}
|
1060 |
}
|
1061 |
$data = self::decap_do_curl($fb_graph_url);
|
1062 |
|
1293 |
'fb_page_id' =>$ffwd_info_options['fb_page_id'],
|
1294 |
), array(
|
1295 |
'%s',//name
|
1296 |
+
'%s',//page_access_token
|
1297 |
'%s',//type
|
1298 |
'%s',//content_type
|
1299 |
'%s',//content
|
1686 |
}
|
1687 |
$facebook_graph_results = json_decode($facebook_graph_results, true);
|
1688 |
if (array_key_exists("error", $facebook_graph_results)) {
|
1689 |
+
update_option('ffwd_token_error_flag', "1");
|
1690 |
if ($facebook_graph_results['error']['code'] == 2) {
|
1691 |
return self::decap_do_curl($facebook_graph_url);
|
1692 |
}
|
1693 |
}
|
1694 |
+
else {
|
1695 |
+
update_option('ffwd_token_error_flag', "0");
|
1696 |
+
}
|
1697 |
/* if(isset($facebook_graph_results["error"]) && isset($facebook_graph_results["error"]['code']) && $facebook_graph_results["error"]['code']===190){
|
1698 |
if(self::$exist_access){
|
1699 |
$fb_option_data = self::get_fb_option_data();
|
1763 |
|
1764 |
update_option('ffwd_pages_list', $datas);
|
1765 |
update_option("ffwd_pages_list_success", "1");
|
1766 |
+
update_option('ffwd_token_error_flag', "0");
|
1767 |
self::update_access_tokens();
|
1768 |
|
1769 |
}
|
1812 |
$pages = json_decode($response['body']);
|
1813 |
update_option('ffwd_pages_list', $pages->data);
|
1814 |
update_option("ffwd_pages_list_success", "1");
|
1815 |
+
update_option('ffwd_token_error_flag', "0");
|
1816 |
self::update_access_tokens();
|
1817 |
return true;
|
1818 |
}
|
frontend/views/FFWDViewBlog_style.php
CHANGED
@@ -176,6 +176,7 @@ class FFWDViewBlog_style {
|
|
176 |
box-shadow: <?php echo $theme_row->blog_style_box_shadow; ?>;
|
177 |
margin: 0;
|
178 |
box-sizing: border-box;
|
|
|
179 |
border-width: <?php echo $theme_row->blog_style_border_width; ?>px;
|
180 |
border-<?php echo ($theme_row->blog_style_border_type != 'all') ? $theme_row->blog_style_border_type . '-' : ''; ?>style: <?php echo $theme_row->blog_style_border_style; ?>;
|
181 |
border-color: #<?php echo $theme_row->blog_style_border_color; ?>;
|
176 |
box-shadow: <?php echo $theme_row->blog_style_box_shadow; ?>;
|
177 |
margin: 0;
|
178 |
box-sizing: border-box;
|
179 |
+
border-radius: <?php echo $theme_row->blog_style_border_radius; ?>px;
|
180 |
border-width: <?php echo $theme_row->blog_style_border_width; ?>px;
|
181 |
border-<?php echo ($theme_row->blog_style_border_type != 'all') ? $theme_row->blog_style_border_type . '-' : ''; ?>style: <?php echo $theme_row->blog_style_border_style; ?>;
|
182 |
border-color: #<?php echo $theme_row->blog_style_border_color; ?>;
|
js/ffwd_embed.js
DELETED
@@ -1,455 +0,0 @@
|
|
1 |
-
/*server side analogue is function display_embed in WDWLibraryEmbed*/
|
2 |
-
/*params
|
3 |
-
embed_type: string , one of predefined accepted types
|
4 |
-
embed_id: string, id of media in corresponding host, or url if no unique id system is defined for host
|
5 |
-
attrs: object with html attributes and values format e.g. {width:'100px', style:"display:inline;"}
|
6 |
-
*/
|
7 |
-
|
8 |
-
function spider_display_embed(embed_type, file_url, embed_id, attrs){
|
9 |
-
|
10 |
-
var html_to_insert = '';
|
11 |
-
|
12 |
-
switch(embed_type) {
|
13 |
-
case 'EMBED_OEMBED_YOUTUBE_VIDEO':
|
14 |
-
var oembed_youtube_html ='<iframe ';
|
15 |
-
if(embed_id!=''){
|
16 |
-
oembed_youtube_html += ' src="' + '//www.youtube.com/embed/'+embed_id + '?enablejsapi=1&wmode=transparent"';
|
17 |
-
}
|
18 |
-
for (attr in attrs) {
|
19 |
-
if(!(/src/i).test(attr)){
|
20 |
-
if(attr != '' && attrs[attr] != ''){
|
21 |
-
oembed_youtube_html += ' '+ attr + '="'+ attrs[attr] + '"';
|
22 |
-
}
|
23 |
-
}
|
24 |
-
}
|
25 |
-
oembed_youtube_html += " ></iframe>";
|
26 |
-
html_to_insert += oembed_youtube_html;
|
27 |
-
|
28 |
-
break;
|
29 |
-
case 'EMBED_OEMBED_VIMEO_VIDEO':
|
30 |
-
var oembed_vimeo_html ='<iframe ';
|
31 |
-
if(embed_id!=''){
|
32 |
-
oembed_vimeo_html += ' src="' + '//player.vimeo.com/video/'+embed_id + '?enablejsapi=1"';
|
33 |
-
}
|
34 |
-
for (attr in attrs) {
|
35 |
-
if(!(/src/i).test(attr)){
|
36 |
-
if(attr != '' && attrs[attr] != ''){
|
37 |
-
oembed_vimeo_html += ' '+ attr + '="'+ attrs[attr] + '"';
|
38 |
-
}
|
39 |
-
}
|
40 |
-
}
|
41 |
-
oembed_vimeo_html += " ></iframe>";
|
42 |
-
html_to_insert += oembed_vimeo_html;
|
43 |
-
|
44 |
-
break;
|
45 |
-
case 'EMBED_OEMBED_FLICKR_IMAGE':
|
46 |
-
|
47 |
-
var oembed_flickr_html ='<div ';
|
48 |
-
for (attr in attrs) {
|
49 |
-
if(!(/src/i).test(attr)){
|
50 |
-
if(attr != '' && attrs[attr] != ''){
|
51 |
-
oembed_flickr_html += ' '+ attr + '="'+ attrs[attr] + '"';
|
52 |
-
}
|
53 |
-
}
|
54 |
-
}
|
55 |
-
oembed_flickr_html += " >";
|
56 |
-
if(embed_id!=''){
|
57 |
-
|
58 |
-
oembed_flickr_html += '<img src="'+embed_id+'"'+
|
59 |
-
' style="'+
|
60 |
-
'max-width:'+'100%'+" !important"+
|
61 |
-
'; max-height:'+'100%'+" !important"+
|
62 |
-
'; width:'+'auto !important'+
|
63 |
-
'; height:'+ 'auto !important' +
|
64 |
-
';">';
|
65 |
-
|
66 |
-
|
67 |
-
}
|
68 |
-
|
69 |
-
oembed_flickr_html +="</div>";
|
70 |
-
|
71 |
-
html_to_insert += oembed_flickr_html;
|
72 |
-
break;
|
73 |
-
case 'EMBED_OEMBED_FLICKR_VIDEO':
|
74 |
-
/* code...*/
|
75 |
-
break;
|
76 |
-
|
77 |
-
case 'EMBED_OEMBED_INSTAGRAM_VIDEO':
|
78 |
-
var oembed_instagram_html ='<div ';
|
79 |
-
for (attr in attrs) {
|
80 |
-
if(!(/src/i).test(attr)){
|
81 |
-
if(attr != '' && attrs[attr] != ''){
|
82 |
-
oembed_instagram_html += ' '+ attr + '="'+ attrs[attr] + '"';
|
83 |
-
}
|
84 |
-
}
|
85 |
-
}
|
86 |
-
oembed_instagram_html += " >";
|
87 |
-
if(embed_id!=''){
|
88 |
-
|
89 |
-
/*oembed_instagram_html += '<iframe src="'+embed_id+'"'+
|
90 |
-
' style="'+
|
91 |
-
'max-width:'+'100%'+" !important"+
|
92 |
-
'; max-height:'+'100%'+" !important"+
|
93 |
-
'; width:'+'auto'+
|
94 |
-
'; height:'+ '100%' + " "+
|
95 |
-
'; margin:0;"'+
|
96 |
-
'frameborder="0" scrolling="no" allowtransparency="false"></iframe>';
|
97 |
-
*/
|
98 |
-
oembed_instagram_html += '<video style="width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;" controls>'+
|
99 |
-
'<source src="'+embed_id+
|
100 |
-
'" type="video/mp4"> Your browser does not support the video tag. </video>';
|
101 |
-
|
102 |
-
}
|
103 |
-
|
104 |
-
|
105 |
-
oembed_instagram_html +="</div>";
|
106 |
-
|
107 |
-
html_to_insert += oembed_instagram_html;
|
108 |
-
|
109 |
-
break;
|
110 |
-
|
111 |
-
case 'EMBED_OEMBED_INSTAGRAM_IMAGE':
|
112 |
-
var oembed_instagram_html ='<div ';
|
113 |
-
for (attr in attrs) {
|
114 |
-
if(!(/src/i).test(attr)){
|
115 |
-
if(attr != '' && attrs[attr] != ''){
|
116 |
-
oembed_instagram_html += ' '+ attr + '="'+ attrs[attr] + '"';
|
117 |
-
}
|
118 |
-
}
|
119 |
-
}
|
120 |
-
oembed_instagram_html += " >";
|
121 |
-
if(embed_id!=''){
|
122 |
-
|
123 |
-
oembed_instagram_html += '<img src="//instagram.com/p/'+embed_id+'/media/?size=l"'+
|
124 |
-
' style=" '+
|
125 |
-
'max-width:'+'100%'+" !important"+
|
126 |
-
'; max-height:'+'100%'+" !important"+
|
127 |
-
'; width:'+'auto'+
|
128 |
-
'; height:'+ '100%' +
|
129 |
-
';">';
|
130 |
-
}
|
131 |
-
oembed_instagram_html +="</div>";
|
132 |
-
|
133 |
-
html_to_insert += oembed_instagram_html;
|
134 |
-
|
135 |
-
break;
|
136 |
-
case 'EMBED_OEMBED_INSTAGRAM_POST':
|
137 |
-
var oembed_instagram_html ='<div ';
|
138 |
-
var id = '';
|
139 |
-
for (attr in attrs) {
|
140 |
-
if(!(/src/i).test(attr)){
|
141 |
-
if(attr != '' && attrs[attr] != ''){
|
142 |
-
oembed_instagram_html += ' '+ attr + '="'+ attrs[attr] + '"';
|
143 |
-
if(attr == 'CLASS' || attr =='class' || attr =='Class'){
|
144 |
-
obj_class = attrs[attr];
|
145 |
-
}
|
146 |
-
}
|
147 |
-
}
|
148 |
-
}
|
149 |
-
oembed_instagram_html += " >";
|
150 |
-
if(embed_id!=''){
|
151 |
-
|
152 |
-
oembed_instagram_html += '<iframe class="inner_instagram_iframe_'+obj_class+'" src="//instagr.am/p/'+embed_id+'/embed/?enablejsapi=1"'+
|
153 |
-
' style="'+
|
154 |
-
'max-width:'+'100%'+" !important"+
|
155 |
-
'; max-height:'+'100%'+" !important"+
|
156 |
-
'; width:'+'100%'+
|
157 |
-
'; height:'+ '100%' +
|
158 |
-
'; margin:0'+
|
159 |
-
'; display:table-cell; vertical-align:middle;"'+
|
160 |
-
'frameborder="0" scrolling="no" allowtransparency="false" allowfullscreen'+
|
161 |
-
'></iframe>';
|
162 |
-
}
|
163 |
-
|
164 |
-
oembed_instagram_html +="</div>";
|
165 |
-
|
166 |
-
html_to_insert += oembed_instagram_html;
|
167 |
-
|
168 |
-
break;
|
169 |
-
case 'EMBED_OEMBED_FACEBOOK_IMAGE':
|
170 |
-
var oembed_facebook_html ='<div ';
|
171 |
-
for (attr in attrs) {
|
172 |
-
if(!(/src/i).test(attr)){
|
173 |
-
if(attr != '' && attrs[attr] != ''){
|
174 |
-
oembed_facebook_html += ' '+ attr + '="'+ attrs[attr] + '"';
|
175 |
-
}
|
176 |
-
}
|
177 |
-
}
|
178 |
-
oembed_facebook_html += " >";
|
179 |
-
if(embed_id!=''){
|
180 |
-
oembed_facebook_html += '<img src="'+file_url+'"'+
|
181 |
-
' style=" '+
|
182 |
-
'max-width:'+'100%'+" !important"+
|
183 |
-
'; max-height:'+'100%'+" !important"+
|
184 |
-
'; width:'+'auto'+
|
185 |
-
'; height:'+ '100%' +
|
186 |
-
';">';
|
187 |
-
}
|
188 |
-
oembed_facebook_html +="</div>";
|
189 |
-
html_to_insert += oembed_facebook_html;
|
190 |
-
break;
|
191 |
-
case 'EMBED_OEMBED_FACEBOOK_VIDEO':
|
192 |
-
var oembed_facebook_video_html ='<div ';
|
193 |
-
for (attr in attrs) {
|
194 |
-
if(!(/src/i).test(attr)){
|
195 |
-
if(attr != '' && attrs[attr] != ''){
|
196 |
-
oembed_facebook_video_html += ' '+ attr + '="'+ attrs[attr] + '"';
|
197 |
-
}
|
198 |
-
}
|
199 |
-
}
|
200 |
-
oembed_facebook_video_html += " >";
|
201 |
-
if(embed_id!=''){
|
202 |
-
oembed_facebook_video_html += '<iframe src="https://www.facebook.com/video/embed?video_id='+file_url+'"' +
|
203 |
-
' style="'+
|
204 |
-
'max-width:'+'100%'+" !important"+
|
205 |
-
'; max-height:'+'100%'+" !important"+
|
206 |
-
'; width:'+'100%'+
|
207 |
-
'; height:'+ '100%' +
|
208 |
-
'; margin:0'+
|
209 |
-
'; display:table-cell; vertical-align:middle;"'+
|
210 |
-
'frameborder="0" scrolling="no" allowtransparency="false" allowfullscreen'+
|
211 |
-
'></iframe>';
|
212 |
-
}
|
213 |
-
oembed_facebook_video_html +="</div>";
|
214 |
-
html_to_insert += oembed_facebook_video_html;
|
215 |
-
break;
|
216 |
-
case 'EMBED_OEMBED_DAILYMOTION_VIDEO':
|
217 |
-
var oembed_dailymotion_html ='<iframe ';
|
218 |
-
if(embed_id!=''){
|
219 |
-
oembed_dailymotion_html += ' src="' + '//www.dailymotion.com/embed/video/'+embed_id + '?api=postMessage"';
|
220 |
-
}
|
221 |
-
for (attr in attrs) {
|
222 |
-
if(!(/src/i).test(attr)){
|
223 |
-
if(attr != '' && attrs[attr] != ''){
|
224 |
-
oembed_dailymotion_html += ' '+ attr + '="'+ attrs[attr] + '"';
|
225 |
-
}
|
226 |
-
}
|
227 |
-
}
|
228 |
-
oembed_dailymotion_html += " ></iframe>";
|
229 |
-
html_to_insert += oembed_dailymotion_html;
|
230 |
-
|
231 |
-
break;
|
232 |
-
case 'EMBED_OEMBED_IMGUR':
|
233 |
-
/*not working yet*/
|
234 |
-
var oembed_imgur_html ='<div ';
|
235 |
-
for (attr in attrs) {
|
236 |
-
if(!(/src/i).test(attr)){
|
237 |
-
if(attr != '' && attrs[attr] != ''){
|
238 |
-
oembed_instagram_html += ' '+ attr + '="'+ attrs[attr] + '"';
|
239 |
-
}
|
240 |
-
}
|
241 |
-
}
|
242 |
-
oembed_imgur_html += " >";
|
243 |
-
if(embed_id!=''){
|
244 |
-
|
245 |
-
oembed_imgur_html += '<img src="'+embed_id+'"'+
|
246 |
-
' style="'+
|
247 |
-
'max-width:'+'100%'+" !important"+
|
248 |
-
'; max-height:'+'100%'+" !important"+
|
249 |
-
'; width:'+'auto'+
|
250 |
-
'; height:'+ 'auto' + " !important"+
|
251 |
-
';">';
|
252 |
-
}
|
253 |
-
oembed_imgur_html +="</div>";
|
254 |
-
|
255 |
-
html_to_insert += oembed_imgur_html;
|
256 |
-
|
257 |
-
break;
|
258 |
-
default:
|
259 |
-
;
|
260 |
-
}
|
261 |
-
|
262 |
-
return html_to_insert;
|
263 |
-
|
264 |
-
}
|
265 |
-
/**
|
266 |
-
* @param from_popup: optional, true if from bulk embed popup, false(default) if from instagram gallery
|
267 |
-
* @return "ok" if adds instagram gallery, false if any error when adding instagram gallery
|
268 |
-
*/
|
269 |
-
|
270 |
-
|
271 |
-
function add_instagram_gallery(instagram_client_id, from_popup) {
|
272 |
-
|
273 |
-
from_popup = typeof from_popup !== 'undefined' ? from_popup : false;
|
274 |
-
|
275 |
-
/*if bulk_embed action*/
|
276 |
-
if(from_popup === true){
|
277 |
-
if (bwg_check_instagram_gallery_input(instagram_client_id, from_popup)){
|
278 |
-
return false;
|
279 |
-
}
|
280 |
-
var whole_post = '0';
|
281 |
-
if(jQuery("input[name=popup_instagram_post_gallery]:checked").val() == 1){
|
282 |
-
whole_post = '1';
|
283 |
-
};
|
284 |
-
|
285 |
-
var instagram_user = encodeURI(jQuery("#popup_instagram_gallery_source").val());
|
286 |
-
var autogallery_image_number = encodeURI(jQuery("#popup_instagram_image_number").val());
|
287 |
-
|
288 |
-
}
|
289 |
-
else{
|
290 |
-
if(!bwg_check_gallery_empty(false, true)){
|
291 |
-
return false;
|
292 |
-
}
|
293 |
-
/*check if there is problem with input*/
|
294 |
-
if (bwg_check_instagram_gallery_input(instagram_client_id, from_popup)){
|
295 |
-
return false;
|
296 |
-
}
|
297 |
-
var whole_post = '0';
|
298 |
-
if(jQuery("input[name=instagram_post_gallery]:checked").val() == 1){
|
299 |
-
whole_post = '1';
|
300 |
-
};
|
301 |
-
|
302 |
-
var instagram_user = encodeURI(jQuery("#gallery_source").val());
|
303 |
-
var update_flag = jQuery("input[name=update_flag]:checked").val();
|
304 |
-
var autogallery_image_number = encodeURI(jQuery("#autogallery_image_number").val());
|
305 |
-
}
|
306 |
-
jQuery('#bulk_embed').hide();
|
307 |
-
jQuery('#opacity_div').show();
|
308 |
-
jQuery('#loading_div').show();
|
309 |
-
|
310 |
-
/*prepare data for request*/
|
311 |
-
var filesValid = [];
|
312 |
-
var data = {
|
313 |
-
'action': 'addInstagramGallery',
|
314 |
-
'instagram_user': instagram_user,
|
315 |
-
'instagram_client_id': instagram_client_id,
|
316 |
-
'whole_post': whole_post,
|
317 |
-
'autogallery_image_number':autogallery_image_number,
|
318 |
-
'update_flag':update_flag,
|
319 |
-
'async':true
|
320 |
-
};
|
321 |
-
|
322 |
-
// get response data. Here we use the server as a proxy, since Cross-Origin Resource Sharing AJAX is forbidden.
|
323 |
-
jQuery.post(ajax_url, data, function(response) {
|
324 |
-
if(response == false){
|
325 |
-
|
326 |
-
alert('Error: cannot get response from the server.');
|
327 |
-
jQuery('#opacity_div').hide();
|
328 |
-
jQuery('#loading_div').hide();
|
329 |
-
if(from_popup){
|
330 |
-
jQuery('#bulk_embed').show();
|
331 |
-
}
|
332 |
-
return false;
|
333 |
-
}
|
334 |
-
else{
|
335 |
-
|
336 |
-
var index_start = response.indexOf("WD_delimiter_start");
|
337 |
-
var index_end = response.indexOf("WD_delimiter_end");
|
338 |
-
if(index_start == -1 || index_end == -1){
|
339 |
-
jQuery('#opacity_div').hide();
|
340 |
-
jQuery('#loading_div').hide();
|
341 |
-
if(from_popup){
|
342 |
-
jQuery('#bulk_embed').show();
|
343 |
-
}
|
344 |
-
return false;
|
345 |
-
}
|
346 |
-
|
347 |
-
/*filter out other echoed characters*/
|
348 |
-
/*18 is the length of "wd_delimiter_start"*/
|
349 |
-
response = response.substring(index_start+18,index_end);
|
350 |
-
response_JSON = jQuery.parseJSON(response);
|
351 |
-
|
352 |
-
if(!response_JSON ){
|
353 |
-
alert('There is some error. Cannot add Instagram gallery.');
|
354 |
-
jQuery('#opacity_div').hide();
|
355 |
-
jQuery('#loading_div').hide();
|
356 |
-
if(from_popup){
|
357 |
-
jQuery('#bulk_embed').show();
|
358 |
-
}
|
359 |
-
return false;
|
360 |
-
}
|
361 |
-
else{
|
362 |
-
if(response_JSON[0] == 'error'){
|
363 |
-
alert('Error: ' + jQuery.parseJSON(response)[1]);
|
364 |
-
jQuery('#opacity_div').hide();
|
365 |
-
jQuery('#loading_div').hide();
|
366 |
-
if(from_popup){
|
367 |
-
jQuery('#bulk_embed').show();
|
368 |
-
}
|
369 |
-
return false;
|
370 |
-
}
|
371 |
-
else{
|
372 |
-
var len = response_JSON.length;
|
373 |
-
for (var i=1; i<=len; i++) {
|
374 |
-
if(response_JSON[len-i]!= false){
|
375 |
-
filesValid.push(response_JSON[len-i]);
|
376 |
-
}
|
377 |
-
}
|
378 |
-
//console.log(filesValid);
|
379 |
-
bwg_add_image(filesValid);
|
380 |
-
if(!from_popup){
|
381 |
-
bwg_gallery_update_flag();
|
382 |
-
jQuery('#tr_instagram_gallery_add_button').hide();
|
383 |
-
}
|
384 |
-
|
385 |
-
jQuery('#opacity_div').hide();
|
386 |
-
jQuery('#loading_div').hide();
|
387 |
-
if(from_popup){
|
388 |
-
jQuery('.opacity_bulk_embed').hide();
|
389 |
-
}
|
390 |
-
return "ok";
|
391 |
-
}
|
392 |
-
|
393 |
-
}
|
394 |
-
|
395 |
-
}/*end of considering all cases*/
|
396 |
-
|
397 |
-
});
|
398 |
-
|
399 |
-
}
|
400 |
-
|
401 |
-
function add_facebook_gallery(mixed_gallery) {
|
402 |
-
if(mixed_gallery) {
|
403 |
-
//if mixed gallery is active
|
404 |
-
jQuery('#bulk_embed').hide();
|
405 |
-
jQuery('#opacity_div').show();
|
406 |
-
jQuery('#loading_div').show();
|
407 |
-
var album_url = jQuery('#popup_facebook_gallery_album_url').val();
|
408 |
-
var album_limit = jQuery('#popup_facebook_gallery_album_limit').val();
|
409 |
-
var content_type = jQuery('input[name="popup_facebook_gallery_album_content_type"]:checked').val();
|
410 |
-
}
|
411 |
-
else {
|
412 |
-
//if facebook gallery is active
|
413 |
-
var album_url = jQuery('#facebook_gallery_source').val();
|
414 |
-
var album_limit = jQuery('#facebook_gallery_image_limit').val();
|
415 |
-
var content_type = jQuery('input[name="facebook_content_type"]:checked').val();
|
416 |
-
|
417 |
-
if(content_type == '0')
|
418 |
-
content_type = 'regular';
|
419 |
-
else if(content_type == '1')
|
420 |
-
content_type = 'post';
|
421 |
-
}
|
422 |
-
|
423 |
-
jQuery('#bulk_embed').hide();
|
424 |
-
jQuery('#opacity_div').show();
|
425 |
-
jQuery('#loading_div').show();
|
426 |
-
|
427 |
-
var files = [];
|
428 |
-
var data = {
|
429 |
-
'action': 'addFacebookGallery',
|
430 |
-
'album_url': album_url,
|
431 |
-
'album_limit': album_limit,
|
432 |
-
'content_type': content_type
|
433 |
-
};
|
434 |
-
|
435 |
-
jQuery.post(
|
436 |
-
ajax_url,
|
437 |
-
data,
|
438 |
-
function(response) {
|
439 |
-
//console.log(response);
|
440 |
-
var response_JSON = jQuery.parseJSON(response);
|
441 |
-
|
442 |
-
if(response_JSON[0] == 'error'){
|
443 |
-
alert('Error: ' + response_JSON[1]);
|
444 |
-
jQuery('#opacity_div').hide();
|
445 |
-
jQuery('#loading_div').hide();
|
446 |
-
return '';
|
447 |
-
}
|
448 |
-
bwg_add_image(response_JSON);
|
449 |
-
}
|
450 |
-
).done(function() {
|
451 |
-
jQuery('#opacity_div').hide();
|
452 |
-
jQuery('#loading_div').hide();
|
453 |
-
jQuery('.opacity_bulk_embed').hide();
|
454 |
-
});
|
455 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: customizable facebook feed, facebook, facebook feed, facebook group, faceb
|
|
4 |
Requires at least: 3.4
|
5 |
Requires PHP: 5.2
|
6 |
Tested up to: 5.6
|
7 |
-
Stable tag: 1.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -104,6 +104,11 @@ If you think you found a bug in 10Web Facebook Feed or have any problem/question
|
|
104 |
The plugin uses Facebook API to get public data from Facebook. All the received data is cached in WordPress database for some short customizable period to provide optimization. You can delete or update cached data. You can optionally enable like button for Facebook page. If you do so, Facebook will load some JS and embedded content which may track visitors. Facebook embeds are regulated under terms of Facebook privacy policy https://www.facebook.com/policy.php.
|
105 |
|
106 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
107 |
= 1.1.30 =
|
108 |
* Fixed: Token autoupdate.
|
109 |
|
4 |
Requires at least: 3.4
|
5 |
Requires PHP: 5.2
|
6 |
Tested up to: 5.6
|
7 |
+
Stable tag: 1.1.31
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
104 |
The plugin uses Facebook API to get public data from Facebook. All the received data is cached in WordPress database for some short customizable period to provide optimization. You can delete or update cached data. You can optionally enable like button for Facebook page. If you do so, Facebook will load some JS and embedded content which may track visitors. Facebook embeds are regulated under terms of Facebook privacy policy https://www.facebook.com/policy.php.
|
105 |
|
106 |
== Changelog ==
|
107 |
+
= 1.1.31 =
|
108 |
+
* Fixed: Open settings page after activation.
|
109 |
+
* Fixed: Border radius in Blog style view.
|
110 |
+
* Fixed: Expired token issue.
|
111 |
+
|
112 |
= 1.1.30 =
|
113 |
* Fixed: Token autoupdate.
|
114 |
|