Quick Page/Post Redirect Plugin - Version 5.0

Version Description

  • Added jQuery version check to ensure no problmes with themes forcing older versions of jQuery
  • Added a few warning /info messages to Quick Redirects page.
  • Redirect summary was updated to display Quick Redirects as well as individual redirects. Now it is easier to see at a glance what redirects you have set up.
  • Rewrite of Quick Redirects functions to allow selecting Open in New Window (NW) and rel=nofollow (NF) as long as 'use jQuery' is selected.
  • Added "use jQuery" option on settings page - on by default after upgrade
  • Added jQuery redirect replace, target="_blank", and rel="nofollow" to increase success for additional options (mainly Quick redirects).
  • Changed out WP_PLUGIN_URL for plugins_url() to help resolve errors in redirects for SSL/https
  • Changed the way custom post types are handled.These are now on by default for new users - or users who have not specifically set to off.
  • The ability to turn off the Plugin Meta Box for any post type was added (admin permissions required).
  • Import and Export features were added to allow for backup of existing Quick Redirects, Restoring a backup or adding bulk redirects.
  • Plugin clean-up features were added to completely remove either Page/Post meta data (for regular redirects), Quick Redirects, or both.
  • Several filter and action hooks were added to help users better integrate the plugin into their theme, should they need additional functionality.
  • New FAQs/Help page with items provided by an RSS feed, so we can easily update FAQs when common questions/issues arise.
  • Query String data is now preserved for Quick Redirects (thanks to Jon Wilson for the contribution).
  • Case insensitivity option was added for Quick Redirects (thanks to Brian DiChiara for the contribution).
Download this release

Release Info

Developer prophecy2040
Plugin Icon 128x128 Quick Page/Post Redirect Plugin
Version 5.0
Comparing to
See all releases

Code changes from version 4.2.3 to 5.0

license.txt CHANGED
@@ -1,674 +1,674 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 3, 29 June 2007
3
-
4
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
- Everyone is permitted to copy and distribute verbatim copies
6
- of this license document, but changing it is not allowed.
7
-
8
- Preamble
9
-
10
- The GNU General Public License is a free, copyleft license for
11
- software and other kinds of works.
12
-
13
- The licenses for most software and other practical works are designed
14
- to take away your freedom to share and change the works. By contrast,
15
- the GNU General Public License is intended to guarantee your freedom to
16
- share and change all versions of a program--to make sure it remains free
17
- software for all its users. We, the Free Software Foundation, use the
18
- GNU General Public License for most of our software; it applies also to
19
- any other work released this way by its authors. You can apply it to
20
- your programs, too.
21
-
22
- When we speak of free software, we are referring to freedom, not
23
- price. Our General Public Licenses are designed to make sure that you
24
- have the freedom to distribute copies of free software (and charge for
25
- them if you wish), that you receive source code or can get it if you
26
- want it, that you can change the software or use pieces of it in new
27
- free programs, and that you know you can do these things.
28
-
29
- To protect your rights, we need to prevent others from denying you
30
- these rights or asking you to surrender the rights. Therefore, you have
31
- certain responsibilities if you distribute copies of the software, or if
32
- you modify it: responsibilities to respect the freedom of others.
33
-
34
- For example, if you distribute copies of such a program, whether
35
- gratis or for a fee, you must pass on to the recipients the same
36
- freedoms that you received. You must make sure that they, too, receive
37
- or can get the source code. And you must show them these terms so they
38
- know their rights.
39
-
40
- Developers that use the GNU GPL protect your rights with two steps:
41
- (1) assert copyright on the software, and (2) offer you this License
42
- giving you legal permission to copy, distribute and/or modify it.
43
-
44
- For the developers' and authors' protection, the GPL clearly explains
45
- that there is no warranty for this free software. For both users' and
46
- authors' sake, the GPL requires that modified versions be marked as
47
- changed, so that their problems will not be attributed erroneously to
48
- authors of previous versions.
49
-
50
- Some devices are designed to deny users access to install or run
51
- modified versions of the software inside them, although the manufacturer
52
- can do so. This is fundamentally incompatible with the aim of
53
- protecting users' freedom to change the software. The systematic
54
- pattern of such abuse occurs in the area of products for individuals to
55
- use, which is precisely where it is most unacceptable. Therefore, we
56
- have designed this version of the GPL to prohibit the practice for those
57
- products. If such problems arise substantially in other domains, we
58
- stand ready to extend this provision to those domains in future versions
59
- of the GPL, as needed to protect the freedom of users.
60
-
61
- Finally, every program is threatened constantly by software patents.
62
- States should not allow patents to restrict development and use of
63
- software on general-purpose computers, but in those that do, we wish to
64
- avoid the special danger that patents applied to a free program could
65
- make it effectively proprietary. To prevent this, the GPL assures that
66
- patents cannot be used to render the program non-free.
67
-
68
- The precise terms and conditions for copying, distribution and
69
- modification follow.
70
-
71
- TERMS AND CONDITIONS
72
-
73
- 0. Definitions.
74
-
75
- "This License" refers to version 3 of the GNU General Public License.
76
-
77
- "Copyright" also means copyright-like laws that apply to other kinds of
78
- works, such as semiconductor masks.
79
-
80
- "The Program" refers to any copyrightable work licensed under this
81
- License. Each licensee is addressed as "you". "Licensees" and
82
- "recipients" may be individuals or organizations.
83
-
84
- To "modify" a work means to copy from or adapt all or part of the work
85
- in a fashion requiring copyright permission, other than the making of an
86
- exact copy. The resulting work is called a "modified version" of the
87
- earlier work or a work "based on" the earlier work.
88
-
89
- A "covered work" means either the unmodified Program or a work based
90
- on the Program.
91
-
92
- To "propagate" a work means to do anything with it that, without
93
- permission, would make you directly or secondarily liable for
94
- infringement under applicable copyright law, except executing it on a
95
- computer or modifying a private copy. Propagation includes copying,
96
- distribution (with or without modification), making available to the
97
- public, and in some countries other activities as well.
98
-
99
- To "convey" a work means any kind of propagation that enables other
100
- parties to make or receive copies. Mere interaction with a user through
101
- a computer network, with no transfer of a copy, is not conveying.
102
-
103
- An interactive user interface displays "Appropriate Legal Notices"
104
- to the extent that it includes a convenient and prominently visible
105
- feature that (1) displays an appropriate copyright notice, and (2)
106
- tells the user that there is no warranty for the work (except to the
107
- extent that warranties are provided), that licensees may convey the
108
- work under this License, and how to view a copy of this License. If
109
- the interface presents a list of user commands or options, such as a
110
- menu, a prominent item in the list meets this criterion.
111
-
112
- 1. Source Code.
113
-
114
- The "source code" for a work means the preferred form of the work
115
- for making modifications to it. "Object code" means any non-source
116
- form of a work.
117
-
118
- A "Standard Interface" means an interface that either is an official
119
- standard defined by a recognized standards body, or, in the case of
120
- interfaces specified for a particular programming language, one that
121
- is widely used among developers working in that language.
122
-
123
- The "System Libraries" of an executable work include anything, other
124
- than the work as a whole, that (a) is included in the normal form of
125
- packaging a Major Component, but which is not part of that Major
126
- Component, and (b) serves only to enable use of the work with that
127
- Major Component, or to implement a Standard Interface for which an
128
- implementation is available to the public in source code form. A
129
- "Major Component", in this context, means a major essential component
130
- (kernel, window system, and so on) of the specific operating system
131
- (if any) on which the executable work runs, or a compiler used to
132
- produce the work, or an object code interpreter used to run it.
133
-
134
- The "Corresponding Source" for a work in object code form means all
135
- the source code needed to generate, install, and (for an executable
136
- work) run the object code and to modify the work, including scripts to
137
- control those activities. However, it does not include the work's
138
- System Libraries, or general-purpose tools or generally available free
139
- programs which are used unmodified in performing those activities but
140
- which are not part of the work. For example, Corresponding Source
141
- includes interface definition files associated with source files for
142
- the work, and the source code for shared libraries and dynamically
143
- linked subprograms that the work is specifically designed to require,
144
- such as by intimate data communication or control flow between those
145
- subprograms and other parts of the work.
146
-
147
- The Corresponding Source need not include anything that users
148
- can regenerate automatically from other parts of the Corresponding
149
- Source.
150
-
151
- The Corresponding Source for a work in source code form is that
152
- same work.
153
-
154
- 2. Basic Permissions.
155
-
156
- All rights granted under this License are granted for the term of
157
- copyright on the Program, and are irrevocable provided the stated
158
- conditions are met. This License explicitly affirms your unlimited
159
- permission to run the unmodified Program. The output from running a
160
- covered work is covered by this License only if the output, given its
161
- content, constitutes a covered work. This License acknowledges your
162
- rights of fair use or other equivalent, as provided by copyright law.
163
-
164
- You may make, run and propagate covered works that you do not
165
- convey, without conditions so long as your license otherwise remains
166
- in force. You may convey covered works to others for the sole purpose
167
- of having them make modifications exclusively for you, or provide you
168
- with facilities for running those works, provided that you comply with
169
- the terms of this License in conveying all material for which you do
170
- not control copyright. Those thus making or running the covered works
171
- for you must do so exclusively on your behalf, under your direction
172
- and control, on terms that prohibit them from making any copies of
173
- your copyrighted material outside their relationship with you.
174
-
175
- Conveying under any other circumstances is permitted solely under
176
- the conditions stated below. Sublicensing is not allowed; section 10
177
- makes it unnecessary.
178
-
179
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
-
181
- No covered work shall be deemed part of an effective technological
182
- measure under any applicable law fulfilling obligations under article
183
- 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
- similar laws prohibiting or restricting circumvention of such
185
- measures.
186
-
187
- When you convey a covered work, you waive any legal power to forbid
188
- circumvention of technological measures to the extent such circumvention
189
- is effected by exercising rights under this License with respect to
190
- the covered work, and you disclaim any intention to limit operation or
191
- modification of the work as a means of enforcing, against the work's
192
- users, your or third parties' legal rights to forbid circumvention of
193
- technological measures.
194
-
195
- 4. Conveying Verbatim Copies.
196
-
197
- You may convey verbatim copies of the Program's source code as you
198
- receive it, in any medium, provided that you conspicuously and
199
- appropriately publish on each copy an appropriate copyright notice;
200
- keep intact all notices stating that this License and any
201
- non-permissive terms added in accord with section 7 apply to the code;
202
- keep intact all notices of the absence of any warranty; and give all
203
- recipients a copy of this License along with the Program.
204
-
205
- You may charge any price or no price for each copy that you convey,
206
- and you may offer support or warranty protection for a fee.
207
-
208
- 5. Conveying Modified Source Versions.
209
-
210
- You may convey a work based on the Program, or the modifications to
211
- produce it from the Program, in the form of source code under the
212
- terms of section 4, provided that you also meet all of these conditions:
213
-
214
- a) The work must carry prominent notices stating that you modified
215
- it, and giving a relevant date.
216
-
217
- b) The work must carry prominent notices stating that it is
218
- released under this License and any conditions added under section
219
- 7. This requirement modifies the requirement in section 4 to
220
- "keep intact all notices".
221
-
222
- c) You must license the entire work, as a whole, under this
223
- License to anyone who comes into possession of a copy. This
224
- License will therefore apply, along with any applicable section 7
225
- additional terms, to the whole of the work, and all its parts,
226
- regardless of how they are packaged. This License gives no
227
- permission to license the work in any other way, but it does not
228
- invalidate such permission if you have separately received it.
229
-
230
- d) If the work has interactive user interfaces, each must display
231
- Appropriate Legal Notices; however, if the Program has interactive
232
- interfaces that do not display Appropriate Legal Notices, your
233
- work need not make them do so.
234
-
235
- A compilation of a covered work with other separate and independent
236
- works, which are not by their nature extensions of the covered work,
237
- and which are not combined with it such as to form a larger program,
238
- in or on a volume of a storage or distribution medium, is called an
239
- "aggregate" if the compilation and its resulting copyright are not
240
- used to limit the access or legal rights of the compilation's users
241
- beyond what the individual works permit. Inclusion of a covered work
242
- in an aggregate does not cause this License to apply to the other
243
- parts of the aggregate.
244
-
245
- 6. Conveying Non-Source Forms.
246
-
247
- You may convey a covered work in object code form under the terms
248
- of sections 4 and 5, provided that you also convey the
249
- machine-readable Corresponding Source under the terms of this License,
250
- in one of these ways:
251
-
252
- a) Convey the object code in, or embodied in, a physical product
253
- (including a physical distribution medium), accompanied by the
254
- Corresponding Source fixed on a durable physical medium
255
- customarily used for software interchange.
256
-
257
- b) Convey the object code in, or embodied in, a physical product
258
- (including a physical distribution medium), accompanied by a
259
- written offer, valid for at least three years and valid for as
260
- long as you offer spare parts or customer support for that product
261
- model, to give anyone who possesses the object code either (1) a
262
- copy of the Corresponding Source for all the software in the
263
- product that is covered by this License, on a durable physical
264
- medium customarily used for software interchange, for a price no
265
- more than your reasonable cost of physically performing this
266
- conveying of source, or (2) access to copy the
267
- Corresponding Source from a network server at no charge.
268
-
269
- c) Convey individual copies of the object code with a copy of the
270
- written offer to provide the Corresponding Source. This
271
- alternative is allowed only occasionally and noncommercially, and
272
- only if you received the object code with such an offer, in accord
273
- with subsection 6b.
274
-
275
- d) Convey the object code by offering access from a designated
276
- place (gratis or for a charge), and offer equivalent access to the
277
- Corresponding Source in the same way through the same place at no
278
- further charge. You need not require recipients to copy the
279
- Corresponding Source along with the object code. If the place to
280
- copy the object code is a network server, the Corresponding Source
281
- may be on a different server (operated by you or a third party)
282
- that supports equivalent copying facilities, provided you maintain
283
- clear directions next to the object code saying where to find the
284
- Corresponding Source. Regardless of what server hosts the
285
- Corresponding Source, you remain obligated to ensure that it is
286
- available for as long as needed to satisfy these requirements.
287
-
288
- e) Convey the object code using peer-to-peer transmission, provided
289
- you inform other peers where the object code and Corresponding
290
- Source of the work are being offered to the general public at no
291
- charge under subsection 6d.
292
-
293
- A separable portion of the object code, whose source code is excluded
294
- from the Corresponding Source as a System Library, need not be
295
- included in conveying the object code work.
296
-
297
- A "User Product" is either (1) a "consumer product", which means any
298
- tangible personal property which is normally used for personal, family,
299
- or household purposes, or (2) anything designed or sold for incorporation
300
- into a dwelling. In determining whether a product is a consumer product,
301
- doubtful cases shall be resolved in favor of coverage. For a particular
302
- product received by a particular user, "normally used" refers to a
303
- typical or common use of that class of product, regardless of the status
304
- of the particular user or of the way in which the particular user
305
- actually uses, or expects or is expected to use, the product. A product
306
- is a consumer product regardless of whether the product has substantial
307
- commercial, industrial or non-consumer uses, unless such uses represent
308
- the only significant mode of use of the product.
309
-
310
- "Installation Information" for a User Product means any methods,
311
- procedures, authorization keys, or other information required to install
312
- and execute modified versions of a covered work in that User Product from
313
- a modified version of its Corresponding Source. The information must
314
- suffice to ensure that the continued functioning of the modified object
315
- code is in no case prevented or interfered with solely because
316
- modification has been made.
317
-
318
- If you convey an object code work under this section in, or with, or
319
- specifically for use in, a User Product, and the conveying occurs as
320
- part of a transaction in which the right of possession and use of the
321
- User Product is transferred to the recipient in perpetuity or for a
322
- fixed term (regardless of how the transaction is characterized), the
323
- Corresponding Source conveyed under this section must be accompanied
324
- by the Installation Information. But this requirement does not apply
325
- if neither you nor any third party retains the ability to install
326
- modified object code on the User Product (for example, the work has
327
- been installed in ROM).
328
-
329
- The requirement to provide Installation Information does not include a
330
- requirement to continue to provide support service, warranty, or updates
331
- for a work that has been modified or installed by the recipient, or for
332
- the User Product in which it has been modified or installed. Access to a
333
- network may be denied when the modification itself materially and
334
- adversely affects the operation of the network or violates the rules and
335
- protocols for communication across the network.
336
-
337
- Corresponding Source conveyed, and Installation Information provided,
338
- in accord with this section must be in a format that is publicly
339
- documented (and with an implementation available to the public in
340
- source code form), and must require no special password or key for
341
- unpacking, reading or copying.
342
-
343
- 7. Additional Terms.
344
-
345
- "Additional permissions" are terms that supplement the terms of this
346
- License by making exceptions from one or more of its conditions.
347
- Additional permissions that are applicable to the entire Program shall
348
- be treated as though they were included in this License, to the extent
349
- that they are valid under applicable law. If additional permissions
350
- apply only to part of the Program, that part may be used separately
351
- under those permissions, but the entire Program remains governed by
352
- this License without regard to the additional permissions.
353
-
354
- When you convey a copy of a covered work, you may at your option
355
- remove any additional permissions from that copy, or from any part of
356
- it. (Additional permissions may be written to require their own
357
- removal in certain cases when you modify the work.) You may place
358
- additional permissions on material, added by you to a covered work,
359
- for which you have or can give appropriate copyright permission.
360
-
361
- Notwithstanding any other provision of this License, for material you
362
- add to a covered work, you may (if authorized by the copyright holders of
363
- that material) supplement the terms of this License with terms:
364
-
365
- a) Disclaiming warranty or limiting liability differently from the
366
- terms of sections 15 and 16 of this License; or
367
-
368
- b) Requiring preservation of specified reasonable legal notices or
369
- author attributions in that material or in the Appropriate Legal
370
- Notices displayed by works containing it; or
371
-
372
- c) Prohibiting misrepresentation of the origin of that material, or
373
- requiring that modified versions of such material be marked in
374
- reasonable ways as different from the original version; or
375
-
376
- d) Limiting the use for publicity purposes of names of licensors or
377
- authors of the material; or
378
-
379
- e) Declining to grant rights under trademark law for use of some
380
- trade names, trademarks, or service marks; or
381
-
382
- f) Requiring indemnification of licensors and authors of that
383
- material by anyone who conveys the material (or modified versions of
384
- it) with contractual assumptions of liability to the recipient, for
385
- any liability that these contractual assumptions directly impose on
386
- those licensors and authors.
387
-
388
- All other non-permissive additional terms are considered "further
389
- restrictions" within the meaning of section 10. If the Program as you
390
- received it, or any part of it, contains a notice stating that it is
391
- governed by this License along with a term that is a further
392
- restriction, you may remove that term. If a license document contains
393
- a further restriction but permits relicensing or conveying under this
394
- License, you may add to a covered work material governed by the terms
395
- of that license document, provided that the further restriction does
396
- not survive such relicensing or conveying.
397
-
398
- If you add terms to a covered work in accord with this section, you
399
- must place, in the relevant source files, a statement of the
400
- additional terms that apply to those files, or a notice indicating
401
- where to find the applicable terms.
402
-
403
- Additional terms, permissive or non-permissive, may be stated in the
404
- form of a separately written license, or stated as exceptions;
405
- the above requirements apply either way.
406
-
407
- 8. Termination.
408
-
409
- You may not propagate or modify a covered work except as expressly
410
- provided under this License. Any attempt otherwise to propagate or
411
- modify it is void, and will automatically terminate your rights under
412
- this License (including any patent licenses granted under the third
413
- paragraph of section 11).
414
-
415
- However, if you cease all violation of this License, then your
416
- license from a particular copyright holder is reinstated (a)
417
- provisionally, unless and until the copyright holder explicitly and
418
- finally terminates your license, and (b) permanently, if the copyright
419
- holder fails to notify you of the violation by some reasonable means
420
- prior to 60 days after the cessation.
421
-
422
- Moreover, your license from a particular copyright holder is
423
- reinstated permanently if the copyright holder notifies you of the
424
- violation by some reasonable means, this is the first time you have
425
- received notice of violation of this License (for any work) from that
426
- copyright holder, and you cure the violation prior to 30 days after
427
- your receipt of the notice.
428
-
429
- Termination of your rights under this section does not terminate the
430
- licenses of parties who have received copies or rights from you under
431
- this License. If your rights have been terminated and not permanently
432
- reinstated, you do not qualify to receive new licenses for the same
433
- material under section 10.
434
-
435
- 9. Acceptance Not Required for Having Copies.
436
-
437
- You are not required to accept this License in order to receive or
438
- run a copy of the Program. Ancillary propagation of a covered work
439
- occurring solely as a consequence of using peer-to-peer transmission
440
- to receive a copy likewise does not require acceptance. However,
441
- nothing other than this License grants you permission to propagate or
442
- modify any covered work. These actions infringe copyright if you do
443
- not accept this License. Therefore, by modifying or propagating a
444
- covered work, you indicate your acceptance of this License to do so.
445
-
446
- 10. Automatic Licensing of Downstream Recipients.
447
-
448
- Each time you convey a covered work, the recipient automatically
449
- receives a license from the original licensors, to run, modify and
450
- propagate that work, subject to this License. You are not responsible
451
- for enforcing compliance by third parties with this License.
452
-
453
- An "entity transaction" is a transaction transferring control of an
454
- organization, or substantially all assets of one, or subdividing an
455
- organization, or merging organizations. If propagation of a covered
456
- work results from an entity transaction, each party to that
457
- transaction who receives a copy of the work also receives whatever
458
- licenses to the work the party's predecessor in interest had or could
459
- give under the previous paragraph, plus a right to possession of the
460
- Corresponding Source of the work from the predecessor in interest, if
461
- the predecessor has it or can get it with reasonable efforts.
462
-
463
- You may not impose any further restrictions on the exercise of the
464
- rights granted or affirmed under this License. For example, you may
465
- not impose a license fee, royalty, or other charge for exercise of
466
- rights granted under this License, and you may not initiate litigation
467
- (including a cross-claim or counterclaim in a lawsuit) alleging that
468
- any patent claim is infringed by making, using, selling, offering for
469
- sale, or importing the Program or any portion of it.
470
-
471
- 11. Patents.
472
-
473
- A "contributor" is a copyright holder who authorizes use under this
474
- License of the Program or a work on which the Program is based. The
475
- work thus licensed is called the contributor's "contributor version".
476
-
477
- A contributor's "essential patent claims" are all patent claims
478
- owned or controlled by the contributor, whether already acquired or
479
- hereafter acquired, that would be infringed by some manner, permitted
480
- by this License, of making, using, or selling its contributor version,
481
- but do not include claims that would be infringed only as a
482
- consequence of further modification of the contributor version. For
483
- purposes of this definition, "control" includes the right to grant
484
- patent sublicenses in a manner consistent with the requirements of
485
- this License.
486
-
487
- Each contributor grants you a non-exclusive, worldwide, royalty-free
488
- patent license under the contributor's essential patent claims, to
489
- make, use, sell, offer for sale, import and otherwise run, modify and
490
- propagate the contents of its contributor version.
491
-
492
- In the following three paragraphs, a "patent license" is any express
493
- agreement or commitment, however denominated, not to enforce a patent
494
- (such as an express permission to practice a patent or covenant not to
495
- sue for patent infringement). To "grant" such a patent license to a
496
- party means to make such an agreement or commitment not to enforce a
497
- patent against the party.
498
-
499
- If you convey a covered work, knowingly relying on a patent license,
500
- and the Corresponding Source of the work is not available for anyone
501
- to copy, free of charge and under the terms of this License, through a
502
- publicly available network server or other readily accessible means,
503
- then you must either (1) cause the Corresponding Source to be so
504
- available, or (2) arrange to deprive yourself of the benefit of the
505
- patent license for this particular work, or (3) arrange, in a manner
506
- consistent with the requirements of this License, to extend the patent
507
- license to downstream recipients. "Knowingly relying" means you have
508
- actual knowledge that, but for the patent license, your conveying the
509
- covered work in a country, or your recipient's use of the covered work
510
- in a country, would infringe one or more identifiable patents in that
511
- country that you have reason to believe are valid.
512
-
513
- If, pursuant to or in connection with a single transaction or
514
- arrangement, you convey, or propagate by procuring conveyance of, a
515
- covered work, and grant a patent license to some of the parties
516
- receiving the covered work authorizing them to use, propagate, modify
517
- or convey a specific copy of the covered work, then the patent license
518
- you grant is automatically extended to all recipients of the covered
519
- work and works based on it.
520
-
521
- A patent license is "discriminatory" if it does not include within
522
- the scope of its coverage, prohibits the exercise of, or is
523
- conditioned on the non-exercise of one or more of the rights that are
524
- specifically granted under this License. You may not convey a covered
525
- work if you are a party to an arrangement with a third party that is
526
- in the business of distributing software, under which you make payment
527
- to the third party based on the extent of your activity of conveying
528
- the work, and under which the third party grants, to any of the
529
- parties who would receive the covered work from you, a discriminatory
530
- patent license (a) in connection with copies of the covered work
531
- conveyed by you (or copies made from those copies), or (b) primarily
532
- for and in connection with specific products or compilations that
533
- contain the covered work, unless you entered into that arrangement,
534
- or that patent license was granted, prior to 28 March 2007.
535
-
536
- Nothing in this License shall be construed as excluding or limiting
537
- any implied license or other defenses to infringement that may
538
- otherwise be available to you under applicable patent law.
539
-
540
- 12. No Surrender of Others' Freedom.
541
-
542
- If conditions are imposed on you (whether by court order, agreement or
543
- otherwise) that contradict the conditions of this License, they do not
544
- excuse you from the conditions of this License. If you cannot convey a
545
- covered work so as to satisfy simultaneously your obligations under this
546
- License and any other pertinent obligations, then as a consequence you may
547
- not convey it at all. For example, if you agree to terms that obligate you
548
- to collect a royalty for further conveying from those to whom you convey
549
- the Program, the only way you could satisfy both those terms and this
550
- License would be to refrain entirely from conveying the Program.
551
-
552
- 13. Use with the GNU Affero General Public License.
553
-
554
- Notwithstanding any other provision of this License, you have
555
- permission to link or combine any covered work with a work licensed
556
- under version 3 of the GNU Affero General Public License into a single
557
- combined work, and to convey the resulting work. The terms of this
558
- License will continue to apply to the part which is the covered work,
559
- but the special requirements of the GNU Affero General Public License,
560
- section 13, concerning interaction through a network will apply to the
561
- combination as such.
562
-
563
- 14. Revised Versions of this License.
564
-
565
- The Free Software Foundation may publish revised and/or new versions of
566
- the GNU General Public License from time to time. Such new versions will
567
- be similar in spirit to the present version, but may differ in detail to
568
- address new problems or concerns.
569
-
570
- Each version is given a distinguishing version number. If the
571
- Program specifies that a certain numbered version of the GNU General
572
- Public License "or any later version" applies to it, you have the
573
- option of following the terms and conditions either of that numbered
574
- version or of any later version published by the Free Software
575
- Foundation. If the Program does not specify a version number of the
576
- GNU General Public License, you may choose any version ever published
577
- by the Free Software Foundation.
578
-
579
- If the Program specifies that a proxy can decide which future
580
- versions of the GNU General Public License can be used, that proxy's
581
- public statement of acceptance of a version permanently authorizes you
582
- to choose that version for the Program.
583
-
584
- Later license versions may give you additional or different
585
- permissions. However, no additional obligations are imposed on any
586
- author or copyright holder as a result of your choosing to follow a
587
- later version.
588
-
589
- 15. Disclaimer of Warranty.
590
-
591
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
- APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
- HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
- OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
- PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
- IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
- ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
-
600
- 16. Limitation of Liability.
601
-
602
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
- THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
- GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
- USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
- DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
- PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
- EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
- SUCH DAMAGES.
611
-
612
- 17. Interpretation of Sections 15 and 16.
613
-
614
- If the disclaimer of warranty and limitation of liability provided
615
- above cannot be given local legal effect according to their terms,
616
- reviewing courts shall apply local law that most closely approximates
617
- an absolute waiver of all civil liability in connection with the
618
- Program, unless a warranty or assumption of liability accompanies a
619
- copy of the Program in return for a fee.
620
-
621
- END OF TERMS AND CONDITIONS
622
-
623
- How to Apply These Terms to Your New Programs
624
-
625
- If you develop a new program, and you want it to be of the greatest
626
- possible use to the public, the best way to achieve this is to make it
627
- free software which everyone can redistribute and change under these terms.
628
-
629
- To do so, attach the following notices to the program. It is safest
630
- to attach them to the start of each source file to most effectively
631
- state the exclusion of warranty; and each file should have at least
632
- the "copyright" line and a pointer to where the full notice is found.
633
-
634
- <one line to give the program's name and a brief idea of what it does.>
635
- Copyright (C) <year> <name of author>
636
-
637
- This program is free software: you can redistribute it and/or modify
638
- it under the terms of the GNU General Public License as published by
639
- the Free Software Foundation, either version 3 of the License, or
640
- (at your option) any later version.
641
-
642
- This program is distributed in the hope that it will be useful,
643
- but WITHOUT ANY WARRANTY; without even the implied warranty of
644
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
- GNU General Public License for more details.
646
-
647
- You should have received a copy of the GNU General Public License
648
- along with this program. If not, see <http://www.gnu.org/licenses/>.
649
-
650
- Also add information on how to contact you by electronic and paper mail.
651
-
652
- If the program does terminal interaction, make it output a short
653
- notice like this when it starts in an interactive mode:
654
-
655
- <program> Copyright (C) <year> <name of author>
656
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
- This is free software, and you are welcome to redistribute it
658
- under certain conditions; type `show c' for details.
659
-
660
- The hypothetical commands `show w' and `show c' should show the appropriate
661
- parts of the General Public License. Of course, your program's commands
662
- might be different; for a GUI interface, you would use an "about box".
663
-
664
- You should also get your employer (if you work as a programmer) or school,
665
- if any, to sign a "copyright disclaimer" for the program, if necessary.
666
- For more information on this, and how to apply and follow the GNU GPL, see
667
- <http://www.gnu.org/licenses/>.
668
-
669
- The GNU General Public License does not permit incorporating your program
670
- into proprietary programs. If your program is a subroutine library, you
671
- may consider it more useful to permit linking proprietary applications with
672
- the library. If this is what you want to do, use the GNU Lesser General
673
- Public License instead of this License. But first, please read
674
- <http://www.gnu.org/philosophy/why-not-lgpl.html>.
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ <one line to give the program's name and a brief idea of what it does.>
635
+ Copyright (C) <year> <name of author>
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ <program> Copyright (C) <year> <name of author>
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <http://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
+ <http://www.gnu.org/philosophy/why-not-lgpl.html>.
page_post_redirect_plugin.php CHANGED
@@ -1,18 +1,18 @@
1
  <?php
