WD Facebook Feed – Custom Facebook Feed Plugin - Version 1.1.0

Version Description

  • **Important: Breaking change. Obtaining page access token is required to display your page content with Facebook Feed WD plugin. See the documentation.
  • Fixed: Error on PHP 7.2
  • Fixed: Notices when feed is unpublished
  • Changed: Deactivation popup
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 WD Facebook Feed – Custom Facebook Feed Plugin
Version 1.1.0
Comparing to
See all releases

Code changes from version 1.0.38 to 1.1.0

admin/controllers/FFWDControllerOptions_ffwd.php CHANGED
@@ -49,7 +49,7 @@ class FFWDControllerOptions_ffwd {
49
 
50
  require_once WD_FFWD_DIR . "/admin/views/FFWDViewOptions_ffwd.php";
51
  $view = new FFWDViewOptions_ffwd($model);
52
- echo WDW_FFWD_Library::message('Changes must be saved.', 'error');
53
  $view->display(true);
54
  }
55
 
@@ -101,6 +101,20 @@ class FFWDControllerOptions_ffwd {
101
  }
102
  }
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  ////////////////////////////////////////////////////////////////////////////////////////
105
  // Getters & Setters //
106
  ////////////////////////////////////////////////////////////////////////////////////////
49
 
50
  require_once WD_FFWD_DIR . "/admin/views/FFWDViewOptions_ffwd.php";
51
  $view = new FFWDViewOptions_ffwd($model);
52
+ echo WDW_FFWD_Library::message('Settings successfully reset', 'updated');
53
  $view->display(true);
54
  }
55
 
101
  }
102
  }
103
 
104
+ public function save_app_keys($facebook_app_id, $facebook_app_secret){
105
+ global $wpdb;
106
+
107
+ if(empty($facebook_app_id) || empty($facebook_app_secret)){
108
+ return false;
109
+ }
110
+
111
+ $save = $wpdb->update($wpdb->prefix . 'wd_fb_option', array(
112
+ 'app_id' => $facebook_app_id,
113
+ 'app_secret' => $facebook_app_secret,
114
+ ), array('id' => 1));
115
+
116
+ return ($save !== false);
117
+ }
118
  ////////////////////////////////////////////////////////////////////////////////////////
119
  // Getters & Setters //
120
  ////////////////////////////////////////////////////////////////////////////////////////
admin/models/FFWDModelOptions_ffwd.php CHANGED
@@ -266,6 +266,15 @@ class FFWDModelOptions_ffwd {
266
  $row->page_plugin_cover = 1;
267
  $row->page_plugin_header = 0;
268
  $row->page_plugin_width = 380;
 
 
 
 
 
 
 
 
 
269
  }
270
  return $row;
271
  }
266
  $row->page_plugin_cover = 1;
267
  $row->page_plugin_header = 0;
268
  $row->page_plugin_width = 380;
269
+
270
+ $wpdb->update($wpdb->prefix . 'wd_fb_option', array(
271
+ 'autoupdate_interval' => $row->autoupdate_interval,
272
+ 'app_id' => $row->app_id,
273
+ 'app_secret' => $row->app_secret,
274
+ 'date_timezone' => $row->date_timezone,
275
+ 'post_date_format' => $row->post_date_format,
276
+ 'event_date_format' =>$row->event_date_format,
277
+ ), array('id' => 1));
278
  }
279
  return $row;
280
  }
admin/models/FFWDModelUninstall_ffwd.php CHANGED
@@ -32,6 +32,7 @@ class FFWDModelUninstall_ffwd
32
  delete_option("ffwd_version");
33
  //delete_option("ffwd_subscribe_done");
34
  delete_option('wds_bk_notice_status');
 
35
  add_option('ffwd_uninstall', '1');
36
 
37
  }
32
  delete_option("ffwd_version");
33
  //delete_option("ffwd_subscribe_done");
34
  delete_option('wds_bk_notice_status');
35
+ delete_option('ffwd_old_version');
36
  add_option('ffwd_uninstall', '1');
37
 
38
  }
admin/views/FFWDViewInfo_ffwd.php CHANGED
@@ -299,9 +299,15 @@ class FFWDViewInfo_ffwd
299
  $fb_glob_optons = $this->model->get_option_row_data();
300
  $page_title = (($id != 0) ? 'Edit Facebook Feed WD ' . $row->name : 'Create new Facebook Feed WD');
301
  $type = $row->type;
 
 
 
302
  $content_url = $row->content_url;
303
  $disabled = ($id != 0) ? 'disabled' : '';
304
 
 
 
 
305
  $effects = array(
306
  'none' => 'None',
307
  'fade' => 'Fade',
@@ -627,11 +633,11 @@ class FFWDViewInfo_ffwd
627
 
628
  <div class="ffwd_butts_c" style="float:right;">
629
  <input class=" ffwd-button-primary ffwd-button-save" type="button"
630
- onclick="if (spider_check_required('name', 'Name'))return false;
631
  spider_set_input_value('task', 'save');
632
  spider_ajax_save('<?php echo WD_FB_PREFIX; ?>');" value="Save"/>
633
  <input class=" ffwd-button-primary ffwd-button-apply" type="button"
634
- onclick="if (spider_check_required('name', 'Name')) return false;
635
  spider_set_input_value('task', 'apply');
636
  spider_ajax_save('<?php echo WD_FB_PREFIX; ?>');" value="Apply"/>
637
  <input class=" ffwd-button-secondary ffwd-button-cancel" type="submit" onclick="spider_set_input_value('page_number', '1');
@@ -680,11 +686,11 @@ class FFWDViewInfo_ffwd
680
  </tr>
681
  <tr>
682
  <td class="ffwd_set_l">
683
- <label for="page_access_token">Page access token: </label>
684
  </td>
685
  <td>
686
  <input type="text" id="page_access_token" name="page_access_token" value="<?php echo $row->page_access_token; ?>" size="39"/>
687
- <p class="description">Use this <a target="_blank" href="https://web-dorado.com/wordpress-facebook-feed/options.html">tutorial</a> to get page access token. If you do not use page access token, built-in tokens will be used instead, which may cause API rate limit errors.</p>
688
  </td>
689
  </tr>
690
  </tbody>
@@ -731,7 +737,7 @@ class FFWDViewInfo_ffwd
731
  style="display:<?php echo($type == 'page' ? 'table-row-group' : 'none'); ?>;">
732
  <tr>
733
  <td class="ffwd_set_l"><label for="<?php echo WD_FB_PREFIX; ?>_page_url">Page
734
- url: </label></td>
735
  <td style="margin-bottom:15px"><input type="text"
736
  id="<?php echo WD_FB_PREFIX; ?>_page_url"
737
  name="<?php echo WD_FB_PREFIX; ?>_page_url"
@@ -2046,7 +2052,7 @@ class FFWDViewInfo_ffwd
2046
  <table class="ffwd_sett_tabl">
2047
  <tr>
2048
  <td class="ffwd_set_l">
2049
- <label>Show place(street):</label>
2050
  </td>
2051
  <td class="ffwd_set_i">
2052
  <input type="radio" name="<?php echo WD_FB_PREFIX; ?>_event_street"
@@ -2060,7 +2066,7 @@ class FFWDViewInfo_ffwd
2060
  <div class="spider_description"></div>
2061
  </td>
2062
  </tr>
2063
- <tr>
2064
  <td class="ffwd_set_l">
2065
  <label>Show place(city):</label>
2066
  </td>
@@ -2123,7 +2129,7 @@ class FFWDViewInfo_ffwd
2123
  for="<?php echo WD_FB_PREFIX; ?>_event_map_0">No</label>
2124
  <div class="spider_description"></div>
2125
  </td>
2126
- </tr>
2127
  <tr>
2128
  <td class="ffwd_set_l">
2129
  <label>Show date:</label>
299
  $fb_glob_optons = $this->model->get_option_row_data();
300
  $page_title = (($id != 0) ? 'Edit Facebook Feed WD ' . $row->name : 'Create new Facebook Feed WD');
301
  $type = $row->type;
302
+ if($type != 'profile' || $type != 'group' ){
303
+ $type = 'page';
304
+ }
305
  $content_url = $row->content_url;
306
  $disabled = ($id != 0) ? 'disabled' : '';
307
 
308
+ //var_dump($required_secret);
309
+ $required_secret = ($fb_glob_optons->app_id == "" || $fb_glob_optons->app_secret == "") ? "1" : "0";
310
+
311
  $effects = array(
312
  'none' => 'None',
313
  'fade' => 'Fade',
633
 
634
  <div class="ffwd_butts_c" style="float:right;">
635
  <input class=" ffwd-button-primary ffwd-button-save" type="button"
636
+ onclick="if(<?php echo $required_secret; ?>){alert('App ID and App Secret are required. Please fill them first in plugin options.');return false;} if (spider_check_required('name', 'Name') || spider_check_required('page_access_token', 'Page access token') || spider_check_required('ffwd_page_url', 'Page url'))return false;
637
  spider_set_input_value('task', 'save');
638
  spider_ajax_save('<?php echo WD_FB_PREFIX; ?>');" value="Save"/>
639
  <input class=" ffwd-button-primary ffwd-button-apply" type="button"
640
+ onclick="if(<?php echo $required_secret; ?>){alert('App ID and App Secret are required. Please fill them first in plugin options.');return false;}if (spider_check_required('name', 'Name') || spider_check_required('page_access_token', 'Page access token') || spider_check_required('ffwd_page_url', 'Page url')) return false;
641
  spider_set_input_value('task', 'apply');
642
  spider_ajax_save('<?php echo WD_FB_PREFIX; ?>');" value="Apply"/>
643
  <input class=" ffwd-button-secondary ffwd-button-cancel" type="submit" onclick="spider_set_input_value('page_number', '1');
686
  </tr>
687
  <tr>
688
  <td class="ffwd_set_l">
689
+ <label for="page_access_token">Page access token: <span style="color:#FF0000;">*</span></label>
690
  </td>
691
  <td>
692
  <input type="text" id="page_access_token" name="page_access_token" value="<?php echo $row->page_access_token; ?>" size="39"/>
693
+ <p class="description">Use this <a target="_blank" href="https://web-dorado.com/wordpress-facebook-feed/options.html">tutorial</a> to get page access token.</p>
694
  </td>
695
  </tr>
696
  </tbody>
737
  style="display:<?php echo($type == 'page' ? 'table-row-group' : 'none'); ?>;">
738
  <tr>
739
  <td class="ffwd_set_l"><label for="<?php echo WD_FB_PREFIX; ?>_page_url">Page
740
+ url: <span style="color:#FF0000;">*</span></label></td>
741
  <td style="margin-bottom:15px"><input type="text"
742
  id="<?php echo WD_FB_PREFIX; ?>_page_url"
743
  name="<?php echo WD_FB_PREFIX; ?>_page_url"
2052
  <table class="ffwd_sett_tabl">
2053
  <tr>
2054
  <td class="ffwd_set_l">
2055
+ <label>Show place:</label>
2056
  </td>
2057
  <td class="ffwd_set_i">
2058
  <input type="radio" name="<?php echo WD_FB_PREFIX; ?>_event_street"
2066
  <div class="spider_description"></div>
2067
  </td>
2068
  </tr>
2069
+ <!--<tr>
2070
  <td class="ffwd_set_l">
2071
  <label>Show place(city):</label>
2072
  </td>
2129
  for="<?php echo WD_FB_PREFIX; ?>_event_map_0">No</label>
2130
  <div class="spider_description"></div>
2131
  </td>
2132
+ </tr>-->
2133
  <tr>
2134
  <td class="ffwd_set_l">
2135
  <label>Show date:</label>
admin/views/FFWDViewOptions_ffwd.php CHANGED
@@ -83,7 +83,7 @@ class FFWDViewOptions_ffwd
83
  return false;
84
  }" value="Reset all options"/>
85
  <input class="ffwd-button-primary ffwd-button-save" type="submit"
86
- onclick="if (spider_check_required('title', 'Title')) {return false;}; check_app('<?php echo WD_FB_PREFIX; ?>'); spider_set_input_value('task', 'save')"
87
  value="Save"/>
88
 
89
  </div>
@@ -96,7 +96,7 @@ class FFWDViewOptions_ffwd
96
  <tbody>
97
  <tr>
98
  <td class="spider_label_options">
99
- <label for="<?php echo WD_FB_PREFIX; ?>_app_id">Facebook app Id: </label>
100
  </td>
101
  <td>
102
  <input type="text" name="<?php echo WD_FB_PREFIX; ?>_app_id"
@@ -108,14 +108,14 @@ class FFWDViewOptions_ffwd
108
  </tr>
109
  <tr>
110
  <td class="spider_label_options">
111
- <label for="<?php echo WD_FB_PREFIX; ?>_app_secret">Facebook app Secret: </label>
112
  </td>
113
  <td>
114
  <input type="text" name="<?php echo WD_FB_PREFIX; ?>_app_secret"
115
  id="<?php echo WD_FB_PREFIX; ?>_app_secret" size="40"
116
  value="<?php echo isset($row->app_secret) ? $row->app_secret : ''; ?>" class=""
117
  onchange="if(wd_fb_log_in) alert('Before change app id and secret please logout from curent app.'); "/>
118
- <div class="spider_description">To get data from Facebook, you need app ID and app Secret. Create your app and get app ID and secret using this <a target="_blank" href="https://web-dorado.com/wordpress-facebook-feed/options.html">tutorial</a>. If you do not use custom app and page access tokens, built-in tokens will be used instead, which may cause API rate limit errors.</div>
119
  </td>
120
  </tr>
121
  <!--<tr>
83
  return false;
84
  }" value="Reset all options"/>
