Responsive Facebook Page Plugin - Version 1.6.3

Version Description

  • 01/04/18 =
  • Improved string translations
  • Updated Graph API from v2.5 to v2.12
  • Fail gracefully when SimpleXML isn't installed
  • Fixed changelog link
  • Updated the plugin display name to avoid potential trademark issues
Download this release

Release Info

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

Code changes from version 1.6.2 to 1.6.3

Files changed (5) hide show
  1. facebook-page-feed-graph-api.php +131 -164
  2. faq.json +13 -7
  3. inc/landing-page.php +43 -32
  4. js/landing-page.js +0 -13
  5. readme.md +10 -3
facebook-page-feed-graph-api.php CHANGED
@@ -1,24 +1,24 @@
1
  <?php
2
  /**
3
- * Plugin Name: Facebook Page Plugin
4
  * Plugin URI: https://cameronjonesweb.com.au/wordpress-plugins/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.2
7
  * Author: Cameron Jones
8
  * Author URI: https://cameronjonesweb.com.au
9
  * License: GPLv2
10
  * Text Domain: facebook-page-feed-graph-api
11
 
12
- * Copyright 2015-2017 Cameron Jones (email : plugins@cameronjonesweb.com.au)
13
 
14
- This program is free software; you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License, version 2, as
16
- published by the Free Software Foundation.
17
 
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU General Public License for more details.
22
  */
23
 
24
  defined( 'ABSPATH' ) or die();