2
  /*
3
- Plugin Name: Quick Page/Post Redirect DEV
4
  Plugin URI: http://www.fischercreativemedia.com/wordpress-plugins/quick-pagepost-redirect-plugin/
5
  Description: Redirect Pages, Posts or Custom Post Types to another location quickly (for internal or external URLs). Includes individual post/page options, redirects for Custom Post types, non-existant 301 Quick Redirects (helpful for sites converted to WordPress), New Window functionality, and rel=nofollow functionality.
6
  Author: Don Fischer
7
  Author URI: http://www.fischercreativemedia.com/
8
- Donate link: http://www.fischercreativemedia.com/wordpress-plugins/donate/
9
- Version: 4.2.3
10
 
11
  Version info:
12
  See change log in readme.txt file.
13
  Version 3.2.4 to 4.0.1 are testing versions only
14
 
15
- Copyright (C) 2009-2011 Donald J. Fischer
16
 
17
  This program is free software: you can redistribute it and/or modify
18
  it under the terms of the GNU General Public License as published by
@@ -33,7 +33,51 @@ Version 3.2.4 to 4.0.1 are testing versions only
33
  function esc_attr($attr){return attribute_escape( $attr );}
34
  function esc_url($url){return clean_url( $url );}
35
  }
 
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  //=======================================
38
  // Main Redirect Class.
39
  //=======================================
@@ -62,29 +106,38 @@ class quick_page_post_reds {
62
  public $pproverride_rewrite;
63
  public $pprmeta_seconds;
64
  public $pprmeta_message;
 
 
 
 
 
65
 
66
  function __construct() {
67
- $this->ppr_curr_version = '4.1';
68
  $this->ppr_nofollow = array();
69
  $this->ppr_newindow = array();
70
  $this->ppr_url = array();
71
  $this->ppr_url_rewrite = array();
72
- $this->thepprversion = get_option('ppr_version');
73
- $this->thepprmeta = get_option('ppr_meta_clean');
74
- $this->quickppr_redirects = get_option('quickppr_redirects');
75
- $this->homelink = get_option('home');
 
76
  $this->pproverride_nofollow = get_option( 'ppr_override-nofollow' );
77
  $this->pproverride_newwin = get_option( 'ppr_override-newwindow' );
 
 
78
  $this->pproverride_type = get_option( 'ppr_override-redirect-type' );
79
  $this->pproverride_active = get_option( 'ppr_override-active' );
80
  $this->pproverride_URL = get_option( 'ppr_override-URL' );
81
  $this->pproverride_rewrite = get_option( 'ppr_override-rewrite' );
82
  $this->pprmeta_message = get_option( 'ppr_meta-message' );
83
  $this->pprmeta_seconds = get_option( 'ppr_meta-seconds' );
 
84
  $this->adminlink = get_bloginfo('url').'/wp-admin/';
85
- $this->fcmlink = 'http://www.fischercreativemedia.com/wordpress-plugins';
86
  $this->ppr_metaurl = '';
87
- $this->ppr_all_redir_array = $this->get_main_array();
88
  $this->updatemsg = '';
89
  if($this->pprmeta_seconds==''){$this->pprmeta_seconds='0';}
90
 
@@ -92,12 +145,15 @@ class quick_page_post_reds {
92
  add_action( 'init', array($this,'ppr_init_check_version'), 1 ); // checks version of plugin in DB and updates if needed.
93
  add_action( 'save_post', array($this,'ppr_save_metadata'),20,2 ); // save the custom fields
94
  add_action( 'wp',array($this,'ppr_parse_request') ); // parse query vars
 
 
95
  add_action( 'admin_menu', array($this,'ppr_add_menu') ); // add the menu items needed
96
  add_action( 'admin_menu', array($this,'ppr_add_metabox') ); // add the metaboxes where needed
97
  add_action( 'plugin_action_links_' . plugin_basename(__FILE__), array($this,'ppr_filter_plugin_actions') );
98
  add_filter( 'query_vars',array($this,'ppr_queryhook') );
99
  add_filter( 'plugin_row_meta', array($this,'ppr_filter_plugin_links'), 10, 2 );
100
-
 
101
  if($this->pproverride_active!='1' && !is_admin()){ // don't run these if override active is set
102
  add_action( 'init', array($this,'redirect'), 1 ); // add the 301 redirect action, high priority
103
  add_action( 'init', array($this,'redirect_post_type'), 1 ); // add the normal redirect action, high priority
@@ -110,16 +166,129 @@ class quick_page_post_reds {
110
  add_filter( 'get_permalink', array($this, 'ppr_filter_links'), 20, 2 );
111
  }
112
  if (isset( $_POST['submit_301']) ) {$this->quickppr_redirects = $this->save_redirects($_POST['quickppr_redirects']);$this->updatemsg ='Quick Redirects Updated.';} //if submitted, process the data
113
- if (isset( $_REQUEST['settings-updated'] ) && $_REQUEST['settings-updated']=='true'){$this->updatemsg ='Settings Updated.';}
114
  }
115
 
116
  function ppr_add_menu(){
117
- add_menu_page('Redirect Menu', 'Redirect Menu', 'administrator', 'redirect-options', array($this,'ppr_settings_page'),plugins_url().'/quick-pagepost-redirect-plugin/settings-16-icon.png');
118
  add_submenu_page( 'redirect-options', 'Quick Redirects', 'Quick Redirects', 'manage_options', 'redirect-updates', array($this,'ppr_options_page') );
119
  add_submenu_page( 'redirect-options', 'Redirect Summary', 'Redirect Summary', 'manage_options', 'redirect-summary', array($this,'ppr_summary_page') );
 
120
  add_action( 'admin_init', array($this,'register_pprsettings') );
121
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  function register_pprsettings() {
124
  register_setting( 'ppr-settings-group', 'ppr_use-custom-post-types' );
125
  register_setting( 'ppr-settings-group', 'ppr_override-nofollow' );
@@ -130,18 +299,89 @@ class quick_page_post_reds {
130
  register_setting( 'ppr-settings-group', 'ppr_override-rewrite' );
131
  register_setting( 'ppr-settings-group', 'ppr_meta-seconds' );
132
  register_setting( 'ppr-settings-group', 'ppr_meta-message' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  }
134
-
135
  function ppr_summary_page() {?>
136
  <div class="wrap">
137
- <style type="text/css">.pprdonate{padding:5px;border:1px solid #dadada;font-family:tahoma, arial, helvetica, sans-serif;font-size:12px;float:right;position:absolute;top:25px;right:5px;width:250px;text-align:center;}.qform-table td{padding:2px !important;border:1px solid #cccccc;}.qform-table .headrow td{font-weight:bold;}.qform-table .onrow td{background-color:#eaeaea;}.qform-table .offrow td{background-color:#ffffff;}</style>
138
- <div class="icon32" style="<?php echo 'background: url('.plugins_url().'/quick-pagepost-redirect-plugin/settings-icon.png) no-repeat transparent;';?>"><br></div>
 
 
 
 
 
 
 
 
 
139
  <h2>Quick Page Post Redirect Summary</h2>
140
- <p>This is a summary of Individual redirects only. Quick 301 Redirects can be found <a href="admin.php?page=redirect-updates">here</a>.</p><br/>
141
  <?php if($this->updatemsg!=''){?><div class="updated settings-error" id="setting-error-settings_updated"><p><strong><?php echo $this->updatemsg;?></strong></p></div><?php } ?>
142
  <?php $this->updatemsg ='';?>
143
  <h2 style="font-size:20px;">Summary</h2>
144
  <div align="left">
 
 
 
 
 
 
145
  <table class="form-table qform-table" width="100%">
146
  <tr valign="top" class="headrow">
147
  <td width="50" align="left">ID</td>
@@ -159,12 +399,33 @@ class quick_page_post_reds {
159
  $tempReportArray = array();
160
  $tempa = array();
161
  $tempQTReportArray = array();
162
- if(count($this->quickppr_redirects)>0){
 
163
  foreach($this->quickppr_redirects as $key=>$redir){
164
  $tempQTReportArray = array('url'=>$key,'destinaition'=>$redir);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  }
166
  }
167
- if(count($this->ppr_all_redir_array)>0){
168
  foreach($this->ppr_all_redir_array as $key=>$result){
169
  $tempa['id']= $key;
170
  $tempa['post_type'] = get_post_type( $key );
@@ -177,10 +438,12 @@ class quick_page_post_reds {
177
  unset($tempa);
178
  }
179
  }
180
- if(count($tempReportArray)>0){
181
  $pclass = 'onrow';
182
  foreach($tempReportArray as $reportItem){
183
  $tactive = $reportItem['_pprredirect_active'];
 
 
184
  $trewrit = $reportItem['_pprredirect_rewritelink'];
185
  $tnofoll = $reportItem['_pprredirect_relnofollow'];
186
  $tnewwin = $reportItem['_pprredirect_newwindow'];
@@ -188,10 +451,19 @@ class quick_page_post_reds {
188
  $tredURL = $reportItem['_pprredirect_url'];
189
  $tpotype = $reportItem['post_type'];
190
  $tpostid = $reportItem['id'];
191
- $toriurl = get_permalink($tpostid);
 
 
 
 
 
 
 
 
 
 
192
  if($pclass == 'offrow'){$pclass = 'onrow';}else{$pclass = 'offrow';}
193
- if($tnewwin == '0'){$tnewwin = '0';}else{$tnewwin = '1';}
194
- if($tredURL == 'http://www.example.com'){$tredURL='<strong>N/A - redirection will not occur</strong>';}
195
  ?>
196
  <tr valign="top" class="<?php echo $pclass;?>">
197
  <td width="50" align="left"><?php echo $tpostid;?></td>
@@ -214,22 +486,125 @@ class quick_page_post_reds {
214
  }
215
 
216
  function ppr_settings_page() {
 
 
 
 
217
  ?>
218
  <div class="wrap" style="position:relative;">
219
- <style type="text/css">.pprdonate{padding:5px;border:1px solid #dadada;font-family:tahoma, arial, helvetica, sans-serif;font-size:12px;float:right;position:absolute;top:25px;right:5px;width:250px;text-align:center;}.qpprform label {float:left;display:block;width:290px;margin-left:30px;}.qpprform .submit{clear:both;}.qpprform span{font-size:9px;}</style>
220
- <div class="icon32" style="<?php echo 'background: url('.plugins_url().'/quick-pagepost-redirect-plugin/settings-icon.png) no-repeat transparent;';?>"><br></div>
221
- <div class="pprdonate">
222
- <p>If you enjoy or find any of our plugins useful, please donate a few dollars to help with future development and updates.</p>
223
- <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
224
- <input name="cmd" value="_s-xclick" type="hidden">
225
- <input name="hosted_button_id" value="8274582" type="hidden">
226
- <input alt="PayPal - The safer, easier way to pay online!" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" type="image"> <img src="https://www.paypal.com/en_US/i/scr/pixel.gif" alt="" border="0" height="1" width="1"><br>
227
- </form>
228
- <p>We thank you in advance.</p>
229
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  <h2>Quick Page Post Redirect Options & Settings</h2>
231
- <?php if($this->updatemsg!=''){?><div class="updated settings-error" id="setting-error-settings_updated"><p><strong><?php echo $this->updatemsg;?></strong></p></div><?php } ?>
232
  <?php $this->updatemsg ='';//reset message;?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
 
234
  <form method="post" action="options.php" class="qpprform">
235
  <?php settings_fields( 'ppr-settings-group' ); ?>
@@ -238,25 +613,57 @@ class quick_page_post_reds {
238
  <td><h2 style="font-size:20px;">Basic Settings</h2></td>
239
  </tr>
240
  <tr valign="top">
241
- <td><label>Use with Custom Post Types?</label> <input type="checkbox" name="ppr_use-custom-post-types" value="1"<?php if(get_option('ppr_use-custom-post-types')=='1'){echo ' checked="checked" ';} ?>/></td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  </tr>
243
  <tr valign="top">
244
- <td><label>Meta Refresh Time (in seconds):</label> <input type="text" size="5" name="ppr_meta-seconds" value="<?php echo get_option('ppr_meta-seconds');?>" /> <span>only needed for meta refresh. 0=default (instant)</span></td>
 
245
  </tr>
246
  <tr valign="top">
247
- <td><label>Meta Refresh Message:</label> <input type="text" size="25" name="ppr_meta-message" value="<?php echo get_option('ppr_meta-message');?>" /> <span>default is none. message to display while waiting for refresh</span></td>
 
248
  </tr>
249
  <tr valign="top">
250
  <td><h2 style="font-size:20px;">Master Override Options</h2><b>NOTE: </b>These will override all individual settings.</td>
251
  </tr>
252
  <tr valign="top">
253
- <td><label>Turn OFF all Redirects? </label><input type="checkbox" name="ppr_override-active" value="1"<?php if(get_option('ppr_override-active')=='1'){echo ' checked="checked" ';} ?>/> <span>excludes Quick 301 Redirects.</span></td>
 
254
  </tr>
255
  <tr valign="top">
256
- <td><label>Make ALL Redirects have <code>rel="nofollow"</code>? </label><input type="checkbox" name="ppr_override-nofollow" value="1"<?php if(get_option('ppr_override-nofollow')=='1'){echo ' checked="checked" ';} ?>/> <span>excludes Quick 301 Redirects.</span></td>
 
257
  </tr>
258
  <tr valign="top">
259
- <td><label>Make ALL Redirects open in a New Window? </label><input type="checkbox" name="ppr_override-newwindow" value="1"<?php if(get_option('ppr_override-newwindow')=='1'){echo ' checked="checked" ';} ?>/> <span>excludes Quick 301 Redirects.</span></td>
 
260
  </tr>
261
  <tr valign="top">
262
  <td><label>Make ALL Redirects this type: </label>
@@ -270,10 +677,22 @@ class quick_page_post_reds {
270
  <span> (Quick 301 Redirects will always be 301)</span></td>
271
  </tr>
272
  <tr valign="top">
273
- <td><label>Make ALL Redirects go to this URL: </label><input type="text" size="50" name="ppr_override-URL" value="<?php echo get_option('ppr_override-URL'); ?>"/> <span>(use full URL including <code>http://</code>).</span></td>
 
 
 
 
 
 
 
 
 
 
 
 
274
  </tr>
275
  <tr valign="top">
276
- <td><label>Rewrite ALL Redirects URLs to Show in LINK? </label><input type="checkbox" name="ppr_override-rewrite" value="1"<?php if(get_option('ppr_override-rewrite')=='1'){echo ' checked="checked" ';} ?>/> <span>(makes link show redirect URL instead of the original URL).</span></td>
277
  </tr>
278
  </table>
279
  <p class="submit">
@@ -288,41 +707,74 @@ class quick_page_post_reds {
288
  $tohash = $this->homelink.'/';
289
  ?>
290
  <div class="wrap">
291
- <div class="icon32" style="<?php echo 'background: url('.plugins_url().'/quick-pagepost-redirect-plugin/settings-icon.png) no-repeat transparent;';?>"><br></div>
292
- <script type="text/javascript">jQuery(document).ready(function() {jQuery(".delete-qppr").click(function(){var mainurl = '<?php echo get_bloginfo('url');?>/'; var thepprdel = jQuery(this).attr('id');if(confirm('Are you sure you want to delete this redirect?')){jQuery.ajax({url: mainurl+"/",data : "pprd="+thepprdel+"&scid=<?php echo md5($tohash);?>",success: function(data){jQuery('#row'+thepprdel).remove();},complete: function(){}});return false;}else{return false;}});});</script>
 
293
  <h2>Quick 301 Redirects</h2>
294
  <?php if($this->updatemsg!=''){?><div class="updated settings-error" id="setting-error-settings_updated"><p><strong><?php echo $this->updatemsg;?></strong></p></div><?php } ?>
295
  <?php $this->updatemsg ='';//reset message;?>
296
- <br/>This section is useful if you have links from an old site and need to have them redirect to a new location on the current site, or if you have an existing URL that you need to send some place else and you don't want to have a Page or Post created to use the other Page/Post Redirect option.
297
- <br/>
298
- <br/>To add additional 301 redirects, put the URL you want to redirect in the Request field and the Place you want it to redirect to, in the Destination field.
299
- <br/>To delete a redirect, click the 'x' next to the Destination Field.
 
 
 
 
 
 
 
300
  <br/>
301
- <br/><b style="color:red;">PLEASE NOTE:</b>
302
- <ul>
303
- <li style="color:#214070;margin-left:25px;list-style-type:disc;">The <b>Request</b> field MUST be relative to the ROOT directory and contain the <code>/</code> at the beginning.</li>
304
- <li style="color:#214070;margin-left:25px;list-style-type:disc;">The <b>Destination</b> field can be any valid URL or relative path (from root).</li>
305
- <li style="color:#214070;margin-left:25px;list-style-type:disc;">Quick Redirects <b>WILL NOT open in a new window</b>. They are meant to be 'Quick' and since the user will not
306
- actually be clicking anything, a new window cannot be opened.</li>
307
- </ul>
 
308
  <br/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  <form method="post" action="admin.php?page=redirect-updates">
310
  <table>
311
  <tr>
312
  <th align="left">Request</th>
313
  <th align="left">Destination</th>
314
- <th align="left">&nbsp;</th>
 
 
315
  </tr>
316
  <tr>
317
- <td><small>example: <code>/about.htm</code> or <code>/test-directory/landing-zone/</code></small></td>
318
- <td><small>example: <code><?php echo $this->homelink; ?>/about/</code> or <code><?php echo $this->homelink; ?>/landing/</code></small></td>
319
  <td>&nbsp;</td>
320
  </tr>
321
  <?php echo $this->expand_redirects(); ?>
322
  <tr>
323
- <td><input type="text" name="quickppr_redirects[request][]" value="" style="width:35em" />&nbsp;&raquo;&nbsp;</td>
324
- <td><input type="text" name="quickppr_redirects[destination][]" value="" style="width:35em;" /></td>
325
- <td></td>
 
 
326
  </tr>
327
  </table>
328
 
@@ -338,14 +790,23 @@ class quick_page_post_reds {
338
  function save_redirects($data){
339
  // Save the redirects from the options page to the database
340
  $redirects = array();
 
341
  for($i = 0; $i < sizeof($data['request']); ++$i) {
342
- $request = trim($data['request'][$i]);
 
 
 
343
  if(strpos($request,'/',0) !== 0 && strpos($request,'http',0) !== 0){$request = '/'.$request;} // adds root marker to front if not there
344
  if((strpos($request,'.') === false && strpos($request,'?') === false) && strpos($request,'/',strlen($request)-1) === false){$request = $request.'/';} // adds end folder marker if not a file end
345
- $destination = trim($data['destination'][$i]);
346
- if (($request == '' || $request == '/') && $destination == '') { continue; } elseif($request != '' && $request != '/' && $destination == '' ){ $redirects[$request] = $this->homelink.'/';}else { $redirects[$request] = $destination; }
 
347
  }
348
  update_option('quickppr_redirects', $redirects);
 
 
 
 
349
  return $redirects;
350
  }
351
 
@@ -355,11 +816,17 @@ class quick_page_post_reds {
355
  if (!empty($this->quickppr_redirects)) {
356
  $ww=1;
357
  foreach ($this->quickppr_redirects as $request => $destination) {
 
 
 
 
358
  $output .= '
359
  <tr id="rowpprdel-'.$ww.'">
360
- <td><input type="text" name="quickppr_redirects[request][]" value="'.$request.'" style="width:35em" />&nbsp;&raquo;&nbsp;</td>
361
- <td><input type="text" name="quickppr_redirects[destination][]" value="'.$destination.'" style="width:35em;" /></td>
362
- <td>&nbsp;<a href="javascript:void();" id="pprdel-'.$ww.'" class="delete-qppr">x</a>&nbsp;</td>
 
 
363
  </tr>
364
  ';
365
  $ww++;
@@ -375,8 +842,10 @@ class quick_page_post_reds {
375
  }else{
376
  $id = $post;
377
  }
378
- if(array_key_exists($id, $this->ppr_all_redir_array)){
379
- $matchedID = $this->ppr_all_redir_array[$id];
 
 
380
  if($matchedID['_pprredirect_rewritelink'] == '1' || $this->pproverride_rewrite =='1'){ // if rewrite link is checked or override is set
381
  if($this->pproverride_URL ==''){$newURL = $matchedID['_pprredirect_url'];}else{$newURL = $this->pproverride_URL;} // check override
382
  if(strpos($newURL,$this->homelink)>=0 || strpos($newURL,'www.')>=0 || strpos($newURL,'http://')>=0 || strpos($newURL,'https://')>=0){
@@ -395,8 +864,10 @@ class quick_page_post_reds {
395
  }else{
396
  $id = $post;
397
  }
398
- if(array_key_exists($id, $this->ppr_all_redir_array)){
399
- $matchedID = $this->ppr_all_redir_array[$id];
 
 
400
  if($matchedID['_pprredirect_rewritelink'] == '1' || $this->pproverride_rewrite =='1'){ // if rewrite link is checked
401
  if($this->pproverride_URL ==''){$newURL = $matchedID['_pprredirect_url'];}else{$newURL = $this->pproverride_URL;} // check override
402
  if(strpos($newURL,$this->homelink)>=0 || strpos($newURL,'www.')>=0 || strpos($newURL,'http://')>=0 || strpos($newURL,'https://')>=0){
@@ -420,11 +891,18 @@ class quick_page_post_reds {
420
  $post_types_temp = array('page' => 'page','post' => 'post','attachment' => 'attachment','nav_menu_item' => 'nav_menu_item');
421
  }
422
  }else{
423
- $post_types_temp = array('page' => 'page','post' => 'post','attachment' => 'attachment','nav_menu_item' => 'nav_menu_item');
424
  }
425
  unset($post_types_temp['revision']); //remove revions from array if present as they are not needed.
 
 
 
 
 
426
  foreach($post_types_temp as $type){
427
- add_meta_box( 'edit-box-ppr', 'Quick Page/Post Redirect', array($this,'edit_box_ppr_1'), $type, 'normal', 'high' );
 
 
428
  }
429
  }
430
  }
@@ -432,7 +910,10 @@ class quick_page_post_reds {
432
  function get_main_array(){
433
  global $wpdb;
434
  $theArray = array();
435
- $thetemp = $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE (`meta_key` = '_pprredirect_active' OR `meta_key` = '_pprredirect_rewritelink' OR `meta_key` = '_pprredirect_newwindow' OR `meta_key` = '_pprredirect_relnofollow' OR `meta_key` = '_pprredirect_type' OR `meta_key` = '_pprredirect_url') ORDER BY `post_id` ASC;");
 
 
 
436
  if(count($thetemp)>0){
437
  foreach($thetemp as $key){
438
  $theArray[$key->post_id][$key->meta_key] = $key->meta_value;
@@ -445,9 +926,19 @@ class quick_page_post_reds {
445
  if(!isset($theArray[$key->post_id]['_pprredirect_relnofollow'])){$theArray[$key->post_id]['_pprredirect_relnofollow'] = 0;}
446
  if(!isset($theArray[$key->post_id]['_pprredirect_newwindow'] )) {$theArray[$key->post_id]['_pprredirect_newwindow'] = 0;}
447
  if(!isset($theArray[$key->post_id]['_pprredirect_active'] )){$theArray[$key->post_id]['_pprredirect_active'] = 0;}
 
 
 
 
 
 
 
 
448
  }
449
 
450
  }
 
 
451
  return $theArray;
452
  }
453
 
@@ -478,6 +969,9 @@ class quick_page_post_reds {
478
  case 'ppr_metaurlnew':
479
  return $this->ppr_metaurlnew;
480
  break;
 
 
 
481
  case 'hepprversion':
482
  return $this->hepprversion;
483
  break;
@@ -517,21 +1011,151 @@ class quick_page_post_reds {
517
  }
518
 
519
  function ppr_addmetatohead_theme(){
 
 
 
520
  // check URL override
521
  if($this->pproverride_URL !=''){$urlsite = $this->pproverride_URL;} else {$urlsite = $this->ppr_metaurl;}
522
  $this->pproverride_URL = ''; //reset
523
  if($this->pprmeta_seconds==''){$this->pprmeta_seconds='0';}
524
- echo '<meta http-equiv="refresh" content="'.$this->pprmeta_seconds.'; URL='.$urlsite.'" />';
525
- if($this->pprmeta_message!='' && $this->pprmeta_seconds!='0'){echo '<div style="margin-top:20px;text-align:center;">'.$this->pprmeta_message.'</div>';}
526
- exit; //stop loading page so meta can do it's job without rest of page loading.
 
 
 
 
 
 
 
 
 
 
 
527
  }
528
 
529
  function ppr_queryhook($vars) {
530
  $vars[] = 'pprd';
531
  $vars[] = 'scid';
 
 
 
 
 
532
  return $vars;
533
  }
534
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
535
  function ppr_parse_request($wp) {
536
  global $wp;
537
  if(array_key_exists('pprd', $wp->query_vars) && array_key_exists('scid', $wp->query_vars)){
@@ -539,22 +1163,50 @@ class quick_page_post_reds {
539
  if( $wp->query_vars['pprd'] !='' && $wp->query_vars['scid'] == md5($tohash)){
540
  $theDel = str_replace('pprdel-','',$wp->query_vars['pprd']);
541
  $redirects = get_option('quickppr_redirects');
 
542
  if (!empty($redirects)) {
543
  $ww=1;
544
  foreach ($redirects as $request => $destination) {
545
  if($ww != (int)$theDel){
546
  $quickppr_redirects[$request] = $destination;
 
547
  }
548
  $ww++;
549
  }
550
  } // end if
551
  update_option('quickppr_redirects',$quickppr_redirects);
 
 
552
  echo 1;
553
  exit;
554
  }else{
555
  echo 0;
556
  exit;
557
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
558
  }else{
559
  return;
560
  }
@@ -562,8 +1214,13 @@ class quick_page_post_reds {
562
 
563
  function ppr_init_check_version() {
564
  // checks version of plugin in DB and updates if needed.
 
 
 
565
  global $wpdb;
566
  if($this->thepprversion != $this->ppr_curr_version){
 
 
567
  update_option( 'ppr_version', $this->ppr_curr_version );
568
  }
569
  if($this->thepprmeta != '1'){
@@ -574,15 +1231,15 @@ class quick_page_post_reds {
574
 
575
  function ppr_filter_plugin_actions($links){
576
  $new_links = array();
577
- $new_links[] = '<a href="'.$this->fcmlink.'/donate/">Donate</a>';
578
  return array_merge($links,$new_links );
579
  }
580
 
581
  function ppr_filter_plugin_links($links, $file){
582
  if ( $file == plugin_basename(__FILE__) ){
583
  $links[] = '<a href="'.$this->adminlink.'admin.php?page=redirect-updates">Quick Redirects</a>';
584
- $links[] = '<a target="_blank" href="'.$this->fcmlink.'/quick-pagepost-redirect-plugin/">FAQ</a>';
585
- $links[] = '<a target="_blank" href="'.$this->fcmlink.'/donate/">Donate</a>';
586
  }
587
  return $links;
588
  }
@@ -599,10 +1256,11 @@ class quick_page_post_reds {
599
  wp_nonce_field( 'pprredirect_noncename', 'pprredirect_noncename', false, true );
600
 
601
  // The actual fields for data entry
602
- echo '<label for="pprredirect_active" style="padding:2px 0;"><input type="checkbox" name="pprredirect_active" value="1" '. checked('1',get_post_meta($post->ID,'_pprredirect_active',true),0).' />Make Redirect <b>Active</b>. (check to turn on)</label><br />';
603
- echo '<label for="pprredirect_newwindow" style="padding:2px 0;"><input type="checkbox" name="pprredirect_newwindow" id="pprredirect_newwindow" value="_blank" '. checked('_blank',get_post_meta($post->ID,'_pprredirect_newwindow',true),0).'>Open redirect link in a <b>new window.</b></label><br />';
604
- echo '<label for="pprredirect_relnofollow" style="padding:2px 0;"><input type="checkbox" name="pprredirect_relnofollow" id="pprredirect_relnofollow" value="1" '. checked('1',get_post_meta($post->ID,'_pprredirect_relnofollow',true),0).'>Add <b>rel=\"nofollow\"</b> to redirect link.</label><br />';
605
- echo '<label for="pprredirect_rewritelink" style="padding:2px 0;"><input type="checkbox" name="pprredirect_rewritelink" id="pprredirect_rewritelink" value="1" '. checked('1',get_post_meta($post->ID,'_pprredirect_rewritelink',true),0).'><b>Show</b> the Redirect URL below in the link instead of this page URL. <b>NOTE: You may have to use the <u>FULL</u> URL below!</b></label><br /><br />';
 
606
  echo '<label for="pprredirect_url"><b>Redirect URL:</b></label><br />';
607
  if(get_post_meta($post->ID, '_pprredirect_url', true)!=''){$pprredirecturl=get_post_meta($post->ID, '_pprredirect_url', true);}else{$pprredirecturl="";}
608
  echo '<input type="text" style="width:75%;margin-top:2px;margin-bottom:2px;" name="pprredirect_url" value="'.$pprredirecturl.'" /><br />(i.e., <code>http://example.com</code> or <code>/somepage/</code> or <code>p=15</code> or <code>155</code>. Use <b>FULL URL</b> <i>including</i> <code>http://</code> for all external <i>and</i> meta redirects. )<br /><br />';
@@ -653,7 +1311,8 @@ class quick_page_post_reds {
653
  $my_meta_data['_pprredirect_relnofollow'] = $_REQUEST['pprredirect_relnofollow'];
654
  $my_meta_data['_pprredirect_type'] = $_REQUEST['pprredirect_type'];
655
  $my_meta_data['_pprredirect_rewritelink'] = $_REQUEST['pprredirect_rewritelink'];
656
- $my_meta_data['_pprredirect_url'] = $_REQUEST['pprredirect_url']; //stripslashes( $_POST['pprredirect_url']);
 
657
 
658
  if ( 0 === strpos($my_meta_data['_pprredirect_url'], 'www.'))
659
  $my_meta_data['_pprredirect_url'] = 'http://' . $my_meta_data['_pprredirect_url'] ; // Starts with www., so add http://
@@ -681,6 +1340,7 @@ class quick_page_post_reds {
681
  }
682
  }
683
  endif;
 
684
  }
685
 
686
  function ppr_fix_targetsandrels($pages) {
@@ -778,39 +1438,51 @@ class quick_page_post_reds {
778
  }
779
 
780
  function redirect(){
781
- // Read the list of redirects and if the current page is found in the list, send the visitor on her way
782
  if (!empty($this->quickppr_redirects) && !is_admin()) {
783
- $userrequest = str_replace(get_option('home'),'',$this->getAddress());
784
- if(strpos($userrequest,'/') === false) {$userrequesttest = '/'.$userrequest.'/';}else{$userrequesttest = $userrequest.'/';}
785
- if (array_key_exists($userrequest,$this->quickppr_redirects) || array_key_exists($userrequesttest,$this->quickppr_redirects)) {
786
- if(isset($this->quickppr_redirects[$userrequesttest]) && $this->quickppr_redirects[$userrequesttest]!=''){$userrequest = $userrequesttest;}
787
- if($this->quickppr_redirects[$userrequest]!='') {
788
- if($this->pproverride_URL!=''){$useURL = $this->pproverride_URL;}else{$useURL = $this->quickppr_redirects[$userrequest];}
789
- switch($this->pproverride_type){
790
- case '':
791
- case '0':
792
- case '301':
793
- header ('Status: 301');
794
- header ('HTTP/1.1 301 Moved Permanently');
795
- break;
796
- case '302':
797
- header ('Status: 302');
798
- header ('HTTP/1.1 302 Moved Temporarily');
799
- break;
800
- case '307':
801
- header ('Status: 307');
802
- header ('HTTP/1.1 307 Moved Temporarily');
803
- break;
804
- case 'meta':
805
- $this->ppr_metaurl = $useURL;
806
- add_action('wp_head', array($this,'ppr_addmetatohead_theme'),1);
807
- break;
808
- }
809
- //check URL Override
810
- header ('Location: ' . $useURL);
811
- exit();
812
  }
813
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
814
  }
815
  }
816
 
@@ -841,30 +1513,12 @@ class quick_page_post_reds {
841
  // check if override is set for all redirects to go to one URL
842
  if($this->pproverride_URL !=''){$urlsite=$this->pproverride_URL;}
843
  if($this->pproverride_type!='0' && $this->pproverride_type!=''){$redrtype = $this->pproverride_type;} //override check
844
-
845
- header("Status: $redrtype");
846
- switch($redrtype){
847
- case '301':
848
- case '0':
849
- case '':
850
- header ('HTTP/1.1 301 Moved Permanently');
851
- header("Location: $urlsite", true, $redrtype);
852
- exit(); //stop loading page
853
- break;
854
- case '302':
855
- header ('HTTP/1.1 302 Moved Temporarily');
856
- header("Location: $urlsite", true, $redrtype);
857
- exit(); //stop loading page
858
- break;
859
- case '307':
860
- header ('HTTP/1.1 307 Moved Temporarily');
861
- header("Location: $urlsite", true, $redrtype);
862
- exit(); //stop loading page
863
- break;
864
- case 'meta':
865
- $this->ppr_metaurl = $redrurl;
866
- add_action('wp_head', array($this,'ppr_addmetatohead_theme'),1);
867
- break;
868
  }
869
  }
870
  }
@@ -908,6 +1562,7 @@ class quick_page_post_reds {
908
  //=======================================
909
  // END Main Redirect Class.
910
  //=======================================
911
-
912
- $redirect_plugin = new quick_page_post_reds(); // call our class
 
913
  ?>
1
  <?php
2
  /*
3
+ Plugin Name: Quick Page/Post Redirect Plugin
4
  Plugin URI: http://www.fischercreativemedia.com/wordpress-plugins/quick-pagepost-redirect-plugin/
5
  Description: Redirect Pages, Posts or Custom Post Types to another location quickly (for internal or external URLs). Includes individual post/page options, redirects for Custom Post types, non-existant 301 Quick Redirects (helpful for sites converted to WordPress), New Window functionality, and rel=nofollow functionality.
6
  Author: Don Fischer
7
  Author URI: http://www.fischercreativemedia.com/
8
+ Donate link: http://www.fischercreativemedia.com/donations/
9
+ Version: 5.0
10
 
11
  Version info:
12
  See change log in readme.txt file.
13
  Version 3.2.4 to 4.0.1 are testing versions only
14
 
15
+ Copyright (C) 2009-2012 Donald J. Fischer
16
 
17
  This program is free software: you can redistribute it and/or modify
18
  it under the terms of the GNU General Public License as published by
33
  function esc_attr($attr){return attribute_escape( $attr );}
34
  function esc_url($url){return clean_url( $url );}
35
  }
36
+ add_action('init','start_ppr_class',0);
37
 
38
+ //you can use the following action hooks with this plugin:
39
+ // *** Quick Rediects function: use to take over redirect
40
+ // add_action('qppr_redirect','some_callback_function',10,2);
41
+ // value 1. is Redirect URL
42
+ // value 2. is Redirect Type
43
+ // *******************************
44
+ // *** Page/Post Redirects function: use to take over redirect
45
+ // add_action('qppr_do_redirect','some_callback_function2',10,2);
46
+ // value 1. is Redirect URL
47
+ // value 2. is Redirect Type
48
+ // *******************************
49
+ // *** Meta Redirect Action: Used for Meta Redirect Page Headers (so you can add meta tag)
50
+ //add_action('ppr_meta_head_hook','some_callback',10,3);
51
+ // arg 1. URL site
52
+ // arg 2. Meta Redirect Time in Seconds
53
+ // arg 3. Meta Message to display
54
+ // Example:
55
+ /***
56
+ add_action('ppr_meta_head_hook','override_ppr_metahead',10,3);
57
+ function override_ppr_metahead($refresh_url='',$refresh_secs=0,$messages=''){
58
+ echo '<meta http-equiv="refresh" content="'.$refresh_secs.'; URL='.$refresh_url.'" />'."\n";
59
+ echo '<div id="ppr_custom_message">'. $messages.'</div>'."\n";
60
+ return;
61
+ }
62
+ **/
63
+ // *******************************
64
+ // *** Meta Redirect Filter: Used for Meta Redirect Page Headers (so you can add meta and message, etc.)
65
+ //add_filter('ppr_meta_head_hook_filter','some_callback2',10,2);
66
+ // value 1. Meta Tag (fully generated)
67
+ // value 2. Page HTML Message (wrapped in a <div> tag)
68
+ // Example:
69
+ add_filter('ppr_meta_head_hook_filter','override_ppr_metahead_new');
70
+ function override_ppr_metahead_new($meta_tag='',$meta_message=''){
71
+ $meta = $meta_tag;
72
+ $function = create_function('$content', 'return \'<div id="ppr_custom_message">sample message override</div>\';');
73
+ $function2 = create_function('$title', 'return \'sample message override TITLE\';');
74
+ add_filter('get_content',$function,100,1);
75
+ add_filter('get_title',$function2,100,1);
76
+ return $meta;
77
+ }
78
+ // *******************************
79
+
80
+
81
  //=======================================