85
  <input class="ffwd-button-primary ffwd-button-save" type="submit"
86
+ onclick="if (spider_check_required('ffwd_app_id', 'Facebook app Id') || spider_check_required('ffwd_app_secret', 'Facebook app Secret')) {return false;}; check_app('<?php echo WD_FB_PREFIX; ?>','save'); spider_set_input_value('task', 'save')"
87
  value="Save"/>
88
 
89
  </div>
96
  <tbody>
97
  <tr>
98
  <td class="spider_label_options">
99
+ <label for="<?php echo WD_FB_PREFIX; ?>_app_id">Facebook app Id: <span style="color:#FF0000;">*</span> </label>
100
  </td>
101
  <td>
102
  <input type="text" name="<?php echo WD_FB_PREFIX; ?>_app_id"
108
  </tr>
109
  <tr>
110
  <td class="spider_label_options">
111
+ <label for="<?php echo WD_FB_PREFIX; ?>_app_secret">Facebook app Secret: <span style="color:#FF0000;">*</span> </label>
112
  </td>
113
  <td>
114
  <input type="text" name="<?php echo WD_FB_PREFIX; ?>_app_secret"
115
  id="<?php echo WD_FB_PREFIX; ?>_app_secret" size="40"
116
  value="<?php echo isset($row->app_secret) ? $row->app_secret : ''; ?>" class=""
117
  onchange="if(wd_fb_log_in) alert('Before change app id and secret please logout from curent app.'); "/>
118
+ <div class="spider_description">To get data from Facebook, you need app ID and app Secret. Create your app and get app ID and secret using this <a target="_blank" href="https://web-dorado.com/wordpress-facebook-feed/options.html">tutorial</a>.</div>
119
  </td>
120
  </tr>
121
  <!--<tr>
css/ffwd_tables.css CHANGED
@@ -66,6 +66,15 @@
66
  font-family: sans-serif;
67
  }
68
 
 
 
 
 
 
 
 
 
 
69
  .input_th {
70
  margin-left: 0px !important;
71
  width: 160px !important;
66
  font-family: sans-serif;
67
  }
68
 
