Responsive Facebook Page Plugin - Version 1.6.0

Version Description

  • 02/04/17 =
  • New landing page with FAQs to help with onboarding of new users
  • Removal of the admin notice review nag
  • Localisation of SDK
  • Added events option to the widget and shortcode generator
  • Changed tabs setting to checkboxes instead of a dropdown
Download this release

Release Info

Developer deployer
Plugin Icon 128x128 Responsive Facebook Page Plugin
Version 1.6.0
Comparing to
See all releases

Code changes from version 1.5.5 to 1.6.0

css/facebook-page-plugin-admin.css CHANGED
@@ -2,4 +2,10 @@
2
  #facebook-page-plugin-shortcode-generator input:not([type="checkbox"]),#facebook-page-plugin-shortcode-generator select{width:50%;}
3
  #facebook-page-plugin-shortcode-generator input,#facebook-page-plugin-shortcode-generator select{float:right;}
4
  #facebook-page-plugin-shortcode-generator #facebook-page-plugin-shortcode-generator-output{width:100%;float:none;}
5
- #facebook-page-plugin-review{position:relative;}
 
 
 
 
 
 
2
  #facebook-page-plugin-shortcode-generator input:not([type="checkbox"]),#facebook-page-plugin-shortcode-generator select{width:50%;}
3
  #facebook-page-plugin-shortcode-generator input,#facebook-page-plugin-shortcode-generator select{float:right;}
4
  #facebook-page-plugin-shortcode-generator #facebook-page-plugin-shortcode-generator-output{width:100%;float:none;}