@@ -32,7 +32,7 @@ class cameronjonesweb_facebook_page_plugin {
32
  define( 'CJW_FBPP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
33
  define( 'CJW_FBPP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
34
  define( 'CJW_FBPP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
35
- define( 'CJW_FBPP_PLUGIN_VER', '1.6.2' );
36
  define( 'CJW_FBPP_PLUGIN_DONATE_LINK', 'https://www.patreon.com/cameronjonesweb' );
37
  define( 'CJW_FBPP_PLUGIN_SURVEY_LINK', 'https://cameronjonesweb.typeform.com/to/BllbYm' );
38
 
@@ -44,7 +44,6 @@ class cameronjonesweb_facebook_page_plugin {
44
  add_action( 'admin_init', array( $this, 'remove_donate_notice_nojs' ) );
45
  add_action( 'admin_menu', array( $this, 'facebook_page_plugin_landing_page_menu' ) );
46
  add_action( 'wp_ajax_facebook_page_plugin_latest_blog_posts_callback', array( $this, 'facebook_page_plugin_latest_blog_posts_callback' ) );
47
- add_action( 'wp_ajax_facebook_page_plugin_other_plugins_callback', array( $this, 'facebook_page_plugin_other_plugins_callback' ) );
48
  add_action( 'activated_plugin', array( $this, 'facebook_page_plugin_activation_hook' ) );
49
  add_action( 'wp_ajax_facebook_page_plugin_remove_donate_notice', array( $this, 'remove_donate_notice' ) );
50
  add_filter( 'plugin_action_links_' . CJW_FBPP_PLUGIN_BASENAME, array( $this, 'plugin_action_links' ) );
@@ -176,7 +175,7 @@ class cameronjonesweb_facebook_page_plugin {
176
  }
177
 
178
  function facebook_page_plugin_landing_page_menu() {
179
- 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' ) );
180
  }
181
 
182
  function facebook_page_plugin_landing_page() {
@@ -191,84 +190,52 @@ class cameronjonesweb_facebook_page_plugin {
191
  */
192
 
193
  function facebook_page_plugin_is_connected() {
194
- $connected = @fsockopen( "cameronjonesweb.com.au", 80 );
195
- if( $connected ){
196
- $is_conn = true; //action when connected
197
- fclose( $connected );
198
- } else {
199
- $is_conn = false; //action in connection failure
200
- }
201
- return $is_conn;
202
  }
203
 
204
  function facebook_page_plugin_latest_blog_posts_callback() {
 
 
 
 
 
 
205
  $internet = $this->facebook_page_plugin_is_connected();
206
- if( $internet ) {
207
  $feed = 'https://cameronjonesweb.com.au/feed/';
208
  $xml = simplexml_load_file( $feed, 'SimpleXMLElement', LIBXML_NOCDATA );
209
  if( isset( $xml ) && !empty( $xml ) ) {
210
- echo '<ul>';
 
211
  foreach( $xml->channel->item as $blogpost ) {
212
- echo '<li>';
213
- echo date( 'M jS', strtotime( $blogpost->pubDate ) ) . ' - ';
214
- echo '<a href="' . $blogpost->link . '">';
215
- echo $blogpost->title;
216
- echo '</a>';
217
- echo '</li>';
218
  }
219
- echo '</ul>';
220
- echo '<p><a href="https://cameronjonesweb.com.au/blog/" target="_blank">' . __( 'View more recent posts', 'facebook-page-feed-graph-api' ) . '</a></p>';
221
  }
222
- } else {
223
- echo '<p><strong>' . __( 'No posts found.', 'facebook-page-feed-graph-api' ) . '</strong>' . __( 'Check your connection.', 'facebook-page-feed-graph-api' ) . '</p>';
224
  }
225
- wp_die();
226
- }
227
-
228
- function facebook_page_plugin_other_plugins_callback() {
229
- $internet = $this->facebook_page_plugin_is_connected();
230
- if ( ! function_exists( 'plugins_api' ) ){
231
- require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
232
- }
233
- if( $internet ) {
234
- $plugins = plugins_api( 'query_plugins', array(
235
- 'author' => 'cameronjonesweb', 'fields' => array(
236
- 'active_installs' => true,
237
- 'description' => false,
238
- 'icons' => true,
239
- )
240
- ) );
241
- if( isset( $plugins ) && !empty( $plugins ) ) {
242
- echo '<div>';
243
- for( $i = 0; $i < count( $plugins->plugins ); $i++ ) {
244
- if( $plugins->plugins[$i]->slug != 'facebook-page-feed-graph-api' ) {
245
- echo '<div class="plugin-card">';
246
- echo '<div class="plugin-card-top">';
247
- if( !empty( $plugins->plugins[$i]->icons['1x'] ) ) {
248
- echo '<img src="' . $plugins->plugins[$i]->icons['1x'] . '" alt="' . $plugins->plugins[$i]->name . ' Icon" />';
249
- }
250
- echo '<h4><strong>' . __( $plugins->plugins[$i]->name, 'facebook-page-feed-graph-api' ) . '</strong></h4>';
251
- echo '<p>' . _e( $plugins->plugins[$i]->short_description, 'facebook-page-feed-graph-api' ) . '</p>';
252
- 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>';
253
- echo '</div>';
254
- echo '</div>';
255
- }
256
- }
257
- echo '<div class="clear"></div>';
258
- echo '</div>';
259
- } else {
260
- _e( 'No additional plugins available at this time.', 'facebook-page-feed-graph-api' );
261
- }
262
- } else {
263
- echo '<p><strong>' . __( 'No plugins found.', 'facebook-page-feed-graph-api' ) . '</strong> ' . __( 'Check your connection.', 'facebook-page-feed-graph-api' ) . '</p>';
264
- }
265
- wp_die();
266
  }
267
 
268
  function facebook_page_plugin_activation_hook( $plugin ) {
269
  if( $plugin == CJW_FBPP_PLUGIN_BASENAME ) {
270
- exit( wp_redirect( admin_url( 'plugins.php?page=facebook-page-plugin' ) ) );
271
- }
272
  }
273
 
274
 
@@ -283,8 +250,8 @@ class cameronjonesweb_facebook_page_plugin {
283
  wp_enqueue_script( 'facebook-page-plugin-responsive-script', CJW_FBPP_PLUGIN_URL . 'js/responsive.min.js', 'jquery', NULL, true );
284
  $return = NULL;
285
  $a = shortcode_atts( array(
286
- 'href' => NULL,
287
- 'width' => 340,
288
  'height' => 130,
289
  'cover' => NULL,
290
  'facepile' => NULL,
@@ -298,7 +265,7 @@ class cameronjonesweb_facebook_page_plugin {
298
  'linktext' => NULL,
299
  'standard' => 'html5',
300
  '_implementation' => 'shortcode'
301
- ), $filter );
302
  if(isset($a['href']) && !empty($a['href'])){
303
  $a['language'] = str_replace("-", "_", $a['language']);
304
 
@@ -306,7 +273,7 @@ class cameronjonesweb_facebook_page_plugin {
306
  wp_localize_script( 'facebook-page-plugin-sdk', 'facebook_page_plugin_language', array( 'language' => $a['language'] ) );
307
 
308
  $return .= '<div class="cameronjonesweb_facebook_page_plugin" data-version="' . CJW_FBPP_PLUGIN_VER . '" data-implementation="' . esc_attr( $a['_implementation'] ) . '" id="' . $this->facebook_page_plugin_generate_wrapper_id() . '">';
309
- $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>';
310
  $return .= '<div class="fb-page" data-href="https://facebook.com/' . $a["href"] . '" ';
311
  if(isset($a['width']) && !empty($a['width'])){
312
  $return .= ' data-width="' . $a['width'] . '"';
@@ -574,90 +541,90 @@ class cameronjonesweb_facebook_page_plugin_widget extends WP_Widget {
574
  echo '</label>';
575
  echo '<input class="widefat" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" type="text" value="' . esc_attr( $title ) . '" />';
576
  echo '</p>';
577
- echo '<p>';
578
- echo '<label for="' . $this->get_field_id( 'href' ) . '">';
579
- _e( 'Page URL:', 'facebook-page-feed-graph-api' );
580
- echo '</label>';
581
- echo '<input class="widefat" id="' . $this->get_field_id( 'href' ) . '" name="' . $this->get_field_name( 'href' ) . '" type="url" value="' . esc_attr( $href ) . '" required />';
582
- echo '</p>';
583
  echo '<p>';
584
- echo '<label for="' . $this->get_field_id( 'width' ) . '">';
585
- _e( 'Width:', 'facebook-page-feed-graph-api' );
586
- echo '</label>';
587
- echo '<input class="widefat" id="' . $this->get_field_id( 'width' ) . '" name="' . $this->get_field_name( 'width' ) . '" type="number" min="180" max="500" value="' . esc_attr( $width ) . '" />';
588
- echo '</p>';
589
  echo '<p>';
590
- echo '<label for="' . $this->get_field_id( 'height' ) . '">';
591
- _e( 'Height:', 'facebook-page-feed-graph-api' );
592
- echo '</label>';
593
- echo '<input class="widefat" id="' . $this->get_field_id( 'height' ) . '" name="' . $this->get_field_name( 'height' ) . '" type="number" min="70" value="' . esc_attr( $height ) . '" />';
594
- echo '</p>';
595
  echo '<p>';
596
- echo '<label for="' . $this->get_field_id( 'cover' ) . '">';
597
- _e( 'Cover Photo:', 'facebook-page-feed-graph-api' );
598
- echo '</label>';
599
- echo ' <input class="widefat" id="' . $this->get_field_id( 'cover' ) . '" name="' . $this->get_field_name( 'cover' ) . '" type="checkbox" value="true" ' . checked( esc_attr( $cover ), 'true', false ) . ' />';
600
- echo '</p>';
601
  echo '<p>';
602
- echo '<label for="' . $this->get_field_id( 'facepile' ) . '">';
603
- _e( 'Show Facepile:', 'facebook-page-feed-graph-api' );
604
- echo '</label>';
605
- 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 ) . ' />';
606
- echo '</p>';
607
- echo '<p>';
608
- _e( 'Page Tabs:', 'facebook-page-feed-graph-api' );
609
- $CJW_FBPP_TABS = $this->settings->tabs();
610
- if( !empty( $CJW_FBPP_TABS ) ) {
611
- // First we should convert the string to an array as that's how it will be stored moving forward.
612
- if( !is_array( $tabs ) ) {
613
- $oldtabs = esc_attr( $tabs );
614
- $newtabs = explode( ',', $tabs );
615
- $tabs = $newtabs;
616
- }
617
- foreach( $CJW_FBPP_TABS as $tab ) {
618
- echo '<br/><label>';
619
- echo '<input type="checkbox" name="' . $this->get_field_name( 'tabs' ) . '[' . $tab . ']" ' . ( in_array( $tab, $tabs ) ? 'checked' : '' ) . ' /> ';
620
- _e( ucfirst( $tab ), 'facebook-page-feed-graph-api' );
621
- echo '</label>';
622
- }
623
- }
624
- echo '</p>';
625
  echo '<p>';
626
- echo '<label for="' . $this->get_field_id( 'cta' ) . '">';
627
- _e( 'Hide Call To Action:', 'facebook-page-feed-graph-api' );
628
- echo '</label>';
629
- echo ' <input class="widefat" id="' . $this->get_field_id( 'cta' ) . '" name="' . $this->get_field_name( 'cta' ) . '" type="checkbox" value="true" ' . checked( esc_attr( $cta ), 'true', false ) . ' />';
630
- echo '</p>';
631
  echo '<p>';
632
- echo '<label for="' . $this->get_field_id( 'small' ) . '">';
633
- _e( 'Small Header:', 'facebook-page-feed-graph-api' );
634
- echo '</label>';
635
- echo ' <input class="widefat" id="' . $this->get_field_id( 'small' ) . '" name="' . $this->get_field_name( 'small' ) . '" type="checkbox" value="true" ' . checked( esc_attr( $small ), 'true', false ) . ' />';
636
- echo '</p>';
637
  echo '<p>';
638
- echo '<label for="' . $this->get_field_id( 'adapt' ) . '">';
639
- _e( 'Adaptive Width:', 'facebook-page-feed-graph-api' );
640
- echo '</label>';
641
- echo ' <input class="widefat" id="' . $this->get_field_id( 'adapt' ) . '" name="' . $this->get_field_name( 'adapt' ) . '" type="checkbox" value="true" ' . checked( esc_attr( $adapt ), 'true', false ) . ' />';
642
- echo '</p>';
643
  echo '<p>';
644
- echo '<label for="' . $this->get_field_id( 'link' ) . '">';
645
- _e( 'Display link while loading:', 'facebook-page-feed-graph-api' );
646
- echo '</label>';
647
- echo ' <input class="widefat" id="' . $this->get_field_id( 'link' ) . '" name="' . $this->get_field_name( 'link' ) . '" type="checkbox" value="true" ' . checked( esc_attr( $link ), 'true', false ) . ' />';
648
- echo '</p>';
649
  echo '<p>';
650
- echo '<label for="' . $this->get_field_id( 'linktext' ) . '">';
651
- _e( 'Link text:', 'facebook-page-feed-graph-api' );
652
- echo '</label>';
653
- echo '<input class="widefat" id="' . $this->get_field_id( 'linktext' ) . '" name="' . $this->get_field_name( 'linktext' ) . '" type="text" value="' . esc_attr( $linktext ) . '" />';
654
- echo '</p>';
655
  echo '<p>';
656
- echo '<label for="' . $this->get_field_id( 'language' ) . '">';
657
- _e( 'Language:', 'facebook-page-feed-graph-api' );
658
- echo '</label>';
659
- echo '<select class="widefat" id="' . $this->get_field_id( 'language' ) . '" name="' . $this->get_field_name( 'language' ) . '">';
660
- echo '<option value="">' . __( 'Site Language (default)', 'facebook-page-feed-graph-api' ) . '</option>';
661
  if(isset($langs) && !empty($langs)){
662
  foreach($langs as $lang){
663
  //echo '<option value="' . $lang->codes->code->standard->representation . '"' . selected( esc_attr( $language ), $lang->codes->code->standard->representation, false ) . '>' . __( $lang->englishName, 'facebook-page-feed-graph-api' ) . '</option>'; // Facebook only
@@ -665,7 +632,7 @@ class cameronjonesweb_facebook_page_plugin_widget extends WP_Widget {
665
  }
666
  }
667
  echo '</select>';
668
- echo '</p>';
669
  }
670
 
671
  // Updating widget replacing old instances with new
@@ -724,15 +691,15 @@ class cameronjonesweb_facebook_page_plugin_shortcode_generator {
724
  $return .= '<p><label>' . __( 'Show Facepile', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-facepile" /></label></p>';
725
  $return .= '<p><label>' . __( 'Page Tabs (formerly posts)', 'facebook-page-feed-graph-api' ) . ':';
726
  $settings = new facebook_page_plugin_settings;
727
- $CJW_FBPP_TABS = $settings->tabs();
728
  if( !empty( $CJW_FBPP_TABS ) ) {
729
  foreach( $CJW_FBPP_TABS as $tab ) {
730
- $return .= '<br/><label>';
731
- $return .= '<input type="checkbox" class="fbpp-tabs" name="' . $tab . '" /> ';
732
- $return .= __( ucfirst( $tab ), 'facebook-page-feed-graph-api' );
733
- $return .= '</label>';
734
- }
735
- }
736
  $return .= '<p><label>' . __( 'Hide Call To Action', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-cta" /></label></p>';
737
  $return .= '<p><label>' . __( 'Small Header', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-small" /></label></p>';
738
  $return .= '<p><label>' . __( 'Adaptive Width', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-adapt" checked /></label></p>';
@@ -774,7 +741,7 @@ class facebook_page_plugin_settings {
774
  $wp_filesystem = new WP_Filesystem_Direct( null );
775
 
776
  try {
777
- //$xml = file_get_contents('https://www.facebook.com/translations/FacebookLocales.xml');
778
  //$xml = file_get_contents( CJW_FBPP_PLUGIN_URL ) . 'lang.xml');
779
  $lang_xml = $wp_filesystem->get_contents( CJW_FBPP_PLUGIN_DIR . '/lang.xml');
780
  } catch( Exception $ex ){
@@ -782,7 +749,7 @@ class facebook_page_plugin_settings {
782
  }
783
 
784
  if(isset($lang_xml) && !empty($lang_xml)){
785
- $langs = new SimpleXMLElement($lang_xml);
786
  } else {
787
  $langs = NULL;
788
  }
1
  <?php
2
  /**
3
+ * Plugin Name: Responsive Facebook Page Plugin
4
  * Plugin URI: https://cameronjonesweb.com.au/wordpress-plugins/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.3
7
  * Author: Cameron Jones
8
  * Author URI: https://cameronjonesweb.com.au
9
  * License: GPLv2
10
  * Text Domain: facebook-page-feed-graph-api
11
 
12
+ * Copyright 2015-2018 Cameron Jones (email : plugins@cameronjonesweb.com.au)
13
 
14
+ This program is free software; you can redistribute it and/or modify
15
+ it under the terms of the GNU General Public License, version 2, as
16
+ published by the Free Software Foundation.
17
 
18
+ This program is distributed in the hope that it will be useful,
19
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ GNU General Public License for more details.
22
  */
23
 
24
  defined( 'ABSPATH' ) or die();
32
  define( 'CJW_FBPP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
33
  define( 'CJW_FBPP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
34
  define( 'CJW_FBPP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
35
+ define( 'CJW_FBPP_PLUGIN_VER', '1.6.3' );
36
  define( 'CJW_FBPP_PLUGIN_DONATE_LINK', 'https://www.patreon.com/cameronjonesweb' );
37
  define( 'CJW_FBPP_PLUGIN_SURVEY_LINK', 'https://cameronjonesweb.typeform.com/to/BllbYm' );
38
 
44
  add_action( 'admin_init', array( $this, 'remove_donate_notice_nojs' ) );
45
  add_action( 'admin_menu', array( $this, 'facebook_page_plugin_landing_page_menu' ) );
46
  add_action( 'wp_ajax_facebook_page_plugin_latest_blog_posts_callback', array( $this, 'facebook_page_plugin_latest_blog_posts_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' ) );
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() {
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
+
205
+ $output = sprintf(
206
+ '<p><strong>%1$s</strong></p>',
207
+ __( 'Unable to load posts.', 'facebook-page-feed-graph-api' )
208
+ );
209
+
210
  $internet = $this->facebook_page_plugin_is_connected();
211
+ if( true === $internet && function_exists( 'simplexml_load_file' ) ) {
212
  $feed = 'https://cameronjonesweb.com.au/feed/';
213
  $xml = simplexml_load_file( $feed, 'SimpleXMLElement', LIBXML_NOCDATA );
214
  if( isset( $xml ) && !empty( $xml ) ) {
215
+ $output = '';
216
+ $output .= '<ul>';
217
  foreach( $xml->channel->item as $blogpost ) {
218
+ $output .= '<li>';
219
+ $output .= date( 'M jS', strtotime( $blogpost->pubDate ) ) . ' - ';
220
+ $output .= '<a href="' . $blogpost->link . '">';
221
+ $output .= $blogpost->title;
222
+ $output .= '</a>';
223
+ $output .= '</li>';
224
  }
225
+ $output .= '</ul>';
 
226
  }
 
 
227
  }
228
+ $output .= sprintf(
229
+ '<p><a href="https://cameronjonesweb.com.au/blog/" target="_blank">%1$s</a></p>',
230
+ __( 'View all recent posts', 'facebook-page-feed-graph-api' )
231
+ );
232
+ wp_die( $output );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
  }
234
 
235
  function facebook_page_plugin_activation_hook( $plugin ) {
236
  if( $plugin == CJW_FBPP_PLUGIN_BASENAME ) {
237
+ exit( wp_redirect( admin_url( 'plugins.php?page=facebook-page-plugin' ) ) );
238
+ }
239
  }
240
 
241
 
250
  wp_enqueue_script( 'facebook-page-plugin-responsive-script', CJW_FBPP_PLUGIN_URL . 'js/responsive.min.js', 'jquery', NULL, true );
251
  $return = NULL;
252
  $a = shortcode_atts( array(
253
+ 'href' => NULL,
254
+ 'width' => 340,
255
  'height' => 130,
256
  'cover' => NULL,
257
  'facepile' => NULL,
265
  'linktext' => NULL,
266
  'standard' => 'html5',
267
  '_implementation' => 'shortcode'
268
+ ), $filter );
269
  if(isset($a['href']) && !empty($a['href'])){
270
  $a['language'] = str_replace("-", "_", $a['language']);
271
 
273
  wp_localize_script( 'facebook-page-plugin-sdk', 'facebook_page_plugin_language', array( 'language' => $a['language'] ) );
274
 
275
  $return .= '<div class="cameronjonesweb_facebook_page_plugin" data-version="' . CJW_FBPP_PLUGIN_VER . '" data-implementation="' . esc_attr( $a['_implementation'] ) . '" id="' . $this->facebook_page_plugin_generate_wrapper_id() . '">';
276
+ $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.12&appId=' . self::app_id() . '";fjs.parentNode.insertBefore(js, fjs); }(document, \'script\', \'facebook-jssdk\'));</script>';
277
  $return .= '<div class="fb-page" data-href="https://facebook.com/' . $a["href"] . '" ';
278
  if(isset($a['width']) && !empty($a['width'])){
279
  $return .= ' data-width="' . $a['width'] . '"';
541
  echo '</label>';
542
  echo '<input class="widefat" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" type="text" value="' . esc_attr( $title ) . '" />';
543
  echo '</p>';
544
+ echo '<p>';
545
+ echo '<label for="' . $this->get_field_id( 'href' ) . '">';
546
+ _e( 'Page URL:', 'facebook-page-feed-graph-api' );
547
+ echo '</label>';
548
+ echo '<input class="widefat" id="' . $this->get_field_id( 'href' ) . '" name="' . $this->get_field_name( 'href' ) . '" type="url" value="' . esc_attr( $href ) . '" required />';
549
+ echo '</p>';
550
  echo '<p>';
551
+ echo '<label for="' . $this->get_field_id( 'width' ) . '">';
552
+ _e( 'Width:', 'facebook-page-feed-graph-api' );
553
+ echo '</label>';
554
+ echo '<input class="widefat" id="' . $this->get_field_id( 'width' ) . '" name="' . $this->get_field_name( 'width' ) . '" type="number" min="180" max="500" value="' . esc_attr( $width ) . '" />';
555
+ echo '</p>';
556
  echo '<p>';
557
+ echo '<label for="' . $this->get_field_id( 'height' ) . '">';
558
+ _e( 'Height:', 'facebook-page-feed-graph-api' );
559
+ echo '</label>';
560
+ echo '<input class="widefat" id="' . $this->get_field_id( 'height' ) . '" name="' . $this->get_field_name( 'height' ) . '" type="number" min="70" value="' . esc_attr( $height ) . '" />';
561
+ echo '</p>';
562
  echo '<p>';
563
+ echo '<label for="' . $this->get_field_id( 'cover' ) . '">';
564
+ _e( 'Cover Photo:', 'facebook-page-feed-graph-api' );
565
+ echo '</label>';
566
+ echo ' <input class="widefat" id="' . $this->get_field_id( 'cover' ) . '" name="' . $this->get_field_name( 'cover' ) . '" type="checkbox" value="true" ' . checked( esc_attr( $cover ), 'true', false ) . ' />';
567
+ echo '</p>';
568
  echo '<p>';
569
+ echo '<label for="' . $this->get_field_id( 'facepile' ) . '">';
570
+ _e( 'Show Facepile:', 'facebook-page-feed-graph-api' );
571
+ echo '</label>';
572
+ 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 ) . ' />';
573
+ echo '</p>';
574
+ echo '<p>';
575
+ _e( 'Page Tabs:', 'facebook-page-feed-graph-api' );
576
+ $CJW_FBPP_TABS = $this->settings->tabs();
577
+ if( !empty( $CJW_FBPP_TABS ) ) {
578
+ // First we should convert the string to an array as that's how it will be stored moving forward.
579
+ if( !is_array( $tabs ) ) {
580
+ $oldtabs = esc_attr( $tabs );
581
+ $newtabs = explode( ',', $tabs );
582
+ $tabs = $newtabs;
583
+ }
584
+ foreach( $CJW_FBPP_TABS as $tab ) {
585
+ echo '<br/><label>';
586
+ echo '<input type="checkbox" name="' . $this->get_field_name( 'tabs' ) . '[' . $tab . ']" ' . ( in_array( $tab, $tabs ) ? 'checked' : '' ) . ' /> ';
587
+ _e( ucfirst( $tab ), 'facebook-page-feed-graph-api' );
588
+ echo '</label>';
589
+ }
590
+ }
591
+ echo '</p>';
592
  echo '<p>';
593
+ echo '<label for="' . $this->get_field_id( 'cta' ) . '">';
594
+ _e( 'Hide Call To Action:', 'facebook-page-feed-graph-api' );
595
+ echo '</label>';
596
+ echo ' <input class="widefat" id="' . $this->get_field_id( 'cta' ) . '" name="' . $this->get_field_name( 'cta' ) . '" type="checkbox" value="true" ' . checked( esc_attr( $cta ), 'true', false ) . ' />';
597
+ echo '</p>';
598
  echo '<p>';
599
+ echo '<label for="' . $this->get_field_id( 'small' ) . '">';
600
+ _e( 'Small Header:', 'facebook-page-feed-graph-api' );
601
+ echo '</label>';
602
+ echo ' <input class="widefat" id="' . $this->get_field_id( 'small' ) . '" name="' . $this->get_field_name( 'small' ) . '" type="checkbox" value="true" ' . checked( esc_attr( $small ), 'true', false ) . ' />';
603
+ echo '</p>';
604
  echo '<p>';
605
+ echo '<label for="' . $this->get_field_id( 'adapt' ) . '">';
606
+ _e( 'Adaptive Width:', 'facebook-page-feed-graph-api' );
607
+ echo '</label>';
608
+ echo ' <input class="widefat" id="' . $this->get_field_id( 'adapt' ) . '" name="' . $this->get_field_name( 'adapt' ) . '" type="checkbox" value="true" ' . checked( esc_attr( $adapt ), 'true', false ) . ' />';
609
+ echo '</p>';
610
  echo '<p>';
611
+ echo '<label for="' . $this->get_field_id( 'link' ) . '">';
612
+ _e( 'Display link while loading:', 'facebook-page-feed-graph-api' );
613
+ echo '</label>';
614
+ echo ' <input class="widefat" id="' . $this->get_field_id( 'link' ) . '" name="' . $this->get_field_name( 'link' ) . '" type="checkbox" value="true" ' . checked( esc_attr( $link ), 'true', false ) . ' />';
615
+ echo '</p>';
616
  echo '<p>';
617
+ echo '<label for="' . $this->get_field_id( 'linktext' ) . '">';
618
+ _e( 'Link text:', 'facebook-page-feed-graph-api' );
619
+ echo '</label>';
620
+ echo '<input class="widefat" id="' . $this->get_field_id( 'linktext' ) . '" name="' . $this->get_field_name( 'linktext' ) . '" type="text" value="' . esc_attr( $linktext ) . '" />';
621
+ echo '</p>';
622
  echo '<p>';
623
+ echo '<label for="' . $this->get_field_id( 'language' ) . '">';
624
+ _e( 'Language:', 'facebook-page-feed-graph-api' );
625
+ echo '</label>';
626
+ echo '<select class="widefat" id="' . $this->get_field_id( 'language' ) . '" name="' . $this->get_field_name( 'language' ) . '">';
627
+ echo '<option value="">' . __( 'Site Language (default)', 'facebook-page-feed-graph-api' ) . '</option>';
628
  if(isset($langs) && !empty($langs)){
629
  foreach($langs as $lang){
630
  //echo '<option value="' . $lang->codes->code->standard->representation . '"' . selected( esc_attr( $language ), $lang->codes->code->standard->representation, false ) . '>' . __( $lang->englishName, 'facebook-page-feed-graph-api' ) . '</option>'; // Facebook only
632
  }
633
  }
634
  echo '</select>';
635
+ echo '</p>';
636
  }
637
 
638
  // Updating widget replacing old instances with new
691
  $return .= '<p><label>' . __( 'Show Facepile', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-facepile" /></label></p>';
692
  $return .= '<p><label>' . __( 'Page Tabs (formerly posts)', 'facebook-page-feed-graph-api' ) . ':';
693
  $settings = new facebook_page_plugin_settings;
694
+ $CJW_FBPP_TABS = $settings->tabs();
695
  if( !empty( $CJW_FBPP_TABS ) ) {
696
  foreach( $CJW_FBPP_TABS as $tab ) {
697
+ $return .= '<br/><label>';
698
+ $return .= '<input type="checkbox" class="fbpp-tabs" name="' . $tab . '" /> ';
699
+ $return .= __( ucfirst( $tab ), 'facebook-page-feed-graph-api' );
700
+ $return .= '</label>';
701
+ }
702
+ }
703
  $return .= '<p><label>' . __( 'Hide Call To Action', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-cta" /></label></p>';
704
  $return .= '<p><label>' . __( 'Small Header', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-small" /></label></p>';
705
  $return .= '<p><label>' . __( 'Adaptive Width', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-adapt" checked /></label></p>';
741
  $wp_filesystem = new WP_Filesystem_Direct( null );
742
 
743
  try {
744
+ //$xml = file_get_contents('https://www.facebook.com/translations/FacebookLocales.xml');
745
  //$xml = file_get_contents( CJW_FBPP_PLUGIN_URL ) . 'lang.xml');
746
  $lang_xml = $wp_filesystem->get_contents( CJW_FBPP_PLUGIN_DIR . '/lang.xml');
747
  } catch( Exception $ex ){
749
  }
750
 
751
  if(isset($lang_xml) && !empty($lang_xml)){
752
+ $langs = new SimpleXMLElement($lang_xml);
753
  } else {
754
  $langs = NULL;
755
  }
faq.json CHANGED
@@ -1,16 +1,12 @@
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": "I have audience restrictions and the plugin won't display",
13
- "answer": "If your Facebook page has audience restrictions for age and/or location, the plugin will not display. If you want the plugin to display, disable the audience restrictions in your page settings on Facebook. <a href='https://developers.facebook.com/docs/plugins/page-plugin/#privacy' target='_blank'>See Facebook documentation</a>."
14
  },
15
  {
16
  "question": "The Facepile and/or posts aren't showing up",
@@ -51,6 +47,16 @@
51
  "Fixed bug with setting the language in the shortcode generator",
52
  "Increased accuracy of URL detection in the widget form"
53
  ]
 
 
 
 
 
 
 
 
 
 
54
  }
55
  ]
56
  }
1
  {
2
  "faqs": [
 
 
 
 
3
  {
4
  "question": "The plugin is blank or only displays a link",
5
+ "answer": "It is likely one of two issues, your page has audience restrictions or you're using an ad-blocker or similar browser extension that is blocking it. If your Facebook page has audience restrictions for age and/or location, the plugin will not display. If you want the plugin to display, make sure any audience restrictions are disabled in your page settings on Facebook, and turn off your ad-blocker or whitelist your website."
6
  },
7
  {
8
+ "question": "Where is the settings page?",
9
+ "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."
10
  },
11
  {
12
  "question": "The Facepile and/or posts aren't showing up",
47
  "Fixed bug with setting the language in the shortcode generator",
48
  "Increased accuracy of URL detection in the widget form"
49
  ]
50
+ },
51
+ {
52
+ "version": "1.6.3",
53
+ "changes": [
54
+ "Improved string translations",
55
+ "Updated Graph API from v2.5 to v2.12",
56
+ "Fail gracefully when SimpleXML isn't installed",
57
+ "Fixed changelog link",
58
+ "Updated the plugin display name to avoid potential trademark issues"
59
+ ]
60
  }
61
  ]
62
  }
inc/landing-page.php CHANGED
@@ -3,35 +3,35 @@ $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 {
@@ -43,19 +43,27 @@ $internet = $this->facebook_page_plugin_is_connected(); ?>
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
  } ?>
@@ -68,7 +76,10 @@ $internet = $this->facebook_page_plugin_is_connected(); ?>
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">
@@ -93,25 +104,25 @@ $internet = $this->facebook_page_plugin_is_connected(); ?>
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">
3
  $internet = $this->facebook_page_plugin_is_connected(); ?>
4
  <div class="wrap">
5
 
6
+ <?php printf(
7
+ '<h1>%1$s</h1>',
8
+ __( 'Facebook Page Plugin', 'facebook-page-feed-graph-api' )
9
+ ); ?>
10
 
11
  <div class="welcome-panel">
12
  <div class="welcome-panel-content">
13
  <img src="<?php echo CJW_FBPP_PLUGIN_URL; ?>/images/banner-772x250.jpg" class="welcome-panel-image">
14
+ <p class="about-description"><?php _e( 'Thank you for downloading the Facebook Page Plugin by cameronjonesweb! You\'ve joined more than 30,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>
15
  </div>
16
  </div>
17
  <div id="dashboard-widgets-wrap">
18
+ <div id="dashboard-widgets" class="metabox-holder columns-2">
19
  <div id="postbox-container-1" class="postbox-container">
20
  <div class="meta-box-sortables">
21
  <div class="postbox">
22
  <div class="main inside">
23
+ <h2><abbr title="<?php _e( 'Frequently Asked Questions', 'facebook-page-feed-graph-api' ); ?>"><?php _e( 'FAQs', 'facebook-page-feed-graph-api' ); ?></abbr></h2>
24
  <?php $file = CJW_FBPP_PLUGIN_DIR . '/faq.json';
25
  $json = file_get_contents( $file );
26
  $faq_obj = json_decode( $json );
27
  if( !empty( $faq_obj->faqs ) ) {
28
  echo '<ul>';
29
  foreach( $faq_obj->faqs as $faq ) {
30
+ printf(
31
+ '<li><strong>%1$s</strong><p>%2$s</p></li>',
32
+ $faq->question,
33
+ $faq->answer
34
+ );
 
 
 
35
  }
36
  echo '</ul>';
37
  } else {
43
  <div class="meta-box-sortables">
44
  <div class="postbox">
45
  <div class="main inside">
46
+ <h2><?php _e( 'Changelog', 'facebook-page-feed-graph-api' ); ?></h2>
47
+ <h3><?php printf(
48
+ __( 'New in version %1$s', 'facebook-page-feed-graph-api' ),
49
+ CJW_FBPP_PLUGIN_VER
50
+ ); ?></h3>
51
+
52
  <?php if( !empty( $faq_obj->changelog ) ) {
53
  foreach( $faq_obj->changelog as $version ) {
54
  if( $version->version == CJW_FBPP_PLUGIN_VER ) {
55
  echo '<ul>';
56
  foreach( $version->changes as $change ) {
57
+ printf(
58
+ '<li>%1$s</li>',
59
+ $change
60
+ );
61
  }
62
  echo '</ul>';
63
+ printf(
64
+ '<a href="https://wordpress.org/plugins/facebook-page-feed-graph-api/#developers" target="_blank" rel="noopener noreferrer">%1$s</a>',
65
+ __( 'View full changelog', 'facebook-page-feed-graph-api' )
66
+ );
67
  }
68
  }
69
  } ?>
76
  <div class="postbox">
77
  <div class="main inside">
78
  <h3><i class="dashicons dashicons-heart"></i> <?php _e( 'Donate', 'facebook-page-feed-graph-api' ); ?></h3>
79
+ <p><?php printf(
80
+ __( 'Development relies on donations from kind-hearted supporters of the Facebook Page Plugin. If you\'re enjoying the plugin, <a href="%1$s" target="_blank" rel="noopener noreferrer">please donate today</a>.', 'facebook-page-feed-graph-api' ),
81
+ CJW_FBPP_PLUGIN_DONATE_LINK
82
+ ); ?></p>
83
  </div>
84
  </div>
85
  <div class="postbox">
104
  <div class="postbox">
105
  <div class="main inside">
106
  <h3><i class="dashicons dashicons-star-filled"></i> <?php _e( 'Leave A Review', 'facebook-page-feed-graph-api' ); ?></h3>
107
+ <p><?php printf(
108
+ '%1$s <a href="https://wordpress.org/support/view/plugin-reviews/facebook-page-feed-graph-api#new-post" target="_blank" rel="noopener noreferrer">%2$s</a>!</p>',
109
+ __( 'Is this the best plugin for adding a Facebook Page to your WordPress website?', 'facebook-page-feed-graph-api' ),
110
+ __( 'Let me know', 'facebook-page-feed-graph-api' )
111
+ ); ?></p>
112
+ <p><?php printf(
113
+ __( 'If there\'s a problem, please open a support ticket on <a href="%1$s" target="_blank" rel="noopener noreferrer">Github</a>, on <a href="%2$s" target="_blank" rel="noopener noreferrer">WordPress.org</a>, or <a href="%3$s" target="_blank" rel="noopener noreferrer">email me</a>.', 'facebook-page-feed-graph-api' ),
114
+ 'https://github.com/cameronjonesweb/facebook-page-feed-graph-api/issues',
115
+ 'https://wordpress.org/support/plugin/facebook-page-feed-graph-api',
116
+ 'mailto:plugins@cameronjonesweb.com.au'
117
+
118
+ ); ?></p>
119
  </div>
120
  </div>
121
  <div class="postbox">
122
  <div class="main inside">
123
  <h3><i class="dashicons dashicons-chart-line"></i> <?php _e( 'Take The Survey', 'facebook-page-feed-graph-api' ); ?></h3>
124
  <p><?php _e( 'Want to have your say about the Facebook Page Plugin?', 'facebook-page-feed-graph-api' ); ?></p>
125
+ <p><a href="<?php echo CJW_FBPP_PLUGIN_SURVEY_LINK; ?>" class="button" target="_blank" rel="noopener noreferrer"><?php _e( 'Take The Survey!', 'facebook-page-feed-graph-api' ); ?></a></p>
 
 
 
 
 
 
 
 
 
 
126
  </div>
127
  </div>
128
  <div class="postbox">
js/landing-page.js CHANGED
@@ -1,18 +1,5 @@
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,
1
  (function($){
2
  $(document).ready(function(){
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  $.ajax({
4
  type: "GET",
5
  url: ajaxurl,
readme.md CHANGED
@@ -1,11 +1,11 @@
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
 
@@ -17,7 +17,7 @@ Other features include:
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
@@ -51,6 +51,13 @@ Chances are your plugin isn't tall enough to display the facepile properly. The
51
 
52
  ## Changelog
53
 
 
 
 
 
 
 
 
54
  ### 1.6.2 - 18/11/17
55
  * Changes minimum WordPress version to 4.6 for translations
56
  * Tested for WordPress 4.9 'Tipton'
1
+ # Responsive 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 30,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
 
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 30,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
51
 
52
  ## Changelog
53
 
54
+ ### 1.6.3 - 01/04/18
55
+ * Improved string translations
56
+ * Updated Graph API from v2.5 to v2.12
57
+ * Fail gracefully when SimpleXML isn't installed
58
+ * Fixed changelog link
59
+ * Updated the plugin display name to avoid potential trademark issues
60
+
61
  ### 1.6.2 - 18/11/17
62
  * Changes minimum WordPress version to 4.6 for translations
63
  * Tested for WordPress 4.9 'Tipton'