69
+ #ffwd_keys_form *{
70
+ font-size: inherit;
71
+ }
72
+
73
+ #ffwd_keys_form input{
74
+ border-color: #ddd;
75
+ }
76
+
77
+
78
  .input_th {
79
  margin-left: 0px !important;
80
  width: 160px !important;
facebook-feed-wd.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: WD Facebook Feed
5
  * Plugin URI: https://web-dorado.com/products/wordpress-facebook-feed-plugin.html
6
  * Description:WD Facebook Feed is a completely customizable, responsive solution to help you display your Facebook feed on your WordPress website.
7
- * Version: 1.0.38
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -17,7 +17,7 @@ define( 'WD_FFWD_URL', plugins_url( plugin_basename( dirname( __FILE__ ) ) ) );
17
  define( 'WD_FFWD_PRO', true );
18
  define( 'WD_FB_PREFIX', 'ffwd' );
19
  if(! defined( 'FFWD_VERSION' ) ){
20
- define ('FFWD_VERSION',"1.0.38");
21
  }
22
 
23
 
@@ -46,9 +46,26 @@ if ( ffwd_use_home_url() ) {
46
  define( 'WD_FFWD_FRONT_URL', WD_FFWD_URL );
47
  }
48
 
 
 
 
 
 
 
 
 
49
  // Plugin menu.
50
  function ffwd_menu_panel() {
51
- $ffwd_uninstall = get_option("ffwd_uninstall");
 
 
 
 
 
 
 
 
 
52
  $parent_slug = null;
53
 
54
  if ( get_option( "ffwd_subscribe_done" ) == 1 || ( isset( $_GET["page"] ) && $_GET["page"] == "uninstall_ffwd" ) ) {
@@ -56,25 +73,29 @@ function ffwd_menu_panel() {
56
  if(isset($ffwd_uninstall) && $ffwd_uninstall ==="1"){
57
  $parent_slug = 'uninstall_ffwd';
58
  }
 
 
 
59
  $galleries_page = add_menu_page( 'Facebook Feed WD', 'Facebook Feed WD', 'manage_options', $parent_slug, 'ffwd_menu', WD_FFWD_URL . '/images/ffwd/ffwd_logo_small.png' );
60
 
61
  }
62
  if($ffwd_uninstall !=="1"){
63
- $galleries_page = add_submenu_page( $parent_slug, 'Feeds', 'Feeds', 'manage_options', 'info_ffwd', 'ffwd_menu' );
64
- add_action( 'admin_print_styles-' . $galleries_page, 'ffwd_styles' );
65
- add_action( 'admin_print_scripts-' . $galleries_page, 'ffwd_scripts' );
66
- add_action( 'load-' . $galleries_page, 'ffwd_add_ffwd_info_per_page_option' );
67
-
 
68
  $options_page = add_submenu_page( $parent_slug, 'Options', 'Options', 'manage_options', 'options_ffwd', 'ffwd_menu' );
69
  add_action( 'admin_print_styles-' . $options_page, 'ffwd_styles' );
70
  add_action( 'admin_print_scripts-' . $options_page, 'ffwd_admin_scripts' );
71
-
72
- $themes_page = add_submenu_page( $parent_slug, 'Themes', 'Themes', 'manage_options', 'themes_ffwd', 'ffwd_menu' );
73
- add_action( 'admin_print_styles-' . $themes_page, 'ffwd_styles' );
74
- add_action( 'admin_print_scripts-' . $themes_page, 'ffwd_admin_scripts' );
75
- add_action( 'load-' . $themes_page, 'ffwd_add_themes_per_page_option' );
76
-
77
- $licensing_page = add_submenu_page( $parent_slug, 'Buy Pro', 'Buy Pro', 'manage_options', 'ffwd_licensing', 'ffwd_licensing_page' );
78
  add_action( 'admin_print_styles-' . $licensing_page, 'ffwd_styles' );
79
  }
80
  $uninstall_page = add_submenu_page( '', 'Uninstall', 'Uninstall', 'manage_options', 'uninstall_ffwd', 'ffwd_menu' );
@@ -84,6 +105,70 @@ function ffwd_menu_panel() {
84
 
85
  add_action( 'admin_menu', 'ffwd_menu_panel' );
86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  add_action( 'init', 'ffwd_silently_update' );
88
 
89
 
@@ -278,18 +363,7 @@ function ffwd_menu() {
278
  }
279
  }
280
  $ffwd_limit_notice = get_option( 'ffwd_limit_notice' );
281
- if ( $ffwd_limit_notice == 1 ) {
282
- echo '<div style="width:99%">
283
- <div class="error">
284
- <p style="font-size:18px;"><strong>' . __( "If you are getting errors please go to options and fill in App ID and App Secret.", "ffwd" ) . '</strong></p>
285
- <p>' . __( "For getting App ID and App Secret read more in", "ffwd" ) . '
286
- <a href="https://web-dorado.com/wordpress-facebook-feed/options.html" target="_blank" style="color: #00A0D2;">' . __( "User Manual", "ffwd" ) . '</a>.
287
- </p>
288
- </div>
289
- </div>';
290
- }
291
-
292
-
293
  require_once( WD_FFWD_DIR . '/admin/controllers/FFWDController' . ( ( $page == 'FFWDShortcode' ) ? $page : ucfirst( strtolower( $page ) ) ) . '.php' );
294
  $controller_class = 'FFWDController' . ucfirst( strtolower( $page ) );
295
  $controller = new $controller_class();
@@ -463,6 +537,11 @@ add_filter( 'mce_buttons', 'ffwd_add_button', 0 );
463
 
464
  // Activate plugin.
465
  function ffwd_activate() {
 
 
 
 
 
466
  delete_option("ffwd_uninstall");
467
  global $wpdb;
468
  $wd_fb_shortcode = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "wd_fb_shortcode` (
@@ -829,7 +908,7 @@ function ffwd_admin_scripts() {
829
 
830
  wp_localize_script( 'ffwd-deactivate-popup', 'ffwdWDDeactivateVars', array(
831
  "prefix" => "ffwd" ,
832
- "deactivate_class" => '',
833
  "email" => $admin_data->data->user_email,
834
  "plugin_wd_url" => "https://web-dorado.com/products/wordpress-google-maps-plugin.html",
835
  ));
@@ -930,10 +1009,9 @@ function wd_fb_update($from_plugin=0) {
930
 
931
  $current_time=current_time('timestamp');
932
  $update_time=get_option('ffwd_autoupdate_time');
933
- $autoupdate_interval = 1440;//WDFacebookFeed::get_autoupdate_interval();
934
- if(!$update_time){
935
- update_option('ffwd_autoupdate_time',$autoupdate_interval*60+$current_time);
936
- }
937
 
938
  if(($current_time>=$update_time && $from_plugin) || !$from_plugin )
939
  {
@@ -952,7 +1030,11 @@ function wd_fb_update($from_plugin=0) {
952
  // Facebook feed wd Widget.
953
  if ( class_exists( 'WP_Widget' ) ) {
954
  require_once( WD_FFWD_DIR . '/admin/controllers/FFWDControllerWidget.php' );
955
- add_action( 'widgets_init', create_function( '', 'return register_widget("FFWDControllerWidget");' ) );
 
 
 
 
956
  }
957
 
958
  // Languages localization.
4
  * Plugin Name: WD Facebook Feed
5
  * Plugin URI: https://web-dorado.com/products/wordpress-facebook-feed-plugin.html
6
  * Description:WD Facebook Feed is a completely customizable, responsive solution to help you display your Facebook feed on your WordPress website.
7
+ * Version: 1.1.0
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
17
  define( 'WD_FFWD_PRO', true );
18
  define( 'WD_FB_PREFIX', 'ffwd' );
19
  if(! defined( 'FFWD_VERSION' ) ){
20
+ define ('FFWD_VERSION',"1.1.0");
21
  }
22
 
23
 
46
  define( 'WD_FFWD_FRONT_URL', WD_FFWD_URL );
47
  }
48
 
49
+ add_action('init', 'ffwd_silent_update');
50
+
51
+ function ffwd_silent_update(){
52
+ if (get_option('ffwd_old_version') === false && get_option('ffwd_version') !== false) {
53
+ add_option('ffwd_old_version', get_option('ffwd_version'));
54
+ }
55
+ }
56
+
57
  // Plugin menu.
58
  function ffwd_menu_panel() {
59
+ // global $wpdb;
60
+ // $required = true;
61
+ $ffwd_uninstall = get_option("ffwd_uninstall");
62
+ if($ffwd_uninstall !=="1"){
63
+ // $app_id = $wpdb->get_row($wpdb->prepare('SELECT app_id,app_secret FROM ' . $wpdb->prefix . 'wd_fb_option WHERE id="%d"', 1));
64
+ // $old_version = get_option('ffwd_old_version');
65
+ // $old_version = ($old_version !== false) ? substr($old_version, 2) : "0.0";
66
+ // $required = (($app_id->app_id == "" || $app_id->app_secret == "") && version_compare("1.0", $old_version, '<=')) ? false : true;
67
+ }
68
+
69
  $parent_slug = null;
70
 
71
  if ( get_option( "ffwd_subscribe_done" ) == 1 || ( isset( $_GET["page"] ) && $_GET["page"] == "uninstall_ffwd" ) ) {
73
  if(isset($ffwd_uninstall) && $ffwd_uninstall ==="1"){
74
  $parent_slug = 'uninstall_ffwd';
75
  }
76
+ // if(!$required){
77
+ // $parent_slug = 'options_ffwd';
78
+ // }
79
  $galleries_page = add_menu_page( 'Facebook Feed WD', 'Facebook Feed WD', 'manage_options', $parent_slug, 'ffwd_menu', WD_FFWD_URL . '/images/ffwd/ffwd_logo_small.png' );
80
 
81
  }
82
  if($ffwd_uninstall !=="1"){
83
+ // if($required){
84
+ $galleries_page = add_submenu_page( $parent_slug, 'Feeds', 'Feeds', 'manage_options', 'info_ffwd', 'ffwd_menu' );
85
+ add_action( 'admin_print_styles-' . $galleries_page, 'ffwd_styles' );
86
+ add_action( 'admin_print_scripts-' . $galleries_page, 'ffwd_scripts' );
87
+ add_action( 'load-' . $galleries_page, 'ffwd_add_ffwd_info_per_page_option' );
88
+ // }
89
  $options_page = add_submenu_page( $parent_slug, 'Options', 'Options', 'manage_options', 'options_ffwd', 'ffwd_menu' );
90
  add_action( 'admin_print_styles-' . $options_page, 'ffwd_styles' );
91
  add_action( 'admin_print_scripts-' . $options_page, 'ffwd_admin_scripts' );
92
+ // if($required){
93
+ $themes_page = add_submenu_page( $parent_slug, 'Themes', 'Themes', 'manage_options', 'themes_ffwd', 'ffwd_menu' );
94
+ add_action( 'admin_print_styles-' . $themes_page, 'ffwd_styles' );
95
+ add_action( 'admin_print_scripts-' . $themes_page, 'ffwd_admin_scripts' );
96
+ add_action( 'load-' . $themes_page, 'ffwd_add_themes_per_page_option' );
97
+ // }
98
+ $licensing_page = add_submenu_page( $parent_slug, 'Get Premium', 'Get Premium', 'manage_options', 'ffwd_licensing', 'ffwd_licensing_page' );
99
  add_action( 'admin_print_styles-' . $licensing_page, 'ffwd_styles' );
100
  }
101
  $uninstall_page = add_submenu_page( '', 'Uninstall', 'Uninstall', 'manage_options', 'uninstall_ffwd', 'ffwd_menu' );
105
 
106
  add_action( 'admin_menu', 'ffwd_menu_panel' );
107
 
108
+ add_action('admin_notices', 'ffwd_keys_form');
109
+ function ffwd_keys_form(){
110
+
111
+ $screen = get_current_screen();
112
+
113
+ if($screen->parent_base !== "info_ffwd" || $screen->id == "facebook-feed-wd_page_overview_ffwd"){
114
+ return;
115
+ }
116
+
117
+ global $wpdb;
118
+ $ffwd_uninstall = get_option("ffwd_uninstall");
119
+ if($ffwd_uninstall =="1"){
120
+ return;
121
+ }
122
+
123
+ $app_id = $wpdb->get_row($wpdb->prepare('SELECT app_id,app_secret FROM ' . $wpdb->prefix . 'wd_fb_option WHERE id="%d"', 1));
124
+ if(!(empty($app_id->app_id) || empty($app_id->app_secret))){
125
+ return;
126
+ }
127
+
128
+ ?>
129
+
130
+ <div class="error" style="width:99%" id="ffwd_keys_form">
131
+ <p style="font-size:18px;"><strong>Important: Facebook app ID and app secret are required for Facebook Feed WD
132
+ to work.</strong></p>
133
+ <p style="font-size:16px;"><span>Add your own app ID and secret. Use this <a target="_blank" href="https://web-dorado.com/wordpress-facebook-feed/options.html">tutorial</a> to get them.</span></p>
134
+ <div>
135
+ <label style="display: inline-block;width: 135px;" for="ffwd_keys_form_id">Facebook app Id:<span style="color:#FF0000;"> *</span></label>
136
+ <input size="40" id="ffwd_keys_form_id" type="text"/>
137
+ </div>
138
+ <div>
139
+ <label style="display: inline-block;width: 135px;" for="ffwd_keys_form_secret">Facebook app Secret:<span style="color:#FF0000;"> *</span></label>
140
+ <input size="40" id="ffwd_keys_form_secret" type="text"/>
141
+ </div>
142
+ <div style="padding-bottom: 10px;padding-top: 5px;">
143
+ <button id="ffwd_keys_form_button" style="padding: 6px 13px;" class="ffwd-button-primary">Save</button>
144
+ <?php wp_nonce_field('ffwd_keys_form_nonce', 'ffwd_keys_form_nonce'); ?>
145
+ </div>
146
+ </div>
147
+
148
+ <?php
149
+ }
150
+
151
+ add_action('wp_ajax_ffwd_save_fb_keys', 'ffwd_save_fb_keys');
152
+ function ffwd_save_fb_keys(){
153
+
154
+ $app_id = sanitize_text_field($_POST['app_id']);
155
+ $app_secret = sanitize_text_field($_POST['app_secret']);
156
+ $nonce = sanitize_text_field($_POST['nonce']);
157
+
158
+ if(wp_verify_nonce($nonce, 'ffwd_keys_form_nonce') === false) {
159
+ die('0');
160
+ }
161
+
162
+ include_once 'admin/controllers/FFWDControllerOptions_ffwd.php';
163
+ $options = new FFWDControllerOptions_ffwd();
164
+ if($options->save_app_keys($app_id, $app_secret)){
165
+ die('1');
166
+ }else{
167
+ die('0');
168
+ }
169
+
170
+ }
171
+
172
  add_action( 'init', 'ffwd_silently_update' );
173
 
174
 
363
  }
364
  }
365
  $ffwd_limit_notice = get_option( 'ffwd_limit_notice' );
366
+
 
 
 
 
 
 
 
 
 
 
 
367
  require_once( WD_FFWD_DIR . '/admin/controllers/FFWDController' . ( ( $page == 'FFWDShortcode' ) ? $page : ucfirst( strtolower( $page ) ) ) . '.php' );
368
  $controller_class = 'FFWDController' . ucfirst( strtolower( $page ) );
369
  $controller = new $controller_class();
537
 
538
  // Activate plugin.
539
  function ffwd_activate() {
540
+ $current_time=current_time('timestamp');
541
+ $autoupdate_interval = 60;
542
+ update_option('ffwd_autoupdate_time',$autoupdate_interval*60+$current_time);
543
+
544
+
545
  delete_option("ffwd_uninstall");
546
  global $wpdb;
547
  $wd_fb_shortcode = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "wd_fb_shortcode` (
908
 
909
  wp_localize_script( 'ffwd-deactivate-popup', 'ffwdWDDeactivateVars', array(
910
  "prefix" => "ffwd" ,
911
+ "deactivate_class" => 'ffwd_deactivate_link',
912
  "email" => $admin_data->data->user_email,
913
  "plugin_wd_url" => "https://web-dorado.com/products/wordpress-google-maps-plugin.html",
914
  ));
1009
 
1010
  $current_time=current_time('timestamp');
1011
  $update_time=get_option('ffwd_autoupdate_time');
1012
+ $autoupdate_interval = 60;//WDFacebookFeed::get_autoupdate_interval();
1013
+ update_option('ffwd_autoupdate_time',$autoupdate_interval*60+$current_time);
1014
+
 
1015
 
1016
  if(($current_time>=$update_time && $from_plugin) || !$from_plugin )
1017
  {
1030
  // Facebook feed wd Widget.
1031
  if ( class_exists( 'WP_Widget' ) ) {
1032
  require_once( WD_FFWD_DIR . '/admin/controllers/FFWDControllerWidget.php' );
1033
+ add_action( 'widgets_init', 'ffwd_register_widget' );
1034
+ }
1035
+
1036
+ function ffwd_register_widget(){
1037
+ return register_widget("FFWDControllerWidget");
1038
  }
1039
 
1040
  // Languages localization.
framework/WDFacebookFeed.php CHANGED
@@ -37,70 +37,7 @@ class WDFacebookFeed {
37
 
38
 
39
  // Existing app ids and app secrets
40
- protected static $access_tokens = array (
41
- '1786066011417150|5043eac44ee54731ed404b9db021cdf2',
42
- '366766273734391|b9894da4ba6d4d75b500d13fda893810',
43
- '142301613131592|66b723042df89a280e618670b73e3aaa',
44
- '209804229584368|3a2d59f876e0df3d42d829f8a1569636',
45
- '522842584751334|de7e0895060a9e2bf6e972a17626ce1d',
46
- '623116398019349|4d4c0f3404ce3baa9d07d525be0f2d65',
47
- '155873221861806|41c4c1b3df8ac8ed12dd5f7204abf1e6',
48
- '462859190728873|55b52362578b8475e12486816fba3b08',
49
- '1907658946156725|772c0f8e45a3e7ce70e66a93763e3c1e',
50
- '1856176344702073|518810088891d8dd77f65519909e1552',
51
- '1568389583234881|d76357cd1a2639bcdf4abbe3c3d12d52',
52
- '1337518309701023|118cb47c5661be524a50a597ea013c85',
53
- '263377707476536|b091b6e1769d6b8a9e79ed7472394943',
54
- '2035553139992018|20faa0abffc02f00ef1cac3f82e6e8b6',
55
- '433829403627911|94d292a128ef6231fa2a25b3f43d520d',
56
- '1785723671755597|8bea3b6d606eba041bc8d300c0530b10',
57
- '1360249327365720|29097e215fae42483319ffa6fa78e5dd',
58
- '706861409474127|c8e30a19bb18713acf3b637061323914',
59
- '193040531189876|d01897c23430b75d6c51a95f3586a688',
60
- '239405206526053|617592294eacdc07943a1e0ecbf69eab',
61
- '1465318366846430|ce12c0e2e8e768b5f66eadd8e157e123',
62
- '1332501960106748|5c00e11412c36ce741e5bb051d3d948e',
63
- '1303503889682231|6a947d424fc7e2fd373568ed92c3c9de', // App version 2.4
64
- '1005694739559398|b32df5b3f7cecd1105e028abe1bc7ef6',
65
- '274394046295054|2fbdbe248092c63f812e0e1d6dbe0f2b',
66
- '1739880636336728|e786c42c6cbe13b28b8f4a83afbebbcd',
67
- '1683088998649596|73282ca4410752d64621e693cc19524e',
68
- '987113411398480|3e2d346234b086dba07e5c6f5c87caaa',
69
-
70
-
71
-
72
-
73
- '1795317140689602|e25d547c4f12164254f85eead086b0a7',
74
- //'181607922248075|d0787a2cfff89efd23b9fe1ffafa45db',
75
- '1851314935096786|0de2a9ec77d745d6941850696ce166f9',
76
- //'1983264355330375|e5c100f6d4b768abb560e7df1771ac89',
77
- //'274376249625432|03d7cc70158f4b720a124c11aad5606e',
78
- //'927474184059774|ekzzwIV9JnvG-ELYWut9wIvf4Y0',
79
- //'157849737751172|1wgUYn-UwVvoiZkvROi7yi2aIRw',
80
- //'140081703552|rtuoT3AGRIzb-z_PPUlOnN9iYA0',
81
- '322095208287051|pbCTS6jPuhjR18sl2UPhKQw7eyY',
82
- //'1439406912938596|4JDCXisJ2d-1EWeObBt27DybH5c',
83
- '1042396375891598|gn2HiZgDgjTbCMcXsSb6VK91PqM',
84
- '348613608818294|d4gRX7tNppCrI-DrOGof_O8gwvg',
85
- //'502797619766223|fuoqcs_7_9HPokY0C296S4VtB0o',
86
- '1591407604237466|cHUFs9XDDJa7LDUW9zBxirwGAHE',
87
- //'277269689412168|o3k5mzmHsT-prqc2qizxk_DoXEQ',
88
- //'386881278380301|NW_PiECD9TLVe0UNMsB5H9HkPEo',
89
- '697312047120344|p8ST5dkrub6IoBZsClmyRBTScB0',
90
- '1134584793234186|763Jh88I-PuO8_slARazfgucxFg',
91
- //'257106408010811|MwCorr7qsyIeU_GjdPFIEw3-_P8',
92
- //'1693018934313805|VYDjx69NpsgkDEAm79cYD0fxJBk',
93
- //'1298990730176646|rU4QhoOaYPWQng6-k_QdxRoVNaA',
94
- '1788677371359317|UU7yeB5dsKOT8xLsLA9xSNu4OMQ',
95
- //'1876405409266356|VT8hdBxkbAf6-PCq-TosrtiMilU',
96
- //'128947497630881|rlgLr8wtMUWRw7hbcLcsgoa01-k',
97
- //'963645750343660|1mgCt1EhXAI0o51tYpZ7O6dThKM',
98
- //'177899259380474|JgdlhmU-J0dq55bKng0xywDIgIo',
99
- //'1106367462776766|Pj4xBlwzMH53yCQw7-h_prMExQg',
100
- //'131153380694449|jxU6_J0SobvxNG-pzJW8MKsI0w8',
101
-
102
- );
103
-
104
  protected static $save = true;
105
  protected static $edit_feed = false;
106
  protected static $update_mode = 'keep_old';
37
 
38
 
39
  // Existing app ids and app secrets
40
+ protected static $access_tokens = array ();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  protected static $save = true;
42
  protected static $edit_feed = false;
43
  protected static $update_mode = 'keep_old';
frontend/models/FFWDModelMain.php CHANGED
@@ -44,6 +44,7 @@ class FFWDModelMain {
44
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'wd_fb_info WHERE published=1 AND id="%d"', $id),ARRAY_A);
45
  // set access token
46
  if($row != NULL) {
 
47
  $this->access_token = $row['access_token'];
48
 
49
  $graph_url_for_page_info = str_replace (
@@ -53,6 +54,8 @@ class FFWDModelMain {
53
  );
54
  $this->page_user_group = array();//self::decap_do_curl($graph_url_for_page_info);
55
  $this->page_user_group = json_encode($this->page_user_group);
 
 
56
  }
57
  $row["blog_style_likes"] = "0";
58
  return $row;
44
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'wd_fb_info WHERE published=1 AND id="%d"', $id),ARRAY_A);
45
  // set access token
46
  if($row != NULL) {
47
+ $row["success"] = true;
48
  $this->access_token = $row['access_token'];
49
 
50
  $graph_url_for_page_info = str_replace (
54
  );
55
  $this->page_user_group = array();//self::decap_do_curl($graph_url_for_page_info);
56
  $this->page_user_group = json_encode($this->page_user_group);
57
+ }else{
58
+ $row["success"] = false;
59
  }
60
  $row["blog_style_likes"] = "0";
61
  return $row;
frontend/views/FFWDViewAlbum_compact.php CHANGED
@@ -33,7 +33,10 @@ class FFWDViewAlbum_compact {
33
  $sort_direction = ' ASC ';
34
 
35
  $ffwd_info = $this->model->get_ffwd_info($params['fb_id']);
36
-
 
 
 
37
  if(isset($params['from']) and $params['from']=='widget')
38
  {
39
  $ffwd_info['objects_per_page']= $params['objects_per_page'];
33
  $sort_direction = ' ASC ';
34
 
35
  $ffwd_info = $this->model->get_ffwd_info($params['fb_id']);
36
+ if ($ffwd_info == NULL || $ffwd_info["success"] === false) {
37
+ echo WDW_FFWD_Library::message(__('There is no facebook feed selected or it was deleted.', 'ffwd'), 'error');
38
+ return;
39
+ }
40
  if(isset($params['from']) and $params['from']=='widget')
41
  {
42
  $ffwd_info['objects_per_page']= $params['objects_per_page'];
frontend/views/FFWDViewBlog_style.php CHANGED
@@ -33,7 +33,7 @@ class FFWDViewBlog_style {
33
 
34
 
35
 
36
- if ($ffwd_info == NULL) {
37
  echo WDW_FFWD_Library::message(__('There is no facebook feed selected or it was deleted.', 'ffwd'), 'error');
38
  return;
39
  }
33
 
34
 
35
 
36
+ if ($ffwd_info == NULL || $ffwd_info["success"] === false) {
37
  echo WDW_FFWD_Library::message(__('There is no facebook feed selected or it was deleted.', 'ffwd'), 'error');
38
  return;
39
  }
frontend/views/FFWDViewThumbnails.php CHANGED
@@ -28,7 +28,7 @@ class FFWDViewThumbnails {
28
  $current_url = $wp->query_string;
29
  require_once(WD_FFWD_DIR . '/framework/WDW_FFWD_Library.php');
30
  $ffwd_info = $this->model->get_ffwd_info($params['fb_id']);
31
- if ($ffwd_info == NULL) {
32
  echo WDW_FFWD_Library::message(__('There is no facebook feed selected or it was deleted.', 'ffwd'), 'error');
33
  return;
34
  }
28
  $current_url = $wp->query_string;
29
  require_once(WD_FFWD_DIR . '/framework/WDW_FFWD_Library.php');
30
  $ffwd_info = $this->model->get_ffwd_info($params['fb_id']);
31
+ if ($ffwd_info == NULL || $ffwd_info["success"] === false) {
32
  echo WDW_FFWD_Library::message(__('There is no facebook feed selected or it was deleted.', 'ffwd'), 'error');
33
  return;
34
  }
frontend/views/FFWDViewThumbnails_masonry.php CHANGED
@@ -28,7 +28,7 @@ class FFWDViewThumbnails_masonry {
28
  $options_row = $this->model->get_ffwd_options();
29
 
30
  $ffwd_info = $this->model->get_ffwd_info($params['fb_id']);
31
- if ($ffwd_info == NULL) {
32
  echo WDW_FFWD_Library::message(__('There is no facebook feed selected or it was deleted.', 'ffwd'), 'error');
33
  return;
34
  }
@@ -295,13 +295,17 @@ class FFWDViewThumbnails_masonry {
295
  }
296
  #ffwd_container1_<?php echo $ffwd; ?> #ffwd_container2_<?php echo $ffwd; ?> .ffwd_masonry_thumb_description_<?php echo $ffwd; ?> {
297
  color: #<?php echo $theme_row->masonry_description_color; ?>;
298
- line-height: 1.4;
299
  font-size: <?php echo $theme_row->masonry_description_font_size; ?>px;
300
  font-family: <?php echo $theme_row->masonry_description_font_style; ?>;
301
  text-align: justify;
302
  padding: <?php echo $theme_row->masonry_thumb_padding; ?>px !important;
303
  box-sizing: border-box;
304
- background-color: #<?php echo $theme_row->masonry_thumb_bg_color; ?>;
 
 
 
 
305
  }
306
 
307
  #ffwd_container1_<?php echo $ffwd; ?> #ffwd_container2_<?php echo $ffwd; ?> .ffwd_likes_comments_container_<?php echo $ffwd; ?> {
28
  $options_row = $this->model->get_ffwd_options();
29
 
30
  $ffwd_info = $this->model->get_ffwd_info($params['fb_id']);
31
+ if ($ffwd_info == NULL || $ffwd_info["success"] === false) {
32
  echo WDW_FFWD_Library::message(__('There is no facebook feed selected or it was deleted.', 'ffwd'), 'error');
33
  return;
34
  }
295
  }
296
  #ffwd_container1_<?php echo $ffwd; ?> #ffwd_container2_<?php echo $ffwd; ?> .ffwd_masonry_thumb_description_<?php echo $ffwd; ?> {
297
  color: #<?php echo $theme_row->masonry_description_color; ?>;
298
+ line-height: 1.4;
299
  font-size: <?php echo $theme_row->masonry_description_font_size; ?>px;
300
  font-family: <?php echo $theme_row->masonry_description_font_style; ?>;
301
  text-align: justify;
302
  padding: <?php echo $theme_row->masonry_thumb_padding; ?>px !important;
303
  box-sizing: border-box;
304
+ <?php
305
+ if(isset($theme_row->masonry_thumb_bg_color)){
306
+ echo "background-color: #".$theme_row->masonry_thumb_bg_color;
307
+ }
308
+ ?>
309
  }
310
 
311
  #ffwd_container1_<?php echo $ffwd; ?> #ffwd_container2_<?php echo $ffwd; ?> .ffwd_likes_comments_container_<?php echo $ffwd; ?> {
js/ffwd.js CHANGED
@@ -90,10 +90,10 @@ function spider_ajax_save(wd_fb_prefix) {
90
  post_date_format=jQuery("#"+wd_fb_prefix+"_post_date_format").val()
91
  date_timezone=jQuery("#"+wd_fb_prefix+"_date_timezone").val()
92
  event_street=jQuery("input[name="+wd_fb_prefix+"_event_street]:checked").val()
93
- event_city=jQuery("input[name="+wd_fb_prefix+"_event_city]:checked").val()
94
- event_country=jQuery("input[name="+wd_fb_prefix+"_event_country]:checked").val()
95
- event_zip=jQuery("input[name="+wd_fb_prefix+"_event_zip]:checked").val()
96
- event_map=jQuery("input[name="+wd_fb_prefix+"_event_map]:checked").val()
97
  event_date=jQuery("input[name="+wd_fb_prefix+"_event_date]:checked").val()
98
  event_date_format=jQuery("#"+wd_fb_prefix+"_event_date_format").val()
99
  event_desp_length=jQuery("#"+wd_fb_prefix+"_event_desp_length").val()
@@ -257,6 +257,7 @@ data['image_onclick_action']=image_onclick_action
257
  jQuery("#task").val("");
258
  jQuery('#message_div').html("<strong><p>Items Succesfully Saved.</p></strong>");
259
  jQuery('#message_div').show();
 
260
  break;
261
  case "save":
262
  jQuery("#ffwd_info_form").submit();
@@ -432,44 +433,12 @@ switch (jQuery('input[name="ffwd_specific"]:checked').val()) {
432
 
433
 
434
  function check_app(wd_fb_prefix) {
435
- var ffwd_nonce = jQuery("#ffwd_nonce").val(),
436
- app_id = jQuery('#'+wd_fb_prefix+'_app_id').val(),
437
- app_secret = jQuery('#'+wd_fb_prefix+'_app_secret').val(),
438
- data = {};
439
- data["action"] = 'check_app';
440
- data["ffwd_nonce"] = ffwd_nonce;
441
- data["app_id"] = app_id;
442
- data["app_secret"] = app_secret;
443
- /* Loading.*/
444
- jQuery('#opacity_div').show();
445
- jQuery('#loading_div').show();
446
-
447
- jQuery.ajax({
448
- method: "POST",
449
- url: ajax_url,
450
- data: data,
451
- success: function(result) {
452
- console.log(result);
453
- try {
454
- result = jQuery.parseJSON(result);
455
- } catch (e) {
456
- alert(e);
457
- jQuery('#opacity_div').hide();
458
- jQuery('#loading_div').hide();
459
- }
460
 
461
- if(result[0] == 'success') {
462
- console.log(result[0] + ' : ' + result[1]);
463
- jQuery('#'+wd_fb_prefix+'_login_button').attr('href', result[1]);
464
- }
465
- else if(result[0] == 'error' && app_id != '' && app_secret != '') {
466
- confirm(result[0] + " : " + result[1] + ".");
467
- }
468
-
469
- jQuery('#opacity_div').hide();
470
- jQuery('#loading_div').hide();
471
- }
472
- });
473
  }
474
 
475
 
@@ -963,4 +932,48 @@ jQuery(document).ready(function () {
963
  });
964
  }
965
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
966
  });
90
  post_date_format=jQuery("#"+wd_fb_prefix+"_post_date_format").val()
91
  date_timezone=jQuery("#"+wd_fb_prefix+"_date_timezone").val()
92
  event_street=jQuery("input[name="+wd_fb_prefix+"_event_street]:checked").val()
93
+ event_city="0"
94
+ event_country="0"
95
+ event_zip="0"
96
+ event_map="0"
97
  event_date=jQuery("input[name="+wd_fb_prefix+"_event_date]:checked").val()
98
  event_date_format=jQuery("#"+wd_fb_prefix+"_event_date_format").val()
99
  event_desp_length=jQuery("#"+wd_fb_prefix+"_event_desp_length").val()
257
  jQuery("#task").val("");
258
  jQuery('#message_div').html("<strong><p>Items Succesfully Saved.</p></strong>");
259
  jQuery('#message_div').show();
260
+ jQuery('#ffwd_page_url,#page_access_token,#name').removeAttr("style");
261
  break;
262
  case "save":
263
  jQuery("#ffwd_info_form").submit();
433
 
434
 
435
  function check_app(wd_fb_prefix) {
436
+ var app_id = jQuery('#' + wd_fb_prefix + '_app_id').val(),
437
+ app_secret = jQuery('#' + wd_fb_prefix + '_app_secret').val();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
438
 
439
+ if((app_id_first == "" || app_secret_first == "") && app_id != "" && app_secret != ""){
440
+ localStorage.setItem('show_menus', "1");
441
+ }
 
 
 
 
 
 
 
 
 
442
  }
443
 
444
 
932
  });
933
  }
934
  });
935
+
936
+ app_id_first = jQuery('#ffwd_app_id').val();
937
+ app_secret_first = jQuery('#ffwd_app_secret').val();
938
+ if(localStorage.getItem('show_menus') == "1"){
939
+ localStorage.removeItem('show_menus');
940
+ location.reload();
941
+ }
942
+
943
+ jQuery('#ffwd_keys_form_button').on('click', function(e){
944
+ e.preventDefault();
945
+
946
+ var data = {
947
+ app_id: (jQuery('#ffwd_keys_form_id').val()).trim(),
948
+ app_secret: (jQuery('#ffwd_keys_form_secret').val()).trim(),
949
+ nonce: jQuery('#ffwd_keys_form_nonce').val(),
950
+ action: 'ffwd_save_fb_keys'
951
+ };
952
+
953
+ jQuery('#ffwd_keys_form_id,#ffwd_keys_form_secret').css("border-color", "#ddd");
954
+
955
+ if (data.app_id == "") {
956
+ alert("Facebook app Id* field is required.");
957
+ jQuery('#ffwd_keys_form_id').css("border-color", "#FF0000");
958
+ return false;
959
+ }
960
+
961
+ if (data.app_secret == "") {
962
+ alert("Facebook app Secret* field is required.");
963
+ jQuery('#ffwd_keys_form_secret').css("border-color", "#FF0000");
964
+ return false;
965
+ }
966
+
967
+ jQuery.ajax({
968
+ method: "POST",
969
+ url: ajax_url,
970
+ data: data,
971
+ success: function (result) {
972
+ window.location.reload();
973
+ }
974
+ });
975
+
976
+ return false;
977
+ });
978
+
979
  });
js/ffwd_frontend.js CHANGED
@@ -812,20 +812,23 @@ function do_something_with_data_blog_style(result, id, ffwd, type, owner_info, f
812
  place_index = -1;
813
 
814
  if (id['place'] != null) {
815
- place_id = id['place']['id'];
816
- if(id['place']['location']){
817
- var street = (ffwd_params['event_street'] == "1") ? ((typeof id['place']['location']['street'] != 'undefined') ? id['place']['location']['street'] : '') : '',
818
- city = (ffwd_params['event_city'] == "1") ? ((typeof id['place']['location']['city'] != 'undefined') ? id['place']['location']['city'] : '') : '',
819
- country = (ffwd_params['event_country'] == "1") ? ((typeof id['place']['location']['country'] != 'undefined') ? id['place']['location']['country'] : '') : '',
820
- state = (ffwd_params['event_zip'] == "1") ? ((typeof id['place']['location']['state'] != 'undefined') ? id['place']['location']['state'] : '') : '',
821
- zip = (ffwd_params['event_zip'] == "1") ? ((typeof id['place']['location']['zip'] != 'undefined') ? id['place']['location']['zip'] : '') : '',
822
- latitude = (ffwd_params['event_map'] == "1") ? ((typeof id['place']['location']['latitude'] != 'undefined') ? id['place']['location']['latitude'] : '') : '',
823
- longitude = (ffwd_params['event_map'] == "1") ? ((typeof id['place']['location']['longitude'] != 'undefined') ? id['place']['location']['longitude'] : '') : '';
824
-
825
- full_place = ((ffwd_params['event_street'] == "1") ? '<div class="ffwd_place_street_' + ffwd + '" >' + street + '</div> ' : '') +
826
- ((ffwd_params['event_city'] == "1" || ffwd_params['event_zip'] == "1" || ffwd_params['event_country'] == "1" ) ? '<div class="ffwd_place_city_state_country_' + ffwd + '" >' + city + ' ' + state + ' ' + zip + ' ' + country + '</div>' : '') +
827
- ((ffwd_params['event_map'] == "1") ? '<a class="ffwd_place_map_' + ffwd + '" style="text-decoration:underline" href="https://maps.google.com/maps?q=' + latitude + ',' + longitude + '" target="_blank">Map</a>' : '');
828
- }
 
 
 
829
  }
830
  // Who post
831
  if (who_post_index != -1) {
812
  place_index = -1;
813
 
814
  if (id['place'] != null) {
815
+ /* place_id = id['place']['id'];
816
+ if(id['place']['location']){
817
+ var street = (ffwd_params['event_street'] == "1") ? ((typeof id['place']['location']['street'] != 'undefined') ? id['place']['location']['street'] : '') : '',
818
+ city = (ffwd_params['event_city'] == "1") ? ((typeof id['place']['location']['city'] != 'undefined') ? id['place']['location']['city'] : '') : '',
819
+ country = (ffwd_params['event_country'] == "1") ? ((typeof id['place']['location']['country'] != 'undefined') ? id['place']['location']['country'] : '') : '',
820
+ state = (ffwd_params['event_zip'] == "1") ? ((typeof id['place']['location']['state'] != 'undefined') ? id['place']['location']['state'] : '') : '',
821
+ zip = (ffwd_params['event_zip'] == "1") ? ((typeof id['place']['location']['zip'] != 'undefined') ? id['place']['location']['zip'] : '') : '',
822
+ latitude = (ffwd_params['event_map'] == "1") ? ((typeof id['place']['location']['latitude'] != 'undefined') ? id['place']['location']['latitude'] : '') : '',
823
+ longitude = (ffwd_params['event_map'] == "1") ? ((typeof id['place']['location']['longitude'] != 'undefined') ? id['place']['location']['longitude'] : '') : '';
824
+
825
+ full_place = ((ffwd_params['event_street'] == "1") ? '<div class="ffwd_place_street_' + ffwd + '" >' + street + '</div> ' : '') +
826
+ ((ffwd_params['event_city'] == "1" || ffwd_params['event_zip'] == "1" || ffwd_params['event_country'] == "1" ) ? '<div class="ffwd_place_city_state_country_' + ffwd + '" >' + city + ' ' + state + ' ' + zip + ' ' + country + '</div>' : '') +
827
+ ((ffwd_params['event_map'] == "1") ? '<a class="ffwd_place_map_' + ffwd + '" style="text-decoration:underline" href="https://maps.google.com/maps?q=' + latitude + ',' + longitude + '" target="_blank">Map</a>' : '');
828
+ }*/
829
+ if(id['place']['name'] && ffwd_params['event_street'] == "1"){
830
+ full_place = '<div class="ffwd_place_city_state_country_' + ffwd + '" >' + id['place']['name'] + '</div>';
831
+ }
832
  }
833
  // Who post
834
  if (who_post_index != -1) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: customizable facebook feed, facebook, facebook events, facebook feed, face
4
  Requires at least: 3.4
5
  Requires PHP: 5.2
6
  Tested up to: 4.9
7
- Stable tag: 1.0.38
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -100,6 +100,12 @@ The plugin uses Facebook API to get public data from Facebook. All the received
100
 
101
  == Changelog ==
102
 
 
 
 
 
 
 
103
  = 1.0.38 =
104
  * New: Using page access token
105
  * New: Reset and update cached Facebook data
4
  Requires at least: 3.4
5
  Requires PHP: 5.2
6
  Tested up to: 4.9
7
+ Stable tag: 1.1.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
100
 
101
  == Changelog ==
102
 
103
+ = 1.1.0 =
104
+ * **Important: Breaking change. Obtaining page access token is required to display your page content with Facebook Feed WD plugin. See the [documentation](https://web-dorado.com/wordpress-facebook-feed/options.html).
105
+ * Fixed: Error on PHP 7.2
106
+ * Fixed: Notices when feed is unpublished
107
+ * Changed: Deactivation popup
108
+
109
  = 1.0.38 =
110
  * New: Using page access token
111
  * New: Reset and update cached Facebook data
wd/README.md CHANGED
@@ -1,4 +1,4 @@
1
- Version: 1.0.13
2
 
3
 
4
 
1
+ Version: 1.0.16
2
 
3
 
4
 
wd/assets/css/deactivate_popup.css CHANGED
@@ -63,12 +63,20 @@
63
  margin: 14px 0px 5px;
64
  }
65
  .wd-popup-active1{
66
- height: 523px !important;
67
  }
68
 
69
  .wd-popup-active2{
70
  height: 426px !important
71
  }
 
 
 
 
 
 
 
 
72
  .wd-deactivate-popup-opacity{
73
  width: 100%;
74
  height: 100%;
@@ -87,4 +95,17 @@
87
  bottom: 0;
88
  margin: auto;
89
  z-index: 63;
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
63
  margin: 14px 0px 5px;
64
  }
65
  .wd-popup-active1{
66
+ height: 583px !important;
67
  }
68
 
69
  .wd-popup-active2{
70
  height: 426px !important
71
  }
72
+
73
+ .wd-popup-active3{
74
+ height: 479px !important
75
+ }
76
+
77
+ .wd-popup-active4{
78
+ height: 340px !important
79
+ }
80
  .wd-deactivate-popup-opacity{
81
  width: 100%;
82
  height: 100%;
95
  bottom: 0;
96
  margin: auto;
97
  z-index: 63;
98
+ }
99
+
100
+ .wd-deactivate-popup-close-btn{
101
+ background-image: url(img/close.svg);
102
+ background-repeat: no-repeat;
103
+ background-size: 16px;
104
+ display: inline-block;
105
+ width: 16px;
106
+ height: 16px;
107
+ position: absolute;
108
+ top: 7px;
109
+ right: 8px;
110
+ cursor: pointer;
111
  }
wd/assets/css/img/close.svg ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="6917.521 490.293 11.414 11.414">
2
+ <defs>
3
+ <style>
4
+ .cls-1 {
5
+ fill: none;
6
+ stroke: #cbcbcb;
7
+ stroke-linecap: round;
8
+ stroke-linejoin: round;
9
+ }
10
+ </style>
11
+ </defs>
12
+ <g id="if_misc-_close__1276877_3_" data-name="if_misc-_close__1276877 (3)" transform="translate(6917.229 490)">
13
+ <line id="Line_262" data-name="Line 262" class="cls-1" y1="10" x2="10" transform="translate(1 1)"/>
14
+ <line id="Line_263" data-name="Line 263" class="cls-1" x2="10" y2="10" transform="translate(1 1)"/>
15
+ </g>
16
+ </svg>
wd/assets/img/ewd_main_plugin.png DELETED
Binary file
wd/assets/img/fmc_main_plugin.png ADDED
Binary file
wd/assets/img/fwd_main_plugin.png DELETED
Binary file
wd/assets/img/swd_main_plugin.png DELETED
Binary file
wd/assets/js/deactivate_popup.js CHANGED
@@ -19,80 +19,120 @@ var btnVal = 3;
19
  ////////////////////////////////////////////////////////////////////////////////////////
20
  // Public Methods //
21
  ////////////////////////////////////////////////////////////////////////////////////////
22
- function wdReady(prefix){
23
-
24
- jQuery(document).on("click", "." + window[prefix + "WDDeactivateVars"].deactivate_class, function(){
25
- jQuery(".wd-" + prefix + "-opacity").show();
26
- jQuery(".wd-" + prefix + "-deactivate-popup").show();
27
- if(jQuery(this).attr("data-uninstall") == "1"){
28
- btnVal = 2 ;
29
- }
30
-
31
- return false;
32
- });
33
-
34
- jQuery(document).on("change", "[name=" + prefix + "_reasons]", function(){
35
-
36
- jQuery("." + prefix + "_additional_details_wrap").html("");
37
- jQuery(".wd-" + prefix + "-deactivate-popup").removeClass("wd-popup-active1 wd-popup-active2");
38
- if(jQuery(this).val() == "reason_plugin_is_hard_to_use_technical_problems"){
39
-
40
- additionalInfo = '<div class="wd-additional-active"><div><strong>Please describe your issue.</strong></div><br>' +
41
- '<textarea name="' + prefix + '_additional_details" rows = "4"></textarea><br>' +
42
- '<div>Our support will contact <input type="text" name="' + prefix + '_email" value="' + window[prefix + "WDDeactivateVars"].email + '"> shortly.</div>'+
43
- '<br><div><button class="button button-primary wd-' + prefix + '-deactivate" data-val="' + btnVal + '">Submit support ticket</button></div></div>';
44
- jQuery("." + prefix + "_additional_details_wrap").append(additionalInfo);
45
- jQuery(".wd-" + prefix + "-deactivate-popup").addClass("wd-popup-active1");
46
-
47
- }
48
- else if(jQuery(this).val() == "reason_free_version_limited"){
49
- additionalInfo = '<div class="wd-additional-active">' +
50
- '<div><strong>We believe our premium version will fit your needs.</strong></div>' +
51
- '<div><a href="' + window[prefix + "WDDeactivateVars"].plugin_wd_url+ '" target="_blank">Try with 30 day money back guarantee.</a></div>';
52
-
53
- jQuery("." + prefix + "_additional_details_wrap").append(additionalInfo);
54
- jQuery(".wd-" + prefix + "-deactivate-popup").addClass("wd-popup-active2");
55
- }
56
- else if(jQuery(this).val() == "reason_premium_expensive"){
57
- additionalInfo = '<div class="wd-additional-active">' +
58
- '<div><strong>We have a special offer for you.</strong></div>' +
59
- '<div>Submit this form to get the offer to <input type="text" name="' + prefix + '_email" value="' + window[prefix + "WDDeactivateVars"].email + '"></div>' +
60
- '<br><div><button class="button button-primary wd-' + prefix + '-deactivate" data-val="' + btnVal + '">Submit</button></div></div>';
61
-
62
- jQuery("." + prefix + "_additional_details_wrap").append(additionalInfo);
63
- jQuery(".wd-" + prefix + "-deactivate-popup").addClass("wd-popup-active2");
64
- }
65
-
66
- jQuery("#wd-" + prefix + "-deactivate").hide();
67
- jQuery("#wd-" + prefix + "-submit-and-deactivate").show();
68
-
69
- });
70
- jQuery(document).on("keyup", "[name=" + prefix + "_additional_details]", function(){
71
- if(jQuery(this).val().trim() || jQuery("[name=" + prefix + "_reasons]:checked").length > 0){
72
- jQuery("#wd-" + prefix + "-deactivate").hide();
73
- jQuery("#wd-" + prefix + "-submit-and-deactivate").show();
74
- }
75
- else{
76
- jQuery("#wd-" + prefix + "-deactivate").show();
77
- jQuery("#wd-" + prefix + "-submit-and-deactivate").hide();
78
- }
79
-
80
- });
81
- jQuery(document).on("click", ".wd-" + prefix + "-deactivate", function(){
82
- jQuery(".wd-deactivate-popup-opacity-" + prefix).show();
83
- if(jQuery(this).hasClass("wd-clicked") == false){
84
- jQuery(this).addClass("wd-clicked");
85
- jQuery("[name=" + prefix + "_submit_and_deactivate]").val(jQuery(this).attr("data-val"));
86
- jQuery("#" + prefix + "_deactivate_form").submit();
87
- }
88
- return false;
89
- });
90
-
91
- jQuery(document).on("click", ".wd-" + prefix + "-cancel, .wd-opacity", function(){
92
- jQuery(".wd-" + prefix + "-opacity").hide();
93
- jQuery(".wd-" + prefix + "-deactivate-popup").hide();
94
- return false;
95
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
 
97
  }
98
 
19
  ////////////////////////////////////////////////////////////////////////////////////////
20
  // Public Methods //
21
  ////////////////////////////////////////////////////////////////////////////////////////
22
+ function wdReady( prefix ) {
23
+
24
+ var agree_with_pp = false;
25
+ reset_popup();
26
+ jQuery( document ).on( "click", "." + window[prefix + "WDDeactivateVars"].deactivate_class, function () {
27
+ agree_with_pp = false;
28
+ if ( !jQuery( '#wd-' + prefix + '-submit-and-deactivate' ).hasClass( 'button-primary-disabled' ) ) {
29
+ jQuery( '#wd-' + prefix + '-submit-and-deactivate' ).addClass( 'button-primary-disabled' )
30
+ }
31
+ jQuery( ".wd-" + prefix + "-opacity" ).show();
32
+ jQuery( ".wd-" + prefix + "-deactivate-popup" ).show();
33
+ if ( jQuery( this ).attr( "data-uninstall" ) == "1" ) {
34
+ btnVal = 2;
35
+ }
36
+
37
+ return false;
38
+ } );
39
+
40
+ jQuery( document ).on( "change", "[name=" + prefix + "_reasons]", function () {
41
+ var disabled_class = ( agree_with_pp === false ) ? "button-primary-disabled" : "";
42
+
43
+ jQuery( "." + prefix + "_additional_details_wrap" ).html( "" );
44
+ jQuery( ".wd-" + prefix + "-deactivate-popup" ).removeClass( "wd-popup-active1 wd-popup-active2 wd-popup-active3 wd-popup-active4" );
45
+ if ( jQuery( this ).val() == "reason_plugin_is_hard_to_use_technical_problems" ) {
46
+
47
+ additionalInfo = '<div class="wd-additional-active"><div><strong>Please describe your issue.</strong></div><br>' +
48
+ '<textarea name="' + prefix + '_additional_details" rows = "4"></textarea><br>' +
49
+ '<div>Our support will contact <input type="text" name="' + prefix + '_email" value="' + window[prefix + "WDDeactivateVars"].email + '"> shortly.</div>' +
50
+ '<br><div><button class="button button-primary ' + disabled_class + ' wd-' + prefix + '-deactivate" data-val="' + btnVal + '">Submit support ticket</button></div></div>';
51
+ jQuery( "." + prefix + "_additional_details_wrap" ).append( additionalInfo );
52
+ jQuery( ".wd-" + prefix + "-deactivate-popup" ).addClass( "wd-popup-active1" );
53
+
54
+ }
55
+ else if ( jQuery( this ).val() == "reason_free_version_limited" ) {
56
+ additionalInfo = '<div class="wd-additional-active">' +
57
+ '<div><strong>We believe our premium version will fit your needs.</strong></div>' +
58
+ '<div><a href="' + window[prefix + "WDDeactivateVars"].plugin_wd_url + '" target="_blank">Try with 30 day money back guarantee.</a></div>';
59
+
60
+ jQuery( "." + prefix + "_additional_details_wrap" ).append( additionalInfo );
61
+ jQuery( ".wd-" + prefix + "-deactivate-popup" ).addClass( "wd-popup-active2" );
62
+ }
63
+ else if ( jQuery( this ).val() == "reason_premium_expensive" ) {
64
+ additionalInfo = '<div class="wd-additional-active">' +
65
+ '<div><strong>We have a special offer for you.</strong></div>' +
66
+ '<div>Submit this form to get the offer to <input type="text" name="' + prefix + '_email" value="' + window[prefix + "WDDeactivateVars"].email + '"></div>' +
67
+ '<br><div><button class="button button-primary ' + disabled_class + ' wd-' + prefix + '-deactivate" data-val="' + btnVal + '">Submit</button></div></div>';
68
+
69
+ jQuery( "." + prefix + "_additional_details_wrap" ).append( additionalInfo );
70
+ jQuery( ".wd-" + prefix + "-deactivate-popup" ).addClass( "wd-popup-active3" );
71
+ } else {
72
+ jQuery( ".wd-" + prefix + "-deactivate-popup" ).addClass( "wd-popup-active4" );
73
+ }
74
+
75
+ var checked = ( agree_with_pp === true ) ? "checked" : "";
76
+ var agree_checkbox =
77
+ "<div style='margin-top: 5px;'>" +
78
+ "<input type='checkbox' " + checked + " name='" + prefix + "_agree_with_pp" + "' id='" + prefix + "_agree_with_pp" + "'/>" +
79
+ "By submitting this form your email and website URL will be sent to Web-Dorado. Click the checkbox if you consent to usage of mentioned data by Web-Dorado in accordance with our <a target='_blank' href='https://web-dorado.com/web-dorado-privacy-statement.html'>Privacy Policy</a>."+
80
+ "</div>";
81
+ jQuery( "." + prefix + "_additional_details_wrap" ).prepend( agree_checkbox );
82
+
83
+ jQuery( "#wd-" + prefix + "-submit-and-deactivate" ).show();
84
+ } );
85
+ jQuery( document ).on( "keyup", "[name=" + prefix + "_additional_details]", function () {
86
+ if ( jQuery( this ).val().trim() || jQuery( "[name=" + prefix + "_reasons]:checked" ).length > 0 ) {
87
+ jQuery( "#wd-" + prefix + "-submit-and-deactivate" ).show();
88
+ }
89
+ else {
90
+ jQuery( "#wd-" + prefix + "-submit-and-deactivate" ).hide();
91
+ }
92
+ } );
93
+
94
+ jQuery( document ).on( "change", "[name=" + prefix + "_agree_with_pp]", function () {
95
+ if ( jQuery( this ).prop( 'checked' ) ) {
96
+ jQuery( ".wd-" + prefix + "-deactivate" ).removeClass( 'button-primary-disabled' );
97
+ agree_with_pp = true;
98
+ } else {
99
+ jQuery( ".wd-" + prefix + "-deactivate" ).addClass( 'button-primary-disabled' );
100
+ agree_with_pp = false;
101
+ }
102
+ } );
103
+
104
+ jQuery( document ).on( "click", ".wd-" + prefix + "-deactivate", function ( e ) {
105
+ var data_val = jQuery( this ).data( 'val' );
106
+ var checkbox = jQuery( "#" + prefix + "_agree_with_pp" );
107
+
108
+ if ( data_val !== 1 && ( checkbox.length === 0 || checkbox.prop( 'checked' ) === false ) ) {
109
+ return false;
110
+ }
111
+
112
+ jQuery( ".wd-deactivate-popup-opacity-" + prefix ).show();
113
+ if ( jQuery( this ).hasClass( "wd-clicked" ) == false ) {
114
+ jQuery( this ).addClass( "wd-clicked" );
115
+ jQuery( "[name=" + prefix + "_submit_and_deactivate]" ).val( jQuery( this ).attr( "data-val" ) );
116
+ jQuery( "#" + prefix + "_deactivate_form" ).submit();
117
+ }
118
+ return false;
119
+ } );
120
+
121
+ jQuery( document ).on( "click", ".wd-" + prefix + "-cancel, .wd-opacity, .wd-deactivate-popup-close-btn", function () {
122
+ jQuery( ".wd-" + prefix + "-opacity" ).hide();
123
+ jQuery( ".wd-" + prefix + "-deactivate-popup" ).hide();
124
+ reset_popup();
125
+
126
+ return false;
127
+ } );
128
+
129
+ function reset_popup() {
130
+ jQuery( "." + prefix + "_additional_details_wrap" ).html( "" );
131
+ jQuery( ".wd-" + prefix + "-deactivate-popup" ).removeClass( "wd-popup-active1 wd-popup-active2 wd-popup-active3 wd-popup-active4" );
132
+
133
+ jQuery( "#wd-" + prefix + "-submit-and-deactivate" ).hide();
134
+ jQuery( '#' + prefix + '_deactivate_form input[name="' + prefix + '_reasons' + '"]' ).prop( 'checked', false );
135
+ }
136
 
137
  }
138
 
wd/config.php CHANGED
@@ -36,6 +36,7 @@
36
  public $custom_post = null;
37
  public $menu_capability = null;
38
  public $menu_position = null;
 
39
 
40
  public function set_options( $options ){
41
 
@@ -108,7 +109,10 @@
108
  }
109
  if(isset( $options["menu_position"] )) {
110
  $this->menu_position = $options["menu_position"];
111
- }
 
 
 
112
 
113
  // directories
114
  $this->wd_dir = dirname( $this->plugin_main_file ) . '/wd';
36
  public $custom_post = null;
37
  public $menu_capability = null;
38
  public $menu_position = null;
39
+ public $start_using_url = null;
40
 
41
  public function set_options( $options ){
42
 
109
  }
110
  if(isset( $options["menu_position"] )) {
111
  $this->menu_position = $options["menu_position"];
112
+ }
113
+ if(isset( $options["start_using_url"] )) {
114
+ $this->start_using_url = $options["start_using_url"];
115
+ }
116
 
117
  // directories
118
  $this->wd_dir = dirname( $this->plugin_main_file ) . '/wd';
wd/includes/deactivate.php CHANGED
@@ -18,8 +18,7 @@
18
  // Reason IDs
19
  const REASON_PLUGIN_IS_HARD_TO_USE_TECHNICAL_PROBLEMS = "reason_plugin_is_hard_to_use_technical_problems";
20
  const REASON_FREE_VERSION_IS_LIMITED = "reason_free_version_limited";
21
- const REASON_PRO_EXPENSIVE = "reason_premium_expensive";
22
- const REASON_UPGRADING_TO_PAID_VERSION = "reason_upgrading_to_paid_version";
23
  const REASON_TEMPORARY_DEACTIVATION = "reason_temporary_deactivation";
24
 
25
  ////////////////////////////////////////////////////////////////////////////////////////
@@ -41,12 +40,8 @@
41
  3 => array(
42
  'id' => self::REASON_PRO_EXPENSIVE,
43
  'text' => __( 'Premium is expensive', $wd_options->prefix ),
44
- ),
45
- 4 => array(
46
- 'id' => self::REASON_UPGRADING_TO_PAID_VERSION,
47
- 'text' => __( 'Upgrading to paid version', $wd_options->prefix ),
48
  ),
49
- 5 => array(
50
  'id' => self::REASON_TEMPORARY_DEACTIVATION,
51
  'text' => __( 'Temporary deactivation', $wd_options->prefix ),
52
  ),
18
  // Reason IDs
19
  const REASON_PLUGIN_IS_HARD_TO_USE_TECHNICAL_PROBLEMS = "reason_plugin_is_hard_to_use_technical_problems";
20
  const REASON_FREE_VERSION_IS_LIMITED = "reason_free_version_limited";
21
+ const REASON_PRO_EXPENSIVE = "reason_premium_expensive";
 
22
  const REASON_TEMPORARY_DEACTIVATION = "reason_temporary_deactivation";
23
 
24
  ////////////////////////////////////////////////////////////////////////////////////////
40
  3 => array(
41
  'id' => self::REASON_PRO_EXPENSIVE,
42
  'text' => __( 'Premium is expensive', $wd_options->prefix ),
 
 
 
 
43
  ),
44
+ 4 => array(
45
  'id' => self::REASON_TEMPORARY_DEACTIVATION,
46
  'text' => __( 'Temporary deactivation', $wd_options->prefix ),
47
  ),
wd/includes/overview.php CHANGED
@@ -66,6 +66,9 @@
66
  $start_using_url = menu_page_url($this->config->custom_post, false);
67
  }
68
  }
 
 
 
69
  require_once( $wd_options->wd_dir_templates . "/display_overview.php" );
70
  }
71
  public function wd_overview_welcome(){
@@ -86,7 +89,7 @@
86
  'title' => 'Form Maker',
87
  'text' => __( 'Wordpress form builder plugin', $wd_options->prefix ),
88
  'content' => __( 'Form Maker is a modern and advanced tool for creating WordPress forms easily and fast.', $wd_options->prefix ),
89
- 'href' => 'https://web-dorado.com/products/wordpress-form.html'
90
  ),
91
  "photo-gallery" => array(
92
  'title' => 'Photo Gallery',
66
  $start_using_url = menu_page_url($this->config->custom_post, false);
67
  }
68
  }
69
+ if(!empty($this->config->start_using_url)){
70
+ $start_using_url = $this->config->start_using_url;
71
+ }
72
  require_once( $wd_options->wd_dir_templates . "/display_overview.php" );
73
  }
74
  public function wd_overview_welcome(){
89
  'title' => 'Form Maker',
90
  'text' => __( 'Wordpress form builder plugin', $wd_options->prefix ),
91
  'content' => __( 'Form Maker is a modern and advanced tool for creating WordPress forms easily and fast.', $wd_options->prefix ),
92
+ 'href' => 'https://web-dorado.com/files/fromFormMaker.php'
93
  ),
94
  "photo-gallery" => array(
95
  'title' => 'Photo Gallery',
wd/templates/display_deactivation_popup.php CHANGED
@@ -1,27 +1,28 @@
1
  <div class="wd-opacity wd-<?php echo $wd_options->prefix; ?>-opacity"></div>
2
  <div class="wd-deactivate-popup wd-<?php echo $wd_options->prefix; ?>-deactivate-popup">
3
- <div class="wd-deactivate-popup-opacity wd-deactivate-popup-opacity-<?php echo $wd_options->prefix; ?>">
4
- <img src="<?php echo $wd_options->wd_url_img . '/spinner.gif'; ?>" class="wd-img-loader" >
5
- </div>
6
- <form method="post" id="<?php echo $wd_options->prefix; ?>_deactivate_form">
7
- <div class="wd-deactivate-popup-header">
8
- <?php _e( "Please let us know why you are deactivating. Your answer will help us to serve you better (Optional)", $wd_options->prefix ); ?>:
9
- </div>
 
10
 
11
- <div class="wd-deactivate-popup-body">
12
- <?php foreach( $deactivate_reasons as $deactivate_reason_slug => $deactivate_reason ) { ?>
13
- <div class="wd-<?php echo $wd_options->prefix; ?>-reasons">
14
- <input type="radio" value="<?php echo $deactivate_reason["id"];?>" id="<?php echo $wd_options->prefix . "-" .$deactivate_reason["id"]; ?>" name="<?php echo $wd_options->prefix; ?>_reasons" >
15
- <label for="<?php echo $wd_options->prefix . "-" . $deactivate_reason["id"]; ?>"><?php echo $deactivate_reason["text"];?></label>
16
- </div>
17
- <?php } ?>
18
- <div class="<?php echo $wd_options->prefix; ?>_additional_details_wrap"></div>
19
- </div>
20
- <div class="wd-btns">
21
- <a href="<?php echo $deactivate_url; ?>" data-val="1" class="button button-primary button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-deactivate"><?php _e( "Skip and Deactivate" , $wd_options->prefix ); ?></a>
22
- <a href="<?php echo $deactivate_url; ?>" data-val="2" class="button button-primary button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-submit-and-deactivate" style="display:none;"><?php _e( "Submit and Deactivate" , $wd_options->prefix ); ?></a>
23
- </div>
24
- <input type="hidden" name="<?php echo $wd_options->prefix . "_submit_and_deactivate"; ?>" value="" >
25
- <?php wp_nonce_field( $wd_options->prefix . '_save_form', $wd_options->prefix . '_save_form_fild'); ?>
26
- </form>
27
- </div>
1
  <div class="wd-opacity wd-<?php echo $wd_options->prefix; ?>-opacity"></div>
2
  <div class="wd-deactivate-popup wd-<?php echo $wd_options->prefix; ?>-deactivate-popup">
3
+ <div class="wd-deactivate-popup-opacity wd-deactivate-popup-opacity-<?php echo $wd_options->prefix; ?>">
4
+ <img src="<?php echo $wd_options->wd_url_img . '/spinner.gif'; ?>" class="wd-img-loader" >
5
+ </div>
6
+ <form method="post" id="<?php echo $wd_options->prefix; ?>_deactivate_form">
7
+ <div class="wd-deactivate-popup-header">
8
+ <?php _e( "Please let us know why you are deactivating. Your answer will help us to provide you support or sometimes offer discounts. (Optional)", $wd_options->prefix ); ?>:
9
+ <span class="wd-deactivate-popup-close-btn"></span>
10
+ </div>
11
 
12
+ <div class="wd-deactivate-popup-body">
13
+ <?php foreach( $deactivate_reasons as $deactivate_reason_slug => $deactivate_reason ) { ?>
14
+ <div class="wd-<?php echo $wd_options->prefix; ?>-reasons">
15
+ <input type="radio" value="<?php echo $deactivate_reason["id"];?>" id="<?php echo $wd_options->prefix . "-" .$deactivate_reason["id"]; ?>" name="<?php echo $wd_options->prefix; ?>_reasons" >
16
+ <label for="<?php echo $wd_options->prefix . "-" . $deactivate_reason["id"]; ?>"><?php echo $deactivate_reason["text"];?></label>
17
+ </div>
18
+ <?php } ?>
19
+ <div class="<?php echo $wd_options->prefix; ?>_additional_details_wrap"></div>
20
+ </div>
21
+ <div class="wd-btns">
22
+ <a href="<?php echo $deactivate_url; ?>" data-val="1" class="button button-secondary button-close" id="wd-<?php echo $wd_options->prefix; ?>-deactivate"><?php _e( "Skip and Deactivate" , $wd_options->prefix ); ?></a>
23
+ <a href="<?php echo $deactivate_url; ?>" data-val="2" class="button button-primary button-primary-disabled button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-submit-and-deactivate"><?php _e( "Submit and Deactivate" , $wd_options->prefix ); ?></a>
24
+ </div>
25
+ <input type="hidden" name="<?php echo $wd_options->prefix . "_submit_and_deactivate"; ?>" value="" >
26
+ <?php wp_nonce_field( $wd_options->prefix . '_save_form', $wd_options->prefix . '_save_form_fild'); ?>
27
+ </form>
28
+ </div>
wd/templates/display_overview_support.php CHANGED
@@ -27,8 +27,24 @@
27
  echo '&#13;&#10;&#13;&#10;';
28
  foreach( $gd_info as $key => $val ){
29
  echo $key . ": " . $val . '&#13;&#10;';
30
- }
31
- ?></textarea>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  </div>
33
  </div>
34
  <?php
27
  echo '&#13;&#10;&#13;&#10;';
28
  foreach( $gd_info as $key => $val ){
29
  echo $key . ": " . $val . '&#13;&#10;';
30
+ }
31
+ echo '&#13;&#10;';
32
+ _e("Active Plugins", $wd_options->prefix);
33
+ echo '&#13;&#10;';
34
+ $activepl = get_option('active_plugins');
35
+ $plugins = get_plugins();
36
+ $activated_plugins = array();
37
+ foreach ( $activepl as $p ) {
38
+ if ( isset($plugins[$p]) ) {
39
+ array_push($activated_plugins, $plugins[$p]);
40
+ echo '&#13;&#10;' . $plugins[$p]['Name'];
41
+ }
42
+ }
43
+ echo '&#13;&#10;&#13;&#10;';
44
+ _e("Active theme", $wd_options->prefix);
45
+ echo '&#13;&#10;&#13;&#10;';
46
+ echo wp_get_theme();
47
+ ?></textarea>
48
  </div>
49
  </div>
50
  <?php
wd/templates/display_subscribe.php CHANGED
@@ -8,7 +8,10 @@
8
  <div class="texts">
9
  <p><?php _e( "Hi there", $wd_options->prefix ); ?>,</p>
10
  <p>
11
- <?php echo sprintf( __( "Allow %s to collect some usage data. This will allow you to get more out of your plugin experience - get awesome customer support, receive exclusive deals and discounts on premium products and more. You can choose to skip this step, %s will still work just fine.", $wd_options->prefix ), '<strong>Web-Dorado</strong>', $wd_options->plugin_title ); ?>
 
 
 
12
  </p>
13
  </div>
14
  <div class="btns">
8
  <div class="texts">
9
  <p><?php _e( "Hi there", $wd_options->prefix ); ?>,</p>
10
  <p>
11
+ <?php
12
+ $pp_text = "<a target='_blank' href='https://web-dorado.com/web-dorado-privacy-statement.html'>" . __("Privacy Policy", $wd_options->prefix) . "</a>";
13
+ echo sprintf(__("Allow %s to collect some usage data, to be able to provide you more out of your plugin experience - awesome customer support and more. Check how we handle your personal data in our %s. You can always customize your preferences from the emails your receive from us. You can choose to skip this step, %s will still work just fine.", $wd_options->prefix), '<strong>Web-Dorado</strong>', $pp_text, $wd_options->plugin_title);
14
+ ?>
15
  </p>
16
  </div>
17
  <div class="btns">
wd/wd.php CHANGED
@@ -17,7 +17,7 @@
17
  public $overview_instance;
18
  public $subscribe_instance;
19
  public $config;
20
- private $version = "1.0.13";
21
 
22
  ////////////////////////////////////////////////////////////////////////////////////////
23
  // Constructor & Destructor //
17
  public $overview_instance;
18
  public $subscribe_instance;
19
  public $config;
20
+ private $version = "1.0.16";
21
 
22
  ////////////////////////////////////////////////////////////////////////////////////////
23
  // Constructor & Destructor //