Easy Facebook Like Box (Facebook Page Plugin) – Custom Facebook Feed – Auto PopUp - Version 1.0

Version Description

=1.0.0= Initial release.

Download this release

Release Info

Developer sjaved
Plugin Icon 128x128 Easy Facebook Like Box (Facebook Page Plugin) – Custom Facebook Feed – Auto PopUp
Version 1.0
Comparing to
See all releases

Version 1.0

LICENSE.txt ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ <one line to give the program's name and a brief idea of what it does.>
294
+ Copyright (C) <year> <name of author>
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ <signature of Ty Coon>, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
README.txt ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Easy Facebook Likebox ===
2
+ Contributors: sjaved
3
+ Tags: facebook, likebox, widget, shortcode
4
+ Donate link: http://jwebsol.com/
5
+ Requires at least: 3.3
6
+ Tested up to: 3.9
7
+ Stable tag: trunk
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ Mobile friendly easy to use facebook like box wigdet and shortcode
12
+
13
+ == Description ==
14
+ Easily embed facebook fan page in WordPress using widget or shortcode. You can use the shortcode generated after saving the widget. Its completely customizable with lots of optional settings. Its also responsive at the same time.
15
+
16
+ Features:
17
+ 1. Responsive
18
+ 2. Generate shortcode using widget form.
19
+
20
+ == Installation ==
21
+ 1. Upload "easy-facebook-likebox" to the "/wp-content/plugins/" directory.
22
+ 2. Activate the plugin through the "Plugins" menu in WordPress.
23
+ 3. Navigate to "Appearance > Widgets" and drag and drop "Easy Facebook Likebox" in desired widget area or use the shortcode in page/post generated by widget.
24
+
25
+ == Upgrade Notice ==
26
+ =1.0.0=
27
+ Initial release.
28
+
29
+ == Frequently Asked Questions ==
30
+ = Width not working =
31
+ If width parameter is not working then it could be due to facebook responsive styling.
32
+
33
+
34
+ == Screenshots ==
35
+ 1. screenshot-1.png
36
+ 2. screenshot-2.png
37
+ 3. screenshot-3.png
38
+
39
+ == Changelog ==
40
+ = 1.0.0 =
41
+ * Initial release.
admin/assets/css/admin.css ADDED
@@ -0,0 +1 @@
 