82
  // Main Redirect Class.
83
  //=======================================
106
  public $pproverride_rewrite;
107
  public $pprmeta_seconds;
108
  public $pprmeta_message;
109
+ public $quickppr_redirectsmeta;
110
+ public $quickppr_jquerycache;
111
+ public $pproverride_casesensitive;
112
+ public $ppruse_jquery;
113
+ public $pprptypes_ok;
114
 
115
  function __construct() {
116
+ $this->ppr_curr_version = '5.0';
117
  $this->ppr_nofollow = array();
118
  $this->ppr_newindow = array();
119
  $this->ppr_url = array();
120
  $this->ppr_url_rewrite = array();
121
+ $this->thepprversion = get_option( 'ppr_version');
122
+ $this->thepprmeta = get_option( 'ppr_meta_clean');
123
+ $this->quickppr_redirects = get_option( 'quickppr_redirects');
124
+ $this->quickppr_redirectsmeta= get_option('quickppr_redirects_meta');
125
+ $this->homelink = get_option( 'home');
126
  $this->pproverride_nofollow = get_option( 'ppr_override-nofollow' );
127
  $this->pproverride_newwin = get_option( 'ppr_override-newwindow' );
128
+ $this->ppruse_jquery = get_option( 'ppr_use-jquery' );
129
+ $this->pprptypes_ok = array();
130
  $this->pproverride_type = get_option( 'ppr_override-redirect-type' );
131
  $this->pproverride_active = get_option( 'ppr_override-active' );
132
  $this->pproverride_URL = get_option( 'ppr_override-URL' );
133
  $this->pproverride_rewrite = get_option( 'ppr_override-rewrite' );
134
  $this->pprmeta_message = get_option( 'ppr_meta-message' );
135
  $this->pprmeta_seconds = get_option( 'ppr_meta-seconds' );
136
+ $this->pproverride_casesensitive = get_option( 'ppr_override-casesensitive' );
137
  $this->adminlink = get_bloginfo('url').'/wp-admin/';
138
+ $this->fcmlink = 'http://www.fischercreativemedia.com/plugins';
139
  $this->ppr_metaurl = '';
140
+ $this->quickppr_jquerycache = get_option( 'qppr_jQuery_cache' );
141
  $this->updatemsg = '';
142
  if($this->pprmeta_seconds==''){$this->pprmeta_seconds='0';}
143
 
145
  add_action( 'init', array($this,'ppr_init_check_version'), 1 ); // checks version of plugin in DB and updates if needed.
146
  add_action( 'save_post', array($this,'ppr_save_metadata'),20,2 ); // save the custom fields
147
  add_action( 'wp',array($this,'ppr_parse_request') ); // parse query vars
148
+ add_action( 'init',array($this,'ppr_parse_request_new') ); // parse query vars
149
+ add_action( 'wp_enqueue_scripts',array($this,'ppr_do_jQuery'), 1, 2); // do the jQuery in site header
150
  add_action( 'admin_menu', array($this,'ppr_add_menu') ); // add the menu items needed
151
  add_action( 'admin_menu', array($this,'ppr_add_metabox') ); // add the metaboxes where needed
152
  add_action( 'plugin_action_links_' . plugin_basename(__FILE__), array($this,'ppr_filter_plugin_actions') );
153
  add_filter( 'query_vars',array($this,'ppr_queryhook') );
154
  add_filter( 'plugin_row_meta', array($this,'ppr_filter_plugin_links'), 10, 2 );
155
+ //add_filter( 'wp_feed_cache_transient_lifetime','ppr_wp_feed_options',10, 2);
156
+
157
  if($this->pproverride_active!='1' && !is_admin()){ // don't run these if override active is set
158
  add_action( 'init', array($this,'redirect'), 1 ); // add the 301 redirect action, high priority
159
  add_action( 'init', array($this,'redirect_post_type'), 1 ); // add the normal redirect action, high priority
166
  add_filter( 'get_permalink', array($this, 'ppr_filter_links'), 20, 2 );
167
  }
168
  if (isset( $_POST['submit_301']) ) {$this->quickppr_redirects = $this->save_redirects($_POST['quickppr_redirects']);$this->updatemsg ='Quick Redirects Updated.';} //if submitted, process the data
169
+ if (isset( $_REQUEST['settings-updated'] ) && $_REQUEST['settings-updated']=='true'){/*$this->updatemsg ='Settings Updated.';*/}
170
  }
