Version Description
Download this release
Release Info
Developer | cameronjonesweb |
Plugin | Responsive Facebook Page Plugin |
Version | trunk |
Comparing to | |
See all releases |
Code changes from version 1.6.3 to trunk
- .github/FUNDING.yml +4 -0
- .travis.yml +26 -0
- css/{facebook-page-plugin-admin.css → admin-global.css} +6 -10
- css/admin-landing-page.css +115 -0
- facebook-page-feed-graph-api.php +720 -768
- faq.json +0 -62
- images/banner-1544x500.png +0 -0
- images/banner-772x250.jpg +0 -0
- images/banner-border.png +0 -0
- inc/index.php +0 -0
- inc/landing-page.php +93 -86
- js/{facebook-page-plugin-admin.js → admin-global.js} +108 -108
- js/{landing-page.js → admin-landing-page.js} +0 -0
- readme.md +25 -21
- readme.txt +221 -212
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
.github/FUNDING.yml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
github: cameronjonesweb
|
2 |
+
patreon: cameronjonesweb
|
3 |
+
ko_fi: cameronjonesweb
|
4 |
+
custom: https://cameronjonesweb.com.au/support-me
|
.travis.yml
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
language: php
|
2 |
+
|
3 |
+
matrix:
|
4 |
+
include:
|
5 |
+
# Arbitrary PHP version to run the sniffs against.
|
6 |
+
- php: '7.1'
|
7 |
+
|
8 |
+
before_install:
|
9 |
+
- export PHPCS_DIR=/tmp/phpcs
|
10 |
+
- export SNIFFS_DIR=/tmp/sniffs
|
11 |
+
# Install PHP_CodeSniffer.
|
12 |
+
- git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR
|
13 |
+
# Install WordPress Coding Standards.
|
14 |
+
- git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $SNIFFS_DIR
|
15 |
+
# Set install path for WordPress Coding Standards.
|
16 |
+
- $PHPCS_DIR/bin/phpcs --config-set installed_paths $SNIFFS_DIR
|
17 |
+
# After CodeSniffer install you should refresh your path.
|
18 |
+
- phpenv rehash
|
19 |
+
|
20 |
+
script:
|
21 |
+
# Run against WordPress Coding Standards.
|
22 |
+
# If you use a custom ruleset, change `--standard=WordPress` to point to your ruleset file,
|
23 |
+
# for example: `--standard=wpcs.xml`.
|
24 |
+
# You can use any of the normal PHPCS command line arguments in the command:
|
25 |
+
# https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage
|
26 |
+
- $PHPCS_DIR/bin/phpcs -p . --standard=WordPress --extensions=php --runtime-set ignore_warnings_on_exit 1
|
css/{facebook-page-plugin-admin.css → admin-global.css}
RENAMED
@@ -1,11 +1,7 @@
|
|
1 |
-
#facebook-page-plugin-shortcode-generator p:after{clear:both;display:table;content:" ";}
|
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 |
-
.
|
6 |
-
.
|
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;}
|
1 |
+
#facebook-page-plugin-shortcode-generator p:after{clear:both;display:table;content:" ";}
|
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-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;}
|
6 |
+
.facebook-page-plugin-donate p{margin:.5em 0;padding:2px;}
|
|
|
|
|
|
|
|
|
7 |
.facebook-page-plugin-donate .notice-dismiss{text-decoration:none;}
|
css/admin-landing-page.css
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
body.settings_page_facebook-page-plugin {
|
2 |
+
background: #fff;
|
3 |
+
}
|
4 |
+
|
5 |
+
.settings_page_facebook-page-plugin .welcome-panel-content {
|
6 |
+
margin-right: 13px;
|
7 |
+
}
|
8 |
+
|
9 |
+
.settings_page_facebook-page-plugin .welcome-panel-image {
|
10 |
+
width: 100%;
|
11 |
+
}
|
12 |
+
|
13 |
+
.settings_page_facebook-page-plugin .about-description {
|
14 |
+
margin: 13px 0 0;
|
15 |
+
}
|
16 |
+
|
17 |
+
.settings_page_facebook-page-plugin .spinner.is-active {
|
18 |
+
float: none !important;
|
19 |
+
margin-left: 0 !important;
|
20 |
+
}
|
21 |
+
|
22 |
+
.settings_page_facebook-page-plugin #wpbody-content {
|
23 |
+
font-family: 'Muli', 'Helvetica', 'Arial', sans-serif;
|
24 |
+
}
|
25 |
+
|
26 |
+
.settings_page_facebook-page-plugin .page-title {
|
27 |
+
font-family: 'Rammetto One', cursive;
|
28 |
+
padding: 0;
|
29 |
+
}
|
30 |
+
|
31 |
+
.settings_page_facebook-page-plugin h2,
|
32 |
+
.settings_page_facebook-page-plugin h3,
|
33 |
+
.settings_page_facebook-page-plugin h4,
|
34 |
+
.settings_page_facebook-page-plugin h5,
|
35 |
+
.settings_page_facebook-page-plugin h6 {
|
36 |
+
font-family: 'Paytone One', sans-serif;
|
37 |
+
}
|
38 |
+
|
39 |
+
.settings_page_facebook-page-plugin .mongoose-facebook-page-plugin__box {
|
40 |
+
background-color: #f8f3ed;
|
41 |
+
padding: 20px 25px;
|
42 |
+
margin-bottom: 20px;
|
43 |
+
border: none;
|
44 |
+
box-shadow: none;
|
45 |
+
}
|
46 |
+
|
47 |
+
.settings_page_facebook-page-plugin .mongoose-facebook-page-plugin__box p:last-child {
|
48 |
+
margin-bottom: 0 !important;
|
49 |
+
}
|
50 |
+
|
51 |
+
.settings_page_facebook-page-plugin .mongoose-facebook-page-plugin__box .inside {
|
52 |
+
margin-top: 0;
|
53 |
+
padding: 0;
|
54 |
+
}
|
55 |
+
.settings_page_facebook-page-plugin .mongoose-facebook-page-plugin__box .inside h2 {
|
56 |
+
padding-top: 0;
|
57 |
+
}
|
58 |
+
|
59 |
+
.settings_page_facebook-page-plugin .notices-placeholder {
|
60 |
+
visibility: hidden;
|
61 |
+
height: 0;
|
62 |
+
overflow: hidden;
|
63 |
+
}
|
64 |
+
|
65 |
+
.settings_page_facebook-page-plugin .mongoose-facebook-page-plugin {
|
66 |
+
max-width: 1544px;
|
67 |
+
}
|
68 |
+
|
69 |
+
.settings_page_facebook-page-plugin .mongoose-facebook-page-plugin__banner {
|
70 |
+
position: relative;
|
71 |
+
}
|
72 |
+
|
73 |
+
.settings_page_facebook-page-plugin .mongoose-facebook-page-plugin__banner:after {
|
74 |
+
position: absolute;
|
75 |
+
content: "";
|
76 |
+
background-image: url( ../images/banner-border.png );
|
77 |
+
background-size: contain;
|
78 |
+
bottom: 0;
|
79 |
+
left: 0;
|
80 |
+
width: 100%;
|
81 |
+
height: 100%;
|
82 |
+
background-position: center bottom;
|
83 |
+
background-repeat: no-repeat;
|
84 |
+
}
|
85 |
+
|
86 |
+
.settings_page_facebook-page-plugin .mongoose-facebook-page-plugin__banner img {
|
87 |
+
max-width: 100%;
|
88 |
+
height: auto;
|
89 |
+
display: block;
|
90 |
+
}
|
91 |
+
|
92 |
+
.mongoose-facebook-page-plugin .button {
|
93 |
+
border: none;
|
94 |
+
background: #e46341;
|
95 |
+
box-shadow: none;
|
96 |
+
border-radius: 0;
|
97 |
+
color: #fff;
|
98 |
+
border: 2px solid #e46341;
|
99 |
+
padding: 4px 12px;
|
100 |
+
height: auto;
|
101 |
+
transition: .2s ease all;
|
102 |
+
font-family: 'Paytone One', sans-serif;
|
103 |
+
}
|
104 |
+
|
105 |
+
.mongoose-facebook-page-plugin .button:hover,
|
106 |
+
.mongoose-facebook-page-plugin .button:focus {
|
107 |
+
background: transparent;
|
108 |
+
border: 2px solid #e46341;
|
109 |
+
color: #e46341;
|
110 |
+
}
|
111 |
+
|
112 |
+
#mce-EMAIL {
|
113 |
+
padding: 4px 12px;
|
114 |
+
line-height: 28px;
|
115 |
+
}
|
facebook-page-feed-graph-api.php
CHANGED
@@ -1,768 +1,720 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Plugin Name:
|
4 |
-
* Plugin URI: https://
|
5 |
-
* Description:
|
6 |
-
* Version: 1.
|
7 |
-
* Author:
|
8 |
-
* Author URI: https://
|
9 |
-
* License: GPLv2
|
10 |
-
* Text Domain: facebook-page-feed-graph-api
|
11 |
-
|
12 |
-
* Copyright 2015-
|
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();
|
25 |
-
|
26 |
-
class cameronjonesweb_facebook_page_plugin {
|
27 |
-
|
28 |
-
public static $remove_donate_notice_key = 'facebook_page_plugin_donate_notice_ignore';
|
29 |
-
|
30 |
-
public function __construct() {
|
31 |
-
|
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.
|
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 |
-
|
39 |
-
//Add all the hooks and actions
|
40 |
-
add_shortcode( 'facebook-page-plugin', array( $this, 'facebook_page_plugin' ) );
|
41 |
-
add_filter( 'widget_text', 'do_shortcode' );
|
42 |
-
add_action( 'wp_dashboard_setup', array( $this, 'facebook_page_plugin_dashboard_widget' ) );
|
43 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'facebook_page_plugin_admin_resources' ) );
|
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' ) );
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
$return
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
$return
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
}
|
157 |
-
|
158 |
-
//
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
function
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
}
|
176 |
-
|
177 |
-
function
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
'
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
'<
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
'
|
257 |
-
|
258 |
-
|
259 |
-
'
|
260 |
-
|
261 |
-
|
262 |
-
'
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
$
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
$
|
328 |
-
}
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
if(
|
345 |
-
$
|
346 |
-
} else {
|
347 |
-
$
|
348 |
-
}
|
349 |
-
if(isset($instance['
|
350 |
-
$
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
$
|
356 |
-
}
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
$
|
361 |
-
}
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
$
|
371 |
-
|
372 |
-
|
373 |
-
$
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
$
|
401 |
-
|
402 |
-
|
403 |
-
$
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
echo
|
415 |
-
}
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
$
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
$
|
472 |
-
}
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
$
|
477 |
-
}
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
$
|
482 |
-
}
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
$
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
echo '</p>';
|
544 |
-
|
545 |
-
echo '<label for="' . $this->get_field_id( '
|
546 |
-
_e( '
|
547 |
-
echo '</label>';
|
548 |
-
echo '<input class="widefat" id="' . $this->get_field_id( '
|
549 |
-
echo '</p>';
|
550 |
-
echo '<p>';
|
551 |
-
echo '<label for="' . $this->get_field_id( '
|
552 |
-
_e( '
|
553 |
-
echo '</label>';
|
554 |
-
echo '<input class="widefat" id="' . $this->get_field_id( '
|
555 |
-
echo '</p>';
|
556 |
-
echo '<p>';
|
557 |
-
echo '<label for="' . $this->get_field_id( '
|
558 |
-
_e( '
|
559 |
-
echo '</label>';
|
560 |
-
echo '<input class="widefat" id="' . $this->get_field_id( '
|
561 |
-
echo '</p>';
|
562 |
-
echo '<p>';
|
563 |
-
echo '<label for="' . $this->get_field_id( '
|
564 |
-
_e( '
|
565 |
-
echo '</label>';
|
566 |
-
echo ' <input class="widefat" id="' . $this->get_field_id( '
|
567 |
-
echo '</p>';
|
568 |
-
echo '<p>';
|
569 |
-
echo '<label for="' . $this->get_field_id( '
|
570 |
-
_e( '
|
571 |
-
echo '</label>';
|
572 |
-
echo '
|
573 |
-
echo '</p>';
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
$
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
}
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
$
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
$
|
705 |
-
|
706 |
-
$
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
}
|
722 |
-
|
723 |
-
class facebook_page_plugin_settings {
|
724 |
-
|
725 |
-
public $tabs;
|
726 |
-
|
727 |
-
function __construct() {
|
728 |
-
$this->tabs = array( 'timeline', 'events', 'messages' );
|
729 |
-
}
|
730 |
-
|
731 |
-
function tabs() {
|
732 |
-
return $this->tabs;
|
733 |
-
}
|
734 |
-
|
735 |
-
function get_locale_xml() {
|
736 |
-
|
737 |
-
$admin_abspath = str_replace( site_url(), ABSPATH, admin_url() );
|
738 |
-
|
739 |
-
include_once( $admin_abspath . '/includes/class-wp-filesystem-base.php' );
|
740 |
-
include_once( $admin_abspath . '/includes/class-wp-filesystem-direct.php' );
|
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 ){
|
748 |
-
$lang_xml = NULL;
|
749 |
-
}
|
750 |
-
|
751 |
-
if(isset($lang_xml) && !empty($lang_xml)){
|
752 |
-
$langs = new SimpleXMLElement($lang_xml);
|
753 |
-
} else {
|
754 |
-
$langs = NULL;
|
755 |
-
}
|
756 |
-
|
757 |
-
return $langs;
|
758 |
-
}
|
759 |
-
|
760 |
-
}
|
761 |
-
|
762 |
-
//Register the widget
|
763 |
-
function facebook_page_plugin_load_widget() {
|
764 |
-
register_widget( 'cameronjonesweb_facebook_page_plugin_widget' );
|
765 |
-
}
|
766 |
-
add_action( 'widgets_init', 'facebook_page_plugin_load_widget' );
|
767 |
-
|
768 |
-
$cameronjonesweb_facebook_page_plugin = new cameronjonesweb_facebook_page_plugin;
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: Mongoose Page Plugin
|
4 |
+
* Plugin URI: https://mongoosemarketplace.com/downloads/facebook-page-plugin/
|
5 |
+
* Description: The most popular way to display the Facebook Page Plugin on your WordPress website. Easy implementation using a shortcode or widget. Now available in 95 different languages
|
6 |
+
* Version: 1.7.1
|
7 |
+
* Author: Mongoose Marketplace
|
8 |
+
* Author URI: https://mongoosemarketplace.com/
|
9 |
+
* License: GPLv2
|
10 |
+
* Text Domain: facebook-page-feed-graph-api
|
11 |
+
|
12 |
+
* Copyright 2015-2019 Cameron Jones (email : support@mongoosemarketplace.com)
|
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();
|
25 |
+
|
26 |
+
class cameronjonesweb_facebook_page_plugin {
|
27 |
+
|
28 |
+
public static $remove_donate_notice_key = 'facebook_page_plugin_donate_notice_ignore';
|
29 |
+
|
30 |
+
public function __construct() {
|
31 |
+
|
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.7.1' );
|
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 |
+
|
39 |
+
// Add all the hooks and actions.
|
40 |
+
add_shortcode( 'facebook-page-plugin', array( $this, 'facebook_page_plugin' ) );
|
41 |
+
add_filter( 'widget_text', 'do_shortcode' );
|
42 |
+
add_action( 'wp_dashboard_setup', array( $this, 'facebook_page_plugin_dashboard_widget' ) );
|
43 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'facebook_page_plugin_admin_resources' ) );
|
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' ) );
|
50 |
+
|
51 |
+
}
|
52 |
+
|
53 |
+
|
54 |
+
// Filter functions.
|
55 |
+
private static function dashboard_widget_capability() {
|
56 |
+
|
57 |
+
$return = apply_filters( 'facebook_page_plugin_dashboard_widget_capability', 'edit_posts' );
|
58 |
+
return $return;
|
59 |
+
|
60 |
+
}
|
61 |
+
|
62 |
+
|
63 |
+
private static function app_id() {
|
64 |
+
|
65 |
+
$return = apply_filters( 'facebook_page_plugin_app_id', '846690882110183' );
|
66 |
+
return $return;
|
67 |
+
|
68 |
+
}
|
69 |
+
|
70 |
+
|
71 |
+
// Admin functions.
|
72 |
+
|
73 |
+
public static function donate_notice() {
|
74 |
+
|
75 |
+
$return = NULL;
|
76 |
+
|
77 |
+
if( current_user_can( 'administrator' ) ) {
|
78 |
+
|
79 |
+
$user_id = get_current_user_id();
|
80 |
+
|
81 |
+
if ( !get_user_meta( $user_id, self::$remove_donate_notice_key ) || get_user_meta( $user_id, self::$remove_donate_notice_key ) === false ) {
|
82 |
+
|
83 |
+
$return .= '<div class="facebook-page-plugin-donate"><p>';
|
84 |
+
|
85 |
+
$return .= __( 'Thank you for using the Mongoose Page Plugin. Please consider donating to support ongoing development. ', 'facebook-page-feed-graph-api' );
|
86 |
+
|
87 |
+
$return .= '</p><p>';
|
88 |
+
|
89 |
+
$return .= '<a href="' . CJW_FBPP_PLUGIN_DONATE_LINK . '" target="_blank" class="button button-secondary">' . __( 'Donate now', 'facebook-page-feed-graph-api' ) . '</a>';
|
90 |
+
|
91 |
+
$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>';
|
92 |
+
|
93 |
+
$return .= '</p></div>';
|
94 |
+
|
95 |
+
}
|
96 |
+
|
97 |
+
}
|
98 |
+
|
99 |
+
return $return;
|
100 |
+
|
101 |
+
}
|
102 |
+
|
103 |
+
public static function remove_donate_notice() {
|
104 |
+
|
105 |
+
$user_id = get_current_user_id();
|
106 |
+
|
107 |
+
update_user_meta( $user_id, self::$remove_donate_notice_key, 'true', true );
|
108 |
+
|
109 |
+
if( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
110 |
+
|
111 |
+
wp_die();
|
112 |
+
|
113 |
+
}
|
114 |
+
|
115 |
+
}
|
116 |
+
|
117 |
+
public function remove_donate_notice_nojs() {
|
118 |
+
|
119 |
+
if ( isset( $_GET[self::$remove_donate_notice_key] ) && '0' == $_GET[self::$remove_donate_notice_key] ) {
|
120 |
+
|
121 |
+
self::remove_donate_notice();
|
122 |
+
|
123 |
+
}
|
124 |
+
|
125 |
+
}
|
126 |
+
|
127 |
+
|
128 |
+
// Add a link to support on plugins listing
|
129 |
+
function plugin_action_links( $links ) {
|
130 |
+
|
131 |
+
$links[] = sprintf(
|
132 |
+
'<a href="https://wordpress.org/support/plugin/facebook-page-feed-graph-api" target="_blank">%1$s</a>',
|
133 |
+
__( 'Support', 'facebook-page-feed-graph-api' )
|
134 |
+
);
|
135 |
+
return $links;
|
136 |
+
}
|
137 |
+
|
138 |
+
|
139 |
+
//Enqueue CSS and JS for admin
|
140 |
+
public function facebook_page_plugin_admin_resources() {
|
141 |
+
|
142 |
+
wp_enqueue_script( 'facebook-page-plugin-admin-scripts', CJW_FBPP_PLUGIN_URL . 'js/admin-global.js' );
|
143 |
+
wp_enqueue_style( 'facebook-page-plugin-admin-styles', CJW_FBPP_PLUGIN_URL . 'css/admin-global.css' );
|
144 |
+
|
145 |
+
}
|
146 |
+
|
147 |
+
//Register the dashboard widget
|
148 |
+
public function facebook_page_plugin_dashboard_widget() {
|
149 |
+
|
150 |
+
if( current_user_can( self::dashboard_widget_capability() ) ) {
|
151 |
+
|
152 |
+
wp_add_dashboard_widget( 'facebook-page-plugin-shortcode-generator', __( 'Mongoose Page Plugin Shortcode Generator', 'facebook-page-feed-graph-api' ), array( $this, 'facebook_page_plugin_dashboard_widget_callback' ) );
|
153 |
+
|
154 |
+
}
|
155 |
+
|
156 |
+
}
|
157 |
+
|
158 |
+
//Load the dashboard widget
|
159 |
+
function facebook_page_plugin_dashboard_widget_callback() {
|
160 |
+
echo '<a name="cameronjonesweb_facebook_page_plugin_shortcode_generator"></a>';
|
161 |
+
$generator = new cameronjonesweb_facebook_page_plugin_shortcode_generator();
|
162 |
+
$generator->generate();
|
163 |
+
|
164 |
+
}
|
165 |
+
|
166 |
+
function facebook_page_plugin_landing_page_menu() {
|
167 |
+
add_options_page( __( 'Mongoose Page Plugin by Mongoose Marketplace', 'facebook-page-feed-graph-api' ), 'Mongoose Page Plugin', 'install_plugins', 'facebook-page-plugin', array( $this, 'facebook_page_plugin_landing_page' ) );
|
168 |
+
}
|
169 |
+
|
170 |
+
function facebook_page_plugin_landing_page() {
|
171 |
+
wp_enqueue_style( 'facebook-page-plugin-landing-page-css', CJW_FBPP_PLUGIN_URL . 'css/admin-landing-page.css', [], CJW_FBPP_PLUGIN_VER );
|
172 |
+
wp_enqueue_style( 'facebook-page-plugin-google-fonts', 'https://fonts.googleapis.com/css?family=Rammetto+One|Paytone+One|Space+Mono:400|Muli:400,400i,700', [], CJW_FBPP_PLUGIN_VER );
|
173 |
+
wp_enqueue_script( 'facebook-page-plugin-landing-page-js', CJW_FBPP_PLUGIN_URL . 'js/admin-landing-page.js', array( 'jquery' ), CJW_FBPP_PLUGIN_VER, true );
|
174 |
+
include CJW_FBPP_PLUGIN_DIR . '/inc/landing-page.php';
|
175 |
+
}
|
176 |
+
|
177 |
+
function facebook_page_plugin_latest_blog_posts_callback() {
|
178 |
+
$links = sprintf(
|
179 |
+
'<p><a href="https://cameronjonesweb.com.au/blog/" target="_blank">%1$s</a> | <a href="https://mongoosemarketplace.com/news/" target="_blank">%2$s</a></p>',
|
180 |
+
__( 'Developer\'s blog', 'facebook-page-feed-graph-api' ),
|
181 |
+
__( 'Latest plugin news', 'facebook-page-feed-graph-api' )
|
182 |
+
);
|
183 |
+
wp_widget_rss_output( 'https://feed.rssunify.com/5b718c594e800/rss.xml', [ 'show_date' => 1 ] );
|
184 |
+
wp_die( $links );
|
185 |
+
}
|
186 |
+
|
187 |
+
function facebook_page_plugin_activation_hook( $plugin ) {
|
188 |
+
if( $plugin == CJW_FBPP_PLUGIN_BASENAME ) {
|
189 |
+
exit( wp_redirect( admin_url( 'options-general.php?page=facebook-page-plugin' ) ) );
|
190 |
+
}
|
191 |
+
}
|
192 |
+
|
193 |
+
|
194 |
+
// Client side stuff.
|
195 |
+
function facebook_page_plugin_generate_wrapper_id() {
|
196 |
+
return substr( str_shuffle( str_repeat( implode( '', array_merge( range( 'A', 'Z' ), range( 'a', 'z' ) ) ), 5 ) ), 0, 15 );
|
197 |
+
}
|
198 |
+
|
199 |
+
// Parse shortcode.
|
200 |
+
function facebook_page_plugin( $filter ) {
|
201 |
+
wp_enqueue_script( 'facebook-page-plugin-sdk', CJW_FBPP_PLUGIN_URL . 'js/sdk.js', array(), NULL, true );
|
202 |
+
wp_enqueue_script( 'facebook-page-plugin-responsive-script', CJW_FBPP_PLUGIN_URL . 'js/responsive.min.js', 'jquery', NULL, true );
|
203 |
+
$return = NULL;
|
204 |
+
$a = shortcode_atts( array(
|
205 |
+
'href' => NULL,
|
206 |
+
'width' => 340,
|
207 |
+
'height' => 130,
|
208 |
+
'cover' => NULL,
|
209 |
+
'facepile' => NULL,
|
210 |
+
'posts' => NULL,
|
211 |
+
'tabs' => array(),
|
212 |
+
'language' => get_bloginfo('language'),
|
213 |
+
'cta' => NULL,
|
214 |
+
'small' => NULL,
|
215 |
+
'adapt' => NULL,
|
216 |
+
'link' => true,
|
217 |
+
'linktext' => NULL,
|
218 |
+
'standard' => 'html5',
|
219 |
+
'_implementation' => 'shortcode'
|
220 |
+
), $filter );
|
221 |
+
if(isset($a['href']) && !empty($a['href'])){
|
222 |
+
$a['language'] = str_replace("-", "_", $a['language']);
|
223 |
+
|
224 |
+
//Send the language as a parameter to the SDK
|
225 |
+
wp_localize_script( 'facebook-page-plugin-sdk', 'facebook_page_plugin_language', array( 'language' => $a['language'] ) );
|
226 |
+
|
227 |
+
$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() . '">';
|
228 |
+
$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=v3.2&appId=' . self::app_id() . '";fjs.parentNode.insertBefore(js, fjs); }(document, \'script\', \'facebook-jssdk\'));</script>';
|
229 |
+
$return .= '<div class="fb-page" data-href="https://facebook.com/' . $a["href"] . '" ';
|
230 |
+
if(isset($a['width']) && !empty($a['width'])){
|
231 |
+
$return .= ' data-width="' . $a['width'] . '"';
|
232 |
+
$return .= ' data-max-width="' . $a['width'] . '"';
|
233 |
+
}
|
234 |
+
if(isset($a['height']) && !empty($a['height'])){
|
235 |
+
$return .= ' data-height="' . $a['height'] . '"';
|
236 |
+
}
|
237 |
+
if(isset($a['cover']) && !empty($a['cover'])){
|
238 |
+
if($a['cover'] == "false"){
|
239 |
+
$return .= ' data-hide-cover="true"';
|
240 |
+
} else if($a['cover'] == "true"){
|
241 |
+
$return .= ' data-hide-cover="false"';
|
242 |
+
}
|
243 |
+
}
|
244 |
+
if(isset($a['facepile']) && !empty($a['facepile'])){
|
245 |
+
$return .= ' data-show-facepile="' . $a['facepile'] . '"';
|
246 |
+
}
|
247 |
+
if(isset($a['tabs']) && !empty($a['tabs'])){
|
248 |
+
$return .= ' data-tabs="' . $a['tabs'] . '"';
|
249 |
+
} else if(isset($a['posts']) && !empty($a['posts'])){
|
250 |
+
if($a['posts'] == 'true'){
|
251 |
+
$return .= ' data-tabs="timeline"';
|
252 |
+
} else {
|
253 |
+
$return .= ' data-tabs="false"';
|
254 |
+
}
|
255 |
+
}
|
256 |
+
if(isset($a['cta']) && !empty($a['cta'])){
|
257 |
+
$return .= ' data-hide-cta="' . $a['cta'] . '"';
|
258 |
+
}
|
259 |
+
if(isset($a['small']) && !empty($a['small'])){
|
260 |
+
$return .= ' data-small-header="' . $a['small'] . '"';
|
261 |
+
}
|
262 |
+
if(isset($a['adapt']) && !empty($a['adapt'])){
|
263 |
+
$return .= ' data-adapt-container-width="' . $a['adapt'] . '"';
|
264 |
+
} else {
|
265 |
+
$return .= ' data-adapt-container-width="false"';
|
266 |
+
}
|
267 |
+
$return .= '><div class="fb-xfbml-parse-ignore">';
|
268 |
+
if( $a['link'] == 'true' ){
|
269 |
+
$return .= '<blockquote cite="https://www.facebook.com/' . $a['href'] . '">';
|
270 |
+
$return .= '<a href="https://www.facebook.com/' . $a['href'] . '">';
|
271 |
+
if( empty( $a['linktext'] ) ) {
|
272 |
+
$return .= 'https://www.facebook.com/' . $a['href'];
|
273 |
+
} else {
|
274 |
+
$return .= $a['linktext'];
|
275 |
+
}
|
276 |
+
$return .= '</a>';
|
277 |
+
$return .= '</blockquote>';
|
278 |
+
}
|
279 |
+
$return .= '</div></div></div>';
|
280 |
+
}
|
281 |
+
return $return;
|
282 |
+
}
|
283 |
+
|
284 |
+
}
|
285 |
+
|
286 |
+
class cameronjonesweb_facebook_page_plugin_widget extends WP_Widget {
|
287 |
+
|
288 |
+
private $facebookURLs = array( 'https://www.facebook.com/', 'https://facebook.com/', 'www.facebook.com/', 'facebook.com/', 'http://facebook.com/', 'http://www.facebook.com/' );
|
289 |
+
private $settings;
|
290 |
+
|
291 |
+
function __construct() {
|
292 |
+
$this->settings = new facebook_page_plugin_settings;
|
293 |
+
parent::__construct( 'facebook_page_plugin_widget', __( 'Mongoose Page Plugin', 'facebook-page-feed-graph-api' ), array( 'description' => __( 'Generates a Facebook Page feed in your widget area', 'facebook-page-feed-graph-api' ), ) );
|
294 |
+
}
|
295 |
+
public function widget( $args, $instance ) {
|
296 |
+
if( isset( $instance['title'] ) && !empty( $instance['title'] ) ) {
|
297 |
+
$title = apply_filters( 'widget_title', $instance['title'] );
|
298 |
+
} else {
|
299 |
+
$title = NULL;
|
300 |
+
}
|
301 |
+
if(isset($instance['href']) && !empty($instance['href'])){
|
302 |
+
$href = $instance['href'];
|
303 |
+
foreach($this->facebookURLs as $url){
|
304 |
+
$href = str_replace($url, '', $href);
|
305 |
+
}
|
306 |
+
} else {
|
307 |
+
$href = NULL;
|
308 |
+
}
|
309 |
+
if(isset($instance['width']) && !empty($instance['width'])){
|
310 |
+
$width = $instance['width'];
|
311 |
+
} else {
|
312 |
+
$width = NULL;
|
313 |
+
}
|
314 |
+
if(isset($instance['height']) && !empty($instance['height'])){
|
315 |
+
$height = $instance['height'];
|
316 |
+
} else {
|
317 |
+
$height = NULL;
|
318 |
+
}
|
319 |
+
if(isset($instance['cover']) && !empty($instance['cover'])){
|
320 |
+
$cover = 'true';
|
321 |
+
} else {
|
322 |
+
$cover = 'false';
|
323 |
+
}
|
324 |
+
if(isset($instance['facepile']) && !empty($instance['facepile'])){
|
325 |
+
$facepile = 'true';
|
326 |
+
} else {
|
327 |
+
$facepile = 'false';
|
328 |
+
}
|
329 |
+
if(isset($instance['tabs']) && !empty($instance['tabs'])){
|
330 |
+
$tabs = $instance['tabs'];
|
331 |
+
} else {
|
332 |
+
$tabs = '';
|
333 |
+
}
|
334 |
+
if(isset($instance['cta']) && !empty($instance['cta'])){
|
335 |
+
$cta = 'true';
|
336 |
+
} else {
|
337 |
+
$cta = 'false';
|
338 |
+
}
|
339 |
+
if(isset($instance['small']) && !empty($instance['small'])){
|
340 |
+
$small = 'true';
|
341 |
+
} else {
|
342 |
+
$small = 'false';
|
343 |
+
}
|
344 |
+
if(isset($instance['adapt']) && !empty($instance['adapt'])){
|
345 |
+
$adapt = 'true';
|
346 |
+
} else {
|
347 |
+
$adapt = 'false';
|
348 |
+
}
|
349 |
+
if(isset($instance['link']) && !empty($instance['link'])){
|
350 |
+
$link = 'true';
|
351 |
+
} else {
|
352 |
+
$link = 'false';
|
353 |
+
}
|
354 |
+
if(isset($instance['linktext']) && !empty($instance['linktext'])){
|
355 |
+
$linktext = $instance['linktext'];
|
356 |
+
} else {
|
357 |
+
$linktext = NULL;
|
358 |
+
}
|
359 |
+
if(isset($instance['language']) && !empty($instance['language'])){
|
360 |
+
$language = $instance['language'];
|
361 |
+
} else {
|
362 |
+
$language = NULL;
|
363 |
+
}
|
364 |
+
echo $args['before_widget'];
|
365 |
+
if ( ! empty( $title ) ) {
|
366 |
+
echo $args['before_title'] . $title . $args['after_title'];
|
367 |
+
}
|
368 |
+
if( !empty($href )){
|
369 |
+
$shortcode = '[facebook-page-plugin href="' . $href . '"';
|
370 |
+
if( isset( $width ) && !empty( $width ) ){
|
371 |
+
$shortcode .= ' width="' . $width . '"';
|
372 |
+
}
|
373 |
+
if( isset( $height ) && !empty( $height ) ){
|
374 |
+
$shortcode .= ' height="' . $height . '"';
|
375 |
+
}
|
376 |
+
if( isset( $cover ) && !empty( $cover ) ){
|
377 |
+
$shortcode .= ' cover="' . $cover . '"';
|
378 |
+
}
|
379 |
+
if( isset( $facepile ) && !empty( $facepile ) ){
|
380 |
+
$shortcode .= ' facepile="' . $facepile . '"';
|
381 |
+
}
|
382 |
+
if( isset( $tabs ) && !empty( $tabs ) ){
|
383 |
+
if( is_array( $tabs ) ) {
|
384 |
+
$shortcode .= ' tabs="';
|
385 |
+
for( $i = 0; $i < count( $tabs ); $i++ ) {
|
386 |
+
$shortcode .= $tabs[$i];
|
387 |
+
$shortcode .= ( $i != count( $tabs ) - 1 ? ',' : '' );
|
388 |
+
}
|
389 |
+
$shortcode .= '"';
|
390 |
+
} else {
|
391 |
+
$shortcode .= ' tabs="' . $tabs . '"';
|
392 |
+
}
|
393 |
+
}
|
394 |
+
if( isset( $language ) && !empty( $language ) ){
|
395 |
+
$shortcode .= ' language="' . $language . '"';
|
396 |
+
}
|
397 |
+
if( isset( $cta ) && !empty( $cta ) ){
|
398 |
+
$shortcode .= ' cta="' . $cta . '"';
|
399 |
+
}
|
400 |
+
if( isset( $small ) && !empty( $small ) ){
|
401 |
+
$shortcode .= ' small="' . $small . '"';
|
402 |
+
}
|
403 |
+
if( isset( $adapt ) && !empty( $adapt ) ){
|
404 |
+
$shortcode .= ' adapt="' . $adapt . '"';
|
405 |
+
}
|
406 |
+
if( isset( $link ) && !empty( $link ) ){
|
407 |
+
$shortcode .= ' link="' . $link . '"';
|
408 |
+
}
|
409 |
+
if( isset( $linktext ) && !empty( $linktext ) ){
|
410 |
+
$shortcode .= ' linktext="' . $linktext . '"';
|
411 |
+
}
|
412 |
+
$shortcode .= ' _implementation="widget"';
|
413 |
+
$shortcode .= ']';
|
414 |
+
echo do_shortcode( $shortcode );
|
415 |
+
}
|
416 |
+
echo $args['after_widget'];
|
417 |
+
}
|
418 |
+
public function form( $instance ) {
|
419 |
+
|
420 |
+
if ( isset( $instance[ 'title' ] ) ) {
|
421 |
+
$title = $instance[ 'title' ];
|
422 |
+
} else {
|
423 |
+
$title = __( 'New title', 'facebook-page-feed-graph-api' );
|
424 |
+
}
|
425 |
+
if ( isset( $instance[ 'href' ] ) ) {
|
426 |
+
$href = $instance[ 'href' ];
|
427 |
+
} else {
|
428 |
+
$href = '';
|
429 |
+
}
|
430 |
+
if ( isset( $instance[ 'width' ] ) ) {
|
431 |
+
$width = $instance[ 'width' ];
|
432 |
+
} else {
|
433 |
+
$width = '';
|
434 |
+
}
|
435 |
+
if ( isset( $instance[ 'height' ] ) ) {
|
436 |
+
$height = $instance[ 'height' ];
|
437 |
+
} else {
|
438 |
+
$height = '';
|
439 |
+
}
|
440 |
+
if ( isset( $instance[ 'cover' ] ) ) {
|
441 |
+
$cover = $instance[ 'cover' ];
|
442 |
+
} else {
|
443 |
+
$cover = 'false';
|
444 |
+
}
|
445 |
+
if ( isset( $instance[ 'facepile' ] ) ) {
|
446 |
+
$facepile = $instance[ 'facepile' ];
|
447 |
+
} else {
|
448 |
+
$facepile = 'false';
|
449 |
+
}
|
450 |
+
if ( isset( $instance[ 'tabs' ] ) ) {
|
451 |
+
$tabs = $instance[ 'tabs' ];
|
452 |
+
} else {
|
453 |
+
$tabs = '';
|
454 |
+
}
|
455 |
+
if ( isset( $instance[ 'cta' ] ) ) {
|
456 |
+
$cta = $instance[ 'cta' ];
|
457 |
+
} else {
|
458 |
+
$cta = 'false';
|
459 |
+
}
|
460 |
+
if ( isset( $instance[ 'small' ] ) ) {
|
461 |
+
$small = $instance[ 'small' ];
|
462 |
+
} else {
|
463 |
+
$small = 'false';
|
464 |
+
}
|
465 |
+
if ( isset( $instance[ 'adapt' ] ) ) {
|
466 |
+
$adapt = $instance[ 'adapt' ];
|
467 |
+
} else {
|
468 |
+
$adapt = 'true';
|
469 |
+
}
|
470 |
+
if ( isset( $instance[ 'link' ] ) ) {
|
471 |
+
$link = $instance[ 'link' ];
|
472 |
+
} else {
|
473 |
+
$link = 'true';
|
474 |
+
}
|
475 |
+
if ( isset( $instance[ 'linktext' ] ) ) {
|
476 |
+
$linktext = $instance[ 'linktext' ];
|
477 |
+
} else {
|
478 |
+
$linktext = '';
|
479 |
+
}
|
480 |
+
if ( isset( $instance[ 'language' ] ) ) {
|
481 |
+
$language = $instance[ 'language' ];
|
482 |
+
} else {
|
483 |
+
$language = '';
|
484 |
+
}
|
485 |
+
|
486 |
+
$langs = $this->settings->get_locale_xml();
|
487 |
+
|
488 |
+
echo cameronjonesweb_facebook_page_plugin::donate_notice();
|
489 |
+
|
490 |
+
echo '<p>';
|
491 |
+
echo '<label for="' . $this->get_field_id( 'title' ) . '">';
|
492 |
+
_e( 'Title:', 'facebook-page-feed-graph-api' );
|
493 |
+
echo '</label>';
|
494 |
+
echo '<input class="widefat" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" type="text" value="' . esc_attr( $title ) . '" />';
|
495 |
+
echo '</p>';
|
496 |
+
echo '<p>';
|
497 |
+
echo '<label for="' . $this->get_field_id( 'href' ) . '">';
|
498 |
+
_e( 'Page URL:', 'facebook-page-feed-graph-api' );
|
499 |
+
echo '</label>';
|
500 |
+
echo '<input class="widefat" id="' . $this->get_field_id( 'href' ) . '" name="' . $this->get_field_name( 'href' ) . '" type="url" value="' . esc_attr( $href ) . '" required />';
|
501 |
+
echo '</p>';
|
502 |
+
echo '<p>';
|
503 |
+
echo '<label for="' . $this->get_field_id( 'width' ) . '">';
|
504 |
+
_e( 'Width:', 'facebook-page-feed-graph-api' );
|
505 |
+
echo '</label>';
|
506 |
+
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 ) . '" />';
|
507 |
+
echo '</p>';
|
508 |
+
echo '<p>';
|
509 |
+
echo '<label for="' . $this->get_field_id( 'height' ) . '">';
|
510 |
+
_e( 'Height:', 'facebook-page-feed-graph-api' );
|
511 |
+
echo '</label>';
|
512 |
+
echo '<input class="widefat" id="' . $this->get_field_id( 'height' ) . '" name="' . $this->get_field_name( 'height' ) . '" type="number" min="70" value="' . esc_attr( $height ) . '" />';
|
513 |
+
echo '</p>';
|
514 |
+
echo '<p>';
|
515 |
+
echo '<label for="' . $this->get_field_id( 'cover' ) . '">';
|
516 |
+
_e( 'Cover Photo:', 'facebook-page-feed-graph-api' );
|
517 |
+
echo '</label>';
|
518 |
+
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 ) . ' />';
|
519 |
+
echo '</p>';
|
520 |
+
echo '<p>';
|
521 |
+
echo '<label for="' . $this->get_field_id( 'facepile' ) . '">';
|
522 |
+
_e( 'Show Facepile:', 'facebook-page-feed-graph-api' );
|
523 |
+
echo '</label>';
|
524 |
+
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 ) . ' />';
|
525 |
+
echo '</p>';
|
526 |
+
echo '<p>';
|
527 |
+
_e( 'Page Tabs:', 'facebook-page-feed-graph-api' );
|
528 |
+
$CJW_FBPP_TABS = $this->settings->tabs();
|
529 |
+
if( !empty( $CJW_FBPP_TABS ) ) {
|
530 |
+
// First we should convert the string to an array as that's how it will be stored moving forward.
|
531 |
+
if( !is_array( $tabs ) ) {
|
532 |
+
$oldtabs = esc_attr( $tabs );
|
533 |
+
$newtabs = explode( ',', $tabs );
|
534 |
+
$tabs = $newtabs;
|
535 |
+
}
|
536 |
+
foreach( $CJW_FBPP_TABS as $tab ) {
|
537 |
+
echo '<br/><label>';
|
538 |
+
echo '<input type="checkbox" name="' . $this->get_field_name( 'tabs' ) . '[' . $tab . ']" ' . ( in_array( $tab, $tabs ) ? 'checked' : '' ) . ' /> ';
|
539 |
+
_e( ucfirst( $tab ), 'facebook-page-feed-graph-api' );
|
540 |
+
echo '</label>';
|
541 |
+
}
|
542 |
+
}
|
543 |
+
echo '</p>';
|
544 |
+
echo '<p>';
|
545 |
+
echo '<label for="' . $this->get_field_id( 'cta' ) . '">';
|
546 |
+
_e( 'Hide Call To Action:', 'facebook-page-feed-graph-api' );
|
547 |
+
echo '</label>';
|
548 |
+
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 ) . ' />';
|
549 |
+
echo '</p>';
|
550 |
+
echo '<p>';
|
551 |
+
echo '<label for="' . $this->get_field_id( 'small' ) . '">';
|
552 |
+
_e( 'Small Header:', 'facebook-page-feed-graph-api' );
|
553 |
+
echo '</label>';
|
554 |
+
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 ) . ' />';
|
555 |
+
echo '</p>';
|
556 |
+
echo '<p>';
|
557 |
+
echo '<label for="' . $this->get_field_id( 'adapt' ) . '">';
|
558 |
+
_e( 'Adaptive Width:', 'facebook-page-feed-graph-api' );
|
559 |
+
echo '</label>';
|
560 |
+
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 ) . ' />';
|
561 |
+
echo '</p>';
|
562 |
+
echo '<p>';
|
563 |
+
echo '<label for="' . $this->get_field_id( 'link' ) . '">';
|
564 |
+
_e( 'Display link while loading:', 'facebook-page-feed-graph-api' );
|
565 |
+
echo '</label>';
|
566 |
+
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 ) . ' />';
|
567 |
+
echo '</p>';
|
568 |
+
echo '<p>';
|
569 |
+
echo '<label for="' . $this->get_field_id( 'linktext' ) . '">';
|
570 |
+
_e( 'Link text:', 'facebook-page-feed-graph-api' );
|
571 |
+
echo '</label>';
|
572 |
+
echo '<input class="widefat" id="' . $this->get_field_id( 'linktext' ) . '" name="' . $this->get_field_name( 'linktext' ) . '" type="text" value="' . esc_attr( $linktext ) . '" />';
|
573 |
+
echo '</p>';
|
574 |
+
echo '<p>';
|
575 |
+
echo '<label for="' . $this->get_field_id( 'language' ) . '">';
|
576 |
+
_e( 'Language:', 'facebook-page-feed-graph-api' );
|
577 |
+
echo '</label>';
|
578 |
+
echo '<select class="widefat" id="' . $this->get_field_id( 'language' ) . '" name="' . $this->get_field_name( 'language' ) . '">';
|
579 |
+
echo '<option value="">' . __( 'Site Language (default)', 'facebook-page-feed-graph-api' ) . '</option>';
|
580 |
+
if(isset($langs) && !empty($langs)){
|
581 |
+
foreach($langs as $lang){
|
582 |
+
//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
|
583 |
+
echo '<option value="' . $lang->standard->representation . '"' . selected( esc_attr( $language ), $lang->standard->representation, false ) . '>' . __( $lang->englishName, 'facebook-page-feed-graph-api' ) . '</option>';
|
584 |
+
}
|
585 |
+
}
|
586 |
+
echo '</select>';
|
587 |
+
echo '</p>';
|
588 |
+
}
|
589 |
+
|
590 |
+
// Updating widget replacing old instances with new
|
591 |
+
public function update( $new_instance, $old_instance ) {
|
592 |
+
$instance = array();
|
593 |
+
$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
|
594 |
+
$instance['href'] = ( ! empty( $new_instance['href'] ) ) ? strip_tags( $new_instance['href'] ) : '';
|
595 |
+
$instance['width'] = ( ! empty( $new_instance['width'] ) ) ? strip_tags( $new_instance['width'] ) : '';
|
596 |
+
$instance['height'] = ( ! empty( $new_instance['height'] ) ) ? strip_tags( $new_instance['height'] ) : '';
|
597 |
+
$instance['cover'] = ( ! empty( $new_instance['cover'] ) ) ? strip_tags( $new_instance['cover'] ) : '';
|
598 |
+
$instance['facepile'] = ( ! empty( $new_instance['facepile'] ) ) ? strip_tags( $new_instance['facepile'] ) : '';
|
599 |
+
if( !empty( $new_instance['tabs'] ) ) {
|
600 |
+
if( is_array( $new_instance['tabs'] ) ) {
|
601 |
+
foreach( $new_instance['tabs'] as $key => $var ) {
|
602 |
+
$instance['tabs'][] = sanitize_text_field( $key );
|
603 |
+
}
|
604 |
+
}
|
605 |
+
} else {
|
606 |
+
$instance['tabs'] = '';
|
607 |
+
}
|
608 |
+
$instance['cta'] = ( ! empty( $new_instance['cta'] ) ) ? strip_tags( $new_instance['cta'] ) : '';
|
609 |
+
$instance['small'] = ( ! empty( $new_instance['small'] ) ) ? strip_tags( $new_instance['small'] ) : '';
|
610 |
+
$instance['adapt'] = ( ! empty( $new_instance['adapt'] ) ) ? strip_tags( $new_instance['adapt'] ) : '';
|
611 |
+
$instance['link'] = ( ! empty( $new_instance['link'] ) ) ? strip_tags( $new_instance['link'] ) : '';
|
612 |
+
$instance['linktext'] = ( ! empty( $new_instance['linktext'] ) ) ? strip_tags( $new_instance['linktext'] ) : '';
|
613 |
+
$instance['language'] = ( ! empty( $new_instance['language'] ) ) ? strip_tags( $new_instance['language'] ) : '';
|
614 |
+
return $instance;
|
615 |
+
}
|
616 |
+
|
617 |
+
}
|
618 |
+
|
619 |
+
class cameronjonesweb_facebook_page_plugin_shortcode_generator {
|
620 |
+
|
621 |
+
private $langs;
|
622 |
+
private $settings;
|
623 |
+
|
624 |
+
function __construct() {
|
625 |
+
|
626 |
+
$this->settings = new facebook_page_plugin_settings;
|
627 |
+
$this->langs = $this->settings->get_locale_xml();
|
628 |
+
}
|
629 |
+
|
630 |
+
function generate() {
|
631 |
+
|
632 |
+
$return = NULL;
|
633 |
+
|
634 |
+
$return .= cameronjonesweb_facebook_page_plugin::donate_notice();
|
635 |
+
|
636 |
+
$return .= '<noscript>' . __( 'The shortcode generator requires JavaScript enabled', 'facebook-page-feed-graph-api' ) . '</noscript>';
|
637 |
+
|
638 |
+
$return .= '<form>';
|
639 |
+
$return .= '<p><label>' . __( 'Facebook Page URL', 'facebook-page-feed-graph-api' ) . ': <input type="url" id="fbpp-href" /></label></p>';
|
640 |
+
$return .= '<p><label>' . __( 'Width (pixels)', 'facebook-page-feed-graph-api' ) . ': <input type="number" max="500" min="180" id="fbpp-width" /></label></p>';
|
641 |
+
$return .= '<p><label>' . __( 'Height (pixels)', 'facebook-page-feed-graph-api' ) . ': <input type="number" min="70" id="fbpp-height" /></label></p>';
|
642 |
+
$return .= '<p><label>' . __( 'Show Cover Photo', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-cover" /></label></p>';
|
643 |
+
$return .= '<p><label>' . __( 'Show Facepile', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-facepile" /></label></p>';
|
644 |
+
$return .= '<p><label>' . __( 'Page Tabs (formerly posts)', 'facebook-page-feed-graph-api' ) . ':';
|
645 |
+
$settings = new facebook_page_plugin_settings;
|
646 |
+
$CJW_FBPP_TABS = $settings->tabs();
|
647 |
+
if( !empty( $CJW_FBPP_TABS ) ) {
|
648 |
+
foreach( $CJW_FBPP_TABS as $tab ) {
|
649 |
+
$return .= '<br/><label>';
|
650 |
+
$return .= '<input type="checkbox" class="fbpp-tabs" name="' . $tab . '" /> ';
|
651 |
+
$return .= __( ucfirst( $tab ), 'facebook-page-feed-graph-api' );
|
652 |
+
$return .= '</label>';
|
653 |
+
}
|
654 |
+
}
|
655 |
+
$return .= '<p><label>' . __( 'Hide Call To Action', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-cta" /></label></p>';
|
656 |
+
$return .= '<p><label>' . __( 'Small Header', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-small" /></label></p>';
|
657 |
+
$return .= '<p><label>' . __( 'Adaptive Width', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-adapt" checked /></label></p>';
|
658 |
+
$return .= '<p><label>' . __( 'Display link while loading', 'facebook-page-feed-graph-api' ) . ': <input type="checkbox" value="true" id="fbpp-link" checked /></label></p>';
|
659 |
+
$return .= '<p id="linktext-label"><label>' . __( 'Link text', 'facebook-page-feed-graph-api' ) . ': <input type="text" id="fbpp-linktext" /></label></p>';
|
660 |
+
$return .= '<p><label>' . __( 'Language', 'facebook-page-feed-graph-api' ) . ': <select id="fbpp-lang"><option value="">' . __( 'Site Language', 'facebook-page-feed-graph-api' ) . '</option>';
|
661 |
+
if(isset($this->langs) && !empty($this->langs)){
|
662 |
+
foreach($this->langs as $lang){
|
663 |
+
$return .= '<option value="' . $lang->standard->representation . '">' . __( $lang->englishName, 'facebook-page-feed-graph-api' ) . '</option>';
|
664 |
+
}
|
665 |
+
}
|
666 |
+
$return .= '</select></label></p>';
|
667 |
+
$return .= '<input type="text" readonly="readonly" id="facebook-page-plugin-shortcode-generator-output" onfocus="this.select()" />';
|
668 |
+
$return .= '</form>';
|
669 |
+
|
670 |
+
echo $return;
|
671 |
+
}
|
672 |
+
|
673 |
+
}
|
674 |
+
|
675 |
+
class facebook_page_plugin_settings {
|
676 |
+
|
677 |
+
public $tabs;
|
678 |
+
|
679 |
+
function __construct() {
|
680 |
+
$this->tabs = array( 'timeline', 'events', 'messages' );
|
681 |
+
}
|
682 |
+
|
683 |
+
function tabs() {
|
684 |
+
return $this->tabs;
|
685 |
+
}
|
686 |
+
|
687 |
+
function get_locale_xml() {
|
688 |
+
|
689 |
+
$admin_abspath = str_replace( site_url(), ABSPATH, admin_url() );
|
690 |
+
|
691 |
+
include_once( $admin_abspath . '/includes/class-wp-filesystem-base.php' );
|
692 |
+
include_once( $admin_abspath . '/includes/class-wp-filesystem-direct.php' );
|
693 |
+
$wp_filesystem = new WP_Filesystem_Direct( null );
|
694 |
+
|
695 |
+
try {
|
696 |
+
//$xml = file_get_contents('https://www.facebook.com/translations/FacebookLocales.xml');
|
697 |
+
//$xml = file_get_contents( CJW_FBPP_PLUGIN_URL ) . 'lang.xml');
|
698 |
+
$lang_xml = $wp_filesystem->get_contents( CJW_FBPP_PLUGIN_DIR . '/lang.xml');
|
699 |
+
} catch( Exception $ex ){
|
700 |
+
$lang_xml = NULL;
|
701 |
+
}
|
702 |
+
|
703 |
+
if(isset($lang_xml) && !empty($lang_xml)){
|
704 |
+
$langs = new SimpleXMLElement($lang_xml);
|
705 |
+
} else {
|
706 |
+
$langs = NULL;
|
707 |
+
}
|
708 |
+
|
709 |
+
return $langs;
|
710 |
+
}
|
711 |
+
|
712 |
+
}
|
713 |
+
|
714 |
+
// Register the widget.
|
715 |
+
function facebook_page_plugin_load_widget() {
|
716 |
+
register_widget( 'cameronjonesweb_facebook_page_plugin_widget' );
|
717 |
+
}
|
718 |
+
add_action( 'widgets_init', 'facebook_page_plugin_load_widget' );
|
719 |
+
|
720 |
+
$cameronjonesweb_facebook_page_plugin = new cameronjonesweb_facebook_page_plugin();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
faq.json
DELETED
@@ -1,62 +0,0 @@
|
|
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",
|
13 |
-
"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."
|
14 |
-
},
|
15 |
-
{
|
16 |
-
"question": "It's still broken, where do I get help?",
|
17 |
-
"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."
|
18 |
-
}
|
19 |
-
],
|
20 |
-
|
21 |
-
"changelog": [
|
22 |
-
{
|
23 |
-
"version": "1.5.3",
|
24 |
-
"changes": [
|
25 |
-
"Fixed bug where share button would return \"App Not Setup\" error"
|
26 |
-
]
|
27 |
-
},
|
28 |
-
{
|
29 |
-
"version": "1.6",
|
30 |
-
"changes": [
|
31 |
-
"Tabs are now checkboxes and the events tab is now available",
|
32 |
-
"New landing page to provide help new users"
|
33 |
-
]
|
34 |
-
},
|
35 |
-
{
|
36 |
-
"version": "1.6.1",
|
37 |
-
"changes": [
|
38 |
-
"Adding text domain header",
|
39 |
-
"Adding implementation indicator for debugging"
|
40 |
-
]
|
41 |
-
},
|
42 |
-
{
|
43 |
-
"version": "1.6.2",
|
44 |
-
"changes": [
|
45 |
-
"Changes minimum WordPress version to 4.6 for translations",
|
46 |
-
"Tested for WordPress 4.9 'Tipton'",
|
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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
images/banner-1544x500.png
ADDED
Binary file
|
images/banner-772x250.jpg
DELETED
Binary file
|
images/banner-border.png
ADDED
Binary file
|
inc/index.php
ADDED
File without changes
|
inc/landing-page.php
CHANGED
@@ -1,133 +1,140 @@
|
|
1 |
-
<?php
|
|
|
2 |
$currentuser = wp_get_current_user();
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
24 |
-
<?php
|
25 |
-
$
|
26 |
-
|
27 |
-
|
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 {
|
38 |
-
|
39 |
-
}
|
|
|
40 |
</div>
|
41 |
</div>
|
42 |
</div>
|
43 |
<div class="meta-box-sortables">
|
44 |
-
<div class="postbox">
|
45 |
<div class="main inside">
|
46 |
-
<h2><?php
|
47 |
-
<h3
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
70 |
</div>
|
71 |
</div>
|
72 |
</div>
|
73 |
</div>
|
74 |
<div id="postbox-container-2" class="postbox-container">
|
75 |
<div class="meta-box-sortables">
|
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
|
81 |
CJW_FBPP_PLUGIN_DONATE_LINK
|
82 |
); ?></p>
|
83 |
</div>
|
84 |
</div>
|
85 |
-
<div class="postbox">
|
86 |
<div class="main inside">
|
87 |
<h3><i class="dashicons dashicons-email-alt"></i> <?php _e( 'Plugin Newsletter', 'facebook-page-feed-graph-api' ); ?></h3>
|
88 |
-
<p><?php _e( 'Subscribe today to receive the latest updates for the
|
89 |
<!-- Begin MailChimp Signup Form -->
|
90 |
<div id="mc_embed_signup">
|
91 |
<form action="//cameronjonesweb.us10.list-manage.com/subscribe/post?u=507cd0221f4894316c903e99b&id=8d3d7b8378" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
|
92 |
-
|
93 |
-
<input type="email" value="<?php echo $currentuser->user_email; ?>" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
</form>
|
100 |
</div>
|
101 |
<!--End mc_embed_signup-->
|
102 |
</div>
|
103 |
</div>
|
104 |
-
<div class="postbox">
|
105 |
<div class="main inside">
|
106 |
-
<h3><i class="dashicons dashicons-star-filled"></i> <?php
|
107 |
-
<p
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
|
|
|
|
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 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
</div>
|
120 |
</div>
|
121 |
-
<div class="postbox">
|
122 |
<div class="main inside">
|
123 |
-
<h3><i class="dashicons dashicons-chart-line"></i> <?php
|
124 |
-
<p><?php
|
125 |
-
<p><a href="<?php echo CJW_FBPP_PLUGIN_SURVEY_LINK; ?>" class="button" target="_blank" rel="noopener noreferrer"><?php
|
126 |
</div>
|
127 |
</div>
|
128 |
-
<div class="postbox">
|
129 |
<div class="main inside">
|
130 |
-
<h3><i class="dashicons dashicons-testimonial"></i> <?php
|
131 |
<div id="blog-posts-target">
|
132 |
<span class="spinner is-active"></span>
|
133 |
</div>
|
@@ -137,4 +144,4 @@ $internet = $this->facebook_page_plugin_is_connected(); ?>
|
|
137 |
</div>
|
138 |
</div>
|
139 |
</div>
|
140 |
-
</div>
|
1 |
+
<?php
|
2 |
+
defined( 'ABSPATH' ) or die();
|
3 |
$currentuser = wp_get_current_user();
|
4 |
+
if ( ! function_exists( 'plugins_api' ) ) {
|
5 |
+
require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
6 |
+
}
|
7 |
+
$plugin_data = plugins_api(
|
8 |
+
'plugin_information',
|
9 |
+
[
|
10 |
+
'slug' => 'facebook-page-feed-graph-api',
|
11 |
+
'fields' => [ 'sections' ],
|
12 |
+
]
|
13 |
+
);
|
14 |
+
?>
|
15 |
+
<div class="wrap mongoose-facebook-page-plugin">
|
16 |
+
<h1 class="notices-placeholder"></h1>
|
17 |
+
<div class="mongoose-facebook-page-plugin__banner">
|
18 |
+
<img src="<?php echo esc_url( trailingslashit( CJW_FBPP_PLUGIN_URL ) ); ?>images/banner-1544x500.png" />
|
19 |
+
</div>
|
20 |
+
<div class="mongoose-facebook-page-plugin__box">
|
21 |
+
<?php
|
22 |
+
printf(
|
23 |
+
'<h1 class="page-title">%1$s</h1>',
|
24 |
+
esc_html( get_admin_page_title() )
|
25 |
+
);
|
26 |
+
?>
|
27 |
+
<p class="about-description"><?php esc_html_e( 'Thank you for downloading the Mongoose Page Plugin by Mongoose Marketplace! 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 Mongoose Page Plugin and let me know how it works for you!', 'facebook-page-feed-graph-api' ); ?></p>
|
28 |
</div>
|
29 |
<div id="dashboard-widgets-wrap">
|
30 |
<div id="dashboard-widgets" class="metabox-holder columns-2">
|
31 |
<div id="postbox-container-1" class="postbox-container">
|
32 |
<div class="meta-box-sortables">
|
33 |
+
<div class="postbox mongoose-facebook-page-plugin__box">
|
34 |
<div class="main inside">
|
35 |
+
<h2><?php esc_html_e( 'FAQs', 'facebook-page-feed-graph-api' ); ?></h2>
|
36 |
+
<?php
|
37 |
+
if ( ! empty( $plugin_data ) && ! is_wp_error( $plugin_data ) && isset( $plugin_data->sections['faq'] ) ) {
|
38 |
+
$faqs = $plugin_data->sections['faq'];
|
39 |
+
echo wp_kses_post( $faqs );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
} else {
|
41 |
+
esc_html_e( 'There was a problem retrieving the FAQs.', 'facebook-page-feed-graph-api' );
|
42 |
+
}
|
43 |
+
?>
|
44 |
</div>
|
45 |
</div>
|
46 |
</div>
|
47 |
<div class="meta-box-sortables">
|
48 |
+
<div class="postbox mongoose-facebook-page-plugin__box">
|
49 |
<div class="main inside">
|
50 |
+
<h2><?php esc_html_e( 'Changelog', 'facebook-page-feed-graph-api' ); ?></h2>
|
51 |
+
<h3>
|
52 |
+
<?php
|
53 |
+
printf(
|
54 |
+
/* translators: 1. version number */
|
55 |
+
esc_html__( 'New in version %1$s', 'facebook-page-feed-graph-api' ),
|
56 |
+
esc_html( CJW_FBPP_PLUGIN_VER )
|
57 |
+
);
|
58 |
+
?>
|
59 |
+
</h3>
|
60 |
+
<?php
|
61 |
+
if ( ! empty( $plugin_data ) && ! is_wp_error( $plugin_data ) && isset( $plugin_data->sections['changelog'] ) ) {
|
62 |
+
$changelog = explode( '</ul>', $plugin_data->sections['changelog'] );
|
63 |
+
if ( ! empty( $changelog ) ) {
|
64 |
+
$changes = explode( '</h4>', $changelog[0] );
|
65 |
+
echo wp_kses_post( $changes[1] );
|
66 |
+
echo '</ul>';
|
|
|
|
|
|
|
|
|
|
|
67 |
}
|
68 |
+
}
|
69 |
+
printf(
|
70 |
+
'<p><a href="https://wordpress.org/plugins/facebook-page-feed-graph-api/#developers" target="_blank" rel="noopener noreferrer">%1$s</a></p>',
|
71 |
+
esc_html__( 'View full changelog', 'facebook-page-feed-graph-api' )
|
72 |
+
);
|
73 |
+
?>
|
74 |
</div>
|
75 |
</div>
|
76 |
</div>
|
77 |
</div>
|
78 |
<div id="postbox-container-2" class="postbox-container">
|
79 |
<div class="meta-box-sortables">
|
80 |
+
<div class="postbox mongoose-facebook-page-plugin__box">
|
81 |
<div class="main inside">
|
82 |
<h3><i class="dashicons dashicons-heart"></i> <?php _e( 'Donate', 'facebook-page-feed-graph-api' ); ?></h3>
|
83 |
<p><?php printf(
|
84 |
+
__( 'Development relies on donations from kind-hearted supporters of the Mongoose 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' ),
|
85 |
CJW_FBPP_PLUGIN_DONATE_LINK
|
86 |
); ?></p>
|
87 |
</div>
|
88 |
</div>
|
89 |
+
<div class="postbox mongoose-facebook-page-plugin__box">
|
90 |
<div class="main inside">
|
91 |
<h3><i class="dashicons dashicons-email-alt"></i> <?php _e( 'Plugin Newsletter', 'facebook-page-feed-graph-api' ); ?></h3>
|
92 |
+
<p><?php _e( 'Subscribe today to receive the latest updates for the Mongoose Page Plugin', 'facebook-page-feed-graph-api' ); ?></p>
|
93 |
<!-- Begin MailChimp Signup Form -->
|
94 |
<div id="mc_embed_signup">
|
95 |
<form action="//cameronjonesweb.us10.list-manage.com/subscribe/post?u=507cd0221f4894316c903e99b&id=8d3d7b8378" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
|
96 |
+
<div id="mc_embed_signup_scroll">
|
97 |
+
<input type="email" value="<?php echo esc_attr( $currentuser->user_email ); ?>" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
|
98 |
+
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
|
99 |
+
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_507cd0221f4894316c903e99b_8d3d7b8378" tabindex="-1" value=""></div>
|
100 |
+
<input type="submit" value="<?php esc_attr_e( 'Subscribe', 'facebook-page-feed-graph-api' ); ?>" name="subscribe" id="mc-embedded-subscribe" class="button">
|
101 |
+
<div class="clear"></div>
|
102 |
+
</div>
|
103 |
</form>
|
104 |
</div>
|
105 |
<!--End mc_embed_signup-->
|
106 |
</div>
|
107 |
</div>
|
108 |
+
<div class="postbox mongoose-facebook-page-plugin__box">
|
109 |
<div class="main inside">
|
110 |
+
<h3><i class="dashicons dashicons-star-filled"></i> <?php esc_html_e( 'Leave A Review', 'facebook-page-feed-graph-api' ); ?></h3>
|
111 |
+
<p>
|
112 |
+
<?php printf(
|
113 |
+
'%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>',
|
114 |
+
esc_html__( 'Is this the best plugin for adding a Facebook Page to your WordPress website?', 'facebook-page-feed-graph-api' ),
|
115 |
+
esc_html__( 'Let me know', 'facebook-page-feed-graph-api' )
|
116 |
+
); ?>
|
117 |
+
</p>
|
118 |
+
<p>
|
119 |
+
<?php printf(
|
120 |
__( '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' ),
|
121 |
+
'https://github.com/cameronjonesweb/facebook-page-feed-graph-api/issues',
|
122 |
+
'https://wordpress.org/support/plugin/facebook-page-feed-graph-api',
|
123 |
+
'mailto:support@mongoosemarketplace.com'
|
124 |
+
); ?>
|
125 |
+
</p>
|
126 |
</div>
|
127 |
</div>
|
128 |
+
<div class="postbox mongoose-facebook-page-plugin__box">
|
129 |
<div class="main inside">
|
130 |
+
<h3><i class="dashicons dashicons-chart-line"></i> <?php esc_html_e( 'Take The Survey', 'facebook-page-feed-graph-api' ); ?></h3>
|
131 |
+
<p><?php esc_html_e( 'Want to have your say about the Mongoose Page Plugin?', 'facebook-page-feed-graph-api' ); ?></p>
|
132 |
+
<p><a href="<?php echo CJW_FBPP_PLUGIN_SURVEY_LINK; ?>" class="button" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Take The Survey!', 'facebook-page-feed-graph-api' ); ?></a></p>
|
133 |
</div>
|
134 |
</div>
|
135 |
+
<div class="postbox mongoose-facebook-page-plugin__box">
|
136 |
<div class="main inside">
|
137 |
+
<h3><i class="dashicons dashicons-testimonial"></i> <?php esc_html_e( 'Latest News From The Developer', 'facebook-page-feed-graph-api' ); ?></h3>
|
138 |
<div id="blog-posts-target">
|
139 |
<span class="spinner is-active"></span>
|
140 |
</div>
|
144 |
</div>
|
145 |
</div>
|
146 |
</div>
|
147 |
+
</div>
|
js/{facebook-page-plugin-admin.js → admin-global.js}
RENAMED
@@ -1,109 +1,109 @@
|
|
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 ) {
|
14 |
-
$('#linktext-label').hide();
|
15 |
-
} else {
|
16 |
-
$('#linktext-label').show();
|
17 |
-
}
|
18 |
-
var $shortcode = '';
|
19 |
-
$shortcode += '[facebook-page-plugin ';
|
20 |
-
var $href = $('#fbpp-href').val();
|
21 |
-
for(i = 0; i < $facebookURLs.length; i++) {
|
22 |
-
$href = $href.replace($facebookURLs[i],'');
|
23 |
-
}
|
24 |
-
if($href.length > 0){
|
25 |
-
$shortcode += 'href="' + $href + '" ';
|
26 |
-
var $width = $('#fbpp-width').val();
|
27 |
-
if($width.length > 0){
|
28 |
-
$shortcode += 'width="' + $width + '" ';
|
29 |
-
}
|
30 |
-
var $height = $('#fbpp-height').val();
|
31 |
-
if($height.length > 0){
|
32 |
-
$shortcode += 'height="' + $height + '" ';
|
33 |
-
}
|
34 |
-
var $cover = $('#fbpp-cover').prop("checked");
|
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");
|
57 |
-
$shortcode += 'small="' + $small + '" ';
|
58 |
-
var $adapt = $('#fbpp-adapt').prop("checked");
|
59 |
-
$shortcode += 'adapt="' + $adapt + '" ';
|
60 |
-
var $link = $('#fbpp-link').prop("checked");
|
61 |
-
$shortcode += 'link="' + $link + '" ';
|
62 |
-
if( $link == true ) {
|
63 |
-
var $linktext = $('#fbpp-linktext').val();
|
64 |
-
$shortcode += 'linktext="' + $linktext + '" ';
|
65 |
-
}
|
66 |
-
var $lang = $('#fbpp-lang').val();
|
67 |
-
if($lang.length > 0){
|
68 |
-
$shortcode += 'language="' + $lang + '" ';
|
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));
|
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 ) {
|
14 |
+
$('#linktext-label').hide();
|
15 |
+
} else {
|
16 |
+
$('#linktext-label').show();
|
17 |
+
}
|
18 |
+
var $shortcode = '';
|
19 |
+
$shortcode += '[facebook-page-plugin ';
|
20 |
+
var $href = $('#fbpp-href').val();
|
21 |
+
for(i = 0; i < $facebookURLs.length; i++) {
|
22 |
+
$href = $href.replace($facebookURLs[i],'');
|
23 |
+
}
|
24 |
+
if($href.length > 0){
|
25 |
+
$shortcode += 'href="' + $href + '" ';
|
26 |
+
var $width = $('#fbpp-width').val();
|
27 |
+
if($width.length > 0){
|
28 |
+
$shortcode += 'width="' + $width + '" ';
|
29 |
+
}
|
30 |
+
var $height = $('#fbpp-height').val();
|
31 |
+
if($height.length > 0){
|
32 |
+
$shortcode += 'height="' + $height + '" ';
|
33 |
+
}
|
34 |
+
var $cover = $('#fbpp-cover').prop("checked");
|
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");
|
57 |
+
$shortcode += 'small="' + $small + '" ';
|
58 |
+
var $adapt = $('#fbpp-adapt').prop("checked");
|
59 |
+
$shortcode += 'adapt="' + $adapt + '" ';
|
60 |
+
var $link = $('#fbpp-link').prop("checked");
|
61 |
+
$shortcode += 'link="' + $link + '" ';
|
62 |
+
if( $link == true ) {
|
63 |
+
var $linktext = $('#fbpp-linktext').val();
|
64 |
+
$shortcode += 'linktext="' + $linktext + '" ';
|
65 |
+
}
|
66 |
+
var $lang = $('#fbpp-lang').val();
|
67 |
+
if($lang.length > 0){
|
68 |
+
$shortcode += 'language="' + $lang + '" ';
|
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 → admin-landing-page.js}
RENAMED
File without changes
|
readme.md
CHANGED
@@ -1,7 +1,10 @@
|
|
1 |
-
|
2 |
-
by @cameronjonesweb
|
3 |
|
4 |
-
|
|
|
|
|
|
|
|
|
5 |
|
6 |
|
7 |
## Description
|
@@ -22,25 +25,17 @@ With more than 30,000 installs and nearly 50 5-star rating, the Facebook Page Pl
|
|
22 |
|
23 |
## Frequently Asked Questions
|
24 |
|
25 |
-
###
|
26 |
-
|
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 |
-
|
40 |
-
|
|
|
|
|
41 |
|
42 |
-
###
|
43 |
-
|
44 |
|
45 |
|
46 |
## Screenshots
|
@@ -51,7 +46,16 @@ Chances are your plugin isn't tall enough to display the facepile properly. The
|
|
51 |
|
52 |
## Changelog
|
53 |
|
54 |
-
### 1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
* Improved string translations
|
56 |
* Updated Graph API from v2.5 to v2.12
|
57 |
* Fail gracefully when SimpleXML isn't installed
|
@@ -203,4 +207,4 @@ Changes who can see the shortcode generator on the dashboard. Default: `edit_pos
|
|
203 |
|
204 |
`facebook_page_plugin_app_id`
|
205 |
|
206 |
-
Changes the Facebook App ID.
|
1 |
+
[![Build Status](https://api.travis-ci.org/cameronjonesweb/facebook-page-feed-graph-api.svg)](https://travis-ci.org/cameronjonesweb/facebook-page-feed-graph-api)
|
|
|
2 |
|
3 |
+
# Mongoose Page Plugin
|
4 |
+
|
5 |
+
[![ko-fi](https://www.ko-fi.com/img/donate_sm.png)](https://ko-fi.com/E1E0GU12) [![patreon](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://patreon.com/cameronjonesweb)
|
6 |
+
|
7 |
+
The most popular way to display the Facebook Page Plugin on your WordPress website. Easy implementation using a shortcode or widget. Now available in 95 different languages
|
8 |
|
9 |
|
10 |
## Description
|
25 |
|
26 |
## Frequently Asked Questions
|
27 |
|
28 |
+
### Where did Mongoose Marketplace come from?
|
29 |
+
Mongoose Marketplace is a new website just for my plugins. It's still being maintained by the same developer as always, just with new branding.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
### I can only see a link, the plugin won't load
|
32 |
+
The two most common causes of the plugin not displaying are an ad blocker, or audience restrictions. Disable or whitelist any ad blocking browser extension and disable any audience restrictions in your page settings on Facebook.
|
33 |
+
|
34 |
+
### The plugin loads but doesn't show the facepile or posts
|
35 |
+
The default height of the plugin is only tall enough to display the main page header. Increase the height until you can see the additional features you want to display.
|
36 |
|
37 |
+
### Where is the shortcode generator?
|
38 |
+
On your dashboard. We'll be improving how this is implemented in future versions.
|
39 |
|
40 |
|
41 |
## Screenshots
|
46 |
|
47 |
## Changelog
|
48 |
|
49 |
+
### 1.7.1 - 21/06/19
|
50 |
+
* Rebranded langing page
|
51 |
+
* Fixed admin resources not being enqueued properly
|
52 |
+
|
53 |
+
### 1.7.0 - 03/06/19
|
54 |
+
* Rebranded under the Mongoose Marketplace umbrella
|
55 |
+
* Updated RSS feed
|
56 |
+
* Fixed conflict with Elementor page builder
|
57 |
+
|
58 |
+
### 1.6.3 - 30/03/18
|
59 |
* Improved string translations
|
60 |
* Updated Graph API from v2.5 to v2.12
|
61 |
* Fail gracefully when SimpleXML isn't installed
|
207 |
|
208 |
`facebook_page_plugin_app_id`
|
209 |
|
210 |
+
Changes the Facebook App ID.
|
readme.txt
CHANGED
@@ -1,213 +1,222 @@
|
|
1 |
-
===
|
2 |
-
Contributors: cameronjonesweb
|
3 |
-
Tags: like box,facebook like box,facebook page plugin, facebook feed, facebook page
|
4 |
-
Donate link: https://www.patreon.com/cameronjonesweb
|
5 |
-
Requires at least: 4.6
|
6 |
-
Tested up to:
|
7 |
-
Stable tag: 1.
|
8 |
-
License: GPLv2
|
9 |
-
License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
== Description ==
|
15 |
-
Seamlessly add a Facebook Page to your WordPress website with the
|
16 |
-
|
17 |
-
You can add your Facebook page to any widget area with the custom
|
18 |
-
|
19 |
-
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.
|
20 |
-
|
21 |
-
Other features include:
|
22 |
-
|
23 |
-
* A shortcode generator on the admin dashboard for easy generating of the shortcode
|
24 |
-
|
25 |
-
* 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
|
26 |
-
|
27 |
-
With more than 30,000 installs and
|
28 |
-
|
29 |
-
|
30 |
-
== Frequently Asked Questions ==
|
31 |
-
|
32 |
-
= What happened to "Show Posts"? =
|
33 |
-
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.
|
34 |
-
|
35 |
-
= What languages are available? =
|
36 |
-
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.
|
37 |
-
|
38 |
-
= My Facebook page isn't loading =
|
39 |
-
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"]`
|
40 |
-
Also, if your page has only just been created it may take some time for the API to load the page. Just be patient
|
41 |
-
|
42 |
-
= What versions of WordPress will this plugin work on? =
|
43 |
-
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
|
44 |
-
|
45 |
-
= I can only see a link, the plugin won't load =
|
46 |
-
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.
|
47 |
-
Additionally, 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.
|
48 |
-
|
49 |
-
= I can't get the Facepile to work! =
|
50 |
-
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.
|
51 |
-
|
52 |
-
|
53 |
-
== Screenshots ==
|
54 |
-
1. The
|
55 |
-
2. Easy-to-use widget form with the new options available in 1.6
|
56 |
-
3. The shortcode generator dashboard widget
|
57 |
-
|
58 |
-
|
59 |
-
== Changelog ==
|
60 |
-
|
61 |
-
= 1.
|
62 |
-
*
|
63 |
-
*
|
64 |
-
|
65 |
-
|
66 |
-
*
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
*
|
72 |
-
*
|
73 |
-
|
74 |
-
|
75 |
-
*
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
*
|
80 |
-
*
|
81 |
-
*
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
*
|
90 |
-
|
91 |
-
|
92 |
-
*
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
* Fixed
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
*
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
*
|
107 |
-
*
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
*
|
112 |
-
*
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
*
|
120 |
-
*
|
121 |
-
|
122 |
-
|
123 |
-
*
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
*
|
129 |
-
*
|
130 |
-
|
131 |
-
= 1.3.
|
132 |
-
*
|
133 |
-
*
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
*
|
143 |
-
|
144 |
-
= 1.2.
|
145 |
-
* Fixed
|
146 |
-
|
147 |
-
= 1.2.
|
148 |
-
* Fixed readme
|
149 |
-
|
150 |
-
= 1.2.
|
151 |
-
*
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
*
|
163 |
-
|
164 |
-
= 1.
|
165 |
-
*
|
166 |
-
|
167 |
-
= 1.0 -
|
168 |
-
*
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
`
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
`
|
212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
Changes the Facebook App ID.
|
1 |
+
=== Mongoose Page Plugin ===
|
2 |
+
Contributors: cameronjonesweb, mongoosemarketplace
|
3 |
+
Tags: like box,facebook like box,facebook page plugin, facebook feed, facebook page
|
4 |
+
Donate link: https://www.patreon.com/cameronjonesweb
|
5 |
+
Requires at least: 4.6
|
6 |
+
Tested up to: 5.2
|
7 |
+
Stable tag: 1.7.1
|
8 |
+
License: GPLv2
|
9 |
+
License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
10 |
+
|
11 |
+
The most popular way to display the Mongoose Page Plugin on your WordPress website. Easy implementation using a shortcode or widget. Now available in 95 different languages
|
12 |
+
|
13 |
+
|
14 |
+
== Description ==
|
15 |
+
Seamlessly add a Facebook Page to your WordPress website with the Mongoose Page Plugin! Trusted by more than 30,000 WordPress websites worldwide, the Mongoose Page Plugin is the simplest way to add a Facebook page to your website.
|
16 |
+
|
17 |
+
You can add your Facebook page to any widget area with the custom Mongoose Page Plugin widget, with live preview available in the Customizer.
|
18 |
+
|
19 |
+
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.
|
20 |
+
|
21 |
+
Other features include:
|
22 |
+
|
23 |
+
* A shortcode generator on the admin dashboard for easy generating of the shortcode
|
24 |
+
|
25 |
+
* 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
|
26 |
+
|
27 |
+
With more than 30,000 installs and over 50 5-star ratings, the Mongoose Page Plugin is one of the most popular social media plugins for WordPress.
|
28 |
+
|
29 |
+
|
30 |
+
== Frequently Asked Questions ==
|
31 |
+
|
32 |
+
= What happened to "Show Posts"? =
|
33 |
+
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.
|
34 |
+
|
35 |
+
= What languages are available? =
|
36 |
+
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.
|
37 |
+
|
38 |
+
= My Facebook page isn't loading =
|
39 |
+
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"]`
|
40 |
+
Also, if your page has only just been created it may take some time for the API to load the page. Just be patient
|
41 |
+
|
42 |
+
= What versions of WordPress will this plugin work on? =
|
43 |
+
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
|
44 |
+
|
45 |
+
= I can only see a link, the plugin won't load =
|
46 |
+
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.
|
47 |
+
Additionally, 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.
|
48 |
+
|
49 |
+
= I can't get the Facepile to work! =
|
50 |
+
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.
|
51 |
+
|
52 |
+
|
53 |
+
== Screenshots ==
|
54 |
+
1. The Mongoose Page Plugin widget in use with the Twenty Sixteen theme
|
55 |
+
2. Easy-to-use widget form with the new options available in 1.6
|
56 |
+
3. The shortcode generator dashboard widget
|
57 |
+
|
58 |
+
|
59 |
+
== Changelog ==
|
60 |
+
|
61 |
+
= 1.7.1 - 21/06/19 =
|
62 |
+
* Rebranded langing page
|
63 |
+
* Fixed admin resources not being enqueued properly
|
64 |
+
|
65 |
+
= 1.7.0 - 03/06/19 =
|
66 |
+
* Rebranded under the Mongoose Marketplace umbrella
|
67 |
+
* Updated RSS feed
|
68 |
+
* Fixed conflict with Elementor page builder
|
69 |
+
|
70 |
+
= 1.6.3 - 30/03/18 =
|
71 |
+
* Improved string translations
|
72 |
+
* Updated Graph API from v2.5 to v2.12
|
73 |
+
* Fail gracefully when SimpleXML isn't installed
|
74 |
+
* Fixed changelog link
|
75 |
+
* Updated the plugin display name to avoid potential trademark issues
|
76 |
+
|
77 |
+
= 1.6.2 - 18/11/17 =
|
78 |
+
* Changes minimum WordPress version to 4.6 for translations
|
79 |
+
* Tested for WordPress 4.9 'Tipton'
|
80 |
+
* Fixed bug with setting the language in the shortcode generator
|
81 |
+
* Increased accuracy of URL detection in the widget form
|
82 |
+
|
83 |
+
= 1.6.1 - 11/04/17 =
|
84 |
+
* Adding text domain header
|
85 |
+
* Adding implementation indicator for debugging
|
86 |
+
|
87 |
+
= 1.6.0 - 02/04/17 =
|
88 |
+
* New landing page with FAQs to help with onboarding of new users
|
89 |
+
* Removal of the admin notice review nag
|
90 |
+
* Localisation of SDK
|
91 |
+
* Added `events` option to the widget and shortcode generator
|
92 |
+
* Changed `tabs` setting to checkboxes instead of a dropdown
|
93 |
+
|
94 |
+
= 1.5.3 - 25/01/16 =
|
95 |
+
* Fixed bug where share button would return `App Not Setup` error
|
96 |
+
|
97 |
+
= 1.5.2 - 01/12/15 =
|
98 |
+
* Fixed bug where plugin would rerender during scroll on mobile devices
|
99 |
+
|
100 |
+
= 1.5.1 - 29/11/15 =
|
101 |
+
* Fixed bug where plugin wouldn't rerender
|
102 |
+
* Fixed bug with languages XML file not loading on installs where the admin is not wp-admin
|
103 |
+
|
104 |
+
= 1.5.0 - 23/11/15 =
|
105 |
+
* Migrated to object oriented
|
106 |
+
* Fixed languages XML file being blocked by iThemes Security
|
107 |
+
* Fixed HTML issue with dashboard widget
|
108 |
+
* Added script that makes the plugin fully responsive
|
109 |
+
|
110 |
+
= 1.4.2 - 23/09/15 =
|
111 |
+
* Fixing shortcode not being updated when tabs change in the shortcode generator
|
112 |
+
* Removing link text parameter and option when `Show Link` is false
|
113 |
+
|
114 |
+
= 1.4.1 - 22/09/15 =
|
115 |
+
* Fixing shortcode generator using posts instead of tabs
|
116 |
+
* Verifying compatibility with 4.3.1
|
117 |
+
|
118 |
+
= 1.4.0 - 03/09/15 =
|
119 |
+
* Options to remove and customise the page link that displays while the plugin loads
|
120 |
+
* Fixed `undefined index` error when adding a new instance of the plugin in the customizer
|
121 |
+
* Updated all admin text to be multi-lingual compatible
|
122 |
+
* Updated `posts` option to `tabs`
|
123 |
+
* Updated screenshots and example
|
124 |
+
|
125 |
+
= 1.3.4 - 13/08/15 =
|
126 |
+
* Fixed typo in widget
|
127 |
+
* Fixed labels in widget
|
128 |
+
* 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.
|
129 |
+
* Re-introduced App ID, while it should not be needed it appears that removing it has affected some sites.
|
130 |
+
|
131 |
+
= 1.3.3 - 11/08/15 =
|
132 |
+
* Direct access security update
|
133 |
+
* Verifying compatibility with WP 4.2.4 and WP 4.3
|
134 |
+
* Fixing bug where some options in the widget would revert to the default instead of false
|
135 |
+
|
136 |
+
= 1.3.2 - 25/07/15 =
|
137 |
+
* WP 4.2.3 Compatibility
|
138 |
+
* Upgrading to Graph API 2.4
|
139 |
+
|
140 |
+
= 1.3.0 - 02/07/15 =
|
141 |
+
* Added hide-cta, small-header and adapt-container-width settings
|
142 |
+
* Adjusted min height and width
|
143 |
+
|
144 |
+
= 1.2.5 - 06/06/15 =
|
145 |
+
* Fixed close icon on notice
|
146 |
+
|
147 |
+
= 1.2.4 - 05/06/15 =
|
148 |
+
* Fixed readme
|
149 |
+
|
150 |
+
= 1.2.3 - 04/06/15 =
|
151 |
+
* 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
|
152 |
+
|
153 |
+
= 1.2.2 - 27/05/15 =
|
154 |
+
* Fixed posts option for widget
|
155 |
+
|
156 |
+
= 1.2.1 - 27/05/15 =
|
157 |
+
* Fixed readme bug
|
158 |
+
|
159 |
+
= 1.2.0 - 26/05/15 =
|
160 |
+
* Added multilingual support. Language can be specified in the shortcode, otherwise it is retrievd from the site settings.
|
161 |
+
* Added a shortcode generator dashboard widget to allow easier creation of the shortcode
|
162 |
+
* Added a custom widget
|
163 |
+
|
164 |
+
= 1.1.1 - 14/05/15 =
|
165 |
+
* Fixed height bug
|
166 |
+
|
167 |
+
= 1.1.0 - 10/05/15 =
|
168 |
+
* Added filter to allow calling of shortcodes in the text widget
|
169 |
+
|
170 |
+
= 1.0.3 - 28/04/15 =
|
171 |
+
* Fixing screenshot issue
|
172 |
+
|
173 |
+
= 1.0.1 - 28/04/15 =
|
174 |
+
* Cleaning up readme file
|
175 |
+
|
176 |
+
= 1.0 - 25/04/15 =
|
177 |
+
* Initial release
|
178 |
+
|
179 |
+
|
180 |
+
== Plugin Settings ==
|
181 |
+
|
182 |
+
The Mongoose Page Plugin uses a shortcode to insert the page feed. You set your settings within the shortcode.
|
183 |
+
`[facebook-page-plugin setting="value"]`
|
184 |
+
Available settings:
|
185 |
+
|
186 |
+
`href` (URL path that comes after facebook.com/)
|
187 |
+
|
188 |
+
`width` (number, in pixels, between 180 and 500, default 340)
|
189 |
+
|
190 |
+
`height` (number, in pixels, minimum 70, default 500)
|
191 |
+
|
192 |
+
`cover` (true/false, show page cover photo, default true)
|
193 |
+
|
194 |
+
`facepile` (true/false, show facepile, default true)
|
195 |
+
|
196 |
+
`tabs` (any combination of [posts, messages, events], default timeline)
|
197 |
+
|
198 |
+
`cta` (true/false, hide custom call to action if applicable, default false)
|
199 |
+
|
200 |
+
`small` (true/false, display small header (must be true for height to be lower than 130px), default false)
|
201 |
+
|
202 |
+
`adapt` (true/false, force plugin to be responsive, default true)
|
203 |
+
|
204 |
+
`language` (languageCode_countryCode eg: en_US, language of the plugin, default site language)
|
205 |
+
|
206 |
+
* Deprecated Settings *
|
207 |
+
|
208 |
+
`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
|
209 |
+
|
210 |
+
Example: `[facebook-page-plugin href="facebook" width="300" height="500" cover="true" facepile="true" tabs="timeline" adapt="true"]`
|
211 |
+
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
|
212 |
+
|
213 |
+
|
214 |
+
== Filter Reference ==
|
215 |
+
|
216 |
+
`facebook_page_plugin_dashboard_widget_capability`
|
217 |
+
|
218 |
+
Changes who can see the shortcode generator on the dashboard. Default: `edit_posts`
|
219 |
+
|
220 |
+
`facebook_page_plugin_app_id`
|
221 |
+
|
222 |
Changes the Facebook App ID.
|
screenshot-1.png
DELETED
Binary file
|
screenshot-2.png
DELETED
Binary file
|
screenshot-3.png
DELETED
Binary file
|