1
+ /* This stylesheet is used to style the admin option form of the plugin. */
admin/assets/css/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
admin/assets/js/admin.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ (function ( $ ) {
2
+ "use strict";
3
+
4
+ $(function () {
5
+
6
+ // Place your administration-specific JavaScript here
7
+
8
+ });
9
+
10
+ }(jQuery));
admin/assets/js/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
admin/easy-facebook-likebox-admin.php ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name.
4
+ *
5
+ * @package Easy_Facebook_Likebox_Admin
6
+ * @author Sajid Javed <email@example.com>
7
+ * @license GPL-2.0+
8
+ * @link http://example.com
9
+ * @copyright 2014 Your Name or Company Name
10
+ */
11
+
12
+ /**
13
+ * Plugin class. This class should ideally be used to work with the
14
+ * administrative side of the WordPress site.
15
+ *
16
+ * If you're interested in introducing public-facing
17
+ * functionality, then refer to `class-plugin-name.php`
18
+ *
19
+ * @TODO: Rename this class to a proper name for your plugin.
20
+ *
21
+ * @package Plugin_Name_Admin
22
+ * @author Your Name <email@example.com>
23
+ */
24
+ class Easy_Facebook_Likebox_Admin {
25
+
26
+ /**
27
+ * Instance of this class.
28
+ *
29
+ * @since 1.0.0
30
+ *
31
+ * @var object
32
+ */
33
+ protected static $instance = null;
34
+
35
+ /**
36
+ * Slug of the plugin screen.
37
+ *
38
+ * @since 1.0.0
39
+ *
40
+ * @var string
41
+ */
42
+ protected $plugin_screen_hook_suffix = null;
43
+
44
+ /**
45
+ * Initialize the plugin by loading admin scripts & styles and adding a
46
+ * settings page and menu.
47
+ *
48
+ * @since 1.0.0
49
+ */
50
+ private function __construct() {
51
+
52
+ /*
53
+ * @TODO :
54
+ *
55
+ * - Uncomment following lines if the admin class should only be available for super admins
56
+ */
57
+ /* if( ! is_super_admin() ) {
58
+ return;
59
+ } */
60
+
61
+ /*
62
+ * Call $plugin_slug from public plugin class.
63
+ *
64
+ * @TODO:
65
+ *
66
+ * - Rename "Plugin_Name" to the name of your initial plugin class
67
+ *
68
+ */
69
+ $plugin = Easy_Facebook_Likebox::get_instance();
70
+ $this->plugin_slug = $plugin->get_plugin_slug();
71
+
72
+ // Load admin style sheet and JavaScript.
73
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) );
74
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
75
+
76
+ // Add the options page and menu item.
77
+ add_action( 'admin_menu', array( $this, 'add_plugin_admin_menu' ) );
78
+
79
+ // Add an action link pointing to the options page.
80
+ $plugin_basename = plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_slug . '.php' );
81
+ add_filter( 'plugin_action_links_' . $plugin_basename, array( $this, 'add_action_links' ) );
82
+
83
+ /*
84
+ * Define custom functionality.
85
+ *
86
+ * Read more about actions and filters:
87
+ * http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters
88
+ */
89
+ add_action( '@TODO', array( $this, 'action_method_name' ) );
90
+ add_filter( '@TODO', array( $this, 'filter_method_name' ) );
91
+
92
+ }
93
+
94
+ /**
95
+ * Return an instance of this class.
96
+ *
97
+ * @since 1.0.0
98
+ *
99
+ * @return object A single instance of this class.
100
+ */
101
+ public static function get_instance() {
102
+
103
+ /*
104
+ * @TODO :
105
+ *
106
+ * - Uncomment following lines if the admin class should only be available for super admins
107
+ */
108
+ /* if( ! is_super_admin() ) {
109
+ return;
110
+ } */
111
+
112
+ // If the single instance hasn't been set, set it now.
113
+ if ( null == self::$instance ) {
114
+ self::$instance = new self;
115
+ }
116
+
117
+ return self::$instance;
118
+ }
119
+
120
+ /**
121
+ * Register and enqueue admin-specific style sheet.
122
+ *
123
+ * @TODO:
124
+ *
125
+ * - Rename "Plugin_Name" to the name your plugin
126
+ *
127
+ * @since 1.0.0
128
+ *
129
+ * @return null Return early if no settings page is registered.
130
+ */
131
+ public function enqueue_admin_styles() {
132
+
133
+ if ( ! isset( $this->plugin_screen_hook_suffix ) ) {
134
+ return;
135
+ }
136
+
137
+ $screen = get_current_screen();
138
+ if ( $this->plugin_screen_hook_suffix == $screen->id ) {
139
+ wp_enqueue_style( $this->plugin_slug .'-admin-styles', plugins_url( 'assets/css/admin.css', __FILE__ ), array(), Plugin_Name::VERSION );
140
+ }
141
+
142
+ }
143
+
144
+ /**
145
+ * Register and enqueue admin-specific JavaScript.
146
+ *
147
+ * @TODO:
148
+ *
149
+ * - Rename "Plugin_Name" to the name your plugin
150
+ *
151
+ * @since 1.0.0
152
+ *
153
+ * @return null Return early if no settings page is registered.
154
+ */
155
+ public function enqueue_admin_scripts() {
156
+
157
+ if ( ! isset( $this->plugin_screen_hook_suffix ) ) {
158
+ return;
159
+ }
160
+
161
+ $screen = get_current_screen();
162
+ if ( $this->plugin_screen_hook_suffix == $screen->id ) {
163
+ wp_enqueue_script( $this->plugin_slug . '-admin-script', plugins_url( 'assets/js/admin.js', __FILE__ ), array( 'jquery' ), Plugin_Name::VERSION );
164
+ }
165
+
166
+ }
167
+
168
+ /**
169
+ * Register the administration menu for this plugin into the WordPress Dashboard menu.
170
+ *
171
+ * @since 1.0.0
172
+ */
173
+ public function add_plugin_admin_menu() {
174
+
175
+ /*
176
+ * Add a settings page for this plugin to the Settings menu.
177
+ *
178
+ * NOTE: Alternative menu locations are available via WordPress administration menu functions.
179
+ *
180
+ * Administration Menus: http://codex.wordpress.org/Administration_Menus
181
+ *
182
+ * @TODO:
183
+ *
184
+ * - Change 'Page Title' to the title of your plugin admin page
185
+ * - Change 'Menu Text' to the text for menu item for the plugin settings page
186
+ * - Change 'manage_options' to the capability you see fit
187
+ * For reference: http://codex.wordpress.org/Roles_and_Capabilities
188
+ */
189
+ $this->plugin_screen_hook_suffix = add_options_page(
190
+ __( 'Page Title', $this->plugin_slug ),
191
+ __( 'Menu Text', $this->plugin_slug ),
192
+ 'manage_options',
193
+ $this->plugin_slug,
194
+ array( $this, 'display_plugin_admin_page' )
195
+ );
196
+
197
+ }
198
+
199
+ /**
200
+ * Render the settings page for this plugin.
201
+ *
202
+ * @since 1.0.0
203
+ */
204
+ public function display_plugin_admin_page() {
205
+ include_once( 'views/admin.php' );
206
+ }
207
+
208
+ /**
209
+ * Add settings action link to the plugins page.
210
+ *
211
+ * @since 1.0.0
212
+ */
213
+ public function add_action_links( $links ) {
214
+
215
+ return array_merge(
216
+ array(
217
+ 'settings' => '<a href="' . admin_url( 'options-general.php?page=' . $this->plugin_slug ) . '">' . __( 'Settings', $this->plugin_slug ) . '</a>'
218
+ ),
219
+ $links
220
+ );
221
+
222
+ }
223
+
224
+ /**
225
+ * NOTE: Actions are points in the execution of a page or process
226
+ * lifecycle that WordPress fires.
227
+ *
228
+ * Actions: http://codex.wordpress.org/Plugin_API#Actions
229
+ * Reference: http://codex.wordpress.org/Plugin_API/Action_Reference
230
+ *
231
+ * @since 1.0.0
232
+ */
233
+ public function action_method_name() {
234
+ // @TODO: Define your action hook callback here
235
+ }
236
+
237
+ /**
238
+ * NOTE: Filters are points of execution in which WordPress modifies data
239
+ * before saving it or sending it to the browser.
240
+ *
241
+ * Filters: http://codex.wordpress.org/Plugin_API#Filters
242
+ * Reference: http://codex.wordpress.org/Plugin_API/Filter_Reference
243
+ *
244
+ * @since 1.0.0
245
+ */
246
+ public function filter_method_name() {
247
+ // @TODO: Define your filter hook callback here
248
+ }
249
+
250
+ }
admin/includes/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
admin/views/admin.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Represents the view for the administration dashboard.
4
+ *
5
+ * This includes the header, options, and other information that should provide
6
+ * The User Interface to the end user.
7
+ *
8
+ * @package Plugin_Name
9
+ * @author Your Name <email@example.com>
10
+ * @license GPL-2.0+
11
+ * @link http://example.com
12
+ * @copyright 2014 Your Name or Company Name
13
+ */
14
+ ?>
15
+
16
+ <div class="wrap">
17
+
18
+ <h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
19
+
20
+ <!-- @TODO: Provide markup for your options page here. -->
21
+
22
+ </div>
admin/views/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
assets/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
assets/screenshot-1.png ADDED
Binary file
assets/screenshot-2.png ADDED
Binary file
assets/screenshot-3.png ADDED
Binary file
easy-facebook-likebox.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The WordPress Plugin Boilerplate.
4
+ *
5
+ * A foundation off of which to build well-documented WordPress plugins that
6
+ * also follow WordPress Coding Standards and PHP best practices.
7
+ *
8
+ * @package Easy Facebook Likebox
9
+ * @author Sajid Javed <email@example.com>
10
+ * @license GPL-2.0+
11
+ * @link http://example.com
12
+ * @copyright 2014 Your Name or Company Name
13
+ *
14
+ * @wordpress-plugin
15
+ * Plugin Name: Easy Facebook Likebox
16
+ * Plugin URI: httt://wordpress.org/plugins/easy-facebook-likebox
17
+ * Description: Easily embed facebook fan page in WordPress using widget or shortcode. You can use the shortcode generated after saving the widget. Its completely customizable with lots of optional settings. Its also responsive at the same time.
18
+ * Version: 1.0.0
19
+ * Author: Sajid Javed
20
+ * Author URI: http://jwebsol.com
21
+ * Text Domain: easy-facebook-likebox
22
+ * License: GPL-2.0+
23
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
24
+ * Domain Path: /languages
25
+ */
26
+
27
+ // If this file is called directly, abort.
28
+ if ( ! defined( 'WPINC' ) ) {
29
+ die;
30
+ }
31
+
32
+ /*----------------------------------------------------------------------------*
33
+ * Public-Facing Functionality
34
+ *----------------------------------------------------------------------------*/
35
+
36
+ /*
37
+ * @TODO:
38
+ *
39
+ * - replace `class-plugin-name.php` with the name of the plugin's class file
40
+ *
41
+ */
42
+ require_once( plugin_dir_path( __FILE__ ) . 'public/easy-facebook-likebox.php' );
43
+
44
+ /*
45
+ * Register hooks that are fired when the plugin is activated or deactivated.
46
+ * When the plugin is deleted, the uninstall.php file is loaded.
47
+ *
48
+ * @TODO:
49
+ *
50
+ * - replace Plugin_Name with the name of the class defined in
51
+ * `class-plugin-name.php`
52
+ */
53
+ register_activation_hook( __FILE__, array( 'Easy_Facebook_Likebox', 'activate' ) );
54
+ register_deactivation_hook( __FILE__, array( 'Easy_Facebook_Likebox', 'deactivate' ) );
55
+
56
+ /*
57
+ * @TODO:
58
+ *
59
+ * - replace Plugin_Name with the name of the class defined in
60
+ * `class-plugin-name.php`
61
+ */
62
+ add_action( 'plugins_loaded', array( 'Easy_Facebook_Likebox', 'get_instance' ) );
63
+
64
+ /*----------------------------------------------------------------------------*
65
+ * Dashboard and Administrative Functionality
66
+ *----------------------------------------------------------------------------*/
67
+
68
+ /*
69
+ * @TODO:
70
+ *
71
+ * - replace `class-plugin-name-admin.php` with the name of the plugin's admin file
72
+ * - replace Plugin_Name_Admin with the name of the class defined in
73
+ * `class-plugin-name-admin.php`
74
+ *
75
+ * If you want to include Ajax within the dashboard, change the following
76
+ * conditional to:
77
+ *
78
+ * if ( is_admin() ) {
79
+ * ...
80
+ * }
81
+ *
82
+ * The code below is intended to give the lightest footprint possible.
83
+ */
84
+ if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
85
+
86
+ require_once( plugin_dir_path( __FILE__ ) . 'admin/easy-facebook-likebox-admin.php' );
87
+ add_action( 'plugins_loaded', array( 'Easy_Facebook_Likebox_Admin', 'get_instance' ) );
88
+
89
+ }
90
+
91
+
92
+ /*----------------------------------------------------------------------------*
93
+ * Dashboard and Administrative Functionality
94
+ *----------------------------------------------------------------------------*/
95
+
96
+ /*
97
+ * Including widget class.
98
+ */
99
+
100
+ require_once( plugin_dir_path( __FILE__ ) . 'includes/easy-facebook-likebox-widget.php' );
101
+ // register Foo_Widget widget
102
+ function register_fblx_widget() {
103
+ register_widget( 'Facebook_Like_Box_Widget' );
104
+ }
105
+ add_action( 'widgets_init', 'register_fblx_widget' );
includes/easy-facebook-likebox-widget.php ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Facebook_Like_Box_Widget extends WP_Widget {
3
+
4
+ /**
5
+ * Register widget with WordPress.
6
+ */
7
+ function __construct() {
8
+ parent::__construct(
9
+ 'easy_racebook_likebox', // Base ID
10
+ __('Easy Facebook Likebox', 'easy-facebook-likebox'), // Name
11
+ array( 'description' => __( 'Drag and drop this widget for facebook like box integration', 'easy-facebook-likebox' ), ) // Args
12
+ );
13
+ }
14
+
15
+ /**
16
+ * Front-end display of widget.
17
+ *
18
+ * @see WP_Widget::widget()
19
+ *
20
+ * @param array $args Widget arguments.
21
+ * @param array $instance Saved values from database.
22
+ */
23
+ public function widget( $args, $instance ) {
24
+ $title = apply_filters( 'widget_title', $instance['title'] );
25
+
26
+ echo $args['before_widget'];
27
+ if ( ! empty( $title ) )
28
+ echo $args['before_title'] . $title . $args['after_title'];
29
+
30
+ echo Easy_Facebook_Likebox::render_fb_box($instance);
31
+
32
+ echo $args['after_widget'];
33
+ }
34
+
35
+ /**
36
+ * Back-end widget form.
37
+ *
38
+ * @see WP_Widget::form()
39
+ *
40
+ * @param array $instance Previously saved values from database.
41
+ */
42
+ public function form( $instance ) {
43
+
44
+ /* $title = $instance[ 'title' ];
45
+ $'title' => 'test', = ( ! empty( $instance['fanpage_url'] ) ) ? strip_tags( $instance['fanpage_url'] ) : '';
46
+ $fb_appid = $instance[ 'fb_appid' ];
47
+ $show_faces = ( ! empty( $instance['show_faces'] ) ) ? strip_tags( $instance['show_faces'] ) : 1;
48
+ $show_stream = ( ! empty( $instance['show_stream'] ) ) ? strip_tags( $instance['show_stream'] ) : 1;
49
+ $show_border = ( ! empty( $instance['show_border'] ) ) ? strip_tags( $instance['show_border'] ) : 1;
50
+ $show_header = ( ! empty( $instance['show_header'] ) ) ? strip_tags( $instance['show_header'] ) : 1;*/
51
+
52
+
53
+ $defaults = array(
54
+ 'title' => '',
55
+ 'fb_appid' => '',
56
+ 'fanpage_url' => 'https://www.facebook.com/jwebsol',
57
+ 'box_width' => 300,
58
+ 'box_height' => '',
59
+ 'colorscheme' => 'light',
60
+ 'show_faces' => 1,
61
+ 'show_stream' => 0,
62
+ 'show_header' => 1,
63
+ 'show_border' => 1,
64
+ );
65
+
66
+ $instance = wp_parse_args( (array) $instance, $defaults );
67
+
68
+ extract($instance, EXTR_SKIP);
69
+
70
+ ?>
71
+
72
+ <p>
73
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
74
+ <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
75
+ </p>
76
+
77
+ <p>
78
+ <label for="<?php echo $this->get_field_id( 'fanpage_url' ); ?>"><?php _e( 'Fanpage Url:' ); ?></label>
79
+ <input class="widefat" id="<?php echo $this->get_field_id( 'fanpage_url' ); ?>" name="<?php echo $this->get_field_name( 'fanpage_url' ); ?>" type="text" value="<?php echo esc_attr( $fanpage_url ); ?>"><br />
80
+ <i>Full url including http://</i>
81
+ </p>
82
+
83
+ <p>
84
+ <label for="<?php echo $this->get_field_id( 'fb_appid' ); ?>"><?php _e( 'Application ID:' ); ?></label>
85
+ <input class="widefat" id="<?php echo $this->get_field_id( 'fb_appid' ); ?>" name="<?php echo $this->get_field_name( 'fb_appid' ); ?>" type="text" value="<?php echo esc_attr( $fb_appid ); ?>"><br />
86
+ <i>Optional</i>
87
+ </p>
88
+
89
+ <p>
90
+ <label for="<?php echo $this->get_field_id( 'box_width' ); ?>"><?php _e( 'Width:' ); ?></label>
91
+ <input class="widefat" id="<?php echo $this->get_field_id( 'box_width' ); ?>" name="<?php echo $this->get_field_name( 'box_width' ); ?>" type="text" value="<?php echo esc_attr( $box_width ); ?>"><br />
92
+ </p>
93
+
94
+ <p>
95
+ <label for="<?php echo $this->get_field_id( 'box_height' ); ?>"><?php _e( 'Height:' ); ?></label>
96
+ <input class="widefat" id="<?php echo $this->get_field_id( 'box_height' ); ?>" name="<?php echo $this->get_field_name( 'box_height' ); ?>" type="text" value="<?php echo esc_attr( $box_height ); ?>"><br />
97
+ </p>
98
+
99
+ <p>
100
+ <label for="<?php echo $this->get_field_id( 'colorscheme' ); ?>"><?php _e( 'Colorscheme:' ); ?></label>
101
+ <select id="<?php echo $this->get_field_id( 'colorscheme' ); ?>" name="<?php echo $this->get_field_name( 'colorscheme' ); ?>">
102
+ <option <?php selected( $colorscheme, 'light' , $echo = true); ?> value="light">light</option>
103
+ <option <?php selected( $colorscheme, 'dark', $echo = true); ?> value="dark">dark</option>
104
+ </select>
105
+ </p>
106
+
107
+ <p>
108
+ <label for="<?php echo $this->get_field_id( 'show_faces' ); ?>">Show Faces</label>
109
+ <input type="checkbox" class="widefat" id="<?php echo $this->get_field_id( 'show_faces' ); ?>" name="<?php echo $this->get_field_name( 'show_faces' ); ?>" value="1" <?php checked( $show_faces, 1 ); ?>>
110
+ </p>
111
+
112
+ <p>
113
+ <label for="<?php echo $this->get_field_id( 'show_stream' ); ?>">Show Posts/Stream</label>
114
+ <input type="checkbox" class="widefat" id="<?php echo $this->get_field_id( 'show_stream' ); ?>" name="<?php echo $this->get_field_name( 'show_stream' ); ?>" value="1" <?php checked( $show_stream, 1 ); ?>>
115
+ </p>
116
+
117
+ <p>
118
+ <label for="<?php echo $this->get_field_id( 'show_border' ); ?>">Show Border</label>
119
+ <input type="checkbox" class="widefat" id="<?php echo $this->get_field_id( 'show_border' ); ?>" name="<?php echo $this->get_field_name( 'show_border' ); ?>" value="1" <?php checked( $show_border, 1 ); ?>>
120
+ </p>
121
+
122
+ <p>
123
+ <label for="<?php echo $this->get_field_id( 'show_header' ); ?>">Show Header</label>
124
+ <input type="checkbox" class="widefat" id="<?php echo $this->get_field_id( 'show_header' ); ?>" name="<?php echo $this->get_field_name( 'show_header' ); ?>" value="1" <?php checked( $show_header, 1 ); ?>>
125
+ </p>
126
+
127
+ <p>Use Below shortcode to use inside pages or posts</p>
128
+ <?php
129
+ if( empty($show_stream) ){
130
+ $show_stream = 0;
131
+ }
132
+
133
+ if( empty($show_faces) ){
134
+ $show_faces = 0;
135
+ }
136
+
137
+ if( empty($show_header) ){
138
+ $show_header = 0;
139
+ }
140
+
141
+ if( empty($show_border) ){
142
+ $show_border = 0;
143
+ }
144
+
145
+ ?>
146
+
147
+ <p style="background:#ddd; padding:5px; "><?php echo '[efb_likebox fanpage_url="'.$fanpage_url.'" fb_appid="'.$fb_appid.'" box_width="'.$box_width.'" box_height="'.$box_height.'" colorscheme="'.$colorscheme.'" show_faces="'.$show_faces.'" show_header="'.$show_header.'" show_stream="'.$show_stream.'" show_border="'.$show_border.'" ]'?></p>
148
+
149
+ <?php
150
+ }
151
+
152
+ /**
153
+ * Sanitize widget form values as they are saved.
154
+ *
155
+ * @see WP_Widget::update()
156
+ *
157
+ * @param array $new_instance Values just sent to be saved.
158
+ * @param array $old_instance Previously saved values from database.
159
+ *
160
+ * @return array Updated safe values to be saved.
161
+ */
162
+ public function update( $new_instance, $old_instance ) {
163
+ $instance = array();
164
+
165
+ $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
166
+ $instance['fanpage_url'] = ( ! empty( $new_instance['fanpage_url'] ) ) ? strip_tags( $new_instance['fanpage_url'] ) : '';
167
+ $instance['fb_appid'] = ( ! empty( $new_instance['fb_appid'] ) ) ? strip_tags( $new_instance['fb_appid'] ) : '';
168
+ $instance['show_faces'] = ( ! empty( $new_instance['show_faces'] ) ) ? strip_tags( $new_instance['show_faces'] ) : '';
169
+ $instance['show_stream'] = ( ! empty( $new_instance['show_stream'] ) ) ? strip_tags( $new_instance['show_stream'] ) : '';
170
+ $instance['show_border'] = ( ! empty( $new_instance['show_border'] ) ) ? strip_tags( $new_instance['show_border'] ) : '';
171
+ $instance['show_header'] = ( ! empty( $new_instance['show_header'] ) ) ? strip_tags( $new_instance['show_header'] ) : '';
172
+ $instance['box_height'] = ( ! empty( $new_instance['box_height'] ) ) ? strip_tags( $new_instance['box_height'] ) : '';
173
+ $instance['box_width'] = ( ! empty( $new_instance['box_width'] ) ) ? strip_tags( $new_instance['box_width'] ) : '';
174
+ $instance['colorscheme'] = ( ! empty( $new_instance['colorscheme'] ) ) ? strip_tags( $new_instance['colorscheme'] ) : '';
175
+
176
+ return $instance;
177
+ }
178
+
179
+ } // class Foo_Widget
180
+ ?>
includes/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
languages/easy-facebook-likebox.pot ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2013 TODO
2
+ # This file is distributed under the same license as the TODO package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: TODO 1.0.0\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/plugins/plugin-name\n"
7
+ "POT-Creation-Date: 2013-05-10 11:23:19+00:00\n"
8
+ "PO-Revision-Date: 2013-05-10 10:37-0500\n"
9
+ "Last-Translator: FULL NAME <email@example.com>\n"
10
+ "Language-Team: LANGUAGE <translations@example.com >\n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: 8bit\n"
14
+ "X-Generator: Poedit 1.5.7\n"
15
+ "X-Poedit-KeywordsList: __;_e;_n;_x;esc_html_e;esc_html__;esc_attr_e;"
16
+ "esc_attr__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_x:1,2c;_n:1,2\n"
17
+ "X-Poedit-Basepath: ../\n"
18
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+
21
+ #: class-plugin-name-admin.php:170
22
+ msgid "Page Title"
23
+ msgstr ""
24
+
25
+ #: class-plugin-name-admin.php:171
26
+ msgid "Menu Text"
27
+ msgstr ""
28
+
29
+ #: class-plugin-name-admin.php:197
30
+ msgid "Settings"
31
+ msgstr ""
languages/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
public/assets/css/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
public/assets/css/public.css ADDED
@@ -0,0 +1 @@
 
