Version Description
- Tweak: Made some adjustments to the Access Token login process
Download this release
Release Info
Developer | smashballoon |
Plugin | Custom Facebook Feed |
Version | 2.7.1 |
Comparing to | |
See all releases |
Code changes from version 2.7 to 2.7.1
- README.txt +4 -1
- css/cff-admin-style.css +42 -4
- css/cff-style.css +3 -1
- css/cff-style.min.css +1 -1
- custom-facebook-feed-admin.php +67 -26
- custom-facebook-feed.php +3 -3
- js/cff-admin-scripts.js +21 -3
README.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: smashballoon
|
|
3 |
Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook page
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 4.9
|
6 |
-
Stable tag: 2.7
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -265,6 +265,9 @@ You no longer need your own Access Token to use the Custom Facebook Feed Plugin,
|
|
265 |
|
266 |
== Changelog ==
|
267 |
|
|
|
|
|
|
|
268 |
= 2.7 =
|
269 |
* New: Now easily get your own Access Token to avoid any Facebook connection issues. Simply click the blue "Log in and get my Access Token" button on the plugin's settings page and connect your Facebook account to get your token. The Access Token will work to get posts from ANY Facebook page. Thanks to our friends at SlickRemix for powering our new login and getting the plugin back up and running again!
|
270 |
* Tweak: Removed the minimum caching time if you're using your own Page Access Token
|
3 |
Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook page
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 4.9
|
6 |
+
Stable tag: 2.7.1
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
265 |
|
266 |
== Changelog ==
|
267 |
|
268 |
+
= 2.7.1 =
|
269 |
+
* Tweak: Made some adjustments to the Access Token login process
|
270 |
+
|
271 |
= 2.7 =
|
272 |
* New: Now easily get your own Access Token to avoid any Facebook connection issues. Simply click the blue "Log in and get my Access Token" button on the plugin's settings page and connect your Facebook account to get your token. The Access Token will work to get posts from ANY Facebook page. Thanks to our friends at SlickRemix for powering our new login and getting the plugin back up and running again!
|
273 |
* Tweak: Removed the minimum caching time if you're using your own Page Access Token
|
css/cff-admin-style.css
CHANGED
@@ -801,7 +801,7 @@
|
|
801 |
|
802 |
/* FB login button */
|
803 |
#cff-admin .cff_admin_btn,
|
804 |
-
#cff-admin
|
805 |
display: inline-block;
|
806 |
clear: both;
|
807 |
padding: 0 21px 0 20px;
|
@@ -822,7 +822,7 @@
|
|
822 |
transition: all 0.5s ease-in-out;
|
823 |
}
|
824 |
#cff-admin .cff_admin_btn:hover,
|
825 |
-
#cff-admin
|
826 |
background-color: #3880c4;
|
827 |
color: #fff;
|
828 |
|
@@ -906,12 +906,12 @@
|
|
906 |
#cff-admin .cff_modal_box .cff_admin_btn{
|
907 |
margin-top: 10px;
|
908 |
}
|
909 |
-
#cff-admin
|
910 |
margin-right: 5px;
|
911 |
background: #ddd;
|
912 |
color: #555;
|
913 |
}
|
914 |
-
#cff-admin
|
915 |
background: #ccc;
|
916 |
color: #333;
|
917 |
}
|
@@ -935,4 +935,42 @@
|
|
935 |
#cff-admin .cff_modal_box p{
|
936 |
font-size: 14px;
|
937 |
line-height: 1.6;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
938 |
}
|
801 |
|
802 |
/* FB login button */
|
803 |
#cff-admin .cff_admin_btn,
|
804 |
+
#cff-admin .cff-admin-cancel-btn{
|
805 |
display: inline-block;
|
806 |
clear: both;
|
807 |
padding: 0 21px 0 20px;
|
822 |
transition: all 0.5s ease-in-out;
|
823 |
}
|
824 |
#cff-admin .cff_admin_btn:hover,
|
825 |
+
#cff-admin .cff-admin-cancel-btn:hover{
|
826 |
background-color: #3880c4;
|
827 |
color: #fff;
|
828 |
|
906 |
#cff-admin .cff_modal_box .cff_admin_btn{
|
907 |
margin-top: 10px;
|
908 |
}
|
909 |
+
#cff-admin .cff-admin-cancel-btn{
|
910 |
margin-right: 5px;
|
911 |
background: #ddd;
|
912 |
color: #555;
|
913 |
}
|
914 |
+
#cff-admin .cff-admin-cancel-btn:hover{
|
915 |
background: #ccc;
|
916 |
color: #333;
|
917 |
}
|
935 |
#cff-admin .cff_modal_box p{
|
936 |
font-size: 14px;
|
937 |
line-height: 1.6;
|
938 |
+
}
|
939 |
+
|
940 |
+
/* Choose token */
|
941 |
+
#cff-admin #cff-own, #cff-admin #cff-public{
|
942 |
+
display: none;
|
943 |
+
}
|
944 |
+
#cff-admin .cff-token-radios{
|
945 |
+
width: 265px;
|
946 |
+
text-align: left;
|
947 |
+
margin-left: 110px;
|
948 |
+
}
|
949 |
+
#cff-admin .cff-token-radios input{
|
950 |
+
position: relative;
|
951 |
+
top: 2px;
|
952 |
+
}
|
953 |
+
#cff-admin .cff_modal_box .cff-disabled{
|
954 |
+
background: #EEE;
|
955 |
+
color: #aaa;
|
956 |
+
cursor: default;
|
957 |
+
}
|
958 |
+
#cff-admin .cff-token-question-own,
|
959 |
+
#cff-admin .cff-token-question-public{
|
960 |
+
position: relative;
|
961 |
+
top: 2px;
|
962 |
+
left: 3px;
|
963 |
+
font-size: 15px;
|
964 |
+
opacity: 0.8;
|
965 |
+
margin: 0;
|
966 |
+
}
|
967 |
+
#cff-admin .cff-token-question-own:hover,
|
968 |
+
#cff-admin .cff-token-question-public:hover{
|
969 |
+
opacity: 1;
|
970 |
+
color: #005e8c;
|
971 |
+
}
|
972 |
+
#cff-admin #cff-token-intro .cff-tooltip{
|
973 |
+
font-size: 13px;
|
974 |
+
background: #f0f0f0;
|
975 |
+
padding: 10px 15px;
|
976 |
}
|
css/cff-style.css
CHANGED
@@ -117,9 +117,12 @@
|
|
117 |
#cff .cff-author-img{
|
118 |
float: left;
|
119 |
width: 40px;
|
|
|
120 |
margin: 0 0 0 -100% !important;
|
121 |
font-size: 0;
|
122 |
background: #eee;
|
|
|
|
|
123 |
}
|
124 |
#cff .cff-author img{
|
125 |
float: left;
|
@@ -127,7 +130,6 @@
|
|
127 |
padding: 0 !important;
|
128 |
border: none !important;
|
129 |
font-size: 0;
|
130 |
-
background: #eee;
|
131 |
}
|
132 |
#cff .cff-author .cff-author-text span.cff-page-name{
|
133 |
display: table-cell;
|
117 |
#cff .cff-author-img{
|
118 |
float: left;
|
119 |
width: 40px;
|
120 |
+
height: 40px;
|
121 |
margin: 0 0 0 -100% !important;
|
122 |
font-size: 0;
|
123 |
background: #eee;
|
124 |
+
|
125 |
+
background: url('../img/cff-avatar.png') no-repeat;
|
126 |
}
|
127 |
#cff .cff-author img{
|
128 |
float: left;
|
130 |
padding: 0 !important;
|
131 |
border: none !important;
|
132 |
font-size: 0;
|
|
|
133 |
}
|
134 |
#cff .cff-author .cff-author-text span.cff-page-name{
|
135 |
display: table-cell;
|
css/cff-style.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cff-wrapper:after{content:"";display:table;clear:both}#cff{float:left;width:100%;margin:0 auto;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#cff .cff-item{float:left;width:100%;clear:both;padding:20px 0 15px;margin:0;border-bottom:1px solid #ddd}#cff .cff-item:first-child{padding-top:0}#cff .cff-item.cff-box,#cff .cff-item.cff-box:first-child{padding:15px;margin:5px 0;border:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.cff-header{width:100%;margin:0 0 15px;padding:0;line-height:1;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#cff .cff-share-tooltip,#cff .cff-shared-link{-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.cff-header .fa,.cff-header svg{margin:0 10px 0 0;padding:0}#cff .cff-less{display:none}#cff.cff-default-styles a{text-decoration:none}#cff.cff-default-styles a:focus,#cff.cff-default-styles a:hover{text-decoration:underline}#cff .cff-author a,#cff.cff-default-styles .cff-author a,#cff.cff-default-styles .cff-credit a{text-decoration:none}#cff .cff-post-text-link{display:block}#cff .cff-post-desc,#cff h3,#cff h4,#cff h5,#cff h6,#cff p{float:left;width:100%;clear:both;padding:0;margin:5px 0;white-space:pre;white-space:pre-wrap;white-space:pre-line;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:-moz-pre-wrap;white-space:-hp-pre-wrap;word-wrap:break-word}#cff.cff-default-styles .cff-post-desc,#cff.cff-default-styles h3,#cff.cff-default-styles h4,#cff.cff-default-styles h5,#cff.cff-default-styles h6,#cff.cff-default-styles p{line-height:1.4}#cff .cff-date{float:left;min-width:50px;width:auto}#cff.cff-default-styles .cff-date{font-size:11px}#cff .cff-author{float:left;clear:both;margin:0 0 15px;padding:0;line-height:1.2;width:100%}#cff .cff-author a{border:none}#cff .cff-author-img{float:left;
|
1 |
+
.cff-wrapper:after{content:"";display:table;clear:both}#cff{float:left;width:100%;margin:0 auto;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#cff .cff-item{float:left;width:100%;clear:both;padding:20px 0 15px;margin:0;border-bottom:1px solid #ddd}#cff .cff-item:first-child{padding-top:0}#cff .cff-item.cff-box,#cff .cff-item.cff-box:first-child{padding:15px;margin:5px 0;border:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.cff-header{width:100%;margin:0 0 15px;padding:0;line-height:1;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#cff .cff-share-tooltip,#cff .cff-shared-link{-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.cff-header .fa,.cff-header svg{margin:0 10px 0 0;padding:0}#cff .cff-less{display:none}#cff.cff-default-styles a{text-decoration:none}#cff.cff-default-styles a:focus,#cff.cff-default-styles a:hover{text-decoration:underline}#cff .cff-author a,#cff.cff-default-styles .cff-author a,#cff.cff-default-styles .cff-credit a{text-decoration:none}#cff .cff-post-text-link{display:block}#cff .cff-post-desc,#cff h3,#cff h4,#cff h5,#cff h6,#cff p{float:left;width:100%;clear:both;padding:0;margin:5px 0;white-space:pre;white-space:pre-wrap;white-space:pre-line;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:-moz-pre-wrap;white-space:-hp-pre-wrap;word-wrap:break-word}#cff.cff-default-styles .cff-post-desc,#cff.cff-default-styles h3,#cff.cff-default-styles h4,#cff.cff-default-styles h5,#cff.cff-default-styles h6,#cff.cff-default-styles p{line-height:1.4}#cff .cff-date{float:left;min-width:50px;width:auto}#cff.cff-default-styles .cff-date{font-size:11px}#cff .cff-author{float:left;clear:both;margin:0 0 15px;padding:0;line-height:1.2;width:100%}#cff .cff-author-img,#cff .cff-author.cff-no-author-info .cff-author-img{width:40px;height:40px;background:url(../img/cff-avatar.png) no-repeat}#cff .cff-author a{border:none}#cff .cff-author-img{float:left;margin:0 0 0 -100%!important;font-size:0}#cff .cff-author img{float:left;margin:0!important;padding:0!important;border:none!important;font-size:0}#cff .cff-author .cff-author-text span.cff-page-name{display:table-cell;vertical-align:middle;height:40px;margin:0;font-weight:700;padding-left:50px;float:none}#cff .cff-author .cff-story{font-weight:400}#cff.cff-default-styles .cff-author .cff-author-text span{font-weight:1.2}#cff .cff-author.cff-no-author-info .cff-date{margin-top:14px!important}#cff .cff-author .cff-author-text{float:left;width:100%}#cff .cff-author .cff-date,#cff .cff-author .cff-page-name{float:left;clear:both;width:auto;margin:0 0 0 50px!important}#cff.cff-default-styles .cff-author .cff-author-text *{font-weight:700;line-height:1.2}#cff .cff-author .cff-date{color:#9197a3;font-size:11px;margin-top:0!important;margin-bottom:0!important}#cff.cff-default-styles .cff-author .cff-date{font-weight:400}#cff .cff-author .cff-page-name.cff-author-date{float:left;padding:2px 0 0;font-size:14px}#cff .cff-break-word{word-break:break-all}#cff .cff-expand{display:none}#cff.cff-default-styles .cff-expand a{font-size:11px;font-weight:400}#cff .cff-shared-link{float:left;clear:both;width:100%;padding:5px 10px;margin:10px 0 5px;border:1px solid #d9d9d9;background:rgba(0,0,0,.02);border:1px solid rgba(0,0,0,.07);box-sizing:border-box}#cff .cff-no-styles{background:0 0;border:none;padding:0}#cff .cff-link{float:left;clear:both;max-width:20%;margin:10px 0 0}#cff .cff-link img{max-width:100%}#cff .cff-link-title{float:left;clear:both;width:100%;display:block}#cff.cff-default-styles .cff-link-title{font-weight:700}#cff p.cff-link-title{margin:5px 0 0}#cff .cff-text-link{float:left;clear:none;width:72%;margin-left:3%;padding:0 0 5px}#cff .cff-link-caption{margin:0}#cff.cff-default-styles .cff-link-caption{font-size:12px}#cff .cff-text-link.cff-no-image{width:100%;margin-left:0}#cff .cff-post-desc{margin:5px 0 0}#cff .cff-details{float:left;clear:none;width:100%;margin:0;padding:0}#cff .cff-details h5{margin:0 0 5px}#cff.cff-default-styles .cff-details h5{padding:0;font-size:16px}#cff.cff-default-styles .cff-details p{font-size:14px}#cff.cff-default-styles .cff-post-links,#cff.cff-default-styles .cff-post-links a{font-size:11px}#cff .cff-timeline-event .cff-date,#cff .cff-timeline-event .cff-info,#cff .cff-timeline-event .cff-timeline-event-title,#cff .cff-timeline-event .cff-where{display:block;width:100%;clear:both}#cff .cff-details .cff-info{padding:10px 0 0}#cff.cff-default-styles .cff-details .cff-info{line-height:1.2}#cff .cff-desc-wrap{float:left;width:100%}#cff .cff-post-links{float:left;clear:none;padding:5px 0 0;margin:0}#cff .cff-post-links.cff-left{float:left;margin:8px 0}#cff .cff-post-links a:first-child{padding-left:0;margin:0}#cff .cff-dot{padding:0 5px}#cff .cff-share-container{position:relative;display:inline}#cff .cff-share-tooltip{display:none;position:absolute;z-index:1000;bottom:22px;right:-54px;width:140px;padding:5px 5px 4px;margin:0;background:#333;color:#eee;font-size:12px;line-height:1.3;box-sizing:border-box}#cff .cff-share-tooltip .fa-play{position:absolute;font-size:8px;bottom:-6px;left:50%;margin-left:-3px;color:#333}#cff .cff-share-tooltip a .fa,#cff .cff-share-tooltip a svg{font-size:16px;margin:0;padding:5px}#cff .cff-share-tooltip a{display:block;float:left;margin:0!important;padding:0!important;color:#eee!important;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}#cff .cff-share-tooltip a:hover{color:#fff}#cff .cff-share-tooltip .cff-facebook-icon:hover{background:#3b5998}#cff .cff-share-tooltip .cff-twitter-icon:hover{background:#00aced}#cff .cff-share-tooltip .cff-google-icon:hover{background:#dd4b39}#cff .cff-share-tooltip .cff-linkedin-icon:hover{background:#007bb6}#cff .cff-share-tooltip .cff-pinterest-icon:hover{background:#cb2027}#cff .cff-share-tooltip .cff-email-icon:hover{background:#666}.cff-likebox{float:left;width:100%;position:relative;margin:20px 0 0}.cff-likebox .fb_iframe_widget{width:100%}.cff-likebox .fb_iframe_widget span{width:100%!important}.cff-likebox .fb_iframe_widget iframe{margin:0;position:relative;top:0;left:0;width:100%!important;height:100%}.cff-likebox.cff-top.cff-outside{margin-bottom:10px}.cff-likebox.cff-bottom.cff-outside{margin-top:10px}#cff.cff-fixed-height{overflow:hidden;overflow-y:auto;padding:5px 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#cff .cff-error-msg{display:none;font-size:12px;font-family:sans-serif}#cff #cff-error-reason{display:none;padding:5px 0 0;clear:both}#cff.cff-default-styles .cff-credit{font-size:11px}#cff .cff-credit img{float:left;margin:-2px 5px 0 0}#cff .cff-credit .fa{padding-right:5px;font-size:13px}@media all and (max-width:640px){#cff.cff-width-resp{width:100%!important}}#cff .cff-comment .cff-comment-text img,#cff img.emoji,#cff-lightbox-wrapper .cff-comment .cff-comment-text img,#cff-lightbox-wrapper img.emoji{float:none;max-width:100%}#cff .cff-linebreak{display:block;height:5px}
|
custom-facebook-feed-admin.php
CHANGED
@@ -47,7 +47,7 @@ function cff_settings_page() {
|
|
47 |
$cff_cache_time_unit = 'cff_cache_time_unit';
|
48 |
$cff_locale = 'cff_locale';
|
49 |
// Read in existing option value from database
|
50 |
-
$show_access_token_val =
|
51 |
$access_token_val = get_option( $access_token );
|
52 |
$page_id_val = get_option( $page_id );
|
53 |
$cff_page_type_val = get_option( $cff_page_type, 'page' );
|
@@ -73,7 +73,7 @@ function cff_settings_page() {
|
|
73 |
// See if the user has posted us some information. If they did, this hidden field will be set to 'Y'.
|
74 |
if( isset($_POST[ $hidden_field_name ]) && $_POST[ $hidden_field_name ] == 'Y' ) {
|
75 |
// Read their posted value
|
76 |
-
isset( $_POST[ $show_access_token ] ) ? $show_access_token_val =
|
77 |
isset( $_POST[ $access_token ] ) ? $access_token_val = sanitize_text_field( $_POST[ $access_token ] ) : $access_token_val = '';
|
78 |
isset( $_POST[ $page_id ] ) ? $page_id_val = sanitize_text_field( $_POST[ $page_id ] ) : $page_id_val = '';
|
79 |
isset( $_POST[ $cff_page_type ] ) ? $cff_page_type_val = sanitize_text_field( $_POST[ $cff_page_type ] ) : $cff_page_type_val = '';
|
@@ -86,7 +86,7 @@ function cff_settings_page() {
|
|
86 |
if (isset($_POST[ 'cff_timezone' ]) ) $cff_timezone = sanitize_text_field( $_POST[ 'cff_timezone' ] );
|
87 |
|
88 |
// Save the posted value in the database
|
89 |
-
update_option( $show_access_token,
|
90 |
update_option( $access_token, $access_token_val );
|
91 |
update_option( $page_id, $page_id_val );
|
92 |
update_option( $cff_page_type, $cff_page_type_val );
|
@@ -135,13 +135,65 @@ function cff_settings_page() {
|
|
135 |
|
136 |
<div id="cff_fb_login_modal">
|
137 |
<div class="cff_modal_box">
|
138 |
-
<p>We're teaming up with our good friends at <span class="cff_srlogo">SlickRemix</b> <img src="<?php echo plugins_url( 'img/slick-remix.png' , __FILE__ ) ?>"></span> to provide you with an easy way to connect to Facebook. Simply log into your Facebook account using the button below and approve the plugin to connect your account.</p>
|
139 |
|
140 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
|
142 |
-
<a href="https://www.facebook.com/dialog/oauth?scope=manage_pages&client_id=1123168491105924&redirect_uri=https://www.slickremix.com/facebook-token/&state=<?php echo admin_url('admin.php?page=cff-top'); ?>" class="cff_admin_btn"><i class="fa fa-facebook-square"></i> <?php _e( 'Continue', 'custom-facebook-feed' ); ?></a></p>
|
143 |
|
144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
</div>
|
146 |
</div>
|
147 |
|
@@ -176,7 +228,12 @@ function cff_settings_page() {
|
|
176 |
<?php
|
177 |
} else {
|
178 |
//Show the pages they manage
|
179 |
-
|
|
|
|
|
|
|
|
|
|
|
180 |
|
181 |
foreach ( $pages_data_arr->data as $page => $page_data ) {
|
182 |
echo '<div class="cff-managed-page ';
|
@@ -220,26 +277,11 @@ function cff_settings_page() {
|
|
220 |
</td>
|
221 |
</tr>
|
222 |
|
223 |
-
<!-- <tr valign="top">
|
224 |
-
<th scope="row" style="padding-bottom: 10px;"><?php _e('Enter my own Access Token', 'custom-facebook-feed'); ?><br /><i style="font-weight: normal; font-size: 12px;"><?php _e('This is Recommended', 'custom-facebook-feed'); ?></i></th>
|
225 |
-
<td>
|
226 |
-
<input name="cff_show_access_token" type="checkbox" id="cff_show_access_token" <?php if($show_access_token_val == true) echo "checked"; ?> /> <a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e("What is this?", 'custom-facebook-feed'); ?></a>
|
227 |
-
<p class="cff-tooltip cff-more-info"><?php _e("A Facebook Access Token is not required to use this plugin, but we recommend it so that you're not reliant on the token built into the plugin. If you have your own token then you can check this box and enter it here. To get your own Access Token you can follow these <a href='https://smashballoon.com/custom-facebook-feed/access-token/' target='_blank'>step-by-step instructions</a>", 'custom-facebook-feed'); ?>.</p>
|
228 |
-
</td>
|
229 |
-
</tr> -->
|
230 |
-
|
231 |
<tr valign="top">
|
232 |
-
<th scope="row" style="padding-bottom: 10px;"><?php _e('
|
233 |
<td>
|
234 |
-
<
|
235 |
<p class="cff-tooltip cff-more-info"><?php _e("In order to connect to Facebook and get a feed, you need to use an Access Token. To get one, simply use the blue button above to log into your Facebook account. You will then receive a token that will be used to connect to Facebook's API. If you already have an Access Token then you can enter it here.", 'custom-facebook-feed'); ?></p>
|
236 |
-
</td>
|
237 |
-
</tr>
|
238 |
-
|
239 |
-
<tr valign="top" class="cff-access-token-hidden">
|
240 |
-
<th scope="row" style="padding-bottom: 10px;"><?php _e('Facebook Access Token', 'custom-facebook-feed'); ?></th>
|
241 |
-
<td>
|
242 |
-
<textarea name="cff_access_token" id="cff_access_token" style="min-width: 60%;"><?php esc_attr_e( $access_token_val ); ?></textarea>
|
243 |
|
244 |
<div class="cff-notice cff-profile-error cff-access-token">
|
245 |
<?php _e("<p>This doesn't appear to be an Access Token. Please be sure that you didn't enter your App Secret instead of your Access Token.<br />Your App ID and App Secret are used to obtain your Access Token; simply paste them into the fields in the last step of the <a href='https://smashballoon.com/custom-facebook-feed/access-token/' target='_blank'>Access Token instructions</a> and click '<b>Get my Access Token</b>'.</p>", 'custom-facebook-feed'); ?>
|
@@ -654,7 +696,6 @@ foreach ( $plugins as $plugin_path => $plugin ) {
|
|
654 |
?>
|
655 |
|
656 |
## PLUGIN SETTINGS: ##
|
657 |
-
Use own Access Token: <?php echo get_option( 'cff_show_access_token' ) ."\n"; ?>
|
658 |
Access Token: <?php echo get_option( 'cff_access_token' ) ."\n"; ?>
|
659 |
Page ID: <?php echo get_option( 'cff_page_id' ) ."\n"; ?>
|
660 |
Page Type: <?php echo get_option( 'cff_page_type' ) ."\n"; ?>
|
47 |
$cff_cache_time_unit = 'cff_cache_time_unit';
|
48 |
$cff_locale = 'cff_locale';
|
49 |
// Read in existing option value from database
|
50 |
+
$show_access_token_val = true;
|
51 |
$access_token_val = get_option( $access_token );
|
52 |
$page_id_val = get_option( $page_id );
|
53 |
$cff_page_type_val = get_option( $cff_page_type, 'page' );
|
73 |
// See if the user has posted us some information. If they did, this hidden field will be set to 'Y'.
|
74 |
if( isset($_POST[ $hidden_field_name ]) && $_POST[ $hidden_field_name ] == 'Y' ) {
|
75 |
// Read their posted value
|
76 |
+
isset( $_POST[ $show_access_token ] ) ? $show_access_token_val = true : $show_access_token_val = true;
|
77 |
isset( $_POST[ $access_token ] ) ? $access_token_val = sanitize_text_field( $_POST[ $access_token ] ) : $access_token_val = '';
|
78 |
isset( $_POST[ $page_id ] ) ? $page_id_val = sanitize_text_field( $_POST[ $page_id ] ) : $page_id_val = '';
|
79 |
isset( $_POST[ $cff_page_type ] ) ? $cff_page_type_val = sanitize_text_field( $_POST[ $cff_page_type ] ) : $cff_page_type_val = '';
|
86 |
if (isset($_POST[ 'cff_timezone' ]) ) $cff_timezone = sanitize_text_field( $_POST[ 'cff_timezone' ] );
|
87 |
|
88 |
// Save the posted value in the database
|
89 |
+
update_option( $show_access_token, true );
|
90 |
update_option( $access_token, $access_token_val );
|
91 |
update_option( $page_id, $page_id_val );
|
92 |
update_option( $cff_page_type, $cff_page_type_val );
|
135 |
|
136 |
<div id="cff_fb_login_modal">
|
137 |
<div class="cff_modal_box">
|
|
|
138 |
|
139 |
+
<div id="cff-token-intro">
|
140 |
+
<p>I am displaying a feed from a Facebook page that:</p>
|
141 |
+
<div class="cff-token-radios">
|
142 |
+
<div>
|
143 |
+
<input type="radio" id="cff-token-own" name="token-perm" value="own" />
|
144 |
+
<label for="cff-token-own">I am an admin of</label> <a href="javascript:void(0);" class="cff-tooltip-link cff-token-question-own"><i class="fa fa-info-circle" aria-hidden="true"></i></a>
|
145 |
+
|
146 |
+
<p class="cff-tooltip cff-more-info"><?php _e("Select this option if you are an admin of the Facebook page you want to display a feed from.", 'custom-facebook-feed'); ?></p>
|
147 |
+
</div>
|
148 |
+
<div>
|
149 |
+
<input type="radio" id="cff-token-public" name="token-perm" value="public" />
|
150 |
+
<label for="cff-token-public">I am <b>NOT</b> an admin of</label> <a href="javascript:void(0);" class="cff-tooltip-link cff-token-question-public"><i class="fa fa-info-circle" aria-hidden="true"></i></a>
|
151 |
+
|
152 |
+
<p class="cff-tooltip cff-more-info"><?php _e("Select this option if you need to display a feed from a Facebook page that you are not an admin of.", 'custom-facebook-feed'); ?></p>
|
153 |
+
</div>
|
154 |
+
</div>
|
155 |
+
|
156 |
+
<p>
|
157 |
+
<a href="javascript:void(0);" id="cff_admin_cancel_btn_2" class="cff-admin-cancel-btn">Cancel</a>
|
158 |
+
<a href="javascript:void(0);" class="cff_admin_btn cff-disabled" id="cff_token_perm_selected"><?php _e( 'Continue', 'custom-facebook-feed' ); ?></a>
|
159 |
+
</p>
|
160 |
+
</div>
|
161 |
+
|
162 |
+
<div id="cff-own">
|
163 |
+
<p>Log into your Facebook account using the button below and approve the plugin to connect your account.</p>
|
164 |
+
|
165 |
+
<p><a href="javascript:void(0);" id="cff_admin_cancel_btn_3" class="cff-admin-cancel-btn">Cancel</a>
|
166 |
+
|
167 |
+
<?php
|
168 |
+
$admin_url_state = admin_url('admin.php?page=cff-top');
|
169 |
+
//If the admin_url isn't returned correctly then use a fallback
|
170 |
+
if( $admin_url_state == '/wp-admin/admin.php?page=cff-top' || $admin_url_state == '/wp-admin/admin.php?page=cff-top&tab=configuration' ){
|
171 |
+
$admin_url_state = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
172 |
+
}
|
173 |
+
?>
|
174 |
+
<a href="https://www.facebook.com/dialog/oauth?client_id=1332798716823516&redirect_uri=https://smashballoon.com/fb-1332798716823516-redirect/&scope=manage_pages&state=<?php echo $admin_url_state; ?>" class="cff_admin_btn"><i class="fa fa-facebook-square"></i> <?php _e( 'Continue', 'custom-facebook-feed' ); ?></a></p>
|
175 |
+
|
176 |
+
<p style="font-size: 11px; margin-top: 25px;"><b>Please note:</b> this does not give us permission to manage your Facebook pages, it simply allows the plugin to see a list of the pages you manage and retrieve an Access Token.</p>
|
177 |
+
</div>
|
178 |
+
|
179 |
+
<div id="cff-public">
|
180 |
+
<p>We're teaming up with our good friends at <span class="cff_srlogo">SlickRemix</b> <img src="<?php echo plugins_url( 'img/slick-remix.png' , __FILE__ ) ?>"></span> to provide you with an easy way to connect to Facebook. Simply log into your Facebook account using the button below and approve the plugin to connect your account.</p>
|
181 |
|
|
|
182 |
|
183 |
+
<p><a href="javascript:void(0);" id="cff_admin_cancel_btn" class="cff-admin-cancel-btn">Cancel</a>
|
184 |
+
|
185 |
+
<?php
|
186 |
+
$admin_url_state = admin_url('admin.php?page=cff-top');
|
187 |
+
//If the admin_url isn't returned correctly then use a fallback
|
188 |
+
if( $admin_url_state == '/wp-admin/admin.php?page=cff-top' || $admin_url_state == '/wp-admin/admin.php?page=cff-top&tab=configuration' ){
|
189 |
+
$admin_url_state = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
190 |
+
}
|
191 |
+
?>
|
192 |
+
<a href="https://www.facebook.com/dialog/oauth?scope=manage_pages&client_id=1123168491105924&redirect_uri=https://www.slickremix.com/facebook-token/&state=<?php echo $admin_url_state; ?>" class="cff_admin_btn"><i class="fa fa-facebook-square"></i> <?php _e( 'Continue', 'custom-facebook-feed' ); ?></a></p>
|
193 |
+
|
194 |
+
<p style="font-size: 11px; margin-top: 25px;"><b>Please note:</b> this does not give us permission to manage your Facebook pages, it simply allows the plugin to see a list of the pages you manage and retrieve an Access Token.</p>
|
195 |
+
</div>
|
196 |
+
|
197 |
</div>
|
198 |
</div>
|
199 |
|
228 |
<?php
|
229 |
} else {
|
230 |
//Show the pages they manage
|
231 |
+
|
232 |
+
if( isset($_GET['own']) ){
|
233 |
+
echo '<p style="background: #F7E6E6; border: 1px solid #BA7B7B; padding: 15px 20px; border-radius: 5px;">Select one of the pages below to get an Access Token for that page.<br /><b><u>Important:</u></b> This Access Token will only be able to display content from the <b>selected page</b>.</p>';
|
234 |
+
} else {
|
235 |
+
echo '<p style="background: #dceada; border: 1px solid #6ca365; padding: 15px 20px; border-radius: 5px;">Select one of the pages below to get an Access Token.<br /><b><u>Important:</u> This Access Token will allow you to display posts from <u>any</u> public Facebook page, not just the one selected.</b></p>';
|
236 |
+
}
|
237 |
|
238 |
foreach ( $pages_data_arr->data as $page => $page_data ) {
|
239 |
echo '<div class="cff-managed-page ';
|
277 |
</td>
|
278 |
</tr>
|
279 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
<tr valign="top">
|
281 |
+
<th scope="row" style="padding-bottom: 10px;"><?php _e('Facebook Access Token', 'custom-facebook-feed'); ?><br /><i style="font-weight: normal; font-size: 12px; color: red;"><?php _e('Required', 'custom-facebook-feed'); ?></i></th>
|
282 |
<td>
|
283 |
+
<textarea name="cff_access_token" id="cff_access_token" style="min-width: 60%;"><?php esc_attr_e( $access_token_val ); ?></textarea><br /><a class="cff-tooltip-link" style="margin-left: 3px;" href="JavaScript:void(0);"><?php _e("What is this?", 'custom-facebook-feed'); ?></a>
|
284 |
<p class="cff-tooltip cff-more-info"><?php _e("In order to connect to Facebook and get a feed, you need to use an Access Token. To get one, simply use the blue button above to log into your Facebook account. You will then receive a token that will be used to connect to Facebook's API. If you already have an Access Token then you can enter it here.", 'custom-facebook-feed'); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
|
286 |
<div class="cff-notice cff-profile-error cff-access-token">
|
287 |
<?php _e("<p>This doesn't appear to be an Access Token. Please be sure that you didn't enter your App Secret instead of your Access Token.<br />Your App ID and App Secret are used to obtain your Access Token; simply paste them into the fields in the last step of the <a href='https://smashballoon.com/custom-facebook-feed/access-token/' target='_blank'>Access Token instructions</a> and click '<b>Get my Access Token</b>'.</p>", 'custom-facebook-feed'); ?>
|
696 |
?>
|
697 |
|
698 |
## PLUGIN SETTINGS: ##
|
|
|
699 |
Access Token: <?php echo get_option( 'cff_access_token' ) ."\n"; ?>
|
700 |
Page ID: <?php echo get_option( 'cff_page_id' ) ."\n"; ?>
|
701 |
Page Type: <?php echo get_option( 'cff_page_type' ) ."\n"; ?>
|
custom-facebook-feed.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Custom Facebook Feed
|
4 |
Plugin URI: http://smashballoon.com/custom-facebook-feed
|
5 |
Description: Add completely customizable Facebook feeds to your WordPress site
|
6 |
-
Version: 2.7
|
7 |
Author: Smash Balloon
|
8 |
Author URI: http://smashballoon.com/
|
9 |
License: GPLv2 or later
|
@@ -24,7 +24,7 @@ along with this program; if not, write to the Free Software
|
|
24 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
25 |
*/
|
26 |
|
27 |
-
define('CFFVER', '2.7');
|
28 |
|
29 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
30 |
//Include admin
|
@@ -1311,7 +1311,7 @@ function display_cff($atts) {
|
|
1311 |
//Set the author image as a variable. If it already exists then don't query the api for it again.
|
1312 |
$cff_author_img_var = '$cff_author_img_' . $cff_from_id;
|
1313 |
if ( !isset($$cff_author_img_var) ) $$cff_author_img_var = 'https://graph.facebook.com/' . $cff_from_id . '/picture?type=square';
|
1314 |
-
$cff_author .= '<div class="cff-author-img"><a '.$cff_author_link_atts.'><img src="'.$$cff_author_img_var.'" title="'.$cff_author_name.'" alt="'.$cff_author_name.'" width=40 height=40></a></div>';
|
1315 |
|
1316 |
$cff_author .= '</div>'; //End .cff-author
|
1317 |
|
3 |
Plugin Name: Custom Facebook Feed
|
4 |
Plugin URI: http://smashballoon.com/custom-facebook-feed
|
5 |
Description: Add completely customizable Facebook feeds to your WordPress site
|
6 |
+
Version: 2.7.1
|
7 |
Author: Smash Balloon
|
8 |
Author URI: http://smashballoon.com/
|
9 |
License: GPLv2 or later
|
24 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
25 |
*/
|
26 |
|
27 |
+
define('CFFVER', '2.7.1');
|
28 |
|
29 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
30 |
//Include admin
|
1311 |
//Set the author image as a variable. If it already exists then don't query the api for it again.
|
1312 |
$cff_author_img_var = '$cff_author_img_' . $cff_from_id;
|
1313 |
if ( !isset($$cff_author_img_var) ) $$cff_author_img_var = 'https://graph.facebook.com/' . $cff_from_id . '/picture?type=square';
|
1314 |
+
$cff_author .= '<div class="cff-author-img"><a '.$cff_author_link_atts.'><img src="'.$$cff_author_img_var.'" title="'.$cff_author_name.'" alt="'.$cff_author_name.'" width=40 height=40 onerror="this.style.display=\'none\'"></a></div>';
|
1315 |
|
1316 |
$cff_author .= '</div>'; //End .cff-author
|
1317 |
|
js/cff-admin-scripts.js
CHANGED
@@ -191,14 +191,15 @@ jQuery(document).ready(function($) {
|
|
191 |
$('#cff_fb_login').on('click', function(){
|
192 |
$('#cff_fb_login_modal').show();
|
193 |
});
|
194 |
-
$('#cff_admin_cancel_btn').on('click', function(){
|
195 |
-
$('#cff_fb_login_modal').hide();
|
|
|
196 |
});
|
197 |
|
198 |
//Select a page for token
|
199 |
$('.cff-managed-page').on('click', function(){
|
200 |
$('#cff_access_token, #cff_page_access_token').val( $(this).attr('data-token') ).addClass('cff-success');
|
201 |
-
|
202 |
$(this).siblings().removeClass('cff-page-selected');
|
203 |
$(this).addClass('cff-page-selected');
|
204 |
// $('.cff-save-page-token').show();
|
@@ -208,4 +209,21 @@ jQuery(document).ready(function($) {
|
|
208 |
}
|
209 |
});
|
210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
});
|
191 |
$('#cff_fb_login').on('click', function(){
|
192 |
$('#cff_fb_login_modal').show();
|
193 |
});
|
194 |
+
$('#cff_admin_cancel_btn, #cff_admin_cancel_btn_2, #cff_admin_cancel_btn_3').on('click', function(){
|
195 |
+
$('#cff_fb_login_modal, #cff-public, #cff-own').hide();
|
196 |
+
$('#cff-token-intro').show();
|
197 |
});
|
198 |
|
199 |
//Select a page for token
|
200 |
$('.cff-managed-page').on('click', function(){
|
201 |
$('#cff_access_token, #cff_page_access_token').val( $(this).attr('data-token') ).addClass('cff-success');
|
202 |
+
if( $('#cff_page_id').val().trim() == '' ) $('#cff_page_id').val( $(this).attr('data-page-id') );
|
203 |
$(this).siblings().removeClass('cff-page-selected');
|
204 |
$(this).addClass('cff-page-selected');
|
205 |
// $('.cff-save-page-token').show();
|
209 |
}
|
210 |
});
|
211 |
|
212 |
+
//Token radio change event
|
213 |
+
$('input[type=radio][name=token-perm]').change(function() {
|
214 |
+
$('.cff_admin_btn').removeClass('cff-disabled');
|
215 |
+
});
|
216 |
+
if( $('input[type=radio][name=token-perm]').is(":checked") ){
|
217 |
+
$('.cff_admin_btn').removeClass('cff-disabled');
|
218 |
+
}
|
219 |
+
|
220 |
+
$('#cff_token_perm_selected').on('click', function(){
|
221 |
+
if( !$(this).hasClass('cff-disabled') ){
|
222 |
+
var cffTokenRadioVal = $('input[name=token-perm]:checked').val();
|
223 |
+
if( cffTokenRadioVal == 'own' ) $('#cff-own').show();
|
224 |
+
if( cffTokenRadioVal == 'public' ) $('#cff-public').show();
|
225 |
+
$('#cff-token-intro').hide();
|
226 |
+
}
|
227 |
+
});
|
228 |
+
|
229 |
});
|