171
 
172
  function ppr_add_menu(){
173
+ add_menu_page('Redirect Options', 'Redirect Options', 'administrator', 'redirect-options', array($this,'ppr_settings_page'),plugins_url( 'settings-16-icon.png' , __FILE__));
174
  add_submenu_page( 'redirect-options', 'Quick Redirects', 'Quick Redirects', 'manage_options', 'redirect-updates', array($this,'ppr_options_page') );
175
  add_submenu_page( 'redirect-options', 'Redirect Summary', 'Redirect Summary', 'manage_options', 'redirect-summary', array($this,'ppr_summary_page') );
176
+ add_submenu_page( 'redirect-options', 'FAQs/Help', 'FAQs/Help', 'manage_options', 'redirect-faqs', array($this,'ppr_faq_page') );
177
  add_action( 'admin_init', array($this,'register_pprsettings') );
178
  }
179
+
180
+ function ppr_do_jQuery($wphead){
181
+ $this->build_jQueryCache();
182
+ wp_enqueue_script( 'pprjquery', get_bloginfo('url').'/', array('jquery'), 'pprjq1');
183
+ }
184
+
185
+ function build_jQueryCache(){
186
+ $redirects = $this->quickppr_redirects;
187
+ $redirectsmeta = $this->quickppr_redirectsmeta;
188
+ $ppr_newWindowArray = array();
189
+ $ppr_noFollowArray = array();
190
+ $ppr_newwin = $this->ppr_newwindow;
191
+ $ppr_nofoll = $this->ppr_nofollow;
192
+
193
+ //quick redirects
194
+ if (!empty($redirects)) {
195
+ foreach ($redirects as $request => $destination) {
196
+ if($redirectsmeta[$request]['nofollow'] == '1' || $this->pproverride_nofollow =='1'){$ppr_noFollowArray[] = str_replace(array(get_bloginfo('url'),'/'),array('',''),$request);}
197
+ if($redirectsmeta[$request]['newwindow'] == '1' || $this->pproverride_newwin =='1'){$ppr_newWindowArray[] = str_replace(array(get_bloginfo('url'),'/'),array('',''),$request);}
198
+ }
199
+ }
200
 
201
+ //New Window Array
202
+ if (!empty($ppr_newwin)) {
203
+ foreach ($ppr_newwin as $request) {
204
+ if($ppr_newwin != ''){$ppr_newWindowArray[] = str_replace(array(get_bloginfo('url'),'/'),array('',''),$request);}
205
+ }
206
+ }
207
+
208
+ //No Follow Array
209
+ if (!empty($ppr_nofoll)) {
210
+ foreach ($ppr_nofoll as $request) {
211
+ if($ppr_nofoll != ''){$ppr_noFollowArray[] = str_replace(array(get_bloginfo('url'),'/'),array('',''),$request);}
212
+ }
213
+ }
214
+
215
+ $newWin = implode('", "',$ppr_newWindowArray);
216
+ if($newWin!=''){$newWin = '"'.$newWin.'"';}
217
+ $newFoll = implode('", "',$ppr_noFollowArray);
218
+ if($newFoll!=''){$newFoll = '"'.$newFoll.'"';}
219
+ $pprextrajqrw = '0';
220
+ $pprextrajqurl = '';
221
+ if($this->pproverride_rewrite == '1'){
222
+ $pprextrajqrw = '1';
223
+ $pprextrajqurl = $this->pproverride_URL;
224
+ }
225
+ $theScript ="
226
+ jQuery(document).ready(function() {
227
+ var pprrewrite = '".$pprextrajqrw."';
228
+ var pprrewriteurl = '".$pprextrajqurl."';
229
+ var pprNoFollArr = new Array(".$newFoll.");
230
+ var pprNewWinArr = new Array(".$newWin.");
231
+ var pprchechhref = '';
232
+ var pprchechhref2 = '';
233
+ var pprspoturl = '".get_bloginfo('url')."';
234
+ var tempdf = '';
235
+ var jqvers = parseFloat(jQuery().jquery, 3);
236
+ //this checks for jQuery version and serves correct script (i.e., prop vs attr)
237
+ if(jqvers >= 1.6){
238
+ jQuery('a').each(function (i) {
239
+ var tempfga = jQuery(this).attr('href');
240
+ var tempfg = tempfga.replace(pprspoturl,'');
241
+ var tempfg2 = tempfg.replace(/\//gi,'');
242
+ var tempfg3 = tempfga.replace(/\//gi,'');
243
+ var tempfh = jQuery(this).prop('rel');
244
+ var tempfi = jQuery(this).prop('target');
245
+ if(pprrewrite == '1'){
246
+ pprnewurl = jQuery(this).attr('href',pprrewriteurl);
247
+ }
248
+ if(jQuery.inArray(tempfg2, pprNoFollArr) >= 0 || jQuery.inArray(tempfg3, pprNoFollArr) >= 0){
249
+ if(tempfh =='' || tempfh =='undefined' ){
250
+ jQuery(this).prop('rel','nofollow');
251
+ }else{
252
+ if(tempfh != 'nofollow' && tempfh.indexOf('nofollow') == -1){
253
+ jQuery(this).prop('rel','nofollow '+tempfh);
254
+ }
255
+ }
256
+ }
257
+ if(jQuery.inArray(tempfg2,pprNewWinArr) >= 0 || jQuery.inArray(tempfg3, pprNewWinArr) >= 0){
258
+ if(tempfi =='' || tempfi =='undefined'){jQuery(this).prop('target','_blank');}
259
+ }
260
+ });
261
+ }else{
262
+ jQuery('a').each(function (i) {
263
+ var tempfga = jQuery(this).attr('href');
264
+ var tempfg = tempfga.replace(pprspoturl,'');
265
+ var tempfg2 = tempfg.replace(/\//gi,'');
266
+ var tempfg3 = tempfga.replace(/\//gi,'');
267
+ var tempfh = jQuery(this).attr('rel');
268
+ var tempfi = jQuery(this).attr('target');
269
+ if(pprrewrite == '1'){
270
+ pprnewurl = jQuery(this).attr('href',pprrewriteurl);
271
+ }
272
+ if(jQuery.inArray(tempfg2, pprNoFollArr) >= 0 || jQuery.inArray(tempfg3, pprNoFollArr) >= 0){
273
+ if(tempfh =='' || tempfh =='undefined' ){
274
+ jQuery(this).attr('rel','nofollow');
275
+ }else{
276
+ if(tempfh != 'nofollow' && tempfh.indexOf('nofollow') == -1){
277
+ jQuery(this).attr('rel','nofollow '+tempfh);
278
+ }
279
+ }
280
+ }
281
+ if(jQuery.inArray(tempfg2,pprNewWinArr) >= 0 || jQuery.inArray(tempfg3, pprNewWinArr) >= 0){
282
+ if(tempfi =='' || tempfi =='undefined'){jQuery(this).attr('target','_blank');}
283
+ }
284
+ });
285
+ }
286
+ });
287
+ ";
288
+ update_option('qppr_jQuery_cache',$theScript);
289
+ $this->quickppr_jquerycache = get_option('qppr_jQuery_cache');
290
+ }
291
+
292
  function register_pprsettings() {
293
  register_setting( 'ppr-settings-group', 'ppr_use-custom-post-types' );
294
  register_setting( 'ppr-settings-group', 'ppr_override-nofollow' );
299
  register_setting( 'ppr-settings-group', 'ppr_override-rewrite' );
300
  register_setting( 'ppr-settings-group', 'ppr_meta-seconds' );
301
  register_setting( 'ppr-settings-group', 'ppr_meta-message' );
302
+ register_setting( 'ppr-settings-group', 'ppr_use-jquery' );
303
+ register_setting( 'ppr-settings-group', 'ppr_qpprptypeok' );
304
+ register_setting( 'ppr-settings-group', 'ppr_override-casesensitive' );
305
+ }
306
+
307
+ function ppr_wp_feed_options($cache,$url){
308
+ if($url == "http://www.fischercreativemedia.com/?feed=qppr_faqs"){
309
+ $cache = '1';
310
+ }
311
+ return $cache;
312
+ }
313
+
314
+ function ppr_faq_page(){
315
+ include_once(ABSPATH . WPINC . '/feed.php');
316
+ echo '
317
+ <div class="wrap">
318
+ <style type="text/css">
319
+ .faq-item{border-bottom:1px solid #CCC;padding-bottom:10px;margin-bottom:10px;}
320
+ .faq-item span.qa{color: #21759B;display: block;float: left;font-family: serif;font-size: 17px;font-weight: bold;margin-left: 0;margin-right: 5px;}
321
+ h3.qa{color: #21759B;margin:0px 0px 10px 0;font-family: serif;font-size: 17px;font-weight: bold;}
322
+ .faq-item .qa-content p:first-child{margin-top:0;}
323
+ .qppr-faq-links {border-bottom: 1px solid #CCCCCC;list-style-position: inside;margin:10px 0 15px 35px;}
324
+ .qppr-faq-answers{list-style-position: inside;margin:10px 0 15px 35px;}
325
+ .toplink{text-align:left;}
326
+ .qa-content div > code{background: none repeat scroll 0 0 #EFEFEF;border: 1px solid #CCCCCC;display: block;margin-left: 35px;overflow-y: auto;padding: 10px 20px;white-space: nowrap;width: 90%;}
327
+ </style>
328
+ <div class="icon32" style="background: url('. plugins_url( "settings-icon.png" , __FILE__ ) . ') no-repeat transparent;"><br/></div>
329
+ <h2>Quick Page/Post Redirect FAQs/Help</h2>
330
+ <div align="left"><p>The FAQS are now on a feed that can be updated on the fly. If you have a question and don\'t see an answer, please send an email to <a href="mailto:plugins@fischercreativemedia.com">plugins@fischercreativemedia.com</a> and ask your question. If it is relevant to the plugin, it will be added to the FAQs feed so it will show up here. Please be sure to include the plugin you are asking a question about (Quick Page/Post Redirect Plugin) and any other information like your WordPress version and examples if the plugin is not working correctly for you. THANKS!</p>
331
+ <hr noshade color="#C0C0C0" size="1" />
332
+ ';
333
+ $rss = fetch_feed('http://www.fischercreativemedia.com/?feed=qppr_faqs');
334
+ $linkfaq = array();
335
+ $linkcontent = array();
336
+ if (!is_wp_error( $rss ) ) :
337
+ $maxitems = $rss->get_item_quantity(100);
338
+ $rss_items = $rss->get_items(0, $maxitems);
339
+ endif;
340
+ $aqr = 0;
341
+ if ($maxitems != 0){
342
+ foreach ( $rss_items as $item ) :
343
+ $aqr++;
344
+ $linkfaq[] = '<li class="faq-top-item"><a href="#faq-'.$aqr.'">'.esc_html( $item->get_title() ).'</a></li>';
345
+ $linkcontent[] = '<li class="faq-item"><a name="faq-'.$aqr.'"></a><h3 class="qa"><span class="qa">Q. </span>'.esc_html( $item->get_title() ).'</h3><div class="qa-content"><span class="qa answer">A. </span>'.$item->get_content().'</div><div class="toplink"><a href="#faq-top">top &uarr;</a></li>';
346
+ endforeach;
347
+ }
348
+ echo '<a name="faq-top"></a><h2>Table of Contents</h2>';
349
+ echo '<ol class="qppr-faq-links">';
350
+ echo implode("\n",$linkfaq);
351
+ echo '</ol>';
352
+ echo '<h2>Questions/Answers</h2>';
353
+ echo '<ul class="qppr-faq-answers">';
354
+ echo implode("\n",$linkcontent);
355
+ echo '</ul>';
356
+ echo '
357
+ </div>
358
+ </div>';
359
  }
 
360
  function ppr_summary_page() {?>
361
  <div class="wrap">
362
+ <style type="text/css">
363
+ .ppr-acor{background:#FF0000;display:block;color:#FFFFFF;}
364
+ .ppr-nfor{background:#FFAAAA;display:block;}
365
+ .ppr-nwor{background:#FF9933;display:block;}
366
+ .ppr-rrlor{background:#FFFF66;display:block;}
367
+ .pprdonate{padding:5px;border:1px solid #dadada;font-family:tahoma, arial, helvetica, sans-serif;font-size:12px;float:right;position:absolute;top:25px;right:5px;width:250px;text-align:center;}
368
+ .qform-table td{padding:2px !important;border:1px solid #cccccc;}
369
+ .qform-table .headrow td{font-weight:bold;}
370
+ .qform-table .onrow td{background-color:#eaeaea;}
371
+ .qform-table .offrow td{background-color:#ffffff;}</style>
372
+ <div class="icon32" style="<?php echo 'background: url('.plugins_url( 'settings-icon.png' , __FILE__ ).') no-repeat transparent;';?>"><br></div>
373
  <h2>Quick Page Post Redirect Summary</h2>
374
+ <p>This is a summary of Individual &amp; Quick 301 Redirects.</p><br/>
375
  <?php if($this->updatemsg!=''){?><div class="updated settings-error" id="setting-error-settings_updated"><p><strong><?php echo $this->updatemsg;?></strong></p></div><?php } ?>
376
  <?php $this->updatemsg ='';?>
377
  <h2 style="font-size:20px;">Summary</h2>
378
  <div align="left">
379
+ <?php
380
+ if($this->pproverride_active =='1'){echo '<div class="ppr-acor" style="margin:1px 0;width: 250px;font-weight: bold;padding: 2px;">Acitve Override is on - All Redirects are OFF!</div>';}
381
+ if($this->pproverride_nofollow =='1'){echo '<div class="ppr-nfor" style="margin:1px 0;width: 200px;font-weight: bold;padding: 2px;">No Follow Override is on!</div>';}
382
+ if($this->pproverride_newwin =='1'){echo '<div class="ppr-nwor" style="margin:1px 0;width: 200px;font-weight: bold;padding: 2px;">New Window Override is on!</div>';}
383
+ if($this->pproverride_rewrite =='1'){echo '<div class="ppr-rrlor" style="margin:1px 0;width: 200px;font-weight: bold;padding: 2px;">Rewrite Override is on!</div>';}
384
+ ?>
385
  <table class="form-table qform-table" width="100%">
386
  <tr valign="top" class="headrow">
387
  <td width="50" align="left">ID</td>
399
  $tempReportArray = array();
400
  $tempa = array();
401
  $tempQTReportArray = array();
402
+ $this->build_jQueryCache();
403
+ if( !empty( $this->quickppr_redirects)){
404
  foreach($this->quickppr_redirects as $key=>$redir){
405
  $tempQTReportArray = array('url'=>$key,'destinaition'=>$redir);
406
+ $qr_nofollow = $this->quickppr_redirectsmeta[$key]['nofollow'];
407
+ $qr_newwindow = $this->quickppr_redirectsmeta[$key]['newwindow'];
408
+ if($qr_nofollow ==''){$qr_nofollow = '0';}
409
+ if($qr_newwindow ==''){$qr_newwindow = '0';}
410
+ if($this->pproverride_nofollow == '1'){$qr_nofollow = '<span class="ppr-nfor">1</span>';}
411
+ if($this->pproverride_newwin == '1'){$qr_newwindow= '<span class="ppr-nwor">1</span>';}
412
+ if($this->pproverride_rewrite == '1'){$qrtrewrit= '<span class="ppr-rrlor">1</span>';$qrtredURL = '<span class="ppr-rrlor">'.$this->pproverride_URL.'</span>';}else{$qrtrewrit = 'N/A';$qrtredURL =$redir;}
413
+ if($this->pproverride_active =='1'){$qrtactive = '<span class="ppr-acor">0</span>';}else{$qrtactive= 1;}
414
+
415
+ $tempReportArray[] = array(
416
+ '_pprredirect_active' => $qrtactive,
417
+ '_pprredirect_rewritelink' => $qrtrewrit,
418
+ '_pprredirect_relnofollow' => $qr_nofollow,
419
+ '_pprredirect_newwindow' => $qr_newwindow,
420
+ '_pprredirect_type' => 'Quick',
421
+ 'post_type' => 'N/A',
422
+ 'id' => 'N/A',
423
+ 'origurl' => $key,
424
+ '_pprredirect_url' => $qrtredURL
425
+ );
426
  }
427
  }
428
+ if(!empty($this->ppr_all_redir_array)){
429
  foreach($this->ppr_all_redir_array as $key=>$result){
430
  $tempa['id']= $key;
431
  $tempa['post_type'] = get_post_type( $key );
438
  unset($tempa);
439
  }
440
  }
441
+ if(!empty($tempReportArray)){
442
  $pclass = 'onrow';
443
  foreach($tempReportArray as $reportItem){
444
  $tactive = $reportItem['_pprredirect_active'];
445
+ if($this->pproverride_active =='1'){$tactive = '<span class="ppr-acor">0</span>';}
446
+
447
  $trewrit = $reportItem['_pprredirect_rewritelink'];
448
  $tnofoll = $reportItem['_pprredirect_relnofollow'];
449
  $tnewwin = $reportItem['_pprredirect_newwindow'];
451
  $tredURL = $reportItem['_pprredirect_url'];
452
  $tpotype = $reportItem['post_type'];
453
  $tpostid = $reportItem['id'];
454
+
455
+ if($tnewwin == '0' || $tnewwin == ''){$tnewwin = '0';}elseif($tnewwin == 'N/A'){$tnewwin = 'N/A';}elseif($tnewwin == '_blank'){$tnewwin = '1';};
456
+ if($this->pproverride_nofollow =='1'){$tnofoll = '<span class="ppr-nfor">1</span>';}
457
+ if($this->pproverride_newwin =='1'){$tnewwin= '<span class="ppr-nwor">1</span>';}
458
+ if($this->pproverride_rewrite =='1'){$trewrit= '<span class="ppr-rrlor">1</span>';$tredURL = '<span class="ppr-rrlor">'.$this->pproverride_URL.'</span>';}
459
+
460
+ if(isset($reportItem['origurl'])){
461
+ $toriurl = $reportItem['origurl'];
462
+ }else{
463
+ $toriurl = get_permalink($tpostid);
464
+ }
465
  if($pclass == 'offrow'){$pclass = 'onrow';}else{$pclass = 'offrow';}
466
+ if($tredURL == 'http://www.example.com' || $tredURL == '<span class="ppr-rrlor">http://www.example.com</span>'){$tredURL='<strong>N/A - redirection will not occur</strong>';}
 
467
  ?>
468
  <tr valign="top" class="<?php echo $pclass;?>">
469
  <td width="50" align="left"><?php echo $tpostid;?></td>
486
  }
487
 
488
  function ppr_settings_page() {
489
+ if($_GET['update']=='3'){$this->updatemsg ='All Quick Redirects deleted from database.';}
490
+ if($_GET['update']=='2'){$this->updatemsg ='All Regular Redirects deleted from database.';}
491
+ if($_GET['update']=='4'){$this->updatemsg ='Quick Redirects Imported & Replaced.';}
492
+ if($_GET['update']=='5'){$this->updatemsg ='Quick Redirects Importer & Added to Existing Redirects.';}
493
  ?>
494
  <div class="wrap" style="position:relative;">
495
+ <style type="text/css">
496
+ .qppr-posttypes{overflow: hidden;}
497
+ .qppr-ptype{float: left; width: auto;}
498
+ .qpprform label {float:left;display:block;width:290px;margin-left:15px;}
499
+ .qpprform .submit{clear:both;}
500
+ .qpprform span{font-size:11px;color:#21759B;display:inline-block;margin-left:15px;}
501
+ .pprdonate{border: 1px solid #DADADA;font-family: tahoma,arial,helvetica,sans-serif;font-size: 12px;overflow: hidden;padding: 5px;position: absolute;right: 0;text-align: center;top: 0;width: 160px;}
502
+ .pprdonate form{display:block;}
503
+ .settings-error{display:inline-block;width:70%;}
504
+ .ppr-type-name{display:inline-block;margin:0 25px 0 2px;}
505
+ </style>
506
+ <script type="text/javascript">
507
+ jQuery(document).ready(function() {
508
+ jQuery("#qppr_import_qr_button").click(function(event){
509
+ jQuery('#qppr_addto_form').css({'display':'none'});
510
+ if(jQuery('#qppr_import_form').css('display')=='block'){
511
+ jQuery('#qppr_import_form').css({'display':'none'});
512
+ }else{
513
+ jQuery('#qppr_import_form').css({'display':'block'});
514
+ }
515
+ event.preventDefault();
516
+ });
517
+ jQuery("#qppr_addto_qr_button").click(function(event){
518
+ jQuery('#qppr_import_form').css({'display':'none'});
519
+ if(jQuery('#qppr_addto_form').css('display')=='block'){
520
+ jQuery('#qppr_addto_form').css({'display':'none'});
521
+ }else{
522
+ jQuery('#qppr_addto_form').css({'display':'block'});
523
+ }
524
+ event.preventDefault();
525
+ });
526
+ jQuery("#import_redirects_add_qppr").click(function(event){
527
+ if(jQuery("[name|=qppr_file_add]").attr('value')==''){
528
+ alert('select a file');
529
+ event.preventDefault();
530
+ return false;
531
+ }
532
+ });
533
+ jQuery("#import_redirects_qppr").click(function(event){
534
+ if(jQuery("[name|=qppr_file]").attr('value')==''){
535
+ alert('select a file');
536
+ event.preventDefault();
537
+ return false;
538
+ }
539
+ });
540
+ });
541
+ function check_file(fname){
542
+ str = fname.value.toUpperCase();
543
+ suffix = ".TXT";
544
+ if(!(str.indexOf(suffix, str.length - suffix.length) !== -1)){
545
+ alert('File type not allowed,\nAllowed file: *.txt');
546
+ fname.value = '';
547
+ }
548
+ }
549
+ function goOnConfirm(message, href) {if (confirm(message)) document.location.href = '/wp-admin/admin.php'+href;}
550
+ </script>
551
+ <div class="icon32" style="<?php echo 'background: url('.plugins_url( 'settings-icon.png' , __FILE__ ).') no-repeat transparent;';?>"><br></div>
552
  <h2>Quick Page Post Redirect Options & Settings</h2>
553
+ <?php if($this->updatemsg!=''){?><div class="updated" id="setting-error-settings_updated"><p><strong><?php echo $this->updatemsg;?></strong></p></div><?php } ?>
554
  <?php $this->updatemsg ='';//reset message;?>
555
+ <div class="pprdonate">
556
+ <div style="overflow: hidden; width: 161px; text-align: center;">
557
+ <div style="overflow: hidden; width: 161px; text-align: center; float: left;"><form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input name="cmd" value="_s-xclick" type="hidden"/><input name="hosted_button_id" value="8274582" type="hidden"/><input alt="PayPal - The safer, easier way to pay online!" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" type="image"> <img src="https://www.paypal.com/en_US/i/scr/pixel.gif" alt="" border="0" height="1" width="1"></form></div>
558
+ If you enjoy or find any of our plugins useful, please donate a few dollars to help with future development and updates. We thank you in advance.</div>
559
+ </div>
560
+
561
+ <div align="left">
562
+ <table style="border-collapse: collapse" class="form-table">
563
+ <tr valign="top">
564
+ <td><h2 style="font-size:20px;">Import/Export</h2></td>
565
+ </tr>
566
+ <tr valign="top">
567
+ <td><label>Export Redirects </label><input class="button-secondary qppr_export_qr" type="button" name="qppr_export_qr" value="EXPORT all Quick Redirects" onclick="document.location='<?php echo wp_nonce_url( admin_url('admin.php?page=redirect-options').'&action=export_redirects_qppr', 'export-redirects-qppr'); ?>';" /></td>
568
+ </tr>
569
+ <tr valign="top">
570
+ <td>
571
+ <label>Import Redirects </label>
572
+ <input class="button-secondary qppr_import_qr" type="button" id="qppr_import_qr_button" name="qppr_import_qr" value="RESTORE Saved Quick Redirects" /> OR <input class="button-secondary qppr_addto_qr" type="button" id="qppr_addto_qr_button" name="qppr_addto_qr" value="ADD TO Quick Redirects" />
573
+ <div id="qppr_import_form" class="hide-if-js">
574
+ <form action="<?php echo admin_url('admin.php?page=redirect-options'); ?>" method="post" enctype="multipart/form-data">
575
+ <p style="margin:1em 0;">
576
+ <label>Select Quick Redirects file to import:</label> <input type="file" name="qppr_file" onchange="check_file(this);" />
577
+ </p>
578
+ <p class="submit">
579
+ <?php wp_nonce_field( 'import_redirects_qppr' ); ?>
580
+ <input class="button-primary" type="submit" id="import_redirects_qppr" name="import_redirects_qppr" value="IMPORT & REPLACE Current Quick Redirects" />
581
+ </p>
582
+ </form>
583
+ </div>
584
+ <div id="qppr_addto_form" class="hide-if-js">
585
+ <form action="<?php echo admin_url('admin.php?page=redirect-options'); ?>" method="post" enctype="multipart/form-data">
586
+ <p style="margin:1em 0;">
587
+ <label>Select Quick Redirects file to import:</label> <input type="file" name="qppr_file_add" onchange="check_file(this);" />
588
+ <br/>file should be a text file with one rediect per line, PIPE separated, as <code>redirect|destination|newwindow|nofollow</code> - i.e.:<br/>
589
+ <code>/old-location.htm|http://some.com/new-destination/|0|1</code><br/><code>/dontate/|http://example.com/destination/|1|1</code><br/>
590
+ <strong>IMPORTANT:</strong> Make Sure any destinations that might have a PIPE in the querystring data are URL encoded!
591
+ </p>
592
+ <p class="submit">
593
+ <?php wp_nonce_field( 'import_redirects_add_qppr' ); ?>
594
+ <input class="button-primary" type="submit" id="import_redirects_add_qppr" name="import_redirects_add_qppr" value="ADD TO Current Quick Redirects" />
595
+ </p>
596
+ </form>
597
+ </div>
598
+
599
+ </td>
600
+ </tr>
601
+ <tr valign="top">
602
+ <td>
603
+ <hr noshade color="#EAEAEA" size="1">
604
+ </td>
605
+ </tr>
606
+ </table>
607
+ </div>
608
 
609
  <form method="post" action="options.php" class="qpprform">
610
  <?php settings_fields( 'ppr-settings-group' ); ?>
613
  <td><h2 style="font-size:20px;">Basic Settings</h2></td>
614
  </tr>
615
  <tr valign="top">
616
+ <td><label>Use with Custom Post Types?</label> <input type="checkbox" name="ppr_use-custom-post-types" value="1"<?php if(get_option('ppr_use-custom-post-types')=='1'){echo ' checked="checked" ';} ?>/>
617
+ <?php
618
+ $ptypes = get_post_types();
619
+ $ptypesok = $this->pprptypes_ok;
620
+ if(!is_array($ptypesok)){$ptypesok = get_option( 'ppr_qpprptypeok' );}
621
+ if(!is_array($ptypesok)){$ptypesok = array();}
622
+ $ptypeHTML = '<div class="qppr-posttypes">';
623
+ foreach($ptypes as $ptype){
624
+ if($ptype != 'nav_menu_item' && $ptype != 'attachment' && $ptype != 'revision'){
625
+ if(in_array($ptype,$ptypesok)){
626
+ $ptypecheck = ' checked="checked"';
627
+ }else{
628
+ $ptypecheck = '';
629
+ }
630
+ $ptypeHTML .= '<div class="qppr-ptype"><input class="qppr-ptypecb" type="checkbox" name="ppr_qpprptypeok[]" value="'.$ptype.'"'.$ptypecheck.' /> <div class="ppr-type-name">'.$ptype.'</div></div>';
631
+ }
632
+ }
633
+ $ptypeHTML .= '</div>';
634
+ ?>
635
+ </td>
636
+ </tr>
637
+ <tr valign="top">
638
+ <td><label><span style="color:#FF0000;font-weight:bold;font-size:100%;margin-left:0px;">Hide</span> meta box for following Post Types:</label><?php echo $ptypeHTML;?></td>
639
+ </tr>
640
+ <tr valign="top">
641
+ <td><label>Use with jQuery?</label> <input type="checkbox" name="ppr_use-jquery" value="1"<?php if(get_option('ppr_use-jquery')=='1'){echo ' checked="checked" ';} ?>/>
642
+ <span>Increases effectiveness of plugin. If you have a jQuery
643
+ conflict, try turning this off.</span></td>
644
  </tr>
645
  <tr valign="top">
646
+ <td><label>Meta Refresh Time (in seconds):</label> <input type="text" size="5" name="ppr_meta-seconds" value="<?php echo get_option('ppr_meta-seconds');?>" />
647
+ <span>Only needed for Meta Refresh. 0=default (instant)</span></td>
648
  </tr>
649
  <tr valign="top">
650
+ <td><label>Meta Refresh Message:</label> <input type="text" size="25" name="ppr_meta-message" value="<?php echo get_option('ppr_meta-message');?>" />
651
+ <span>Default is blank. Message to display while waiting for refresh.</span></td>
652
  </tr>
653
  <tr valign="top">
654
  <td><h2 style="font-size:20px;">Master Override Options</h2><b>NOTE: </b>These will override all individual settings.</td>
655
  </tr>
656
  <tr valign="top">
657
+ <td><label>Turn OFF all Redirects? </label><input type="checkbox" name="ppr_override-active" value="1"<?php if(get_option('ppr_override-active')=='1'){echo ' checked="checked" ';} ?>/> <span>
658
+ Includes Quick 301 Redirects when "use with jQuery" is also selected.</span></td>
659
  </tr>
660
  <tr valign="top">
661
+ <td><label>Make ALL Redirects have <code>rel="nofollow"</code>? </label><input type="checkbox" name="ppr_override-nofollow" value="1"<?php if(get_option('ppr_override-nofollow')=='1'){echo ' checked="checked" ';} ?>/>
662
+ <span>Includes Quick 301 Redirects when "use with jQuery" is also selected.</span></td>
663
  </tr>
664
  <tr valign="top">
665
+ <td><label>Make ALL Redirects open in a New Window? </label><input type="checkbox" name="ppr_override-newwindow" value="1"<?php if(get_option('ppr_override-newwindow')=='1'){echo ' checked="checked" ';} ?>/>
666
+ <span>Includes Quick 301 Redirects when "use with jQuery" is also selected.</span></td>
667
  </tr>
668
  <tr valign="top">
669
  <td><label>Make ALL Redirects this type: </label>
677
  <span> (Quick 301 Redirects will always be 301)</span></td>
678
  </tr>
679
  <tr valign="top">
680
+ <td><label>Make ALL redirects Case Sensitive? </label><input type="checkbox" name="ppr_override-casesensitive" value="1"<?php if(get_option('ppr_override-casesensitive')=='1'){echo ' checked="checked" ';} ?>/>
681
+ <span> Makes URLs CaSe SensiTivE - i.e., /somepage/ DOES NOT EQUAL /SoMEpaGe/</span></td>
682
+ </tr>
683
+ <tr valign="top">
684
+ <td><label>Make ALL Redirects go to this URL: </label><input type="text" size="50" name="ppr_override-URL" value="<?php echo get_option('ppr_override-URL'); ?>"/>
685
+ <span>Use full URL including <code>http://</code>.</span></td>
686
+ </tr>
687
+ <tr valign="top">
688
+ <td><label>Rewrite ALL Redirects URLs to Show in LINK? </label><input type="checkbox" name="ppr_override-rewrite" value="1"<?php if(get_option('ppr_override-rewrite')=='1'){echo ' checked="checked" ';} ?>/> <span>
689
+ Makes link show redirect URL instead of the original URL. ONLY includes Quick 301 Redirects when "use with jQuery" is also selected.</span></td>
690
+ </tr>
691
+ <tr valign="top">
692
+ <td><h2 style="font-size:20px;">Plugin Clean Up</h2><b>NOTE: </b>This will DELETE all redirects - so be careful with this.</td>
693
  </tr>
694
  <tr valign="top">
695
+ <td><label>Delete Redirects? </label><input class="button-secondary qppr_delete_reg" type="button" name="qppr_delete_reg" value="Delete all Page/Post Redirects" onclick="goOnConfirm('Are you sure you want to PERMANENTLY Delets ALL Regular Redirects?' , '?page=redirect-options&qppr_delete_reg=1');" /> <input class="button-secondary qppr_delete_qr" type="button" name="qppr_delete_qr" value="Delete all Quick Redirects" onclick="goOnConfirm('Are you sure you want to PERMANENTLY Delets ALL Quick Redirects?' , '?page=redirect-options&qppr_delete_qr=1');" /></td>
696
  </tr>
697
  </table>
698
  <p class="submit">
707
  $tohash = $this->homelink.'/';
708
  ?>
709
  <div class="wrap">
710
+ <div class="icon32" style="<?php echo 'background: url('.plugins_url( 'settings-icon.png' , __FILE__ ).') no-repeat transparent;';?>"><br></div>
711
+ <script type="text/javascript">jQuery(document).ready(function() { var mainurl = '<?php echo get_bloginfo('url');?>'; jQuery(".delete-qppr").click(function(){ var thepprdel = jQuery(this).attr('id'); if(confirm('Are you sure you want to delete this redirect?')){ jQuery.ajax({ url: mainurl+"/",data : "pprd="+thepprdel+"&scid=<?php echo md5($tohash);?>", success: function(data){ jQuery('#row'+thepprdel).remove(); }, complete: function(){ jQuery(".pprnewwin").each(function (i) { jQuery(this).attr('name','quickppr_redirects[newwindow]['+jQuery(".pprnewwin").index(this)+']'); }); jQuery(".pprnofoll").each(function (i) { jQuery(this).attr('name','quickppr_redirects[nofollow]['+jQuery(".pprnofoll").index(this)+']'); }); } }); return false; }else{ return false; } }); jQuery("#hidepprjqmessage").click(function(){ jQuery.ajax({ url: mainurl+"/",data : "pprhidemessage=1", success: function(data){ jQuery('#usejqpprmessage').remove(); } }); return false; }); jQuery("#hidepprjqmessage2").click(function(){ jQuery.ajax({ url: mainurl+"/",data : "pprhidemessage=2", success: function(data){ jQuery('#usejqpprmessage2').remove(); } }); return false; }); });</script>
712
+ <style type="text/css">div.info{background-color:#dceff8;border-color:#c00;margin: 5px 0 15px;padding: 5px;border:1px solid #2e92c1;border-radius: 3px;}div.info a{color:#2e92c1;}.usejqpprmessage{overflow:hidden;}.hidepprjqmessage{float:right;font-size:11px;}.delete-qppr{border: 1px solid #FFBBBB;display: inline-block;font-weight: bold;padding: 0 5px;text-decoration: none;text-transform: uppercase;}</style>
713
  <h2>Quick 301 Redirects</h2>
714
  <?php if($this->updatemsg!=''){?><div class="updated settings-error" id="setting-error-settings_updated"><p><strong><?php echo $this->updatemsg;?></strong></p></div><?php } ?>
715
  <?php $this->updatemsg ='';//reset message;?>
716
+ <?php $isJQueryOn = get_option('ppr_use-jquery');$isJQueryMsgHidden = get_option('qppr_jQuery_hide_message');$isJQueryMsgHidden2 = get_option('qppr_jQuery_hide_message2');?>
717
+ <?php if($isJQueryOn == '' && ($isJQueryMsgHidden =='' || $isJQueryMsgHidden =='0')){?>
718
+ <div class="usejqpprmessage error below-h2" id="usejqpprmessage"><code>Use with jQuery</code> option is turned off in plugin settings.<br/>
719
+ In order to use NW (open in a new window) or NF (add rel="nofollow") options for Quick Redirects, you must have it enabled.<br/>
720
+ <div class="hidepprjqmessage" style=""><a href="javascript:void(0);" id="hidepprjqmessage">hide this message</a></div></div>
721
+ <?php }elseif($isJQueryMsgHidden2 !='1'){ ?>
722
+ <div class="usejqpprmessage info below-h2" id="usejqpprmessage2">The
723
+ <b>NW </b>(open in a new window)<b> NF</b> (nofollow) options are new for this version.<br/>
724
+ To use them, just click the appropriate option and update. Then, any link in the page that has the request URL will be updated with these options (as long as you have <code>use with jQuery</code> enabled in the plugin settings.
725
+ <div class="hidepprjqmessage" style=""><a href="javascript:void(0);" id="hidepprjqmessage2">hide this message</a></div></div>
726
+ <?php }else{ ?>
727
  <br/>
728
+ <?php }?>
729
+ This section is useful if you have links from an old site and need to have them redirect to a new location on the current site, or if you have an existing URL that you need to send some place else and you don't want to have a Page or Post created to use the other Page/Post Redirect option.
730
+ To add these additional 301 redirects, put the URL you want to redirect into the Request field and the
731
+ place it should redirect to in the Destination field. To delete a redirect, click the 'x' next to the Destination Field.
732
+ If you want the redirect to open in a new window or to add rel=nofollow
733
+ to the link, select the NW (new Window) or NF (no Follow) boxes next to
734
+ the appropriate redirect (must enable 'use jQuery' in settings for this
735
+ to work).
736
  <br/>
737
+ <br/><b style="color:red;">IMPORTANT TROUBLE SHOOTING NOTES:</b>
738
+ <ol>
739
+ <li style="color:#214070;margin-left:25px;list-style-type:disc;">The
740
+ <b>Request</b> field MUST be relative to the ROOT directory and contain the
741
+ <code>/</code> at the beginning.</li>
742
+ <li style="color:#214070;margin-left:25px;list-style-type:disc;">The
743
+ <b>Destination</b> field can be any valid URL or relative path (from root).</li>
744
+ <li style="color:#214070;margin-left:25px;list-style-type:disc;">In
745
+ order for NW (open in a new window) or NF (rel=&quot;nofollow&quot;) options
746
+ to work with Quick Redirects, you need to have:
747
+ <ol><li>&quot;Use with jQuery&quot; option selected in the settings page</li>
748
+ <li>A link that uses the request url SOMEWHERE in your site page
749
+ - i.e., in a menu, content, sidebar, etc. </li>
750
+ <li>The open in a new window or nofollow settings will not
751
+ happen if someone just types the old link in the URL or if that
752
+ come from a bookmark or link outside your site - in essence,
753
+ there needs to be a link that they click on in your site so that
754
+ the jQuery script can add the appropriate <code>target</code> and <code>rel</code> properties to the link to make it work.</li></ol>
755
+ </li>
756
+ </ol>
757
  <form method="post" action="admin.php?page=redirect-updates">
758
  <table>
759
  <tr>
760
  <th align="left">Request</th>
761
  <th align="left">Destination</th>
762
+ <th align="left">NW</th>
763
+ <th align="left">NF</th>
764
+ <th align="left">Delete</th>
765
  </tr>
766
  <tr>
767
+ <td><small>example: <code>/about.htm</code> or <code>/directory/landing/</code></small></td>
768
+ <td><small>example: <code><?php echo $this->homelink; ?>/about/</code></small></td>
769
  <td>&nbsp;</td>
770
  </tr>
771
  <?php echo $this->expand_redirects(); ?>
772
  <tr>
773
+ <td><input type="text" name="quickppr_redirects[request][]" value="" style="width:27em" />&nbsp;&raquo;&nbsp;</td>
774
+ <td><input type="text" name="quickppr_redirects[destination][]" value="" style="width:27em;" /></td>
775
+ <td align="center"><input class="pprnewwin" type="checkbox" name="quickppr_redirects[newwindow][<?php if(count($this->quickppr_redirects)==0){echo '0';}else{echo (count($this->quickppr_redirects));}?>]" value="1" title="open in a New Window" /></td>
776
+ <td align="center"><input class="pprnofoll" type="checkbox" name="quickppr_redirects[nofollow][<?php if(count($this->quickppr_redirects)==0){echo '0';}else{echo (count($this->quickppr_redirects));}?>]" value="1" title="add No Follow" /></td>
777
+ <td align="center"></td>
778
  </tr>
779
  </table>
780
 
790
  function save_redirects($data){
791
  // Save the redirects from the options page to the database
792
  $redirects = array();
793
+ $redirectsmeta = array();
794
  for($i = 0; $i < sizeof($data['request']); ++$i) {
795
+ $request = trim($data['request'][$i]);
796
+ $destination = trim($data['destination'][$i]);
797
+ $newwin = trim($data['newwindow'][$i]);
798
+ $nofoll = trim($data['nofollow'][$i]);
799
  if(strpos($request,'/',0) !== 0 && strpos($request,'http',0) !== 0){$request = '/'.$request;} // adds root marker to front if not there
800
  if((strpos($request,'.') === false && strpos($request,'?') === false) && strpos($request,'/',strlen($request)-1) === false){$request = $request.'/';} // adds end folder marker if not a file end
801
+ if (($request == '' || $request == '/') && $destination == '') { continue;} elseif($request != '' && $request != '/' && $destination == '' ){$redirects[$request] = $this->homelink.'/';}else { $redirects[$request] = $destination; }
802
+ $redirectsmeta[$request]['newwindow'] = $newwin;
803
+ $redirectsmeta[$request]['nofollow'] = $nofoll;
804
  }
805
  update_option('quickppr_redirects', $redirects);
806
+ update_option('quickppr_redirects_meta', $redirectsmeta);
807
+ $this->quickppr_redirectsmeta = get_option('quickppr_redirects_meta');
808
+ $this->quickppr_redirects = get_option('quickppr_redirects');
809
+ $this->build_jQueryCache();
810
  return $redirects;
811
  }
812
 
816
  if (!empty($this->quickppr_redirects)) {
817
  $ww=1;
818
  foreach ($this->quickppr_redirects as $request => $destination) {
819
+ $newWindow = $this->quickppr_redirectsmeta[$request]['newwindow'];
820
+ $noFollow = $this->quickppr_redirectsmeta[$request]['nofollow'];
821
+ if($newWindow == '1'){$newChecked = ' checked="checked"';}else{$newChecked = '';}
822
+ if($noFollow == '1'){$noChecked = ' checked="checked"';}else{$noChecked = '';}
823
  $output .= '
824
  <tr id="rowpprdel-'.$ww.'">
825
+ <td><input type="text" name="quickppr_redirects[request][]" value="'.$request.'" style="width:27em" />&nbsp;&raquo;&nbsp;</td>
826
+ <td><input type="text" name="quickppr_redirects[destination][]" value="'.$destination.'" style="width:27em;" /></td>
827
+ <td align="center"><input class="pprnewwin" type="checkbox" name="quickppr_redirects[newwindow]['.($ww - 1).']" value="1"'.$newChecked.' title="open in a New Window" /></td>
828
+ <td align="center"><input class="pprnofoll" type="checkbox" name="quickppr_redirects[nofollow]['.($ww - 1).']" value="1"'.$noChecked.' title="add No Follow" /></td>
829
+ <td align="center">&nbsp;&nbsp;<a href="javascript:void();" id="pprdel-'.$ww.'" class="delete-qppr">X</a>&nbsp;</td>
830
  </tr>
831
  ';
832
  $ww++;
842
  }else{
843
  $id = $post;
844
  }
845
+ $newCheck = $this->ppr_all_redir_array;
846
+ if(!is_array($newCheck)){$newCheck = array();}
847
+ if(array_key_exists($id, $newCheck)){
848
+ $matchedID = $newCheck[$id];
849
  if($matchedID['_pprredirect_rewritelink'] == '1' || $this->pproverride_rewrite =='1'){ // if rewrite link is checked or override is set
850
  if($this->pproverride_URL ==''){$newURL = $matchedID['_pprredirect_url'];}else{$newURL = $this->pproverride_URL;} // check override
851
  if(strpos($newURL,$this->homelink)>=0 || strpos($newURL,'www.')>=0 || strpos($newURL,'http://')>=0 || strpos($newURL,'https://')>=0){
864
  }else{
865
  $id = $post;
866
  }
867
+ $newCheck = $this->ppr_all_redir_array;
868
+ if(!is_array($newCheck)){$newCheck = array();}
869
+ if(array_key_exists($id, $newCheck)){
870
+ $matchedID = $newCheck[$id];
871
  if($matchedID['_pprredirect_rewritelink'] == '1' || $this->pproverride_rewrite =='1'){ // if rewrite link is checked
872
  if($this->pproverride_URL ==''){$newURL = $matchedID['_pprredirect_url'];}else{$newURL = $this->pproverride_URL;} // check override
873
  if(strpos($newURL,$this->homelink)>=0 || strpos($newURL,'www.')>=0 || strpos($newURL,'http://')>=0 || strpos($newURL,'https://')>=0){
891
  $post_types_temp = array('page' => 'page','post' => 'post','attachment' => 'attachment','nav_menu_item' => 'nav_menu_item');
892
  }
893
  }else{
894
+ $post_types_temp = array('page' => 'page','post' => 'post'/*,'attachment' => 'attachment','nav_menu_item' => 'nav_menu_item'*/);
895
  }
896
  unset($post_types_temp['revision']); //remove revions from array if present as they are not needed.
897
+ unset($post_types_temp['attachment']); //remove from array if present as they are not needed.
898
+ unset($post_types_temp['nav_menu_item']); //remove from array if present as they are not needed.
899
+ $ptypesok = $this->pprptypes_ok;
900
+ if($ptypesok==''){$ptypesok = array();}
901
+ if(!is_array($ptypesok)){$ptypesok = array();}
902
  foreach($post_types_temp as $type){
903
+ if(!in_array($type,$ptypesok)){
904
+ add_meta_box( 'edit-box-ppr', 'Quick Page/Post Redirect', array($this,'edit_box_ppr_1'), $type, 'normal', 'high' );
905
+ }
906
  }
907
  }
908
  }
910
  function get_main_array(){
911
  global $wpdb;
912
  $theArray = array();
913
+ $theArrayNW = array();
914
+ $theArrayNF = array();
915
+ $theqsl = "SELECT * FROM $wpdb->postmeta a, $wpdb->posts b WHERE a.`post_id`=b.`ID` AND b.`post_status`!='trash' AND (a.`meta_key` = '_pprredirect_active' OR a.`meta_key` = '_pprredirect_rewritelink' OR a.`meta_key` = '_pprredirect_newwindow' OR a.`meta_key` = '_pprredirect_relnofollow' OR a.`meta_key` = '_pprredirect_type' OR a.`meta_key` = '_pprredirect_url') ORDER BY a.`post_id` ASC;";
916
+ $thetemp = $wpdb->get_results($theqsl);
917
  if(count($thetemp)>0){
918
  foreach($thetemp as $key){
919
  $theArray[$key->post_id][$key->meta_key] = $key->meta_value;
926
  if(!isset($theArray[$key->post_id]['_pprredirect_relnofollow'])){$theArray[$key->post_id]['_pprredirect_relnofollow'] = 0;}
927
  if(!isset($theArray[$key->post_id]['_pprredirect_newwindow'] )) {$theArray[$key->post_id]['_pprredirect_newwindow'] = 0;}
928
  if(!isset($theArray[$key->post_id]['_pprredirect_active'] )){$theArray[$key->post_id]['_pprredirect_active'] = 0;}
929
+
930
+ if($theArray[$key->post_id]['_pprredirect_newwindow']!= '0' || $this->pproverride_newwin =='1'){
931
+ $theArrayNW[$key->post_id] = get_permalink($key->ID);
932
+ }
933
+
934
+ if($theArray[$key->post_id]['_pprredirect_relnofollow']!= '0' || $this->pproverride_nofollow =='1'){
935
+ $theArrayNF[$key->post_id] = get_permalink($key->ID);
936
+ }
937
  }
938
 
939
  }
940
+ $this->ppr_newwindow = $theArrayNW;
941
+ $this->ppr_nofollow = $theArrayNF;
942
  return $theArray;
943
  }
944
 
969
  case 'ppr_metaurlnew':
970
  return $this->ppr_metaurlnew;
971
  break;
972
+ case 'ppr_casesensitive':
973
+ return $this->pproverride_casesensitive;
974
+ break;
975
  case 'hepprversion':
976
  return $this->hepprversion;
977
  break;
1011
  }
1012
 
1013
  function ppr_addmetatohead_theme(){
1014
+ $themsgmeta = '';
1015
+ $themsgmsg = '';
1016
+ $hook_name = 'ppr_meta_head_hook';
1017
  // check URL override
1018
  if($this->pproverride_URL !=''){$urlsite = $this->pproverride_URL;} else {$urlsite = $this->ppr_metaurl;}
1019
  $this->pproverride_URL = ''; //reset
1020
  if($this->pprmeta_seconds==''){$this->pprmeta_seconds='0';}
1021
+ $themsgmeta = '<meta http-equiv="refresh" content="'.$this->pprmeta_seconds.'; URL='.$urlsite.'" />'."\n";
1022
+ if($this->pprmeta_message!='' && $this->pprmeta_seconds!='0'){$themsgmsg = '<div style="margin-top:20px;text-align:center;">'.$this->pprmeta_message.'</div>'."\n";}
1023
+ if( has_action($hook_name)){
1024
+ do_action( $hook_name,$urlsite,$this->pprmeta_seconds,$this->pprmeta_message);
1025
+ return;
1026
+ }elseif( has_filter($hook_name.'_filter')){
1027
+ $themsgmeta = apply_filters($hook_name, $themsgmeta,$themsgmsg);
1028
+ echo $themsgmeta;
1029
+ return;
1030
+ }else{
1031
+ echo $themsgmeta;
1032
+ echo $themsgmsg;
1033
+ exit; //stop loading page so meta can do it's job without rest of page loading.
1034
+ }
1035
  }
1036
 
1037
  function ppr_queryhook($vars) {
1038
  $vars[] = 'pprd';
1039
  $vars[] = 'scid';
1040
+ $vars[] = 'pprjq';
1041
+ $vars[] = 'ver';
1042
+ $vars[] = 'pprhidemessage';
1043
+ $vars[] = 'qppr_delete_reg';
1044
+ $vars[] = 'qppr_delete_qr';
1045
  return $vars;
1046
  }
1047
+ function ppr_parse_request_new($wp) {
1048
+ global $wp;
1049
+ if(is_admin() && (isset($_GET['qppr_delete_reg']) || isset($_GET['qppr_delete_qr']))){
1050
+ if( $_GET['qppr_delete_reg'] =='1'){
1051
+ global $wpdb;
1052
+ $wpdb->query("DELETE FROM $wpdb->postmeta WHERE `meta_key` = '_pprredirect_active' OR `meta_key` = '_pprredirect_rewritelink' OR `meta_key` = '_pprredirect_newwindow' OR `meta_key` = '_pprredirect_relnofollow' OR `meta_key` = '_pprredirect_type' OR `meta_key` = '_pprredirect_url';");
1053
+ wp_redirect('admin.php?page=redirect-options&update=2&settings-updated=true',200);
1054
+ exit;
1055
+ }elseif($_GET['qppr_delete_qr'] =='1'){
1056
+ delete_option('quickppr_redirects');
1057
+ delete_option('quickppr_redirects_meta');
1058
+ wp_redirect('admin.php?page=redirect-options&update=3&settings-updated=true',200);
1059
+ exit;
1060
+ }elseif($_GET['qppr_export_qr'] =='1'){
1061
+ wp_die('This option is not available at this time.','Quick Page/Post Redirect Plugin - Export',array('back_link'=>true));
1062
+ exit;
1063
+ }elseif($_GET['qppr_import_qr'] =='1'){
1064
+ wp_die('This option is not available at this time.','Quick Page/Post Redirect Plugin - Import',array('back_link'=>true));
1065
+ exit;
1066
+ }
1067
+ }elseif ( isset($_GET['action']) && $_GET['action'] == 'export_redirects_qppr' ) {
1068
+ $newQPPR_Array = array();
1069
+ check_admin_referer('export-redirects-qppr');
1070
+ header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' );
1071
+ header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
1072
+ header( 'Cache-Control: no-store, no-cache, must-revalidate' );
1073
+ header( 'Cache-Control: post-check=0, pre-check=0', false );
1074
+ header( 'Pragma: no-cache' );
1075
+ header("Content-Type: application/force-download");
1076
+ header("Content-Type: application/octet-stream");
1077
+ header("Content-Type: application/download");
1078
+ header("Content-Disposition: attachment; filename=qppr-quick-redirects-export-".date('U').".txt;");
1079
+ $newQPPR_Array['quickppr_redirects'] = get_option('quickppr_redirects');
1080
+ $newQPPR_Array['quickppr_redirects_meta'] = get_option('quickppr_redirects_meta');
1081
+ die('QUICKPAGEPOSTREDIRECT'.base64_encode(serialize($newQPPR_Array)));
1082
+ exit;
1083
+ } elseif( isset($_POST['import_redirects_qppr']) && isset($_FILES['qppr_file']) ) {
1084
+ check_admin_referer( 'import_redirects_qppr' );
1085
+ if ( $_FILES['qppr_file']['error'] > 0 ) {
1086
+ wp_die('An error occured during the file upload. Please fix your server configuration and retry.', 'SERVER ERROR - Could Not Load',array('response'=>'200','back_link'=>'1'));
1087
+ exit;
1088
+ } else {
1089
+ $config_file = file_get_contents( $_FILES['qppr_file']['tmp_name'] );
1090
+ if ( substr($config_file, 0, strlen('QUICKPAGEPOSTREDIRECT')) !== 'QUICKPAGEPOSTREDIRECT' ) {
1091
+ wp_die('This does not look like a Quick Page Post Redirect config file - it is possibly damaged or corrupt.', 'ERROR - Not a valid File',array('response'=>'200','back_link'=>'1'));
1092
+ exit;
1093
+ } else {
1094
+ $config_file = unserialize(base64_decode(substr($config_file, strlen('QUICKPAGEPOSTREDIRECT'))));
1095
+ if ( !is_array($config_file) ) {
1096
+ wp_die('This does not look like a Quick Page Post Redirect config file - it is possibly damaged or corrupt.', 'ERROR - Not a valid File',array('response'=>'200','back_link'=>'1'));
1097
+ exit;
1098
+ } else {
1099
+ $newQPPRRedirects = $config_file['quickppr_redirects'];
1100
+ $newQPPRMeta = $config_file['quickppr_redirects_meta'];
1101
+ update_option('quickppr_redirects', $newQPPRRedirects);
1102
+ update_option('quickppr_redirects_meta', $newQPPRMeta);
1103
+ wp_redirect(admin_url('admin.php?page=redirect-options&update=4'),302);
1104
+ }
1105
+ }
1106
+ }
1107
+ } elseif( isset($_POST['import_redirects_add_qppr']) && isset($_FILES['qppr_file_add']) ) {
1108
+ check_admin_referer( 'import_redirects_add_qppr' );
1109
+ if ( $_FILES['qppr_file_add']['error'] > 0 ) {
1110
+ wp_die('An error occured during the file upload. Please fix your server configuration and retry.', 'SERVER ERROR - Could Not Load',array('response'=>'200','back_link'=>'1'));
1111
+ exit;
1112
+ } else {
1113
+ $config_file = file_get_contents( $_FILES['qppr_file_add']['tmp_name'] );
1114
+ //------------
1115
+ if ( strpos($config_file,'|') === false ) {
1116
+ wp_die('This does not look like the file is in the correct format - it is possibly damaged or corrupt.<br/>be sure the redirects are 1 per line and the redirect and destination are seperated by a PIPE (|).<br/>Example:<br/><br/><code>redirect|destination</code>', 'ERROR - Not a valid File',array('response'=>'200','back_link'=>'1'));
1117
+ exit;
1118
+ } else {
1119
+ $tempArr = array();
1120
+ $tempMArr = array();
1121
+ $QR_Array = explode("\n",$config_file);
1122
+ if(!empty($QR_Array) && is_array($QR_Array)):
1123
+ foreach($QR_Array as $qrtoadd):
1124
+ $item = explode('|',str_replace(array("\r","\n"), array('',''),$qrtoadd));
1125
+ if(is_array($item) && !empty($item)){
1126
+ $tempArr[$item[0]] = $item[1];
1127
+ if(isset( $item[2]) || isset( $item[3])){
1128
+ $newwin = (isset($item[2]) && ($item[2] != '' && $item[2] != '0')) ? 1 : '';
1129
+ $nofoll = (isset($item[3]) && ($item[3] != '' && $item[3] != '0')) ? 1 : '';
1130
+ $tempMArr[$item[0]]['newwindow'] = $newwin;
1131
+ $tempMArr[$item[0]]['nofollow'] = $nofoll;
1132
+ }else{
1133
+ $tempMArr[$item[0]]['newwindow'] = '';
1134
+ $tempMArr[$item[0]]['nofollow'] = '';
1135
+ }
1136
+ }
1137
+ endforeach;
1138
+ if(!empty($tempArr)){
1139
+ $currQRs = get_option('quickppr_redirects');
1140
+ $resultQR = array_merge($currQRs, $tempArr);
1141
+ update_option('quickppr_redirects',$resultQR);
1142
+ }
1143
+ if(!empty($tempMArr)){
1144
+ $currQRM = get_option('quickppr_redirects_meta');
1145
+ $resultQRM = array_merge($currQRM, $tempMArr);
1146
+ update_option('quickppr_redirects_meta',$resultQRM);
1147
+ }
1148
+ wp_redirect(admin_url('admin.php?page=redirect-options&update=5'),302);
1149
+ exit;
1150
+ else:
1151
+ wp_die('Does not look like there are any valid items to import - check the file and try again.', 'ERROR - No Valid items to add.',array('response'=>'200','back_link'=>'1'));
1152
+ exit;
1153
+ endif;
1154
+ }
1155
+ //-------------
1156
+ }
1157
+ } return;
1158
+ }
1159
  function ppr_parse_request($wp) {
1160
  global $wp;
1161
  if(array_key_exists('pprd', $wp->query_vars) && array_key_exists('scid', $wp->query_vars)){
1163
  if( $wp->query_vars['pprd'] !='' && $wp->query_vars['scid'] == md5($tohash)){
1164
  $theDel = str_replace('pprdel-','',$wp->query_vars['pprd']);
1165
  $redirects = get_option('quickppr_redirects');
1166
+ $redirectsmeta = get_option('quickppr_redirects_meta');
1167
  if (!empty($redirects)) {
1168
  $ww=1;
1169
  foreach ($redirects as $request => $destination) {
1170
  if($ww != (int)$theDel){
1171
  $quickppr_redirects[$request] = $destination;
1172
+ $quickppr_redirectsmeta[$request] = $redirectsmeta[$request];
1173
  }
1174
  $ww++;
1175
  }
1176
  } // end if
1177
  update_option('quickppr_redirects',$quickppr_redirects);
1178
+ update_option('quickppr_redirects_meta',$quickppr_redirectsmeta);
1179
+ $this->build_jQueryCache();
1180
  echo 1;
1181
  exit;
1182
  }else{
1183
  echo 0;
1184
  exit;
1185
  }
1186
+ }elseif(array_key_exists('ver', $wp->query_vars)){
1187
+ if( $wp->query_vars['ver'] =='pprjq1'){
1188
+ if($this->ppruse_jquery == '1'){
1189
+ $pprscript = get_option('qppr_jQuery_cache');
1190
+ }else{
1191
+ $pprscript = '//not set';
1192
+ }
1193
+ if($pprscript == ''){$pprscript = $this->build_jQueryCache();}
1194
+ header('Content-type: text/javascript');
1195
+ echo $pprscript;
1196
+ exit;
1197
+ }
1198
+ return;
1199
+ }elseif(array_key_exists('pprhidemessage', $wp->query_vars)){
1200
+ if( $wp->query_vars['pprhidemessage'] =='1'){
1201
+ update_option('qppr_jQuery_hide_message','1');
1202
+ echo '1';
1203
+ exit;
1204
+ }elseif($wp->query_vars['pprhidemessage'] =='2'){
1205
+ update_option('qppr_jQuery_hide_message2','1');
1206
+ echo '1';
1207
+ exit;
1208
+ }
1209
+ return;
1210
  }else{
1211
  return;
1212
  }
1214
 
1215
  function ppr_init_check_version() {
1216
  // checks version of plugin in DB and updates if needed.
1217
+ $this->ppr_all_redir_array = $this->get_main_array();
1218
+ $this->pprptypes_ok = get_option( 'ppr_qpprptypeok' );
1219
+
1220
  global $wpdb;
1221
  if($this->thepprversion != $this->ppr_curr_version){
1222
+ update_option( 'ppr_use-jquery','1'); //default to on
1223
+ $this->ppruse_jquery = '1';
1224
  update_option( 'ppr_version', $this->ppr_curr_version );
1225
  }
1226
  if($this->thepprmeta != '1'){
1231
 
1232
  function ppr_filter_plugin_actions($links){
1233
  $new_links = array();
1234
+ $new_links[] = '<a href="'.$this->fcmlink.'/donations/">Donate</a>';
1235
  return array_merge($links,$new_links );
1236
  }
1237
 
1238
  function ppr_filter_plugin_links($links, $file){
1239
  if ( $file == plugin_basename(__FILE__) ){
1240
  $links[] = '<a href="'.$this->adminlink.'admin.php?page=redirect-updates">Quick Redirects</a>';
1241
+ $links[] = '<a target="_blank" href="'.$this->fcmlink.'/quick-page-post-redirect-plugin/">FAQ</a>';
1242
+ $links[] = '<a target="_blank" href="'.$this->fcmlink.'/donations/">Donate</a>';
1243
  }
1244
  return $links;
1245
  }
1256
  wp_nonce_field( 'pprredirect_noncename', 'pprredirect_noncename', false, true );
1257
 
1258
  // The actual fields for data entry
1259
+ echo '<label for="pprredirect_active" style="padding:2px 0;"><input type="checkbox" name="pprredirect_active" value="1" '. checked('1',get_post_meta($post->ID,'_pprredirect_active',true),0).' />&nbsp;Make Redirect <b>Active</b>. (check to turn on)</label><br />';
1260
+ echo '<label for="pprredirect_newwindow" style="padding:2px 0;"><input type="checkbox" name="pprredirect_newwindow" id="pprredirect_newwindow" value="_blank" '. checked('_blank',get_post_meta($post->ID,'_pprredirect_newwindow',true),0).'>&nbsp;Open redirect link in a <b>new window.</b></label><br />';
1261
+ echo '<label for="pprredirect_relnofollow" style="padding:2px 0;"><input type="checkbox" name="pprredirect_relnofollow" id="pprredirect_relnofollow" value="1" '. checked('1',get_post_meta($post->ID,'_pprredirect_relnofollow',true),0).'>&nbsp;Add <b>rel=\"nofollow\"</b> to redirect link.</label><br />';
1262
+ echo '<label for="pprredirect_rewritelink" style="padding:2px 0;"><input type="checkbox" name="pprredirect_rewritelink" id="pprredirect_rewritelink" value="1" '. checked('1',get_post_meta($post->ID,'_pprredirect_rewritelink',true),0).'>&nbsp;<b>Show</b> the Redirect URL below in the link instead of this page URL. <b>NOTE: You may have to use the <u>FULL</u> URL below!</b></label><br /><br />';
1263
+ //echo '<label for="pprredirect_casesensitive" style="padding:2px 0;"><input type="checkbox" name="pprredirect_casesensitive" id="pprredirect_casesensitive" value="1" '. checked('1',get_post_meta($post->ID,'_pprredirect_casesensitive',true),0).'>&nbsp;Make the Redirect Case Insensitive.</label><br /><br />';
1264
  echo '<label for="pprredirect_url"><b>Redirect URL:</b></label><br />';
1265
  if(get_post_meta($post->ID, '_pprredirect_url', true)!=''){$pprredirecturl=get_post_meta($post->ID, '_pprredirect_url', true);}else{$pprredirecturl="";}
1266
  echo '<input type="text" style="width:75%;margin-top:2px;margin-bottom:2px;" name="pprredirect_url" value="'.$pprredirecturl.'" /><br />(i.e., <code>http://example.com</code> or <code>/somepage/</code> or <code>p=15</code> or <code>155</code>. Use <b>FULL URL</b> <i>including</i> <code>http://</code> for all external <i>and</i> meta redirects. )<br /><br />';
1311
  $my_meta_data['_pprredirect_relnofollow'] = $_REQUEST['pprredirect_relnofollow'];
1312
  $my_meta_data['_pprredirect_type'] = $_REQUEST['pprredirect_type'];
1313
  $my_meta_data['_pprredirect_rewritelink'] = $_REQUEST['pprredirect_rewritelink'];
1314
+ $my_meta_data['_pprredirect_url'] = $_REQUEST['pprredirect_url'];
1315
+ //$my_meta_data['_pprredirect_casesensitive'] = $_REQUEST['pprredirect_casesensitive'];
1316
 
1317
  if ( 0 === strpos($my_meta_data['_pprredirect_url'], 'www.'))
1318
  $my_meta_data['_pprredirect_url'] = 'http://' . $my_meta_data['_pprredirect_url'] ; // Starts with www., so add http://
1340
  }
1341
  }
1342
  endif;
1343
+ $this->build_jQueryCache();
1344
  }
1345
 
1346
  function ppr_fix_targetsandrels($pages) {
1438
  }
1439
 
1440
  function redirect(){
1441
+ // Read the list of redirects and if the current page is found in the list, send the visitor on her way
1442
  if (!empty($this->quickppr_redirects) && !is_admin()) {
1443
+ $userrequest = str_replace(get_option('home'),'',$this->getAddress());
1444
+ //get the query string if there is one so that it can be preserved
1445
+ $finalQS = '';
1446
+ if(isset($_GET)){
1447
+ $useURLQS = array();
1448
+ if(count($_GET) >= 1){
1449
+ foreach($_GET as $key => $value){$useURLQS[] = $key.'='.$value;}
1450
+ $finalQS = '?'.implode('&',$useURLQS);
1451
+ $userrequest = preg_replace('/\?.*/', '', $userrequest);
1452
+ }
1453
+ }
1454
+ //end QS preservation
1455
+
1456
+ $needle = $this->pproverride_casesensitive ? $userrequest : strtolower($userrequest);
1457
+ $haystack = $this->pproverride_casesensitive ? $this->quickppr_redirects : array_change_key_case($this->quickppr_redirects);
1458
+ $index = false;
1459
+
1460
+ if(array_key_exists($needle, $haystack)){
1461
+ $index = $needle;
1462
+ } elseif(strpos($needle,'/') === false) {
1463
+ if(array_key_exists('/'.$needle.'/', $haystack)){
1464
+ $index = '/'.$needle.'/';
1465
+ }
1466
+ }else{
1467
+ if(array_key_exists($needle.'/', $haystack)){
1468
+ $index = $needle.'/';
 
 
 
1469
  }
1470
  }
1471
+ if($index){
1472
+ $val = $haystack[$index];
1473
+ if($val) {
1474
+ $useURL = $this->pproverride_URL!='' ? $this->pproverride_URL : $val;
1475
+ $useURL .= $finalQS; //add QS back
1476
+ do_action('qppr_redirect',$useURL,$this->pproverride_type);
1477
+ if($this->pproverride_type == 'meta'){
1478
+ $this->ppr_metaurl = $useURL;
1479
+ add_action('wp_head', array($this,'ppr_addmetatohead_theme'),1);
1480
+ }else{
1481
+ wp_redirect($useURL,$this->pproverride_type);
1482
+ exit();
1483
+ }
1484
+ }
1485
+ }
1486
  }
1487
  }
1488
 
1513
  // check if override is set for all redirects to go to one URL
1514
  if($this->pproverride_URL !=''){$urlsite=$this->pproverride_URL;}
1515
  if($this->pproverride_type!='0' && $this->pproverride_type!=''){$redrtype = $this->pproverride_type;} //override check
1516
+ if($redrtype == 'meta'){
1517
+ $this->ppr_metaurl = $redrurl;
1518
+ add_action('wp_head', array($this,'ppr_addmetatohead_theme'),1);
1519
+ }else{
1520
+ wp_redirect($urlsite,$redrtype);
1521
+ exit();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1522
  }
1523
  }
1524
  }
1562
  //=======================================
1563
  // END Main Redirect Class.
1564
  //=======================================
1565
+ function start_ppr_class(){
1566
+ $redirect_plugin = new quick_page_post_reds(); // call our class
1567
+ }
1568
  ?>
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Quick Page/Post Redirect Plugin ===
2
  Contributors: Don Fischer
3
- Donate link: http://www.fischercreativemedia.com/wordpress-plugins/donate/
4
- Tags: redirect, 301, 302, meta, post, plugin, page, forward, re-direct, nofollow, menu links, posts, pages, admin, 404, custom post types, nav menu
5
  Requires at least: 3.1
6
- Tested up to: 3.3.2
7
- Stable tag: 4.2.3
8
 
9
  Redirect Pages/Posts to another page/post or external URL. Has edit box as well as global options. Specify the redirect Location and type. For PHP5+
10
 
@@ -15,6 +15,7 @@ It adds an option box to the edit section where you can specify the redirect loc
15
  = Features: =
16
  * Works with new WordPress menus
17
  * Works with new WordPress Custom Post Types (set option on settings page)
 
18
  * You can set a redirect page or menu link to open in a new window (will not work on permalinks)
19
  * You can add a *rel="nofollow"* attribute to the page or menu link of the redirect (will not work on permalinks)
20
  * You can completely re-write the URL for the redirect so it takes the place of the default page URL (rewrite the href link)
@@ -22,20 +23,24 @@ It adds an option box to the edit section where you can specify the redirect loc
22
  * Redirect Location can be to another WordPress page/post or any other website with an external URL.
23
  * Redirect can use a full URL path, the post or page ID, permalink or page-name (not available for Quick Redirects method).
24
  * Option Screen to set global overrides like turning off all redirects at once, setting a global destination link, make all redirect open in a new window, etc.
25
- * View a summary of all individual redirected pages/posts or custom post types that are currently set up.
 
 
 
26
 
27
- This plugin is not compatible with WordPress versions less than 2.5. Requires PHP 5+.
28
 
29
- *PLEASE NOTE:* A new page or post needs to be Published in order for the redirect to happen. It WILL work on a DRAFT Status Post/Page ONLY, and I mean ONLY, if the Post/Page has FIRST been Published and the re-saved as a Draft.
30
 
31
  = TROUBLESHOOTING: =
32
  * To include custom post types, check the setting on the main plugin option page.
33
  * If you check the box for "Show Redirect URL below" on the edit page, please note that you MUST use the full URL in the Redirect URL box. If you do not, you may experience some odd links and 404 pages, as this option changes the Permalink for the page/post to the EXACT URL you enter in that field. (i.e., if you enter '2' in the field, it will redirect to 'http://2' which is not the same as 'http://yoursite.com/?p=2').
34
  * If your browser tells you that your are in an infinite loop, check to make sure you do not have pages redirecting to another page that redirects back to the initial page. That WILL cause an infinite loop.
35
- * If you are using the Quick 301 Redirects method to do your redirects, be sure that your Request URL starts with a / and is relative to the root (i.e., http://mysite.com/test/ would have /test/ in the request field).
36
- * Links in page/post content and Permalinks will not open in a new window or add the rel=nofollow. That is because the theme template actually sets up the links by calling "the_permalink()" function so add these elements is not consistently possible so it has been excluded from the functionality.
37
  * If your page or post is not redirecting, this is most likely because something else like the theme functions file or another plugin is outputting the header BEFORE the plugin can perform the redirect. This can be tested by turning off all plugins except the Quick Page/Post Redirect Plugin and testing if the redirect works. 9 out of 10 times, a plugin or bad code is the culprit.
38
- * We have tested the plugin in dozens of themes and alongside a whole lot more plugins. In our experience, (with exception to a few bugs) most of the time another plugin is the problem. If you do notice a problem, please let us know at plugins@fischercreativemedia.com - along with the WP version, theme you are using and plugins you have installed - and we will try to troubleshoot the problem.
 
39
 
40
  == Installation ==
41
 
@@ -52,6 +57,8 @@ This plugin is not compatible with WordPress versions less than 2.5. Requires PH
52
  1. You can create a redirect with the 'Quick Redirects' option located in the Admin Settings menu.
53
 
54
  == Frequently Asked Questions ==
 
 
55
  = With 3.0s new menu structure, isn't your plugin now obsolete? =
56
  Yes, and No. Mostly No.
57
  Here is why - with WordPress 3.0, comes the new menu structure, but only a handful of themes actually have the menu structure already integrated into theme. This means that there are tons of themes out there that still need to use the the old way until they can update their theme template pages and functions to turn on the menu capability.
@@ -68,10 +75,10 @@ If you had a link on a site that went to http://yoursite.com/aboutme.html you ca
68
  The functionality is located in the REDIRECT MENU under Quick Redirects. The old URL goes in the Request field and the to new URL goes in the Destination field. Simple and Quick!
69
 
70
  = Can I add 'rel="nofollow" attribute to the redirect link? =
71
- YES, you can add a ' rel="nofollow" ' attribute for the redirect link. Simply check the "add rel=nofollow" box when setting up the redirect on the page/post edit page. Note - this option is not available for the Quick Redirects method or for permalinks and link within post content.
72
 
73
  = Can I make the redirect open in a new window? =
74
- YES, you can make the redirect link open in a new window. Simply check the "Open in a new window" box when setting up the redirect on the page/post edit page. Note - this option is not available for the Quick Redirects method or for permalinks and link within post content.
75
 
76
  = I want to just have the link for the redirecting page/post show the new redirect link in the link, not the old one, can I do that? =
77
  YES, you can hide the original page link and have it replaced with the redirect link. Any place the theme calls either "wp_page_links", "post_links" or "page_links" functions, the plugin can replace the original link with the new one. Simply check the "Show Redirect URL" box when setting up the redirect on the page/post edit page. Note - this option is not available for the Quick Redirects method.
@@ -108,17 +115,36 @@ Still not sure? Try 302 for now - at least until you have a little time to read
108
  = Should I use a full URL with http:// or https:// ? =
109
  Yes, you can, but you do not always need to. If you are redirecting to an external URL, then yes. If you are just redirecting to another page or post on your site, then no, it is not needed. When in doubt, use the entire URL.
110
 
 
 
 
111
 
112
  == Screenshots ==
113
 
114
- 1. The Redirect Menu and available option pages (updated for version 4.0).
115
- 2. Quick 301 Redirects Page (Added in version 1.8).
116
- 3. Main settings and Options page (new in version 4.0)
117
- 4. Summary of redirects page (new in version 4.0)
 
 
118
 
119
  == Changelog ==
120
- = 4.2.3 =
121
- * Fix WP_PLUGIN_URL and replace with plugins_url() to help with redirects on SSL. (01/01/2012)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
 
123
  = 4.2.2 =
124
  * Fix some embarrasing spelling errors.(07/14/2011)
@@ -202,6 +228,5 @@ Yes, you can, but you do not always need to. If you are redirecting to an extern
202
  * Initial Plugin creation (7/1/2009)
203
 
204
  == Upgrade Notice ==
205
-
206
- = 4.2.3 =
207
- Fix for SSL sites - replaces WP_PLUGIN_URL constant with plugins_url() funsction for proper URL Protocol return.
1
  === Quick Page/Post Redirect Plugin ===
2
  Contributors: Don Fischer
3
+ Donate link: http://www.fischercreativemedia.com/donations/
4
+ Tags: redirect, 301, 302, meta, post, plugin, page, forward, re-direct, nofollow, menu links, posts, pages, admin, 404, custom post types, nav menu, import, export, restore
5
  Requires at least: 3.1
6
+ Tested up to: 3.4.2
7
+ Stable tag: trunk
8
 
9
  Redirect Pages/Posts to another page/post or external URL. Has edit box as well as global options. Specify the redirect Location and type. For PHP5+
10
 
15
  = Features: =
16
  * Works with new WordPress menus
17
  * Works with new WordPress Custom Post Types (set option on settings page)
18
+ * jQuery integration for more enhanced re-writes (set option on settings page).
19
  * You can set a redirect page or menu link to open in a new window (will not work on permalinks)
20
  * You can add a *rel="nofollow"* attribute to the page or menu link of the redirect (will not work on permalinks)
21
  * You can completely re-write the URL for the redirect so it takes the place of the default page URL (rewrite the href link)
23
  * Redirect Location can be to another WordPress page/post or any other website with an external URL.
24
  * Redirect can use a full URL path, the post or page ID, permalink or page-name (not available for Quick Redirects method).
25
  * Option Screen to set global overrides like turning off all redirects at once, setting a global destination link, make all redirect open in a new window, etc.
26
+ * View a summary of all redirected pages/posts or custom post types and Quick Redirects that are currently set up.
27
+ * Plugin Clean up functions for those who decide they may want to remove all plugin data.
28
+ * Import/Export of redirects for backup, or to bulk add redirects.
29
+ * Built-in FAQs/Help that can be updated daily with relevant questions.
30
 
31
+ This plugin is not compatible with WordPress versions less than 3.1. Requires PHP 5+.
32
 
33
+ *PLEASE NOTE:* A new page or post needs to be Published in order for Page/Post redirect to happen. It WILL work on a DRAFT Status Post/Page ONLY, and I mean ONLY, if the Post/Page has FIRST been Published and the re-saved as a Draft. This does not apply to Quick Redirects.
34
 
35
  = TROUBLESHOOTING: =
36
  * To include custom post types, check the setting on the main plugin option page.
37
  * If you check the box for "Show Redirect URL below" on the edit page, please note that you MUST use the full URL in the Redirect URL box. If you do not, you may experience some odd links and 404 pages, as this option changes the Permalink for the page/post to the EXACT URL you enter in that field. (i.e., if you enter '2' in the field, it will redirect to 'http://2' which is not the same as 'http://yoursite.com/?p=2').
38
  * If your browser tells you that your are in an infinite loop, check to make sure you do not have pages redirecting to another page that redirects back to the initial page. That WILL cause an infinite loop.
39
+ * If you are using the Quick Redirects method to do your redirects, be sure that your Request URL starts with a / and is relative to the root (i.e., http://mysite.com/test/ would have /test/ in the request field).
40
+ * Links in page/post content and Permalinks will not open in a new window or add the rel=nofollow. That is because the theme template actually sets up the links by calling "the_permalink()" function so adding these elements is not consistently possible. You can however, have the attempt to use a jQuery replace to try to fix the issue - to do this enable the jQuery option in the settings.
41
  * If your page or post is not redirecting, this is most likely because something else like the theme functions file or another plugin is outputting the header BEFORE the plugin can perform the redirect. This can be tested by turning off all plugins except the Quick Page/Post Redirect Plugin and testing if the redirect works. 9 out of 10 times, a plugin or bad code is the culprit.
42
+ * We have tested the plugin in dozens of themes and alongside a whole lot more plugins. In our experience, (with exception to a few bugs from time to time) most of the time another plugin is the problem. If you do notice a problem, please let us know at plugins@fischercreativemedia.com - along with the WP version, theme you are using and plugins you have installed - and we will try to troubleshoot the problem.
43
+ * Check the FAQs/Help located in the Plugin menu for more up to date issues and fixes.
44
 
45
  == Installation ==
46
 
57
  1. You can create a redirect with the 'Quick Redirects' option located in the Admin Settings menu.
58
 
59
  == Frequently Asked Questions ==
60
+ ** SEE A LIST OF MORE UP TO DATE FAQS IN THE PLUGIN MENU ITSELF **
61
+
62
  = With 3.0s new menu structure, isn't your plugin now obsolete? =
63
  Yes, and No. Mostly No.
64
  Here is why - with WordPress 3.0, comes the new menu structure, but only a handful of themes actually have the menu structure already integrated into theme. This means that there are tons of themes out there that still need to use the the old way until they can update their theme template pages and functions to turn on the menu capability.
75
  The functionality is located in the REDIRECT MENU under Quick Redirects. The old URL goes in the Request field and the to new URL goes in the Destination field. Simple and Quick!
76
 
77
  = Can I add 'rel="nofollow" attribute to the redirect link? =
78
+ YES, you can add a ' rel="nofollow" ' attribute for the redirect link. Simply check the "add rel=nofollow" box when setting up the redirect on the page/post edit page. Note - this option is only available for the Quick Redirects method when the 'use with jQuery' functionality is enabled in the settings.
79
 
80
  = Can I make the redirect open in a new window? =
81
+ YES, you can make the redirect link open in a new window. Simply check the "Open in a new window" box when setting up the redirect on the page/post edit page. Note - this option is only available for the Quick Redirects method when the 'use with jQuery' functionality is enabled in the settings.
82
 
83
  = I want to just have the link for the redirecting page/post show the new redirect link in the link, not the old one, can I do that? =
84
  YES, you can hide the original page link and have it replaced with the redirect link. Any place the theme calls either "wp_page_links", "post_links" or "page_links" functions, the plugin can replace the original link with the new one. Simply check the "Show Redirect URL" box when setting up the redirect on the page/post edit page. Note - this option is not available for the Quick Redirects method.
115
  = Should I use a full URL with http:// or https:// ? =
116
  Yes, you can, but you do not always need to. If you are redirecting to an external URL, then yes. If you are just redirecting to another page or post on your site, then no, it is not needed. When in doubt, use the entire URL.
117
 
118
+ = That's all the FAQs you have? =
119
+ NO it isn't! Check the plugin FAQs/Help page for a more up to date list of Frequently Asked Questions. The plugin now has a live feed of FAQs that can be updated regularly. If you have something you thin we should add, please let us know.
120
+
121
 
122
  == Screenshots ==
123
 
124
+ 1. New FAQs/Help Page. This is updated off an RSS feed so it can be updated regularly with fixs and common questions.
125
+ 2. Setting Page. Includes new Import and Export features.
126
+ 3. More detailed view of Import/Export Feature.
127
+ 4. Plugin Clean Up feature. You can delete ALL plugin data!
128
+ 5. Quick Redirects setup page.
129
+ 5. Summary of redirects plugin page.
130
 
131
  == Changelog ==
132
+ = 5.0 =
133
+ * Added jQuery version check to ensure no problmes with themes forcing older versions of jQuery
134
+ * Added a few warning /info messages to Quick Redirects page.
135
+ * Redirect summary was updated to display Quick Redirects as well as individual redirects. Now it is easier to see at a glance what redirects you have set up.
136
+ * Rewrite of Quick Redirects functions to allow selecting Open in New Window (NW) and rel=nofollow (NF) as long as 'use jQuery' is selected.
137
+ * Added "use jQuery" option on settings page - on by default after upgrade
138
+ * Added jQuery redirect replace, target="_blank", and rel="nofollow" to increase success for additional options (mainly Quick redirects).
139
+ * Changed out WP_PLUGIN_URL for plugins_url() to help resolve errors in redirects for SSL/https
140
+ * Changed the way custom post types are handled.These are now on by default for new users - or users who have not specifically set to off.
141
+ * The ability to turn off the Plugin Meta Box for any post type was added (admin permissions required).
142
+ * Import and Export features were added to allow for backup of existing Quick Redirects, Restoring a backup or adding bulk redirects.
143
+ * Plugin clean-up features were added to completely remove either Page/Post meta data (for regular redirects), Quick Redirects, or both.
144
+ * Several filter and action hooks were added to help users better integrate the plugin into their theme, should they need additional functionality.
145
+ * New FAQs/Help page with items provided by an RSS feed, so we can easily update FAQs when common questions/issues arise.
146
+ * Query String data is now preserved for Quick Redirects (thanks to Jon Wilson for the contribution).
147
+ * Case insensitivity option was added for Quick Redirects (thanks to Brian DiChiara for the contribution).
148
 
149
  = 4.2.2 =
150
  * Fix some embarrasing spelling errors.(07/14/2011)
228
  * Initial Plugin creation (7/1/2009)
229
 
230
  == Upgrade Notice ==
231
+ = 5.0 =
232
+ This upgrade contains fixes bugs for SSL Force installs and fixes PHP NOTICE/WARNING Messages on settings pages when no Quick Redirects are set up. Several new features have been added.
 
screenshot-1.jpg CHANGED
Binary file
screenshot-2.jpg CHANGED
Binary file
screenshot-3.jpg CHANGED
Binary file
screenshot-4.jpg CHANGED
Binary file
screenshot-5.jpg ADDED
Binary file
screenshot-6.jpg ADDED
Binary file