ation":["\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


二進制
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


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/buttons/default.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/buttons/fullwidth.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/buttons/icon.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/error.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/exclamation-mark.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/facebook/black.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/facebook/dark.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/facebook/light.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/facebook/white.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/google/dark.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/google/light.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/google/uniform.png


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


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/layouts/above.png


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


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


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/layouts/below.png


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


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/layouts/default.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/notice.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/notice/nslnotice.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/nsl-logo.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/ok.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/padlock.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/stars-big.png


二進制
app/wp-content/plugins/nextend-facebook-connect/admin/images/stars-small.png


二進制
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


部分文件因文件數量過多而無法顯示

tum/whitesports - Gogs: Simplico Git Service

Nenhuma Descrição

class-wp-filesystem-base.php 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848
  1. <?php
  2. /**
  3. * Base WordPress Filesystem
  4. *
  5. * @package WordPress
  6. * @subpackage Filesystem
  7. */
  8. /**
  9. * Base WordPress Filesystem class which Filesystem implementations extend.
  10. *
  11. * @since 2.5.0
  12. */
  13. class WP_Filesystem_Base {
  14. /**
  15. * Whether to display debug data for the connection.
  16. *
  17. * @since 2.5.0
  18. * @var bool
  19. */
  20. public $verbose = false;
  21. /**
  22. * Cached list of local filepaths to mapped remote filepaths.
  23. *
  24. * @since 2.7.0
  25. * @var array
  26. */
  27. public $cache = array();
  28. /**
  29. * The Access method of the current connection, Set automatically.
  30. *
  31. * @since 2.5.0
  32. * @var string
  33. */
  34. public $method = '';
  35. /**
  36. * @var WP_Error
  37. */
  38. public $errors = null;
  39. /**
  40. */
  41. public $options = array();
  42. /**
  43. * Returns the path on the remote filesystem of ABSPATH.
  44. *
  45. * @since 2.7.0
  46. *
  47. * @return string The location of the remote path.
  48. */
  49. public function abspath() {
  50. $folder = $this->find_folder( ABSPATH );
  51. // Perhaps the FTP folder is rooted at the WordPress install.
  52. // Check for wp-includes folder in root. Could have some false positives, but rare.
  53. if ( ! $folder && $this->is_dir( '/' . WPINC ) ) {
  54. $folder = '/';
  55. }
  56. return $folder;
  57. }
  58. /**
  59. * Returns the path on the remote filesystem of WP_CONTENT_DIR.
  60. *
  61. * @since 2.7.0
  62. *
  63. * @return string The location of the remote path.
  64. */
  65. public function wp_content_dir() {
  66. return $this->find_folder( WP_CONTENT_DIR );
  67. }
  68. /**
  69. * Returns the path on the remote filesystem of WP_PLUGIN_DIR.
  70. *
  71. * @since 2.7.0
  72. *
  73. * @return string The location of the remote path.
  74. */
  75. public function wp_plugins_dir() {
  76. return $this->find_folder( WP_PLUGIN_DIR );
  77. }
  78. /**
  79. * Returns the path on the remote filesystem of the Themes Directory.
  80. *
  81. * @since 2.7.0
  82. *
  83. * @param string|false $theme Optional. The theme stylesheet or template for the directory.
  84. * Default false.
  85. * @return string The location of the remote path.
  86. */
  87. public function wp_themes_dir( $theme = false ) {
  88. $theme_root = get_theme_root( $theme );
  89. // Account for relative theme roots.
  90. if ( '/themes' === $theme_root || ! is_dir( $theme_root ) ) {
  91. $theme_root = WP_CONTENT_DIR . $theme_root;
  92. }
  93. return $this->find_folder( $theme_root );
  94. }
  95. /**
  96. * Returns the path on the remote filesystem of WP_LANG_DIR.
  97. *
  98. * @since 3.2.0
  99. *
  100. * @return string The location of the remote path.
  101. */
  102. public function wp_lang_dir() {
  103. return $this->find_folder( WP_LANG_DIR );
  104. }
  105. /**
  106. * Locates a folder on the remote filesystem.
  107. *
  108. * @since 2.5.0
  109. * @deprecated 2.7.0 use WP_Filesystem_Base::abspath() or WP_Filesystem_Base::wp_*_dir() instead.
  110. * @see WP_Filesystem_Base::abspath()
  111. * @see WP_Filesystem_Base::wp_content_dir()
  112. * @see WP_Filesystem_Base::wp_plugins_dir()
  113. * @see WP_Filesystem_Base::wp_themes_dir()
  114. * @see WP_Filesystem_Base::wp_lang_dir()
  115. *
  116. * @param string $base Optional. The folder to start searching from. Default '.'.
  117. * @param bool $verbose Optional. True to display debug information. Default false.
  118. * @return string The location of the remote path.
  119. */
  120. public function find_base_dir( $base = '.', $verbose = false ) {
  121. _deprecated_function( __FUNCTION__, '2.7.0', 'WP_Filesystem_Base::abspath() or WP_Filesystem_Base::wp_*_dir()' );
  122. $this->verbose = $verbose;
  123. return $this->abspath();
  124. }
  125. /**
  126. * Locates a folder on the remote filesystem.
  127. *
  128. * @since 2.5.0
  129. * @deprecated 2.7.0 use WP_Filesystem_Base::abspath() or WP_Filesystem_Base::wp_*_dir() methods instead.
  130. * @see WP_Filesystem_Base::abspath()
  131. * @see WP_Filesystem_Base::wp_content_dir()
  132. * @see WP_Filesystem_Base::wp_plugins_dir()
  133. * @see WP_Filesystem_Base::wp_themes_dir()
  134. * @see WP_Filesystem_Base::wp_lang_dir()
  135. *
  136. * @param string $base Optional. The folder to start searching from. Default '.'.
  137. * @param bool $verbose Optional. True to display debug information. Default false.
  138. * @return string The location of the remote path.
  139. */
  140. public function get_base_dir( $base = '.', $verbose = false ) {
  141. _deprecated_function( __FUNCTION__, '2.7.0', 'WP_Filesystem_Base::abspath() or WP_Filesystem_Base::wp_*_dir()' );
  142. $this->verbose = $verbose;
  143. return $this->abspath();
  144. }
  145. /**
  146. * Locates a folder on the remote filesystem.
  147. *
  148. * Assumes that on Windows systems, Stripping off the Drive
  149. * letter is OK Sanitizes \\ to / in Windows filepaths.
  150. *
  151. * @since 2.7.0
  152. *
  153. * @param string $folder the folder to locate.
  154. * @return string|false The location of the remote path, false on failure.
  155. */
  156. public function find_folder( $folder ) {
  157. if ( isset( $this->cache[ $folder ] ) ) {
  158. return $this->cache[ $folder ];
  159. }
  160. if ( stripos( $this->method, 'ftp' ) !== false ) {
  161. $constant_overrides = array(
  162. 'FTP_BASE' => ABSPATH,
  163. 'FTP_CONTENT_DIR' => WP_CONTENT_DIR,
  164. 'FTP_PLUGIN_DIR' => WP_PLUGIN_DIR,
  165. 'FTP_LANG_DIR' => WP_LANG_DIR,
  166. );
  167. // Direct matches ( folder = CONSTANT/ ).
  168. foreach ( $constant_overrides as $constant => $dir ) {
  169. if ( ! defined( $constant ) ) {
  170. continue;
  171. }
  172. if ( $folder === $dir ) {
  173. return trailingslashit( constant( $constant ) );
  174. }
  175. }
  176. // Prefix matches ( folder = CONSTANT/subdir ),
  177. foreach ( $constant_overrides as $constant => $dir ) {
  178. if ( ! defined( $constant ) ) {
  179. continue;
  180. }
  181. if ( 0 === stripos( $folder, $dir ) ) { // $folder starts with $dir.
  182. $potential_folder = preg_replace( '#^' . preg_quote( $dir, '#' ) . '/#i', trailingslashit( constant( $constant ) ), $folder );
  183. $potential_folder = trailingslashit( $potential_folder );
  184. if ( $this->is_dir( $potential_folder ) ) {
  185. $this->cache[ $folder ] = $potential_folder;
  186. return $potential_folder;
  187. }
  188. }
  189. }
  190. } elseif ( 'direct' === $this->method ) {
  191. $folder = str_replace( '\\', '/', $folder ); // Windows path sanitisation.
  192. return trailingslashit( $folder );
  193. }
  194. $folder = preg_replace( '|^([a-z]{1}):|i', '', $folder ); // Strip out Windows drive letter if it's there.
  195. $folder = str_replace( '\\', '/', $folder ); // Windows path sanitisation.
  196. if ( isset( $this->cache[ $folder ] ) ) {
  197. return $this->cache[ $folder ];
  198. }
  199. if ( $this->exists( $folder ) ) { // Folder exists at that absolute path.
  200. $folder = trailingslashit( $folder );
  201. $this->cache[ $folder ] = $folder;
  202. return $folder;
  203. }
  204. $return = $this->search_for_folder( $folder );
  205. if ( $return ) {
  206. $this->cache[ $folder ] = $return;
  207. }
  208. return $return;
  209. }
  210. /**
  211. * Locates a folder on the remote filesystem.
  212. *
  213. * Expects Windows sanitized path.
  214. *
  215. * @since 2.7.0
  216. *
  217. * @param string $folder The folder to locate.
  218. * @param string $base The folder to start searching from.
  219. * @param bool $loop If the function has recursed. Internal use only.
  220. * @return string|false The location of the remote path, false to cease looping.
  221. */
  222. public function search_for_folder( $folder, $base = '.', $loop = false ) {
  223. if ( empty( $base ) || '.' === $base ) {
  224. $base = trailingslashit( $this->cwd() );
  225. }
  226. $folder = untrailingslashit( $folder );
  227. if ( $this->verbose ) {
  228. /* translators: 1: Folder to locate, 2: Folder to start searching from. */
  229. printf( "\n" . __( 'Looking for %1$s in %2$s' ) . "<br/>\n", $folder, $base );
  230. }
  231. $folder_parts = explode( '/', $folder );
  232. $folder_part_keys = array_keys( $folder_parts );
  233. $last_index = array_pop( $folder_part_keys );
  234. $last_path = $folder_parts[ $last_index ];
  235. $files = $this->dirlist( $base );
  236. foreach ( $folder_parts as $index => $key ) {
  237. if ( $index === $last_index ) {
  238. continue; // We want this to be caught by the next code block.
  239. }
  240. /*
  241. * Working from /home/ to /user/ to /wordpress/ see if that file exists within
  242. * the current folder, If it's found, change into it and follow through looking
  243. * for it. If it can't find WordPress down that route, it'll continue onto the next
  244. * folder level, and see if that matches, and so on. If it reaches the end, and still
  245. * can't find it, it'll return false for the entire function.
  246. */
  247. if ( isset( $files[ $key ] ) ) {
  248. // Let's try that folder:
  249. $newdir = trailingslashit( path_join( $base, $key ) );
  250. if ( $this->verbose ) {
  251. /* translators: %s: Directory name. */
  252. printf( "\n" . __( 'Changing to %s' ) . "<br/>\n", $newdir );
  253. }
  254. // Only search for the remaining path tokens in the directory, not the full path again.
  255. $newfolder = implode( '/', array_slice( $folder_parts, $index + 1 ) );
  256. $ret = $this->search_for_folder( $newfolder, $newdir, $loop );
  257. if ( $ret ) {
  258. return $ret;
  259. }
  260. }
  261. }
  262. // Only check this as a last resort, to prevent locating the incorrect install.
  263. // All above procedures will fail quickly if this is the right branch to take.
  264. if ( isset( $files[ $last_path ] ) ) {
  265. if ( $this->verbose ) {
  266. /* translators: %s: Directory name. */
  267. printf( "\n" . __( 'Found %s' ) . "<br/>\n", $base . $last_path );
  268. }
  269. return trailingslashit( $base . $last_path );
  270. }
  271. // Prevent this function from looping again.
  272. // No need to proceed if we've just searched in `/`.
  273. if ( $loop || '/' === $base ) {
  274. return false;
  275. }
  276. // As an extra last resort, Change back to / if the folder wasn't found.
  277. // This comes into effect when the CWD is /home/user/ but WP is at /var/www/....
  278. return $this->search_for_folder( $folder, '/', true );
  279. }
  280. /**
  281. * Returns the *nix-style file permissions for a file.
  282. *
  283. * From the PHP documentation page for fileperms().
  284. *
  285. * @link https://www.php.net/manual/en/function.fileperms.php
  286. *
  287. * @since 2.5.0
  288. *
  289. * @param string $file String filename.
  290. * @return string The *nix-style representation of permissions.
  291. */
  292. public function gethchmod( $file ) {
  293. $perms = intval( $this->getchmod( $file ), 8 );
  294. if ( ( $perms & 0xC000 ) === 0xC000 ) { // Socket.
  295. $info = 's';
  296. } elseif ( ( $perms & 0xA000 ) === 0xA000 ) { // Symbolic Link.
  297. $info = 'l';
  298. } elseif ( ( $perms & 0x8000 ) === 0x8000 ) { // Regular.
  299. $info = '-';
  300. } elseif ( ( $perms & 0x6000 ) === 0x6000 ) { // Block special.
  301. $info = 'b';
  302. } elseif ( ( $perms & 0x4000 ) === 0x4000 ) { // Directory.
  303. $info = 'd';
  304. } elseif ( ( $perms & 0x2000 ) === 0x2000 ) { // Character special.
  305. $info = 'c';
  306. } elseif ( ( $perms & 0x1000 ) === 0x1000 ) { // FIFO pipe.
  307. $info = 'p';
  308. } else { // Unknown.
  309. $info = 'u';
  310. }
  311. // Owner.
  312. $info .= ( ( $perms & 0x0100 ) ? 'r' : '-' );
  313. $info .= ( ( $perms & 0x0080 ) ? 'w' : '-' );
  314. $info .= ( ( $perms & 0x0040 ) ?
  315. ( ( $perms & 0x0800 ) ? 's' : 'x' ) :
  316. ( ( $perms & 0x0800 ) ? 'S' : '-' ) );
  317. // Group.
  318. $info .= ( ( $perms & 0x0020 ) ? 'r' : '-' );
  319. $info .= ( ( $perms & 0x0010 ) ? 'w' : '-' );
  320. $info .= ( ( $perms & 0x0008 ) ?
  321. ( ( $perms & 0x0400 ) ? 's' : 'x' ) :
  322. ( ( $perms & 0x0400 ) ? 'S' : '-' ) );
  323. // World.
  324. $info .= ( ( $perms & 0x0004 ) ? 'r' : '-' );
  325. $info .= ( ( $perms & 0x0002 ) ? 'w' : '-' );
  326. $info .= ( ( $perms & 0x0001 ) ?
  327. ( ( $perms & 0x0200 ) ? 't' : 'x' ) :
  328. ( ( $perms & 0x0200 ) ? 'T' : '-' ) );
  329. return $info;
  330. }
  331. /**
  332. * Gets the permissions of the specified file or filepath in their octal format.
  333. *
  334. * @since 2.5.0
  335. *
  336. * @param string $file Path to the file.
  337. * @return string Mode of the file (the last 3 digits).
  338. */
  339. public function getchmod( $file ) {
  340. return '777';
  341. }
  342. /**
  343. * Converts *nix-style file permissions to a octal number.
  344. *
  345. * Converts '-rw-r--r--' to 0644
  346. * From "info at rvgate dot nl"'s comment on the PHP documentation for chmod()
  347. *
  348. * @link https://www.php.net/manual/en/function.chmod.php#49614
  349. *
  350. * @since 2.5.0
  351. *
  352. * @param string $mode string The *nix-style file permissions.
  353. * @return string Octal representation of permissions.
  354. */
  355. public function getnumchmodfromh( $mode ) {
  356. $realmode = '';
  357. $legal = array( '', 'w', 'r', 'x', '-' );
  358. $attarray = preg_split( '//', $mode );
  359. for ( $i = 0, $c = count( $attarray ); $i < $c; $i++ ) {
  360. $key = array_search( $attarray[ $i ], $legal, true );
  361. if ( $key ) {
  362. $realmode .= $legal[ $key ];
  363. }
  364. }
  365. $mode = str_pad( $realmode, 10, '-', STR_PAD_LEFT );
  366. $trans = array(
  367. '-' => '0',
  368. 'r' => '4',
  369. 'w' => '2',
  370. 'x' => '1',
  371. );
  372. $mode = strtr( $mode, $trans );
  373. $newmode = $mode[0];
  374. $newmode .= $mode[1] + $mode[2] + $mode[3];
  375. $newmode .= $mode[4] + $mode[5] + $mode[6];
  376. $newmode .= $mode[7] + $mode[8] + $mode[9];
  377. return $newmode;
  378. }
  379. /**
  380. * Determines if the string provided contains binary characters.
  381. *
  382. * @since 2.7.0
  383. *
  384. * @param string $text String to test against.
  385. * @return bool True if string is binary, false otherwise.
  386. */
  387. public function is_binary( $text ) {
  388. return (bool) preg_match( '|[^\x20-\x7E]|', $text ); // chr(32)..chr(127)
  389. }
  390. /**
  391. * Changes the owner of a file or directory.
  392. *
  393. * Default behavior is to do nothing, override this in your subclass, if desired.
  394. *
  395. * @since 2.5.0
  396. *
  397. * @param string $file Path to the file or directory.
  398. * @param string|int $owner A user name or number.
  399. * @param bool $recursive Optional. If set to true, changes file owner recursively.
  400. * Default false.
  401. * @return bool True on success, false on failure.
  402. */
  403. public function chown( $file, $owner, $recursive = false ) {
  404. return false;
  405. }
  406. /**
  407. * Connects filesystem.
  408. *
  409. * @since 2.5.0
  410. * @abstract
  411. *
  412. * @return bool True on success, false on failure (always true for WP_Filesystem_Direct).
  413. */
  414. public function connect() {
  415. return true;
  416. }
  417. /**
  418. * Reads entire file into a string.
  419. *
  420. * @since 2.5.0
  421. * @abstract
  422. *
  423. * @param string $file Name of the file to read.
  424. * @return string|false Read data on success, false on failure.
  425. */
  426. public function get_contents( $file ) {
  427. return false;
  428. }
  429. /**
  430. * Reads entire file into an array.
  431. *
  432. * @since 2.5.0
  433. * @abstract
  434. *
  435. * @param string $file Path to the file.
  436. * @return array|false File contents in an array on success, false on failure.
  437. */
  438. public function get_contents_array( $file ) {
  439. return false;
  440. }
  441. /**
  442. * Writes a string to a file.
  443. *
  444. * @since 2.5.0
  445. * @abstract
  446. *
  447. * @param string $file Remote path to the file where to write the data.
  448. * @param string $contents The data to write.
  449. * @param int|false $mode Optional. The file permissions as octal number, usually 0644.
  450. * Default false.
  451. * @return bool True on success, false on failure.
  452. */
  453. public function put_contents( $file, $contents, $mode = false ) {
  454. return false;
  455. }
  456. /**
  457. * Gets the current working directory.
  458. *
  459. * @since 2.5.0
  460. * @abstract
  461. *
  462. * @return string|false The current working directory on success, false on failure.
  463. */
  464. public function cwd() {
  465. return false;
  466. }
  467. /**
  468. * Changes current directory.
  469. *
  470. * @since 2.5.0
  471. * @abstract
  472. *
  473. * @param string $dir The new current directory.
  474. * @return bool True on success, false on failure.
  475. */
  476. public function chdir( $dir ) {
  477. return false;
  478. }
  479. /**
  480. * Changes the file group.
  481. *
  482. * @since 2.5.0
  483. * @abstract
  484. *
  485. * @param string $file Path to the file.
  486. * @param string|int $group A group name or number.
  487. * @param bool $recursive Optional. If set to true, changes file group recursively.
  488. * Default false.
  489. * @return bool True on success, false on failure.
  490. */
  491. public function chgrp( $file, $group, $recursive = false ) {
  492. return false;
  493. }
  494. /**
  495. * Changes filesystem permissions.
  496. *
  497. * @since 2.5.0
  498. * @abstract
  499. *
  500. * @param string $file Path to the file.
  501. * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files,
  502. * 0755 for directories. Default false.
  503. * @param bool $recursive Optional. If set to true, changes file permissions recursively.
  504. * Default false.
  505. * @return bool True on success, false on failure.
  506. */
  507. public function chmod( $file, $mode = false, $recursive = false ) {
  508. return false;
  509. }
  510. /**
  511. * Gets the file owner.
  512. *
  513. * @since 2.5.0
  514. * @abstract
  515. *
  516. * @param string $file Path to the file.
  517. * @return string|false Username of the owner on success, false on failure.
  518. */
  519. public function owner( $file ) {
  520. return false;
  521. }
  522. /**
  523. * Gets the file's group.
  524. *
  525. * @since 2.5.0
  526. * @abstract
  527. *
  528. * @param string $file Path to the file.
  529. * @return string|false The group on success, false on failure.
  530. */
  531. public function group( $file ) {
  532. return false;
  533. }
  534. /**
  535. * Copies a file.
  536. *
  537. * @since 2.5.0
  538. * @abstract
  539. *
  540. * @param string $source Path to the source file.
  541. * @param string $destination Path to the destination file.
  542. * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists.
  543. * Default false.
  544. * @param int|false $mode Optional. The permissions as octal number, usually 0644 for files,
  545. * 0755 for dirs. Default false.
  546. * @return bool True on success, false on failure.
  547. */
  548. public function copy( $source, $destination, $overwrite = false, $mode = false ) {
  549. return false;
  550. }
  551. /**
  552. * Moves a file.
  553. *
  554. * @since 2.5.0
  555. * @abstract
  556. *
  557. * @param string $source Path to the source file.
  558. * @param string $destination Path to the destination file.
  559. * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists.
  560. * Default false.
  561. * @return bool True on success, false on failure.
  562. */
  563. public function move( $source, $destination, $overwrite = false ) {
  564. return false;
  565. }
  566. /**
  567. * Deletes a file or directory.
  568. *
  569. * @since 2.5.0
  570. * @abstract
  571. *
  572. * @param string $file Path to the file or directory.
  573. * @param bool $recursive Optional. If set to true, deletes files and folders recursively.
  574. * Default false.
  575. * @param string|false $type Type of resource. 'f' for file, 'd' for directory.
  576. * Default false.
  577. * @return bool True on success, false on failure.
  578. */
  579. public function delete( $file, $recursive = false, $type = false ) {
  580. return false;
  581. }
  582. /**
  583. * Checks if a file or directory exists.
  584. *
  585. * @since 2.5.0
  586. * @abstract
  587. *
  588. * @param string $file Path to file or directory.
  589. * @return bool Whether $file exists or not.
  590. */
  591. public function exists( $file ) {
  592. return false;
  593. }
  594. /**
  595. * Checks if resource is a file.
  596. *
  597. * @since 2.5.0
  598. * @abstract
  599. *
  600. * @param string $file File path.
  601. * @return bool Whether $file is a file.
  602. */
  603. public function is_file( $file ) {
  604. return false;
  605. }
  606. /**
  607. * Checks if resource is a directory.
  608. *
  609. * @since 2.5.0
  610. * @abstract
  611. *
  612. * @param string $path Directory path.
  613. * @return bool Whether $path is a directory.
  614. */
  615. public function is_dir( $path ) {
  616. return false;
  617. }
  618. /**
  619. * Checks if a file is readable.
  620. *
  621. * @since 2.5.0
  622. * @abstract
  623. *
  624. * @param string $file Path to file.
  625. * @return bool Whether $file is readable.
  626. */
  627. public function is_readable( $file ) {
  628. return false;
  629. }
  630. /**
  631. * Checks if a file or directory is writable.
  632. *
  633. * @since 2.5.0
  634. * @abstract
  635. *
  636. * @param string $file Path to file or directory.
  637. * @return bool Whether $file is writable.
  638. */
  639. public function is_writable( $file ) {
  640. return false;
  641. }
  642. /**
  643. * Gets the file's last access time.
  644. *
  645. * @since 2.5.0
  646. * @abstract
  647. *
  648. * @param string $file Path to file.
  649. * @return int|false Unix timestamp representing last access time, false on failure.
  650. */
  651. public function atime( $file ) {
  652. return false;
  653. }
  654. /**
  655. * Gets the file modification time.
  656. *
  657. * @since 2.5.0
  658. * @abstract
  659. *
  660. * @param string $file Path to file.
  661. * @return int|false Unix timestamp representing modification time, false on failure.
  662. */
  663. public function mtime( $file ) {
  664. return false;
  665. }
  666. /**
  667. * Gets the file size (in bytes).
  668. *
  669. * @since 2.5.0
  670. * @abstract
  671. *
  672. * @param string $file Path to file.
  673. * @return int|false Size of the file in bytes on success, false on failure.
  674. */
  675. public function size( $file ) {
  676. return false;
  677. }
  678. /**
  679. * Sets the access and modification times of a file.
  680. *
  681. * Note: If $file doesn't exist, it will be created.
  682. *
  683. * @since 2.5.0
  684. * @abstract
  685. *
  686. * @param string $file Path to file.
  687. * @param int $time Optional. Modified time to set for file.
  688. * Default 0.
  689. * @param int $atime Optional. Access time to set for file.
  690. * Default 0.
  691. * @return bool True on success, false on failure.
  692. */
  693. public function touch( $file, $time = 0, $atime = 0 ) {
  694. return false;
  695. }
  696. /**
  697. * Creates a directory.
  698. *
  699. * @since 2.5.0
  700. * @abstract
  701. *
  702. * @param string $path Path for new directory.
  703. * @param int|false $chmod Optional. The permissions as octal number (or false to skip chmod).
  704. * Default false.
  705. * @param string|int|false $chown Optional. A user name or number (or false to skip chown).
  706. * Default false.
  707. * @param string|int|false $chgrp Optional. A group name or number (or false to skip chgrp).
  708. * Default false.
  709. * @return bool True on success, false on failure.
  710. */
  711. public function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) {
  712. return false;
  713. }
  714. /**
  715. * Deletes a directory.
  716. *
  717. * @since 2.5.0
  718. * @abstract
  719. *
  720. * @param string $path Path to directory.
  721. * @param bool $recursive Optional. Whether to recursively remove files/directories.
  722. * Default false.
  723. * @return bool True on success, false on failure.
  724. */
  725. public function rmdir( $path, $recursive = false ) {
  726. return false;
  727. }
  728. /**
  729. * Gets details for files in a directory or a specific file.
  730. *
  731. * @since 2.5.0
  732. * @abstract
  733. *
  734. * @param string $path Path to directory or file.
  735. * @param bool $include_hidden Optional. Whether to include details of hidden ("." prefixed) files.
  736. * Default true.
  737. * @param bool $recursive Optional. Whether to recursively include file details in nested directories.
  738. * Default false.
  739. * @return array|false {
  740. * Array of files. False if unable to list directory contents.
  741. *
  742. * @type string $name Name of the file or directory.
  743. * @type string $perms *nix representation of permissions.
  744. * @type string $permsn Octal representation of permissions.
  745. * @type string $owner Owner name or ID.
  746. * @type int $size Size of file in bytes.
  747. * @type int $lastmodunix Last modified unix timestamp.
  748. * @type mixed $lastmod Last modified month (3 letter) and day (without leading 0).
  749. * @type int $time Last modified time.
  750. * @type string $type Type of resource. 'f' for file, 'd' for directory.
  751. * @type mixed $files If a directory and `$recursive` is true, contains another array of files.
  752. * }
  753. */
  754. public function dirlist( $path, $include_hidden = true, $recursive = false ) {
  755. return false;
  756. }
  757. }