;lang":"th"},"Annotation":["\u0e04\u0e33\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21"]}},"comment":{"reference":"wp-includes\/js\/dist\/annotations.js"}} 1
+{"translation-revision-date":"2021-11-28 05:01:06+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"Annotation":["\u0e04\u0e33\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21"]}},"comment":{"reference":"wp-includes\/js\/dist\/annotations.js"}}

+ 1 - 1
app/wp-content/languages/th-320f4ad9792aaa6dedb1e71cbdf85d57.json

@@ -1 +1 @@
1
-{"translation-revision-date":"2021-09-30 09:11:37+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"Notifications":["\u0e01\u0e32\u0e23\u0e41\u0e08\u0e49\u0e07\u0e40\u0e15\u0e37\u0e2d\u0e19"]}},"comment":{"reference":"wp-includes\/js\/dist\/a11y.js"}}
1
+{"translation-revision-date":"2021-11-28 05:01:06+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"Notifications":["\u0e01\u0e32\u0e23\u0e41\u0e08\u0e49\u0e07\u0e40\u0e15\u0e37\u0e2d\u0e19"]}},"comment":{"reference":"wp-includes\/js\/dist\/a11y.js"}}

File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-440127dd25bde48a531ded36f33e927b.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-49c6d4acf36cf3aca9f0b2a77617304f.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-4a38fe1c0c45989e44682ba6109d9f46.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-4bfa11da57ff2600004bb500368247f4.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-5251f7623766a714c8207c7edb938628.json


+ 1 - 1
app/wp-content/languages/th-529362903a5a05b34b06b5e793fb4cf8.json

@@ -1 +1 @@
1
-{"translation-revision-date":"2021-10-10 08:48:56+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"Dismiss this notice.":["\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01\u0e04\u0e33\u0e40\u0e15\u0e37\u0e2d\u0e19\u0e19\u0e35\u0e49"]}},"comment":{"reference":"wp-admin\/js\/application-passwords.js"}}
1
+{"translation-revision-date":"2021-11-28 05:36:52+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"Dismiss this notice.":["\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01\u0e04\u0e33\u0e40\u0e15\u0e37\u0e2d\u0e19\u0e19\u0e35\u0e49"]}},"comment":{"reference":"wp-admin\/js\/application-passwords.js"}}

File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-569e85ef168299eb8c8f24d8ef8c8a78.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-6025add6bde16aaeb12787d250f9b414.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-68f2cec7514bf8563c723a4d675fcfe6.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-7233008897033de5ee0d14f86a42a65a.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-7289286ed59e90a8f36ae797df62220b.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-77fdfadaf2e1ca3a027d1956b910bc50.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-7b74c8457eaa7fcc50db41b431f8a003.json


+ 1 - 1
app/wp-content/languages/th-7d5ca435e60d92f024d46c9257aaa0f7.json

@@ -1 +1 @@
1
-{"translation-revision-date":"2021-09-30 09:11:37+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"tag delimiter\u0004,":[","]}},"comment":{"reference":"wp-admin\/js\/tags-suggest.js"}}
1
+{"translation-revision-date":"2021-11-28 05:01:06+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"tag delimiter\u0004,":[","]}},"comment":{"reference":"wp-admin\/js\/tags-suggest.js"}}

File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-7f13c36c641b114bf18cd0bcc9ecc7e0.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-803bf1ce2131e13efc590c1bc47851fc.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-81c889563f09dd13de1701135dc62941.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-81d6f084cb273e02e15b01bd9ece87f7.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-8240df461220d1d3a028a9a4c5652a5b.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-8860e58c20c6a2ab5876a0f07be43bd9.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-93882e8f9976382d7f724ac595ed7151.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-947c76bb5095da30e16668eec15406b2.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-9b256ea9cd54df92095e04c76758ceb0.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-9c3519f4870fac83dc0dbf18cb6bd4c4.json


+ 1 - 1
app/wp-content/languages/th-9d47a87c240c1d10701cd6a02b28aa1b.json

@@ -1 +1 @@
1
-{"translation-revision-date":"2021-09-30 09:11:37+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"tag delimiter\u0004,":[","]}},"comment":{"reference":"wp-admin\/js\/tags-box.js"}}
1
+{"translation-revision-date":"2021-11-28 05:01:06+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"tag delimiter\u0004,":[","]}},"comment":{"reference":"wp-admin\/js\/tags-box.js"}}

+ 1 - 1
app/wp-content/languages/th-a25d1cc7bf7ca0b4e114f6bea64943f4.json

@@ -1 +1 @@
1
-{"translation-revision-date":"2021-09-30 09:11:37+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"Backtick":["\u0e40\u0e01\u0e23\u0e1f (`)"],"Period":["\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32"],"Comma":["\u0e04\u0e2d\u0e21\u0e21\u0e48\u0e32"]}},"comment":{"reference":"wp-includes\/js\/dist\/keycodes.js"}}
1
+{"translation-revision-date":"2021-11-28 05:01:06+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"Backtick":["\u0e40\u0e01\u0e23\u0e1f (`)"],"Period":["\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32"],"Comma":["\u0e04\u0e2d\u0e21\u0e21\u0e48\u0e32"]}},"comment":{"reference":"wp-includes\/js\/dist\/keycodes.js"}}

File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-a9dc201dcd011fe71849743133052619.json


+ 1 - 0
app/wp-content/languages/th-aabfce98c410957228848dc581e3c420.json

@@ -0,0 +1 @@
1
+{"translation-revision-date":"2021-11-28 05:36:52+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"Your new password for %s is:":["\u0e23\u0e2b\u0e31\u0e2a\u0e1c\u0e48\u0e32\u0e19\u0e43\u0e2b\u0e21\u0e48\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a %s \u0e04\u0e37\u0e2d:"]}},"comment":{"reference":"wp-admin\/js\/auth-app.js"}}

+ 1 - 1
app/wp-content/languages/th-ac23eee47530ac63a1178c827db28087.json

@@ -1 +1 @@
1
-{"translation-revision-date":"2021-09-30 09:11:37+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"text direction\u0004ltr":["ltr"]}},"comment":{"reference":"wp-includes\/js\/dist\/i18n.js"}}
1
+{"translation-revision-date":"2021-11-28 05:01:06+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"text direction\u0004ltr":["ltr"]}},"comment":{"reference":"wp-includes\/js\/dist\/i18n.js"}}

File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-bf0f094965d3d4a95b47babcb35fc136.json


+ 1 - 1
app/wp-content/languages/th-bf23b24175490c2e46aaf92ff6a0c70f.json

@@ -1 +1 @@
1
-{"translation-revision-date":"2021-09-30 09:11:37+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"Dismiss":["\u0e1b\u0e34\u0e14"]}},"comment":{"reference":"wp-includes\/js\/wp-pointer.js"}}
1
+{"translation-revision-date":"2021-11-28 05:01:06+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"Dismiss":["\u0e1b\u0e34\u0e14"]}},"comment":{"reference":"wp-includes\/js\/wp-pointer.js"}}

+ 1 - 1
app/wp-content/languages/th-ca28138671823450e87dfd354f7afc6b.json

@@ -1 +1 @@
1
-{"translation-revision-date":"2021-10-10 08:48:56+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"Changes saved.":["\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e01\u0e32\u0e23\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e41\u0e1b\u0e25\u0e07\u0e41\u0e25\u0e49\u0e27"]}},"comment":{"reference":"wp-admin\/js\/inline-edit-tax.js"}}
1
+{"translation-revision-date":"2021-11-28 05:36:52+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"th"},"Changes saved.":["\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e01\u0e32\u0e23\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e41\u0e1b\u0e25\u0e07\u0e41\u0e25\u0e49\u0e27"]}},"comment":{"reference":"wp-admin\/js\/inline-edit-tax.js"}}

File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-daeb084aab42199d26393a56c3465bc0.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-e2791ba830489d23043be8650a22a22b.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-e2e4c4b80f3adf2c70b431bfdb1b4872.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-e53526243551a102928735ec9eed4edf.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-f575f481034e90e21d832e415fd95fcf.json


File diff suppressed because it is too large
+ 1 - 1
app/wp-content/languages/th-f8f49d9fc4a9cf7d78ec99285417bd9c.json


BIN
app/wp-content/languages/th.mo


+ 70 - 1
app/wp-content/languages/th.po

@@ -2,7 +2,7 @@
2 2
 # This file is distributed under the same license as the WordPress - 5.8.x - Development package.
3 3
 msgid ""
4 4
 msgstr ""
5
-"PO-Revision-Date: 2021-09-30 09:11:37+0000\n"
5
+"PO-Revision-Date: 2021-11-28 05:01:06+0000\n"
6 6
 "MIME-Version: 1.0\n"
7 7
 "Content-Type: text/plain; charset=UTF-8\n"
8 8
 "Content-Transfer-Encoding: 8bit\n"
@@ -390,16 +390,41 @@ msgctxt "block keyword"
390 390
 msgid "poetry"
391 391
 msgstr "บทกวี"
392 392
 
393
+#: wp-includes/blocks/verse/block.json
394
+msgctxt "block description"
395
+msgid "Insert poetry. Use special spacing formats. Or quote song lyrics."
396
+msgstr "สอดแทรกบทกวี เพิ่มความโดดเด่นด้วยพื้นที่ว่างรอบตัวอักษร จะคำคมหรือบทเพลงก็เอาอยู่ "
397
+
393 398
 #: wp-includes/blocks/text-columns/block.json
394 399
 msgctxt "block description"
395 400
 msgid "This block is deprecated. Please use the Columns block instead."
396 401
 msgstr "บล็อกนี้ถูกยกเลิกการใช้งานแล้ว โปรดใช้บล็อกคอลัมน์แทน"
397 402
 
403
+#: wp-includes/blocks/tag-cloud/block.json
404
+msgctxt "block description"
405
+msgid "A cloud of your most used tags."
406
+msgstr "แหล่งเก็บแท็กที่ถูกใช้บ่อย"
407
+
398 408
 #: wp-includes/blocks/table/block.json
399 409
 msgctxt "block style label"
400 410
 msgid "Stripes"
401 411
 msgstr "Stripes"
402 412
 
413
+#: wp-includes/blocks/table/block.json
414
+msgctxt "block description"
415
+msgid "Insert a table — perfect for sharing charts and data."
416
+msgstr "แทรกตาราง — เหมาะสำหรับการนำเสนอแผนภูมิและข้อมูล"
417
+
418
+#: wp-includes/blocks/spacer/block.json
419
+msgctxt "block description"
420
+msgid "Add white space between blocks and customize its height."
421
+msgstr "เพิ่มระยะห่างระหว่างบล็อก และปรับแต่งความสูง"
422
+
423
+#: wp-includes/blocks/social-links/block.json
424
+msgctxt "block style label"
425
+msgid "Pill Shape"
426
+msgstr "รูปร่างเม็ดยา"
427
+
403 428
 #: wp-includes/blocks/social-links/block.json
404 429
 msgctxt "block style label"
405 430
 msgid "Logos Only"
@@ -513,6 +538,11 @@ msgid "Query Loop"
513 538
 msgstr "Query Loop"
514 539
 
515 540
 #: wp-includes/blocks/query-title/block.json
541
+msgctxt "block description"
542
+msgid "Display the query title."
543
+msgstr "แสดงหัวข้อจากการสืบค้น"
544
+
545
+#: wp-includes/blocks/query-title/block.json
516 546
 msgctxt "block title"
517 547
 msgid "Query Title"
518 548
 msgstr "Query Title"
@@ -538,6 +568,11 @@ msgid "Query Pagination Previous"
538 568
 msgstr "Query Pagination Previous"
539 569
 
540 570
 #: wp-includes/blocks/query-pagination-numbers/block.json
571
+msgctxt "block description"
572
+msgid "Displays a list of page numbers for pagination"
573
+msgstr "แสดงการให้เลขหน้า"
574
+
575
+#: wp-includes/blocks/query-pagination-numbers/block.json
541 576
 msgctxt "block title"
542 577
 msgid "Query Pagination Numbers"
543 578
 msgstr "Query Pagination Numbers"
@@ -552,6 +587,11 @@ msgctxt "block style label"
552 587
 msgid "Solid color"
553 588
 msgstr "สีทึบ"
554 589
 
590
+#: wp-includes/blocks/pullquote/block.json
591
+msgctxt "block description"
592
+msgid "Give special visual emphasis to a quote from your text."
593
+msgstr "สร้างความดึงดูดสายตาให้กับการอ้างอิงคำคมได้มากขึ้น"
594
+
555 595
 #: wp-includes/blocks/post-terms/block.json
556 596
 msgctxt "block title"
557 597
 msgid "Post Terms"
@@ -1014,6 +1054,10 @@ msgstr "<strong>ข้อผิดพลาด</strong>:  ลิงก์ล้
1014 1054
 msgid "Block HTML:"
1015 1055
 msgstr "บล็อก HTML"
1016 1056
 
1057
+#: wp-includes/widgets/class-wp-widget-block.php:37
1058
+msgid "A widget containing a block."
1059
+msgstr "วิดเจ็ตมีบล็อกเป็นส่วนประกอบ"
1060
+
1017 1061
 #. translators: 1 & 2: Deprecation replacement options.
1018 1062
 #: wp-includes/user.php:3733 wp-includes/user.php:3975
1019 1063
 msgid "%1$s or %2$s"
@@ -1023,6 +1067,16 @@ msgstr "%1$s หรือ %2$s"
1023 1067
 msgid "<strong>Error</strong>: Unknown email address. Check again or try your username."
1024 1068
 msgstr "<strong>ผิดพลาด</strong>: ไม่ทราบอีเมล โปรดตรวจสอบอีกครั้งหรือลองด้วยชื่อผู้ใช้งาน"
1025 1069
 
1070
+#. translators: %s: User name.
1071
+#: wp-includes/user.php:154
1072
+msgid "<strong>Error</strong>: The username <strong>%s</strong> is not registered on this site. If you are unsure of your username, try your email address instead."
1073
+msgstr "<strong>เกิดข้อผิดพลาด</strong>: ชื่อผู้ใช้<strong>%s</strong> ไม่อยู่ในระบบของเว็บไซต์นี้ หากไม่แน่เรื่องชื่อผู้ใช้ กรุณาใช้อีเมลเพื่อลองใหม่อีกครั้ง"
1074
+
1075
+#: wp-includes/taxonomy.php:646
1076
+msgctxt "navigation link block description"
1077
+msgid "A link to a category."
1078
+msgstr "ลิงก์ไปที่หมวดหมู่"
1079
+
1026 1080
 #: wp-includes/taxonomy.php:645
1027 1081
 msgctxt "navigation link block description"
1028 1082
 msgid "A link to a tag."
@@ -1074,6 +1128,10 @@ msgstr "ชนิดของวิดเจ็ตไม่ถูกต้อง
1074 1128
 msgid "Post ID."
1075 1129
 msgstr "ID เรื่อง"
1076 1130
 
1131
+#: wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php:576
1132
+msgid "Status of template."
1133
+msgstr "สถานะของเทมเพลต"
1134
+
1077 1135
 #: wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php:570
1078 1136
 msgid "Description of template."
1079 1137
 msgstr "คำอธิบายของเทมเพลต"
@@ -1082,6 +1140,17 @@ msgstr "คำอธิบายของเทมเพลต"
1082 1140
 msgid "Content of template."
1083 1141
 msgstr "เนื้อหาของเทมเพลต"
1084 1142
 
1143
+#: wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php:193
1144
+#: wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php:222
1145
+#: wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php:277
1146
+#: wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php:315
1147
+msgid "No templates exist with that id."
1148
+msgstr "ไม่มีเทมเพลตที่ตรงกับ ID ที่ระบุ"
1149
+
1150
+#: wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php:121
1151
+msgid "Sorry, you are not allowed to access the templates on this site."
1152
+msgstr "ขออภัย คุณไม่ได้รับอนุญาตให้เข้าถึงเทมเพลตบนเว็บนี้"
1153
+
1085 1154
 #: wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php:79
1086 1155
 msgid "The id of a template"
1087 1156
 msgstr "ID ของเทมเพลต"

+ 135 - 0
app/wp-content/plugins/nextend-facebook-connect/NSL/GDPR.php

@@ -0,0 +1,135 @@
1
+<?php
2
+
3
+namespace NSL;
4
+
5
+use NextendSocialLogin;
6
+
7
+class GDPR {
8
+
9
+    public function __construct() {
10
+        add_action('admin_init', array(
11
+            $this,
12
+            'add_privacy_policy_content'
13
+        ));
14
+
15
+        add_filter('wp_privacy_personal_data_exporters', array(
16
+            $this,
17
+            'register_exporter'
18
+        ), -1);
19
+
20
+        /*
21
+        add_filter('wp_privacy_personal_data_erasers', array(
22
+            $this,
23
+            'register_eraser'
24
+        ));
25
+        */
26
+    }
27
+
28
+    public function add_privacy_policy_content() {
29
+        if (!function_exists('wp_add_privacy_policy_content')) {
30
+            return;
31
+        }
32
+
33
+        $content = '';
34
+        $content .= '<h2>' . __('What personal data we collect and why we collect it') . '</h2>';
35
+        $content .= '<p class="privacy-policy-tutorial">' . sprintf(__('%1$s collects data when a visitor register, login or link the account with with any of the enabled social provider. It collects the following data: email address, name, social provider identifier and access token. Also it can collect profile picture and more fields with the Pro Addon\'s sync data feature.', 'nextend-facebook-connect'), 'Nextend Social Login') . '</p>';
36
+
37
+        $content .= '<h2>' . __('Who we share your data with') . '</h2>';
38
+        $content .= '<p class="privacy-policy-tutorial">' . sprintf(__('%1$s stores the personal data on your site and does not share it with anyone except the access token which used for the authenticated communication with the social providers.', 'nextend-facebook-connect'), 'Nextend Social Login') . '</p>';
39
+
40
+        $content .= '<h2>' . __('Does the plugin share personal data with third parties', 'nextend-facebook-connect') . '</h2>';
41
+        $content .= '<p class="privacy-policy-tutorial">' . sprintf(__('%1$s use the access token what the social provider gave to communicate with the providers to verify account and securely access personal data.', 'nextend-facebook-connect'), 'Nextend Social Login') . '</p>';
42
+
43
+        $content .= '<h2>' . __('How long we retain your data', 'nextend-facebook-connect') . '</h2>';
44
+        $content .= '<p class="privacy-policy-tutorial">' . sprintf(__('%1$s removes the collected personal data when the user deleted from WordPress.', 'nextend-facebook-connect'), 'Nextend Social Login') . '</p>';
45
+
46
+        $content .= '<h2>' . __('Does the plugin use personal data collected by others?', 'nextend-facebook-connect') . '</h2>';
47
+        $content .= '<p class="privacy-policy-tutorial">' . sprintf(__('%1$s use the personal data collected by the social providers to create account on your site when the visitor authorize it.', 'nextend-facebook-connect'), 'Nextend Social Login') . '</p>';
48
+
49
+        $content .= '<h2>' . __('Does the plugin store things in the browser?', 'nextend-facebook-connect') . '</h2>';
50
+        $content .= '<p class="privacy-policy-tutorial">' . sprintf(__('Yes, %1$s must create a cookie for visitors who use the social login authorization flow. This cookie required for every provider to secure the communication and to redirect the user back to the last location.', 'nextend-facebook-connect'), 'Nextend Social Login') . '</p>';
51
+
52
+        $content .= '<h2>' . __('Does the plugin collect telemetry data, directly or indirectly?', 'nextend-facebook-connect') . '</h2>';
53
+        $content .= '<p class="privacy-policy-tutorial">' . __('No') . '</p>';
54
+
55
+        $content .= '<h2>' . __('Does the plugin enqueue JavaScript, tracking pixels or embed iframes from a third party?', 'nextend-facebook-connect') . '</h2>';
56
+        $content .= '<p class="privacy-policy-tutorial">' . __('No') . '</p>';
57
+
58
+
59
+        wp_add_privacy_policy_content('Nextend Social Login', wp_kses_post($content));
60
+    }
61
+
62
+
63
+    public function register_exporter($exporters) {
64
+        $exporters['nextend-facebook-connect'] = array(
65
+            'exporter_friendly_name' => 'Nextend Social Login',
66
+            'callback'               => array(
67
+                $this,
68
+                'exporter'
69
+            ),
70
+        );
71
+
72
+        return $exporters;
73
+    }
74
+
75
+    public function exporter($email_address, $page = 1) {
76
+        $email_address = trim($email_address);
77
+
78
+        $data_to_export = array();
79
+
80
+        $user = get_user_by('email', $email_address);
81
+
82
+        if (!$user) {
83
+            return array(
84
+                'data' => array(),
85
+                'done' => true,
86
+            );
87
+        }
88
+
89
+        $user_data_to_export = array();
90
+
91
+        foreach (NextendSocialLogin::$allowedProviders as $provider) {
92
+            $user_data_to_export = array_merge($user_data_to_export, $provider->exportPersonalData($user->ID));
93
+        }
94
+
95
+
96
+        if (!empty($user_data_to_export)) {
97
+            $data_to_export[] = array(
98
+                'group_id'    => 'user',
99
+                'group_label' => __('User'),
100
+                'item_id'     => "user-{$user->ID}",
101
+                'data'        => $user_data_to_export,
102
+            );
103
+        }
104
+
105
+
106
+        return array(
107
+            'data' => $data_to_export,
108
+            'done' => true,
109
+        );
110
+    }
111
+
112
+    public function register_eraser($erasers) {
113
+        $erasers['nextend-facebook-connect'] = array(
114
+            'exporter_friendly_name' => 'Nextend Social Login',
115
+            'callback'               => array(
116
+                $this,
117
+                'eraser'
118
+            ),
119
+        );
120
+
121
+        return $erasers;
122
+    }
123
+
124
+    public function eraser($email_address, $page = 1) {
125
+        return array(
126
+            'items_removed'  => false,
127
+            'items_retained' => false,
128
+            'messages'       => array(),
129
+            'done'           => true,
130
+        );
131
+    }
132
+}
133
+
134
+
135
+new GDPR();

+ 214 - 0
app/wp-content/plugins/nextend-facebook-connect/NSL/Notices.php

@@ -0,0 +1,214 @@
1
+<?php
2
+
3
+namespace NSL;
4
+
5
+use NSL\Persistent\Persistent;
6
+use WP_Error;
7
+
8
+class Notices {
9
+
10
+    private static $notices;
11
+
12
+    private static $instance;
13
+
14
+    public static function init() {
15
+        if (self::$instance === null) {
16
+            self::$instance = new self;
17
+        }
18
+    }
19
+
20
+    private function __construct() {
21
+        if (is_admin() || (isset($_GET['nsl-notice']) && $_GET['nsl-notice'] == 1)) {
22
+            add_action('init', array(
23
+                $this,
24
+                'load'
25
+            ), 11);
26
+
27
+            if (basename($_SERVER['PHP_SELF']) !== 'options-general.php' || empty($_GET['page']) || $_GET['page'] !== 'nextend-social-login') {
28
+                add_action('admin_notices', array(
29
+                    $this,
30
+                    'admin_notices'
31
+                ));
32
+            }
33
+
34
+            add_action('admin_print_footer_scripts', array(
35
+                $this,
36
+                'notices_fallback'
37
+            ));
38
+            add_action('wp_print_footer_scripts', array(
39
+                $this,
40
+                'notices_fallback'
41
+            ));
42
+        }
43
+    }
44
+
45
+    public function load() {
46
+        self::$notices = maybe_unserialize(self::get());
47
+        if (!is_array(self::$notices)) {
48
+            self::$notices = array();
49
+        }
50
+    }
51
+
52
+    private static function add($type, $message) {
53
+        if (!isset(self::$notices[$type])) {
54
+            self::$notices[$type] = array();
55
+        }
56
+
57
+        if (!in_array($message, self::$notices[$type])) {
58
+            self::$notices[$type][] = $message;
59
+        }
60
+
61
+        self::set();
62
+    }
63
+
64
+    /**
65
+     * @param $message string|WP_Error
66
+     */
67
+    public static function addError($message) {
68
+        if (is_wp_error($message)) {
69
+            foreach ($message->get_error_messages() as $m) {
70
+                self::add('error', $m);
71
+            }
72
+        } else {
73
+            self::add('error', $message);
74
+        }
75
+    }
76
+
77
+    public static function getErrors() {
78
+        if (isset(self::$notices['error'])) {
79
+
80
+            $errors = self::$notices['error'];
81
+
82
+            unset(self::$notices['error']);
83
+            self::set();
84
+
85
+            return $errors;
86
+        }
87
+
88
+        return false;
89
+    }
90
+
91
+    public static function addSuccess($message) {
92
+        self::add('success', $message);
93
+    }
94
+
95
+    public static function displayNotices() {
96
+
97
+        $html = self::getHTML();
98
+
99
+        if (!empty($html)) {
100
+            echo '<div class="nsl-admin-notices">' . $html . '</div>';
101
+        }
102
+    }
103
+
104
+    public function admin_notices() {
105
+        echo self::getHTML();
106
+    }
107
+
108
+    /**
109
+     * Displays the non-displayed notices in lightbox as a fallback
110
+     */
111
+    public function notices_fallback() {
112
+
113
+        $html = self::getHTML();
114
+
115
+        if (!empty($html)) {
116
+            ?>
117
+            <div id="nsl-notices-fallback" onclick="this.parentNode.removeChild(this);">
118
+                <?php echo $html; ?>
119
+                <style>
120
+                    #nsl-notices-fallback {
121
+                        position: fixed;
122
+                        right: 10px;
123
+                        top: 10px;
124
+                        z-index: 10000;
125
+                    }
126
+
127
+                    .admin-bar #nsl-notices-fallback {
128
+                        top: 42px;
129
+                    }
130
+
131
+                    #nsl-notices-fallback > div {
132
+                        position: relative;
133
+                        background: #fff;
134
+                        border-left: 4px solid #fff;
135
+                        box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
136
+                        margin: 5px 15px 2px;
137
+                        padding: 1px 20px;
138
+                    }
139
+
140
+                    #nsl-notices-fallback > div.error {
141
+                        display: block;
142
+                        border-left-color: #dc3232;
143
+                    }
144
+
145
+                    #nsl-notices-fallback > div.updated {
146
+                        display: block;
147
+                        border-left-color: #46b450;
148
+                    }
149
+
150
+                    #nsl-notices-fallback p {
151
+                        margin: .5em 0;
152
+                        padding: 2px;
153
+                    }
154
+
155
+                    #nsl-notices-fallback > div:after {
156
+                        position: absolute;
157
+                        right: 5px;
158
+                        top: 5px;
159
+                        content: '\00d7';
160
+                        display: block;
161
+                        height: 16px;
162
+                        width: 16px;
163
+                        line-height: 16px;
164
+                        text-align: center;
165
+                        font-size: 20px;
166
+                        cursor: pointer;
167
+                    }
168
+                </style>
169
+            </div>
170
+            <?php
171
+        }
172
+    }
173
+
174
+    private static function getHTML() {
175
+        $html = '';
176
+        if (isset(self::$notices['success'])) {
177
+            foreach (self::$notices['success'] AS $message) {
178
+                $html .= '<div class="updated"><p>' . $message . '</p></div>';
179
+            }
180
+        }
181
+
182
+        if (isset(self::$notices['error'])) {
183
+            foreach (self::$notices['error'] AS $message) {
184
+                $html .= '<div class="error"><p>' . $message . '</p></div>';
185
+            }
186
+        }
187
+
188
+        self::clear();
189
+
190
+        return $html;
191
+    }
192
+
193
+    private static function get() {
194
+        return Persistent::get('notices');
195
+    }
196
+
197
+    private static function set() {
198
+        Persistent::set('notices', self::$notices);
199
+    }
200
+
201
+    public static function clear() {
202
+
203
+        Persistent::delete('notices');
204
+        self::$notices = array();
205
+    }
206
+
207
+    public static function hasErrors() {
208
+        if (isset(self::$notices['error'])) {
209
+            return true;
210
+        }
211
+
212
+        return false;
213
+    }
214
+}

+ 93 - 0
app/wp-content/plugins/nextend-facebook-connect/NSL/Persistent/Persistent.php

@@ -0,0 +1,93 @@
1
+<?php
2
+
3
+namespace NSL\Persistent;
4
+
5
+use NSL\Persistent\Storage\Session;
6
+use NSL\Persistent\Storage\StorageAbstract;
7
+use NSL\Persistent\Storage\Transient;
8
+use WP_User;
9
+
10
+require_once dirname(__FILE__) . '/Storage/Abstract.php';
11
+require_once dirname(__FILE__) . '/Storage/Session.php';
12
+require_once dirname(__FILE__) . '/Storage/Transient.php';
13
+
14
+class Persistent {
15
+
16
+    private static $instance;
17
+
18
+    /** @var StorageAbstract */
19
+    private $storage;
20
+
21
+    public function __construct() {
22
+        self::$instance = $this;
23
+        add_action('init', array(
24
+            $this,
25
+            'init'
26
+        ), 0);
27
+
28
+        add_action('wp_login', array(
29
+            $this,
30
+            'transferSessionToUser'
31
+        ), 10, 2);
32
+    }
33
+
34
+    public function init() {
35
+        if ($this->storage === NULL) {
36
+            if (is_user_logged_in()) {
37
+                $this->storage = new Transient();
38
+            } else {
39
+                $this->storage = new Session();
40
+            }
41
+        }
42
+    }
43
+
44
+    public static function set($key, $value) {
45
+        if (self::$instance->storage) {
46
+            self::$instance->storage->set($key, $value);
47
+        }
48
+    }
49
+
50
+    public static function get($key) {
51
+        if (self::$instance->storage) {
52
+            return self::$instance->storage->get($key);
53
+        }
54
+
55
+        return false;
56
+    }
57
+
58
+    public static function delete($key) {
59
+        if (self::$instance->storage) {
60
+            self::$instance->storage->delete($key);
61
+        }
62
+    }
63
+
64
+    /**
65
+     * @param          $user_login
66
+     * @param WP_User  $user
67
+     */
68
+    public function transferSessionToUser($user_login, $user = null) {
69
+
70
+        if (!$user) { // For do_action( 'wp_login' ) calls that lacked passing the 2nd arg.
71
+            $user = get_user_by('login', $user_login);
72
+        }
73
+
74
+        $newStorage = new Transient($user->ID);
75
+        /**
76
+         * $this->storage might be NULL if init action not called yet
77
+         */
78
+        if ($this->storage !== NULL) {
79
+            $newStorage->transferData($this->storage);
80
+        }
81
+
82
+        $this->storage = $newStorage;
83
+    }
84
+
85
+    public static function clear() {
86
+        if (self::$instance->storage) {
87
+            self::$instance->storage->clear();
88
+        }
89
+    }
90
+}
91
+
92
+
93
+new Persistent();

+ 72 - 0
app/wp-content/plugins/nextend-facebook-connect/NSL/Persistent/Storage/Abstract.php

@@ -0,0 +1,72 @@
1
+<?php
2
+
3
+namespace NSL\Persistent\Storage;
4
+
5
+abstract class StorageAbstract {
6
+
7
+    protected $sessionId = null;
8
+
9
+    protected $data = array();
10
+
11
+    public function set($key, $value) {
12
+        $this->load(true);
13
+
14
+        $this->data[$key] = $value;
15
+
16
+        $this->store();
17
+    }
18
+
19
+    public function get($key) {
20
+        $this->load();
21
+
22
+        if (isset($this->data[$key])) {
23
+            return $this->data[$key];
24
+        }
25
+
26
+        return null;
27
+    }
28
+
29
+    public function delete($key) {
30
+        $this->load();
31
+
32
+        if (isset($this->data[$key])) {
33
+            unset($this->data[$key]);
34
+            $this->store();
35
+        }
36
+    }
37
+
38
+    public function clear() {
39
+        $this->data = array();
40
+        $this->store();
41
+    }
42
+
43
+    protected function load($createSession = false) {
44
+        static $isLoaded = false;
45
+
46
+        if (!$isLoaded) {
47
+            $data = maybe_unserialize(get_site_transient($this->sessionId));
48
+            if (is_array($data)) {
49
+                $this->data = $data;
50
+            }
51
+            $isLoaded = true;
52
+        }
53
+    }
54
+
55
+    private function store() {
56
+        if (empty($this->data)) {
57
+            delete_site_transient($this->sessionId);
58
+        } else {
59
+            set_site_transient($this->sessionId, $this->data, apply_filters('nsl_persistent_expiration', HOUR_IN_SECONDS));
60
+        }
61
+    }
62
+
63
+    /**
64
+     * @param StorageAbstract $storage
65
+     */
66
+    public function transferData($storage) {
67
+        $this->data = $storage->data;
68
+        $this->store();
69
+
70
+        $storage->clear();
71
+    }
72
+}

+ 86 - 0
app/wp-content/plugins/nextend-facebook-connect/NSL/Persistent/Storage/Session.php

@@ -0,0 +1,86 @@
1
+<?php
2
+
3
+namespace NSL\Persistent\Storage;
4
+
5
+class Session extends StorageAbstract {
6
+
7
+    /**
8
+     * @var string name of the cookie. Can be changed with nsl_session_name filter and NSL_SESSION_NAME constant.
9
+     *
10
+     * @see https://pantheon.io/docs/caching-advanced-topics/
11
+     */
12
+    private $sessionName = 'SESSnsl';
13
+
14
+    public function __construct() {
15
+
16
+        /**
17
+         * WP Engine hosting needs custom cookie name to prevent caching.
18
+         *
19
+         * @see https://wpengine.com/support/wpengine-ecommerce/
20
+         */
21
+        if (class_exists('WpePlugin_common', false)) {
22
+            $this->sessionName = 'wordpress_nsl';
23
+        }
24
+        if (defined('NSL_SESSION_NAME')) {
25
+            $this->sessionName = NSL_SESSION_NAME;
26
+        }
27
+        $this->sessionName = apply_filters('nsl_session_name', $this->sessionName);
28
+    }
29
+
30
+    public function clear() {
31
+        parent::clear();
32
+
33
+        $this->destroy();
34
+    }
35
+
36
+    private function destroy() {
37
+        $sessionID = $this->sessionId;
38
+        if ($sessionID) {
39
+            $this->setCookie($sessionID, time() - YEAR_IN_SECONDS, apply_filters('nsl_session_use_secure_cookie', false));
40
+
41
+            add_action('shutdown', array(
42
+                $this,
43
+                'destroySiteTransient'
44
+            ));
45
+        }
46
+    }
47
+
48
+    public function destroySiteTransient() {
49
+        $sessionID = $this->sessionId;
50
+        if ($sessionID) {
51
+            delete_site_transient('nsl_' . $sessionID);
52
+        }
53
+    }
54
+
55
+    protected function load($createSession = false) {
56
+        static $isLoaded = false;
57
+        if ($this->sessionId === null) {
58
+            if (isset($_COOKIE[$this->sessionName])) {
59
+                $this->sessionId = 'nsl_persistent_' . md5(SECURE_AUTH_KEY . $_COOKIE[$this->sessionName]);
60
+            } else if ($createSession) {
61
+                $unique = uniqid('nsl', true);
62
+
63
+                $this->setCookie($unique, apply_filters('nsl_session_cookie_expiration', 0), apply_filters('nsl_session_use_secure_cookie', false));
64
+
65
+                $this->sessionId = 'nsl_persistent_' . md5(SECURE_AUTH_KEY . $unique);
66
+
67
+                $isLoaded = true;
68
+            }
69
+        }
70
+
71
+        if (!$isLoaded) {
72
+            if ($this->sessionId !== null) {
73
+                $data = maybe_unserialize(get_site_transient($this->sessionId));
74
+                if (is_array($data)) {
75
+                    $this->data = $data;
76
+                }
77
+                $isLoaded = true;
78
+            }
79
+        }
80
+    }
81
+
82
+    private function setCookie($value, $expire, $secure = false) {
83
+
84
+        setcookie($this->sessionName, $value, $expire, COOKIEPATH ? COOKIEPATH : '/', COOKIE_DOMAIN, $secure);
85
+    }
86
+}

+ 13 - 0
app/wp-content/plugins/nextend-facebook-connect/NSL/Persistent/Storage/Transient.php

@@ -0,0 +1,13 @@
1
+<?php
2
+
3
+namespace NSL\Persistent\Storage;
4
+
5
+class Transient extends StorageAbstract {
6
+
7
+    public function __construct($user_id = false) {
8
+        if ($user_id === false) {
9
+            $user_id = get_current_user_id();
10
+        }
11
+        $this->sessionId = 'nsl_persistent_' . $user_id;
12
+    }
13
+}

+ 72 - 0
app/wp-content/plugins/nextend-facebook-connect/NSL/REST.php

@@ -0,0 +1,72 @@
1
+<?php
2
+
3
+namespace NSL;
4
+
5
+use Exception;
6
+use NextendSocialLogin;
7
+use WP_Error;
8
+use WP_REST_Request;
9
+use WP_REST_Response;
10
+use function add_action;
11
+use function register_rest_route;
12
+
13
+class REST {
14
+
15
+    public function __construct() {
16
+        add_action('rest_api_init', array(
17
+            $this,
18
+            'rest_api_init'
19
+        ));
20
+    }
21
+
22
+    public function rest_api_init() {
23
+        register_rest_route('nextend-social-login/v1', '/(?P<provider>\w[\w\s\-]*)/get_user', array(
24
+            'args' => array(
25
+                'provider'     => array(
26
+                    'required'          => true,
27
+                    'validate_callback' => array(
28
+                        $this,
29
+                        'validate_provider'
30
+                    )
31
+                ),
32
+                'access_token' => array(
33
+                    'required' => true,
34
+                ),
35
+            ),
36
+            array(
37
+                'methods'             => 'POST',
38
+                'callback'            => array(
39
+                    $this,
40
+                    'get_user'
41
+                ),
42
+                'permission_callback' => '__return_true'
43
+            ),
44
+        ));
45
+
46
+    }
47
+
48
+    public function validate_provider($providerID) {
49
+        return NextendSocialLogin::isProviderEnabled($providerID);
50
+    }
51
+
52
+    /**
53
+     * @param WP_REST_Request $request Full details about the request.
54
+     *
55
+     * @return WP_Error|WP_REST_Response
56
+     */
57
+    public function get_user($request) {
58
+
59
+        $provider = NextendSocialLogin::$enabledProviders[$request['provider']];
60
+        try {
61
+            $user = $provider->findUserByAccessToken($request['access_token']);
62
+        } catch (Exception $e) {
63
+            return new WP_Error('error', $e->getMessage());
64
+        }
65
+
66
+        return $user;
67
+    }
68
+
69
+}
70
+
71
+new REST();
72
+

+ 71 - 0
app/wp-content/plugins/nextend-facebook-connect/admin/EditUser.php

@@ -0,0 +1,71 @@
1
+<?php
2
+/** @var $user WP_User */
3
+?>
4
+
5
+<?php foreach (NextendSocialLogin::$enabledProviders AS $provider): ?>
6
+    <?php
7
+    $settings = $provider->settings;
8
+    if (!$provider->isUserConnected($user->ID)) continue;
9
+    $hasData = false;
10
+    ob_start();
11
+    ?>
12
+
13
+    <h2><?php echo $provider->getLabel(); ?></h2>
14
+
15
+    <table class="form-table">
16
+        <tbody>
17
+        <?php foreach ($provider->getSyncFields() AS $fieldName => $fieldData): ?>
18
+            <tr>
19
+                <?php
20
+                $meta_key = $settings->get('sync_fields/fields/' . $fieldName . '/meta_key');
21
+                $value    = get_user_meta($user->ID, $meta_key, true);
22
+                if (isset($value) && $value !== '') {
23
+                    ?>
24
+                    <th><label><?php echo $fieldData['label'] ?></label></th>
25
+                    <td>
26
+                        <?php
27
+
28
+                        $unSerialized = maybe_unserialize($value);
29
+                        if (is_array($unSerialized) || is_object($unSerialized)) {
30
+
31
+                            echo "<pre>";
32
+                            print_r(formatUserMeta((array)$unSerialized));
33
+
34
+                            echo "</pre>";
35
+                        } else {
36
+                            echo esc_html($value);
37
+                        }
38
+                        $hasData = true;
39
+                        ?>
40
+                    </td>
41
+                    <?php
42
+                }
43
+                ?>
44
+            </tr>
45
+        <?php endforeach; ?>
46
+
47
+        </tbody>
48
+    </table>
49
+    <?php
50
+    if ($hasData) {
51
+        echo ob_get_clean();
52
+    } else {
53
+        ob_end_clean();
54
+    }
55
+    ?>
56
+<?php endforeach; ?>
57
+
58
+<?php
59
+
60
+function formatUserMeta($user_meta, $level = '') {
61
+    $formatted_usermeta = '';
62
+    if (is_array($user_meta)) {
63
+        foreach ($user_meta as $meta_key => $meta_value) {
64
+            $formatted_usermeta .= formatUserMeta($meta_value, $level . '[' . $meta_key . ']');
65
+        }
66
+    } else {
67
+        $formatted_usermeta .= "\n" . $level . ' = ' . $user_meta;
68
+    }
69
+
70
+    return $formatted_usermeta;
71
+}

File diff suppressed because it is too large
+ 1023 - 0
app/wp-content/plugins/nextend-facebook-connect/admin/admin.php


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/buttons/default.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/buttons/fullwidth.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/buttons/icon.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/error.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/exclamation-mark.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/facebook/black.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/facebook/dark.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/facebook/light.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/facebook/white.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/google/dark.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/google/light.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/google/uniform.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/layouts/above-separator.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/layouts/above.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/layouts/below-floating.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/layouts/below-separator.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/layouts/below.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/layouts/default-separator.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/layouts/default.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/notice.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/notice/nslnotice.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/nsl-logo.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/ok.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/padlock.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/stars-big.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/stars-small.png


BIN
app/wp-content/plugins/nextend-facebook-connect/admin/images/test-needed.png


+ 38 - 0
app/wp-content/plugins/nextend-facebook-connect/admin/interim.php

@@ -0,0 +1,38 @@
1
+<?php
2
+if (!defined('ABSPATH')) {
3
+    exit;
4
+}
5
+
6
+global $interim_login;
7
+$customize_login = isset($_REQUEST['customize-login']);
8
+if ($customize_login) {
9
+    wp_enqueue_script('customize-base');
10
+}
11
+
12
+$message = '<p class="message">' . __('You have logged in successfully.') . '</p>';
13
+$interim_login = 'success';
14
+?><!DOCTYPE html>
15
+<!--[if IE 8]>
16
+<html xmlns="http://www.w3.org/1999/xhtml" class="ie8" <?php language_attributes(); ?>>
17
+<![endif]-->
18
+<!--[if !(IE 8) ]><!-->
19
+<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
20
+<!--<![endif]-->
21
+<head>
22
+    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>"/>
23
+    <title><?php __('You have logged in successfully.'); ?></title>
24
+</head>
25
+<body class="login interim-login interim-login-success">
26
+<?php
27
+echo $message;
28
+/** This action is documented in wp-login.php */
29
+do_action('login_footer'); ?>
30
+<?php if ($customize_login) : ?>
31
+    <script type="text/javascript">setTimeout(function () {
32
+            new wp.customize.Messenger({url: '<?php echo wp_customize_url(); ?>', channel: 'login'}).send(
33
+                'login');
34
+        }, 1000);</script>
35
+<?php endif; ?>
36
+</body>
37
+</html>
38
+<?php exit;

+ 77 - 0
app/wp-content/plugins/nextend-facebook-connect/admin/notice.php

@@ -0,0 +1,77 @@
1
+<?php
2
+
3
+
4
+$current = time();
5
+if (mktime(0, 0, 0, 11, 23, 2021) <= $current && $current < mktime(0, 0, 0, 12, 1, 2021)) {
6
+    if (get_option('nsl_bf_2021') != '1') {
7
+
8
+        add_action('admin_notices', function () {
9
+            ?>
10
+            <div class="notice notice-info is-dismissible" data-nsldismissable="nsl_bf_2021" style="display:grid;grid-template-columns: 100px auto;padding-top: 25px; padding-bottom: 22px;">
11
+                <img alt="Nextend Social Login" src="<?php echo plugins_url('images/notice/nslnotice.png', NSL_ADMIN_PATH) ?>" width="74" height="74" style="grid-row: 1 / 4; align-self: center;justify-self: center">
12
+                <h3 style="margin:0;">Nextend Social Login - Black Friday Deal</h3>
13
+                <p style="margin:0 0 2px;">Don't miss out on our biggest sale of the year! Get your <b>Pro Addon</b>
14
+                    with <b>40% OFF</b> to access <b>WooCommerce support</b>, Apple provider and much more!
15
+                    Limited time offer expires on November 30.</p>
16
+                <p style="margin:0;">
17
+                    <a class="button button-primary" href="https://nextendweb.com/social-login/?coupon=SAVE4021&utm_source=wpfree&utm_medium=wp&utm_campaign=bf21#pricing" target="_blank">
18
+                        Buy Now</a>
19
+                    <a class="button button-dismiss" href="#">Dismiss</a>
20
+                </p>
21
+            </div>
22
+            <?php
23
+        });
24
+
25
+        add_action('admin_footer', function () {
26
+            ?>
27
+            <script>
28
+                (function () {
29
+                    function ready(fn) {
30
+                        if (document.readyState === "complete" || document.readyState === "interactive") {
31
+                            fn();
32
+                        } else {
33
+                            document.addEventListener("DOMContentLoaded", fn);
34
+                        }
35
+                    }
36
+
37
+                    function serialize(obj) {
38
+                        return Object.keys(obj).reduce(function (a, k) {
39
+                            a.push(k + '=' + encodeURIComponent(obj[k]));
40
+                            return a;
41
+                        }, []).join('&');
42
+                    }
43
+
44
+                    ready(function () {
45
+                        setTimeout(function () {
46
+                            const buttons = document.querySelectorAll("div[data-nsldismissable] .notice-dismiss, div[data-nsldismissable] .button-dismiss");
47
+                            for (let i = 0; i < buttons.length; i++) {
48
+                                buttons[i].addEventListener('click', function (e) {
49
+                                    e.preventDefault();
50
+
51
+                                    const http = new XMLHttpRequest();
52
+                                    http.open('POST', ajaxurl, true);
53
+                                    http.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
54
+
55
+                                    http.send(serialize({
56
+                                        'action': 'nsl_dismiss_admin_notice',
57
+                                        'nonce': <?php echo json_encode(wp_create_nonce('nsl-dismissible-notice')); ?>
58
+                                    }));
59
+
60
+                                    e.target.closest('.is-dismissible').remove();
61
+                                });
62
+                            }
63
+                        }, 1000);
64
+                    });
65
+                })();
66
+            </script>
67
+            <?php
68
+        });
69
+
70
+        add_action('wp_ajax_nsl_dismiss_admin_notice', function () {
71
+            check_ajax_referer('nsl-dismissible-notice', 'nonce');
72
+
73
+            update_option('nsl_bf_2021', '1');
74
+            wp_die();
75
+        });
76
+    }
77
+}

File diff suppressed because it is too large
+ 529 - 0
app/wp-content/plugins/nextend-facebook-connect/admin/style.css


+ 201 - 0
app/wp-content/plugins/nextend-facebook-connect/admin/templates-provider/buttons.php

@@ -0,0 +1,201 @@
1
+<?php
2
+defined('ABSPATH') || die();
3
+/** @var $this NextendSocialProviderAdmin */
4
+
5
+$provider = $this->getProvider();
6
+
7
+$settings = $provider->settings;
8
+
9
+$isPRO = apply_filters('nsl-pro', false);
10
+?>
11
+<div class="nsl-admin-sub-content">
12
+    <script type="text/javascript">
13
+
14
+        document.addEventListener("DOMContentLoaded", function () {
15
+            window.resetButtonToDefault = function (id) {
16
+                var defaultButtonValues = {
17
+                    '#login_label': <?php echo wp_json_encode($settings->get('login_label', 'default')); ?>,
18
+                    '#register_label': <?php echo wp_json_encode($settings->get('register_label', 'default')); ?>,
19
+                    '#link_label': <?php echo wp_json_encode($settings->get('link_label', 'default')); ?>,
20
+                    '#unlink_label': <?php echo wp_json_encode($settings->get('unlink_label', 'default')); ?>,
21
+                    '#custom_default_button': <?php echo wp_json_encode($provider->getRawDefaultButton()); ?>,
22
+                    '#custom_icon_button': <?php echo wp_json_encode($provider->getRawIconButton()); ?>
23
+                };
24
+
25
+                var inputField = document.querySelector(id),
26
+                    codeMirror = inputField.parentNode.querySelector('.CodeMirror');
27
+
28
+                inputField.value = defaultButtonValues[id];
29
+                if (codeMirror) {
30
+                    codeMirror.CodeMirror.setValue(defaultButtonValues[id]);
31
+                }
32
+                return false;
33
+            };
34
+
35
+            var defaultButton = document.getElementById('custom_default_button_enabled');
36
+            defaultButton.addEventListener('change', function () {
37
+                if (this.checked) {
38
+                    document.getElementById('custom_default_button_textarea_container').style.removeProperty('display');
39
+
40
+                    var inputField = document.getElementById('custom_default_button'),
41
+                        codeMirror = inputField.parentNode.querySelector('.CodeMirror');
42
+                    if (codeMirror) {
43
+                        codeMirror.CodeMirror.refresh();
44
+                    }
45
+                } else {
46
+                    document.getElementById('custom_default_button_textarea_container').style.display = 'none';
47
+                }
48
+            });
49
+
50
+            var defaultIcon = document.getElementById('custom_icon_button_enabled');
51
+            defaultIcon.addEventListener('change', function () {
52
+                if (this.checked) {
53
+                    document.getElementById('custom_icon_button_textarea_container').style.removeProperty('display');
54
+
55
+                    var inputField = document.getElementById('custom_icon_button');
56
+                    var codeMirror = inputField.parentNode.querySelector('.CodeMirror');
57
+                    if (codeMirror) {
58
+                        codeMirror.CodeMirror.refresh();
59
+                    }
60
+                } else {
61
+                    document.getElementById('custom_icon_button_textarea_container').style.display = 'none';
62
+                }
63
+            });
64
+        });
65
+
66
+    </script>
67
+
68
+    <form method="post" action="<?php echo admin_url('admin-post.php'); ?>" novalidate="novalidate">
69
+
70
+        <?php wp_nonce_field('nextend-social-login'); ?>
71
+        <input type="hidden" name="action" value="nextend-social-login"/>
72
+        <input type="hidden" name="view" value="provider-<?php echo $provider->getId(); ?>"/>
73
+        <input type="hidden" name="subview" value="buttons"/>
74
+
75
+        <table class="form-table">
76
+            <tbody>
77
+            <?php
78
+            $buttonsPath = $provider->getPath() . '/admin/buttons.php';
79
+            if (file_exists($buttonsPath)) {
80
+                include($buttonsPath);
81
+            }
82
+            ?>
83
+
84
+            <tr>
85
+                <th scope="row"><label
86
+                            for="login_label"><?php _e('Login label', 'nextend-facebook-connect'); ?></label></th>
87
+                <td>
88
+                    <input name="login_label" type="text" id="login_label"
89
+                           value="<?php echo esc_attr($settings->get('login_label')); ?>" class="regular-text">
90
+                    <p class="description"><a href="#"
91
+                                              onclick="return resetButtonToDefault('#login_label');"><?php _e('Reset to default', 'nextend-facebook-connect'); ?></a>
92
+                    </p>
93
+                </td>
94
+            </tr>
95
+
96
+            <?php
97
+            $useCustomRegisterLabel = NextendSocialLogin::$settings->get('custom_register_label');
98
+            if ($useCustomRegisterLabel): ?>
99
+                <tr>
100
+                    <th scope="row"><label
101
+                                for="register_label"><?php _e('Register label', 'nextend-facebook-connect'); ?></label>
102
+                    </th>
103
+                    <td>
104
+                        <input name="register_label" type="text" id="register_label"
105
+                               value="<?php echo esc_attr($settings->get('register_label')); ?>" class="regular-text">
106
+                        <p class="description"><a href="#"
107
+                                                  onclick="return resetButtonToDefault('#register_label');"><?php _e('Reset to default', 'nextend-facebook-connect'); ?></a>
108
+                        </p>
109
+                    </td>
110
+                </tr>
111
+            <?php endif; ?>
112
+
113
+            <tr>
114
+                <th scope="row"><label for="link_label"><?php _e('Link label', 'nextend-facebook-connect'); ?></label>
115
+                </th>
116
+                <td>
117
+                    <input name="link_label" type="text" id="link_label"
118
+                           value="<?php echo esc_attr($settings->get('link_label')); ?>" class="regular-text">
119
+                    <p class="description"><a href="#"
120
+                                              onclick="return resetButtonToDefault('#link_label');"><?php _e('Reset to default', 'nextend-facebook-connect'); ?></a>
121
+                    </p>
122
+                </td>
123
+            </tr>
124
+            <tr>
125
+                <th scope="row"><label
126
+                            for="unlink_label"><?php _e('Unlink label', 'nextend-facebook-connect'); ?></label></th>
127
+                <td>
128
+                    <input name="unlink_label" type="text" id="unlink_label"
129
+                           value="<?php echo esc_attr($settings->get('unlink_label')); ?>" class="regular-text">
130
+                    <p class="description"><a href="#"
131
+                                              onclick="return resetButtonToDefault('#unlink_label');"><?php _e('Reset to default', 'nextend-facebook-connect'); ?></a>
132
+                    </p>
133
+                </td>
134
+            </tr>
135
+            <tr>
136
+                <th scope="row"><label
137
+                            for="custom_default_button"><?php _e('Default button', 'nextend-facebook-connect'); ?></label>
138
+                </th>
139
+                <td>
140
+                    <?php
141
+                    $useCustom      = false;
142
+                    $buttonTemplate = $settings->get('custom_default_button');
143
+                    if (!empty($buttonTemplate)) {
144
+                        $useCustom = true;
145
+                    } else {
146
+                        $buttonTemplate = $provider->getRawDefaultButton();
147
+                    }
148
+                    ?>
149
+                    <fieldset><label for="custom_default_button_enabled">
150
+                            <input name="custom_default_button_enabled" type="checkbox"
151
+                                   id="custom_default_button_enabled"
152
+                                   value="1" <?php if ($useCustom): ?> checked<?php endif; ?>>
153
+                            <?php _e('Use custom button', 'nextend-facebook-connect'); ?></label>
154
+                    </fieldset>
155
+                    <div id="custom_default_button_textarea_container" <?php if (!$useCustom): ?> style="display:none;"<?php endif; ?>>
156
+                        <textarea cols="160" rows="6" name="custom_default_button" id="custom_default_button"
157
+                                  class="nextend-html-editor"
158
+                                  aria-describedby="editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"><?php echo esc_textarea($buttonTemplate); ?></textarea>
159
+                        <p class="description"><a href="#"
160
+                                                  onclick="return resetButtonToDefault('#custom_default_button');"><?php _e('Reset to default', 'nextend-facebook-connect'); ?></a><br><br><?php printf(__('Use the %s in your custom button\'s code to make the label show up.', 'nextend-facebook-connect'), "<code>{{label}}</code>"); ?>
161
+                        </p>
162
+                    </div>
163
+                </td>
164
+            </tr>
165
+            <?php if ($isPRO): ?>
166
+                <tr>
167
+                    <th scope="row"><label
168
+                                for="custom_icon_button"><?php _e('Icon button', 'nextend-facebook-connect'); ?></label>
169
+                    </th>
170
+                    <td>
171
+                        <?php
172
+                        $useCustom      = false;
173
+                        $buttonTemplate = $settings->get('custom_icon_button');
174
+                        if (!empty($buttonTemplate)) {
175
+                            $useCustom = true;
176
+                        } else {
177
+                            $buttonTemplate = $provider->getRawIconButton();
178
+                        }
179
+                        ?>
180
+                        <fieldset><label for="custom_icon_button_enabled">
181
+                                <input name="custom_icon_button_enabled" type="checkbox" id="custom_icon_button_enabled"
182
+                                       value="1" <?php if ($useCustom): ?> checked<?php endif; ?>>
183
+                                <?php _e('Use custom button', 'nextend-facebook-connect'); ?></label>
184
+                        </fieldset>
185
+                        <div id="custom_icon_button_textarea_container" <?php if (!$useCustom): ?> style="display:none;"<?php endif; ?>>
186
+                        <textarea cols="160" rows="6" name="custom_icon_button" id="custom_icon_button"
187
+                                  class="nextend-html-editor"
188
+                                  aria-describedby="editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"><?php echo esc_textarea($buttonTemplate); ?></textarea>
189
+                            <p class="description"><a href="#"
190
+                                                      onclick="return resetButtonToDefault('#custom_icon_button');"><?php _e('Reset to default', 'nextend-facebook-connect'); ?></a>
191
+                            </p>
192
+                        </div>
193
+                    </td>
194
+                </tr>
195
+            <?php endif; ?>
196
+            </tbody>
197
+        </table>
198
+        <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary"
199
+                                 value="<?php _e('Save Changes'); ?>"></p>
200
+    </form>
201
+</div>

+ 25 - 0
app/wp-content/plugins/nextend-facebook-connect/admin/templates-provider/menu.php

@@ -0,0 +1,25 @@
1
+<?php
2
+defined('ABSPATH') || die();
3
+/** @var $this NextendSocialProviderAdmin */
4
+/** @var $view string */
5
+
6
+$proBadge = '';
7
+if (!NextendSocialLoginAdmin::isPro()) {
8
+    $proBadge = '<span class="nsl-pro-badge">Pro</span>';
9
+}
10
+?>
11
+<div class="nsl-admin-sub-nav-bar">
12
+    <a href="<?php echo $this->getUrl(); ?>"
13
+       class="nsl-admin-nav-tab<?php if ($view === 'getting-started'): ?> nsl-admin-nav-tab-active<?php endif; ?>"><?php _e('Getting Started', 'nextend-facebook-connect'); ?></a>
14
+    <a href="<?php echo $this->getUrl('settings'); ?>"
15
+       class="nsl-admin-nav-tab<?php if ($view === 'settings'): ?> nsl-admin-nav-tab-active<?php endif; ?>"><?php _e('Settings', 'nextend-facebook-connect'); ?></a>
16
+    <a href="<?php echo $this->getUrl('buttons'); ?>"
17
+       class="nsl-admin-nav-tab<?php if ($view === 'buttons'): ?> nsl-admin-nav-tab-active<?php endif; ?>"><?php _e('Buttons', 'nextend-facebook-connect'); ?></a>
18
+
19
+    <?php if ($this->provider->hasSyncFields()): ?>
20
+        <a href="<?php echo $this->getUrl('sync-data'); ?>"
21
+           class="nsl-admin-nav-tab<?php if ($view === 'sync-data'): ?> nsl-admin-nav-tab-active<?php endif; ?>"><?php _e('Sync data', 'nextend-facebook-connect'); ?><?php echo $proBadge; ?></a>
22
+    <?php endif; ?>
23
+    <a href="<?php echo $this->getUrl('usage'); ?>"
24
+       class="nsl-admin-nav-tab<?php if ($view === 'usage'): ?> nsl-admin-nav-tab-active<?php endif; ?>"><?php _e('Usage', 'nextend-facebook-connect'); ?></a>
25
+</div>

+ 73 - 0
app/wp-content/plugins/nextend-facebook-connect/admin/templates-provider/settings-other.php

@@ -0,0 +1,73 @@
1
+<?php
2
+defined('ABSPATH') || die();
3
+/** @var $this NextendSocialProviderAdmin */
4
+
5
+$provider = $this->getProvider();
6
+
7
+$settings = $provider->settings;
8
+?>
9
+
10
+<hr/>
11
+<h2><?php _e('Other settings', 'nextend-facebook-connect'); ?></h2>
12
+<table class="form-table">
13
+    <tbody>
14
+    <tr>
15
+        <th scope="row"><label
16
+                    for="user_prefix"><?php _e('Username prefix on register', 'nextend-facebook-connect'); ?></label>
17
+        </th>
18
+        <td><input name="user_prefix" type="text" id="user_prefix"
19
+                   value="<?php echo esc_attr($settings->get('user_prefix')); ?>" class="regular-text"></td>
20
+    </tr>
21
+    <tr>
22
+        <th scope="row"><label
23
+                    for="user_fallback"><?php _e('Fallback username prefix on register', 'nextend-facebook-connect'); ?></label>
24
+        </th>
25
+        <td><input name="user_fallback" type="text" id="user_fallback"
26
+                   value="<?php echo esc_attr($settings->get('user_fallback')); ?>" class="regular-text">
27
+            <p class="description" id="tagline-user_fallback"><?php _e('Used when username is invalid or not stored', 'nextend-facebook-connect'); ?></p>
28
+        </td>
29
+    </tr>
30
+    <?php if (NextendSocialLogin::$settings->get('terms_show') == 1): ?>
31
+        <tr>
32
+            <th scope="row"><?php _e('Terms and conditions', 'nextend-facebook-connect'); ?></th>
33
+            <td>
34
+                <?php
35
+                $terms              = $settings->get('terms');
36
+                $hasOverriddenTerms = !empty($terms);
37
+                ?>
38
+                <fieldset>
39
+                    <label for="terms_override">
40
+                        <input type="hidden" name="terms_override" value="0">
41
+                        <input type="checkbox" name="terms_override" id="terms_override"
42
+                               value="1" <?php if ($hasOverriddenTerms) : ?> checked="checked" <?php endif; ?>>
43
+                        <?php printf(__('Override global "%1$s"', 'nextend-facebook-connect'), __('Terms and conditions', 'nextend-facebook-connect')); ?>
44
+                    </label>
45
+
46
+                    <div id="nsl-terms" <?php if (!$hasOverriddenTerms) : ?> style="display:none;" <?php endif; ?>>
47
+                        <?php
48
+                        wp_editor($terms, 'terms', array(
49
+                            'textarea_rows' => 4,
50
+                            'media_buttons' => false
51
+                        ));
52
+                        ?>
53
+                    </div>
54
+                </fieldset>
55
+                <script type="text/javascript">
56
+                    (function ($) {
57
+
58
+                        $(document).ready(function () {
59
+                            $('#terms_override').on('change', function () {
60
+                                if ($(this).is(':checked')) {
61
+                                    $('#nsl-terms').css('display', '');
62
+                                } else {
63
+                                    $('#nsl-terms').css('display', 'none');
64
+                                }
65
+                            });
66
+                        });
67
+                    })(jQuery);
68
+                </script>
69
+            </td>
70
+        </tr>
71
+    <?php endif; ?>
72
+    </tbody>
73
+</table>

+ 141 - 0
app/wp-content/plugins/nextend-facebook-connect/admin/templates-provider/settings-pro.php

@@ -0,0 +1,141 @@
1
+<?php
2
+defined('ABSPATH') || die();
3
+/** @var $this NextendSocialProviderAdmin */
4
+
5
+$provider = $this->getProvider();
6
+
7
+$settings = $provider->settings;
8
+
9
+$isPRO = apply_filters('nsl-pro', false);
10
+
11
+$attr = '';
12
+if (!$isPRO) {
13
+    $attr = ' disabled ';
14
+}
15
+?>
16
+
17
+    <hr/>
18
+    <h1><?php _e('PRO settings', 'nextend-facebook-connect'); ?></h1>
19
+
20
+
21
+<?php
22
+NextendSocialLoginAdmin::showProBox();
23
+?>
24
+    <input type="hidden" name="tested" id="tested" value="<?php echo esc_attr($settings->get('tested')); ?>"/>
25
+    <table class="form-table" <?php if (!$isPRO): ?> style="opacity:0.5;"<?php endif; ?>>
26
+        <tbody>
27
+        <tr>
28
+            <th scope="row"><?php _e('Ask E-mail on registration', 'nextend-facebook-connect'); ?></th>
29
+            <td>
30
+                <fieldset>
31
+                    <legend class="screen-reader-text">
32
+                        <span><?php _e('Ask E-mail on registration', 'nextend-facebook-connect'); ?></span></legend>
33
+                    <label><input type="radio" name="ask_email"
34
+                                  value="never" <?php if ($settings->get('ask_email') == 'never') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
35
+                        <span><?php _e('Never', 'nextend-facebook-connect'); ?></span></label><br>
36
+                    <label><input type="radio" name="ask_email"
37
+                                  value="when-empty" <?php if ($settings->get('ask_email') == 'when-empty') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
38
+                        <span><?php _e('When email is not provided or empty', 'nextend-facebook-connect'); ?></span></label><br>
39
+                    <label><input type="radio" name="ask_email"
40
+                                  value="always" <?php if ($settings->get('ask_email') == 'always') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
41
+                        <span><?php _e('Always', 'nextend-facebook-connect'); ?></span></label><br>
42
+                </fieldset>
43
+            </td>
44
+        </tr>
45
+        <tr>
46
+            <th scope="row"><?php _e('Ask Username on registration', 'nextend-facebook-connect'); ?></th>
47
+            <td>
48
+                <fieldset>
49
+                    <legend class="screen-reader-text">
50
+                        <span><?php _e('Ask Username on registration', 'nextend-facebook-connect'); ?></span></legend>
51
+                    <label><input type="radio" name="ask_user"
52
+                                  value="never" <?php if ($settings->get('ask_user') == 'never') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
53
+                        <span><?php _e('Never, generate automatically', 'nextend-facebook-connect'); ?></span></label><br>
54
+                    <label><input type="radio" name="ask_user"
55
+                                  value="when-empty" <?php if ($settings->get('ask_user') == 'when-empty') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
56
+                        <span><?php _e('When username is empty or invalid', 'nextend-facebook-connect'); ?></span></label><br>
57
+                    <label><input type="radio" name="ask_user"
58
+                                  value="always" <?php if ($settings->get('ask_user') == 'always') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
59
+                        <span><?php _e('Always', 'nextend-facebook-connect'); ?></span></label><br>
60
+                </fieldset>
61
+            </td>
62
+        </tr>
63
+        <tr>
64
+            <th scope="row"><?php _e('Ask Password on registration', 'nextend-facebook-connect'); ?></th>
65
+            <td>
66
+                <fieldset>
67
+                    <label><input type="radio" name="ask_password"
68
+                                  value="never" <?php if ($settings->get('ask_password') == 'never') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
69
+                        <span><?php _e('Never', 'nextend-facebook-connect'); ?></span></label><br>
70
+                    <label><input type="radio" name="ask_password"
71
+                                  value="always" <?php if ($settings->get('ask_password') == 'always') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
72
+                        <span><?php _e('Always', 'nextend-facebook-connect'); ?></span></label><br>
73
+                </fieldset>
74
+            </td>
75
+        </tr>
76
+        <tr>
77
+            <th scope="row"><?php _e('Automatically connect the existing account upon registration', 'nextend-facebook-connect'); ?></th>
78
+            <td>
79
+                <fieldset>
80
+                    <legend class="screen-reader-text">
81
+                        <span><?php _e('Automatically connect the existing account upon registration', 'nextend-facebook-connect'); ?></span>
82
+                    </legend>
83
+                    <label><input type="radio" name="auto_link"
84
+                                  value="disabled" <?php if ($settings->get('auto_link') == 'disabled') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
85
+                        <span><?php _e('Disabled', 'nextend-facebook-connect'); ?></span></label><br>
86
+                    <label><input type="radio" name="auto_link"
87
+                                  value="email" <?php if ($settings->get('auto_link') == 'email') : ?> checked="checked" <?php endif; ?><?php echo $attr; ?>>
88
+                        <span><?php _e('Automatic, based on email address', 'nextend-facebook-connect'); ?></span></label><br>
89
+                </fieldset>
90
+            </td>
91
+        </tr>
92
+        <tr>
93
+            <th scope="row"><?php _e('Disable login for the selected roles', 'nextend-facebook-connect'); ?></th>
94
+            <td>
95
+                <?php
96
+                $wp_roles = new WP_Roles();
97
+                $roles    = $wp_roles->get_names();
98
+
99
+                $disable_roles = $settings->get('disabled_roles');
100
+                foreach ($roles AS $roleKey => $label):
101
+                    ?>
102
+                    <fieldset><label for="disabled_roles_<?php echo esc_attr($roleKey); ?>">
103
+                            <input name="disabled_roles[]" type="checkbox"
104
+                                   id="disabled_roles_<?php echo esc_attr($roleKey); ?>"
105
+                                   value="<?php echo esc_attr($roleKey); ?>" <?php if (in_array($roleKey, $disable_roles)) : ?> checked <?php endif ?> <?php echo $attr; ?> />
106
+                            <?php echo $label; ?></label>
107
+                    </fieldset>
108
+                <?php endforeach; ?>
109
+                <input type="hidden" name="disabled_roles[]" value=""/>
110
+            </td>
111
+        </tr>
112
+        <tr>
113
+            <th scope="row"><?php _e('Default roles for user who registered with this provider', 'nextend-facebook-connect'); ?></th>
114
+            <td>
115
+                <?php
116
+                $register_roles = $settings->get('register_roles');
117
+                ?>
118
+                <fieldset><label for="register_roles_default">
119
+                        <input name="register_roles[]" type="checkbox" id="register_roles_default"
120
+                               value="default" <?php if (in_array('default', $register_roles)) : ?> checked <?php endif ?> <?php echo $attr; ?> />
121
+                        <?php _e('Default', 'nextend-facebook-connect'); ?></label>
122
+                </fieldset>
123
+                <?php
124
+                foreach ($roles AS $roleKey => $label):
125
+                    ?>
126
+                    <fieldset><label for="register_roles_<?php echo esc_attr($roleKey); ?>">
127
+                            <input name="register_roles[]" type="checkbox"
128
+                                   id="register_roles_<?php echo esc_attr($roleKey); ?>"
129
+                                   value="<?php echo esc_attr($roleKey); ?>" <?php if (in_array($roleKey, $register_roles)) : ?> checked <?php endif ?> <?php echo $attr; ?> />
130
+                            <?php echo $label; ?></label>
131
+                    </fieldset>
132
+                <?php endforeach; ?>
133
+                <input type="hidden" name="register_roles[]" value=""/>
134
+            </td>
135
+        </tr>
136
+        </tbody>
137
+    </table>
138
+<?php if ($isPRO): ?>
139
+    <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary"
140
+                             value="<?php _e('Save Changes'); ?>"></p>
141
+<?php endif; ?>

+ 126 - 0
app/wp-content/plugins/nextend-facebook-connect/admin/templates-provider/sync-data.php

@@ -0,0 +1,126 @@
1
+<?php
2
+defined('ABSPATH') || die();
3
+/** @var $this NextendSocialProviderAdmin */
4
+
5
+$provider = $this->getProvider();
6
+
7
+$settings = $provider->settings;
8
+
9
+$isPRO = apply_filters('nsl-pro', false);
10
+
11
+$attr = '';
12
+if (!$isPRO) {
13
+    $attr = ' disabled ';
14
+}
15
+?>
16
+
17
+<div class="nsl-admin-sub-content">
18
+
19
+    <?php
20
+    NextendSocialLoginAdmin::showProBox();
21
+    ?>
22
+
23
+    <form method="post" action="<?php echo admin_url('admin-post.php'); ?>" novalidate="novalidate">
24
+
25
+        <?php wp_nonce_field('nextend-social-login'); ?>
26
+        <input type="hidden" name="action" value="nextend-social-login"/>
27
+        <input type="hidden" name="view" value="provider-<?php echo $provider->getId(); ?>"/>
28
+        <input type="hidden" name="subview" value="sync-data"/>
29
+        <input type="hidden" name="settings_saved" value="1"/>
30
+
31
+        <?php
32
+        $sync_warning_message = apply_filters('nsl_' . $provider->getId() . '_sync_warning', false);
33
+        if (!empty($sync_warning_message)): ?>
34
+            <div class="notice notice-warning">
35
+                <p>
36
+                    <?php echo $sync_warning_message; ?>
37
+                </p>
38
+            </div>
39
+        <?php endif; ?>
40
+
41
+        <table class="form-table">
42
+            <tbody>
43
+            <tr>
44
+                <th scope="row"><label>Sync fields</label></th>
45
+                <td>
46
+                    <fieldset>
47
+                        <label for="sync_fields_register">
48
+                            <input type="checkbox" id="sync_fields_register"
49
+                                   value="1" checked disabled/>
50
+                            <?php _e('Register', 'nextend-facebook-connect'); ?>
51
+                        </label>
52
+                    </fieldset>
53
+                    <fieldset>
54
+                        <label for="sync_fields_login">
55
+                            <input name="sync_fields[login]" type="hidden" value="0"/>
56
+                            <input name="sync_fields[login]" type="checkbox" id="sync_fields_login"
57
+                                   value="1" <?php if ($settings->get('sync_fields/login')): ?> checked<?php endif; ?> <?php echo $attr; ?>/>
58
+                            <?php _e('Login', 'nextend-facebook-connect'); ?>
59
+                        </label>
60
+                    </fieldset>
61
+                    <fieldset>
62
+                        <label for="sync_fields_link">
63
+                            <input name="sync_fields[link]" type="hidden" value="0"/>
64
+                            <input name="sync_fields[link]" type="checkbox" id="sync_fields_link"
65
+                                   value="1" <?php if ($settings->get('sync_fields/link')): ?> checked<?php endif; ?> <?php echo $attr; ?>/>
66
+                            <?php _e('Link', 'nextend-facebook-connect'); ?>
67
+                        </label>
68
+                    </fieldset>
69
+                </td>
70
+            </tr>
71
+            <?php
72
+
73
+            $syncFields = $provider->getSyncFields();
74
+            foreach ($syncFields AS $fieldName => $fieldData):
75
+                ?>
76
+                <tr>
77
+                    <th scope="row"><label for="sync_fields_locale"><?php echo $fieldData['label']; ?></label></th>
78
+                    <td>
79
+                        <fieldset>
80
+                            <label for="sync_fields_<?php echo $fieldName; ?>_enabled">
81
+                                <input name="sync_fields[fields][<?php echo $fieldName; ?>][enabled]" type="hidden" value="0" <?php echo $attr; ?>/>
82
+                                <input name="sync_fields[fields][<?php echo $fieldName; ?>][enabled]" type="checkbox" id="sync_fields_<?php echo $fieldName; ?>_enabled"
83
+                                       value="1" <?php if ($settings->get('sync_fields/fields/' . $fieldName . '/enabled')): ?> checked<?php endif; ?> <?php echo $attr; ?>/>
84
+                                <?php _e('Store in meta key', 'nextend-facebook-connect'); ?>
85
+                            </label>
86
+                            <input name="sync_fields[fields][<?php echo $fieldName; ?>][meta_key]" type="text" id="sync_fields_<?php echo $fieldName; ?>_meta_key"
87
+                                   value="<?php echo esc_attr($settings->get('sync_fields/fields/' . $fieldName . '/meta_key')); ?>" class="regular-text" <?php echo $attr; ?>/>
88
+                        </fieldset>
89
+                        <?php
90
+                        $description = $provider->getSyncDataFieldDescription($fieldName);
91
+                        ?>
92
+                        <?php if (!empty($description)): ?>
93
+                            <p class="description">
94
+                                <?php echo $description; ?>
95
+                            </p>
96
+                        <?php endif; ?>
97
+                    </td>
98
+                </tr>
99
+            <?php endforeach; ?>
100
+            </tbody>
101
+        </table>
102
+        <?php if ($isPRO): ?>
103
+            <p class="submit">
104
+                <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e('Save Changes'); ?>">
105
+            </p>
106
+        <?php endif; ?>
107
+    </form>
108
+</div>
109
+
110
+<script type="text/javascript">
111
+    (function ($) {
112
+
113
+        $(document).ready(function () {
114
+            var $checkboxes = $('input[type="checkbox"]');
115
+            $checkboxes.on('change', function (e) {
116
+                var $checkbox = $(this);
117
+                $checkbox.closest('td').toggleClass('nsl-admin-setting-disabled', !$checkbox.is(':checked'));
118
+            });
119
+
120
+            $checkboxes.each(function () {
121
+                var $checkbox = $(this);
122
+                $checkbox.closest('td').toggleClass('nsl-admin-setting-disabled', !$checkbox.is(':checked'));
123
+            });
124
+        });
125
+    })(jQuery);
126
+</script>

+ 47 - 0
app/wp-content/plugins/nextend-facebook-connect/admin/templates-provider/usage.php

@@ -0,0 +1,47 @@
1
+<?php
2
+defined('ABSPATH') || die();
3
+/** @var $this NextendSocialProviderAdmin */
4
+
5
+$provider = $this->getProvider();
6
+?>
7
+<div class="nsl-admin-sub-content">
8
+
9
+    <h4><?php _e('Shortcode', 'nextend-facebook-connect'); ?></h4>
10
+
11
+    <p>
12
+        <b><?php _e('Important!', 'nextend-facebook-connect'); ?></b>
13
+        &nbsp;<?php _e('The shortcodes are only rendered for users who haven\'t logged in yet!', 'nextend-facebook-connect'); ?>
14
+        &nbsp;<a href="https://nextendweb.com/nextend-social-login-docs/theme-developer/#shortcode"><?php _e('See the full list of shortcode parameters.', 'nextend-facebook-connect'); ?></a>
15
+    </p>
16
+
17
+    <?php
18
+    $shortcodes = array(
19
+        '[nextend_social_login]',
20
+        '[nextend_social_login provider="' . $provider->getId() . '"]',
21
+        '[nextend_social_login provider="' . $provider->getId() . '" style="icon"]',
22
+        '[nextend_social_login provider="' . $provider->getId() . '" style="icon" redirect="https://nextendweb.com/"]',
23
+        '[nextend_social_login trackerdata="source"]'
24
+    );
25
+    ?>
26
+
27
+    <textarea readonly cols="160" rows="6" class="nextend-html-editor-readonly"
28
+              aria-describedby="editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"><?php echo implode("\n\n", $shortcodes); ?></textarea>
29
+
30
+
31
+    <h4><?php _e('Simple link', 'nextend-facebook-connect'); ?></h4>
32
+
33
+    <?php
34
+    $html = '<a href="' . $provider->getLoginUrl() . '" data-plugin="nsl" data-action="connect" data-redirect="current" data-provider="' . esc_attr($provider->getId()) . '" data-popupwidth="' . $provider->getPopupWidth() . '" data-popupheight="' . $provider->getPopupHeight() . '">' . "\n\t" . __('Click here to login or register', 'nextend-facebook-connect') . "\n" . '</a>';
35
+    ?>
36
+    <textarea readonly cols="160" rows="6" class="nextend-html-editor-readonly"
37
+              aria-describedby="editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"><?php echo esc_textarea($html); ?></textarea>
38
+
39
+    <h4><?php _e('Image button', 'nextend-facebook-connect'); ?></h4>
40
+
41
+    <?php
42
+    $html = '<a href="' . $provider->getLoginUrl() . '" data-plugin="nsl" data-action="connect" data-redirect="current" data-provider="' . esc_attr($provider->getId()) . '" data-popupwidth="' . $provider->getPopupWidth() . '" data-popupheight="' . $provider->getPopupHeight() . '">' . "\n\t" . '<img src="' . __('Image url', 'nextend-facebook-connect') . '" alt="" />' . "\n" . '</a>';
43
+    ?>
44
+    <textarea readonly cols="160" rows="6" class="nextend-html-editor-readonly"
45
+              aria-describedby="editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"><?php echo esc_textarea($html); ?></textarea>
46
+
47
+</div>

+ 66 - 0
app/wp-content/plugins/nextend-facebook-connect/admin/templates/debug.php

@@ -0,0 +1,66 @@
1
+<div class="nsl-admin-content">
2
+    <style>
3
+        .nsl-admin-notices {
4
+            display: none;
5
+        }
6
+    </style>
7
+    <h1 class="title"><?php _e('Debug', 'nextend-facebook-connect'); ?></h1>
8
+    <?php
9
+
10
+
11
+    if (NextendSocialLoginAdmin::isPro()) {
12
+        $activation_data = NextendSocialLogin::getLicense();
13
+
14
+        $proAddonState = NextendSocialLoginAdmin::getProState();
15
+        echo "<p><b>Pro Addon State</b>: " . $proAddonState . "</p>";
16
+
17
+        echo "<p><b>Authorized Domain</b>: " . $activation_data['domain'] . "</p>";
18
+
19
+        $currentDomain = NextendSocialLogin::getDomain();
20
+        echo "<p><b>Current Domain</b>: " . $currentDomain . "</p><br>";
21
+
22
+        $licenseKey = substr($activation_data['license_key'], 0, 8);
23
+        echo "<p><b>License Key</b>: " . $licenseKey . "...</p>";
24
+
25
+        $isLicenseKeyOk = NextendSocialLogin::hasLicense();
26
+        echo "<p><b>License Key OK</b>: " . (boolval($isLicenseKeyOk) ? 'Yes' : 'No') . "</p><br>";
27
+    }
28
+
29
+    $defaultRedirect = NextendSocialLogin::$settings->get('default_redirect');
30
+    echo "<p><b>Default Redirect URL</b>: " . $defaultRedirect . "</p>";
31
+
32
+    $defaultRedirectReg = NextendSocialLogin::$settings->get('default_redirect_reg');
33
+    echo "<p><b>Default Reg Redirect URL</b>: " . $defaultRedirectReg . "</p><br>";
34
+
35
+    $fixRedirect = NextendSocialLogin::$settings->get('redirect');
36
+    echo "<p><b>Fix Redirect URL</b>: " . $fixRedirect . "</p>";
37
+
38
+    $fixRedirectReg = NextendSocialLogin::$settings->get('redirect_reg');
39
+    echo "<p><b>Fix Reg Redirect URL</b>: " . $fixRedirectReg . "</p><br>";
40
+
41
+    echo '<h1>' . __('Test network connection with providers', 'nextend-facebook-connect') . '</h1>';
42
+
43
+    if (!function_exists('curl_init')) {
44
+        ?>
45
+
46
+        <div class="error">
47
+            <p>
48
+                <?php _e('You don\'t have cURL support, please enable it in php.ini!', 'nextend-facebook-connect'); ?>
49
+            </p>
50
+        </div>
51
+
52
+        <?php
53
+    } else {
54
+        foreach (NextendSocialLogin::$allowedProviders AS $provider) {
55
+            ?>
56
+            <p>
57
+                <a target="_blank" href="<?php echo add_query_arg('provider', $provider->getId(), NextendSocialLoginAdmin::getAdminUrl('test-connection')); ?>" class="button button-primary">
58
+                    <?php printf(__('Test %1$s connection', 'nextend-facebook-connect'), $provider->getLabel()); ?>
59
+                </a>
60
+            </p>
61
+            <?php
62
+        }
63
+    }
64
+
65
+    ?>
66
+</div>

+ 40 - 0
app/wp-content/plugins/nextend-facebook-connect/admin/templates/fix-redirect-uri.php

@@ -0,0 +1,40 @@
1
+<div class="nsl-admin-content">
2
+    <h1 class="title"><?php _e('Fix Oauth Redirect URIs', 'nextend-facebook-connect'); ?></h1>
3
+    <?php
4
+    /** @var NextendSocialProvider[] $wrongOauthProviders */
5
+    $wrongOauthProviders = array();
6
+    foreach (NextendSocialLogin::$enabledProviders AS $provider) {
7
+        if (!$provider->checkOauthRedirectUrl()) {
8
+            $wrongOauthProviders[] = $provider;
9
+        }
10
+    }
11
+    ?>
12
+
13
+    <div class="nsl-admin-fix-redirect-uri">
14
+        <?php
15
+        if (count($wrongOauthProviders) === 0) {
16
+            echo '<div class="updated"><p>' . __('Every Oauth Redirect URI seems fine', 'nextend-facebook-connect') . '</p></div>';
17
+
18
+            foreach (NextendSocialLogin::$enabledProviders AS $provider) {
19
+                $provider->getAdmin()
20
+                         ->renderOauthChangedInstruction();
21
+            }
22
+        } else {
23
+            ?>
24
+            <p><?php printf(__('%s detected that your login url changed. You must update the Oauth redirect URIs in the related social applications.', 'nextend-facebook-connect'), '<b>Nextend Social Login</b>'); ?></p>
25
+
26
+            <?php
27
+            foreach ($wrongOauthProviders AS $provider) {
28
+                $provider->getAdmin()
29
+                         ->renderOauthChangedInstruction();
30
+            }
31
+            ?>
32
+
33
+
34
+            <a href="<?php echo wp_nonce_url(NextendSocialLoginAdmin::getAdminUrl('update_oauth_redirect_url'), 'nextend-social-login_update_oauth_redirect_url'); ?>" class="button button-primary">
35
+                <?php _e('Got it', 'nextend-facebook-connect'); ?>
36
+            </a>
37
+
38
+        <?php } ?>
39
+    </div>
40
+</div>

+ 4 - 0
app/wp-content/plugins/nextend-facebook-connect/admin/templates/footer.php

@@ -0,0 +1,4 @@
1
+<?php
2
+defined('ABSPATH') || die();
3
+?>
4
+</div>

+ 0 - 0
app/wp-content/plugins/nextend-facebook-connect/admin/templates/global-settings.php


Some files were not shown because too many files changed in this diff

tum/whitesports - Gogs: Simplico Git Service

Няма описание

class.jetpack-admin.php 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. <?php
  2. use Automattic\Jetpack\Status;
  3. use Automattic\Jetpack\Assets\Logo as Jetpack_Logo;
  4. // Build the Jetpack admin menu as a whole
  5. class Jetpack_Admin {
  6. /**
  7. * @var Jetpack_Admin
  8. **/
  9. private static $instance = null;
  10. static function init() {
  11. if ( isset( $_GET['page'] ) && $_GET['page'] === 'jetpack' ) {
  12. add_filter( 'nocache_headers', array( 'Jetpack_Admin', 'add_no_store_header' ), 100 );
  13. }
  14. if ( is_null( self::$instance ) ) {
  15. self::$instance = new Jetpack_Admin();
  16. }
  17. return self::$instance;
  18. }
  19. static function add_no_store_header( $headers ) {
  20. $headers['Cache-Control'] .= ', no-store';
  21. return $headers;
  22. }
  23. private function __construct() {
  24. jetpack_require_lib( 'admin-pages/class.jetpack-react-page' );
  25. $this->jetpack_react = new Jetpack_React_Page();
  26. jetpack_require_lib( 'admin-pages/class.jetpack-settings-page' );
  27. $this->fallback_page = new Jetpack_Settings_Page();
  28. jetpack_require_lib( 'admin-pages/class-jetpack-about-page' );
  29. $this->jetpack_about = new Jetpack_About_Page();
  30. jetpack_require_lib( 'admin-pages/class-jetpack-search-dashboard-page' );
  31. $this->jetpack_search = new Jetpack_Search_Dashboard_Page();
  32. add_action( 'admin_init', array( $this->jetpack_react, 'react_redirects' ), 0 );
  33. add_action( 'admin_menu', array( $this->jetpack_react, 'add_actions' ), 998 );
  34. add_action( 'admin_menu', array( $this->jetpack_search, 'add_actions' ), 999 );
  35. add_action( 'jetpack_admin_menu', array( $this->jetpack_react, 'jetpack_add_dashboard_sub_nav_item' ) );
  36. add_action( 'jetpack_admin_menu', array( $this->jetpack_react, 'jetpack_add_settings_sub_nav_item' ) );
  37. add_action( 'jetpack_admin_menu', array( $this, 'admin_menu_debugger' ) );
  38. add_action( 'jetpack_admin_menu', array( $this->fallback_page, 'add_actions' ) );
  39. add_action( 'jetpack_admin_menu', array( $this->jetpack_about, 'add_actions' ) );
  40. // Add redirect to current page for activation/deactivation of modules
  41. add_action( 'jetpack_pre_activate_module', array( $this, 'fix_redirect' ), 10, 2 );
  42. add_action( 'jetpack_pre_deactivate_module', array( $this, 'fix_redirect' ) );
  43. // Add module bulk actions handler
  44. add_action( 'jetpack_unrecognized_action', array( $this, 'handle_unrecognized_action' ) );
  45. if ( class_exists( 'Akismet_Admin' ) ) {
  46. // If the site has Jetpack Anti-Spam, change the Akismet menu label accordingly.
  47. $site_products = Jetpack_Plan::get_products();
  48. $anti_spam_products = array( 'jetpack_anti_spam_monthly', 'jetpack_anti_spam' );
  49. if ( ! empty( array_intersect( $anti_spam_products, array_column( $site_products, 'product_slug' ) ) ) ) {
  50. // Prevent Akismet from adding a menu item.
  51. add_action(
  52. 'admin_menu',
  53. function () {
  54. remove_action( 'admin_menu', array( 'Akismet_Admin', 'admin_menu' ), 5 );
  55. },
  56. 4
  57. );
  58. // Add an Anti-spam menu item for Jetpack.
  59. add_action(
  60. 'jetpack_admin_menu',
  61. function () {
  62. add_submenu_page( 'jetpack', __( 'Anti-Spam', 'jetpack' ), __( 'Anti-Spam', 'jetpack' ), 'manage_options', 'akismet-key-config', array( 'Akismet_Admin', 'display_page' ) );
  63. }
  64. );
  65. add_action( 'admin_enqueue_scripts', array( $this, 'akismet_logo_replacement_styles' ) );
  66. }
  67. }
  68. add_filter( 'jetpack_display_jitms_on_screen', array( $this, 'should_display_jitms_on_screen' ), 10, 2 );
  69. }
  70. /**
  71. * Generate styles to replace Akismet logo for the Jetpack logo. It's a workaround until we create a proper settings page for
  72. * Jetpack Anti-Spam. Without this, we would have to change the logo from Akismet codebase and we want to avoid that.
  73. */
  74. public function akismet_logo_replacement_styles() {
  75. $logo = new Jetpack_Logo();
  76. $logo_base64 = base64_encode( $logo->get_jp_emblem_larger() );
  77. $logo_base64_url = "data:image/svg+xml;base64,{$logo_base64}";
  78. $style = ".akismet-masthead__logo-container { background: url({$logo_base64_url}) no-repeat .25rem; height: 1.8125rem; } .akismet-masthead__logo { display: none; }";
  79. wp_add_inline_style( 'admin-bar', $style );
  80. }
  81. static function sort_requires_connection_last( $module1, $module2 ) {
  82. if ( $module1['requires_connection'] == $module2['requires_connection'] ) {
  83. return 0;
  84. } elseif ( $module1['requires_connection'] ) {
  85. return 1;
  86. } elseif ( $module2['requires_connection'] ) {
  87. return -1;
  88. }
  89. return 0;
  90. }
  91. // Produce JS understandable objects of modules containing information for
  92. // presentation like description, name, configuration url, etc.
  93. function get_modules() {
  94. include_once JETPACK__PLUGIN_DIR . 'modules/module-info.php';
  95. $available_modules = Jetpack::get_available_modules();
  96. $active_modules = Jetpack::get_active_modules();
  97. $modules = array();
  98. $jetpack_active = Jetpack::is_connection_ready() || ( new Status() )->is_offline_mode();
  99. $overrides = Jetpack_Modules_Overrides::instance();
  100. foreach ( $available_modules as $module ) {
  101. if ( $module_array = Jetpack::get_module( $module ) ) {
  102. /**
  103. * Filters each module's short description.
  104. *
  105. * @since 3.0.0
  106. *
  107. * @param string $module_array['description'] Module description.
  108. * @param string $module Module slug.
  109. */
  110. $short_desc = apply_filters( 'jetpack_short_module_description', $module_array['description'], $module );
  111. // Fix: correct multibyte strings truncate with checking for mbstring extension
  112. $short_desc_trunc = ( function_exists( 'mb_strlen' ) )
  113. ? ( ( mb_strlen( $short_desc ) > 143 )
  114. ? mb_substr( $short_desc, 0, 140 ) . '...'
  115. : $short_desc )
  116. : ( ( strlen( $short_desc ) > 143 )
  117. ? substr( $short_desc, 0, 140 ) . '...'
  118. : $short_desc );
  119. $module_array['module'] = $module;
  120. $is_available = self::is_module_available( $module_array );
  121. $module_array['activated'] = ( $jetpack_active ? in_array( $module, $active_modules, true ) : false );
  122. $module_array['deactivate_nonce'] = wp_create_nonce( 'jetpack_deactivate-' . $module );
  123. $module_array['activate_nonce'] = wp_create_nonce( 'jetpack_activate-' . $module );
  124. $module_array['available'] = $is_available;
  125. $module_array['unavailable_reason'] = $is_available ? false : self::get_module_unavailable_reason( $module_array );
  126. $module_array['short_description'] = $short_desc_trunc;
  127. $module_array['configure_url'] = Jetpack::module_configuration_url( $module );
  128. $module_array['override'] = $overrides->get_module_override( $module );
  129. ob_start();
  130. /**
  131. * Allow the display of a "Learn More" button.
  132. * The dynamic part of the action, $module, is the module slug.
  133. *
  134. * @since 3.0.0
  135. */
  136. do_action( 'jetpack_learn_more_button_' . $module );
  137. $module_array['learn_more_button'] = ob_get_clean();
  138. ob_start();
  139. /**
  140. * Allow the display of information text when Jetpack is connected to WordPress.com.
  141. * The dynamic part of the action, $module, is the module slug.
  142. *
  143. * @since 3.0.0
  144. */
  145. do_action( 'jetpack_module_more_info_' . $module );
  146. /**
  147. * Filter the long description of a module.
  148. *
  149. * @since 3.5.0
  150. *
  151. * @param string ob_get_clean() The module long description.
  152. * @param string $module The module name.
  153. */
  154. $module_array['long_description'] = apply_filters( 'jetpack_long_module_description', ob_get_clean(), $module );
  155. ob_start();
  156. /**
  157. * Filter the search terms for a module
  158. *
  159. * Search terms are typically added to the module headers, under "Additional Search Queries".
  160. *
  161. * Use syntax:
  162. * function jetpack_$module_search_terms( $terms ) {
  163. * $terms = _x( 'term 1, term 2', 'search terms', 'jetpack' );
  164. * return $terms;
  165. * }
  166. * add_filter( 'jetpack_search_terms_$module', 'jetpack_$module_search_terms' );
  167. *
  168. * @since 3.5.0
  169. *
  170. * @param string The search terms (comma separated).
  171. */
  172. echo apply_filters( 'jetpack_search_terms_' . $module, $module_array['additional_search_queries'] );
  173. $module_array['search_terms'] = ob_get_clean();
  174. $module_array['configurable'] = false;
  175. if (
  176. current_user_can( 'manage_options' ) &&
  177. /**
  178. * Allow the display of a configuration link in the Jetpack Settings screen.
  179. *
  180. * @since 3.0.0
  181. *
  182. * @param string $module Module name.
  183. * @param bool false Should the Configure module link be displayed? Default to false.
  184. */
  185. apply_filters( 'jetpack_module_configurable_' . $module, false )
  186. ) {
  187. $module_array['configurable'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $module_array['configure_url'] ), __( 'Configure', 'jetpack' ) );
  188. }
  189. $modules[ $module ] = $module_array;
  190. }
  191. }
  192. uasort( $modules, array( 'Jetpack', 'sort_modules' ) );
  193. if ( ! Jetpack::is_connection_ready() ) {
  194. uasort( $modules, array( __CLASS__, 'sort_requires_connection_last' ) );
  195. }
  196. return $modules;
  197. }
  198. static function is_module_available( $module ) {
  199. if ( ! is_array( $module ) || empty( $module ) ) {
  200. return false;
  201. }
  202. /**
  203. * We never want to show VaultPress as activatable through Jetpack.
  204. */
  205. if ( 'vaultpress' === $module['module'] ) {
  206. return false;
  207. }
  208. /*
  209. * WooCommerce Analytics should only be available
  210. * when running WooCommerce 3+
  211. */
  212. if (
  213. 'woocommerce-analytics' === $module['module']
  214. && (
  215. ! class_exists( 'WooCommerce' )
  216. || version_compare( WC_VERSION, '3.0', '<' )
  217. )
  218. ) {
  219. return false;
  220. }
  221. /*
  222. * In Offline mode, modules that require a site or user
  223. * level connection should be unavailable.
  224. */
  225. if ( ( new Status() )->is_offline_mode() ) {
  226. return ! ( $module['requires_connection'] || $module['requires_user_connection'] );
  227. }
  228. /*
  229. * Jetpack not connected.
  230. */
  231. if ( ! Jetpack::is_connection_ready() ) {
  232. return false;
  233. }
  234. /*
  235. * Jetpack connected at a site level only. Make sure to make
  236. * modules that require a user connection unavailable.
  237. */
  238. if ( ! Jetpack::connection()->has_connected_owner() && $module['requires_user_connection'] ) {
  239. return false;
  240. }
  241. return Jetpack_Plan::supports( $module['module'] );
  242. }
  243. /**
  244. * Returns why a module is unavailable.
  245. *
  246. * @param array $module The module.
  247. * @return string|false A string stating why the module is not available or false if the module is available.
  248. */
  249. public static function get_module_unavailable_reason( $module ) {
  250. if ( ! is_array( $module ) || empty( $module ) ) {
  251. return false;
  252. }
  253. if ( self::is_module_available( $module ) ) {
  254. return false;
  255. }
  256. /**
  257. * We never want to show VaultPress as activatable through Jetpack so return an empty string.
  258. */
  259. if ( 'vaultpress' === $module['module'] ) {
  260. return '';
  261. }
  262. /*
  263. * WooCommerce Analytics should only be available
  264. * when running WooCommerce 3+
  265. */
  266. if (
  267. 'woocommerce-analytics' === $module['module']
  268. && (
  269. ! class_exists( 'WooCommerce' )
  270. || version_compare( WC_VERSION, '3.0', '<' )
  271. )
  272. ) {
  273. return __( 'Requires WooCommerce 3+ plugin', 'jetpack' );
  274. }
  275. /*
  276. * In Offline mode, modules that require a site or user
  277. * level connection should be unavailable.
  278. */
  279. if ( ( new Status() )->is_offline_mode() ) {
  280. if ( $module['requires_connection'] || $module['requires_user_connection'] ) {
  281. return __( 'Offline mode', 'jetpack' );
  282. }
  283. }
  284. /*
  285. * Jetpack not connected.
  286. */
  287. if ( ! Jetpack::is_connection_ready() ) {
  288. return __( 'Jetpack is not connected', 'jetpack' );
  289. }
  290. /*
  291. * Jetpack connected at a site level only and module requires a user connection.
  292. */
  293. if ( ! Jetpack::connection()->has_connected_owner() && $module['requires_user_connection'] ) {
  294. return __( 'Requires a connected WordPress.com account', 'jetpack' );
  295. }
  296. /*
  297. * Plan restrictions.
  298. */
  299. if ( ! Jetpack_Plan::supports( $module['module'] ) ) {
  300. return __( 'Not supported by current plan', 'jetpack' );
  301. }
  302. return '';
  303. }
  304. function handle_unrecognized_action( $action ) {
  305. switch ( $action ) {
  306. case 'bulk-activate':
  307. if ( ! current_user_can( 'jetpack_activate_modules' ) ) {
  308. break;
  309. }
  310. $modules = (array) $_GET['modules'];
  311. $modules = array_map( 'sanitize_key', $modules );
  312. check_admin_referer( 'bulk-jetpack_page_jetpack_modules' );
  313. foreach ( $modules as $module ) {
  314. Jetpack::log( 'activate', $module );
  315. Jetpack::activate_module( $module, false );
  316. }
  317. // The following two lines will rarely happen, as Jetpack::activate_module normally exits at the end.
  318. wp_safe_redirect( wp_get_referer() );
  319. exit;
  320. case 'bulk-deactivate':
  321. if ( ! current_user_can( 'jetpack_deactivate_modules' ) ) {
  322. break;
  323. }
  324. $modules = (array) $_GET['modules'];
  325. $modules = array_map( 'sanitize_key', $modules );
  326. check_admin_referer( 'bulk-jetpack_page_jetpack_modules' );
  327. foreach ( $modules as $module ) {
  328. Jetpack::log( 'deactivate', $module );
  329. Jetpack::deactivate_module( $module );
  330. Jetpack::state( 'message', 'module_deactivated' );
  331. }
  332. Jetpack::state( 'module', $modules );
  333. wp_safe_redirect( wp_get_referer() );
  334. exit;
  335. default:
  336. return;
  337. }
  338. }
  339. function fix_redirect( $module, $redirect = true ) {
  340. if ( ! $redirect ) {
  341. return;
  342. }
  343. if ( wp_get_referer() ) {
  344. add_filter( 'wp_redirect', 'wp_get_referer' );
  345. }
  346. }
  347. function admin_menu_debugger() {
  348. jetpack_require_lib( 'debugger' );
  349. Jetpack_Debugger::disconnect_and_redirect();
  350. $debugger_hook = add_submenu_page(
  351. null,
  352. __( 'Debugging Center', 'jetpack' ),
  353. '',
  354. 'manage_options',
  355. 'jetpack-debugger',
  356. array( $this, 'wrap_debugger_page' )
  357. );
  358. add_action( "admin_head-$debugger_hook", array( 'Jetpack_Debugger', 'jetpack_debug_admin_head' ) );
  359. }
  360. function wrap_debugger_page() {
  361. nocache_headers();
  362. if ( ! current_user_can( 'manage_options' ) ) {
  363. die( '-1' );
  364. }
  365. Jetpack_Admin_Page::wrap_ui( array( $this, 'debugger_page' ) );
  366. }
  367. function debugger_page() {
  368. jetpack_require_lib( 'debugger' );
  369. Jetpack_Debugger::jetpack_debug_display_handler();
  370. }
  371. /**
  372. * Determines if JITMs should display on a particular screen.
  373. *
  374. * @param bool $value The default value of the filter.
  375. * @param string $screen_id The ID of the screen being tested for JITM display.
  376. *
  377. * @return bool True if JITMs should display, false otherwise.
  378. */
  379. public function should_display_jitms_on_screen( $value, $screen_id ) {
  380. // Disable all JITMs on these pages.
  381. if (
  382. in_array(
  383. $screen_id,
  384. array(
  385. 'jetpack_page_akismet-key-config',
  386. 'admin_page_jetpack_modules',
  387. ),
  388. true
  389. ) ) {
  390. return false;
  391. }
  392. // Disable all JITMs on pages where the recommendations banner is displaying.
  393. if (
  394. in_array(
  395. $screen_id,
  396. array(
  397. 'dashboard',
  398. 'plugins',
  399. 'jetpack_page_stats',
  400. ),
  401. true
  402. )
  403. && \Jetpack_Recommendations_Banner::can_be_displayed()
  404. ) {
  405. return false;
  406. }
  407. return $value;
  408. }
  409. }
  410. Jetpack_Admin::init();