WS Facebook Like Box Widget - Version 4.0

Version Description

  • Fix plugin notices
  • Fix errors notices
  • Update informations
Download this release

Release Info

Developer webshouter
Plugin Icon 128x128 WS Facebook Like Box Widget
Version 4.0
Comparing to
See all releases

Code changes from version 2.0 to 4.0

includes/shortcodes.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Register Shortcode
4
+ function ws_facebook_likebox_add_shortcode( $atts ) {
5
+
6
+ extract( shortcode_atts(
7
+ array(
8
+ 'page_id' => 'webshouters',
9
+ 'width' => '250',
10
+ 'height' => '500',
11
+ 'adapt_width' => 'no',
12
+ 'small_header' => 'no',
13
+ 'hide_cover_photo'=>'no',
14
+ 'show_faces'=> 'yes',
15
+ 'tabs' => 'timeline',
16
+ 'locale_lang' => 'en_US',
17
+ ), $atts )
18
+ );
19
+
20
+ $html = '';
21
+
22
+ $html .= '<div class="fb-page ws-fb-like-box" data-href="https://www.facebook.com/'.$page_id.'"
23
+ data-tabs="'.$tabs.'"
24
+ data-width="'.$width.'"
25
+ data-height="'.$height.'"
26
+ data-small-header="'.$small_header.'"
27
+ data-adapt-container-width="'.$adapt_width.'"
28
+ data-hide-cover="'.$hide_cover_photo.'"
29
+ data-show-facepile="'.$show_faces.'">
30
+ <div class="fb-xfbml-parse-ignore">
31
+ <blockquote cite="https://www.facebook.com/'.$page_id.'">
32
+ <a href="https://www.facebook.com/'.$page_id.'">Facebook</a>
33
+ </blockquote>
34
+ </div>
35
+ </div> ';
36
+
37
+ $html .= '<div id="fb-root"></div>
38
+ <script>(function(d, s, id) {
39
+ var js, fjs = d.getElementsByTagName(s)[0];
40
+ if (d.getElementById(id)) return;
41
+ js = d.createElement(s); js.id = id;
42
+ js.src = "//connect.facebook.net/'. $locale_lang .'/sdk.js#xfbml=1&version=v2.6";
43
+ fjs.parentNode.insertBefore(js, fjs);
44
+ }(document, \'script\', \'facebook-jssdk\'));</script>';
45
+
46
+ return $html;
47
+ }
48
+ add_shortcode( 'ws-facebook-likebox', 'ws_facebook_likebox_add_shortcode' );
49
+
50
+ ?>
languages/ws-facebook-likebox.pot ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2016 WS Facebook Like Box Widget
2
+ # This file is distributed under the same license as the WS Facebook Like Box Widget package.
3
+ #, fuzzy
4
+ msgid ""
5
+ msgstr ""
6
+ "Project-Id-Version: WS Facebook Like Box Widget 3.0\n"
7
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ws-facebook-"
8
+ "likebox\n"
9
+ "POT-Creation-Date: 2016-05-11 09:49+0530\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
14
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
15
+ "Language-Team: Web Shouter <info@webshouter.net>\n"
16
+ "X-Generator: Poedit 1.8.7\n"
17
+ "X-Poedit-SourceCharset: UTF-8\n"
18
+ "X-Poedit-KeywordsList: __;_e\n"
19
+
20
+ #: ws-fecebook-likebox.php:24
21
+ msgid "WS Facebook Likebox"
22
+ msgstr ""
23
+
24
+ #: ws-fecebook-likebox.php:25
25
+ msgid "WS Likebox Widget!"
26
+ msgstr ""
27
+
28
+ #: ws-fecebook-likebox.php:32
29
+ msgid "Facebook Like Box"
30
+ msgstr ""
31
+
32
+ #: ws-fecebook-likebox.php:48
33
+ msgid "Title"
34
+ msgstr ""
35
+
36
+ #: ws-fecebook-likebox.php:56
37
+ msgid "Page Id"
38
+ msgstr ""
39
+
40
+ #: ws-fecebook-likebox.php:64
41
+ msgid "Width"
42
+ msgstr ""
43
+
44
+ #: ws-fecebook-likebox.php:71
45
+ msgid "Height"
46
+ msgstr ""
47
+
48
+ #: ws-fecebook-likebox.php:78
49
+ msgid "Adapt to plugin container width"
50
+ msgstr ""
51
+
52
+ #: ws-fecebook-likebox.php:80 ws-fecebook-likebox.php:88
53
+ #: ws-fecebook-likebox.php:96 ws-fecebook-likebox.php:104
54
+ msgid "No"
55
+ msgstr ""
56
+
57
+ #: ws-fecebook-likebox.php:81 ws-fecebook-likebox.php:89
58
+ #: ws-fecebook-likebox.php:97 ws-fecebook-likebox.php:105
59
+ msgid "Yes"
60
+ msgstr ""
61
+
62
+ #: ws-fecebook-likebox.php:86
63
+ msgid "Use Small Header"
64
+ msgstr ""
65
+
66
+ #: ws-fecebook-likebox.php:94
67
+ msgid "Hide Cover Photo"
68
+ msgstr ""
69
+
70
+ #: ws-fecebook-likebox.php:102
71
+ msgid "Show Friend's Faces"
72
+ msgstr ""
73
+
74
+ #: ws-fecebook-likebox.php:110
75
+ msgid "Tabs"
76
+ msgstr ""
77
+
78
+ #: ws-fecebook-likebox.php:112
79
+ msgid "Hide Posts"
80
+ msgstr ""
81
+
82
+ #: ws-fecebook-likebox.php:113
83
+ msgid "Timeline"
84
+ msgstr ""
85
+
86
+ #: ws-fecebook-likebox.php:114
87
+ msgid "Events"
88
+ msgstr ""
89
+
90
+ #: ws-fecebook-likebox.php:115
91
+ msgid "Messages"
92
+ msgstr ""
93
+
94
+ #: ws-fecebook-likebox.php:121
95
+ msgid "Language"
96
+ msgstr ""
97
+
98
+ #. Plugin Name of the plugin/theme
99
+ msgid "WS Facebook Like Box Widget"
100
+ msgstr ""
101
+
102
+ #. Plugin URI of the plugin/theme
103
+ msgid "https://wordpress.org/plugins/ws-fecebook-likebox/"
104
+ msgstr ""
105
+
106
+ #. Description of the plugin/theme
107
+ msgid ""
108
+ "WS Facebook Like Box Widget provides easy and quick use in your blog. You "
109
+ "can fully customize facebook like box in easy way."
110
+ msgstr ""
111
+
112
+ #. Author of the plugin/theme
113
+ msgid "Web Shouter"
114
+ msgstr ""
115
+
116
+ #. Author URI of the plugin/theme
117
+ msgid "http://www.webshouter.net/"
118
+ msgstr ""
readme.txt CHANGED
@@ -1,41 +1,227 @@
1
  === WS Facebook Like Box Widget ===
2
- Contributors: webshouter
3
  Tags: facebook, facebook like, likebox, widget, likebox, custom facebook likebox, facebook, facebook badge, facebook button, facebook like, facebook like box, facebook like box shortcode, facebook like box shortcodes, facebook like box widget, facebook like button, Facebook like widget, facebook likebox, facebook likebox widget, facebook meta, facebook meta tag, Facebook Open Graph, Facebook Page, facebook platform, facebook plugin, facebook recommend, facebook share, facebook sidebar, facebook style, facebook wall, Facebook Widget, friends, google +1, google plus, Like, like box, like box facebook, like box sidebox, like box widget, likebox, meta, nice facebook like box, open graph, page, plugin, seo, sharebar, sidebar, social, Social Plugins, social profiles, social share, shortcode, social sidebar, wordpress facebook like box, wordpress like
4
- Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=T59LYJEC5HAHC
5
  Requires at least: 3.0
6
- Tested up to: 4.3.1
7
  Stable tag: 4.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- WS Facebook Like Box Widget provides easy and quick use in your blog. You can fully customize facebook like box in easy way.
12
 
13
  == Description ==
14
 
15
- WS Facebook Like Box Widget provides easy and quick use in your blog. You can fully customize facebook like box in easy way.
16
 
17
- Facebook Like Box Widget. Facebook Like Box Widget is a social plugin that enables Facebook Page owners to attract and gain Likes & Recommendation Comments from their own website.
18
 
19
- <strong>Features</strong>
20
 
21
 
22
- * Very Easy to install
 
 
23
  * No facebook api key required
24
  * Fully customized layout
 
 
 
 
 
 
 
 
 
25
  * Easy to add shortcode anywhere in your wordpress site.
26
 
27
- <strong>Shortcode</strong>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
 
29
 
30
- >[ws-facebook-likebox url="https://www.facebook.com/webshouter" width="340" height="500" show_faces="true" show_Header="true" show_border="false"]
31
 
32
- `<?php echo do_shortcode( '[ws-facebook-likebox url="https://www.facebook.com/webshouter" width="340" height="500" show_faces="true" show_Header="true" show_border="false"]' ); ?>`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
- ### Find Us on Social Media
 
 
 
 
 
 
 
 
 
 
35
 
36
- * [Facebook](https://www.facebook.com/webshouter)
37
- * [Twitter](https://twitter.com/webshouter)
38
 
 
 
 
 
 
39
 
40
  == Installation ==
41
 
@@ -48,20 +234,44 @@ This section describes how to install the plugin and get it working.
48
 
49
  == Frequently Asked Questions ==
50
 
51
- There are no FAQ just yet
52
 
53
  == Screenshots ==
54
 
55
  1. This screenshots for widget settings.
56
- 2. After see facebook likebox.
57
- 3. Using shortcode on page.
58
-
 
59
 
60
  == Changelog ==
61
 
62
- Version 1.0 released.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
 
 
 
 
 
 
 
64
 
65
  == Upgrade Notice ==
66
 
67
- Upgrade to Version 1.0.
1
  === WS Facebook Like Box Widget ===
2
+ Contributors: webshouters
3
  Tags: facebook, facebook like, likebox, widget, likebox, custom facebook likebox, facebook, facebook badge, facebook button, facebook like, facebook like box, facebook like box shortcode, facebook like box shortcodes, facebook like box widget, facebook like button, Facebook like widget, facebook likebox, facebook likebox widget, facebook meta, facebook meta tag, Facebook Open Graph, Facebook Page, facebook platform, facebook plugin, facebook recommend, facebook share, facebook sidebar, facebook style, facebook wall, Facebook Widget, friends, google +1, google plus, Like, like box, like box facebook, like box sidebox, like box widget, likebox, meta, nice facebook like box, open graph, page, plugin, seo, sharebar, sidebar, social, Social Plugins, social profiles, social share, shortcode, social sidebar, wordpress facebook like box, wordpress like
4
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CCSEKJQGBQTEQ
5
  Requires at least: 3.0
6
+ Tested up to: 4.5.3
7
  Stable tag: 4.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ This plugin provides easy and quick use facebook like box widget in your blog. You can fully customize facebook like box in easy way.
12
 
13
  == Description ==
14
 
15
+ WS Facebook Like Box Widget provides easy and quick use facebook like box widget in your blog. You can fully customize facebook like box in easy way.
16
 
17
+ A Facebook Like Box Widget is a social plugin that enables Facebook Page owners to attract and gain Likes & Recommendation Comments from their own website.
18
 
19
+ <strong>Free Features</strong>
20
 
21
 
22
+ * Easy to install and Configure
23
+ * User friendly and easy to use.
24
+ * All browser working
25
  * No facebook api key required
26
  * Fully customized layout
27
+ * Show latest post from facebook page
28
+ * Show Events from facebook page
29
+ * Send Message
30
+ * Change Like Box Width
31
+ * Change Like Box Height
32
+ * Show/hide Friend's Faces
33
+ * Use Small Header
34
+ * Show/hide Cover Photo
35
+ * Change Like Box language
36
  * Easy to add shortcode anywhere in your wordpress site.
37
 
38
+ **Premium Features:**
39
+
40
+ * Easy to install and Configure
41
+ * User friendly and easy to use.
42
+ * All browser Support
43
+ * No facebook api key required
44
+ * Fully customized layout
45
+ * Show latest post from facebook page
46
+ * Show Events from facebook page
47
+ * Send Message
48
+ * Set Like Box Width
49
+ * Set Like Box Height
50
+ * Show/hide Friend’s Faces
51
+ * Use Small Header
52
+ * Show/hide Cover Photo
53
+ * Change Like Box language
54
+ * Use Shortcode
55
+ * Enable/Disable Auto Popup Likebox
56
+
57
+ **Buy Now**
58
 
59
+ [http://www.webshouters.com/wp-plugins/ws-facebook-like-box-pro.html](http://www.webshouters.com/wp-plugins/ws-facebook-like-box-pro.html "Buy Now")
60
 
61
+ = WS Facebook Like Box Pro is now available in the following Languages =
62
 
63
+ * Afrikaans (af_ZA)
64
+ * Akan (ak_GH)
65
+ * Amharic (am_ET)
66
+ * Arabic (ar_AR)
67
+ * Assamese (as_IN)
68
+ * Aymara (ay_BO)
69
+ * Azerbaijani (az_AZ)
70
+ * Belarusian (be_BY)
71
+ * Bulgarian (bg_BG)
72
+ * Bengali (bn_IN)
73
+ * Breton (br_FR)
74
+ * Bosnian (bs_BA)
75
+ * Catalan (ca_ES)
76
+ * Sorani Kurdish (cb_IQ)
77
+ * Cherokee (ck_US)
78
+ * Corsican (co_FR)
79
+ * Czech (cs_CZ)
80
+ * Cebuano (cx_PH)
81
+ * Welsh (cy_GB)
82
+ * Danish (da_DK)
83
+ * German (de_DE)
84
+ * Greek (el_GR)
85
+ * English (UK) (en_GB)
86
+ * English (India) (en_IN)
87
+ * English (Pirate) (en_PI)
88
+ * English (Upside Down) (en_UD)
89
+ * English (US) (en_US)
90
+ * Esperanto (eo_EO)
91
+ * Spanish (Chile) (es_CL)
92
+ * Spanish (Colombia) (es_CO)
93
+ * Spanish (Spain) (es_ES)
94
+ * Spanish (es_LA)
95
+ * Spanish (Mexico) (es_MX)
96
+ * Spanish (Venezuela) (es_VE)
97
+ * Estonian (et_EE)
98
+ * Basque (eu_ES)
99
+ * Persian (fa_IR)
100
+ * Leet Speak (fb_LT)
101
+ * Fulah (ff_NG)
102
+ * Finnish (fi_FI)
103
+ * Faroese (fo_FO)
104
+ * French (Canada) (fr_CA)
105
+ * French (France) (fr_FR)
106
+ * Frisian (fy_NL)
107
+ * Irish (ga_IE)
108
+ * Galician (gl_ES)
109
+ * Guarani (gn_PY)
110
+ * Gujarati (gu_IN)
111
+ * Classical Greek (gx_GR)
112
+ * Hausa (ha_NG)
113
+ * Hebrew (he_IL)
114
+ * Hindi (hi_IN)
115
+ * Croatian (hr_HR)
116
+ * Haitian Creole (ht_HT)
117
+ * Hungarian (hu_HU)
118
+ * Armenian (hy_AM)
119
+ * Indonesian (id_ID)
120
+ * Igbo (ig_NG)
121
+ * Icelandic (is_IS)
122
+ * Italian (it_IT)
123
+ * Japanese (ja_JP)
124
+ * Japanese (Kansai) (ja_KS)
125
+ * Javanese (jv_ID)
126
+ * Georgian (ka_GE)
127
+ * Kazakh (kk_KZ)
128
+ * Khmer (km_KH)
129
+ * Kannada (kn_IN)
130
+ * Korean (ko_KR)
131
+ * Kurdish (Kurmanji) (ku_TR)
132
+ * Kyrgyz (ky_KG)
133
+ * Latin (la_VA)
134
+ * Ganda (lg_UG)
135
+ * Limburgish (li_NL)
136
+ * Lingala (ln_CD)
137
+ * Lao (lo_LA)
138
+ * Lithuanian (lt_LT)
139
+ * Latvian (lv_LV)
140
+ * Malagasy (mg_MG)
141
+ * Māori (mi_NZ)
142
+ * Macedonian (mk_MK)
143
+ * Malayalam (ml_IN)
144
+ * Mongolian (mn_MN)
145
+ * Marathi (mr_IN)
146
+ * Malay (ms_MY)
147
+ * Maltese (mt_MT)
148
+ * Burmese (my_MM)
149
+ * Norwegian (bokmal) (nb_NO)
150
+ * Ndebele (nd_ZW)
151
+ * Nepali (ne_NP)
152
+ * Dutch (België) (nl_BE)
153
+ * Dutch (nl_NL)
154
+ * Norwegian (nynorsk) (nn_NO)
155
+ * Chewa (ny_MW)
156
+ * Oriya (or_IN)
157
+ * Punjabi (pa_IN)
158
+ * Polish (pl_PL)
159
+ * Pashto (ps_AF)
160
+ * Portuguese (Brazil) (pt_BR)
161
+ * Portuguese (Portugal) (pt_PT)
162
+ * Quiché (qc_GT)
163
+ * Quechua (qu_PE)
164
+ * Romansh (rm_CH)
165
+ * Romanian (ro_RO)
166
+ * Russian (ru_RU)
167
+ * Kinyarwanda (rw_RW)
168
+ * Sanskrit (sa_IN)
169
+ * Sardinian (sc_IT)
170
+ * Northern Sámi (se_NO)
171
+ * Sinhala (si_LK)
172
+ * Slovak (sk_SK)
173
+ * Slovenian (sl_SI)
174
+ * Shona (sn_ZW)
175
+ * Somali (so_SO)
176
+ * Albanian (sq_AL)
177
+ * Serbian (sr_RS)
178
+ * Swedish (sv_SE)
179
+ * Swahili (sw_KE)
180
+ * Syriac (sy_SY)
181
+ * Silesian (sz_PL)
182
+ * Tamil (ta_IN)
183
+ * Telugu (te_IN)
184
+ * Tajik (tg_TJ)
185
+ * Thai (th_TH)
186
+ * Turkmen (tk_TM)
187
+ * Filipino (tl_PH)
188
+ * Klingon (tl_ST)
189
+ * Turkish (tr_TR)
190
+ * Tatar (tt_RU)
191
+ * Tamazight (tz_MA)
192
+ * Ukrainian (uk_UA)
193
+ * Urdu (ur_PK)
194
+ * Uzbek (uz_UZ)
195
+ * Vietnamese (vi_VN)
196
+ * Wolof (wo_SN)
197
+ * Xhosa (xh_ZA)
198
+ * Yiddish (yi_DE)
199
+ * Yoruba (yo_NG)
200
+ * Simplified Chinese (China) (zh_CN)
201
+ * Traditional Chinese (Hong Kong) (zh_HK)
202
+ * Traditional Chinese (Taiwan) (zh_TW)
203
+ * Zulu (zu_ZA)
204
+ * Zazaki (zz_TR)
205
 
206
+ **Buy Now**
207
+
208
+ [http://www.webshouters.com/wp-plugins/ws-facebook-like-box-pro.html](http://www.webshouter.com/wp-plugins/ws-facebook-like-box-pro.html "Buy Now")
209
+
210
+ <strong>Shortcode</strong>
211
+
212
+ >[ws-facebook-likebox page_id="webshouters" width="340" height="500" small_header="no" hide_cover_photo="no" show_faces="no" tabs="timeline"]
213
+
214
+ **Live Demo**
215
+
216
+ [http://plugins.webshouters.com/ws-facebook-like-box-pro/](http://plugins.webshouters.com/ws-facebook-like-box-pro/ "Click to Live Demo")
217
 
218
+ If you want more information about this plugin or another one don't doubt to visit our website:
 
219
 
220
+ [http://www.webshouters.com/](http://www.webshouters.com/ "WebShouters")
221
+
222
+ = Technical Support =
223
+
224
+ If any problem occurs, please contact us at [support@webshouters.com](mailto:support@webshouters.com).
225
 
226
  == Installation ==
227
 
234
 
235
  == Frequently Asked Questions ==
236
 
237
+ Please visit the forum for questions or comments: http://www.webshouters.com/plugins/
238
 
239
  == Screenshots ==
240
 
241
  1. This screenshots for widget settings.
242
+ 2. Using shortcode on page.
243
+ 3. Screenshot for facebook likebox(default).
244
+ 4. Screenshot for facebook likebox(Tabs-Hide Posts).
245
+ 5. Screenshot for facebook likebox without posts.
246
 
247
  == Changelog ==
248
 
249
+ = 4.0 =
250
+
251
+ * Fix plugin notices
252
+ * Fix errors notices
253
+ * Update informations
254
+
255
+ = 3.2 =
256
+
257
+ * Publish pro version
258
+ * Modify Languages
259
+
260
+ = 3.1 =
261
+
262
+ * Internationalize plugin
263
+ * Make translatable plugin
264
+ * Update Language Support
265
+
266
+ = 3.0 =
267
 
268
+ * Update with latest facebook sdk
269
+ * Language Support
270
+ * Show or Hide Posts, Events & Send Message
271
+ * Use Small Header
272
+ * Show/hide Cover Photo
273
+ * Update Shortcode
274
 
275
  == Upgrade Notice ==
276
 
277
+ Upgrade to Version 3.2.
ws-fecebook-likebox.php CHANGED
@@ -3,132 +3,128 @@
3
  Plugin Name: WS Facebook Like Box Widget
4
  Plugin URI: https://wordpress.org/plugins/ws-fecebook-likebox/
5
  Description: WS Facebook Like Box Widget provides easy and quick use in your blog. You can fully customize facebook like box in easy way.
6
- Version: 2.0
7
- Author: Web Shouter
8
- Author URI: http://www.webshouter.net/
 
 
9
  License: GPL3
10
- */
 
 
 
 
 
 
11
 
12
- class WS_FACEBOOK_LIKEBOX extends WP_Widget {
13
  function __construct() {
14
  parent::__construct(
15
  'ws_fb_like_box', //Base ID
16
- __( 'WS Facebook Likebox', 'ws-fb-likebox' ), //Name
17
- array( 'description' => __( 'WS Likebox Widget!', 'ws-fb-likebox' ), ) //Args
18
  );
19
- add_action('wp_head', array(&$this, 'ws_add_fb_script_to_head'));
20
- }
21
-
22
- //Add script to head
23
- function ws_add_fb_script_to_head(){
24
-
25
- echo '<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/en_US/sdk.js#xfbml=1&appId=&version=v2.0";fjs.parentNode.insertBefore(js, fjs);}(document, "script", "facebook-jssdk"));</script>';
26
-
27
- }
28
-
29
- public function form( $instance ) {
30
- if ( isset( $instance['title'] ) ) {
31
- $title = $instance['title'];
32
- } else {
33
- $title = __( 'Facebook Like Box', 'ws-fb-likebox' );
34
- }
35
-
36
- if ( isset( $instance['width'] ) ) {
37
- $width = $instance['width'];
38
- }
39
- else{
40
- $width="300";
41
- }
42
-
43
- if ( isset( $instance['height'] ) ) {
44
- $height = $instance['height'];
45
- }
46
- else{
47
- $height="280";
48
- }
49
-
50
- if ( isset( $instance['page_username'] ) ) {
51
- $page_username = $instance['page_username'];
52
- }
53
- else{
54
- $page_username='https://www.facebook.com/webshouter';
55
- }
56
 
57
- if ( isset( $instance['show_friends_faces'] ) ) {
58
- $show_friends_faces = $instance['show_friends_faces'];
59
- } else {
60
- $show_friends_faces = 'on';
61
- }
62
-
63
- if ( isset( $instance['show_Header'] ) ) {
64
- $show_Header = $instance['show_Header'];
65
- } else {
66
- $show_Header = 'on';
67
- }
68
-
69
- if ( isset( $instance['show_border'] ) ) {
70
- $show_border = $instance['show_border'];
71
- } else {
72
- $show_border = 'on';
73
- }
74
-
75
  ?>
76
  <p>
77
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title' ); ?>:</label>
78
  <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>"
79
  name="<?php echo $this->get_field_name( 'title' ); ?>" type="text"
80
- value="<?php echo esc_attr( $title ); ?>">
81
- </p>
82
-
83
- <p>
84
- <label
85
- for="<?php echo $this->get_field_id( 'page_username' ); ?>"><?php _e( 'Facebook Page URL' ); ?>:</label>
86
- <input class="widefat" id="<?php echo $this->get_field_id( 'page_username' ); ?>"
87
- name="<?php echo $this->get_field_name( 'page_username' ); ?>" type="text"
88
- value="<?php echo esc_attr( $page_username ); ?>">
89
  </p>
90
 
91
  <p>
92
- <input class="widefat" id="<?php echo $this->get_field_id( 'show_friends_faces' ); ?>"
93
- name="<?php echo $this->get_field_name( 'show_friends_faces' ); ?>" type="checkbox"
94
- value="on" <?php checked( $show_friends_faces, 'on' ); ?>>
95
  <label
96
- for="<?php echo $this->get_field_id( 'show_friends_faces' ); ?>"><?php _e( 'Show Friends\' Faces' ); ?></label>
97
- </p>
98
-
99
- <p>
100
- <input class="widefat" id="<?php echo $this->get_field_id( 'show_Header' ); ?>"
101
- name="<?php echo $this->get_field_name( 'show_Header' ); ?>" type="checkbox"
102
- value="on" <?php checked( $show_Header, 'on' ); ?>>
103
- <label for="<?php echo $this->get_field_id( 'show_Header' ); ?>"><?php _e( 'Show Header' ); ?></label>
104
- </p>
105
-
106
- <p>
107
- <input class="widefat" id="<?php echo $this->get_field_id( 'show_border' ); ?>"
108
- name="<?php echo $this->get_field_name( 'show_border' ); ?>" type="checkbox"
109
- value="on" <?php checked( $show_border, 'on' ); ?>>
110
- <label for="<?php echo $this->get_field_id( 'show_border' ); ?>"><?php _e( 'Show Border' ); ?></label>
111
  </p>
112
 
113
- <p>
114
  <label
115
- for="<?php echo $this->get_field_id( 'width' ); ?>"><?php _e( 'Width:' ); ?>:</label>
116
  <input class="widefat" id="<?php echo $this->get_field_id( 'width' ); ?>"
117
  name="<?php echo $this->get_field_name( 'width' ); ?>" type="text"
118
- value="<?php echo esc_attr( $width ); ?>">
119
  </p>
120
 
121
  <p>
122
- <label
123
- for="<?php echo $this->get_field_id( 'height' ); ?>"><?php _e( 'Height' ); ?>:</label>
124
  <input class="widefat" id="<?php echo $this->get_field_id( 'height' ); ?>"
125
  name="<?php echo $this->get_field_name( 'height' ); ?>" type="text"
126
- value="<?php echo esc_attr( $height ); ?>">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  </p>
128
 
129
- <p>
130
- <label><?php _e( 'Shortcode' ); ?>:</label><br />
131
- <code>[ws-facebook-likebox url="https://www.facebook.com/webshouter" width="340" height="500" show_faces="true" show_Header="true" show_border="false" ]</code>
132
  <?php
133
  }
134
 
@@ -137,49 +133,82 @@ class WS_FACEBOOK_LIKEBOX extends WP_Widget {
137
  public function update( $new_instance, $old_instance ) {
138
  $instance = array();
139
  $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
140
- $instance['page_username'] = ( ! empty( $new_instance['page_username'] ) ) ? strip_tags( $new_instance['page_username'] ) : '';
141
- $instance['show_friends_faces'] = ( ! empty( $new_instance['show_friends_faces'] ) ) ? strip_tags( $new_instance['show_friends_faces'] ) : '';
142
- $instance['show_Header'] = ( ! empty( $new_instance['show_Header'] ) ) ? strip_tags( $new_instance['show_Header'] ) : '';
143
- $instance['show_border'] = ( ! empty( $new_instance['show_border'] ) ) ? strip_tags( $new_instance['show_border'] ) : '';
144
- $instance['width'] = ( ! empty( $new_instance['width'] ) ) ? strip_tags( $new_instance['width'] ) : '';
145
  $instance['height'] = ( ! empty( $new_instance['height'] ) ) ? strip_tags( $new_instance['height'] ) : '';
146
- $instance['fb_api_key'] = ( ! empty( $new_instance['fb_api_key'] ) ) ? strip_tags( $new_instance['fb_api_key'] ) : '';
 
 
 
 
 
147
 
148
-
149
  return $instance;
150
  }
151
 
152
 
153
  public function widget( $args, $instance ) {
154
- $title = apply_filters( 'widget_title', $instance['title'] );
155
- $page_username = $instance['page_username'];
156
- $show_friends_faces = $instance['show_friends_faces'];
157
- $show_Header = $instance['show_Header'];
158
- $show_border = $instance['show_border'];
159
- $width = $instance['width'];
160
- $height = $instance['height'];
161
- $fb_api_key = $instance['fb_api_key'];
162
-
163
-
164
-
165
  echo $args['before_widget'];
 
166
  if ( ! empty( $title ) ) {
167
  echo $args['before_title'] . $title . $args['after_title'];
168
  }
169
 
170
- if ( empty( $page_username ) ) {
171
- echo "Facebook Page Url is missing in Widget settings.";
172
  }
173
  else {
174
- ?>
175
- <div class="fb-like-box" data-href="<?php echo $page_username; ?>" data-colorscheme="light" data-width="<?php echo $width; ?>" data-height="<?php echo $height; ?>" data-show-faces="<?php echo ( $show_friends_faces == 'on' ) ? 'true' : 'false'; ?>" data-header="<?php echo ( $show_Header == 'on' ) ? 'true' : 'false'; ?>" data-stream="false" data-show-border="<?php echo ( $show_border == 'on' ) ? 'true' : 'false'; ?>"></div>
176
-
177
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  }
179
 
180
  echo $args['after_widget'];
181
  }
182
-
 
 
 
 
 
 
183
  }
184
 
185
  // register widget
@@ -187,23 +216,6 @@ function register_ws_fb_likebox_widget() {
187
  register_widget( 'WS_FACEBOOK_LIKEBOX' );
188
  }
189
  add_action( 'widgets_init', 'register_ws_fb_likebox_widget' );
 
190
 
191
- // Register Shortcode
192
- function ws_facebook_likebox_add_shortcode( $atts ) {
193
-
194
- extract( shortcode_atts(
195
- array(
196
- 'url' => 'https://www.facebook.com/webshouter',
197
- 'width' => '380',
198
- 'height' => '500',
199
- 'show_faces' => 'true',
200
- 'show_Header' => 'true',
201
- 'show_border' => 'false'
202
- ), $atts )
203
- );
204
-
205
- $html='<div class="fb-like-box" data-href="'.$url.'" data-colorscheme="light" data-width="'.$width.'" data-height="'.$height.'" data-show-faces="'.$show_faces.'" data-header="'.$show_Header.'" data-stream="false" data-show-border="'.$show_border.'"></div>';
206
- return $html;
207
- }
208
- add_shortcode( 'ws-facebook-likebox', 'ws_facebook_likebox_add_shortcode' );
209
-
3
  Plugin Name: WS Facebook Like Box Widget
4
  Plugin URI: https://wordpress.org/plugins/ws-fecebook-likebox/
5
  Description: WS Facebook Like Box Widget provides easy and quick use in your blog. You can fully customize facebook like box in easy way.
6
+ Version: 4.0
7
+ Author: WebShouters
8
+ Author URI: http://www.webshouters.com/
9
+ Text Domain: ws-facebook-likebox
10
+ Domain Path: /languages/
11
  License: GPL3
12
+ */
13
+
14
+ define( 'WS_FB_LIKE_BOX_VERSION', '4.0' );
15
+ define( 'WS_FB_LIKE_BOX_PLUGIN', __FILE__ );
16
+ define( 'WS_FB_LIKE_BOX_PLUGIN_BASENAME', plugin_basename( WS_FB_LIKE_BOX_PLUGIN ) );
17
+ define( 'WS_FB_LIKE_BOX_PLUGIN_NAME', trim( dirname( WS_FB_LIKE_BOX_PLUGIN_BASENAME ), '/' ) );
18
+ define( 'WS_FB_LIKE_BOX_PLUGIN_DIR', untrailingslashit( dirname( WS_FB_LIKE_BOX_PLUGIN ) ) );
19
 
20
+ class WS_FACEBOOK_LIKEBOX extends WP_Widget {
21
  function __construct() {
22
  parent::__construct(
23
  'ws_fb_like_box', //Base ID
24
+ __( 'WS Facebook Likebox', 'ws-facebook-likebox' ), //Name
25
+ array( 'description' => __( 'WS Likebox Widget!', 'ws-facebook-likebox' ), ) //Args
26
  );
27
+ }
28
+
29
+ public function form( $instance ) {
30
+
31
+ $defaults = array(
32
+ 'title' => __( 'Facebook Like Box', 'ws-facebook-likebox' ),
33
+ 'fb_page_id' => 'webshouters',
34
+ 'width' => '250',
35
+ 'height' => '500',
36
+ 'adapt_width' => 'no',
37
+ 'small_header' => 'no',
38
+ 'hide_cover_photo'=>'no',
39
+ 'show_faces'=>'yes',
40
+ 'tabs' => 'timeline',
41
+ 'locale_lang' => 'en_US',
42
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
+ $instance = wp_parse_args( (array) $instance, $defaults );
45
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  ?>
47
  <p>
48
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'ws-facebook-likebox' ); ?>:</label>
49
  <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>"
50
  name="<?php echo $this->get_field_name( 'title' ); ?>" type="text"
51
+ value="<?php echo esc_attr( $instance['title'] ); ?>">
 
 
 
 
 
 
 
 
52
  </p>
53
 
54
  <p>
 
 
 
55
  <label
56
+ for="<?php echo $this->get_field_id( 'fb_page_id' ); ?>"><?php _e( 'Page Id', 'ws-facebook-likebox' ); ?>:</label>
57
+ <input class="widefat" id="<?php echo $this->get_field_id( 'fb_page_id' ); ?>"
58
+ name="<?php echo $this->get_field_name( 'fb_page_id' ); ?>" type="text"
59
+ value="<?php echo esc_attr( $instance['fb_page_id'] ); ?>">
 
 
 
 
 
 
 
 
 
 
 
60
  </p>
61
 
62
+ <p>
63
  <label
64
+ for="<?php echo $this->get_field_id( 'width' ); ?>"><?php _e( 'Width', 'ws-facebook-likebox' ); ?>:</label>
65
  <input class="widefat" id="<?php echo $this->get_field_id( 'width' ); ?>"
66
  name="<?php echo $this->get_field_name( 'width' ); ?>" type="text"
67
+ value="<?php echo esc_attr( $instance['width'] ); ?>">
68
  </p>
69
 
70
  <p>
71
+ <label for="<?php echo $this->get_field_id( 'height' ); ?>"><?php _e( 'Height', 'ws-facebook-likebox' ); ?>:</label>
 
72
  <input class="widefat" id="<?php echo $this->get_field_id( 'height' ); ?>"
73
  name="<?php echo $this->get_field_name( 'height' ); ?>" type="text"
74
+ value="<?php echo esc_attr( $instance['height'] ); ?>">
75
+ </p>
76
+
77
+ <p>
78
+ <label for="<?php echo $this->get_field_id( 'adapt_width' ); ?>"><?php _e( 'Adapt to plugin container width', 'ws-facebook-likebox' ); ?>:</label>
79
+ <select style="width:100%" id="<?php echo $this->get_field_id('adapt_width'); ?>" name="<?php echo $this->get_field_name('adapt_width'); ?>" >
80
+ <option <?php selected($instance['adapt_width'],'no') ?> value="no"><?php _e( 'No', 'ws-facebook-likebox' ); ?></option>
81
+ <option <?php selected($instance['adapt_width'],'yes') ?> value="yes"><?php _e( 'Yes', 'ws-facebook-likebox' ); ?></option>
82
+ </select>
83
+ </p>
84
+
85
+ <p>
86
+ <label for="<?php echo $this->get_field_id( 'small_header' ); ?>"><?php _e( 'Use Small Header', 'ws-facebook-likebox' ); ?>:</label>
87
+ <select style="width:100%" id="<?php echo $this->get_field_id('small_header'); ?>" name="<?php echo $this->get_field_name('small_header'); ?>" >
88
+ <option <?php selected($instance['small_header'],'no') ?> value="no"><?php _e( 'No', 'ws-facebook-likebox' ); ?></option>
89
+ <option <?php selected($instance['small_header'],'yes') ?> value="yes"><?php _e( 'Yes', 'ws-facebook-likebox' ); ?></option>
90
+ </select>
91
+ </p>
92
+
93
+ <p>
94
+ <label for="<?php echo $this->get_field_id( 'hide_cover_photo' ); ?>"><?php _e( 'Hide Cover Photo', 'ws-facebook-likebox' ); ?>:</label>
95
+ <select style="width:100%" id="<?php echo $this->get_field_id('hide_cover_photo'); ?>" name="<?php echo $this->get_field_name('hide_cover_photo'); ?>" >
96
+ <option <?php selected($instance['hide_cover_photo'],'no') ?> value="no"><?php _e( 'No', 'ws-facebook-likebox' ); ?></option>
97
+ <option <?php selected($instance['hide_cover_photo'],'yes') ?> value="yes"><?php _e( 'Yes', 'ws-facebook-likebox' ); ?></option>
98
+ </select>
99
+ </p>
100
+
101
+ <p>
102
+ <label for="<?php echo $this->get_field_id( 'show_faces' ); ?>"><?php _e( 'Show Friend\'s Faces', 'ws-facebook-likebox' ); ?>:</label>
103
+ <select style="width:100%" id="<?php echo $this->get_field_id('show_faces'); ?>" name="<?php echo $this->get_field_name('show_faces'); ?>" >
104
+ <option <?php selected($instance['show_faces'],'no') ?> value="no"><?php _e( 'No', 'ws-facebook-likebox' ); ?></option>
105
+ <option <?php selected($instance['show_faces'],'yes') ?> value="yes"><?php _e( 'Yes', 'ws-facebook-likebox' ); ?></option>
106
+ </select>
107
+ </p>
108
+
109
+ <p>
110
+ <label for="<?php echo $this->get_field_id( 'tabs' ); ?>"><?php _e( 'Tabs', 'ws-facebook-likebox' ); ?>:</label>
111
+ <select style="width:100%" id="<?php echo $this->get_field_id('tabs'); ?>" name="<?php echo $this->get_field_name('tabs'); ?>" >
112
+ <option <?php selected($instance['tabs'],'') ?> value=""><?php _e( 'Hide Posts', 'ws-facebook-likebox' ); ?></option>
113
+ <option <?php selected($instance['tabs'],'timeline') ?> value="timeline"><?php _e( 'Timeline', 'ws-facebook-likebox' ); ?></option>
114
+ <option <?php selected($instance['tabs'],'events') ?> value="events"><?php _e( 'Events', 'ws-facebook-likebox' ); ?></option>
115
+ <option <?php selected($instance['tabs'],'messages') ?> value="messages"><?php _e( 'Messages', 'ws-facebook-likebox' ); ?></option>
116
+ </select>
117
+ </p>
118
+
119
+ <p>
120
+ <label
121
+ for="<?php echo $this->get_field_id( 'locale_lang' ); ?>"><?php _e( 'Language', 'ws-facebook-likebox' ); ?>:</label>
122
+ <input id="<?php echo $this->get_field_id( 'locale_lang' ); ?>"
123
+ name="<?php echo $this->get_field_name( 'locale_lang' ); ?>" type="text" style="width: 70px;"
124
+ value="<?php echo esc_attr( $instance['locale_lang'] ); ?>">
125
+ <small>(en_US, de_DE...)</small>
126
  </p>
127
 
 
 
 
128
  <?php
129
  }
130
 
133
  public function update( $new_instance, $old_instance ) {
134
  $instance = array();
135
  $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
136
+ $instance['fb_page_id'] = ( ! empty( $new_instance['fb_page_id'] ) ) ? strip_tags( $new_instance['fb_page_id'] ) : '';
137
+ $instance['width'] = ( ! empty( $new_instance['width'] ) ) ? strip_tags( $new_instance['width'] ) : '';
 
 
 
138
  $instance['height'] = ( ! empty( $new_instance['height'] ) ) ? strip_tags( $new_instance['height'] ) : '';
139
+ $instance['adapt_width'] = ( ! empty( $new_instance['adapt_width'] ) ) ? strip_tags( $new_instance['adapt_width'] ) : '';
140
+ $instance['small_header'] = ( ! empty( $new_instance['small_header'] ) ) ? strip_tags( $new_instance['small_header'] ) : '';
141
+ $instance['hide_cover_photo'] = ( ! empty( $new_instance['hide_cover_photo'] ) ) ? strip_tags( $new_instance['hide_cover_photo'] ) : '';
142
+ $instance['show_faces'] = ( ! empty( $new_instance['show_faces'] ) ) ? strip_tags( $new_instance['show_faces'] ) : '';
143
+ $instance['tabs'] = ( ! empty( $new_instance['tabs'] ) ) ? strip_tags( $new_instance['tabs'] ) : '';
144
+ $instance['locale_lang'] = ( ! empty( $new_instance['locale_lang'] ) ) ? strip_tags( $new_instance['locale_lang'] ) : '';
145
 
 
146
  return $instance;
147
  }
148
 
149
 
150
  public function widget( $args, $instance ) {
151
+
152
+ foreach($instance as $key => $value){
153
+ if($value=='yes')
154
+ $instance[$key]='true';
155
+ if($value=='no')
156
+ $instance[$key]='false';
157
+ }
158
+
159
+ $title = apply_filters( 'widget_title', $instance['title'] );
160
+ extract($instance);
161
+
162
  echo $args['before_widget'];
163
+
164
  if ( ! empty( $title ) ) {
165
  echo $args['before_title'] . $title . $args['after_title'];
166
  }
167
 
168
+ if ( empty( $fb_page_id ) ) {
169
+ echo "Facebook Page Id is missing in Widget settings.";
170
  }
171
  else {
172
+
173
+ $html = '';
174
+
175
+ $html .= '<div class="fb-page ws-fb-like-box" data-href="https://www.facebook.com/'.$fb_page_id.'"
176
+ data-tabs="'.$tabs.'"
177
+ data-width="'.$width.'"
178
+ data-height="'.$height.'"
179
+ data-small-header="'.$small_header.'"
180
+ data-adapt-container-width="'.$adapt_width.'"
181
+ data-hide-cover="'.$hide_cover_photo.'"
182
+ data-show-facepile="'.$show_faces.'">
183
+ <div class="fb-xfbml-parse-ignore">
184
+ <blockquote cite="https://www.facebook.com/'.$fb_page_id.'">
185
+ <a href="https://www.facebook.com/'.$fb_page_id.'">Facebook</a>
186
+ </blockquote>
187
+ </div>
188
+ </div> ';
189
+
190
+ $html .= '<div id="fb-root"></div>
191
+ <script>(function(d, s, id) {
192
+ var js, fjs = d.getElementsByTagName(s)[0];
193
+ if (d.getElementById(id)) return;
194
+ js = d.createElement(s); js.id = id;
195
+ js.src = "//connect.facebook.net/'. $locale_lang .'/sdk.js#xfbml=1&version=v2.6";
196
+ fjs.parentNode.insertBefore(js, fjs);
197
+ }(document, \'script\', \'facebook-jssdk\'));</script>';
198
+
199
+ echo $html;
200
+
201
  }
202
 
203
  echo $args['after_widget'];
204
  }
205
+
206
+
207
+
208
+ }
209
+
210
+ function ws_fb_likebox_load_plugin_textdomain() {
211
+ load_plugin_textdomain( 'ws-facebook-likebox', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
212
  }
213
 
214
  // register widget
216
  register_widget( 'WS_FACEBOOK_LIKEBOX' );
217
  }
218
  add_action( 'widgets_init', 'register_ws_fb_likebox_widget' );
219
+ add_action( 'plugins_loaded', 'ws_fb_likebox_load_plugin_textdomain' );
220
 
221
+ require_once WS_FB_LIKE_BOX_PLUGIN_DIR . '/includes/shortcodes.php';