5
+ .plugins_page_facebook-page-plugin .welcome-panel-content{margin-right:13px;}
6
+ .plugins_page_facebook-page-plugin .welcome-panel-image{width:100%;}
7
+ .plugins_page_facebook-page-plugin .about-description{margin:13px 0;}
8
+ .plugins_page_facebook-page-plugin .spinner.is-active{float:none !important;}
9
+ .facebook-page-plugin-donate{margin:20px 0 10px;font-size:14px;line-height:175%;background:#fff;border: 1px solid rgba(0,0,0,0.1);border-left:4px solid #46b450;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1);padding:1px 29px 1px 12px;position:relative;}
10
+ .facebook-page-plugin-donate p{margin:.5em 0;padding:2px;}
11
+ .facebook-page-plugin-donate .notice-dismiss{text-decoration:none;}
facebook-page-feed-graph-api.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Facebook Page Plugin
4
  * Plugin URI: https://cameronjonesweb.com.au/projects/facebook-page-plugin
5
  * Description: It's time to upgrade from your old like box! Display the Facebook Page Plugin from the Graph API using a shortcode or widget. Now available in 95 different languages
6
- * Version: 1.5.5
7
  * Author: Cameron Jones
8
  * Author URI: https://cameronjonesweb.com.au
9
  * License: GPLv2
@@ -24,77 +24,261 @@ defined( 'ABSPATH' ) or die();
24
 
25
  class cameronjonesweb_facebook_page_plugin {
26
 
 
 
27
  public function __construct() {
28
 
29
  define( 'CJW_FBPP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
30
  define( 'CJW_FBPP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
31
- define( 'CJW_FBPP_PLUGIN_VER', '1.5.4' );
 
 
 
32
 
33
  //Add all the hooks and actions
34
  add_shortcode( 'facebook-page-plugin', array( $this, 'facebook_page_plugin' ) );
35
  add_filter( 'widget_text', 'do_shortcode' );
36
  add_action( 'wp_dashboard_setup', array( $this, 'facebook_page_plugin_dashboard_widget' ) );
37
  add_action( 'admin_enqueue_scripts', array( $this, 'facebook_page_plugin_admin_resources' ) );
38
- add_action( 'admin_notices', array( $this, 'facebook_page_plugin_admin_notice' ) );
39
- add_action( 'admin_init', array( $this, 'facebook_page_plugin_admin_notice_ignore' ) );
40
- add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array( $this, 'facebook_page_plugin_action_links' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  }
42
 
43
 
44
  //Admin functions
45
- //Display review notice
46
- public function facebook_page_plugin_admin_notice() {
47
- $screen = get_current_screen();
48
- //Only display on the dashboard, widgets and plugins pages
49
- if( $screen->base === 'widgets' || $screen->base === 'dashboard' || $screen->base === 'plugins' ){
50
- global $current_user ;
51
- $user_id = $current_user->ID;
52
- //Don't show if they have hidden it
53
- if ( !get_user_meta( $user_id, 'facebook_page_plugin_admin_notice_ignore' ) || get_user_meta( $user_id, 'facebook_page_plugin_admin_notice_ignore' ) === false ) {
54
- echo '<div class="updated" id="facebook-page-plugin-review"><p>';
55
- echo __( 'Thank you for using the Facebook Page Plugin. If you enjoy using it, please take the time to', 'facebook-page-feed-graph-api' ) . ' <a href="https://wordpress.org/support/view/plugin-reviews/facebook-page-feed-graph-api?rate=5#postform" target="_blank">' . __( 'leave a review', 'facebook-page-feed-graph-api' ) . '</a>. ' . __( 'Thanks', 'facebook-page-feed-graph-api' );
56
- echo '<a href="?facebook_page_plugin_admin_notice_ignore=0" class="notice-dismiss"><span class="screen-reader-text">' . __( 'Dismiss this notice', 'facebook-page-feed-graph-api' ) . '.</span></a></p></div>';
 
 
 
 
 
 
 
 
 
 
 
57
  }
 
58
  }
 
 
 
59
  }
60
 
61
- //Handler function for when review notice is hidden
62
- public function facebook_page_plugin_admin_notice_ignore() {
63
- global $current_user;
64
- $user_id = $current_user->ID;
65
- if ( isset($_GET['facebook_page_plugin_admin_notice_ignore']) && '0' == $_GET['facebook_page_plugin_admin_notice_ignore'] ) {
66
- update_user_meta($user_id, 'facebook_page_plugin_admin_notice_ignore', 'true', true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  }
 
 
 
 
 
 
 
 
 
68
  }
69
 
70
- //Add link on plugins page to my plugins directory
71
- public function facebook_page_plugin_action_links( $links ) {
72
- $links[] = '<a href="https://profiles.wordpress.org/cameronjonesweb/#content-plugins" target="_blank">More plugins by cameronjonesweb</a>';
 
 
 
 
 
 
73
  return $links;
 
74
  }
75
 
 
76
  //Enqueue CSS and JS for admin
77
  public function facebook_page_plugin_admin_resources() {
 
78
  wp_enqueue_script( 'facebook-page-plugin-admin-scripts', CJW_FBPP_PLUGIN_URL . 'js/facebook-page-plugin-admin.js' );
79
  wp_enqueue_style( 'facebook-page-plugin-admin-styles', CJW_FBPP_PLUGIN_URL . 'css/facebook-page-plugin-admin.css' );
 
80
  }
81
 
82
  //Register the dashboard widget
83
  public function facebook_page_plugin_dashboard_widget() {
84
- wp_add_dashboard_widget( 'facebook-page-plugin-shortcode-generator', __( 'Facebook Page Plugin Shortcode Generator', 'facebook-page-feed-graph-api' ), array( $this, 'facebook_page_plugin_dashboard_widget_callback' ) );
 
 
 
 
 
 
85
  }
86
 
87
  //Load the dashboard widget
88
  function facebook_page_plugin_dashboard_widget_callback() {
89
-
90
  $generator = new cameronjonesweb_facebook_page_plugin_shortcode_generator;
91
  $generator->generate();
92
 
93
  }
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  //Client side stuff
 
 
 
 
96
  //Parse shortcode
97
  function facebook_page_plugin( $filter ) {
 
98
  wp_enqueue_script( 'facebook-page-plugin-responsive-script', CJW_FBPP_PLUGIN_URL . 'js/responsive.min.js', 'jquery', NULL, true );
99
  $return = NULL;
100
  $a = shortcode_atts( array(
@@ -115,8 +299,12 @@ class cameronjonesweb_facebook_page_plugin {
115
  ), $filter );
116
  if(isset($a['href']) && !empty($a['href'])){
117
  $a['language'] = str_replace("-", "_", $a['language']);
118
- $return .= '<div class="cameronjonesweb_facebook_page_plugin" data-version="' . CJW_FBPP_PLUGIN_VER . '" id="' . preg_replace("/[^a-zA-Z]+/", "",substr(md5(rand()), 0, 15)) . '">';
119
- $return .= '<div id="fb-root"></div><script>(function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = d.createElement(s); js.id = id;js.src = "//connect.facebook.net/' . $a['language'] . '/sdk.js#xfbml=1&version=v2.5&appId=846690882110183";fjs.parentNode.insertBefore(js, fjs); }(document, \'script\', \'facebook-jssdk\'));</script>';
 
 
 
 
120
  $return .= '<div class="fb-page" data-href="https://facebook.com/' . $a["href"] . '" ';
121
  if(isset($a['width']) && !empty($a['width'])){
122
  $return .= ' data-width="' . $a['width'] . '"';
@@ -177,8 +365,10 @@ class cameronjonesweb_facebook_page_plugin {
177
  class cameronjonesweb_facebook_page_plugin_widget extends WP_Widget {
178
 
179
  private $facebookURLs = array('https://www.facebook.com/', 'https://facebook.com/', 'www.facebook.com/', 'facebook.com/');
 
180
 
181
  function __construct() {
 
182
  parent::__construct( 'facebook_page_plugin_widget', __( 'Facebook Page Plugin', 'facebook-page-feed-graph-api' ), array( 'description' => __( 'Generates a Facebook Page feed in your widget area', 'facebook-page-feed-graph-api' ), ) );
183
  }
184
  public function widget( $args, $instance ) {
@@ -269,7 +459,16 @@ class cameronjonesweb_facebook_page_plugin_widget extends WP_Widget {
269
  $shortcode .= ' facepile="' . $facepile . '"';
270
  }
271
  if( isset( $tabs ) && !empty( $tabs ) ){
272
- $shortcode .= ' tabs="' . $tabs . '"';
 
 
 
 
 
 
 
 
 
273
  }
274
  if( isset( $language ) && !empty( $language ) ){
275
  $shortcode .= ' language="' . $language . '"';
@@ -295,6 +494,7 @@ class cameronjonesweb_facebook_page_plugin_widget extends WP_Widget {
295
  echo $args['after_widget'];
296
  }
297
  public function form( $instance ) {
 
298
  if ( isset( $instance[ 'title' ] ) ) {
299
  $title = $instance[ 'title' ];
300
  } else {
@@ -361,7 +561,9 @@ class cameronjonesweb_facebook_page_plugin_widget extends WP_Widget {
361
  $language = '';
362
  }
363
 
364
- $langs = get_locale_xml();
 
 
365
 
366
  echo '<p>';
367
  echo '<label for="' . $this->get_field_id( 'title' ) . '">';
@@ -399,12 +601,24 @@ class cameronjonesweb_facebook_page_plugin_widget extends WP_Widget {
399
  echo '</label>';
400
  echo ' <input class="widefat" id="' . $this->get_field_id( 'facepile' ) . '" name="' . $this->get_field_name( 'facepile' ) . '" type="checkbox" value="true" ' . checked( esc_attr( $facepile ), 'true', false ) . ' />';
401
  echo '</p>';
402
- echo '<p>';
403
- echo '<label for="' . $this->get_field_id( 'tabs' ) . '">';
404
- _e( 'Page Tabs:', 'facebook-page-feed-graph-api' );
405
- echo '</label>';
406
- echo ' <select class="widefat" id="' . $this->get_field_id( 'tabs' ) . '" name="' . $this->get_field_name( 'tabs' ) . ' "><option value="" ' . selected( esc_attr( $tabs ), "", false ) . '>None</option><option value="timeline"' . selected( esc_attr( $tabs ), "timeline", false ) . '>Timeline</option><option value="messages"' . selected( esc_attr( $tabs ), "messages", false ) . '>Messages</option><option value="timeline,messages"' . selected( esc_attr( $tabs ), "timeline,messages", false ) . '>Timeline, Messages</option><option value="messages,timeline"' . selected( esc_attr( $tabs ), "messages,timeline", false ) . '>Messages, Timeline</option></select>';
407
- echo '</p>';
 
 
 
 
 
 
 
 
 
 
 
 
408
  echo '<p>';
409
  echo '<label for="' . $this->get_field_id( 'cta' ) . '">';
410
  _e( 'Hide Call To Action:', 'facebook-page-feed-graph-api' );
@@ -460,7 +674,15 @@ class cameronjonesweb_facebook_page_plugin_widget extends WP_Widget {
460
  $instance['height'] = ( ! empty( $new_instance['height'] ) ) ? strip_tags( $new_instance['height'] ) : '';
461
  $instance['cover'] = ( ! empty( $new_instance['cover'] ) ) ? strip_tags( $new_instance['cover'] ) : '';
462
  $instance['facepile'] = ( ! empty( $new_instance['facepile'] ) ) ? strip_tags( $new_instance['facepile'] ) : '';
463
- $instance['tabs'] = ( ! empty( $new_instance['tabs'] ) ) ? strip_tags( $new_instance['tabs'] ) : '';
 
 
 
 
 
 
 
 
464
  $instance['cta'] = ( ! empty( $new_instance['cta'] ) ) ? strip_tags( $new_instance['cta'] ) : '';
465
  $instance['small'] = ( ! empty( $new_instance['small'] ) ) ? strip_tags( $new_instance['small'] ) : '';
466
  $instance['adapt'] = ( ! empty( $new_instance['adapt'] ) ) ? strip_tags( $new_instance['adapt'] ) : '';
@@ -469,28 +691,45 @@ class cameronjonesweb_facebook_page_plugin_widget extends WP_Widget {
469
  $instance['language'] = ( ! empty( $new_instance['language'] ) ) ? strip_tags( $new_instance['language'] ) : '';
470
  return $instance;
471
  }
 
472
  } // Class wpb_widget ends here
473
 
474
  class cameronjonesweb_facebook_page_plugin_shortcode_generator {
475
 
476
  private $langs;
 
477
 
478
  function __construct() {
479
 
480
- $this->langs = get_locale_xml();
 
481
  }
482
 
483
  function generate() {
484
 
485
  $return = NULL;
486
 
 
 
 
 
487
  $return .= '<form>';
488
  $return .= '<p><label>' . __( 'Facebook Page URL', 'facebook-page-feed-graph-api' ) . ': <input type="url" id="fbpp-href" /></label></p>';
489
  $return .= '<p><label>' . __( 'Width (pixels)', 'facebook-page-feed-graph-api' ) . ': <input type="number" max="500" min="180" id="fbpp-width" /></label></p>';
490
  $return .= '<p><label>' . __( 'Height (pixels)', 'facebook-page-feed-graph-api' ) . ': <input type="number" min="70" id="fbpp-height" /></label></p>';
491
  $return .= '<p><label>' . __( 'Show Cover Photo', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-cover" /></label></p>';
492
  $return .= '<p><label>' . __( 'Show Facepile', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-facepile" /></label></p>';
493
- $return .= '<p><label>' . __( 'Page Tabs (formerly posts)', 'facebook-page-feed-graph-api' ) . ': <select id="fbpp-tabs"><option value="">None</option><option value="timeline">Timeline</option><option value="messages">Messages</option><option value="timeline,messages">Timeline, Messages</option><option value="messages,timeline">Messages, Timeline</option></select></label></p>';
 
 
 
 
 
 
 
 
 
 
494
  $return .= '<p><label>' . __( 'Hide Call To Action', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-cta" /></label></p>';
495
  $return .= '<p><label>' . __( 'Small Header', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-small" /></label></p>';
496
  $return .= '<p><label>' . __( 'Adaptive Width', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-adapt" checked /></label></p>';
@@ -508,37 +747,52 @@ class cameronjonesweb_facebook_page_plugin_shortcode_generator {
508
 
509
  echo $return;
510
  }
511
- }
512
 
513
- //Register the widget
514
- function facebook_page_plugin_load_widget() {
515
- register_widget( 'cameronjonesweb_facebook_page_plugin_widget' );
516
  }
517
- add_action( 'widgets_init', 'facebook_page_plugin_load_widget' );
518
 
519
- function get_locale_xml() {
520
 
521
- $admin_abspath = str_replace( site_url(), ABSPATH, admin_url() );
522
 
523
- include_once( $admin_abspath . '/includes/class-wp-filesystem-base.php' );
524
- include_once( $admin_abspath . '/includes/class-wp-filesystem-direct.php' );
525
- $wp_filesystem = new WP_Filesystem_Direct( null );
526
 
527
- try {
528
- //$xml = file_get_contents('https://www.facebook.com/translations/FacebookLocales.xml');
529
- //$xml = file_get_contents( CJW_FBPP_PLUGIN_URL ) . 'lang.xml');
530
- $lang_xml = $wp_filesystem->get_contents( CJW_FBPP_PLUGIN_DIR . '/lang.xml');
531
- } catch( Exception $ex ){
532
- $lang_xml = NULL;
533
  }
534
 
535
- if(isset($lang_xml) && !empty($lang_xml)){
536
- $langs = new SimpleXMLElement($lang_xml);
537
- } else {
538
- $langs = NULL;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
539
  }
540
 
541
- return $langs;
542
  }
543
 
 
 
 
 
 
 
544
  $cameronjonesweb_facebook_page_plugin = new cameronjonesweb_facebook_page_plugin;
3
  * Plugin Name: Facebook Page Plugin
4
  * Plugin URI: https://cameronjonesweb.com.au/projects/facebook-page-plugin
5
  * Description: It's time to upgrade from your old like box! Display the Facebook Page Plugin from the Graph API using a shortcode or widget. Now available in 95 different languages
6
+ * Version: 1.6.0
7
  * Author: Cameron Jones
8
  * Author URI: https://cameronjonesweb.com.au
9
  * License: GPLv2
24
 
25
  class cameronjonesweb_facebook_page_plugin {
26
 
27
+ public static $remove_donate_notice_key = 'facebook_page_plugin_donate_notice_ignore';
28
+
29
  public function __construct() {
30
 
31
  define( 'CJW_FBPP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
32
  define( 'CJW_FBPP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
33
+ define( 'CJW_FBPP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
34
+ define( 'CJW_FBPP_PLUGIN_VER', '1.6.0' );
35
+ define( 'CJW_FBPP_PLUGIN_DONATE_LINK', 'https://www.patreon.com/cameronjonesweb' );
36
+ define( 'CJW_FBPP_PLUGIN_SURVEY_LINK', 'https://cameronjonesweb.typeform.com/to/BllbYm' );
37
 
38
  //Add all the hooks and actions
39
  add_shortcode( 'facebook-page-plugin', array( $this, 'facebook_page_plugin' ) );
40
  add_filter( 'widget_text', 'do_shortcode' );
41
  add_action( 'wp_dashboard_setup', array( $this, 'facebook_page_plugin_dashboard_widget' ) );
42
  add_action( 'admin_enqueue_scripts', array( $this, 'facebook_page_plugin_admin_resources' ) );
43
+ add_action( 'admin_init', array( $this, 'remove_donate_notice_nojs' ) );
44
+ add_action( 'admin_menu', array( $this, 'facebook_page_plugin_landing_page_menu' ) );
45
+ add_action( 'wp_ajax_facebook_page_plugin_latest_blog_posts_callback', array( $this, 'facebook_page_plugin_latest_blog_posts_callback' ) );
46
+ add_action( 'wp_ajax_facebook_page_plugin_other_plugins_callback', array( $this, 'facebook_page_plugin_other_plugins_callback' ) );
47
+ add_action( 'activated_plugin', array( $this, 'facebook_page_plugin_activation_hook' ) );
48
+ add_action( 'wp_ajax_facebook_page_plugin_remove_donate_notice', array( $this, 'remove_donate_notice' ) );
49
+ add_filter( 'plugin_action_links_' . CJW_FBPP_PLUGIN_BASENAME, array( $this, 'plugin_action_links' ) );
50
+ add_filter( 'plugin_row_meta', array( $this, 'plugin_meta_links' ), 10, 2 );
51
+
52
+ }
53
+
54
+
55
+ // Filter functions
56
+ private static function dashboard_widget_capability() {
57
+
58
+ $return = apply_filters( 'facebook_page_plugin_dashboard_widget_capability', 'edit_posts' );
59
+ return $return;
60
+
61
+ }
62
+
63
+
64
+ private static function app_id() {
65
+
66
+ $return = apply_filters( 'facebook_page_plugin_app_id', '846690882110183' );
67
+ return $return;
68
+
69
  }
70
 
71
 
72
  //Admin functions
73
+
74
+ public static function donate_notice() {
75
+
76
+ $return = NULL;
77
+
78
+ if( current_user_can( 'administrator' ) ) {
79
+
80
+ $user_id = get_current_user_id();
81
+
82
+ if ( !get_user_meta( $user_id, self::$remove_donate_notice_key ) || get_user_meta( $user_id, self::$remove_donate_notice_key ) === false ) {
83
+
84
+ $return .= '<div class="facebook-page-plugin-donate"><p>';
85
+
86
+ $return .= __( 'Thank you for using the Facebook Page Plugin. Please consider donating to support ongoing development. ', 'facebook-page-feed-graph-api' );
87
+
88
+ $return .= '</p><p>';
89
+
90
+ $return .= '<a href="' . CJW_FBPP_PLUGIN_DONATE_LINK . '" target="_blank" class="button button-secondary">' . __( 'Donate now', 'facebook-page-feed-graph-api' ) . '</a>';
91
+
92
+ $return .= '<a href="?' . self::$remove_donate_notice_key . '=0" class="notice-dismiss facebook-page-plugin-donate-notice-dismiss" title="' . __( 'Dismiss this notice', 'facebook-page-feed-graph-api' ) . '"><span class="screen-reader-text">' . __( 'Dismiss this notice', 'facebook-page-feed-graph-api' ) . '.</span></a>';
93
+
94
+ $return .= '</p></div>';
95
+
96
  }
97
+
98
  }
99
+
100
+ return $return;
101
+
102
  }
103
 
104
+ public static function remove_donate_notice() {
105
+
106
+ $user_id = get_current_user_id();
107
+
108
+ update_user_meta( $user_id, self::$remove_donate_notice_key, 'true', true );
109
+
110
+ if( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
111
+
112
+ wp_die();
113
+
114
+ }
115
+
116
+ }
117
+
118
+ public function remove_donate_notice_nojs() {
119
+
120
+ if ( isset( $_GET[self::$remove_donate_notice_key] ) && '0' == $_GET[self::$remove_donate_notice_key] ) {
121
+
122
+ self::remove_donate_notice();
123
+
124
  }
125
+
126
+ }
127
+
128
+
129
+ // Add a link to support on plugins listing
130
+ function plugin_action_links( $links ) {
131
+
132
+ $links[] = '<a href="https://wordpress.org/support/plugin/facebook-page-feed-graph-api" target="_blank">Support</a>';
133
+ return $links;
134
  }
135
 
136
+ //Add link on plugins listing to my plugins directory
137
+ function plugin_meta_links( $links, $file ) {
138
+
139
+ if ( $file == CJW_FBPP_PLUGIN_BASENAME ) {
140
+
141
+ $links[] = '<a href="https://profiles.wordpress.org/cameronjonesweb/#content-plugins" target="_blank">More plugins by cameronjonesweb</a>';
142
+
143
+ }
144
+
145
  return $links;
146
+
147
  }
148
 
149
+
150
  //Enqueue CSS and JS for admin
151
  public function facebook_page_plugin_admin_resources() {
152
+
153
  wp_enqueue_script( 'facebook-page-plugin-admin-scripts', CJW_FBPP_PLUGIN_URL . 'js/facebook-page-plugin-admin.js' );
154
  wp_enqueue_style( 'facebook-page-plugin-admin-styles', CJW_FBPP_PLUGIN_URL . 'css/facebook-page-plugin-admin.css' );
155
+
156
  }
157
 
158
  //Register the dashboard widget
159
  public function facebook_page_plugin_dashboard_widget() {
160
+
161
+ if( current_user_can( self::dashboard_widget_capability() ) ) {
162
+
163
+ wp_add_dashboard_widget( 'facebook-page-plugin-shortcode-generator', __( 'Facebook Page Plugin Shortcode Generator', 'facebook-page-feed-graph-api' ), array( $this, 'facebook_page_plugin_dashboard_widget_callback' ) );
164
+
165
+ }
166
+
167
  }
168
 
169
  //Load the dashboard widget
170
  function facebook_page_plugin_dashboard_widget_callback() {
171
+ echo '<a name="cameronjonesweb_facebook_page_plugin_shortcode_generator"></a>';
172
  $generator = new cameronjonesweb_facebook_page_plugin_shortcode_generator;
173
  $generator->generate();
174
 
175
  }
176
 
177
+ function facebook_page_plugin_landing_page_menu() {
178
+ add_submenu_page( 'plugins.php', __( 'Facebook Page Plugin by cameronjonesweb', 'facebook-page-feed-graph-api' ), 'Facebook Page Plugin', 'install_plugins', 'facebook-page-plugin', array( $this, 'facebook_page_plugin_landing_page' ) );
179
+ }
180
+
181
+ function facebook_page_plugin_landing_page() {
182
+
183
+ wp_enqueue_script( 'facebook-page-plugin-landing-page', CJW_FBPP_PLUGIN_URL . 'js/landing-page.js', array( 'jquery' ), NULL, true );
184
+ include CJW_FBPP_PLUGIN_DIR . '/inc/landing-page.php';
185
+
186
+ }
187
+
188
+ /*
189
+ * http://stackoverflow.com/a/4860432/1672694
190
+ */
191
+
192
+ function facebook_page_plugin_is_connected() {
193
+ $connected = @fsockopen( "cameronjonesweb.com.au", 80 );
194
+ if( $connected ){
195
+ $is_conn = true; //action when connected
196
+ fclose( $connected );
197
+ } else {
198
+ $is_conn = false; //action in connection failure
199
+ }
200
+ return $is_conn;
201
+ }
202
+
203
+ function facebook_page_plugin_latest_blog_posts_callback() {
204
+ $internet = $this->facebook_page_plugin_is_connected();
205
+ if( $internet ) {
206
+ $feed = 'https://cameronjonesweb.com.au/feed/';
207
+ $xml = simplexml_load_file( $feed, 'SimpleXMLElement', LIBXML_NOCDATA );
208
+ if( isset( $xml ) && !empty( $xml ) ) {
209
+ echo '<ul>';
210
+ foreach( $xml->channel->item as $blogpost ) {
211
+ echo '<li>';
212
+ echo date( 'M jS', strtotime( $blogpost->pubDate ) ) . ' - ';
213
+ echo '<a href="' . $blogpost->link . '">';
214
+ echo $blogpost->title;
215
+ echo '</a>';
216
+ echo '</li>';
217
+ }
218
+ echo '</ul>';
219
+ echo '<p><a href="https://cameronjonesweb.com.au/blog/" target="_blank">' . __( 'View more recent posts', 'facebook-page-feed-graph-api' ) . '</a></p>';
220
+ }
221
+ } else {
222
+ echo '<p><strong>' . __( 'No posts found.', 'facebook-page-feed-graph-api' ) . '</strong>' . __( 'Check your connection.', 'facebook-page-feed-graph-api' ) . '</p>';
223
+ }
224
+ wp_die();
225
+ }
226
+
227
+ function facebook_page_plugin_other_plugins_callback() {
228
+ $internet = $this->facebook_page_plugin_is_connected();
229
+ if ( ! function_exists( 'plugins_api' ) ){
230
+ require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
231
+ }
232
+ if( $internet ) {
233
+ $plugins = plugins_api( 'query_plugins', array(
234
+ 'author' => 'cameronjonesweb', 'fields' => array(
235
+ 'active_installs' => true,
236
+ 'description' => false,
237
+ 'icons' => true,
238
+ )
239
+ ) );
240
+ if( isset( $plugins ) && !empty( $plugins ) ) {
241
+ echo '<div>';
242
+ for( $i = 0; $i < count( $plugins->plugins ); $i++ ) {
243
+ if( $plugins->plugins[$i]->slug != 'facebook-page-feed-graph-api' ) {
244
+ echo '<div class="plugin-card">';
245
+ echo '<div class="plugin-card-top">';
246
+ if( !empty( $plugins->plugins[$i]->icons['1x'] ) ) {
247
+ echo '<img src="' . $plugins->plugins[$i]->icons['1x'] . '" alt="' . $plugins->plugins[$i]->name . ' Icon" />';
248
+ }
249
+ echo '<h4><strong>' . __( $plugins->plugins[$i]->name, 'facebook-page-feed-graph-api' ) . '</strong></h4>';
250
+ echo '<p>' . _e( $plugins->plugins[$i]->short_description, 'facebook-page-feed-graph-api' ) . '</p>';
251
+ echo '<p><a href="' . self_admin_url() . 'plugin-install.php?tab=plugin-information&plugin=' . $plugins->plugins[$i]->slug . '&TB_iframe=true&width=600&height=550" class="open-plugin-details-modal button" target="_blank" aria-label="More information about ' . __( $plugins->plugins[$i]->name, 'facebook-page-feed-graph-api' ) . '" data-title="' . __( $plugins->plugins[$i]->name, 'facebook-page-feed-graph-api' ) . '">' . __( 'Details &amp; Install', 'facebook-page-feed-graph-api' ) . '</a></p>';
252
+ echo '</div>';
253
+ echo '</div>';
254
+ }
255
+ }
256
+ echo '<div class="clear"></div>';
257
+ echo '</div>';
258
+ } else {
259
+ _e( 'No additional plugins available at this time.', 'facebook-page-feed-graph-api' );
260
+ }
261
+ } else {
262
+ echo '<p><strong>' . __( 'No plugins found.', 'facebook-page-feed-graph-api' ) . '</strong> ' . __( 'Check your connection.', 'facebook-page-feed-graph-api' ) . '</p>';
263
+ }
264
+ wp_die();
265
+ }
266
+
267
+ function facebook_page_plugin_activation_hook( $plugin ) {
268
+ if( $plugin == CJW_FBPP_PLUGIN_BASENAME ) {
269
+ exit( wp_redirect( admin_url( 'plugins.php?page=facebook-page-plugin' ) ) );
270
+ }
271
+ }
272
+
273
+
274
  //Client side stuff
275
+ function facebook_page_plugin_generate_wrapper_id() {
276
+ return substr( str_shuffle( str_repeat( implode( '', array_merge( range( 'A', 'Z' ), range( 'a', 'z' ) ) ), 5 ) ), 0, 15 );
277
+ }
278
+
279
  //Parse shortcode
280
  function facebook_page_plugin( $filter ) {
281
+ wp_enqueue_script( 'facebook-page-plugin-sdk', CJW_FBPP_PLUGIN_URL . 'js/sdk.js', array(), NULL, true );
282
  wp_enqueue_script( 'facebook-page-plugin-responsive-script', CJW_FBPP_PLUGIN_URL . 'js/responsive.min.js', 'jquery', NULL, true );
283
  $return = NULL;
284
  $a = shortcode_atts( array(
299
  ), $filter );
300
  if(isset($a['href']) && !empty($a['href'])){
301
  $a['language'] = str_replace("-", "_", $a['language']);
302
+
303
+ //Send the language as a parameter to the SDK
304
+ wp_localize_script( 'facebook-page-plugin-sdk', 'facebook_page_plugin_language', array( 'language' => $a['language'] ) );
305
+
306
+ $return .= '<div class="cameronjonesweb_facebook_page_plugin" data-version="' . CJW_FBPP_PLUGIN_VER . '" id="' . $this->facebook_page_plugin_generate_wrapper_id() . '">';
307
+ $return .= '<div id="fb-root"></div><script>(function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = d.createElement(s); js.id = id;js.src = "//connect.facebook.net/' . $a['language'] . '/sdk.js#xfbml=1&version=v2.5&appId=' . self::app_id() . '";fjs.parentNode.insertBefore(js, fjs); }(document, \'script\', \'facebook-jssdk\'));</script>';
308
  $return .= '<div class="fb-page" data-href="https://facebook.com/' . $a["href"] . '" ';
309
  if(isset($a['width']) && !empty($a['width'])){
310
  $return .= ' data-width="' . $a['width'] . '"';
365
  class cameronjonesweb_facebook_page_plugin_widget extends WP_Widget {
366
 
367
  private $facebookURLs = array('https://www.facebook.com/', 'https://facebook.com/', 'www.facebook.com/', 'facebook.com/');
368
+ private $settings;
369
 
370
  function __construct() {
371
+ $this->settings = new facebook_page_plugin_settings;
372
  parent::__construct( 'facebook_page_plugin_widget', __( 'Facebook Page Plugin', 'facebook-page-feed-graph-api' ), array( 'description' => __( 'Generates a Facebook Page feed in your widget area', 'facebook-page-feed-graph-api' ), ) );
373
  }
374
  public function widget( $args, $instance ) {
459
  $shortcode .= ' facepile="' . $facepile . '"';
460
  }
461
  if( isset( $tabs ) && !empty( $tabs ) ){
462
+ if( is_array( $tabs ) ) {
463
+ $shortcode .= ' tabs="';
464
+ for( $i = 0; $i < count( $tabs ); $i++ ) {
465
+ $shortcode .= $tabs[$i];
466
+ $shortcode .= ( $i != count( $tabs ) - 1 ? ',' : '' );
467
+ }
468
+ $shortcode .= '"';
469
+ } else {
470
+ $shortcode .= ' tabs="' . $tabs . '"';
471
+ }
472
  }
473
  if( isset( $language ) && !empty( $language ) ){
474
  $shortcode .= ' language="' . $language . '"';
494
  echo $args['after_widget'];
495
  }
496
  public function form( $instance ) {
497
+
498
  if ( isset( $instance[ 'title' ] ) ) {
499
  $title = $instance[ 'title' ];
500
  } else {
561
  $language = '';
562
  }
563
 
564
+ $langs = $this->settings->get_locale_xml();
565
+
566
+ echo cameronjonesweb_facebook_page_plugin::donate_notice();
567
 
568
  echo '<p>';
569
  echo '<label for="' . $this->get_field_id( 'title' ) . '">';
601
  echo '</label>';
602
  echo ' <input class="widefat" id="' . $this->get_field_id( 'facepile' ) . '" name="' . $this->get_field_name( 'facepile' ) . '" type="checkbox" value="true" ' . checked( esc_attr( $facepile ), 'true', false ) . ' />';
603
  echo '</p>';
604
+ echo '<p>';
605
+ _e( 'Page Tabs:', 'facebook-page-feed-graph-api' );
606
+ $CJW_FBPP_TABS = $this->settings->tabs();
607
+ if( !empty( $CJW_FBPP_TABS ) ) {
608
+ // First we should convert the string to an array as that's how it will be stored moving forward.
609
+ if( !is_array( $tabs ) ) {
610
+ $oldtabs = esc_attr( $tabs );
611
+ $newtabs = explode( ',', $tabs );
612
+ $tabs = $newtabs;
613
+ }
614
+ foreach( $CJW_FBPP_TABS as $tab ) {
615
+ echo '<br/><label>';
616
+ echo '<input type="checkbox" name="' . $this->get_field_name( 'tabs' ) . '[' . $tab . ']" ' . ( in_array( $tab, $tabs ) ? 'checked' : '' ) . ' /> ';
617
+ _e( ucfirst( $tab ), 'facebook-page-feed-graph-api' );
618
+ echo '</label>';
619
+ }
620
+ }
621
+ echo '</p>';
622
  echo '<p>';
623
  echo '<label for="' . $this->get_field_id( 'cta' ) . '">';
624
  _e( 'Hide Call To Action:', 'facebook-page-feed-graph-api' );
674
  $instance['height'] = ( ! empty( $new_instance['height'] ) ) ? strip_tags( $new_instance['height'] ) : '';
675
  $instance['cover'] = ( ! empty( $new_instance['cover'] ) ) ? strip_tags( $new_instance['cover'] ) : '';
676
  $instance['facepile'] = ( ! empty( $new_instance['facepile'] ) ) ? strip_tags( $new_instance['facepile'] ) : '';
677
+ if( !empty( $new_instance['tabs'] ) ) {
678
+ if( is_array( $new_instance['tabs'] ) ) {
679
+ foreach( $new_instance['tabs'] as $key => $var ) {
680
+ $instance['tabs'][] = sanitize_text_field( $key );
681
+ }
682
+ }
683
+ } else {
684
+ $instance['tabs'] = '';
685
+ }
686
  $instance['cta'] = ( ! empty( $new_instance['cta'] ) ) ? strip_tags( $new_instance['cta'] ) : '';
687
  $instance['small'] = ( ! empty( $new_instance['small'] ) ) ? strip_tags( $new_instance['small'] ) : '';
688
  $instance['adapt'] = ( ! empty( $new_instance['adapt'] ) ) ? strip_tags( $new_instance['adapt'] ) : '';
691
  $instance['language'] = ( ! empty( $new_instance['language'] ) ) ? strip_tags( $new_instance['language'] ) : '';
692
  return $instance;
693
  }
694
+
695
  } // Class wpb_widget ends here
696
 
697
  class cameronjonesweb_facebook_page_plugin_shortcode_generator {
698
 
699
  private $langs;
700
+ private $settings;
701
 
702
  function __construct() {
703
 
704
+ $this->settings = new facebook_page_plugin_settings;
705
+ $this->langs = $this->settings->get_locale_xml();
706
  }
707
 
708
  function generate() {
709
 
710
  $return = NULL;
711
 
712
+ $return .= cameronjonesweb_facebook_page_plugin::donate_notice();
713
+
714
+ $return .= '<noscript>' . __( 'The shortcode generator requires JavaScript enabled', 'facebook-page-feed-graph-api' ) . '</noscript>';
715
+
716
  $return .= '<form>';
717
  $return .= '<p><label>' . __( 'Facebook Page URL', 'facebook-page-feed-graph-api' ) . ': <input type="url" id="fbpp-href" /></label></p>';
718
  $return .= '<p><label>' . __( 'Width (pixels)', 'facebook-page-feed-graph-api' ) . ': <input type="number" max="500" min="180" id="fbpp-width" /></label></p>';
719
  $return .= '<p><label>' . __( 'Height (pixels)', 'facebook-page-feed-graph-api' ) . ': <input type="number" min="70" id="fbpp-height" /></label></p>';
720
  $return .= '<p><label>' . __( 'Show Cover Photo', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-cover" /></label></p>';
721
  $return .= '<p><label>' . __( 'Show Facepile', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-facepile" /></label></p>';
722
+ $return .= '<p><label>' . __( 'Page Tabs (formerly posts)', 'facebook-page-feed-graph-api' ) . ':';
723
+ $settings = new facebook_page_plugin_settings;
724
+ $CJW_FBPP_TABS = $settings->tabs();
725
+ if( !empty( $CJW_FBPP_TABS ) ) {
726
+ foreach( $CJW_FBPP_TABS as $tab ) {
727
+ $return .= '<br/><label>';
728
+ $return .= '<input type="checkbox" class="fbpp-tabs" name="' . $tab . '" /> ';
729
+ $return .= __( ucfirst( $tab ), 'facebook-page-feed-graph-api' );
730
+ $return .= '</label>';
731
+ }
732
+ }
733
  $return .= '<p><label>' . __( 'Hide Call To Action', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-cta" /></label></p>';
734
  $return .= '<p><label>' . __( 'Small Header', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-small" /></label></p>';
735
  $return .= '<p><label>' . __( 'Adaptive Width', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-adapt" checked /></label></p>';
747
 
748
  echo $return;
749
  }
 
750
 
 
 
 
751
  }
 
752
 
753
+ class facebook_page_plugin_settings {
754
 
755
+ public $tabs;
756
 
757
+ function __construct() {
758
+ $this->tabs = array( 'timeline', 'events', 'messages' );
759
+ }
760
 
761
+ function tabs() {
762
+ return $this->tabs;
 
 
 
 
763
  }
764
 
765
+ function get_locale_xml() {
766
+
767
+ $admin_abspath = str_replace( site_url(), ABSPATH, admin_url() );
768
+
769
+ include_once( $admin_abspath . '/includes/class-wp-filesystem-base.php' );
770
+ include_once( $admin_abspath . '/includes/class-wp-filesystem-direct.php' );
771
+ $wp_filesystem = new WP_Filesystem_Direct( null );
772
+
773
+ try {
774
+ //$xml = file_get_contents('https://www.facebook.com/translations/FacebookLocales.xml');
775
+ //$xml = file_get_contents( CJW_FBPP_PLUGIN_URL ) . 'lang.xml');
776
+ $lang_xml = $wp_filesystem->get_contents( CJW_FBPP_PLUGIN_DIR . '/lang.xml');
777
+ } catch( Exception $ex ){
778
+ $lang_xml = NULL;
779
+ }
780
+
781
+ if(isset($lang_xml) && !empty($lang_xml)){
782
+ $langs = new SimpleXMLElement($lang_xml);
783
+ } else {
784
+ $langs = NULL;
785
+ }
786
+
787
+ return $langs;
788
  }
789
 
 
790
  }
791
 
792
+ //Register the widget
793
+ function facebook_page_plugin_load_widget() {
794
+ register_widget( 'cameronjonesweb_facebook_page_plugin_widget' );
795
+ }
796
+ add_action( 'widgets_init', 'facebook_page_plugin_load_widget' );
797
+
798
  $cameronjonesweb_facebook_page_plugin = new cameronjonesweb_facebook_page_plugin;
faq.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "faqs": [
3
+ {
4
+ "question": "Where is the settings page?",
5
+ "answer": "There is no settings page for the Facebook Page Plugin. To add the plugin to a widget area, go to your <a href='widgets.php'>widgets</a> page, select Facebook Page Plugin from the list of available widgets, add it to your desired widget area and fill out the form. If you wish to use the plugin in a post or page, go to your <a href='index.php#cameronjonesweb_facebook_page_plugin_shortcode_generator'>dashboard</a> and fill out the shortcode generator. Copy the shortcode result and paste it into your post or page editor."
6
+ },
7
+ {
8
+ "question": "The plugin is blank or only displays a link",
9
+ "answer": "It's highly likely that you're using an ad-blocker or similar browser extension that is being blocking it. Turn off your ad-blocker or whitelist your website."
10
+ },
11
+ {
12
+ "question": "The plugin only shows when I'm logged in.",
13
+ "answer": "This means that your Facebook page has audience restrictions of age and/or location. If you want the plugin to display for all users, disable the audience restrictions in your page settings on Facebook."
14
+ },
15
+ {
16
+ "question": "The Facepile and/or posts aren't showing up",
17
+ "answer": "The chances are that they are loading, but your plugin isn't tall enough to display them. Make sure they're enabled properly and try increasing the height of the plugin to 500px and see if they are displaying."
18
+ },
19
+ {
20
+ "question": "It's still broken, where do I get help?",
21
+ "answer": "You can go to <a href='https://wordpress.org/support/plugin/facebook-page-feed-graph-api' target='_blank'>https://wordpress.org/support/plugin/facebook-page-feed-graph-api</a> and create a support ticket on WordPress.org, or you can email the developer at <a href='mailto:plugins@cameronjonesweb.com.au' target='_blank'>plugins@cameronjonesweb.com.au</a>. Please provide your website URL if possible and any console log errors."
22
+ }
23
+ ],
24
+
25
+ "changelog": [
26
+ {
27
+ "version": "1.5.3",
28
+ "changes": [
29
+ "Fixed bug where share button would return \"App Not Setup\" error"
30
+ ]
31
+ },
32
+ {
33
+ "version": "1.6",
34
+ "changes": [
35
+ "Tabs are now checkboxes and the events tab is now available",
36
+ "New landing page to provide help new users"
37
+ ]
38
+ }
39
+ ]
40
+ }
images/banner-772x250.jpg ADDED
Binary file
inc/landing-page.php ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php defined( 'ABSPATH' ) or die();
2
+ $currentuser = wp_get_current_user();
3
+ $internet = $this->facebook_page_plugin_is_connected(); ?>
4
+ <div class="wrap">
5
+
6
+ <h1>Facebook Page Plugin</h1>
7
+
8
+ <div class="welcome-panel">
9
+ <div class="welcome-panel-content">
10
+ <img src="<?php echo CJW_FBPP_PLUGIN_URL; ?>/images/banner-772x250.jpg" class="welcome-panel-image">
11
+ <p class="about-description"><?php _e( 'Thank you for downloading the Facebook Page Plugin by cameronjonesweb! You\'ve joined more than 10,000 other WordPress websites using this plugin to display a Facebook Page on their site. To help introduce you to the plugin, I\'ve created this page full of useful information. Please enjoy using my Facebook Page Plugin and let me know how it works for you!', 'facebook-page-feed-graph-api' ); ?></p>
12
+ </div>
13
+ </div>
14
+ <div id="dashboard-widgets-wrap">
15
+ <div id="dashboard-widgets" class="metabox-holder">
16
+ <div id="postbox-container-1" class="postbox-container">
17
+ <div class="meta-box-sortables">
18
+ <div class="postbox">
19
+ <div class="main inside">
20
+ <h2><abbr title="Frequently Asked Questions"><?php _e( 'FAQs', 'facebook-page-feed-graph-api' ); ?></abbr></h2>
21
+ <?php $file = CJW_FBPP_PLUGIN_DIR . '/faq.json';
22
+ $json = file_get_contents( $file );
23
+ $faq_obj = json_decode( $json );
24
+ if( !empty( $faq_obj->faqs ) ) {
25
+ echo '<ul>';
26
+ foreach( $faq_obj->faqs as $faq ) {
27
+ echo '<li>';
28
+ echo '<strong>';
29
+ _e( $faq->question, 'facebook-page-feed-graph-api' );
30
+ echo '</strong>';
31
+ echo '<p>';
32
+ _e( $faq->answer, 'facebook-page-feed-graph-api' );
33
+ echo '</p>';
34
+ echo '</li>';
35
+ }
36
+ echo '</ul>';
37
+ } else {
38
+ _e( 'There was a problem retrieving the FAQs.', 'facebook-page-feed-graph-api' );
39
+ } ?>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ <div class="meta-box-sortables">
44
+ <div class="postbox">
45
+ <div class="main inside">
46
+ <h2>Changelog</h2>
47
+ <h3>New in version <?php echo CJW_FBPP_PLUGIN_VER; ?></h3>
48
+ <?php if( !empty( $faq_obj->changelog ) ) {
49
+ foreach( $faq_obj->changelog as $version ) {
50
+ if( $version->version == CJW_FBPP_PLUGIN_VER ) {
51
+ echo '<ul>';
52
+ foreach( $version->changes as $change ) {
53
+ echo '<li>';
54
+ _e( $change, 'facebook-page-feed-graph-api' );
55
+ echo '</li>';
56
+ }
57
+ echo '</ul>';
58
+ echo '<a href="https://wordpress.org/plugins/facebook-page-feed-graph-api/changelog/" target="_blank">View full changelog</a>';
59
+ }
60
+ }
61
+ } ?>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ <div id="postbox-container-2" class="postbox-container">
67
+ <div class="meta-box-sortables">
68
+ <div class="postbox">
69
+ <div class="main inside">
70
+ <h3><i class="dashicons dashicons-heart"></i> <?php _e( 'Donate', 'facebook-page-feed-graph-api' ); ?></h3>
71
+ <p><?php _e( 'Development relies on donations from kind-hearted supporters of the Facebook Page Plugin. If you\'re enjoying the plugin,', 'facebook-page-feed-graph-api' ); ?> <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=WLV5HPHSPM2BG&lc=AU&item_name=cameronjonesweb%20-%20Facebook%20Page%20Plugin&¤cy_code=AUD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted" target="_blank"><?php _e( 'please donate today', 'facebook-page-feed-graph-api' ); ?></a>.</p>
72
+ </div>
73
+ </div>
74
+ <div class="postbox">
75
+ <div class="main inside">
76
+ <h3><i class="dashicons dashicons-email-alt"></i> <?php _e( 'Plugin Newsletter', 'facebook-page-feed-graph-api' ); ?></h3>
77
+ <p><?php _e( 'Subscribe today to receive the latest updates for the Facebook Page Plugin', 'facebook-page-feed-graph-api' ); ?></p>
78
+ <!-- Begin MailChimp Signup Form -->
79
+ <div id="mc_embed_signup">
80
+ <form action="//cameronjonesweb.us10.list-manage.com/subscribe/post?u=507cd0221f4894316c903e99b&amp;id=8d3d7b8378" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
81
+ <div id="mc_embed_signup_scroll">
82
+ <input type="email" value="<?php echo $currentuser->user_email; ?>" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
83
+ <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
84
+ <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_507cd0221f4894316c903e99b_8d3d7b8378" tabindex="-1" value=""></div>
85
+ <input type="submit" value="<?php _e( 'Subscribe', 'facebook-page-feed-graph-api' ); ?>" name="subscribe" id="mc-embedded-subscribe" class="button">
86
+ <div class="clear"></div>
87
+ </div>
88
+ </form>
89
+ </div>
90
+ <!--End mc_embed_signup-->
91
+ </div>
92
+ </div>
93
+ <div class="postbox">
94
+ <div class="main inside">
95
+ <h3><i class="dashicons dashicons-star-filled"></i> <?php _e( 'Leave A Review', 'facebook-page-feed-graph-api' ); ?></h3>
96
+ <p><?php _e( 'Is this the best plugin for adding a Facebook Page to your WordPress website?', 'facebook-page-feed-graph-api' ); ?> <a href="https://wordpress.org/support/view/plugin-reviews/facebook-page-feed-graph-api#new-post" target="_blank"><?php _e( 'Let me know', 'facebook-page-feed-graph-api' ); ?></a>!</p>
97
+ <p><?php echo __( 'If there\'s a problem, please open a support ticket on', 'facebook-page-feed-graph-api' ) . ' <a href="https://github.com/cameronjonesweb/facebook-page-feed-graph-api/issues" target="_blank">' . __( 'GitHub', 'facebook-page-feed-graph-api' ) . '</a>' . __( ', on', 'facebook-page-feed-graph-api' ) . ' <a href="https://wordpress.org/support/plugin/facebook-page-feed-graph-api" target="_blank">' . __( 'WordPress.org', 'facebook-page-feed-graph-api' ) . '</a>' . __( ' or ', 'facebook-page-feed-graph-api' ) . '<a href="mailto:plugins@cameronjonesweb.com.au" target="_blank">' . __( 'email me', 'facebook-page-feed-graph-api' ) . '</a>.'; ?></p>
98
+ </div>
99
+ </div>
100
+ <div class="postbox">
101
+ <div class="main inside">
102
+ <h3><i class="dashicons dashicons-chart-line"></i> <?php _e( 'Take The Survey', 'facebook-page-feed-graph-api' ); ?></h3>
103
+ <p><?php _e( 'Want to have your say about the Facebook Page Plugin?', 'facebook-page-feed-graph-api' ); ?></p>
104
+ <p><a href="<?php echo CJW_FBPP_PLUGIN_SURVEY_LINK; ?>" class="button" target="_blank"><?php _e( 'Take The Survey!', 'facebook-page-feed-graph-api' ); ?></a></p>
105
+ </div>
106
+ </div>
107
+ <div class="postbox">
108
+ <div class="main inside">
109
+ <h3><i class="dashicons dashicons-admin-plugins"></i> <?php _e( 'More Free Plugins by cameronjonesweb', 'facebook-page-feed-graph-api' ); ?></h3>
110
+ <p><?php _e( 'Help support the developer by using more of my plugins!', 'facebook-page-feed-graph-api' ); ?></p>
111
+ <?php add_thickbox(); ?>
112
+ <div id="plugins-target">
113
+ <span class="spinner is-active"></span>
114
+ </div>
115
+ </div>
116
+ </div>
117
+ <div class="postbox">
118
+ <div class="main inside">
119
+ <h3><i class="dashicons dashicons-testimonial"></i> <?php _e( 'Latest News From The Developer', 'facebook-page-feed-graph-api' ); ?></h3>
120
+ <div id="blog-posts-target">
121
+ <span class="spinner is-active"></span>
122
+ </div>
123
+ </div>
124
+ </div>
125
+ </div>
126
+ </div>
127
+ </div>
128
+ </div>
129
+ </div>
js/facebook-page-plugin-admin.js CHANGED
@@ -1,8 +1,13 @@
1
  (function($){
 
2
  $(document).ready(function(){
 
3
  $('#facebook-page-plugin-shortcode-generator form').submit(function(e){
 
4
  e.preventDefault();
 
5
  });
 
6
  var $facebookURLs = ['https://www.facebook.com/', 'https://facebook.com/', 'www.facebook.com/', 'facebook.com/'];
7
  $('#facebook-page-plugin-shortcode-generator input, #facebook-page-plugin-shortcode-generator select').change(function(){
8
  if( $('#fbpp-link').prop("checked") == false ) {
@@ -30,8 +35,22 @@
30
  $shortcode += 'cover="' + $cover + '" ';
31
  var $facepile = $('#fbpp-facepile').prop("checked");
32
  $shortcode += 'facepile="' + $facepile + '" ';
33
- var $tabs = $('#fbpp-tabs').val();
34
- $shortcode += 'tabs="' + $tabs + '" ';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  var $cta = $('#fbpp-cta').prop("checked");
36
  $shortcode += 'cta="' + $cta + '" ';
37
  var $small = $('#fbpp-small').prop("checked");
@@ -50,7 +69,41 @@
50
  }
51
  $shortcode += ']';
52
  $('#facebook-page-plugin-shortcode-generator-output').val($shortcode);
 
53
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  });
 
55
  });
 
56
  }(jQuery));
1
  (function($){
2
+
3
  $(document).ready(function(){
4
+
5
  $('#facebook-page-plugin-shortcode-generator form').submit(function(e){
6
+
7
  e.preventDefault();
8
+
9
  });
10
+
11
  var $facebookURLs = ['https://www.facebook.com/', 'https://facebook.com/', 'www.facebook.com/', 'facebook.com/'];
12
  $('#facebook-page-plugin-shortcode-generator input, #facebook-page-plugin-shortcode-generator select').change(function(){
13
  if( $('#fbpp-link').prop("checked") == false ) {
35
  $shortcode += 'cover="' + $cover + '" ';
36
  var $facepile = $('#fbpp-facepile').prop("checked");
37
  $shortcode += 'facepile="' + $facepile + '" ';
38
+ var $tabs = [];
39
+ $('.fbpp-tabs').each(function(){
40
+ if( $(this).prop('checked') == true ) {
41
+ $tabs.push( $(this).attr('name' ) );
42
+ }
43
+ });
44
+ if($tabs.length > 0){
45
+ var $tabstring = '';
46
+ for( $i = 0; $i < $tabs.length; $i++ ) {
47
+ $tabstring += $tabs[$i];
48
+ if( $i != $tabs.length - 1 ) {
49
+ $tabstring += ','
50
+ }
51
+ }
52
+ $shortcode += 'tabs="' + $tabstring + '" ';
53
+ }
54
  var $cta = $('#fbpp-cta').prop("checked");
55
  $shortcode += 'cta="' + $cta + '" ';
56
  var $small = $('#fbpp-small').prop("checked");
69
  }
70
  $shortcode += ']';
71
  $('#facebook-page-plugin-shortcode-generator-output').val($shortcode);
72
+
73
  }
74
+
75
+ });
76
+
77
+ jQuery( document ).on( 'click', '.facebook-page-plugin-donate-notice-dismiss', function(e){
78
+
79
+ e.preventDefault();
80
+
81
+ var $notice = jQuery(this).parents('.facebook-page-plugin-donate');
82
+
83
+ jQuery.ajax({
84
+
85
+ type: "POST",
86
+ url: ajaxurl,
87
+ data: {
88
+
89
+ action: 'facebook_page_plugin_remove_donate_notice',
90
+
91
+ },
92
+ success: function() {
93
+
94
+ $notice.fadeOut();
95
+
96
+ },
97
+ error: function( data ) {
98
+
99
+ console.log( data );
100
+
101
+ }
102
+
103
+ });
104
+
105
  });
106
+
107
  });
108
+
109
  }(jQuery));
js/landing-page.js ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($){
2
+ $(document).ready(function(){
3
+ $.ajax({
4
+ type: "GET",
5
+ url: ajaxurl,
6
+ data: {
7
+ action: 'facebook_page_plugin_other_plugins_callback',
8
+ },
9
+ success: function( result ){
10
+ $('#plugins-target').html(result);
11
+ },
12
+ error: function( result ) {
13
+ $('#plugins-target').html("There was an error retrieving the plugins");
14
+ }
15
+ });
16
+ $.ajax({
17
+ type: "GET",
18
+ url: ajaxurl,
19
+ data: {
20
+ action: 'facebook_page_plugin_latest_blog_posts_callback',
21
+ },
22
+ success: function( result ){
23
+ $('#blog-posts-target').html(result);
24
+ },
25
+ error: function( result ) {
26
+ $('#blog-posts-target').html("There was an error retrieving the RSS feed");
27
+ }
28
+ });
29
+ });
30
+ })(jQuery);
js/sdk.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = d.createElement(s); js.id = id;js.src = "//connect.facebook.net/" + facebook_page_plugin_language.language + "/sdk.js#xfbml=1&version=v2.4";fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));
license ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ {description}
294
+ Copyright (C) {year} {fullname}
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ {signature of Ty Coon}, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
readme.md ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Facebook Page Plugin
2
+ by @cameronjonesweb
3
+
4
+ It's time to upgrade from your old like box! Display the Facebook Page Plugin from the Graph API using a shortcode or widget.
5
+
6
+
7
+ ## Description
8
+ Seamlessly add a Facebook Page to your WordPress website with the Facebook Page Plugin! Trusted by more than 20,000 WordPress websites worldwide, the Facebook Page Plugin is the simplest way to add a Facebook page to your website.
9
+
10
+ You can add your Facebook page to any widget area with the custom Facebook Page Plugin widget, with live preview available in the Customizer.
11
+
12
+ The plugin can be used to add your Facebook page to any post, page or text widget by using the `[facebook-page-plugin]` shortcode to display the plugin wherever you like, as often as you like.
13
+
14
+ Other features include:
15
+
16
+ * A shortcode generator on the admin dashboard for easy generating of the shortcode
17
+
18
+ * Uses your site language by default, but you can display your Facebook page in all 95 languages that Facebook supports, including English, Spanish, Arabic, German, French, Russian and many more
19
+
20
+ With more than 20,000 installs and nearly 50 5-star rating, the Facebook Page Plugin is one of the most popular social media plugins for WordPress.
21
+
22
+
23
+ ## Frequently Asked Questions
24
+
25
+ ### What happened to "Show Posts"?
26
+ The latest version of the API has removed show posts and replaced it with `tabs` which is more dynamic. To show just the posts, your tabs value should be "timeline". To hide the posts, `tabs` should be empty (shortcode) or select "none" (widget). If you're using the shortcode, remember that by default it shows the timeline so you must set it as either an empty or false value to hide posts ie `tabs=""` or `tabs="false"`. If the posts option is already being used it will be converted to tabs.
27
+
28
+ ### What languages are available?
29
+ As of version 1.2.0, the plugin is available in all languages provided by Facebook ( full list availabe [here](https://www.facebook.com/translations/FacebookLocales.xml) ). By default it uses the same language as the site, but alternatively you can specify the language in the shortcode. The dashboard widget is currently only available in English but is multilingual ready.
30
+
31
+ ### My Facebook page isn't loading
32
+ If the URL for your page is http://facebook.com/ABC123 then when you use the shortcode don't include the domain, instead use like so: `[facebook-page-plugin href="ABC123"]`
33
+ Also, if your page has only just been created it may take some time for the API to load the page. Just be patient
34
+
35
+ ### What versions of WordPress will this plugin work on? ###
36
+ Shortcodes were introduced in WordPress 2.5, so theorectially it should work on all sites that are at least 2.5, however it has only been tested on versions 4.0 and up, and no guarantee will be made concerning earlier versions
37
+
38
+ ### I can only see a link, the plugin won't load
39
+ By default the plugin will display a link to your page while the page plugin loads. If the page plugin doesn't load, this could happen for a number of reasons. Your connection could be very slow, you could have JavaScript disabled, you could have an ad blocker or similar browser extension blocking the plugin or there could be an error in the information you have provided in the widget or shortcode.
40
+
41
+ ### I can't get the Facepile to work!
42
+ Chances are your plugin isn't tall enough to display the facepile properly. The facepile requires the plugin to have a minimum height of 214 pixels, or 154 pixel if using the small header.
43
+
44
+
45
+ ## Screenshots
46
+ 1. Installation example
47
+ 1. Example of the new widget introduced in version 1.2.0
48
+ 1. The new shortcode generator dashboard widget
49
+
50
+
51
+ ## Changelog
52
+
53
+ ### 1.6.0 - 02/04/17
54
+ * New landing page with FAQs to help with onboarding of new users
55
+ * Removal of the admin notice review nag
56
+ * Localisation of SDK
57
+ * Added `events` option to the widget and shortcode generator
58
+ * Changed `tabs` setting to checkboxes instead of a dropdown
59
+
60
+ ### 1.5.3 - 25/01/16
61
+ * Fixed bug where share button would return `App Not Setup` error
62
+
63
+ ### 1.5.2 - 01/12/15
64
+ * Fixed bug where plugin would rerender during scroll on mobile devices
65
+
66
+ ### 1.5.1 - 29/11/15
67
+ * Fixed bug where plugin wouldn't rerender
68
+ * Fixed bug with languages XML file not loading on installs where the admin is not wp-admin
69
+
70
+ ### 1.5.0 - 23/11/15
71
+ * Migrated to object oriented
72
+ * Fixed languages XML file being blocked by iThemes Security
73
+ * Fixed HTML issue with dashboard widget
74
+ * Added script that makes the plugin fully responsive
75
+
76
+ ### 1.4.2 - 23/09/15
77
+ * Fixing shortcode not being updated when tabs change in the shortcode generator
78
+ * Removing link text parameter and option when `Show Link` is false
79
+
80
+ ### 1.4.1 - 22/09/15
81
+ * Fixing shortcode generator using posts instead of tabs
82
+ * Verifying compatibility with 4.3.1
83
+
84
+ ### 1.4.0 - 03/09/15
85
+ * Options to remove and customise the page link that displays while the plugin loads
86
+ * Fixed `undefined index` error when adding a new instance of the plugin in the customizer
87
+ * Updated all admin text to be multi-lingual compatible
88
+ * Updated `posts` option to `tabs`
89
+ * Updated screenshots and example
90
+
91
+ ### 1.3.4 - 13/08/15
92
+ * Fixed typo in widget
93
+ * Fixed labels in widget
94
+ * Changed languages to load from a local file instead of Facebook's Locales XML file. This fixes the issue where approximately 40 languages were supported by Facebook but not for the page plugin, and also users working locally without internet access are now able to change the language from default.
95
+ * Re-introduced App ID, while it should not be needed it appears that removing it has affected some sites.
96
+
97
+ ### 1.3.3 - 11/08/15
98
+ * Direct access security update
99
+ * Verifying compatibility with WP 4.2.4 and WP 4.3
100
+ * Fixing bug where some options in the widget would revert to the default instead of false
101
+
102
+ ### 1.3.2 - 25/07/15
103
+ * WP 4.2.3 Compatibility
104
+ * Upgrading to Graph API 2.4
105
+
106
+ ### 1.3.0 - 02/07/15
107
+ * Added hide-cta, small-header and adapt-container-width settings
108
+ * Adjusted min height and width
109
+
110
+ ### 1.2.5 - 06/06/15
111
+ * Fixed close icon on notice
112
+
113
+ ### 1.2.4 - 05/06/15
114
+ * Fixed readme
115
+
116
+ ### 1.2.3 - 04/06/15
117
+ * Fixed bug where the admin dashboard and widgets pages would break if the WordPress installation is running on localhost and there is no internet connection
118
+
119
+ ### 1.2.2 - 27/05/15
120
+ * Fixed posts option for widget
121
+
122
+ ### 1.2.1 - 27/05/15
123
+ * Fixed readme bug
124
+
125
+ ### 1.2.0 - 26/05/15
126
+ * Added multilingual support. Language can be specified in the shortcode, otherwise it is retrievd from the site settings.
127
+ * Added a shortcode generator dashboard widget to allow easier creation of the shortcode
128
+ * Added a custom widget
129
+
130
+ ### 1.1.1 - 14/05/15
131
+ * Fixed height bug
132
+
133
+ ### 1.1.0 - 10/05/15
134
+ * Added filter to allow calling of shortcodes in the text widget
135
+
136
+ ### 1.0.3 - 28/04/15
137
+ * Fixing screenshot issue
138
+
139
+ ### 1.0.1 - 28/04/15
140
+ * Cleaning up readme file
141
+
142
+ ### 1.0 - 25/04/15
143
+ * Initial release
144
+
145
+
146
+ ## Plugin Settings
147
+
148
+ The Facebook Page Plugin uses a shortcode to insert the page feed. You set your settings within the shortcode.
149
+ `[facebook-page-plugin setting="value"]`
150
+ Available settings:
151
+
152
+ `href` (URL path that comes after facebook.com/)
153
+
154
+ `width` (number, in pixels, between 180 and 500, default 340)
155
+
156
+ `height` (number, in pixels, minimum 70, default 500)
157
+
158
+ `cover` (true/false, show page cover photo, default true)
159
+
160
+ `facepile` (true/false, show facepile, default true)
161
+
162
+ `tabs` (any combination of [posts, messages, events], default timeline)
163
+
164
+ `cta` (true/false, hide custom call to action if applicable, default false)
165
+
166
+ `small` (true/false, display small header (must be true for height to be lower than 130px), default false)
167
+
168
+ `adapt` (true/false, force plugin to be responsive, default true)
169
+
170
+ `language` (languageCode_countryCode eg: en_US, language of the plugin, default site language)
171
+
172
+ * Deprecated Settings *
173
+
174
+ `posts` (true/false) - posts has been replaced by tabs as of 1.4.0. There is a fallback in place to convert it to tabs
175
+
176
+ Example: `[facebook-page-plugin href="facebook" width="300" height="500" cover="true" facepile="true" tabs="timeline" adapt="true"]`
177
+ This will display a Facebook page feed that loads in the page `facebook.com/facebook` that is 300px wide but adapts to it's container, 500px high, displaying the page's cover photo, facepile and recent posts in the same language as the site. See the screenshots tab for a demonstration of how it will appear
178
+
179
+
180
+ ## Filter Reference
181
+
182
+ `facebook_page_plugin_dashboard_widget_capability`
183
+
184
+ Changes who can see the shortcode generator on the dashboard. Default: `edit_posts`
185
+
186
+ `facebook_page_plugin_app_id`
187
+
188
+ Changes the Facebook App ID.
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: like box,facebook like box,facebook page plugin, facebook feed, facebook p
4
  Donate link: https://www.patreon.com/cameronjonesweb
5
  Requires at least: 4.0
6
  Tested up to: 4.7.3
7
- Stable tag: 1.6.0
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
 
@@ -57,6 +57,10 @@ Chances are your plugin isn't tall enough to display the facepile properly. The
57
 
58
  == Changelog ==
59
 
 
 
 
 
60
  = 1.6.0 - 02/04/17 =
61
  * New landing page with FAQs to help with onboarding of new users
62
  * Removal of the admin notice review nag
4
  Donate link: https://www.patreon.com/cameronjonesweb
5
  Requires at least: 4.0
6
  Tested up to: 4.7.3
7
+ Stable tag: 1.6.1
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
 
57
 
58
  == Changelog ==
59
 
60
+ = 1.6.1 - 11/04/17 =
61
+ * Adding text domain header
62
+ * Adding implementation indicator for debugging
63
+
64
  = 1.6.0 - 02/04/17 =
65
  * New landing page with FAQs to help with onboarding of new users
66
  * Removal of the admin notice review nag
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png CHANGED
Binary file