Version Description
October 4, 2014 =
Minor code improvements and WP 4.0+ compatibility.
Prevent direct file access
Download this release
Release Info
Developer | DvanKooten |
Plugin | Newsletter Sign-Up |
Version | 2.0.4 |
Comparing to | |
See all releases |
Code changes from version 2.0.3 to 2.0.4
- LICENSE +339 -0
- assets/css/admin.css +10 -2
- assets/css/css.php +4 -4
- assets/css/index.php +6 -0
- assets/img/close.png +0 -0
- assets/img/email-icon.png +0 -0
- assets/img/icon.png +0 -0
- assets/img/index.php +6 -0
- assets/img/overlay.png +0 -0
- assets/img/rss-icon.png +0 -0
- assets/img/twitter-icon.png +0 -0
- assets/index.php +6 -0
- assets/js/admin.js +0 -0
- assets/js/index.php +6 -0
- includes/NSU.php +8 -4
- includes/NSU_Admin.php +17 -10
- includes/NSU_Checkbox.php +171 -143
- includes/NSU_Form.php +161 -130
- includes/NewsletterSignUpWidget.php +0 -0
- includes/index.php +6 -0
- includes/views/checkbox_settings.php +2 -1
- includes/views/config_helper.php +5 -4
- includes/views/dashboard.php +14 -7
- includes/views/form_settings.php +1 -0
- includes/views/index.php +6 -0
- includes/views/parts/index.php +6 -0
- includes/views/parts/navigation.php +6 -5
- includes/views/parts/rows-aweber.php +6 -3
- includes/views/parts/rows-mailchimp.php +71 -30
- includes/views/parts/rows-phplist.php +8 -3
- includes/views/parts/rows-ymlp.php +34 -14
- includes/views/parts/sidebar.php +11 -11
- index.php +6 -0
- newsletter-sign-up.php +9 -5
- readme.txt +22 -114
LICENSE
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., <http://fsf.org/>
|
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 |
+
{description}
|
294 |
+
Copyright (C) {year} {fullname}
|
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.
|
assets/css/admin.css
CHANGED
@@ -2,7 +2,11 @@
|
|
2 |
#nsu-main { width:65%; float:left; }
|
3 |
#nsu-sidebar{ width:30%; float:right; }
|
4 |
|
5 |
-
#nsu-sidebar > div{ margin-bottom:
|
|
|
|
|
|
|
|
|
6 |
|
7 |
#nsu-admin li.has-icon { list-style:none; padding-left:25px; margin-left:-25px; background-position:left center; background-repeat: no-repeat; }
|
8 |
#nsu-admin li.dvk-email{ background-image:url("../img/email-icon.png"); }
|
@@ -10,4 +14,8 @@
|
|
10 |
#nsu-admin li.mc4wp{ background-image:url("../img/mailchimp-for-wp-icon.png"); }
|
11 |
#nsu-admin li.rfb{ background-image:url("../img/recent-facebook-posts-icon.png"); }
|
12 |
|
13 |
-
#nsu-
|
|
|
|
|
|
|
|
2 |
#nsu-main { width:65%; float:left; }
|
3 |
#nsu-sidebar{ width:30%; float:right; }
|
4 |
|
5 |
+
#nsu-sidebar > div{ margin-bottom:40px; }
|
6 |
+
#nsu-sidebar > div h3 {
|
7 |
+
padding-bottom: 10px;
|
8 |
+
border-bottom: 1px solid #ccc;
|
9 |
+
}
|
10 |
|
11 |
#nsu-admin li.has-icon { list-style:none; padding-left:25px; margin-left:-25px; background-position:left center; background-repeat: no-repeat; }
|
12 |
#nsu-admin li.dvk-email{ background-image:url("../img/email-icon.png"); }
|
14 |
#nsu-admin li.mc4wp{ background-image:url("../img/mailchimp-for-wp-icon.png"); }
|
15 |
#nsu-admin li.rfb{ background-image:url("../img/recent-facebook-posts-icon.png"); }
|
16 |
|
17 |
+
#nsu-admin .help {
|
18 |
+
display: block;
|
19 |
+
font-style: italic;
|
20 |
+
font-weight: normal;
|
21 |
+
}
|
assets/css/css.php
CHANGED
@@ -5,12 +5,12 @@ header('Content-Type: text/css; charset: UTF-8');
|
|
5 |
header("Cache-Control: public, max-age=" . $expires);
|
6 |
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT');
|
7 |
|
8 |
-
if(isset($_GET['checkbox'])) {
|
9 |
-
readfile('checkbox.css');
|
10 |
}
|
11 |
|
12 |
-
if(isset($_GET['form'])) {
|
13 |
-
readfile('form.css');
|
14 |
}
|
15 |
|
16 |
exit;
|
5 |
header("Cache-Control: public, max-age=" . $expires);
|
6 |
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT');
|
7 |
|
8 |
+
if( isset( $_GET['checkbox'] ) ) {
|
9 |
+
readfile( dirname( __FILE__ ) . '/checkbox.css' );
|
10 |
}
|
11 |
|
12 |
+
if( isset( $_GET['form'] ) ) {
|
13 |
+
readfile( dirname( __FILE__ ) . '/form.css' );
|
14 |
}
|
15 |
|
16 |
exit;
|
assets/css/index.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// prevent directory listing
|
3 |
+
|
4 |
+
header( 'Status: 403 Forbidden' );
|
5 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
6 |
+
exit;
|
assets/img/close.png
CHANGED
File without changes
|
assets/img/email-icon.png
CHANGED
File without changes
|
assets/img/icon.png
CHANGED
File without changes
|
assets/img/index.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// prevent directory listing
|
3 |
+
|
4 |
+
header( 'Status: 403 Forbidden' );
|
5 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
6 |
+
exit;
|
assets/img/overlay.png
CHANGED
File without changes
|
assets/img/rss-icon.png
CHANGED
File without changes
|
assets/img/twitter-icon.png
CHANGED
File without changes
|
assets/index.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// prevent directory listing
|
3 |
+
|
4 |
+
header( 'Status: 403 Forbidden' );
|
5 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
6 |
+
exit;
|
assets/js/admin.js
CHANGED
File without changes
|
assets/js/index.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// prevent directory listing
|
3 |
+
|
4 |
+
header( 'Status: 403 Forbidden' );
|
5 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
6 |
+
exit;
|
includes/NSU.php
CHANGED
@@ -12,25 +12,29 @@ class NSU {
|
|
12 |
|
13 |
$opts = $this->get_options();
|
14 |
|
15 |
-
// widget hooks
|
16 |
-
add_action( 'widgets_init', array( $this, 'register_widget' ) );
|
17 |
-
|
18 |
self::checkbox();
|
19 |
self::form();
|
20 |
|
|
|
|
|
|
|
|
|
21 |
if ( !defined( "DOING_AJAX" ) || !DOING_AJAX ) {
|
22 |
-
|
23 |
if ( is_admin() ) {
|
24 |
|
25 |
// backend only
|
26 |
require_once NSU_PLUGIN_DIR . 'includes/NSU_Admin.php';
|
27 |
new NSU_Admin();
|
|
|
28 |
} else {
|
|
|
29 |
// frontend only
|
30 |
require_once NSU_PLUGIN_DIR . 'includes/functions.php';
|
31 |
|
32 |
add_action( 'wp_enqueue_scripts', array( $this, 'load_stylesheets' ) );
|
33 |
add_action( 'login_enqueue_scripts', array( $this, 'load_stylesheets' ) );
|
|
|
34 |
}
|
35 |
}
|
36 |
}
|
12 |
|
13 |
$opts = $this->get_options();
|
14 |
|
|
|
|
|
|
|
15 |
self::checkbox();
|
16 |
self::form();
|
17 |
|
18 |
+
// widget hooks
|
19 |
+
add_action( 'widgets_init', array( $this, 'register_widget' ) );
|
20 |
+
|
21 |
+
// check if this is an AJAX request
|
22 |
if ( !defined( "DOING_AJAX" ) || !DOING_AJAX ) {
|
23 |
+
|
24 |
if ( is_admin() ) {
|
25 |
|
26 |
// backend only
|
27 |
require_once NSU_PLUGIN_DIR . 'includes/NSU_Admin.php';
|
28 |
new NSU_Admin();
|
29 |
+
|
30 |
} else {
|
31 |
+
|
32 |
// frontend only
|
33 |
require_once NSU_PLUGIN_DIR . 'includes/functions.php';
|
34 |
|
35 |
add_action( 'wp_enqueue_scripts', array( $this, 'load_stylesheets' ) );
|
36 |
add_action( 'login_enqueue_scripts', array( $this, 'load_stylesheets' ) );
|
37 |
+
|
38 |
}
|
39 |
}
|
40 |
}
|
includes/NSU_Admin.php
CHANGED
@@ -144,18 +144,19 @@ if (!class_exists('NSU_Admin')) {
|
|
144 |
public function options_page_config_helper() {
|
145 |
$tab = 'config-helper';
|
146 |
|
147 |
-
if (isset($_POST['form']) && !empty($_POST['form'])) {
|
148 |
|
149 |
-
$result = $this->extract_form_config($_POST['form']);
|
150 |
|
151 |
}
|
152 |
|
153 |
require_once NSU_PLUGIN_DIR . 'includes/views/config_helper.php';
|
154 |
}
|
155 |
|
156 |
-
private function extract_form_config($form_html) {
|
|
|
157 |
// strip unneccessary tags
|
158 |
-
$form = strip_tags($form_html, '<form><label><input><select><textarea><button>');
|
159 |
|
160 |
// set defaults
|
161 |
$form_action = '';
|
@@ -165,19 +166,23 @@ if (!class_exists('NSU_Admin')) {
|
|
165 |
|
166 |
preg_match_all("'<(.*?)>'si", $form, $matches);
|
167 |
|
168 |
-
if
|
169 |
$matches = $matches[0];
|
170 |
-
$html =
|
171 |
} else {
|
172 |
$html = $form;
|
173 |
}
|
174 |
|
|
|
|
|
|
|
175 |
$doc = new DOMDocument();
|
176 |
-
$doc->strictErrorChecking =
|
177 |
-
$doc->loadHTML($html);
|
|
|
178 |
$xml = simplexml_import_dom($doc);
|
179 |
|
180 |
-
if ($xml) {
|
181 |
$form = $xml->body->form;
|
182 |
|
183 |
if ($form) {
|
@@ -185,7 +190,7 @@ if (!class_exists('NSU_Admin')) {
|
|
185 |
$form_action = (isset($form['action'])) ? $form['action'] : 'Can\'t help you on this one..';
|
186 |
|
187 |
|
188 |
-
if ($form->input) {
|
189 |
|
190 |
/* Loop trough input fields */
|
191 |
foreach ($form->input as $input) {
|
@@ -228,6 +233,8 @@ if (!class_exists('NSU_Admin')) {
|
|
228 |
$doc->replaceChild($doc->firstChild->firstChild->firstChild, $doc->firstChild);
|
229 |
|
230 |
$simpler_form = $doc->saveHTML();
|
|
|
|
|
231 |
$simpler_form = str_replace(array('><', '<input'), array(">\n<", "\t<input"), $simpler_form);
|
232 |
|
233 |
|
144 |
public function options_page_config_helper() {
|
145 |
$tab = 'config-helper';
|
146 |
|
147 |
+
if ( isset( $_POST['form'] ) && ! empty( $_POST['form'] ) ) {
|
148 |
|
149 |
+
$result = $this->extract_form_config( $_POST['form'] );
|
150 |
|
151 |
}
|
152 |
|
153 |
require_once NSU_PLUGIN_DIR . 'includes/views/config_helper.php';
|
154 |
}
|
155 |
|
156 |
+
private function extract_form_config( $form_html ) {
|
157 |
+
|
158 |
// strip unneccessary tags
|
159 |
+
$form = stripslashes( strip_tags($form_html, '<form><label><input><select><textarea><button>') );
|
160 |
|
161 |
// set defaults
|
162 |
$form_action = '';
|
166 |
|
167 |
preg_match_all("'<(.*?)>'si", $form, $matches);
|
168 |
|
169 |
+
if( is_array( $matches ) && isset($matches[0])) {
|
170 |
$matches = $matches[0];
|
171 |
+
$html = join('', $matches);
|
172 |
} else {
|
173 |
$html = $form;
|
174 |
}
|
175 |
|
176 |
+
// fake wrap in html and body tags
|
177 |
+
$html = '<html><body>' . $html . '</body></html>';
|
178 |
+
|
179 |
$doc = new DOMDocument();
|
180 |
+
$doc->strictErrorChecking = false;
|
181 |
+
$doc->loadHTML( $html);
|
182 |
+
|
183 |
$xml = simplexml_import_dom($doc);
|
184 |
|
185 |
+
if ( is_object( $xml ) ) {
|
186 |
$form = $xml->body->form;
|
187 |
|
188 |
if ($form) {
|
190 |
$form_action = (isset($form['action'])) ? $form['action'] : 'Can\'t help you on this one..';
|
191 |
|
192 |
|
193 |
+
if ( $form->input ) {
|
194 |
|
195 |
/* Loop trough input fields */
|
196 |
foreach ($form->input as $input) {
|
233 |
$doc->replaceChild($doc->firstChild->firstChild->firstChild, $doc->firstChild);
|
234 |
|
235 |
$simpler_form = $doc->saveHTML();
|
236 |
+
|
237 |
+
// add tabs for improved readability
|
238 |
$simpler_form = str_replace(array('><', '<input'), array(">\n<", "\t<input"), $simpler_form);
|
239 |
|
240 |
|
includes/NSU_Checkbox.php
CHANGED
@@ -1,212 +1,240 @@
|
|
1 |
<?php
|
2 |
|
3 |
class NSU_Checkbox {
|
4 |
-
|
|
|
|
|
|
|
5 |
private $showed_checkbox = false;
|
6 |
|
7 |
-
public function __construct()
|
8 |
-
{
|
9 |
|
10 |
$options = NSU::instance()->get_options();
|
11 |
-
$opts
|
12 |
|
13 |
// add hooks
|
14 |
|
15 |
-
if($opts['add_to_comment_form'] == 1) {
|
16 |
-
add_action('thesis_hook_after_comment_box', array($this, 'output_checkbox'), 20);
|
17 |
-
add_action('comment_form', array($this, 'output_checkbox'), 20);
|
18 |
-
add_action('comment_post', array($this, 'grab_email_from_comment'), 20, 2);
|
19 |
}
|
20 |
-
|
21 |
-
if($opts['add_to_registration_form'] == 1) {
|
22 |
-
add_action('register_form',array($this, 'output_checkbox'), 20);
|
23 |
-
add_action('register_post',array($this, 'grab_email_from_wp_signup'), 50);
|
24 |
}
|
25 |
-
|
26 |
-
if($opts['add_to_buddypress_form'] == 1) {
|
27 |
-
add_action('bp_before_registration_submit_buttons', array($this, 'output_checkbox'), 20);
|
28 |
-
add_action('bp_complete_signup', array($this, 'grab_email_from_wp_signup'), 20);
|
29 |
}
|
30 |
-
|
31 |
-
if($opts['add_to_multisite_form'] == 1) {
|
32 |
-
add_action('signup_extra_fields', array($this, 'output_checkbox'), 20);
|
33 |
-
add_action('signup_blogform', array($this, 'add_hidden_checkbox'), 20);
|
34 |
-
add_filter('add_signup_meta', array($this, 'add_checkbox_to_usermeta'));
|
35 |
-
add_action('wpmu_activate_blog', array($this, 'grab_email_from_ms_blog_signup'), 20, 5);
|
36 |
-
add_action('wpmu_activate_user', array($this, 'grab_email_from_ms_user_signup'), 20, 3);
|
37 |
}
|
38 |
|
39 |
/* bbPress actions */
|
40 |
-
if($opts['add_to_bbpress_forms']) {
|
41 |
-
add_action('bbp_theme_after_topic_form_subscriptions', array($this, 'output_checkbox'), 10);
|
42 |
-
add_action('bbp_theme_after_reply_form_subscription', array($this, 'output_checkbox'), 10);
|
43 |
-
add_action('bbp_theme_anonymous_form_extras_bottom', array($this, 'output_checkbox'), 10);
|
44 |
-
add_action('bbp_new_topic', array($this, 'subscribe_from_bbpress_new_topic'), 10, 4);
|
45 |
-
add_action('bbp_new_reply', array($this, 'subscribe_from_bbpress_new_reply'), 10, 5);
|
46 |
}
|
47 |
|
48 |
}
|
49 |
|
50 |
-
|
51 |
/**
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
{
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
if($opts['cookie_hide'] == 1 && isset($_COOKIE['ns_subscriber']))
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
|
|
|
|
|
|
66 |
?>
|
67 |
<!-- Checkbox by Newsletter Sign-Up Checkbox v<?php echo NSU_VERSION_NUMBER; ?> - http://wordpress.org/plugins/newsletter-sign-up/ -->
|
68 |
<p id="nsu-checkbox">
|
69 |
<label for="nsu-checkbox-input" id="nsu-checkbox-label">
|
70 |
-
<input value="1" id="nsu-checkbox-input" type="checkbox" name="newsletter-sign-up-do" <?php checked($opts['precheck'], 1); ?> />
|
71 |
-
<?php _e($opts['text'], 'newsletter-sign-up'); ?>
|
72 |
</label>
|
73 |
</p>
|
74 |
<!-- / Newsletter Sign-Up -->
|
75 |
-
<?php
|
76 |
-
|
|
|
77 |
$this->showed_checkbox = true;
|
78 |
-
|
|
|
79 |
}
|
80 |
-
|
81 |
/**
|
82 |
-
|
83 |
-
|
84 |
-
function add_hidden_checkbox()
|
85 |
-
{
|
86 |
?>
|
87 |
-
<input type="hidden" name="newsletter-sign-up-do" value="<?php echo (isset($_POST['newsletter-sign-up-do'])) ? 1 : 0; ?>" />
|
88 |
-
|
89 |
}
|
90 |
-
|
91 |
/**
|
92 |
-
|
93 |
-
|
94 |
-
function add_checkbox_to_usermeta($meta)
|
95 |
-
|
96 |
-
|
97 |
return $meta;
|
98 |
}
|
99 |
-
|
100 |
/**
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
111 |
$email = $user_info->user_email;
|
112 |
-
$name
|
113 |
-
|
114 |
-
NSU::instance()->send_post_data($email, $name);
|
115 |
}
|
116 |
-
|
117 |
/**
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
|
|
|
|
|
|
|
|
|
|
131 |
$email = $user_info->user_email;
|
132 |
-
$name
|
133 |
-
|
134 |
-
NSU::instance()->send_post_data($email, $name);
|
135 |
}
|
136 |
-
|
137 |
/**
|
138 |
-
|
139 |
-
|
140 |
-
function grab_email_from_wp_signup()
|
141 |
-
|
142 |
-
if
|
143 |
-
|
144 |
-
|
145 |
-
|
|
|
|
|
|
|
146 |
// gather emailadress from user who WordPress registered
|
147 |
-
$email = $_POST['user_email'];
|
148 |
-
$name
|
149 |
-
|
150 |
-
} elseif(isset($_POST['signup_email'])) {
|
151 |
-
|
152 |
// gather emailadress from user who BuddyPress registered
|
153 |
-
$email = $_POST['signup_email'];
|
154 |
-
$name
|
|
|
|
|
|
|
|
|
155 |
|
156 |
-
|
157 |
-
|
158 |
-
NSU::instance()->send_post_data($email, $name);
|
159 |
}
|
160 |
-
|
161 |
/**
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
{
|
168 |
-
|
169 |
-
if(
|
170 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
// get comment data
|
172 |
-
$comment = get_comment($cid);
|
173 |
-
|
174 |
$email = $comment->comment_author_email;
|
175 |
-
$name
|
176 |
-
|
177 |
-
return NSU::instance()->send_post_data($email, $name);
|
178 |
}
|
179 |
|
180 |
-
public function subscribe_from_bbpress($anonymous_data, $user_id)
|
181 |
-
|
182 |
-
if(!isset($_POST['newsletter-sign-up-do']) || $_POST['newsletter-sign-up-do'] != 1) {
|
|
|
|
|
183 |
|
184 |
-
if($anonymous_data) {
|
185 |
|
186 |
$email = $anonymous_data['bbp_anonymous_email'];
|
187 |
-
$name
|
188 |
|
189 |
-
} elseif($user_id) {
|
190 |
|
191 |
-
$user_info = get_userdata($user_id);
|
192 |
-
$email
|
193 |
-
$name
|
194 |
|
195 |
} else {
|
196 |
return false;
|
197 |
}
|
198 |
|
199 |
-
return NSU::instance()->send_post_data($email, $name);
|
200 |
}
|
201 |
|
202 |
-
public function subscribe_from_bbpress_new_topic($topic_id, $forum_id, $anonymous_data, $topic_author)
|
203 |
-
|
204 |
-
return $this->subscribe_from_bbpress($anonymous_data, $topic_author);
|
205 |
}
|
206 |
|
207 |
-
public function subscribe_from_bbpress_new_reply($reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author)
|
208 |
-
|
209 |
-
return $this->subscribe_from_bbpress($anonymous_data, $reply_author);
|
210 |
}
|
211 |
|
212 |
}
|
1 |
<?php
|
2 |
|
3 |
class NSU_Checkbox {
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @var bool
|
7 |
+
*/
|
8 |
private $showed_checkbox = false;
|
9 |
|
10 |
+
public function __construct() {
|
|
|
11 |
|
12 |
$options = NSU::instance()->get_options();
|
13 |
+
$opts = $this->options = $options['checkbox'];
|
14 |
|
15 |
// add hooks
|
16 |
|
17 |
+
if ( $opts['add_to_comment_form'] == 1 ) {
|
18 |
+
add_action( 'thesis_hook_after_comment_box', array( $this, 'output_checkbox' ), 20 );
|
19 |
+
add_action( 'comment_form', array( $this, 'output_checkbox' ), 20 );
|
20 |
+
add_action( 'comment_post', array( $this, 'grab_email_from_comment' ), 20, 2 );
|
21 |
}
|
22 |
+
|
23 |
+
if ( $opts['add_to_registration_form'] == 1 ) {
|
24 |
+
add_action( 'register_form', array( $this, 'output_checkbox' ), 20 );
|
25 |
+
add_action( 'register_post', array( $this, 'grab_email_from_wp_signup' ), 50 );
|
26 |
}
|
27 |
+
|
28 |
+
if ( $opts['add_to_buddypress_form'] == 1 ) {
|
29 |
+
add_action( 'bp_before_registration_submit_buttons', array( $this, 'output_checkbox' ), 20 );
|
30 |
+
add_action( 'bp_complete_signup', array( $this, 'grab_email_from_wp_signup' ), 20 );
|
31 |
}
|
32 |
+
|
33 |
+
if ( $opts['add_to_multisite_form'] == 1 ) {
|
34 |
+
add_action( 'signup_extra_fields', array( $this, 'output_checkbox' ), 20 );
|
35 |
+
add_action( 'signup_blogform', array( $this, 'add_hidden_checkbox' ), 20 );
|
36 |
+
add_filter( 'add_signup_meta', array( $this, 'add_checkbox_to_usermeta' ) );
|
37 |
+
add_action( 'wpmu_activate_blog', array( $this, 'grab_email_from_ms_blog_signup' ), 20, 5 );
|
38 |
+
add_action( 'wpmu_activate_user', array( $this, 'grab_email_from_ms_user_signup' ), 20, 3 );
|
39 |
}
|
40 |
|
41 |
/* bbPress actions */
|
42 |
+
if ( $opts['add_to_bbpress_forms'] ) {
|
43 |
+
add_action( 'bbp_theme_after_topic_form_subscriptions', array( $this, 'output_checkbox' ), 10 );
|
44 |
+
add_action( 'bbp_theme_after_reply_form_subscription', array( $this, 'output_checkbox' ), 10 );
|
45 |
+
add_action( 'bbp_theme_anonymous_form_extras_bottom', array( $this, 'output_checkbox' ), 10 );
|
46 |
+
add_action( 'bbp_new_topic', array( $this, 'subscribe_from_bbpress_new_topic' ), 10, 4 );
|
47 |
+
add_action( 'bbp_new_reply', array( $this, 'subscribe_from_bbpress_new_reply' ), 10, 5 );
|
48 |
}
|
49 |
|
50 |
}
|
51 |
|
52 |
+
|
53 |
/**
|
54 |
+
* Outputs the sign-up checkbox, will only run once.
|
55 |
+
*
|
56 |
+
* @return bool
|
57 |
+
*/
|
58 |
+
public function output_checkbox() {
|
59 |
+
$opts = $this->options;
|
60 |
+
|
61 |
+
// If using option to hide checkbox for subscribers and cookie is set, set instance variable showed_checkbox to true so checkbox won't show.
|
62 |
+
if ( $opts['cookie_hide'] == 1 && isset( $_COOKIE['ns_subscriber'] ) ) {
|
63 |
+
$this->showed_checkbox = true;
|
64 |
+
}
|
65 |
+
|
66 |
+
// User could have rendered the checkbox by manually adding 'the hook 'ns_comment_checkbox()' to their comment form
|
67 |
+
// If so, abandon function.
|
68 |
+
if ( $this->showed_checkbox ) {
|
69 |
+
return false;
|
70 |
+
}
|
71 |
+
|
72 |
?>
|
73 |
<!-- Checkbox by Newsletter Sign-Up Checkbox v<?php echo NSU_VERSION_NUMBER; ?> - http://wordpress.org/plugins/newsletter-sign-up/ -->
|
74 |
<p id="nsu-checkbox">
|
75 |
<label for="nsu-checkbox-input" id="nsu-checkbox-label">
|
76 |
+
<input value="1" id="nsu-checkbox-input" type="checkbox" name="newsletter-sign-up-do" <?php checked( $opts['precheck'], 1 ); ?> />
|
77 |
+
<?php _e( $opts['text'], 'newsletter-sign-up' ); ?>
|
78 |
</label>
|
79 |
</p>
|
80 |
<!-- / Newsletter Sign-Up -->
|
81 |
+
<?php
|
82 |
+
|
83 |
+
// make sure checkbox doesn't show again
|
84 |
$this->showed_checkbox = true;
|
85 |
+
|
86 |
+
return true;
|
87 |
}
|
88 |
+
|
89 |
/**
|
90 |
+
* Adds a hidden checkbox to the second page of the MultiSite sign-up form (the blog sign-up form) containing the checkbox value of the previous screen
|
91 |
+
*/
|
92 |
+
function add_hidden_checkbox() {
|
|
|
93 |
?>
|
94 |
+
<input type="hidden" name="newsletter-sign-up-do" value="<?php echo ( isset( $_POST['newsletter-sign-up-do'] ) ) ? 1 : 0; ?>" />
|
95 |
+
<?php
|
96 |
}
|
97 |
+
|
98 |
/**
|
99 |
+
* Save the value of the checkbox to MultiSite sign-ups table
|
100 |
+
*/
|
101 |
+
function add_checkbox_to_usermeta( $meta ) {
|
102 |
+
$meta['newsletter-sign-up-do'] = ( isset( $_POST['newsletter-sign-up-do'] ) ) ? 1 : 0;
|
103 |
+
|
104 |
return $meta;
|
105 |
}
|
106 |
+
|
107 |
/**
|
108 |
+
* Perform the sign-up for users that registered trough a MultiSite register form
|
109 |
+
* This function differs because of the need to grab the emailadress from the user using get_userdata
|
110 |
+
*
|
111 |
+
* @param int $user_id : the ID of the new user
|
112 |
+
* @param string $password : the password, we don't actually use this
|
113 |
+
* @param array $meta : the meta values that belong to this user, holds the value of our 'newsletter-sign-up' checkbox.
|
114 |
+
*/
|
115 |
+
public function grab_email_from_ms_user_signup( $user_id, $password = null, $meta = null ) {
|
116 |
+
|
117 |
+
// only add meta if sign-up checkbox was checked
|
118 |
+
if ( ! isset( $meta['newsletter-sign-up-do'] ) || $meta['newsletter-sign-up-do'] != 1 ) {
|
119 |
+
return;
|
120 |
+
}
|
121 |
+
$user_info = get_userdata( $user_id );
|
122 |
+
|
123 |
$email = $user_info->user_email;
|
124 |
+
$name = $user_info->first_name;
|
125 |
+
|
126 |
+
NSU::instance()->send_post_data( $email, $name );
|
127 |
}
|
128 |
+
|
129 |
/**
|
130 |
+
* Perform the sign-up for users that registered trough a MultiSite register form
|
131 |
+
* This function differs because of the need to grab the emailadress from the user using get_userdata
|
132 |
+
*
|
133 |
+
* @param int $blog_id The id of the new blow
|
134 |
+
* @param int $user_id The ID of the new user
|
135 |
+
* @param $a No idea, seriously.
|
136 |
+
* @param $b No idea, seriously.
|
137 |
+
* @param array $meta The meta values that belong to this user, holds the value of our 'newsletter-sign-up' checkbox.
|
138 |
+
*/
|
139 |
+
public function grab_email_from_ms_blog_signup( $blog_id, $user_id, $a, $b, $meta ) {
|
140 |
+
|
141 |
+
// only subscribe this user if he checked the sign-up checkbox
|
142 |
+
if ( ! isset( $meta['newsletter-sign-up-do'] ) || $meta['newsletter-sign-up-do'] != 1 ) {
|
143 |
+
return;
|
144 |
+
}
|
145 |
+
|
146 |
+
$user_info = get_userdata( $user_id );
|
147 |
+
|
148 |
$email = $user_info->user_email;
|
149 |
+
$name = $user_info->first_name;
|
150 |
+
|
151 |
+
NSU::instance()->send_post_data( $email, $name );
|
152 |
}
|
153 |
+
|
154 |
/**
|
155 |
+
* Grab the emailadress (and name) from a regular WP or BuddyPress sign-up and then send this to mailinglist.
|
156 |
+
*/
|
157 |
+
function grab_email_from_wp_signup() {
|
158 |
+
|
159 |
+
// only act if checkbox was checked
|
160 |
+
if ( $_POST['newsletter-sign-up-do'] != 1 ) {
|
161 |
+
return;
|
162 |
+
}
|
163 |
+
|
164 |
+
if ( isset( $_POST['user_email'] ) ) {
|
165 |
+
|
166 |
// gather emailadress from user who WordPress registered
|
167 |
+
$email = sanitize_text_field( $_POST['user_email'] );
|
168 |
+
$name = sanitize_text_field( $_POST['user_login'] );
|
169 |
+
|
170 |
+
} elseif ( isset( $_POST['signup_email'] ) ) {
|
171 |
+
|
172 |
// gather emailadress from user who BuddyPress registered
|
173 |
+
$email = sanitize_text_field( $_POST['signup_email'] );
|
174 |
+
$name = sanitize_text_field( $_POST['signup_username'] );
|
175 |
+
|
176 |
+
} else {
|
177 |
+
return false;
|
178 |
+
}
|
179 |
|
180 |
+
NSU::instance()->send_post_data( $email, $name );
|
|
|
|
|
181 |
}
|
182 |
+
|
183 |
/**
|
184 |
+
* Grab the emailadress and name from comment and then send it to mailinglist.
|
185 |
+
*
|
186 |
+
* @param int $cid : the ID of the comment
|
187 |
+
* @param object $comment : the comment object, optionally
|
188 |
+
*/
|
189 |
+
public function grab_email_from_comment( $cid, $comment_approved = '' ) {
|
190 |
+
|
191 |
+
if ( ! isset( $_POST['newsletter-sign-up-do'] ) || $_POST['newsletter-sign-up-do'] != 1 ) {
|
192 |
+
return false;
|
193 |
+
}
|
194 |
+
|
195 |
+
if ( $comment_approved === 'spam' ) {
|
196 |
+
return false;
|
197 |
+
}
|
198 |
+
|
199 |
// get comment data
|
200 |
+
$comment = get_comment( $cid );
|
201 |
+
|
202 |
$email = $comment->comment_author_email;
|
203 |
+
$name = $comment->comment_author;
|
204 |
+
|
205 |
+
return NSU::instance()->send_post_data( $email, $name );
|
206 |
}
|
207 |
|
208 |
+
public function subscribe_from_bbpress( $anonymous_data, $user_id ) {
|
209 |
+
// only act if sign-up checkbox was checked
|
210 |
+
if ( ! isset( $_POST['newsletter-sign-up-do'] ) || $_POST['newsletter-sign-up-do'] != 1 ) {
|
211 |
+
return false;
|
212 |
+
}
|
213 |
|
214 |
+
if ( $anonymous_data ) {
|
215 |
|
216 |
$email = $anonymous_data['bbp_anonymous_email'];
|
217 |
+
$name = $anonymous_data['bbp_anonymous_name'];
|
218 |
|
219 |
+
} elseif ( $user_id ) {
|
220 |
|
221 |
+
$user_info = get_userdata( $user_id );
|
222 |
+
$email = $user_info->user_email;
|
223 |
+
$name = $user_info->first_name . ' ' . $user_info->last_name;
|
224 |
|
225 |
} else {
|
226 |
return false;
|
227 |
}
|
228 |
|
229 |
+
return NSU::instance()->send_post_data( $email, $name );
|
230 |
}
|
231 |
|
232 |
+
public function subscribe_from_bbpress_new_topic( $topic_id, $forum_id, $anonymous_data, $topic_author ) {
|
233 |
+
return $this->subscribe_from_bbpress( $anonymous_data, $topic_author );
|
|
|
234 |
}
|
235 |
|
236 |
+
public function subscribe_from_bbpress_new_reply( $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author ) {
|
237 |
+
return $this->subscribe_from_bbpress( $anonymous_data, $reply_author );
|
|
|
238 |
}
|
239 |
|
240 |
}
|
includes/NSU_Form.php
CHANGED
@@ -1,175 +1,206 @@
|
|
1 |
<?php
|
2 |
|
3 |
class NSU_Form {
|
4 |
-
|
5 |
private $validation_errors = array();
|
6 |
private $number_of_forms = 0;
|
7 |
private $options = array();
|
8 |
|
9 |
-
public function __construct()
|
10 |
-
{
|
11 |
// add hooks
|
12 |
-
$options
|
13 |
$this->options = $options;
|
14 |
|
15 |
// register the shortcode which can be used to output sign-up form
|
16 |
-
add_shortcode('newsletter-sign-up-form', array($this,'form_shortcode'));
|
17 |
-
add_shortcode('nsu-form', array($this,'form_shortcode'));
|
18 |
-
add_shortcode('nsu_form', array($this,'form_shortcode'));
|
19 |
|
20 |
-
if(isset($_POST['nsu_submit'])) {
|
21 |
-
add_action('init', array($this, 'submit'));
|
22 |
}
|
23 |
}
|
24 |
|
25 |
/**
|
26 |
-
|
27 |
-
|
28 |
-
public function submit()
|
29 |
-
{
|
30 |
|
31 |
-
$opts
|
32 |
-
$errors = array();
|
33 |
|
34 |
-
$email = (isset($_POST['nsu_email'])) ? $_POST['nsu_email'] : '';
|
35 |
-
$name
|
36 |
|
37 |
// has the honeypot been filled?
|
38 |
-
if(!empty($_POST['nsu_robocop'])) {
|
|
|
|
|
39 |
|
40 |
-
if
|
41 |
-
|
|
|
42 |
}
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
48 |
}
|
49 |
|
|
|
50 |
$this->validation_errors = $errors;
|
51 |
|
52 |
-
if
|
53 |
-
|
|
|
|
|
54 |
}
|
55 |
|
56 |
-
|
57 |
-
return;
|
58 |
}
|
59 |
|
60 |
/**
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
{
|
69 |
-
return $this->output_form(false);
|
70 |
}
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
|
161 |
} else { // form has been submitted
|
162 |
|
163 |
-
$output .= "<p id=\"nsu-signed-up-$formno\" class=\"nsu-signed-up\">". ($text_after_signup) . "</p>";
|
164 |
|
165 |
}
|
166 |
|
167 |
$output .= "\n<!-- / Newsletter Sign-Up -->\n";
|
168 |
|
169 |
-
if($echo) {
|
170 |
-
|
|
|
|
|
171 |
return $output;
|
172 |
|
173 |
}
|
174 |
-
|
175 |
}
|
1 |
<?php
|
2 |
|
3 |
class NSU_Form {
|
4 |
+
|
5 |
private $validation_errors = array();
|
6 |
private $number_of_forms = 0;
|
7 |
private $options = array();
|
8 |
|
9 |
+
public function __construct() {
|
|
|
10 |
// add hooks
|
11 |
+
$options = NSU::instance()->get_options();
|
12 |
$this->options = $options;
|
13 |
|
14 |
// register the shortcode which can be used to output sign-up form
|
15 |
+
add_shortcode( 'newsletter-sign-up-form', array( $this, 'form_shortcode' ) );
|
16 |
+
add_shortcode( 'nsu-form', array( $this, 'form_shortcode' ) );
|
17 |
+
add_shortcode( 'nsu_form', array( $this, 'form_shortcode' ) );
|
18 |
|
19 |
+
if ( isset( $_POST['nsu_submit'] ) ) {
|
20 |
+
add_action( 'init', array( $this, 'submit' ) );
|
21 |
}
|
22 |
}
|
23 |
|
24 |
/**
|
25 |
+
* Check if ANY Newsletter Sign-Up form has been submitted.
|
26 |
+
*/
|
27 |
+
public function submit() {
|
|
|
28 |
|
29 |
+
$opts = $this->options['form'];
|
30 |
+
$errors = array();
|
31 |
|
32 |
+
$email = ( isset( $_POST['nsu_email'] ) ) ? sanitize_text_field( $_POST['nsu_email'] ) : '';
|
33 |
+
$name = ( isset( $_POST['nsu_name'] ) ) ? sanitize_text_field( $_POST['nsu_name'] ) : '';
|
34 |
|
35 |
// has the honeypot been filled?
|
36 |
+
if ( ! empty( $_POST['nsu_robocop'] ) ) {
|
37 |
+
return false;
|
38 |
+
}
|
39 |
|
40 |
+
// if name is required, check it it was given
|
41 |
+
if ( $this->options['mailinglist']['subscribe_with_name'] == 1 && $opts['name_required'] == 1 && empty( $name ) ) {
|
42 |
+
$errors['name-field'] = $opts['text_empty_name'];
|
43 |
}
|
44 |
|
45 |
+
// validate email
|
46 |
+
if ( empty( $email ) ) {
|
47 |
+
$errors['email-field'] = $opts['text_empty_email'];
|
48 |
+
} elseif ( ! is_string( $email ) || ! is_email( $email ) ) {
|
49 |
+
$errors['email-field'] = $opts['text_invalid_email'];
|
50 |
}
|
51 |
|
52 |
+
// store errors as property
|
53 |
$this->validation_errors = $errors;
|
54 |
|
55 |
+
// send request to service if no errors occured
|
56 |
+
if ( count( $this->validation_errors ) == 0 ) {
|
57 |
+
NSU::instance()->send_post_data( $email, $name, 'form' );
|
58 |
+
return true;
|
59 |
}
|
60 |
|
61 |
+
|
62 |
+
return false;
|
63 |
}
|
64 |
|
65 |
/**
|
66 |
+
* The NSU form shortcode function. Calls the output_form method
|
67 |
+
*
|
68 |
+
* @param array $atts Not used
|
69 |
+
* @param string $content Not used
|
70 |
+
*
|
71 |
+
* @return string Form HTML-code
|
72 |
+
*/
|
73 |
+
public function form_shortcode( $atts = null, $content = '' ) {
|
74 |
+
return $this->output_form( false );
|
75 |
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Generate the HTML for a form
|
79 |
+
*
|
80 |
+
* @param boolean $echo Should HTML be echo'ed?
|
81 |
+
*
|
82 |
+
* @return string The generated HTML
|
83 |
+
*/
|
84 |
+
public function output_form( $echo = true ) {
|
85 |
+
|
86 |
+
$errors = $this->validation_errors;
|
87 |
+
$opts = NSU::instance()->get_options();
|
88 |
+
|
89 |
+
$additional_fields = '';
|
90 |
+
$output = "\n<!-- Form by Newsletter Sign-Up v" . NSU_VERSION_NUMBER . " - https://wordpress.org/plugins/newsletter-sign-up/ -->\n";
|
91 |
+
|
92 |
+
$formno = $this->number_of_forms ++;
|
93 |
+
|
94 |
+
/* Set up form variables for API usage or normal form */
|
95 |
+
if ( $opts['mailinglist']['use_api'] == 1 ) {
|
96 |
+
|
97 |
+
/* Using API, send form request to ANY page */
|
98 |
+
$form_action = '';
|
99 |
+
$email_id = 'nsu_email';
|
100 |
+
$name_id = 'nsu_name';
|
101 |
+
|
102 |
+
} else {
|
103 |
+
|
104 |
+
/* Using normal form request, set-up using configuration settings */
|
105 |
+
$form_action = $opts['mailinglist']['form_action'];
|
106 |
+
$email_id = $opts['mailinglist']['email_id'];
|
107 |
+
|
108 |
+
if ( ! empty( $opts['mailinglist']['name_id'] ) ) {
|
109 |
+
$name_id = $opts['mailinglist']['name_id'];
|
110 |
+
}
|
111 |
+
|
112 |
+
}
|
113 |
+
|
114 |
+
/* Set up additional fields */
|
115 |
+
if ( isset( $opts['mailinglist']['extra_data'] ) && is_array( $opts['mailinglist']['extra_data'] ) ) {
|
116 |
+
|
117 |
+
foreach ( $opts['mailinglist']['extra_data'] as $ed ) {
|
118 |
+
|
119 |
+
if ( $ed['value'] === '%%NAME%%' ) {
|
120 |
+
continue;
|
121 |
+
}
|
122 |
+
|
123 |
+
$ed['value'] = str_replace( "%%IP%%", $_SERVER['REMOTE_ADDR'], $ed['value'] );
|
124 |
+
$additional_fields .= "<input type=\"hidden\" name=\"{$ed['name']}\" value=\"{$ed['value']}\" />";
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
$email_label = __( $opts['form']['email_label'], 'nsu' );
|
129 |
+
$name_label = __( $opts['form']['name_label'], 'nsu' );
|
130 |
+
|
131 |
+
if ( $opts['form']['use_html5'] ) {
|
132 |
+
$email_type = 'email';
|
133 |
+
$email_atts = 'placeholder="' . esc_attr( $opts['form']['email_default_value'] ) . '" required';
|
134 |
+
$name_atts = 'placeholder="' . esc_attr( $opts['form']['name_default_value'] ) . '" ';
|
135 |
+
|
136 |
+
if ( $opts['form']['name_required'] ) {
|
137 |
+
$name_atts .= 'required ';
|
138 |
+
}
|
139 |
+
|
140 |
+
} else {
|
141 |
+
$email_type = 'text';
|
142 |
+
$email_value = $opts['form']['email_default_value'];
|
143 |
+
$email_atts = 'value="' . esc_attr( $email_value ) . '"';
|
144 |
+
$name_value = $opts['form']['name_default_value'];
|
145 |
+
$name_atts = 'value="' . esc_attr( $name_value ) . '"';
|
146 |
+
}
|
147 |
+
|
148 |
+
$submit_button = $opts['form']['submit_button'];
|
149 |
+
|
150 |
+
$text_after_signup = $opts['form']['text_after_signup'];
|
151 |
+
$text_after_signup = ( $opts['form']['wpautop'] == 1 ) ? wpautop( wptexturize( $text_after_signup ) ) : $text_after_signup;
|
152 |
+
|
153 |
+
|
154 |
+
// check if form was not submitted or contains error
|
155 |
+
if ( ! isset( $_POST['nsu_submit'] ) || count( $errors ) > 0 ) {
|
156 |
+
|
157 |
+
|
158 |
+
$output .= '<form class="nsu-form" id="nsu-form-' . esc_attr( $formno ) .'" action="' . esc_attr( $form_action ) . '" method="post">';
|
159 |
+
|
160 |
+
if ( $opts['mailinglist']['subscribe_with_name'] == 1 ) {
|
161 |
+
$output .= '<p><label for="nsu-name-'. esc_attr( $formno ) . '">'. esc_html( $name_label ) . '</label>';
|
162 |
+
$output .= '<input class="nsu-field" id="nsu-name-"' . $formno .'" type="text" name="'. esc_attr( $name_id ) .'" ' . $name_atts;
|
163 |
+
|
164 |
+
if ( ! $opts['form']['use_html5'] ) {
|
165 |
+
$output .= "onblur=\"if(!this.value) this.value = '$name_value';\" onfocus=\"if(this.value == '$name_value') this.value=''\" ";
|
166 |
+
}
|
167 |
+
|
168 |
+
$output .= "/>";
|
169 |
+
|
170 |
+
if ( isset( $errors['name-field'] ) ) {
|
171 |
+
$output .= '<span class="nsu-error error notice">' . $errors['name-field'] . '</span>';
|
172 |
+
}
|
173 |
+
$output .= "</p>";
|
174 |
+
}
|
175 |
+
|
176 |
+
$output .= "<p><label for=\"nsu-email-$formno\">$email_label</label><input class=\"nsu-field\" id=\"nsu-email-$formno\" type=\"$email_type\" name=\"$email_id\" $email_atts ";
|
177 |
+
if ( ! $opts['form']['use_html5'] ) {
|
178 |
+
$output .= "onblur=\"if(!this.value) this.value = '$email_value';\" onfocus=\"if(this.value == '$email_value') this.value = ''\" ";
|
179 |
+
}
|
180 |
+
$output .= "/>";
|
181 |
+
if ( isset( $errors['email-field'] ) ) {
|
182 |
+
$output .= '<span class="nsu-error error notice">' . $errors['email-field'] . '</span>';
|
183 |
+
}
|
184 |
+
$output .= "</p>";
|
185 |
+
$output .= $additional_fields;
|
186 |
+
$output .= '<textarea name="nsu_robocop" style="display: none;"></textarea>';
|
187 |
+
$output .= "<p><input type=\"submit\" id=\"nsu-submit-$formno\" class=\"nsu-submit\" name=\"nsu_submit\" value=\"$submit_button\" /></p>";
|
188 |
+
$output .= "</form>";
|
189 |
|
190 |
} else { // form has been submitted
|
191 |
|
192 |
+
$output .= "<p id=\"nsu-signed-up-$formno\" class=\"nsu-signed-up\">" . ( $text_after_signup ) . "</p>";
|
193 |
|
194 |
}
|
195 |
|
196 |
$output .= "\n<!-- / Newsletter Sign-Up -->\n";
|
197 |
|
198 |
+
if ( $echo ) {
|
199 |
+
echo $output;
|
200 |
+
}
|
201 |
+
|
202 |
return $output;
|
203 |
|
204 |
}
|
205 |
+
|
206 |
}
|
includes/NewsletterSignUpWidget.php
CHANGED
File without changes
|
includes/index.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// prevent directory listing
|
3 |
+
|
4 |
+
header( 'Status: 403 Forbidden' );
|
5 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
6 |
+
exit;
|
includes/views/checkbox_settings.php
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
<div class="wrap" id="nsu-admin">
|
2 |
|
3 |
<?php include_once NSU_PLUGIN_DIR . 'includes/views/parts/navigation.php'; ?>
|
@@ -37,7 +38,7 @@
|
|
37 |
<tr valign="top"><th scope="row">Where to show the sign-up checkbox?</th>
|
38 |
<td>
|
39 |
<?php foreach($this->get_checkbox_compatible_plugins() as $code => $name) { ?>
|
40 |
-
<input type="checkbox" id="add_to_<?php echo $code; ?>" name="nsu_checkbox[add_to_<?php echo $code; ?>]" value="1" <?php checked($opts['add_to_'.$code], '1'); ?> /> <label for="add_to_<?php echo $code; ?>"><?php echo $name; ?></label>
|
41 |
<?php } ?>
|
42 |
</td>
|
43 |
</tr>
|
1 |
+
<?php defined( 'ABSPATH' ) or exit; ?>
|
2 |
<div class="wrap" id="nsu-admin">
|
3 |
|
4 |
<?php include_once NSU_PLUGIN_DIR . 'includes/views/parts/navigation.php'; ?>
|
38 |
<tr valign="top"><th scope="row">Where to show the sign-up checkbox?</th>
|
39 |
<td>
|
40 |
<?php foreach($this->get_checkbox_compatible_plugins() as $code => $name) { ?>
|
41 |
+
<input type="checkbox" id="add_to_<?php echo $code; ?>" name="nsu_checkbox[add_to_<?php echo esc_attr( $code ); ?>]" value="1" <?php checked($opts['add_to_'.$code], '1'); ?> /> <label for="add_to_<?php echo $code; ?>"><?php echo $name; ?></label>
|
42 |
<?php } ?>
|
43 |
</td>
|
44 |
</tr>
|
includes/views/config_helper.php
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
<div class="wrap" id="nsu-admin">
|
2 |
|
3 |
|
@@ -8,7 +9,7 @@
|
|
8 |
|
9 |
<div id="nsu-main">
|
10 |
|
11 |
-
<?php if(isset($result) && !is_array($result)) { ?>
|
12 |
<div id="message" class="notice updated"><p>Oops, I couldn't make any sense of that. Are you sure you submitted a form snippet?</p></div>
|
13 |
<?php } ?>
|
14 |
|
@@ -36,8 +37,8 @@
|
|
36 |
</tr>
|
37 |
<?php foreach($result['additional_data'] as $data) { ?>
|
38 |
<tr valign="top">
|
39 |
-
<td><?php echo $data[0]; ?></
|
40 |
-
<td><?php echo $data[1]; ?></td>
|
41 |
</tr>
|
42 |
<?php } ?>
|
43 |
<?php } ?>
|
@@ -48,7 +49,7 @@
|
|
48 |
configure Newsletter Sign-up.</p>
|
49 |
|
50 |
<p>The form code below is a stripped down version of your sign-up form which will make it easier for you to extract the right values. Please also use this form when asking for support.</p>
|
51 |
-
<textarea class="widefat" rows="10"><?php echo $result['simpler_form']; ?></textarea>
|
52 |
|
53 |
<?php } else { ?>
|
54 |
|
1 |
+
<?php defined( 'ABSPATH' ) or exit; ?>
|
2 |
<div class="wrap" id="nsu-admin">
|
3 |
|
4 |
|
9 |
|
10 |
<div id="nsu-main">
|
11 |
|
12 |
+
<?php if( isset( $result ) && ! is_array( $result ) ) { ?>
|
13 |
<div id="message" class="notice updated"><p>Oops, I couldn't make any sense of that. Are you sure you submitted a form snippet?</p></div>
|
14 |
<?php } ?>
|
15 |
|
37 |
</tr>
|
38 |
<?php foreach($result['additional_data'] as $data) { ?>
|
39 |
<tr valign="top">
|
40 |
+
<td><?php echo esc_html( $data[0] ); ?></td>
|
41 |
+
<td><?php echo esc_html( $data[1] ); ?></td>
|
42 |
</tr>
|
43 |
<?php } ?>
|
44 |
<?php } ?>
|
49 |
configure Newsletter Sign-up.</p>
|
50 |
|
51 |
<p>The form code below is a stripped down version of your sign-up form which will make it easier for you to extract the right values. Please also use this form when asking for support.</p>
|
52 |
+
<textarea class="widefat" rows="10"><?php echo esc_textarea( $result['simpler_form'] ); ?></textarea>
|
53 |
|
54 |
<?php } else { ?>
|
55 |
|
includes/views/dashboard.php
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
<div class="wrap" id="nsu-admin">
|
2 |
|
3 |
<?php include_once NSU_PLUGIN_DIR . 'includes/views/parts/navigation.php'; ?>
|
@@ -42,7 +43,10 @@
|
|
42 |
<td><input class="widefat" type="text" id="ns_form_action" name="nsu_mailinglist[form_action]" placeholder="Example: http://newsletter-service.com?action=subscribe&id=123" value="<?php echo esc_attr($opts['form_action']); ?>" /></td>
|
43 |
</tr>
|
44 |
<tr valign="top">
|
45 |
-
<th scope="row">
|
|
|
|
|
|
|
46 |
<td><input class="widefat" type="text" name="nsu_mailinglist[email_id]" placeholder="Example: EMAIL" value="<?php echo esc_attr($opts['email_id']); ?>"/></td>
|
47 |
</tr>
|
48 |
</tbody>
|
@@ -52,7 +56,10 @@
|
|
52 |
<td><input type="checkbox" id="subscribe_with_name" name="nsu_mailinglist[subscribe_with_name]" value="1" <?php checked($opts['subscribe_with_name'], 1); ?> /></td>
|
53 |
</tr>
|
54 |
<tr class="name_dependent" valign="top" <?php if($opts['subscribe_with_name'] != 1) echo 'style="display:none;"'; ?>>
|
55 |
-
<th scope="row">
|
|
|
|
|
|
|
56 |
<td><input class="widefat" id="ns_name_id" type="text" name="nsu_mailinglist[name_id]" placeholder="Example: NAME" value="<?php echo esc_attr($opts['name_id']); ?>" /></td>
|
57 |
</tr>
|
58 |
</tbody>
|
@@ -73,8 +80,8 @@
|
|
73 |
foreach ($opts['extra_data'] as $key => $value) :
|
74 |
?>
|
75 |
<tr valign="top">
|
76 |
-
<td><input class="widefat" type="text" name="nsu_mailinglist[extra_data][<?php echo $key; ?>][name]" value="<?php echo $value['name']; ?>" /></td>
|
77 |
-
<td><input class="widefat" type="text" name="nsu_mailinglist[extra_data][<?php echo $key; ?>][value]" value="<?php echo $value['value']; ?>" /></td>
|
78 |
</tr>
|
79 |
<?php
|
80 |
$last_key = $key + 1;
|
@@ -82,8 +89,8 @@
|
|
82 |
endif;
|
83 |
?>
|
84 |
<tr valign="top">
|
85 |
-
<td><input class="widefat" type="text" name="nsu_mailinglist[extra_data][<?php echo $last_key; ?>][name]" placeholder="Hidden field name" value="" /></td>
|
86 |
-
<td><input class="widefat" type="text" name="nsu_mailinglist[extra_data][<?php echo $last_key; ?>][value]" placeholder="Hidden field value" value="" /></td>
|
87 |
</tr>
|
88 |
</table>
|
89 |
|
@@ -94,7 +101,7 @@
|
|
94 |
|
95 |
</form>
|
96 |
<p>
|
97 |
-
<em>Having trouble finding the right configuration settings? Try the <a href="admin.php?page=newsletter-sign-up
|
98 |
</p>
|
99 |
|
100 |
</div>
|
1 |
+
<?php defined( 'ABSPATH' ) or exit; ?>
|
2 |
<div class="wrap" id="nsu-admin">
|
3 |
|
4 |
<?php include_once NSU_PLUGIN_DIR . 'includes/views/parts/navigation.php'; ?>
|
43 |
<td><input class="widefat" type="text" id="ns_form_action" name="nsu_mailinglist[form_action]" placeholder="Example: http://newsletter-service.com?action=subscribe&id=123" value="<?php echo esc_attr($opts['form_action']); ?>" /></td>
|
44 |
</tr>
|
45 |
<tr valign="top">
|
46 |
+
<th scope="row">
|
47 |
+
E-mail identifier
|
48 |
+
<small class="help">name attribute of input field for the emailadress</small>
|
49 |
+
</th>
|
50 |
<td><input class="widefat" type="text" name="nsu_mailinglist[email_id]" placeholder="Example: EMAIL" value="<?php echo esc_attr($opts['email_id']); ?>"/></td>
|
51 |
</tr>
|
52 |
</tbody>
|
56 |
<td><input type="checkbox" id="subscribe_with_name" name="nsu_mailinglist[subscribe_with_name]" value="1" <?php checked($opts['subscribe_with_name'], 1); ?> /></td>
|
57 |
</tr>
|
58 |
<tr class="name_dependent" valign="top" <?php if($opts['subscribe_with_name'] != 1) echo 'style="display:none;"'; ?>>
|
59 |
+
<th scope="row">
|
60 |
+
Name identifier
|
61 |
+
<small class="help">name attribute of input field that holds the name</small>
|
62 |
+
</th>
|
63 |
<td><input class="widefat" id="ns_name_id" type="text" name="nsu_mailinglist[name_id]" placeholder="Example: NAME" value="<?php echo esc_attr($opts['name_id']); ?>" /></td>
|
64 |
</tr>
|
65 |
</tbody>
|
80 |
foreach ($opts['extra_data'] as $key => $value) :
|
81 |
?>
|
82 |
<tr valign="top">
|
83 |
+
<td><input class="widefat" type="text" name="nsu_mailinglist[extra_data][<?php echo esc_attr( $key ); ?>][name]" value="<?php echo esc_attr( $value['name'] ); ?>" /></td>
|
84 |
+
<td><input class="widefat" type="text" name="nsu_mailinglist[extra_data][<?php echo esc_attr( $key ); ?>][value]" value="<?php echo esc_attr( $value['value'] ); ?>" /></td>
|
85 |
</tr>
|
86 |
<?php
|
87 |
$last_key = $key + 1;
|
89 |
endif;
|
90 |
?>
|
91 |
<tr valign="top">
|
92 |
+
<td><input class="widefat" type="text" name="nsu_mailinglist[extra_data][<?php echo esc_attr( $last_key ); ?>][name]" placeholder="Hidden field name" value="" /></td>
|
93 |
+
<td><input class="widefat" type="text" name="nsu_mailinglist[extra_data][<?php echo esc_attr( $last_key ); ?>][value]" placeholder="Hidden field value" value="" /></td>
|
94 |
</tr>
|
95 |
</table>
|
96 |
|
101 |
|
102 |
</form>
|
103 |
<p>
|
104 |
+
<em>Having trouble finding the right configuration settings? Try the <a href="<?php echo admin_url( 'admin.php?page=newsletter-sign-up-config-helper'); ?>">configuration extractor</a>.</em>
|
105 |
</p>
|
106 |
|
107 |
</div>
|
includes/views/form_settings.php
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
<div class="wrap" id="nsu-admin">
|
2 |
|
3 |
<?php include_once 'parts/navigation.php'; ?>
|
1 |
+
<?php defined( 'ABSPATH' ) or exit; ?>
|
2 |
<div class="wrap" id="nsu-admin">
|
3 |
|
4 |
<?php include_once 'parts/navigation.php'; ?>
|
includes/views/index.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// prevent directory listing
|
3 |
+
|
4 |
+
header( 'Status: 403 Forbidden' );
|
5 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
6 |
+
exit;
|
includes/views/parts/index.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// prevent directory listing
|
3 |
+
|
4 |
+
header( 'Status: 403 Forbidden' );
|
5 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
6 |
+
exit;
|
includes/views/parts/navigation.php
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
|
2 |
-
|
3 |
-
|
4 |
-
<a href="?page=newsletter-sign-up
|
5 |
-
<a href="?page=newsletter-sign-up-
|
6 |
-
<a href="?page=newsletter-sign-up-
|
|
|
7 |
</h2>
|
1 |
|
2 |
+
<?php defined( 'ABSPATH' ) or exit; ?>
|
3 |
+
<h2 class="nav-tab-wrapper">
|
4 |
+
<a href="?page=newsletter-sign-up" class="nav-tab <?php echo ($tab == 'mailinglist-settings') ? 'nav-tab-active' : ''; ?>">Mailinglist Settings</a>
|
5 |
+
<a href="?page=newsletter-sign-up-checkbox-settings" class="nav-tab <?php echo ($tab === 'checkbox-settings') ? 'nav-tab-active' : ''; ?>">Checkbox Settings</a>
|
6 |
+
<a href="?page=newsletter-sign-up-form-settings" class="nav-tab <?php echo ($tab === 'form-settings') ? 'nav-tab-active' : ''; ?>">Form Settings</a>
|
7 |
+
<a href="?page=newsletter-sign-up-config-helper" class="nav-tab <?php echo ($tab === 'config-helper') ? 'nav-tab-active' : ''; ?>">Config Helper</a>
|
8 |
</h2>
|
includes/views/parts/rows-aweber.php
CHANGED
@@ -1,5 +1,8 @@
|
|
|
|
1 |
<tr valign="top">
|
2 |
<th scope="row"><label for="aweber_list_name" Aweber list name</th>
|
3 |
-
<td
|
4 |
-
|
5 |
-
|
|
|
|
1 |
+
<?php defined( 'ABSPATH' ) or exit; ?>
|
2 |
<tr valign="top">
|
3 |
<th scope="row"><label for="aweber_list_name" Aweber list name</th>
|
4 |
+
<td>
|
5 |
+
<input id="aweber_list_name" class="widefat" type="text" name="nsu_mailinglist[aweber_list_name]" value="<?php if ( isset( $opts['aweber_list_name'] ) ) {
|
6 |
+
echo esc_attr( $opts['aweber_list_name'] );
|
7 |
+
} ?>" /></td>
|
8 |
+
</tr>
|
includes/views/parts/rows-mailchimp.php
CHANGED
@@ -1,37 +1,78 @@
|
|
|
|
1 |
<tr valign="top">
|
2 |
-
|
|
|
|
|
|
|
|
|
3 |
</tr>
|
4 |
|
5 |
<tr valign="top">
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
</tr>
|
9 |
|
10 |
-
<tbody class="api_rows" <?php if (!isset($opts['use_api']) || $opts['use_api'] != 1)
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
</tbody>
|
1 |
+
<?php defined( 'ABSPATH' ) or exit; ?>
|
2 |
<tr valign="top">
|
3 |
+
<th colspan="2" style="background: lightskyblue; padding: 20px;">
|
4 |
+
As you're using MailChimp, I highly recommend switching to my newer plugin:
|
5 |
+
<a href="https://wordpress.org/plugins/mailchimp-for-wp/">MailChimp for WordPress</a>.
|
6 |
+
You'll be up and running (again) in just a few minutes.
|
7 |
+
</th>
|
8 |
</tr>
|
9 |
|
10 |
<tr valign="top">
|
11 |
+
<th scope="row">
|
12 |
+
<label for="use_api">Use MailChimp API?</label>
|
13 |
+
<small class="help">(recommended)</small>
|
14 |
+
</th>
|
15 |
+
<td>
|
16 |
+
<input type="checkbox" id="use_api" name="nsu_mailinglist[use_api]" value="1"<?php if ( isset( $opts['use_api'] ) && $opts['use_api'] == '1' ) {
|
17 |
+
echo ' checked="checked"';
|
18 |
+
} ?> /></td>
|
19 |
</tr>
|
20 |
|
21 |
+
<tbody class="api_rows" <?php if ( ! isset( $opts['use_api'] ) || $opts['use_api'] != 1 ) {
|
22 |
+
echo ' style="display:none" ';
|
23 |
+
} ?>>
|
24 |
+
<tr valign="top">
|
25 |
+
<th scope="row">MailChimp API Key <a target="_blank" href="http://admin.mailchimp.com/account/api">(?)</a></th>
|
26 |
+
<td>
|
27 |
+
<input class="widefat" type="text" id="mc_api_key" name="nsu_mailinglist[mc_api_key]" value="<?php if ( isset( $opts['mc_api_key'] ) ) {
|
28 |
+
echo esc_attr( $opts['mc_api_key'] );
|
29 |
+
} ?>" /></td>
|
30 |
+
</tr>
|
31 |
+
<tr valign="top">
|
32 |
+
<th scope="row">MailChimp List ID
|
33 |
+
<a href="http://www.mailchimp.com/kb/article/how-can-i-find-my-list-id" target="_blank">(?)</a></th>
|
34 |
+
<td>
|
35 |
+
<input class="widefat" type="text" name="nsu_mailinglist[mc_list_id]" value="<?php if ( isset( $opts['mc_list_id'] ) ) {
|
36 |
+
echo esc_attr( $opts['mc_list_id'] );
|
37 |
+
} ?>"; />
|
38 |
+
</td>
|
39 |
+
</tr>
|
40 |
+
<tr valign="top">
|
41 |
+
<th scope="row">
|
42 |
+
<label title="Prevents your users from having to confirm their emailaddress. Make sure you comply with the CAN SPAM act." for="mc_prevent_double_optin">Prevent double opt-in?</label>
|
43 |
+
</th>
|
44 |
+
<td>
|
45 |
+
<input type="checkbox" id="mc_prevent_double_optin" name="nsu_mailinglist[mc_no_double_optin]" value="1" <?php if ( isset( $opts['mc_no_double_optin'] ) ) {
|
46 |
+
checked( $opts['mc_no_double_optin'], 1 );
|
47 |
+
} ?> /></td>
|
48 |
+
</tr>
|
49 |
+
<tr valign="top">
|
50 |
+
<th scope="row"><label for="mc_use_groupings">Add to group(s)? </label></th>
|
51 |
+
<td>
|
52 |
+
<input type="checkbox" id="mc_use_groupings" name="nsu_mailinglist[mc_use_groupings]" value="1" <?php if ( isset( $opts['mc_use_groupings'] ) ) {
|
53 |
+
checked( $opts['mc_use_groupings'], 1 );
|
54 |
+
} ?> /></td>
|
55 |
+
</tr>
|
56 |
+
<tbody class="mc_groupings_rows" <?php if ( ! isset( $opts['mc_use_groupings'] ) || $opts['mc_use_groupings'] != 1 ) {
|
57 |
+
echo ' style="display:none" ';
|
58 |
+
} ?>>
|
59 |
+
<tr valign="top">
|
60 |
+
<th scope="row">Grouping name</th>
|
61 |
+
<td>
|
62 |
+
<input class="widefat" type="text" id="mc_groupings_name" name="nsu_mailinglist[mc_groupings_name]" value="<?php if ( isset( $opts['mc_groupings_name'] ) ) {
|
63 |
+
echo esc_attr( $opts['mc_groupings_name'] );
|
64 |
+
} ?>" /></td>
|
65 |
+
</tr>
|
66 |
+
<tr valign="top">
|
67 |
+
<th scope="row">
|
68 |
+
Groups
|
69 |
+
<small class="help">(comma delimited list of interest groups to add to)</small>
|
70 |
+
</th>
|
71 |
+
<td>
|
72 |
+
<input class="widefat" type="text" name="nsu_mailinglist[mc_groupings_groups]" placeholder="Example: Group 1,Group 2,Group 3" value="<?php if ( isset( $opts['mc_groupings_groups'] ) ) {
|
73 |
+
echo esc_attr( $opts['mc_groupings_groups'] );
|
74 |
+
} ?>"; />
|
75 |
+
</td>
|
76 |
+
</tr>
|
77 |
+
</tbody>
|
78 |
</tbody>
|
includes/views/parts/rows-phplist.php
CHANGED
@@ -1,5 +1,10 @@
|
|
1 |
-
<?php
|
|
|
|
|
|
|
2 |
<tr valign="top">
|
3 |
-
|
4 |
-
|
|
|
|
|
5 |
</tr>
|
1 |
+
<?php defined( 'ABSPATH' ) or exit; ?>
|
2 |
+
<?php if ( ! isset( $opts['phplist_list_id'] ) ) {
|
3 |
+
$opts['phplist_list_id'] = 1;
|
4 |
+
} ?>
|
5 |
<tr valign="top">
|
6 |
+
<th scope="row">PHPList list ID</th>
|
7 |
+
<td>
|
8 |
+
<input type="text" class="widefat" name="nsu_mailinglist[phplist_list_id]" value="<?php echo esc_attr( $opts['phplist_list_id'] ); ?>" />
|
9 |
+
</td>
|
10 |
</tr>
|
includes/views/parts/rows-ymlp.php
CHANGED
@@ -1,17 +1,37 @@
|
|
|
|
1 |
<tr valign="top">
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
</tr>
|
5 |
-
<tbody class="api_rows"<?php if (!isset($opts['use_api']) || $opts['use_api'] != 1) echo ' style="display:none" '; ?>>
|
6 |
-
<tr valign="top">
|
7 |
-
<th scope="row">YMLP API Key <a target="_blank" href="http://www.ymlp.com/app/api.php">(?)</a></th>
|
8 |
-
<td><input class="widefat" type="text" id="ymlp_api_key" name="nsu_mailinglist[ymlp_api_key]" value="<?php if (isset($opts['ymlp_api_key'])) echo esc_attr($opts['ymlp_api_key']); ?>" /></td>
|
9 |
-
</tr>
|
10 |
-
<tr valign="top">
|
11 |
-
<th scope="row">YMLP Username</th>
|
12 |
-
<td><input class="widefat" type="text" id="ymlp_username" name="nsu_mailinglist[ymlp_username]" value="<?php if (isset($opts['ymlp_username'])) echo esc_attr($opts['ymlp_username']); ?>" /></td>
|
13 |
-
</tr>
|
14 |
-
<tr valign="top"><th scope="row">YMLP GroupID<br /><small>(starts at 1, check URL when 'viewing all contacts' in certain group)</small></th>
|
15 |
-
<td><input class="widefat" type="text" id="ymlp_groupid" name="nsu_mailinglist[ymlp_groupid]" value="<?php if (isset($opts['ymlp_groupid'])) echo esc_attr($opts['ymlp_groupid']); ?>" /></td>
|
16 |
-
</tr>
|
17 |
</tbody>
|
1 |
+
<?php defined( 'ABSPATH' ) or exit; ?>
|
2 |
<tr valign="top">
|
3 |
+
<th scope="row"><label for="use_api">Use the YMLP API?<br />
|
4 |
+
<small>(recommended)</small>
|
5 |
+
</label></th>
|
6 |
+
<td>
|
7 |
+
<input type="checkbox" id="use_api" name="nsu_mailinglist[use_api]" value="1" <?php if ( isset( $opts['use_api'] ) ) {
|
8 |
+
checked( $opts['use_api'], 1 );
|
9 |
+
} ?> /></td>
|
10 |
+
</tr>
|
11 |
+
<tbody class="api_rows"<?php if ( ! isset( $opts['use_api'] ) || $opts['use_api'] != 1 ) {
|
12 |
+
echo ' style="display:none" ';
|
13 |
+
} ?>>
|
14 |
+
<tr valign="top">
|
15 |
+
<th scope="row">YMLP API Key <a target="_blank" href="http://www.ymlp.com/app/api.php">(?)</a></th>
|
16 |
+
<td>
|
17 |
+
<input class="widefat" type="text" id="ymlp_api_key" name="nsu_mailinglist[ymlp_api_key]" value="<?php if ( isset( $opts['ymlp_api_key'] ) ) {
|
18 |
+
echo esc_attr( $opts['ymlp_api_key'] );
|
19 |
+
} ?>" /></td>
|
20 |
+
</tr>
|
21 |
+
<tr valign="top">
|
22 |
+
<th scope="row">YMLP Username</th>
|
23 |
+
<td>
|
24 |
+
<input class="widefat" type="text" id="ymlp_username" name="nsu_mailinglist[ymlp_username]" value="<?php if ( isset( $opts['ymlp_username'] ) ) {
|
25 |
+
echo esc_attr( $opts['ymlp_username'] );
|
26 |
+
} ?>" /></td>
|
27 |
+
</tr>
|
28 |
+
<tr valign="top">
|
29 |
+
<th scope="row">YMLP GroupID<br />
|
30 |
+
<small class="help">(starts at 1, check URL when 'viewing all contacts' in certain group)</small>
|
31 |
+
</th>
|
32 |
+
<td>
|
33 |
+
<input class="widefat" type="text" id="ymlp_groupid" name="nsu_mailinglist[ymlp_groupid]" value="<?php if ( isset( $opts['ymlp_groupid'] ) ) {
|
34 |
+
echo esc_attr( $opts['ymlp_groupid'] );
|
35 |
+
} ?>" /></td>
|
36 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
</tbody>
|
includes/views/parts/sidebar.php
CHANGED
@@ -18,28 +18,28 @@
|
|
18 |
|
19 |
<p>Alternatively, you can: </p>
|
20 |
<ul class="ul-square">
|
21 |
-
<li><a href="
|
22 |
-
<li><a href="
|
23 |
-
<li><a href="
|
24 |
-
<li><a href="
|
25 |
</ul>
|
26 |
</div>
|
27 |
|
28 |
<div>
|
29 |
<h3>Other WordPress plugins by Danny</h3>
|
30 |
<ul class="ul-square">
|
31 |
-
<li class="has-icon mc4wp"><a href="http://
|
32 |
-
<li><a href="
|
33 |
-
<li
|
34 |
-
|
35 |
-
<li class="has-icon dvk-email"><a href="
|
36 |
-
<li class="has-icon dvk-twitter">
|
37 |
</ul>
|
38 |
</div>
|
39 |
|
40 |
<div>
|
41 |
<h3>Need support?</h3>
|
42 |
-
<p>Please use the <a href="
|
43 |
</div>
|
44 |
|
45 |
</div>
|
18 |
|
19 |
<p>Alternatively, you can: </p>
|
20 |
<ul class="ul-square">
|
21 |
+
<li><a href="https://wordpress.org/support/view/plugin-reviews/newsletter-sign-up?rate=5#postform" target="_blank">Give a ★★★★★ rating on WordPress.org</a></li>
|
22 |
+
<li><a href="https://dannyvankooten.com/wordpress-plugins/newsletter-sign-up/" target="_blank">Blog about it and link to the plugin page</a></li>
|
23 |
+
<li><a href="https://twitter.com/?status=I%27m%20using%20the%20Newsletter%20Sign-Up%20%23WordPress%20plugin%20by%20%40DannyvanKooten%20on%20my%20website.%20Love%20it!%20http%3A%2F%2Fwordpress.org%2Fplugins%2Fnewsletter-sign-up%2F" target="_blank">Tweet about Newsletter Sign-Up</a></li>
|
24 |
+
<li><a href="https://wordpress.org/plugins/newsletter-sign-up/#compatibility">Vote "works" on the Wordpress.org plugin page</a>
|
25 |
</ul>
|
26 |
</div>
|
27 |
|
28 |
<div>
|
29 |
<h3>Other WordPress plugins by Danny</h3>
|
30 |
<ul class="ul-square">
|
31 |
+
<li class="has-icon mc4wp"><a href="http://wordpress.org/plugins/mailchimp-for-wp/">MailChimp for WordPress</a></li>
|
32 |
+
<li><a href="https://wordpress.org/plugins/scroll-triggered-boxes/">Scroll Triggered Boxes</a></li>
|
33 |
+
<li><a href="https://wordpress.org/plugins/dvk-social-sharing/">Social Sharing</a></li>
|
34 |
+
<li class="has-icon rfb"><a href="https://wordpress.org/plugins/recent-facebook-posts/">Recent Facebook Posts</a></li>
|
35 |
+
<li class="has-icon dvk-email"><a href="https://dannyvankooten.com/newsletter/">Subscribe to Danny's newsletter</a> by e-mail</li>
|
36 |
+
<li class="has-icon dvk-twitter">Follow <a href="https://twitter.com/dannyvankooten">@Dannyvankooten</a> on Twitter</li>
|
37 |
</ul>
|
38 |
</div>
|
39 |
|
40 |
<div>
|
41 |
<h3>Need support?</h3>
|
42 |
+
<p>Please use the <a href="https://wordpress.org/support/plugin/newsletter-sign-up">WordPress.org support forums for Newsletter Sign-Up</a>.</p>
|
43 |
</div>
|
44 |
|
45 |
</div>
|
index.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// prevent directory listing
|
3 |
+
|
4 |
+
header( 'Status: 403 Forbidden' );
|
5 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
6 |
+
exit;
|
newsletter-sign-up.php
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Newsletter Sign-Up
|
4 |
-
Plugin URI:
|
5 |
Description: Adds various ways for your visitors to sign-up to your mailinglist (checkbox, widget, form)
|
6 |
-
Version: 2.0.
|
7 |
Author: Danny van Kooten
|
8 |
-
Author URI:
|
9 |
License: GPL2
|
10 |
*/
|
11 |
|
12 |
-
/* Copyright 2010 Danny van Kooten
|
13 |
|
14 |
This program is free software; you can redistribute it and/or modify
|
15 |
it under the terms of the GNU General Public License, version 2, as
|
@@ -25,7 +25,11 @@ License: GPL2
|
|
25 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
26 |
*/
|
27 |
|
28 |
-
|
|
|
|
|
|
|
|
|
29 |
define("NSU_PLUGIN_DIR", plugin_dir_path(__FILE__));
|
30 |
|
31 |
require_once NSU_PLUGIN_DIR . 'includes/NSU.php';
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Newsletter Sign-Up
|
4 |
+
Plugin URI: https://dannyvankooten.com/wordpress-plugins/newsletter-sign-up/
|
5 |
Description: Adds various ways for your visitors to sign-up to your mailinglist (checkbox, widget, form)
|
6 |
+
Version: 2.0.4
|
7 |
Author: Danny van Kooten
|
8 |
+
Author URI: https://dannyvankooten.com
|
9 |
License: GPL2
|
10 |
*/
|
11 |
|
12 |
+
/* Copyright 2010-2014 Danny van Kooten (email: hi@dannyvankooten.com)
|
13 |
|
14 |
This program is free software; you can redistribute it and/or modify
|
15 |
it under the terms of the GNU General Public License, version 2, as
|
25 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
26 |
*/
|
27 |
|
28 |
+
if( ! defined( 'ABSPATH' ) ) {
|
29 |
+
exit;
|
30 |
+
}
|
31 |
+
|
32 |
+
define('NSU_VERSION_NUMBER', "2.0.4");
|
33 |
define("NSU_PLUGIN_DIR", plugin_dir_path(__FILE__));
|
34 |
|
35 |
require_once NSU_PLUGIN_DIR . 'includes/NSU.php';
|
readme.txt
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
-
===
|
2 |
Contributors: DvanKooten
|
3 |
-
Donate link:
|
4 |
Tags: newsletter,sign-up,mailchimp,aweber,newsletter signup,checkbox,ymlp,email,phplist,icontact,mailinglist,checkbox,form widget,widget,newsletter widget,subscribe widget,form shortcode,mailchimp api
|
5 |
-
Requires at least: 3.
|
6 |
-
Tested up to:
|
7 |
-
Stable tag: 2.0.
|
8 |
License: GPL2
|
9 |
|
10 |
-
|
11 |
|
12 |
== Description ==
|
13 |
|
@@ -15,9 +15,12 @@ Ultimate newsletter plugin. Works with 3rd-party newsletter services like Aweber
|
|
15 |
|
16 |
This plugin adds various sign-up methods to your WordPress website, like sign-up checkboxes in your comment form and a sign-up form to show in posts, pages or widget areas.
|
17 |
|
18 |
-
>
|
|
|
|
|
|
|
19 |
|
20 |
-
This plugin works with *almost all* third-party email marketing services including MailChimp, ConstantContact, YMLP, Aweber, iContact, PHPList and Feedblitz. With the right configuration settings, you can make this plugin work with *any* newsletter service around.
|
21 |
|
22 |
**Features:**
|
23 |
|
@@ -31,10 +34,10 @@ This plugin works with *almost all* third-party email marketing services includi
|
|
31 |
|
32 |
**More information**
|
33 |
|
34 |
-
* [MailChimp for WordPress plugin](
|
35 |
-
* [Newsletter Sign-Up for WordPress](
|
36 |
-
* Check out more [WordPress plugins](
|
37 |
-
*
|
38 |
|
39 |
= Sign-up checkboxes =
|
40 |
Most of your commenters will be interested in your newsletter as well. This plugin makes it extremely easie for them to subscribe to your mailinglist. With the sign-up checkbox, all they have to do is check it and the plugin will subscribe them to your mailinglist.
|
@@ -50,7 +53,7 @@ You can set your own messages and even choose to redirect the visitor to a certa
|
|
50 |
|
51 |
1. Upload the contents of newsletter-sign-up.zip to your plugins directory.
|
52 |
1. Activate the plugin
|
53 |
-
1. Specify your newsletter service settings. For more info head over to: [Newsletter Sign-Up for WordPress](
|
54 |
1. That's all. You're done!
|
55 |
|
56 |
== Frequently Asked Questions ==
|
@@ -91,6 +94,11 @@ For more questions and answers go have a look at the [Newsletter Sign-Up](http:/
|
|
91 |
|
92 |
== Changelog ==
|
93 |
|
|
|
|
|
|
|
|
|
|
|
94 |
= 2.0.3 =
|
95 |
* Fixed broken link to settings pages after widget form
|
96 |
* Improved: better stylesheet loading, encouraged browser caching
|
@@ -189,104 +197,4 @@ For more questions and answers go have a look at the [Newsletter Sign-Up](http:/
|
|
189 |
* Added: Added option to set default value for e-mail and name field.
|
190 |