1
+ /* This stylesheet is used to style the public-facing components of the plugin. */
public/assets/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
public/assets/js/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
public/assets/js/public.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ (function ( $ ) {
2
+ "use strict";
3
+
4
+ $(function () {
5
+
6
+ // Place your public-facing JavaScript here
7
+
8
+ });
9
+
10
+ }(jQuery));
public/easy-facebook-likebox.php ADDED
@@ -0,0 +1,360 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name.
4
+ *
5
+ * @package Plugin_Name
6
+ * @author Your Name <email@example.com>
7
+ * @license GPL-2.0+
8
+ * @link http://example.com
9
+ * @copyright 2014 Your Name or Company Name
10
+ */
11
+
12
+ /**
13
+ * Plugin class. This class should ideally be used to work with the
14
+ * public-facing side of the WordPress site.
15
+ *
16
+ * If you're interested in introducing administrative or dashboard
17
+ * functionality, then refer to `class-plugin-name-admin.php`
18
+ *
19
+ * @TODO: Rename this class to a proper name for your plugin.
20
+ *
21
+ * @package Plugin_Name
22
+ * @author Your Name <email@example.com>
23
+ */
24
+ class Easy_Facebook_Likebox {
25
+
26
+ /**
27
+ * Plugin version, used for cache-busting of style and script file references.
28
+ *
29
+ * @since 1.0.0
30
+ *
31
+ * @var string
32
+ */
33
+ const VERSION = '1.0.0';
34
+
35
+ /**
36
+ * @TODO - Rename "plugin-name" to the name your your plugin
37
+ *
38
+ * Unique identifier for your plugin.
39
+ *
40
+ *
41
+ * The variable name is used as the text domain when internationalizing strings
42
+ * of text. Its value should match the Text Domain file header in the main
43
+ * plugin file.
44
+ *
45
+ * @since 1.0.0
46
+ *
47
+ * @var string
48
+ */
49
+ protected $plugin_slug = 'easy-facebook-likebox';
50
+
51
+ /**
52
+ * Instance of this class.
53
+ *
54
+ * @since 1.0.0
55
+ *
56
+ * @var object
57
+ */
58
+ protected static $instance = null;
59
+
60
+ /**
61
+ * Initialize the plugin by setting localization and loading public scripts
62
+ * and styles.
63
+ *
64
+ * @since 1.0.0
65
+ */
66
+ private function __construct() {
67
+
68
+ // Load plugin text domain
69
+ add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
70
+
71
+ // Activate plugin when new blog is added
72
+ add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) );
73
+
74
+ // Load public-facing style sheet and JavaScript.
75
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
76
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
77
+
78
+ add_shortcode( 'efb_likebox', array( $this, 'efb_likebox_shortcode' ) );
79
+
80
+ /* Define custom functionality.
81
+ * Refer To http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters
82
+ */
83
+ //add_action( '@TODO', array( $this, 'action_method_name' ) );
84
+ //add_filter( '@TODO', array( $this, 'filter_method_name' ) );
85
+
86
+ }
87
+
88
+ /**
89
+ * Return the plugin slug.
90
+ *
91
+ * @since 1.0.0
92
+ *
93
+ * @return Plugin slug variable.
94
+ */
95
+ public function get_plugin_slug() {
96
+ return $this->plugin_slug;
97
+ }
98
+
99
+ /**
100
+ * Return an instance of this class.
101
+ *
102
+ * @since 1.0.0
103
+ *
104
+ * @return object A single instance of this class.
105
+ */
106
+ public static function get_instance() {
107
+
108
+ // If the single instance hasn't been set, set it now.
109
+ if ( null == self::$instance ) {
110
+ self::$instance = new self;
111
+ }
112
+
113
+ return self::$instance;
114
+ }
115
+
116
+ /**
117
+ * Fired when the plugin is activated.
118
+ *
119
+ * @since 1.0.0
120
+ *
121
+ * @param boolean $network_wide True if WPMU superadmin uses
122
+ * "Network Activate" action, false if
123
+ * WPMU is disabled or plugin is
124
+ * activated on an individual blog.
125
+ */
126
+ public static function activate( $network_wide ) {
127
+
128
+ if ( function_exists( 'is_multisite' ) && is_multisite() ) {
129
+
130
+ if ( $network_wide ) {
131
+
132
+ // Get all blog ids
133
+ $blog_ids = self::get_blog_ids();
134
+
135
+ foreach ( $blog_ids as $blog_id ) {
136
+
137
+ switch_to_blog( $blog_id );
138
+ self::single_activate();
139
+ }
140
+
141
+ restore_current_blog();
142
+
143
+ } else {
144
+ self::single_activate();
145
+ }
146
+
147
+ } else {
148
+ self::single_activate();
149
+ }
150
+
151
+ }
152
+
153
+ /**
154
+ * Fired when the plugin is deactivated.
155
+ *
156
+ * @since 1.0.0
157
+ *
158
+ * @param boolean $network_wide True if WPMU superadmin uses
159
+ * "Network Deactivate" action, false if
160
+ * WPMU is disabled or plugin is
161
+ * deactivated on an individual blog.
162
+ */
163
+ public static function deactivate( $network_wide ) {
164
+
165
+ if ( function_exists( 'is_multisite' ) && is_multisite() ) {
166
+
167
+ if ( $network_wide ) {
168
+
169
+ // Get all blog ids
170
+ $blog_ids = self::get_blog_ids();
171
+
172
+ foreach ( $blog_ids as $blog_id ) {
173
+
174
+ switch_to_blog( $blog_id );
175
+ self::single_deactivate();
176
+
177
+ }
178
+
179
+ restore_current_blog();
180
+
181
+ } else {
182
+ self::single_deactivate();
183
+ }
184
+
185
+ } else {
186
+ self::single_deactivate();
187
+ }
188
+
189
+ }
190
+
191
+ /**
192
+ * Fired when a new site is activated with a WPMU environment.
193
+ *
194
+ * @since 1.0.0
195
+ *
196
+ * @param int $blog_id ID of the new blog.
197
+ */
198
+ public function activate_new_site( $blog_id ) {
199
+
200
+ if ( 1 !== did_action( 'wpmu_new_blog' ) ) {
201
+ return;
202
+ }
203
+
204
+ switch_to_blog( $blog_id );
205
+ self::single_activate();
206
+ restore_current_blog();
207
+
208
+ }
209
+
210
+ /**
211
+ * Get all blog ids of blogs in the current network that are:
212
+ * - not archived
213
+ * - not spam
214
+ * - not deleted
215
+ *
216
+ * @since 1.0.0
217
+ *
218
+ * @return array|false The blog ids, false if no matches.
219
+ */
220
+ private static function get_blog_ids() {
221
+
222
+ global $wpdb;
223
+
224
+ // get an array of blog ids
225
+ $sql = "SELECT blog_id FROM $wpdb->blogs
226
+ WHERE archived = '0' AND spam = '0'
227
+ AND deleted = '0'";
228
+
229
+ return $wpdb->get_col( $sql );
230
+
231
+ }
232
+
233
+ /**
234
+ * Fired for each blog when the plugin is activated.
235
+ *
236
+ * @since 1.0.0
237
+ */
238
+ private static function single_activate() {
239
+ // @TODO: Define activation functionality here
240
+ }
241
+
242
+ /**
243
+ * Fired for each blog when the plugin is deactivated.
244
+ *
245
+ * @since 1.0.0
246
+ */
247
+ private static function single_deactivate() {
248
+ // @TODO: Define deactivation functionality here
249
+ }
250
+
251
+ /**
252
+ * Load the plugin text domain for translation.
253
+ *
254
+ * @since 1.0.0
255
+ */
256
+ public function load_plugin_textdomain() {
257
+
258
+ $domain = $this->plugin_slug;
259
+ $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
260
+
261
+ load_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain . '/' . $domain . '-' . $locale . '.mo' );
262
+ load_plugin_textdomain( $domain, FALSE, basename( plugin_dir_path( dirname( __FILE__ ) ) ) . '/languages/' );
263
+
264
+ }
265
+
266
+ /**
267
+ * Register and enqueue public-facing style sheet.
268
+ *
269
+ * @since 1.0.0
270
+ */
271
+ public function enqueue_styles() {
272
+ wp_enqueue_style( $this->plugin_slug . '-plugin-styles', plugins_url( 'assets/css/public.css', __FILE__ ), array(), self::VERSION );
273
+ }
274
+
275
+ /**
276
+ * Register and enqueues public-facing JavaScript files.
277
+ *
278
+ * @since 1.0.0
279
+ */
280
+ public function enqueue_scripts() {
281
+ wp_enqueue_script( $this->plugin_slug . '-plugin-script', plugins_url( 'assets/js/public.js', __FILE__ ), array( 'jquery' ), self::VERSION );
282
+ }
283
+
284
+ /**
285
+ * NOTE: Actions are points in the execution of a page or process
286
+ * lifecycle that WordPress fires.
287
+ *
288
+ * Actions: http://codex.wordpress.org/Plugin_API#Actions
289
+ * Reference: http://codex.wordpress.org/Plugin_API/Action_Reference
290
+ *
291
+ * @since 1.0.0
292
+ */
293
+ public function action_method_name() {
294
+ // @TODO: Define your action hook callback here
295
+ }
296
+
297
+ /**
298
+ * NOTE: Filters are points of execution in which WordPress modifies data
299
+ * before saving it or sending it to the browser.
300
+ *
301
+ * Filters: http://codex.wordpress.org/Plugin_API#Filters
302
+ * Reference: http://codex.wordpress.org/Plugin_API/Filter_Reference
303
+ *
304
+ * @since 1.0.0
305
+ */
306
+ public function filter_method_name() {
307
+ // @TODO: Define your filter hook callback here
308
+ }
309
+
310
+ public function efb_likebox_shortcode($atts, $content=""){
311
+ return $this->render_fb_box($atts);
312
+ }
313
+
314
+ /**
315
+ * This fucntion will render the facebook like box
316
+ * before saving it or sending it to the browser.
317
+ *
318
+ * Filters: http://codex.wordpress.org/Plugin_API#Filters
319
+ * Reference: http://codex.wordpress.org/Plugin_API/Filter_Reference
320
+ *
321
+ * @since 1.0.0
322
+ */
323
+ public function render_fb_box($options) {
324
+
325
+ extract($options, EXTR_SKIP);
326
+
327
+ if( empty( $fb_appid ) ){
328
+ $fb_appid = '395202813876688';
329
+ }
330
+
331
+ $pieces = explode('/', $fanpage_url); // divides the string in pieces where '/' is found
332
+ $page_name_id = end($pieces); //takes the last piece
333
+
334
+ $show_stream = ( $show_stream == 1 ) ? 'data-stream=true' : 'data-stream=false';
335
+ $show_faces = ( $show_faces == 1 ) ? 'data-show-faces=true' : 'data-show-faces=false';
336
+ $show_border = ( $show_border == 1 ) ? 'data-show-border=true' : 'data-show-border=false' ;
337
+ $show_header = ( $show_header == 1 ) ? 'data-header=true' : 'data-header=false';
338
+
339
+ $returner = '<div id="fb-root"></div>
340
+ <script>(function(d, s, id) {
341
+ var js, fjs = d.getElementsByTagName(s)[0];
342
+ if (d.getElementById(id)) return;
343
+ js = d.createElement(s); js.id = id;
344
+ js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId='.$fb_appid.'";
345
+ fjs.parentNode.insertBefore(js, fjs);
346
+ }(document, \'script\', \'facebook-jssdk\'));</script>';
347
+
348
+ $returner .= '<div class="fb-like-box" data-href="https://www.facebook.com/'.$page_name_id.'" data-colorscheme="'.$colorscheme.'" data-width="'.$box_width.'" data-height="'.$box_height.'" '.$show_faces.' '.$show_header.' '.$show_stream.' '.$show_border.'></div>';
349
+
350
+ /* echo '<pre>';
351
+ echo htmlspecialchars($returner);
352
+ echo '</pre>';*/
353
+
354
+ return $returner;
355
+
356
+ }
357
+
358
+
359
+
360
+ }
public/includes/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
public/views/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
public/views/public.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Represents the view for the public-facing component of the plugin.
4
+ *
5
+ * This typically includes any information, if any, that is rendered to the
6
+ * frontend of the theme when the plugin is activated.
7
+ *
8
+ * @package Plugin_Name
9
+ * @author Your Name <email@example.com>
10
+ * @license GPL-2.0+
11
+ * @link http://example.com
12
+ * @copyright 2014 Your Name or Company Name
13
+ */
14
+ ?>
15
+
16
+ <!-- This file is used to markup the public facing aspect of the plugin. -->
uninstall.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Fired when the plugin is uninstalled.
4
+ *
5
+ * @package Plugin_Name
6
+ * @author Your Name <email@example.com>
7
+ * @license GPL-2.0+
8
+ * @link http://example.com
9
+ * @copyright 2014 Your Name or Company Name
10
+ */
11
+
12
+ // If uninstall not called from WordPress, then exit
13
+ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
14
+ exit;
15
+ }
16
+ if (is_multisite()) {
17
+ global $wpdb;
18
+ $blogs = $wpdb->get_results("SELECT blog_id FROM {$wpdb->blogs}", ARRAY_A);
19
+ /* @TODO: delete all transient, options and files you may have added
20
+ delete_transient( 'TRANSIENT_NAME' );
21
+ delete_option('OPTION_NAME');
22
+ //info: remove custom file directory for main site
23
+ $upload_dir = wp_upload_dir();
24
+ $directory = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . "CUSTOM_DIRECTORY_NAME" . DIRECTORY_SEPARATOR;
25
+ if (is_dir($directory)) {
26
+ foreach(glob($directory.'*.*') as $v){
27
+ unlink($v);
28
+ }
29
+ rmdir($directory);
30
+ }
31
+ */
32
+ if ($blogs) {
33
+ foreach($blogs as $blog) {
34
+ switch_to_blog($blog['blog_id']);
35
+ /* @TODO: delete all transient, options and files you may have added
36
+ delete_transient( 'TRANSIENT_NAME' );
37
+ delete_option('OPTION_NAME');
38
+ //info: remove custom file directory for main site
39
+ $upload_dir = wp_upload_dir();
40
+ $directory = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . "CUSTOM_DIRECTORY_NAME" . DIRECTORY_SEPARATOR;
41
+ if (is_dir($directory)) {
42
+ foreach(glob($directory.'*.*') as $v){
43
+ unlink($v);
44
+ }
45
+ rmdir($directory);
46
+ }
47
+ //info: remove and optimize tables
48
+ $GLOBALS['wpdb']->query("DROP TABLE `".$GLOBALS['wpdb']->prefix."TABLE_NAME`");
49
+ $GLOBALS['wpdb']->query("OPTIMIZE TABLE `" .$GLOBALS['wpdb']->prefix."options`");
50
+ */
51
+ restore_current_blog();
52
+ }
53
+ }
54
+ }
55
+ else
56
+ {
57
+ /* @TODO: delete all transient, options and files you may have added
58
+ delete_transient( 'TRANSIENT_NAME' );
59
+ delete_option('OPTION_NAME');
60
+ //info: remove custom file directory for main site
61
+ $upload_dir = wp_upload_dir();
62
+ $directory = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . "CUSTOM_DIRECTORY_NAME" . DIRECTORY_SEPARATOR;
63
+ if (is_dir($directory)) {
64
+ foreach(glob($directory.'*.*') as $v){
65
+ unlink($v);
66
+ }
67
+ rmdir($directory);
68
+ }
69
+ //info: remove and optimize tables
70
+ $GLOBALS['wpdb']->query("DROP TABLE `".$GLOBALS['wpdb']->prefix."TABLE_NAME`");
71
+ $GLOBALS['wpdb']->query("OPTIMIZE TABLE `" .$GLOBALS['wpdb']->prefix."options`");
72
+ */
73
+ }