Version Description
- Pro: "After First Login" condition.
- Fixed: PHP Notice Trying to get property user_login of non-object.
Download this release
Release Info
Developer | Collizo4sky |
Plugin | Peter’s Login Redirect |
Version | 3.0.4.0 |
Comparing to | |
See all releases |
Code changes from version 3.0.3.0 to 3.0.4.0
- changelog.txt +4 -0
- languages/peters-login-redirect.pot +110 -59
- readme.txt +9 -4
- src/core/src/Admin/AbstractSettingsPage.php +1 -0
- src/core/src/Admin/RedirectionsPage.php +14 -4
- src/core/src/Admin/SettingsPage.php +0 -5
- src/core/src/Admin/views/view.condition-rule.php +3 -2
- src/core/src/Admin/views/view.pro-conditions.php +3 -0
- src/core/src/Core.php +5 -0
- src/core/src/Functions.php +7 -0
- src/core/src/Helpers.php +144 -14
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +7 -7
- vendor/composer/autoload_static.php +4 -4
- vendor/composer/installed.json +7 -7
- vendor/composer/installed.php +3 -3
- wplogin_redirect.php +2 -2
changelog.txt
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
== Changelog ==
|
2 |
|
|
|
|
|
|
|
|
|
3 |
= 3.0.3.0 =
|
4 |
* Fixed bug with wp list pagination per page not working.
|
5 |
|
1 |
== Changelog ==
|
2 |
|
3 |
+
= 3.0.4.0 =
|
4 |
+
* Pro: ["After First Login" condition](https://loginwp.com/article/redirect-wordpress-users-after-first-login/?ref=changelog).
|
5 |
+
* Fixed: PHP Notice Trying to get property ‘user_login’ of non-object.
|
6 |
+
|
7 |
= 3.0.3.0 =
|
8 |
* Fixed bug with wp list pagination per page not working.
|
9 |
|
languages/peters-login-redirect.pot
CHANGED
@@ -2,9 +2,10 @@
|
|
2 |
# This file is distributed under the same license as the LoginWP (Formerly Peter's Login Redirect) package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: LoginWP (Formerly Peter's Login Redirect) 3.0.
|
6 |
-
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/peters-login-
|
7 |
-
"
|
|
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -37,7 +38,9 @@ msgid "Need Support?"
|
|
37 |
msgstr ""
|
38 |
|
39 |
#: src/core/src/Admin/AbstractSettingsPage.php:126
|
40 |
-
msgid "
|
|
|
|
|
41 |
msgstr ""
|
42 |
|
43 |
#: src/core/src/Admin/AbstractSettingsPage.php:133
|
@@ -49,20 +52,26 @@ msgid "Redirect to currently viewing page"
|
|
49 |
msgstr ""
|
50 |
|
51 |
#: src/core/src/Admin/AbstractSettingsPage.php:142
|
52 |
-
#: src/core/src/Admin/views/view.pro-conditions.php:
|
53 |
msgid "Get LoginWP Pro →"
|
54 |
msgstr ""
|
55 |
|
56 |
#: src/core/src/Admin/AbstractSettingsPage.php:160
|
57 |
-
msgid "
|
|
|
|
|
58 |
msgstr ""
|
59 |
|
60 |
#: src/core/src/Admin/AbstractSettingsPage.php:168
|
61 |
-
msgid "
|
|
|
|
|
62 |
msgstr ""
|
63 |
|
64 |
#: src/core/src/Admin/AbstractSettingsPage.php:176
|
65 |
-
msgid "
|
|
|
|
|
66 |
msgstr ""
|
67 |
|
68 |
#: src/core/src/Admin/Admin.php:39
|
@@ -78,7 +87,9 @@ msgid "Are you sure?"
|
|
78 |
msgstr ""
|
79 |
|
80 |
#: src/core/src/Admin/Admin.php:112
|
81 |
-
msgid "
|
|
|
|
|
82 |
msgstr ""
|
83 |
|
84 |
#: src/core/src/Admin/Admin.php:133 src/core/src/Admin/SettingsPage.php:29
|
@@ -106,16 +117,22 @@ msgstr ""
|
|
106 |
msgid "Support"
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: src/core/src/Admin/Admin.php:165 src/core/src/Admin/RedirectionsPage.php:
|
110 |
msgid "Upgrade to PRO"
|
111 |
msgstr ""
|
112 |
|
113 |
#: src/core/src/Admin/Admin.php:183
|
114 |
-
msgid "
|
|
|
|
|
115 |
msgstr ""
|
116 |
|
117 |
#: src/core/src/Admin/Admin.php:213
|
118 |
-
msgid "
|
|
|
|
|
|
|
|
|
119 |
msgstr ""
|
120 |
|
121 |
#: src/core/src/Admin/Admin.php:217
|
@@ -135,7 +152,9 @@ msgid "Could not install plugin. Please download and install manually."
|
|
135 |
msgstr ""
|
136 |
|
137 |
#: src/core/src/Admin/ProfilePress.php:59
|
138 |
-
msgid "
|
|
|
|
|
139 |
msgstr ""
|
140 |
|
141 |
#: src/core/src/Admin/ProfilePress.php:125
|
@@ -171,15 +190,17 @@ msgid "Login Forms"
|
|
171 |
msgstr ""
|
172 |
|
173 |
#. translators: %s - Lite plugin download URL.
|
174 |
-
|
175 |
#: src/core/src/Admin/ProfilePress.php:207
|
176 |
-
msgid "
|
|
|
|
|
177 |
msgstr ""
|
178 |
|
179 |
#. translators: %s - Lite plugin download URL.
|
180 |
-
|
181 |
#: src/core/src/Admin/ProfilePress.php:219
|
182 |
-
msgid "
|
|
|
|
|
183 |
msgstr ""
|
184 |
|
185 |
#: src/core/src/Admin/ProfilePress.php:230
|
@@ -224,7 +245,10 @@ msgid "Modern Custom Login Forms & Membership Plugin"
|
|
224 |
msgstr ""
|
225 |
|
226 |
#: src/core/src/Admin/ProfilePress.php:477
|
227 |
-
msgid "
|
|
|
|
|
|
|
228 |
msgstr ""
|
229 |
|
230 |
#: src/core/src/Admin/ProfilePress.php:500
|
@@ -232,23 +256,33 @@ msgid "ProfilePress screenshot"
|
|
232 |
msgstr ""
|
233 |
|
234 |
#: src/core/src/Admin/ProfilePress.php:501
|
235 |
-
msgid "
|
|
|
|
|
236 |
msgstr ""
|
237 |
|
238 |
#: src/core/src/Admin/ProfilePress.php:502
|
239 |
-
msgid "
|
|
|
|
|
240 |
msgstr ""
|
241 |
|
242 |
#: src/core/src/Admin/ProfilePress.php:503
|
243 |
-
msgid "
|
|
|
|
|
244 |
msgstr ""
|
245 |
|
246 |
#: src/core/src/Admin/ProfilePress.php:504
|
247 |
-
msgid "
|
|
|
|
|
248 |
msgstr ""
|
249 |
|
250 |
#: src/core/src/Admin/ProfilePress.php:505
|
251 |
-
msgid "
|
|
|
|
|
252 |
msgstr ""
|
253 |
|
254 |
#: src/core/src/Admin/ProfilePress.php:533
|
@@ -425,37 +459,39 @@ msgstr ""
|
|
425 |
msgid "ERROR: Non-existent level submitted"
|
426 |
msgstr ""
|
427 |
|
428 |
-
#: src/core/src/Admin/RedirectionsPage.php:
|
429 |
msgid "ERROR: Unknown error editing redirect rule"
|
430 |
msgstr ""
|
431 |
|
432 |
-
#: src/core/src/Admin/RedirectionsPage.php:
|
433 |
msgid "ERROR: Unknown error when adding the redirect rule"
|
434 |
msgstr ""
|
435 |
|
436 |
-
#: src/core/src/Admin/RedirectionsPage.php:
|
437 |
-
#: src/core/src/Admin/RedirectionsPage.php:
|
438 |
msgid "ERROR: Unknown problem updating URL"
|
439 |
msgstr ""
|
440 |
|
441 |
-
#: src/core/src/Admin/RedirectionsPage.php:
|
442 |
msgid "User ID of user"
|
443 |
msgstr ""
|
444 |
|
445 |
-
#: src/core/src/Admin/RedirectionsPage.php:
|
446 |
msgid "Username of user"
|
447 |
msgstr ""
|
448 |
|
449 |
-
#: src/core/src/Admin/RedirectionsPage.php:
|
450 |
msgid "Author URL slug or user nicename"
|
451 |
msgstr ""
|
452 |
|
453 |
-
#: src/core/src/Admin/RedirectionsPage.php:
|
454 |
msgid "Website URL"
|
455 |
msgstr ""
|
456 |
|
457 |
-
#: src/core/src/Admin/RedirectionsPage.php:
|
458 |
-
msgid "
|
|
|
|
|
459 |
msgstr ""
|
460 |
|
461 |
#: src/core/src/Admin/SettingsPage.php:26
|
@@ -463,21 +499,23 @@ msgid "Settings - LoginWP"
|
|
463 |
msgstr ""
|
464 |
|
465 |
#: src/core/src/Admin/SettingsPage.php:49
|
466 |
-
#: src/core/src/Admin/SettingsPage.php:
|
467 |
msgid "General"
|
468 |
msgstr ""
|
469 |
|
470 |
-
#: src/core/src/Admin/SettingsPage.php:
|
471 |
msgid "Remove Data on Uninstall"
|
472 |
msgstr ""
|
473 |
|
474 |
-
#: src/core/src/Admin/SettingsPage.php:
|
475 |
#: src/core/src/Admin/SettingsPageApi.php:1009
|
476 |
msgid "Activate"
|
477 |
msgstr ""
|
478 |
|
479 |
-
#: src/core/src/Admin/SettingsPage.php:
|
480 |
-
msgid "
|
|
|
|
|
481 |
msgstr ""
|
482 |
|
483 |
#: src/core/src/Admin/SettingsPageApi.php:857
|
@@ -541,7 +579,9 @@ msgid "Redirect Settings"
|
|
541 |
msgstr ""
|
542 |
|
543 |
#: src/core/src/Admin/views/view.bottom-settings.php:86
|
544 |
-
msgid "
|
|
|
|
|
545 |
msgstr ""
|
546 |
|
547 |
#: src/core/src/Admin/views/view.bottom-settings.php:92
|
@@ -555,61 +595,69 @@ msgid "No"
|
|
555 |
msgstr ""
|
556 |
|
557 |
#: src/core/src/Admin/views/view.bottom-settings.php:101
|
558 |
-
msgid "
|
|
|
|
|
559 |
msgstr ""
|
560 |
|
561 |
#: src/core/src/Admin/views/view.condition-rule.php:15
|
562 |
msgid "Select a condition"
|
563 |
msgstr ""
|
564 |
|
565 |
-
#: src/core/src/Admin/views/view.condition-rule.php:
|
566 |
msgid "Order"
|
567 |
msgstr ""
|
568 |
|
569 |
#: src/core/src/Admin/views/view.pro-conditions.php:4
|
570 |
-
|
571 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
572 |
msgid "Enrolled Course"
|
573 |
msgstr ""
|
574 |
|
575 |
-
#: src/core/src/Admin/views/view.pro-conditions.php:
|
576 |
msgid "User Group"
|
577 |
msgstr ""
|
578 |
|
579 |
-
#: src/core/src/Admin/views/view.pro-conditions.php:
|
580 |
msgid "Purchased Product"
|
581 |
msgstr ""
|
582 |
|
583 |
-
#: src/core/src/Admin/views/view.pro-conditions.php:
|
584 |
msgid "Purchased Product Category"
|
585 |
msgstr ""
|
586 |
|
587 |
-
#: src/core/src/Admin/views/view.pro-conditions.php:
|
588 |
msgid "Active User Subscription"
|
589 |
msgstr ""
|
590 |
|
591 |
-
#: src/core/src/Admin/views/view.pro-conditions.php:
|
592 |
msgid "Active Membership Plan"
|
593 |
msgstr ""
|
594 |
|
595 |
-
#: src/core/src/Admin/views/view.pro-conditions.php:
|
596 |
msgid "Subscribed Membership Plan"
|
597 |
msgstr ""
|
598 |
|
599 |
-
#: src/core/src/Admin/views/view.pro-conditions.php:
|
600 |
msgid "Subscribed Membership"
|
601 |
msgstr ""
|
602 |
|
603 |
-
#: src/core/src/Admin/views/view.pro-conditions.php:
|
604 |
msgid "Active Membership Level"
|
605 |
msgstr ""
|
606 |
|
607 |
-
#: src/core/src/Admin/views/view.pro-conditions.php:
|
608 |
msgid "Enrolled Membership"
|
609 |
msgstr ""
|
610 |
|
611 |
-
#: src/core/src/Admin/views/view.pro-conditions.php:30
|
612 |
#: src/core/src/Admin/views/view.pro-conditions.php:33
|
|
|
613 |
msgid "Website Current Language"
|
614 |
msgstr ""
|
615 |
|
@@ -622,7 +670,9 @@ msgid "Site Admin"
|
|
622 |
msgstr ""
|
623 |
|
624 |
#: src/core/src/MoAdminNotice.php:64
|
625 |
-
msgid "
|
|
|
|
|
626 |
msgstr ""
|
627 |
|
628 |
#: src/core/src/MoAdminNotice.php:73
|
@@ -636,22 +686,23 @@ msgstr ""
|
|
636 |
#: src/core/src/MoAdminNotice.php:87
|
637 |
msgid "Dismiss this notice"
|
638 |
msgstr ""
|
|
|
639 |
#. Plugin Name of the plugin/theme
|
640 |
msgid "LoginWP (Formerly Peter's Login Redirect)"
|
641 |
msgstr ""
|
642 |
|
|
|
643 |
#. Plugin URI of the plugin/theme
|
|
|
|
|
644 |
msgid "https://loginwp.com"
|
645 |
msgstr ""
|
646 |
|
647 |
#. Description of the plugin/theme
|
648 |
-
msgid "
|
|
|
649 |
msgstr ""
|
650 |
|
651 |
#. Author of the plugin/theme
|
652 |
msgid "LoginWP Team"
|
653 |
msgstr ""
|
654 |
-
|
655 |
-
#. Author URI of the plugin/theme
|
656 |
-
msgid "https://loginwp.com"
|
657 |
-
msgstr ""
|
2 |
# This file is distributed under the same license as the LoginWP (Formerly Peter's Login Redirect) package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: LoginWP (Formerly Peter's Login Redirect) 3.0.4.0\n"
|
6 |
+
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/peters-login-"
|
7 |
+
"redirect\n"
|
8 |
+
"POT-Creation-Date: 2022-10-27 21:33:47+00:00\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
38 |
msgstr ""
|
39 |
|
40 |
#: src/core/src/Admin/AbstractSettingsPage.php:126
|
41 |
+
msgid ""
|
42 |
+
"Enhance the power of LoginWP with the Pro version featuring integrations "
|
43 |
+
"with many plugins. %sLearn more%s"
|
44 |
msgstr ""
|
45 |
|
46 |
#: src/core/src/Admin/AbstractSettingsPage.php:133
|
52 |
msgstr ""
|
53 |
|
54 |
#: src/core/src/Admin/AbstractSettingsPage.php:142
|
55 |
+
#: src/core/src/Admin/views/view.pro-conditions.php:49
|
56 |
msgid "Get LoginWP Pro →"
|
57 |
msgstr ""
|
58 |
|
59 |
#: src/core/src/Admin/AbstractSettingsPage.php:160
|
60 |
+
msgid ""
|
61 |
+
"Whether you need help or have a new feature request, let us know. %sRequest "
|
62 |
+
"Support%s"
|
63 |
msgstr ""
|
64 |
|
65 |
#: src/core/src/Admin/AbstractSettingsPage.php:168
|
66 |
+
msgid ""
|
67 |
+
"Detailed documentation is also available on the plugin website. %sView "
|
68 |
+
"Knowledge Base%s"
|
69 |
msgstr ""
|
70 |
|
71 |
#: src/core/src/Admin/AbstractSettingsPage.php:176
|
72 |
+
msgid ""
|
73 |
+
"If you are enjoying LoginWP and find it useful, please consider leaving a "
|
74 |
+
"★★★★★ review on WordPress.org. %sLeave a Review%s"
|
75 |
msgstr ""
|
76 |
|
77 |
#: src/core/src/Admin/Admin.php:39
|
87 |
msgstr ""
|
88 |
|
89 |
#: src/core/src/Admin/Admin.php:112
|
90 |
+
msgid ""
|
91 |
+
"Thank you for using LoginWP. Please rate the plugin %1$s on %2$sWordPress.org"
|
92 |
+
"%3$s to help us spread the word."
|
93 |
msgstr ""
|
94 |
|
95 |
#: src/core/src/Admin/Admin.php:133 src/core/src/Admin/SettingsPage.php:29
|
117 |
msgid "Support"
|
118 |
msgstr ""
|
119 |
|
120 |
+
#: src/core/src/Admin/Admin.php:165 src/core/src/Admin/RedirectionsPage.php:499
|
121 |
msgid "Upgrade to PRO"
|
122 |
msgstr ""
|
123 |
|
124 |
#: src/core/src/Admin/Admin.php:183
|
125 |
+
msgid ""
|
126 |
+
"Important news! %1$sPeters Login Redirect%2$s has been rebranded to "
|
127 |
+
"%1$sLoginWP%2$s with a new UI. %3$sCheck It Out%5$s | %4$sDismiss Notice%5$s"
|
128 |
msgstr ""
|
129 |
|
130 |
#: src/core/src/Admin/Admin.php:213
|
131 |
+
msgid ""
|
132 |
+
"Hey, I noticed you have been using LoginWP (Formerly Peter's Login Redirect) "
|
133 |
+
"for a while now - that's awesome! Could you please do me a BIG favor and "
|
134 |
+
"give it a %1$s5-star rating on WordPress?%2$s This will help us spread the "
|
135 |
+
"word and boost our motivation - thanks!"
|
136 |
msgstr ""
|
137 |
|
138 |
#: src/core/src/Admin/Admin.php:217
|
152 |
msgstr ""
|
153 |
|
154 |
#: src/core/src/Admin/ProfilePress.php:59
|
155 |
+
msgid ""
|
156 |
+
"Could not install addon. Please download from wpforms.com and install "
|
157 |
+
"manually."
|
158 |
msgstr ""
|
159 |
|
160 |
#: src/core/src/Admin/ProfilePress.php:125
|
190 |
msgstr ""
|
191 |
|
192 |
#. translators: %s - Lite plugin download URL.
|
|
|
193 |
#: src/core/src/Admin/ProfilePress.php:207
|
194 |
+
msgid ""
|
195 |
+
"Could not install plugin. Please <a href=\"%s\">download</a> and install "
|
196 |
+
"manually."
|
197 |
msgstr ""
|
198 |
|
199 |
#. translators: %s - Lite plugin download URL.
|
|
|
200 |
#: src/core/src/Admin/ProfilePress.php:219
|
201 |
+
msgid ""
|
202 |
+
"Could not activate plugin. Please activate from the <a href=\"%s\">Plugins "
|
203 |
+
"page</a>."
|
204 |
msgstr ""
|
205 |
|
206 |
#: src/core/src/Admin/ProfilePress.php:230
|
245 |
msgstr ""
|
246 |
|
247 |
#: src/core/src/Admin/ProfilePress.php:477
|
248 |
+
msgid ""
|
249 |
+
"ProfilePress lets you create beautiful frontend custom login forms, "
|
250 |
+
"registration forms, member directories and user profiles. You can also "
|
251 |
+
"protect sensitive contents and control user access."
|
252 |
msgstr ""
|
253 |
|
254 |
#: src/core/src/Admin/ProfilePress.php:500
|
256 |
msgstr ""
|
257 |
|
258 |
#: src/core/src/Admin/ProfilePress.php:501
|
259 |
+
msgid ""
|
260 |
+
"Beautiful templates for login, registration, password reset & edit profile "
|
261 |
+
"edit forms."
|
262 |
msgstr ""
|
263 |
|
264 |
#: src/core/src/Admin/ProfilePress.php:502
|
265 |
+
msgid ""
|
266 |
+
"Fine-grained control over what content your users can see based on your "
|
267 |
+
"protection rules."
|
268 |
msgstr ""
|
269 |
|
270 |
#: src/core/src/Admin/ProfilePress.php:503
|
271 |
+
msgid ""
|
272 |
+
"Restrict access to pages, posts, custom post types, categories, tags and "
|
273 |
+
"custom taxonomies."
|
274 |
msgstr ""
|
275 |
|
276 |
#: src/core/src/Admin/ProfilePress.php:504
|
277 |
+
msgid ""
|
278 |
+
"Add beautiful user profiles to your site that can be customised to your "
|
279 |
+
"specific requirements."
|
280 |
msgstr ""
|
281 |
|
282 |
#: src/core/src/Admin/ProfilePress.php:505
|
283 |
+
msgid ""
|
284 |
+
"Create searchable and filterable member directories with avatars and user "
|
285 |
+
"info allowing users to find each other."
|
286 |
msgstr ""
|
287 |
|
288 |
#: src/core/src/Admin/ProfilePress.php:533
|
459 |
msgid "ERROR: Non-existent level submitted"
|
460 |
msgstr ""
|
461 |
|
462 |
+
#: src/core/src/Admin/RedirectionsPage.php:345
|
463 |
msgid "ERROR: Unknown error editing redirect rule"
|
464 |
msgstr ""
|
465 |
|
466 |
+
#: src/core/src/Admin/RedirectionsPage.php:369
|
467 |
msgid "ERROR: Unknown error when adding the redirect rule"
|
468 |
msgstr ""
|
469 |
|
470 |
+
#: src/core/src/Admin/RedirectionsPage.php:406
|
471 |
+
#: src/core/src/Admin/RedirectionsPage.php:429
|
472 |
msgid "ERROR: Unknown problem updating URL"
|
473 |
msgstr ""
|
474 |
|
475 |
+
#: src/core/src/Admin/RedirectionsPage.php:476
|
476 |
msgid "User ID of user"
|
477 |
msgstr ""
|
478 |
|
479 |
+
#: src/core/src/Admin/RedirectionsPage.php:477
|
480 |
msgid "Username of user"
|
481 |
msgstr ""
|
482 |
|
483 |
+
#: src/core/src/Admin/RedirectionsPage.php:478
|
484 |
msgid "Author URL slug or user nicename"
|
485 |
msgstr ""
|
486 |
|
487 |
+
#: src/core/src/Admin/RedirectionsPage.php:479
|
488 |
msgid "Website URL"
|
489 |
msgstr ""
|
490 |
|
491 |
+
#: src/core/src/Admin/RedirectionsPage.php:494
|
492 |
+
msgid ""
|
493 |
+
"With %sLoginWP PRO%s, you can redirect users to the current page they are "
|
494 |
+
"logging in from or back to the previous (referrer) page after login."
|
495 |
msgstr ""
|
496 |
|
497 |
#: src/core/src/Admin/SettingsPage.php:26
|
499 |
msgstr ""
|
500 |
|
501 |
#: src/core/src/Admin/SettingsPage.php:49
|
502 |
+
#: src/core/src/Admin/SettingsPage.php:67
|
503 |
msgid "General"
|
504 |
msgstr ""
|
505 |
|
506 |
+
#: src/core/src/Admin/SettingsPage.php:59
|
507 |
msgid "Remove Data on Uninstall"
|
508 |
msgstr ""
|
509 |
|
510 |
+
#: src/core/src/Admin/SettingsPage.php:60
|
511 |
#: src/core/src/Admin/SettingsPageApi.php:1009
|
512 |
msgid "Activate"
|
513 |
msgstr ""
|
514 |
|
515 |
+
#: src/core/src/Admin/SettingsPage.php:61
|
516 |
+
msgid ""
|
517 |
+
"Check this box if you would like LoginWP to completely remove all of its "
|
518 |
+
"data when uninstalled."
|
519 |
msgstr ""
|
520 |
|
521 |
#: src/core/src/Admin/SettingsPageApi.php:857
|
579 |
msgstr ""
|
580 |
|
581 |
#: src/core/src/Admin/views/view.bottom-settings.php:86
|
582 |
+
msgid ""
|
583 |
+
"Allow a POST or GET "redirect_to" login variable to take redirect "
|
584 |
+
"precedence"
|
585 |
msgstr ""
|
586 |
|
587 |
#: src/core/src/Admin/views/view.bottom-settings.php:92
|
595 |
msgstr ""
|
596 |
|
597 |
#: src/core/src/Admin/views/view.bottom-settings.php:101
|
598 |
+
msgid ""
|
599 |
+
"Allow a POST or GET "redirect_to" logout variable to take redirect "
|
600 |
+
"precedence"
|
601 |
msgstr ""
|
602 |
|
603 |
#: src/core/src/Admin/views/view.condition-rule.php:15
|
604 |
msgid "Select a condition"
|
605 |
msgstr ""
|
606 |
|
607 |
+
#: src/core/src/Admin/views/view.condition-rule.php:49
|
608 |
msgid "Order"
|
609 |
msgstr ""
|
610 |
|
611 |
#: src/core/src/Admin/views/view.pro-conditions.php:4
|
612 |
+
msgid ""
|
613 |
+
"Redirect users to a specific URL only if they are logging in for the first "
|
614 |
+
"time"
|
615 |
+
msgstr ""
|
616 |
+
|
617 |
+
#: src/core/src/Admin/views/view.pro-conditions.php:7
|
618 |
+
#: src/core/src/Admin/views/view.pro-conditions.php:26
|
619 |
+
#: src/core/src/Admin/views/view.pro-conditions.php:30
|
620 |
msgid "Enrolled Course"
|
621 |
msgstr ""
|
622 |
|
623 |
+
#: src/core/src/Admin/views/view.pro-conditions.php:8
|
624 |
msgid "User Group"
|
625 |
msgstr ""
|
626 |
|
627 |
+
#: src/core/src/Admin/views/view.pro-conditions.php:11
|
628 |
msgid "Purchased Product"
|
629 |
msgstr ""
|
630 |
|
631 |
+
#: src/core/src/Admin/views/view.pro-conditions.php:12
|
632 |
msgid "Purchased Product Category"
|
633 |
msgstr ""
|
634 |
|
635 |
+
#: src/core/src/Admin/views/view.pro-conditions.php:13
|
636 |
msgid "Active User Subscription"
|
637 |
msgstr ""
|
638 |
|
639 |
+
#: src/core/src/Admin/views/view.pro-conditions.php:14
|
640 |
msgid "Active Membership Plan"
|
641 |
msgstr ""
|
642 |
|
643 |
+
#: src/core/src/Admin/views/view.pro-conditions.php:17
|
644 |
msgid "Subscribed Membership Plan"
|
645 |
msgstr ""
|
646 |
|
647 |
+
#: src/core/src/Admin/views/view.pro-conditions.php:20
|
648 |
msgid "Subscribed Membership"
|
649 |
msgstr ""
|
650 |
|
651 |
+
#: src/core/src/Admin/views/view.pro-conditions.php:23
|
652 |
msgid "Active Membership Level"
|
653 |
msgstr ""
|
654 |
|
655 |
+
#: src/core/src/Admin/views/view.pro-conditions.php:27
|
656 |
msgid "Enrolled Membership"
|
657 |
msgstr ""
|
658 |
|
|
|
659 |
#: src/core/src/Admin/views/view.pro-conditions.php:33
|
660 |
+
#: src/core/src/Admin/views/view.pro-conditions.php:36
|
661 |
msgid "Website Current Language"
|
662 |
msgstr ""
|
663 |
|
670 |
msgstr ""
|
671 |
|
672 |
#: src/core/src/MoAdminNotice.php:64
|
673 |
+
msgid ""
|
674 |
+
"Free optin form plugin that will %1$sincrease your email list subscribers"
|
675 |
+
"%2$s and keep them engaged with %1$sautomated and schedule newsletters%2$s."
|
676 |
msgstr ""
|
677 |
|
678 |
#: src/core/src/MoAdminNotice.php:73
|
686 |
#: src/core/src/MoAdminNotice.php:87
|
687 |
msgid "Dismiss this notice"
|
688 |
msgstr ""
|
689 |
+
|
690 |
#. Plugin Name of the plugin/theme
|
691 |
msgid "LoginWP (Formerly Peter's Login Redirect)"
|
692 |
msgstr ""
|
693 |
|
694 |
+
#. #-#-#-#-# peters-login-redirect.pot (LoginWP (Formerly Peter's Login Redirect) 3.0.4.0) #-#-#-#-#
|
695 |
#. Plugin URI of the plugin/theme
|
696 |
+
#. #-#-#-#-# peters-login-redirect.pot (LoginWP (Formerly Peter's Login Redirect) 3.0.4.0) #-#-#-#-#
|
697 |
+
#. Author URI of the plugin/theme
|
698 |
msgid "https://loginwp.com"
|
699 |
msgstr ""
|
700 |
|
701 |
#. Description of the plugin/theme
|
702 |
+
msgid ""
|
703 |
+
"Redirect users to different URLs based on their role, capability and more."
|
704 |
msgstr ""
|
705 |
|
706 |
#. Author of the plugin/theme
|
707 |
msgid "LoginWP Team"
|
708 |
msgstr ""
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
=== LoginWP (Formerly Peter's Login Redirect) ===
|
2 |
Contributors: properfraction, collizo4sky
|
3 |
-
Donate link: https://loginwp.com/pricing
|
4 |
Tags: login, logout, redirect, login form, user registration, admin, administration, dashboard, users, authentication
|
5 |
Requires at least: 4.7
|
6 |
Requires PHP: 5.6
|
7 |
-
Tested up to: 6.
|
8 |
-
Stable tag: 3.0.
|
9 |
License: GPL-2.0+
|
10 |
|
11 |
Redirect users to different locations after they log in, log out and register based on different conditions.
|
@@ -24,8 +24,9 @@ You can add your own code logic before and between any of the plugin's normal re
|
|
24 |
|
25 |
### Pro Integrations
|
26 |
|
27 |
-
This is the lite version that works with the default WordPress login page and limited other user registration and login form plugins. Upgrade to Pro to avail the support for the following plugins.
|
28 |
|
|
|
29 |
* [WooCommerce](https://loginwp.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion#pro-integrations)
|
30 |
* [Gravity Forms](https://loginwp.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion#pro-integrations)
|
31 |
* [WPForms](https://loginwp.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion#pro-integrations)
|
@@ -76,6 +77,10 @@ Login redirects not working? This plugin uses WordPress's standard login_redirec
|
|
76 |
|
77 |
== Changelog ==
|
78 |
|
|
|
|
|
|
|
|
|
79 |
= 3.0.3.0 =
|
80 |
* Fixed bug with wp list pagination per page not working.
|
81 |
|
1 |
=== LoginWP (Formerly Peter's Login Redirect) ===
|
2 |
Contributors: properfraction, collizo4sky
|
3 |
+
Donate link: https://loginwp.com/pricing/
|
4 |
Tags: login, logout, redirect, login form, user registration, admin, administration, dashboard, users, authentication
|
5 |
Requires at least: 4.7
|
6 |
Requires PHP: 5.6
|
7 |
+
Tested up to: 6.1
|
8 |
+
Stable tag: 3.0.4.0
|
9 |
License: GPL-2.0+
|
10 |
|
11 |
Redirect users to different locations after they log in, log out and register based on different conditions.
|
24 |
|
25 |
### Pro Integrations
|
26 |
|
27 |
+
This is the lite version that works with the default WordPress login page and limited other user registration and login form plugins. Upgrade to Pro to avail the support for the following features and plugins.
|
28 |
|
29 |
+
* [Redirect After First Login](https://loginwp.com/article/redirect-wordpress-users-after-first-login/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion#pro-integrations)
|
30 |
* [WooCommerce](https://loginwp.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion#pro-integrations)
|
31 |
* [Gravity Forms](https://loginwp.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion#pro-integrations)
|
32 |
* [WPForms](https://loginwp.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion#pro-integrations)
|
77 |
|
78 |
== Changelog ==
|
79 |
|
80 |
+
= 3.0.4.0 =
|
81 |
+
* Pro: ["After First Login" condition](https://loginwp.com/article/redirect-wordpress-users-after-first-login/?ref=changelog).
|
82 |
+
* Fixed: PHP Notice Trying to get property ‘user_login’ of non-object.
|
83 |
+
|
84 |
= 3.0.3.0 =
|
85 |
* Fixed bug with wp list pagination per page not working.
|
86 |
|
src/core/src/Admin/AbstractSettingsPage.php
CHANGED
@@ -130,6 +130,7 @@ abstract class AbstractSettingsPage
|
|
130 |
|
131 |
$content .= '<ul>';
|
132 |
|
|
|
133 |
$content .= sprintf('<li>%s</li>', esc_html__('Redirect to referrer or previous page', 'peters-login-redirect'));
|
134 |
$content .= sprintf('<li>%s</li>', esc_html__('Redirect to currently viewing page', 'peters-login-redirect'));
|
135 |
|
130 |
|
131 |
$content .= '<ul>';
|
132 |
|
133 |
+
$content .= sprintf('<li>%s</li>', esc_html__('Redirect only on first time login', 'peters-login-redirect'));
|
134 |
$content .= sprintf('<li>%s</li>', esc_html__('Redirect to referrer or previous page', 'peters-login-redirect'));
|
135 |
$content .= sprintf('<li>%s</li>', esc_html__('Redirect to currently viewing page', 'peters-login-redirect'));
|
136 |
|
src/core/src/Admin/RedirectionsPage.php
CHANGED
@@ -317,8 +317,12 @@ class RedirectionsPage extends AbstractSettingsPage
|
|
317 |
|
318 |
if ($order > 99) $order = 0;
|
319 |
|
|
|
|
|
320 |
if ( ! empty($_GET['id'])) {
|
321 |
|
|
|
|
|
322 |
$result = $wpdb->update(
|
323 |
PTR_LOGINWP_DB_TABLE,
|
324 |
[
|
@@ -329,7 +333,7 @@ class RedirectionsPage extends AbstractSettingsPage
|
|
329 |
'rul_url_logout' => sanitize_text_field($_POST['rul_logout_url'])
|
330 |
],
|
331 |
[
|
332 |
-
'id' =>
|
333 |
],
|
334 |
['%s', '%s', '%d', '%s', '%s'],
|
335 |
['%d']
|
@@ -366,11 +370,17 @@ class RedirectionsPage extends AbstractSettingsPage
|
|
366 |
);
|
367 |
}
|
368 |
|
369 |
-
|
370 |
-
exit;
|
371 |
}
|
372 |
|
373 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
374 |
exit;
|
375 |
}
|
376 |
|
317 |
|
318 |
if ($order > 99) $order = 0;
|
319 |
|
320 |
+
$rule_id = false;
|
321 |
+
|
322 |
if ( ! empty($_GET['id'])) {
|
323 |
|
324 |
+
$rule_id = absint($_GET['id']);
|
325 |
+
|
326 |
$result = $wpdb->update(
|
327 |
PTR_LOGINWP_DB_TABLE,
|
328 |
[
|
333 |
'rul_url_logout' => sanitize_text_field($_POST['rul_logout_url'])
|
334 |
],
|
335 |
[
|
336 |
+
'id' => $rule_id
|
337 |
],
|
338 |
['%s', '%s', '%d', '%s', '%s'],
|
339 |
['%d']
|
370 |
);
|
371 |
}
|
372 |
|
373 |
+
$rule_id = $wpdb->insert_id;
|
|
|
374 |
}
|
375 |
|
376 |
+
$first_login_data = Helpers::get_meta($rule_id, Helpers::FIRST_LOGIN_DB_KEY);
|
377 |
+
|
378 |
+
Helpers::update_meta($rule_id, Helpers::FIRST_LOGIN_DB_KEY, [
|
379 |
+
'value' => sanitize_text_field($_POST['rul_first_login']),
|
380 |
+
'date' => $first_login_data['date'] ?? current_time('mysql', true)
|
381 |
+
]);
|
382 |
+
|
383 |
+
wp_safe_redirect(add_query_arg('saved', 'true', RedirectWPList::edit_rule_url($rule_id)));
|
384 |
exit;
|
385 |
}
|
386 |
|
src/core/src/Admin/SettingsPage.php
CHANGED
@@ -51,11 +51,6 @@ class SettingsPage extends AbstractSettingsPage
|
|
51 |
return apply_filters('loginwp_settings_header_menu_tabs', $tabs);
|
52 |
}
|
53 |
|
54 |
-
public function save_redirect_rule_changes()
|
55 |
-
{
|
56 |
-
|
57 |
-
}
|
58 |
-
|
59 |
public function settings_page_callback()
|
60 |
{
|
61 |
$settings = [
|
51 |
return apply_filters('loginwp_settings_header_menu_tabs', $tabs);
|
52 |
}
|
53 |
|
|
|
|
|
|
|
|
|
|
|
54 |
public function settings_page_callback()
|
55 |
{
|
56 |
$settings = [
|
src/core/src/Admin/views/view.condition-rule.php
CHANGED
@@ -40,10 +40,11 @@ $db_condition_order = absint(loginwpPOST_var('rul_order', loginwp_var($ruleData,
|
|
40 |
</div>
|
41 |
</div>
|
42 |
|
43 |
-
<div
|
44 |
<table class="form-table">
|
45 |
<tbody>
|
46 |
-
|
|
|
47 |
<th>
|
48 |
<label for="loginwp-login-url"><?= esc_html__('Order', 'peters-login-redirect') ?></label>
|
49 |
</th>
|
40 |
</div>
|
41 |
</div>
|
42 |
|
43 |
+
<div>
|
44 |
<table class="form-table">
|
45 |
<tbody>
|
46 |
+
<?php do_action('loginwp_after_sub_condition_tbody', $ruleData); ?>
|
47 |
+
<tr class="ptr-loginwp-order-wrap"<?php echo ! in_array($db_condition, RedirectionsPage::order_support_conditions()) ? ' style="display:none"' : ''; ?>>
|
48 |
<th>
|
49 |
<label for="loginwp-login-url"><?= esc_html__('Order', 'peters-login-redirect') ?></label>
|
50 |
</th>
|
src/core/src/Admin/views/view.pro-conditions.php
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
<?php
|
2 |
$pro_conditions = [
|
|
|
|
|
|
|
3 |
'LearnDash' => [
|
4 |
esc_html__('Enrolled Course', 'peters-login-redirect'),
|
5 |
esc_html__('User Group', 'peters-login-redirect')
|
1 |
<?php
|
2 |
$pro_conditions = [
|
3 |
+
'After First Login' => [
|
4 |
+
esc_html__('Redirect users to a specific URL only if they are logging in for the first time', 'peters-login-redirect')
|
5 |
+
],
|
6 |
'LearnDash' => [
|
7 |
esc_html__('Enrolled Course', 'peters-login-redirect'),
|
8 |
esc_html__('User Group', 'peters-login-redirect')
|
src/core/src/Core.php
CHANGED
@@ -61,6 +61,7 @@ class Core
|
|
61 |
`rul_url` LONGTEXT NULL default NULL,
|
62 |
`rul_url_logout` LONGTEXT NULL default NULL,
|
63 |
`rul_order` int(2) NOT NULL default '0',
|
|
|
64 |
PRIMARY KEY (id)
|
65 |
)";
|
66 |
|
@@ -173,6 +174,10 @@ class Core
|
|
173 |
$wpdb->query("ALTER TABLE $rul_db_addresses CHANGE rul_type rul_type varchar(100) NOT NULL");
|
174 |
}
|
175 |
|
|
|
|
|
|
|
|
|
176 |
update_option('rul_version', PTR_LOGINWP_VERSION_NUMBER, 'no');
|
177 |
|
178 |
add_option('loginwp_install_date', current_time('mysql'));
|
61 |
`rul_url` LONGTEXT NULL default NULL,
|
62 |
`rul_url_logout` LONGTEXT NULL default NULL,
|
63 |
`rul_order` int(2) NOT NULL default '0',
|
64 |
+
`meta_data` longtext NULL,
|
65 |
PRIMARY KEY (id)
|
66 |
)";
|
67 |
|
174 |
$wpdb->query("ALTER TABLE $rul_db_addresses CHANGE rul_type rul_type varchar(100) NOT NULL");
|
175 |
}
|
176 |
|
177 |
+
if ($cmp_current_version < 3040) {
|
178 |
+
$wpdb->query("ALTER TABLE $rul_db_addresses ADD COLUMN meta_data longtext NULL");
|
179 |
+
}
|
180 |
+
|
181 |
update_option('rul_version', PTR_LOGINWP_VERSION_NUMBER, 'no');
|
182 |
|
183 |
add_option('loginwp_install_date', current_time('mysql'));
|
src/core/src/Functions.php
CHANGED
@@ -109,6 +109,13 @@ function loginwp_get_current_url_query_string()
|
|
109 |
return esc_url_raw($url);
|
110 |
}
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
function redirect_to_front_page($redirect_to, $requested_redirect_to, $user)
|
113 |
{
|
114 |
return Helpers::login_redirect_logic_callback($redirect_to, $requested_redirect_to, $user);
|
109 |
return esc_url_raw($url);
|
110 |
}
|
111 |
|
112 |
+
function loginwp_is_json($str)
|
113 |
+
{
|
114 |
+
$json = json_decode($str);
|
115 |
+
|
116 |
+
return $json && $str != $json;
|
117 |
+
}
|
118 |
+
|
119 |
function redirect_to_front_page($redirect_to, $requested_redirect_to, $user)
|
120 |
{
|
121 |
return Helpers::login_redirect_logic_callback($redirect_to, $requested_redirect_to, $user);
|
src/core/src/Helpers.php
CHANGED
@@ -4,6 +4,8 @@ namespace LoginWP\Core;
|
|
4 |
|
5 |
class Helpers
|
6 |
{
|
|
|
|
|
7 |
public static function get_rule_by_id($id)
|
8 |
{
|
9 |
global $wpdb;
|
@@ -240,11 +242,13 @@ class Helpers
|
|
240 |
|
241 |
if ($rul_custom_redirect) return self::rul_replace_variable($rul_custom_redirect, $user);
|
242 |
|
|
|
|
|
243 |
// Check for a redirect rule for this user
|
244 |
-
$rul_user = $wpdb->
|
245 |
|
246 |
-
if ( ! empty($rul_user)) {
|
247 |
-
$url = self::rul_replace_variable($rul_user, $user);
|
248 |
if ( ! empty($url)) return $url;
|
249 |
}
|
250 |
|
@@ -253,13 +257,17 @@ class Helpers
|
|
253 |
if ($rul_custom_redirect) return self::rul_replace_variable($rul_custom_redirect, $user);
|
254 |
|
255 |
// Check for a redirect rule that matches this user's role
|
256 |
-
$rul_roles = $wpdb->get_results('SELECT rul_value, rul_url FROM ' . PTR_LOGINWP_DB_TABLE . ' WHERE rul_type = \'role\' ORDER BY rul_order, rul_value', OBJECT);
|
257 |
|
258 |
if ( ! empty($rul_roles)) {
|
259 |
|
260 |
foreach ($rul_roles as $rul_role) {
|
261 |
|
262 |
-
if (
|
|
|
|
|
|
|
|
|
263 |
$url = self::rul_replace_variable($rul_role->rul_url, $user);
|
264 |
if ( ! empty($url)) return $url;
|
265 |
}
|
@@ -271,12 +279,16 @@ class Helpers
|
|
271 |
if ($rul_custom_redirect) return self::rul_replace_variable($rul_custom_redirect, $user);
|
272 |
|
273 |
// Check for a redirect rule that matches this user's capability
|
274 |
-
$rul_levels = $wpdb->get_results('SELECT rul_value, rul_url FROM ' . PTR_LOGINWP_DB_TABLE . ' WHERE rul_type = \'level\' ORDER BY rul_order, rul_value', OBJECT);
|
275 |
|
276 |
if ($rul_levels) {
|
277 |
|
278 |
foreach ($rul_levels as $rul_level) {
|
279 |
-
if (
|
|
|
|
|
|
|
|
|
280 |
$url = self::rul_replace_variable($rul_level->rul_url, $user);
|
281 |
if ( ! empty($url)) return $url;
|
282 |
}
|
@@ -299,6 +311,44 @@ class Helpers
|
|
299 |
return $redirect_to;
|
300 |
}
|
301 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
// Get the logout redirect URL according to defined rules
|
303 |
// Functionality for user-, role-, and capability-specific redirect rules is available
|
304 |
// Note that only the "all other users" redirect URL is currently implemented in the UI
|
@@ -310,11 +360,13 @@ class Helpers
|
|
310 |
|
311 |
if ($rul_custom_redirect) return self::rul_replace_variable($rul_custom_redirect, $user);
|
312 |
|
|
|
|
|
313 |
// Check for a redirect rule for this user
|
314 |
-
$rul_user = $wpdb->
|
315 |
|
316 |
-
if ($rul_user) {
|
317 |
-
$url = self::rul_replace_variable($rul_user, $user);
|
318 |
if ( ! empty($url)) return $url;
|
319 |
}
|
320 |
|
@@ -323,12 +375,17 @@ class Helpers
|
|
323 |
if ( ! empty($rul_custom_redirect)) return self::rul_replace_variable($rul_custom_redirect, $user);
|
324 |
|
325 |
// Check for a redirect rule that matches this user's role
|
326 |
-
$rul_roles = $wpdb->get_results('SELECT rul_value, rul_url_logout FROM ' . PTR_LOGINWP_DB_TABLE . ' WHERE rul_type = \'role\' ORDER BY rul_order, rul_value', OBJECT);
|
327 |
|
328 |
if ($rul_roles) {
|
329 |
|
330 |
foreach ($rul_roles as $rul_role) {
|
331 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
332 |
$url = self::rul_replace_variable($rul_role->rul_url_logout, $user);
|
333 |
|
334 |
if ( ! empty($url)) return $url;
|
@@ -341,11 +398,15 @@ class Helpers
|
|
341 |
if ($rul_custom_redirect) return self::rul_replace_variable($rul_custom_redirect, $user);
|
342 |
|
343 |
// Check for a redirect rule that matches this user's capability
|
344 |
-
$rul_levels = $wpdb->get_results('SELECT rul_value, rul_url_logout FROM ' . PTR_LOGINWP_DB_TABLE . ' WHERE rul_type = \'level\' ORDER BY rul_order, rul_value', OBJECT);
|
345 |
|
346 |
if ($rul_levels) {
|
347 |
foreach ($rul_levels as $rul_level) {
|
348 |
-
if (
|
|
|
|
|
|
|
|
|
349 |
$url = self::rul_replace_variable($rul_level->rul_url_logout, $user);
|
350 |
|
351 |
if ( ! empty($url)) return $url;
|
@@ -369,4 +430,73 @@ class Helpers
|
|
369 |
|
370 |
return false;
|
371 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
}
|
4 |
|
5 |
class Helpers
|
6 |
{
|
7 |
+
const FIRST_LOGIN_DB_KEY = 'first_login_condition';
|
8 |
+
|
9 |
public static function get_rule_by_id($id)
|
10 |
{
|
11 |
global $wpdb;
|
242 |
|
243 |
if ($rul_custom_redirect) return self::rul_replace_variable($rul_custom_redirect, $user);
|
244 |
|
245 |
+
$user_login = isset($user->user_login) ? $user->user_login : '';
|
246 |
+
|
247 |
// Check for a redirect rule for this user
|
248 |
+
$rul_user = $wpdb->get_row('SELECT id, rul_url FROM ' . PTR_LOGINWP_DB_TABLE . ' WHERE rul_type = \'user\' AND rul_value = \'' . $user_login . '\' LIMIT 1', ARRAY_A);
|
249 |
|
250 |
+
if ( ! empty($rul_user['rul_url']) && self::first_time_logic_check($rul_user['id'], $user)) {
|
251 |
+
$url = self::rul_replace_variable($rul_user['rul_url'], $user);
|
252 |
if ( ! empty($url)) return $url;
|
253 |
}
|
254 |
|
257 |
if ($rul_custom_redirect) return self::rul_replace_variable($rul_custom_redirect, $user);
|
258 |
|
259 |
// Check for a redirect rule that matches this user's role
|
260 |
+
$rul_roles = $wpdb->get_results('SELECT id, rul_value, rul_url FROM ' . PTR_LOGINWP_DB_TABLE . ' WHERE rul_type = \'role\' ORDER BY rul_order, rul_value', OBJECT);
|
261 |
|
262 |
if ( ! empty($rul_roles)) {
|
263 |
|
264 |
foreach ($rul_roles as $rul_role) {
|
265 |
|
266 |
+
if (
|
267 |
+
! empty($rul_role->rul_url) &&
|
268 |
+
isset($user->{$wpdb->prefix . 'capabilities'}[$rul_role->rul_value]) &&
|
269 |
+
self::first_time_logic_check($rul_role->id, $user)
|
270 |
+
) {
|
271 |
$url = self::rul_replace_variable($rul_role->rul_url, $user);
|
272 |
if ( ! empty($url)) return $url;
|
273 |
}
|
279 |
if ($rul_custom_redirect) return self::rul_replace_variable($rul_custom_redirect, $user);
|
280 |
|
281 |
// Check for a redirect rule that matches this user's capability
|
282 |
+
$rul_levels = $wpdb->get_results('SELECT id, rul_value, rul_url FROM ' . PTR_LOGINWP_DB_TABLE . ' WHERE rul_type = \'level\' ORDER BY rul_order, rul_value', OBJECT);
|
283 |
|
284 |
if ($rul_levels) {
|
285 |
|
286 |
foreach ($rul_levels as $rul_level) {
|
287 |
+
if (
|
288 |
+
! empty($rul_level->rul_url) &&
|
289 |
+
self::redirect_current_user_can($rul_level->rul_value, $user) &&
|
290 |
+
self::first_time_logic_check($rul_level->id, $user)
|
291 |
+
) {
|
292 |
$url = self::rul_replace_variable($rul_level->rul_url, $user);
|
293 |
if ( ! empty($url)) return $url;
|
294 |
}
|
311 |
return $redirect_to;
|
312 |
}
|
313 |
|
314 |
+
/**
|
315 |
+
* @param int $rule_id
|
316 |
+
* @param \WP_User $user
|
317 |
+
*
|
318 |
+
* @return bool
|
319 |
+
*/
|
320 |
+
public static function first_time_logic_check($rule_id, $user)
|
321 |
+
{
|
322 |
+
static $cache = [];
|
323 |
+
|
324 |
+
$cache_key = sprintf('%s_%s', $rule_id, $user->ID);
|
325 |
+
|
326 |
+
if ( ! isset($cache[$cache_key])) {
|
327 |
+
|
328 |
+
$cache[$cache_key] = true;
|
329 |
+
|
330 |
+
$val = self::get_meta($rule_id, self::FIRST_LOGIN_DB_KEY);
|
331 |
+
|
332 |
+
if ('true' == loginwp_var($val, 'value')) {
|
333 |
+
|
334 |
+
$cache[$cache_key] = false;
|
335 |
+
|
336 |
+
if (
|
337 |
+
strtotime($user->user_registered . ' UTC') >=
|
338 |
+
strtotime(loginwp_var($val, 'date') . ' UTC')
|
339 |
+
) {
|
340 |
+
|
341 |
+
if (get_user_meta($user->ID, 'loginwp_first_time_login_flag', true) != 'yes') {
|
342 |
+
$cache[$cache_key] = true;
|
343 |
+
update_user_meta($user->ID, 'loginwp_first_time_login_flag', 'yes');
|
344 |
+
}
|
345 |
+
}
|
346 |
+
}
|
347 |
+
}
|
348 |
+
|
349 |
+
return $cache[$cache_key];
|
350 |
+
}
|
351 |
+
|
352 |
// Get the logout redirect URL according to defined rules
|
353 |
// Functionality for user-, role-, and capability-specific redirect rules is available
|
354 |
// Note that only the "all other users" redirect URL is currently implemented in the UI
|
360 |
|
361 |
if ($rul_custom_redirect) return self::rul_replace_variable($rul_custom_redirect, $user);
|
362 |
|
363 |
+
$user_login = isset($user->user_login) ? $user->user_login : '';
|
364 |
+
|
365 |
// Check for a redirect rule for this user
|
366 |
+
$rul_user = $wpdb->get_row('SELECT id, rul_url_logout FROM ' . PTR_LOGINWP_DB_TABLE . ' WHERE rul_type = \'user\' AND rul_value = \'' . $user_login . '\' LIMIT 1', ARRAY_A);
|
367 |
|
368 |
+
if ( ! empty($rul_user['rul_url_logout']) && self::first_time_logic_check($rul_user['id'], $user)) {
|
369 |
+
$url = self::rul_replace_variable($rul_user['rul_url_logout'], $user);
|
370 |
if ( ! empty($url)) return $url;
|
371 |
}
|
372 |
|
375 |
if ( ! empty($rul_custom_redirect)) return self::rul_replace_variable($rul_custom_redirect, $user);
|
376 |
|
377 |
// Check for a redirect rule that matches this user's role
|
378 |
+
$rul_roles = $wpdb->get_results('SELECT id, rul_value, rul_url_logout FROM ' . PTR_LOGINWP_DB_TABLE . ' WHERE rul_type = \'role\' ORDER BY rul_order, rul_value', OBJECT);
|
379 |
|
380 |
if ($rul_roles) {
|
381 |
|
382 |
foreach ($rul_roles as $rul_role) {
|
383 |
+
if (
|
384 |
+
'' != $rul_role->rul_url_logout &&
|
385 |
+
isset($user->{$wpdb->prefix . 'capabilities'}[$rul_role->rul_value]) &&
|
386 |
+
self::first_time_logic_check($rul_role->id, $user)
|
387 |
+
) {
|
388 |
+
|
389 |
$url = self::rul_replace_variable($rul_role->rul_url_logout, $user);
|
390 |
|
391 |
if ( ! empty($url)) return $url;
|
398 |
if ($rul_custom_redirect) return self::rul_replace_variable($rul_custom_redirect, $user);
|
399 |
|
400 |
// Check for a redirect rule that matches this user's capability
|
401 |
+
$rul_levels = $wpdb->get_results('SELECT id, rul_value, rul_url_logout FROM ' . PTR_LOGINWP_DB_TABLE . ' WHERE rul_type = \'level\' ORDER BY rul_order, rul_value', OBJECT);
|
402 |
|
403 |
if ($rul_levels) {
|
404 |
foreach ($rul_levels as $rul_level) {
|
405 |
+
if (
|
406 |
+
'' != $rul_level->rul_url_logout &&
|
407 |
+
self::redirect_current_user_can($rul_level->rul_value, $user)&&
|
408 |
+
self::first_time_logic_check($rul_level->id, $user)
|
409 |
+
) {
|
410 |
$url = self::rul_replace_variable($rul_level->rul_url_logout, $user);
|
411 |
|
412 |
if ( ! empty($url)) return $url;
|
430 |
|
431 |
return false;
|
432 |
}
|
433 |
+
|
434 |
+
public static function get_rule_meta_bucket($rule_id)
|
435 |
+
{
|
436 |
+
global $wpdb;
|
437 |
+
|
438 |
+
static $cache = [];
|
439 |
+
|
440 |
+
if ( ! isset($cache[$rule_id])) {
|
441 |
+
|
442 |
+
$table = PTR_LOGINWP_DB_TABLE;
|
443 |
+
|
444 |
+
$value = $wpdb->get_var($wpdb->prepare("SELECT meta_data FROM $table WHERE id = %d", $rule_id));
|
445 |
+
|
446 |
+
$cache[$rule_id] = ! empty($value) && loginwp_is_json($value) ? \json_decode($value, true) : [];
|
447 |
+
}
|
448 |
+
|
449 |
+
return $cache[$rule_id];
|
450 |
+
}
|
451 |
+
|
452 |
+
public static function update_meta($rule_id, $meta_key, $meta_value)
|
453 |
+
{
|
454 |
+
global $wpdb;
|
455 |
+
|
456 |
+
$meta_data = self::get_rule_meta_bucket($rule_id);
|
457 |
+
|
458 |
+
$meta_data[$meta_key] = $meta_value;
|
459 |
+
|
460 |
+
return $wpdb->update(
|
461 |
+
PTR_LOGINWP_DB_TABLE,
|
462 |
+
['meta_data' => \wp_json_encode($meta_data)],
|
463 |
+
['id' => $rule_id],
|
464 |
+
['%s'],
|
465 |
+
['%d']
|
466 |
+
);
|
467 |
+
}
|
468 |
+
|
469 |
+
/**
|
470 |
+
* @param $meta_key
|
471 |
+
*
|
472 |
+
* @return false|mixed
|
473 |
+
*/
|
474 |
+
public static function get_meta($rule_id, $meta_key)
|
475 |
+
{
|
476 |
+
$meta_data = self::get_rule_meta_bucket($rule_id);
|
477 |
+
|
478 |
+
return loginwp_var($meta_data, $meta_key);
|
479 |
+
}
|
480 |
+
|
481 |
+
/**
|
482 |
+
* @param $meta_key
|
483 |
+
*
|
484 |
+
* @return false|int
|
485 |
+
*/
|
486 |
+
public static function delete_meta($rule_id, $meta_key)
|
487 |
+
{
|
488 |
+
global $wpdb;
|
489 |
+
|
490 |
+
$meta_data = self::get_rule_meta_bucket($rule_id);
|
491 |
+
|
492 |
+
unset($meta_data[$meta_key]);
|
493 |
+
|
494 |
+
return $wpdb->update(
|
495 |
+
PTR_LOGINWP_DB_TABLE,
|
496 |
+
['meta_data' => \wp_json_encode($meta_data)],
|
497 |
+
['id' => $rule_id],
|
498 |
+
['%s'],
|
499 |
+
['%d']
|
500 |
+
);
|
501 |
+
}
|
502 |
}
|
vendor/autoload.php
CHANGED
@@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
|
|
9 |
|
10 |
require_once __DIR__ . '/composer/autoload_real.php';
|
11 |
|
12 |
-
return
|
9 |
|
10 |
require_once __DIR__ . '/composer/autoload_real.php';
|
11 |
|
12 |
+
return ComposerAutoloaderIniteb0570bd19eabf9e518794363ce0b0b0::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -24,18 +24,18 @@ class ComposerAutoloaderInita9f583478f300f50f350038ebf8720c5
|
|
24 |
|
25 |
require __DIR__ . '/platform_check.php';
|
26 |
|
27 |
-
spl_autoload_register(array('
|
28 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
29 |
-
spl_autoload_unregister(array('
|
30 |
|
31 |
require __DIR__ . '/autoload_static.php';
|
32 |
-
call_user_func(\Composer\Autoload\
|
33 |
|
34 |
$loader->register(true);
|
35 |
|
36 |
-
$includeFiles = \Composer\Autoload\
|
37 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
38 |
-
|
39 |
}
|
40 |
|
41 |
return $loader;
|
@@ -47,7 +47,7 @@ class ComposerAutoloaderInita9f583478f300f50f350038ebf8720c5
|
|
47 |
* @param string $file
|
48 |
* @return void
|
49 |
*/
|
50 |
-
function
|
51 |
{
|
52 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
53 |
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderIniteb0570bd19eabf9e518794363ce0b0b0
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
24 |
|
25 |
require __DIR__ . '/platform_check.php';
|
26 |
|
27 |
+
spl_autoload_register(array('ComposerAutoloaderIniteb0570bd19eabf9e518794363ce0b0b0', 'loadClassLoader'), true, true);
|
28 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
29 |
+
spl_autoload_unregister(array('ComposerAutoloaderIniteb0570bd19eabf9e518794363ce0b0b0', 'loadClassLoader'));
|
30 |
|
31 |
require __DIR__ . '/autoload_static.php';
|
32 |
+
call_user_func(\Composer\Autoload\ComposerStaticIniteb0570bd19eabf9e518794363ce0b0b0::getInitializer($loader));
|
33 |
|
34 |
$loader->register(true);
|
35 |
|
36 |
+
$includeFiles = \Composer\Autoload\ComposerStaticIniteb0570bd19eabf9e518794363ce0b0b0::$files;
|
37 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
38 |
+
composerRequireeb0570bd19eabf9e518794363ce0b0b0($fileIdentifier, $file);
|
39 |
}
|
40 |
|
41 |
return $loader;
|
47 |
* @param string $file
|
48 |
* @return void
|
49 |
*/
|
50 |
+
function composerRequireeb0570bd19eabf9e518794363ce0b0b0($fileIdentifier, $file)
|
51 |
{
|
52 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
53 |
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'7c119350ad5d791b1ae2d87a60e07ace' => __DIR__ . '/../..' . '/src/core/src/MoAdminNotice.php',
|
@@ -156,9 +156,9 @@ class ComposerStaticInita9f583478f300f50f350038ebf8720c5
|
|
156 |
public static function getInitializer(ClassLoader $loader)
|
157 |
{
|
158 |
return \Closure::bind(function () use ($loader) {
|
159 |
-
$loader->prefixLengthsPsr4 =
|
160 |
-
$loader->prefixDirsPsr4 =
|
161 |
-
$loader->classMap =
|
162 |
|
163 |
}, null, ClassLoader::class);
|
164 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticIniteb0570bd19eabf9e518794363ce0b0b0
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'7c119350ad5d791b1ae2d87a60e07ace' => __DIR__ . '/../..' . '/src/core/src/MoAdminNotice.php',
|
156 |
public static function getInitializer(ClassLoader $loader)
|
157 |
{
|
158 |
return \Closure::bind(function () use ($loader) {
|
159 |
+
$loader->prefixLengthsPsr4 = ComposerStaticIniteb0570bd19eabf9e518794363ce0b0b0::$prefixLengthsPsr4;
|
160 |
+
$loader->prefixDirsPsr4 = ComposerStaticIniteb0570bd19eabf9e518794363ce0b0b0::$prefixDirsPsr4;
|
161 |
+
$loader->classMap = ComposerStaticIniteb0570bd19eabf9e518794363ce0b0b0::$classMap;
|
162 |
|
163 |
}, null, ClassLoader::class);
|
164 |
}
|
vendor/composer/installed.json
CHANGED
@@ -200,24 +200,24 @@
|
|
200 |
},
|
201 |
{
|
202 |
"name": "loginwp/core",
|
203 |
-
"version": "0.1.0-alpha.
|
204 |
-
"version_normalized": "0.1.0.0-
|
205 |
"source": {
|
206 |
"type": "git",
|
207 |
"url": "https://github.com/loginwp/Core.git",
|
208 |
-
"reference": "
|
209 |
},
|
210 |
"dist": {
|
211 |
"type": "zip",
|
212 |
-
"url": "https://api.github.com/repos/loginwp/Core/zipball/
|
213 |
-
"reference": "
|
214 |
"shasum": ""
|
215 |
},
|
216 |
"require": {
|
217 |
"collizo4sky/persist-admin-notices-dismissal": "^1.4",
|
218 |
"composer/installers": "~1.0"
|
219 |
},
|
220 |
-
"time": "2022-
|
221 |
"type": "wordpress-plugin",
|
222 |
"installation-source": "dist",
|
223 |
"autoload": {
|
@@ -233,7 +233,7 @@
|
|
233 |
"description": "Core lib for LoginWP",
|
234 |
"support": {
|
235 |
"issues": "https://github.com/loginwp/Core/issues",
|
236 |
-
"source": "https://github.com/loginwp/Core/tree/0.1.0-alpha.
|
237 |
},
|
238 |
"install-path": "../../src/core"
|
239 |
}
|
200 |
},
|
201 |
{
|
202 |
"name": "loginwp/core",
|
203 |
+
"version": "0.1.0-alpha.1666905744",
|
204 |
+
"version_normalized": "0.1.0.0-alpha1666905744",
|
205 |
"source": {
|
206 |
"type": "git",
|
207 |
"url": "https://github.com/loginwp/Core.git",
|
208 |
+
"reference": "d1b6a79290e2d3b74126f51062ad68f2621b94ad"
|
209 |
},
|
210 |
"dist": {
|
211 |
"type": "zip",
|
212 |
+
"url": "https://api.github.com/repos/loginwp/Core/zipball/d1b6a79290e2d3b74126f51062ad68f2621b94ad",
|
213 |
+
"reference": "d1b6a79290e2d3b74126f51062ad68f2621b94ad",
|
214 |
"shasum": ""
|
215 |
},
|
216 |
"require": {
|
217 |
"collizo4sky/persist-admin-notices-dismissal": "^1.4",
|
218 |
"composer/installers": "~1.0"
|
219 |
},
|
220 |
+
"time": "2022-10-27T21:21:54+00:00",
|
221 |
"type": "wordpress-plugin",
|
222 |
"installation-source": "dist",
|
223 |
"autoload": {
|
233 |
"description": "Core lib for LoginWP",
|
234 |
"support": {
|
235 |
"issues": "https://github.com/loginwp/Core/issues",
|
236 |
+
"source": "https://github.com/loginwp/Core/tree/0.1.0-alpha.1666905744"
|
237 |
},
|
238 |
"install-path": "../../src/core"
|
239 |
}
|
vendor/composer/installed.php
CHANGED
@@ -38,9 +38,9 @@
|
|
38 |
'dev_requirement' => false,
|
39 |
),
|
40 |
'loginwp/core' => array(
|
41 |
-
'pretty_version' => '0.1.0-alpha.
|
42 |
-
'version' => '0.1.0.0-
|
43 |
-
'reference' => '
|
44 |
'type' => 'wordpress-plugin',
|
45 |
'install_path' => __DIR__ . '/../../src/core',
|
46 |
'aliases' => array(),
|
38 |
'dev_requirement' => false,
|
39 |
),
|
40 |
'loginwp/core' => array(
|
41 |
+
'pretty_version' => '0.1.0-alpha.1666905744',
|
42 |
+
'version' => '0.1.0.0-alpha1666905744',
|
43 |
+
'reference' => 'd1b6a79290e2d3b74126f51062ad68f2621b94ad',
|
44 |
'type' => 'wordpress-plugin',
|
45 |
'install_path' => __DIR__ . '/../../src/core',
|
46 |
'aliases' => array(),
|
wplogin_redirect.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: LoginWP (Formerly Peter's Login Redirect)
|
4 |
Plugin URI: https://loginwp.com
|
5 |
Description: Redirect users to different URLs based on their role, capability and more.
|
6 |
-
Version: 3.0.
|
7 |
Author: LoginWP Team
|
8 |
Author URI: https://loginwp.com
|
9 |
Text Domain: peters-login-redirect
|
@@ -16,7 +16,7 @@ use LoginWP\Core\Core;
|
|
16 |
require __DIR__ . '/vendor/autoload.php';
|
17 |
|
18 |
define('PTR_LOGINWP_SYSTEM_FILE_PATH', __FILE__);
|
19 |
-
define('PTR_LOGINWP_VERSION_NUMBER', '3.0.
|
20 |
|
21 |
add_action('init', function () {
|
22 |
load_plugin_textdomain('peters-login-redirect', false, dirname(plugin_basename(__FILE__)) . '/languages');
|
3 |
Plugin Name: LoginWP (Formerly Peter's Login Redirect)
|
4 |
Plugin URI: https://loginwp.com
|
5 |
Description: Redirect users to different URLs based on their role, capability and more.
|
6 |
+
Version: 3.0.4.0
|
7 |
Author: LoginWP Team
|
8 |
Author URI: https://loginwp.com
|
9 |
Text Domain: peters-login-redirect
|
16 |
require __DIR__ . '/vendor/autoload.php';
|
17 |
|
18 |
define('PTR_LOGINWP_SYSTEM_FILE_PATH', __FILE__);
|
19 |
+
define('PTR_LOGINWP_VERSION_NUMBER', '3.0.4.0');
|
20 |
|
21 |
add_action('init', function () {
|
22 |
load_plugin_textdomain('peters-login-redirect', false, dirname(plugin_basename(__FILE__)) . '/languages');
|