Version Description
Download this release
Release Info
Developer | paultgoodchild |
Plugin | Shield Security for WordPress |
Version | 14.1.1 |
Comparing to | |
See all releases |
Code changes from version 14.1.0 to 14.1.1
- cl.json +33 -15
- config/admin_access_restriction.json +1 -1
- config/comments_filter.json +24 -10
- config/data.json +21 -16
- config/deprecated/admin_access_restriction.php +14 -0
- config/deprecated/audit_trail.php +61 -21
- config/deprecated/comments_filter.php +24 -10
- config/deprecated/data.php +35 -3
- config/deprecated/firewall.php +1 -0
- config/deprecated/hack_protect.php +12 -0
- config/deprecated/ips.php +14 -0
- config/deprecated/license.php +10 -0
- config/deprecated/login_protect.php +2 -2
- config/deprecated/plugin.php +16 -0
- config/firewall.json +1 -0
- config/login_protect.json +2 -2
- icwp-wpsf.php +1 -1
- plugin-spec.php +6 -19
- plugin.json +6 -19
- readme.txt +1 -1
- resources/js/plugin.js +2 -4
- resources/js/shield/audit_trail.js +14 -14
- resources/js/shield/ipanalyse.js +1 -1
- resources/js/shield/userprofile.js +18 -18
- src/lib/src/ChangeTrack/Snapshot/BuildComments.php +0 -4
- src/lib/src/ChangeTrack/Snapshot/BuildMedia.php +0 -4
- src/lib/src/ChangeTrack/Snapshot/BuildPages.php +0 -4
- src/lib/src/ChangeTrack/Snapshot/BuildPlugins.php +0 -4
- src/lib/src/ChangeTrack/Snapshot/BuildPosts.php +0 -4
- src/lib/src/ChangeTrack/Snapshot/BuildThemes.php +0 -4
- src/lib/src/ChangeTrack/Snapshot/BuildUsers.php +0 -4
- src/lib/src/ChangeTrack/Snapshot/Collate.php +2 -8
- src/lib/src/Controller/Ajax/Init.php +30 -11
- src/lib/src/Databases/AuditTrail/EntryVO.php +0 -2
- src/lib/src/Databases/Base/HandlerConsumer.php +0 -4
- src/lib/src/Databases/ChangeTracking/EntryVO.php +0 -1
- src/lib/src/Databases/Events/EntryVO.php +0 -1
- src/lib/src/Databases/FileLocker/EntryVO.php +0 -1
- src/lib/src/Databases/Reports/EntryVO.php +0 -1
- src/lib/src/Databases/ScanQueue/EntryVO.php +0 -1
- src/lib/src/Databases/Session/EntryVO.php +0 -1
- src/lib/src/Logging/Processors/BaseMetaProcessor.php +11 -0
- src/lib/src/Logging/Processors/RequestMetaProcessor.php +11 -3
- src/lib/src/Logging/Processors/ShieldMetaProcessor.php +2 -7
- src/lib/src/Logging/Processors/UserMetaProcessor.php +3 -20
- src/lib/src/Logging/Processors/WpMetaProcessor.php +2 -4
- src/lib/src/Modules/AuditTrail/AjaxHandler.php +44 -15
- src/lib/src/Modules/AuditTrail/Lib/AuditLogger.php +14 -5
- src/lib/src/Modules/AuditTrail/Lib/LogTable/BuildAuditTableData.php +24 -1
- src/lib/src/Modules/Base/AdminNotices.php +15 -34
- src/lib/src/Modules/Base/AjaxHandler.php +80 -31
- src/lib/src/Modules/Base/ModCon.php +26 -53
- src/lib/src/Modules/Base/Strings.php +0 -10
- src/lib/src/Modules/BaseShield/AjaxHandler.php +13 -34
- src/lib/src/Modules/CommentsFilter/AjaxHandler.php +6 -14
- src/lib/src/Modules/CommentsFilter/ModCon.php +2 -6
- src/lib/src/Modules/CommentsFilter/Options.php +9 -1
- src/lib/src/Modules/CommentsFilter/Scan/AntiBot.php +0 -1
- src/lib/src/Modules/CommentsFilter/Scan/IsEmailTrusted.php +0 -4
- src/lib/src/Modules/CommentsFilter/Strings.php +25 -30
- src/lib/src/Modules/CommentsFilter/Upgrade.php +14 -1
- src/lib/src/Modules/Comms/Strings.php +0 -10
- src/lib/src/Modules/Data/DB/ReqLogs/LoadLogs.php +3 -1
- src/lib/src/Modules/Data/DB/ReqLogs/Ops/Handler.php +29 -11
- src/lib/src/Modules/Data/DB/ReqLogs/Ops/Record.php +6 -0
- src/lib/src/Modules/Data/Lib/UpgradeReqLogsTable.php +9 -4
- src/lib/src/Modules/Data/Upgrade.php +1 -1
- src/lib/src/Modules/Firewall/Strings.php +0 -10
- src/lib/src/Modules/HackGuard/AjaxHandler.php +18 -38
- src/lib/src/Modules/HackGuard/Lib/FileLocker/Ops/Accept.php +0 -4
- src/lib/src/Modules/HackGuard/Lib/FileLocker/Ops/BuildEncryptedFilePayload.php +0 -4
- src/lib/src/Modules/HackGuard/Lib/FileLocker/Ops/Verify.php +0 -4
- src/lib/src/Modules/HackGuard/Lib/Hashes/Query.php +0 -3
- src/lib/src/Modules/HackGuard/Lib/Hashes/Retrieve.php +3 -8
- src/lib/src/Modules/HackGuard/Lib/ScanTables/DelegateAjaxHandler.php +0 -1
- src/lib/src/Modules/HackGuard/Lib/Snapshots/Build/BuildHashesForAsset.php +0 -4
- src/lib/src/Modules/HackGuard/Lib/Snapshots/Build/BuildHashesFromApi.php +0 -4
- src/lib/src/Modules/HackGuard/Lib/Snapshots/Build/BuildHashesFromDir.php +0 -4
- src/lib/src/Modules/Headers/Processor.php +1 -2
- src/lib/src/Modules/Headers/Strings.php +12 -23
- src/lib/src/Modules/IPs/AjaxHandler.php +21 -55
- src/lib/src/Modules/IPs/BotTrack/TrackLinkCheese.php +0 -2
- src/lib/src/Modules/IPs/Components/ProcessOffense.php +0 -2
- src/lib/src/Modules/IPs/Components/QueryIpBlock.php +3 -3
- src/lib/src/Modules/IPs/Components/QueryRemainingOffenses.php +0 -4
- src/lib/src/Modules/IPs/Lib/IpAnalyse/BuildDisplay.php +0 -4
- src/lib/src/Modules/IPs/Lib/Ops/AddIp.php +0 -4
- src/lib/src/Modules/IPs/Strings.php +0 -5
- src/lib/src/Modules/IPs/UI.php +1 -1
- src/lib/src/Modules/Insights/AjaxHandler.php +8 -13
- src/lib/src/Modules/Insights/Lib/Requests/DynamicPageLoader.php +0 -2
- src/lib/src/Modules/Integrations/Lib/Bots/Spam/Handlers/NinjaForms.php +0 -3
- src/lib/src/Modules/Integrations/Lib/Bots/UserForms/Handlers/MemberPress.php +0 -3
- src/lib/src/Modules/Integrations/Lib/MainWP/Client/Auth/ReproduceClientAuthByKey.php +0 -3
- src/lib/src/Modules/Integrations/Lib/MainWP/Common/MWPExtensionVO.php +0 -2
- src/lib/src/Modules/Integrations/Lib/MainWP/Common/MWPSiteVO.php +0 -2
- src/lib/src/Modules/Integrations/Lib/MainWP/Common/MainWPVO.php +0 -2
- src/lib/src/Modules/Integrations/Lib/MainWP/Server/Ajax/AjaxHandlerMainwp.php +11 -27
- src/lib/src/Modules/Integrations/Lib/MainWP/Server/Init.php +1 -1
- src/lib/src/Modules/License/AjaxHandler.php +19 -27
- src/lib/src/Modules/License/Strings.php +2 -2
- src/lib/src/Modules/License/UI.php +4 -4
- src/lib/src/Modules/Lockdown/Strings.php +0 -5
- src/lib/src/Modules/LoginGuard/AdminNotices.php +1 -1
- src/lib/src/Modules/LoginGuard/AjaxHandler.php +39 -90
- src/lib/src/Modules/LoginGuard/Lib/AntiBot/FormProviders/LearnPress.php +0 -2
- src/lib/src/Modules/LoginGuard/Lib/AntiBot/FormProviders/PaidMemberSubscriptions.php +0 -2
- src/lib/src/Modules/LoginGuard/Lib/AntiBot/FormProviders/ProfileBuilder.php +0 -2
- src/lib/src/Modules/LoginGuard/Lib/AntiBot/FormProviders/UltimateMember.php +0 -2
- src/lib/src/Modules/LoginGuard/Lib/AntiBot/FormProviders/UserRegistration.php +0 -2
- src/lib/src/Modules/LoginGuard/Lib/AntiBot/FormProviders/WPMembers.php +0 -2
- src/lib/src/Modules/LoginGuard/Lib/TwoFactor/Provider/BackupCodes.php +2 -2
- src/lib/src/Modules/LoginGuard/Lib/TwoFactor/Provider/Email.php +1 -1
- src/lib/src/Modules/LoginGuard/Lib/TwoFactor/Provider/GoogleAuth.php +1 -1
- src/lib/src/Modules/LoginGuard/Lib/TwoFactor/Provider/Sms.php +3 -3
- src/lib/src/Modules/LoginGuard/Lib/TwoFactor/Provider/U2F.php +2 -2
- src/lib/src/Modules/LoginGuard/Lib/TwoFactor/Provider/Yubikey.php +1 -2
- src/lib/src/Modules/LoginGuard/ModCon.php +2 -2
- src/lib/src/Modules/LoginGuard/Strings.php +0 -10
- src/lib/src/Modules/Plugin/AdminNotices.php +11 -29
- src/lib/src/Modules/Plugin/AjaxHandler.php +40 -74
- src/lib/src/Modules/Plugin/Components/PluginBadge.php +0 -4
- src/lib/src/Modules/Plugin/Lib/Captcha/CaptchaConfigVO.php +0 -2
- src/lib/src/Modules/Plugin/Options.php +2 -3
- src/lib/src/Modules/Plugin/Strings.php +0 -10
- src/lib/src/Modules/Reporting/AjaxHandler.php +10 -17
- src/lib/src/Modules/Reporting/Charts/ChartRequestVO.php +0 -2
- src/lib/src/Modules/Reporting/Charts/CustomChartRequestVO.php +0 -2
- src/lib/src/Modules/Reporting/Lib/Reports/ReportVO.php +0 -2
- src/lib/src/Modules/Reporting/Strings.php +0 -10
- src/lib/src/Modules/SecurityAdmin/AjaxHandler.php +13 -23
- src/lib/src/Modules/Sessions/Strings.php +0 -10
- src/lib/src/Modules/Traffic/AjaxHandler.php +38 -18
- src/lib/src/Modules/Traffic/Lib/LogHandlers/LocalDbWriter.php +1 -1
- src/lib/src/Modules/Traffic/Lib/RequestLogger.php +15 -6
- src/lib/src/Modules/Traffic/Lib/TrafficTable/BuildTrafficTableData.php +8 -11
- src/lib/src/Modules/Traffic/ModCon.php +6 -10
- src/lib/src/Modules/Traffic/Options.php +1 -1
- src/lib/src/Modules/Traffic/Strings.php +0 -10
- src/lib/src/Modules/Traffic/Upgrade.php +1 -1
- src/lib/src/Modules/UserManagement/AjaxHandler.php +17 -29
- src/lib/src/Modules/UserManagement/Options.php +1 -1
- src/lib/src/Modules/UserManagement/Strings.php +0 -10
- src/lib/src/Scans/Base/BaseFileScanActionVO.php +0 -2
- src/lib/src/Scans/Base/BaseMergeItems.php +6 -10
- src/lib/src/Scans/Helpers/BuildHashesFromDir.php +0 -4
- src/lib/src/Scans/Helpers/CopyResultsSets.php +0 -4
- src/lib/src/Scans/Helpers/MergeResultsSets.php +0 -4
- src/lib/src/Scans/Helpers/ScannerRecursiveFilterIterator.php +0 -4
- src/lib/src/Scans/Helpers/StandardDirectoryIterator.php +0 -4
- src/lib/src/Scans/Mal/ScanActionVO.php +0 -2
- src/lib/src/Scans/Wcf/ScanActionVO.php +0 -2
- src/lib/src/ShieldNetApi/Common/BaseApi.php +0 -2
- src/lib/src/Tables/Build/AdminNotes.php +0 -4
- src/lib/src/Tables/Build/Ip.php +10 -10
- src/lib/src/Tests/VerifyUniqueEvents.php +0 -2
- src/lib/src/Utilities/AdminNotices/Controller.php +14 -12
- src/lib/src/Utilities/AdminNotices/NoticeVO.php +3 -5
- src/lib/src/Utilities/ReCaptcha/WordpressPost.php +0 -4
- src/lib/src/Utilities/Tool/FormatBytes.php +0 -4
- src/lib/src/Utilities/Tool/IpListSort.php +0 -4
- src/lib/vendor/composer/autoload_classmap.php +1 -2
- src/lib/vendor/composer/autoload_static.php +1 -2
- src/lib/vendor/fernleafsystems/utilities/src/Data/Adapter/DynProperties.php +12 -0
- src/lib/vendor/fernleafsystems/wordpress-plugin-core/src/Databases/Common/BuildColumnFromDef.php +24 -16
- src/lib/vendor/fernleafsystems/wordpress-services/src/Core/Fs.php +4 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Core/VOs/Assets/WpBaseVo.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Core/VOs/Assets/WpPluginVo.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Core/VOs/Assets/WpThemeVo.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Core/VOs/WpBaseVo.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Core/VOs/WpHttpResponseVo.php +2 -6
- src/lib/vendor/fernleafsystems/wordpress-services/src/Core/VOs/WpPluginVo.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Core/VOs/WpThemeVo.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/ClassicPress/Checksums.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/Cache/Base.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/Cache/CacheDefVO.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/Cache/LoadFromCache.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/Cache/StoreToCache.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/ExtractLineFromFile.php +6 -10
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/ExtractLinesFromFile.php +6 -11
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/LocateStrInFile.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/ReadDataFromFileEncrypted.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/RemoveLineFromFile.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/TestFileWritable.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/WriteDataToFileEncrypted.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/HttpRequest.php +55 -64
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/Ipify/Api.php +5 -12
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/ApiBase.php +19 -31
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/CrowdSourcedHashes/Query/AssetHashesBase.php +6 -0
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/CrowdSourcedHashes/Query/RequestVO.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/CrowdSourcedHashes/Submit/RequestVO.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Hashes/ApiInfo.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Hashes/Plugin.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Hashes/PluginThemeBase.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Hashes/RequestVO.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Hashes/Theme.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Hashes/WordPress.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Malware/Confidence/RequestVO.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Malware/Confidence/Retrieve.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Malware/Patterns/Retrieve.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Malware/Signatures/ReportFalsePositive.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Malware/Signatures/RequestVO.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Malware/Whitelist/ReportFalsePositive.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Malware/Whitelist/RequestVO.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Services/IPs.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Services/RequestVO.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Token/RequestVO.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Token/Solicit.php +5 -9
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Util/Diff.php +6 -10
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Util/RequestVO.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Verify/Email.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Verify/RequestVO.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Vulnerabilities/BasePluginTheme.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Vulnerabilities/Plugin.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Vulnerabilities/RequestVO.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Vulnerabilities/Theme.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Vulnerabilities/WordPress.php +0 -4
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Net/IpIdentify.php +0 -2
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/PluginUserMeta.php +0 -1
- src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/WpOrg/Base/PluginThemeFilesBase.php +0 -4
- src/wizards/base.php +0 -4
- src/wizards/base_wpsf.php +0 -3
- src/wizards/login_protect.php +0 -3
- src/wizards/plugin.php +14 -17
- templates/twig/components/search/dialog.twig +1 -5
- templates/twig/components/search/options.twig +2 -4
- templates/twig/notices/email-verification-sent.twig +33 -33
- templates/twig/wpadmin_pages/insights/ips/ip_analyse/index.twig +1 -1
- templates/twig/wpadmin_pages/insights/ips/ip_analyse/ip_traffic.twig +11 -12
- templates/twig/wpadmin_pages/insights/license/license.twig +2 -2
cl.json
CHANGED
@@ -23,13 +23,16 @@
|
|
23 |
"pro_only": true,
|
24 |
"title": "REST API Routes",
|
25 |
"description": [
|
26 |
-
"New REST API endpoints let you
|
27 |
-
|
28 |
-
|
29 |
-
"
|
30 |
-
"
|
31 |
-
"
|
32 |
-
|
|
|
|
|
|
|
33 |
},
|
34 |
{
|
35 |
"type": "new",
|
@@ -63,14 +66,6 @@
|
|
63 |
"Audit Trail and Traffic Log tables are usually huge and loading them were slow. They're now entirely AJAX based and fast-loading."
|
64 |
]
|
65 |
},
|
66 |
-
{
|
67 |
-
"type": "improved",
|
68 |
-
"pro_only": false,
|
69 |
-
"title": "IP Record Management Error",
|
70 |
-
"description": [
|
71 |
-
"When inserting a duplicate IP address record into the database, we use INSERT IGNORE to reduce error messages in logs."
|
72 |
-
]
|
73 |
-
},
|
74 |
{
|
75 |
"type": "improved",
|
76 |
"pro_only": false,
|
@@ -102,6 +97,15 @@
|
|
102 |
"description": [
|
103 |
]
|
104 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
{
|
106 |
"type": "fixed",
|
107 |
"pro_only": false,
|
@@ -111,6 +115,20 @@
|
|
111 |
}
|
112 |
],
|
113 |
"patches": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
]
|
115 |
},
|
116 |
"14.0": {
|
23 |
"pro_only": true,
|
24 |
"title": "REST API Routes",
|
25 |
"description": [
|
26 |
+
"New REST API endpoints let you manage many areas of the Shield Security plugin."
|
27 |
+
],
|
28 |
+
"list": [
|
29 |
+
"get/set any single option, or group of options",
|
30 |
+
"get scan results & status, and start new scans and check their status",
|
31 |
+
"add/remove IP addresses to/from any list (block or bypass)",
|
32 |
+
"check for, and remove, ShieldPRO license",
|
33 |
+
"run Debug to get general site information summary for debug purposes"
|
34 |
+
],
|
35 |
+
"href": "https://shsec.io/shieldrestapidocs"
|
36 |
},
|
37 |
{
|
38 |
"type": "new",
|
66 |
"Audit Trail and Traffic Log tables are usually huge and loading them were slow. They're now entirely AJAX based and fast-loading."
|
67 |
]
|
68 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
{
|
70 |
"type": "improved",
|
71 |
"pro_only": false,
|
97 |
"description": [
|
98 |
]
|
99 |
},
|
100 |
+
{
|
101 |
+
"title": "Deprecated: Options For CAPTCHA and GASP Bot Checking On WordPress Comments",
|
102 |
+
"description": [
|
103 |
+
"The options to use CAPTCHA and/or GASP Bot Checking for WordPress Comment SPAM has been deprecated.",
|
104 |
+
"These options are replaced with the AntiBot Detection Engine and will be completely removed in a future release."
|
105 |
+
],
|
106 |
+
"type": "changed",
|
107 |
+
"pro_only": false
|
108 |
+
},
|
109 |
{
|
110 |
"type": "fixed",
|
111 |
"pro_only": false,
|
115 |
}
|
116 |
],
|
117 |
"patches": [
|
118 |
+
{
|
119 |
+
"version": "1",
|
120 |
+
"released_at": 1647849231,
|
121 |
+
"items": [
|
122 |
+
{
|
123 |
+
"title": "Fix for 'find as you type' in the options search dialog.",
|
124 |
+
"type": "fixed"
|
125 |
+
},
|
126 |
+
{
|
127 |
+
"title": "PHP Warning.",
|
128 |
+
"type": "fixed"
|
129 |
+
}
|
130 |
+
]
|
131 |
+
}
|
132 |
]
|
133 |
},
|
134 |
"14.0": {
|
config/admin_access_restriction.json
CHANGED
@@ -160,7 +160,7 @@
|
|
160 |
"type": "checkbox",
|
161 |
"link_info": "https://shsec.io/i1",
|
162 |
"link_blog": "https://shsec.io/i2",
|
163 |
-
"beacon_id":
|
164 |
"name": "Run In MU Mode",
|
165 |
"summary": "Run Plugin In Must-Use (MU) Mode",
|
166 |
"description": "Setup the plugin to run as an MU-plugin to prevent accidental deactivation."
|
160 |
"type": "checkbox",
|
161 |
"link_info": "https://shsec.io/i1",
|
162 |
"link_blog": "https://shsec.io/i2",
|
163 |
+
"beacon_id": 460,
|
164 |
"name": "Run In MU Mode",
|
165 |
"summary": "Run Plugin In Must-Use (MU) Mode",
|
166 |
"description": "Setup the plugin to run as an MU-plugin to prevent accidental deactivation."
|
config/comments_filter.json
CHANGED
@@ -79,6 +79,14 @@
|
|
79 |
"Recommendation - Keep the Comments Filter feature turned on."
|
80 |
]
|
81 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
{
|
83 |
"slug": "section_non_ui",
|
84 |
"hidden": true
|
@@ -131,16 +139,16 @@
|
|
131 |
"description": "Shield doesn't normally scan comments from logged-in or registered users. Specify user roles here that shouldn't be scanned."
|
132 |
},
|
133 |
{
|
134 |
-
"key": "
|
135 |
"section": "section_bot_comment_spam_protection_filter",
|
136 |
"default": "N",
|
137 |
"type": "checkbox",
|
138 |
"link_info": "https://shsec.io/k1",
|
139 |
"link_blog": "https://shsec.io/jo",
|
140 |
"beacon_id": 427,
|
141 |
-
"name": "AntiBot Detection
|
142 |
-
"summary": "Use
|
143 |
-
"description": "Use Shield's AntiBot Detection Engine
|
144 |
},
|
145 |
{
|
146 |
"key": "comments_default_action_spam_bot",
|
@@ -174,7 +182,7 @@
|
|
174 |
},
|
175 |
{
|
176 |
"key": "google_recaptcha_style_comments",
|
177 |
-
"section": "
|
178 |
"default": "disabled",
|
179 |
"type": "select",
|
180 |
"value_options": [
|
@@ -208,7 +216,7 @@
|
|
208 |
},
|
209 |
{
|
210 |
"key": "enable_comments_gasp_protection",
|
211 |
-
"section": "
|
212 |
"default": "N",
|
213 |
"type": "checkbox",
|
214 |
"link_info": "https://shsec.io/3n",
|
@@ -259,7 +267,7 @@
|
|
259 |
},
|
260 |
{
|
261 |
"key": "custom_message_checkbox",
|
262 |
-
"section": "
|
263 |
"sensitive": true,
|
264 |
"default": "default",
|
265 |
"type": "text",
|
@@ -272,7 +280,7 @@
|
|
272 |
},
|
273 |
{
|
274 |
"key": "custom_message_alert",
|
275 |
-
"section": "
|
276 |
"sensitive": true,
|
277 |
"default": "default",
|
278 |
"type": "text",
|
@@ -285,7 +293,7 @@
|
|
285 |
},
|
286 |
{
|
287 |
"key": "custom_message_comment_wait",
|
288 |
-
"section": "
|
289 |
"sensitive": true,
|
290 |
"default": "default",
|
291 |
"type": "text",
|
@@ -298,7 +306,7 @@
|
|
298 |
},
|
299 |
{
|
300 |
"key": "custom_message_comment_reload",
|
301 |
-
"section": "
|
302 |
"sensitive": true,
|
303 |
"default": "default",
|
304 |
"type": "text",
|
@@ -328,6 +336,12 @@
|
|
328 |
"ip_address",
|
329 |
"user_agent"
|
330 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
}
|
332 |
],
|
333 |
"definitions": {
|
79 |
"Recommendation - Keep the Comments Filter feature turned on."
|
80 |
]
|
81 |
},
|
82 |
+
{
|
83 |
+
"slug": "section_deprecated",
|
84 |
+
"title": "Deprecated Options",
|
85 |
+
"title_short": "Deprecated Options",
|
86 |
+
"summary": [
|
87 |
+
"These options will be removed in the future. Please use the ADE option under Bot SPAM section."
|
88 |
+
]
|
89 |
+
},
|
90 |
{
|
91 |
"slug": "section_non_ui",
|
92 |
"hidden": true
|
139 |
"description": "Shield doesn't normally scan comments from logged-in or registered users. Specify user roles here that shouldn't be scanned."
|
140 |
},
|
141 |
{
|
142 |
+
"key": "enable_antibot_comments",
|
143 |
"section": "section_bot_comment_spam_protection_filter",
|
144 |
"default": "N",
|
145 |
"type": "checkbox",
|
146 |
"link_info": "https://shsec.io/k1",
|
147 |
"link_blog": "https://shsec.io/jo",
|
148 |
"beacon_id": 427,
|
149 |
+
"name": "AntiBot Detection Technology",
|
150 |
+
"summary": "Use Shield's Unique AntiBot Detection Technology",
|
151 |
+
"description": "Use Shield's AntiBot Detection Engine To Detect and Block SPAM Bots."
|
152 |
},
|
153 |
{
|
154 |
"key": "comments_default_action_spam_bot",
|
182 |
},
|
183 |
{
|
184 |
"key": "google_recaptcha_style_comments",
|
185 |
+
"section": "section_deprecated",
|
186 |
"default": "disabled",
|
187 |
"type": "select",
|
188 |
"value_options": [
|
216 |
},
|
217 |
{
|
218 |
"key": "enable_comments_gasp_protection",
|
219 |
+
"section": "section_deprecated",
|
220 |
"default": "N",
|
221 |
"type": "checkbox",
|
222 |
"link_info": "https://shsec.io/3n",
|
267 |
},
|
268 |
{
|
269 |
"key": "custom_message_checkbox",
|
270 |
+
"section": "section_deprecated",
|
271 |
"sensitive": true,
|
272 |
"default": "default",
|
273 |
"type": "text",
|
280 |
},
|
281 |
{
|
282 |
"key": "custom_message_alert",
|
283 |
+
"section": "section_deprecated",
|
284 |
"sensitive": true,
|
285 |
"default": "default",
|
286 |
"type": "text",
|
293 |
},
|
294 |
{
|
295 |
"key": "custom_message_comment_wait",
|
296 |
+
"section": "section_deprecated",
|
297 |
"sensitive": true,
|
298 |
"default": "default",
|
299 |
"type": "text",
|
306 |
},
|
307 |
{
|
308 |
"key": "custom_message_comment_reload",
|
309 |
+
"section": "section_deprecated",
|
310 |
"sensitive": true,
|
311 |
"default": "default",
|
312 |
"type": "text",
|
336 |
"ip_address",
|
337 |
"user_agent"
|
338 |
]
|
339 |
+
},
|
340 |
+
{
|
341 |
+
"key": "enable_antibot_check",
|
342 |
+
"section": "section_non_ui",
|
343 |
+
"type": "checkbox",
|
344 |
+
"default": ""
|
345 |
}
|
346 |
],
|
347 |
"definitions": {
|
config/data.json
CHANGED
@@ -47,52 +47,57 @@
|
|
47 |
}
|
48 |
},
|
49 |
"db_table_req_logs": {
|
50 |
-
"slug":
|
51 |
-
"autoexpire":
|
52 |
-
"has_updated_at":
|
53 |
-
"has_deleted_at":
|
54 |
-
"cols_custom":
|
55 |
-
"req_id":
|
56 |
"macro_type": "varchar",
|
57 |
"length": 10,
|
58 |
"attr": [
|
59 |
"UNIQUE"
|
60 |
]
|
61 |
},
|
62 |
-
"ip_ref":
|
63 |
"macro_type": "foreign_key_id",
|
64 |
"foreign_key": {
|
65 |
"ref_table": "icwp_wpsf_ips"
|
66 |
}
|
67 |
},
|
68 |
-
"type":
|
69 |
-
"macro_type": "
|
70 |
-
"length":
|
71 |
-
"comment": "Type of
|
72 |
},
|
73 |
-
"verb":
|
74 |
"macro_type": "varchar",
|
75 |
"length": 8,
|
76 |
"comment": "Request Verb"
|
77 |
},
|
78 |
-
"path":
|
79 |
"macro_type": "varchar",
|
80 |
"length": 256,
|
81 |
"comment": "Request Path"
|
82 |
},
|
83 |
-
"code":
|
84 |
"macro_type": "unsigned_int",
|
85 |
"type": "smallint",
|
86 |
"length": 3,
|
87 |
"default": 0,
|
88 |
"comment": "Response Code"
|
89 |
},
|
90 |
-
"
|
|
|
|
|
|
|
|
|
|
|
91 |
"macro_type": "bool",
|
92 |
"default": 0,
|
93 |
"comment": "Was Offense"
|
94 |
},
|
95 |
-
"meta":
|
96 |
"macro_type": "meta"
|
97 |
}
|
98 |
}
|
47 |
}
|
48 |
},
|
49 |
"db_table_req_logs": {
|
50 |
+
"slug": "req_logs",
|
51 |
+
"autoexpire": 0,
|
52 |
+
"has_updated_at": false,
|
53 |
+
"has_deleted_at": false,
|
54 |
+
"cols_custom": {
|
55 |
+
"req_id": {
|
56 |
"macro_type": "varchar",
|
57 |
"length": 10,
|
58 |
"attr": [
|
59 |
"UNIQUE"
|
60 |
]
|
61 |
},
|
62 |
+
"ip_ref": {
|
63 |
"macro_type": "foreign_key_id",
|
64 |
"foreign_key": {
|
65 |
"ref_table": "icwp_wpsf_ips"
|
66 |
}
|
67 |
},
|
68 |
+
"type": {
|
69 |
+
"macro_type": "char",
|
70 |
+
"length": 1,
|
71 |
+
"comment": "Type of requests"
|
72 |
},
|
73 |
+
"verb": {
|
74 |
"macro_type": "varchar",
|
75 |
"length": 8,
|
76 |
"comment": "Request Verb"
|
77 |
},
|
78 |
+
"path": {
|
79 |
"macro_type": "varchar",
|
80 |
"length": 256,
|
81 |
"comment": "Request Path"
|
82 |
},
|
83 |
+
"code": {
|
84 |
"macro_type": "unsigned_int",
|
85 |
"type": "smallint",
|
86 |
"length": 3,
|
87 |
"default": 0,
|
88 |
"comment": "Response Code"
|
89 |
},
|
90 |
+
"uid": {
|
91 |
+
"macro_type": "bigint",
|
92 |
+
"comment": "User ID",
|
93 |
+
"no_length": true
|
94 |
+
},
|
95 |
+
"offense": {
|
96 |
"macro_type": "bool",
|
97 |
"default": 0,
|
98 |
"comment": "Was Offense"
|
99 |
},
|
100 |
+
"meta": {
|
101 |
"macro_type": "meta"
|
102 |
}
|
103 |
}
|
config/deprecated/admin_access_restriction.php
CHANGED
@@ -151,6 +151,20 @@
|
|
151 |
"summary": "Allow Email Override Of Admin Access Restrictions",
|
152 |
"description": "Allow the use of verification emails to override and switch off the Security Admin restrictions."
|
153 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
{
|
155 |
"key": "admin_access_restrict_options",
|
156 |
"section": "section_admin_access_restriction_areas",
|
151 |
"summary": "Allow Email Override Of Admin Access Restrictions",
|
152 |
"description": "Allow the use of verification emails to override and switch off the Security Admin restrictions."
|
153 |
},
|
154 |
+
{
|
155 |
+
"key": "enable_mu",
|
156 |
+
"section": "section_security_admin_settings",
|
157 |
+
"advanced": true,
|
158 |
+
"premium": true,
|
159 |
+
"default": "N",
|
160 |
+
"type": "checkbox",
|
161 |
+
"link_info": "https://shsec.io/i1",
|
162 |
+
"link_blog": "https://shsec.io/i2",
|
163 |
+
"beacon_id": 460,
|
164 |
+
"name": "Run In MU Mode",
|
165 |
+
"summary": "Run Plugin In Must-Use (MU) Mode",
|
166 |
+
"description": "Setup the plugin to run as an MU-plugin to prevent accidental deactivation."
|
167 |
+
},
|
168 |
{
|
169 |
"key": "admin_access_restrict_options",
|
170 |
"section": "section_admin_access_restriction_areas",
|
config/deprecated/audit_trail.php
CHANGED
@@ -250,27 +250,34 @@
|
|
250 |
},
|
251 |
"max_free_days": 7,
|
252 |
"events": {
|
253 |
-
"plugin_activated":
|
254 |
"audit_params": [
|
255 |
"plugin"
|
256 |
],
|
257 |
"level": "notice",
|
258 |
"audit_multiple": true
|
259 |
},
|
260 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
"audit_params": [
|
262 |
"plugin"
|
263 |
],
|
264 |
"level": "notice",
|
265 |
"audit_multiple": true
|
266 |
},
|
267 |
-
"plugin_file_edited":
|
268 |
"audit_params": [
|
269 |
"file"
|
270 |
],
|
271 |
"level": "warning"
|
272 |
},
|
273 |
-
"plugin_upgraded":
|
274 |
"audit_params": [
|
275 |
"plugin",
|
276 |
"from",
|
@@ -279,19 +286,26 @@
|
|
279 |
"level": "notice",
|
280 |
"audit_multiple": true
|
281 |
},
|
282 |
-
"theme_activated":
|
283 |
"audit_params": [
|
284 |
"theme"
|
285 |
],
|
286 |
"level": "notice"
|
287 |
},
|
288 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
"audit_params": [
|
290 |
"file"
|
291 |
],
|
292 |
"level": "warning"
|
293 |
},
|
294 |
-
"theme_upgraded":
|
295 |
"audit_params": [
|
296 |
"theme",
|
297 |
"from",
|
@@ -300,28 +314,28 @@
|
|
300 |
"level": "notice",
|
301 |
"audit_multiple": true
|
302 |
},
|
303 |
-
"core_updated":
|
304 |
"audit_params": [
|
305 |
"from",
|
306 |
"to"
|
307 |
],
|
308 |
"level": "notice"
|
309 |
},
|
310 |
-
"permalinks_structure":
|
311 |
"audit_params": [
|
312 |
"from",
|
313 |
"to"
|
314 |
],
|
315 |
"level": "warning"
|
316 |
},
|
317 |
-
"post_deleted":
|
318 |
"audit_params": [
|
319 |
"title"
|
320 |
],
|
321 |
"level": "warning",
|
322 |
"audit_multiple": true
|
323 |
},
|
324 |
-
"post_trashed":
|
325 |
"audit_params": [
|
326 |
"title",
|
327 |
"type"
|
@@ -329,7 +343,7 @@
|
|
329 |
"level": "warning",
|
330 |
"audit_multiple": true
|
331 |
},
|
332 |
-
"post_recovered":
|
333 |
"audit_params": [
|
334 |
"title",
|
335 |
"type"
|
@@ -337,7 +351,7 @@
|
|
337 |
"level": "info",
|
338 |
"audit_multiple": true
|
339 |
},
|
340 |
-
"post_updated":
|
341 |
"audit_params": [
|
342 |
"title",
|
343 |
"type"
|
@@ -345,7 +359,7 @@
|
|
345 |
"level": "notice",
|
346 |
"audit_multiple": true
|
347 |
},
|
348 |
-
"post_published":
|
349 |
"audit_params": [
|
350 |
"title",
|
351 |
"type"
|
@@ -353,7 +367,7 @@
|
|
353 |
"level": "notice",
|
354 |
"audit_multiple": true
|
355 |
},
|
356 |
-
"post_unpublished":
|
357 |
"audit_params": [
|
358 |
"title",
|
359 |
"type"
|
@@ -361,26 +375,26 @@
|
|
361 |
"level": "warning",
|
362 |
"audit_multiple": true
|
363 |
},
|
364 |
-
"user_login":
|
365 |
"audit_params": [
|
366 |
"user_login"
|
367 |
],
|
368 |
"level": "warning"
|
369 |
},
|
370 |
-
"user_login_app":
|
371 |
"audit_params": [
|
372 |
"user_login"
|
373 |
],
|
374 |
"level": "warning"
|
375 |
},
|
376 |
-
"user_registered":
|
377 |
"audit_params": [
|
378 |
"user_login",
|
379 |
"email"
|
380 |
],
|
381 |
"level": "alert"
|
382 |
},
|
383 |
-
"user_deleted":
|
384 |
"audit_params": [
|
385 |
"user_login",
|
386 |
"email"
|
@@ -388,13 +402,39 @@
|
|
388 |
"level": "warning",
|
389 |
"audit_multiple": true
|
390 |
},
|
391 |
-
"user_deleted_reassigned":
|
|
|
|
|
|
|
|
|
|
|
|
|
392 |
"audit_params": [
|
393 |
"user_login"
|
394 |
],
|
395 |
"level": "notice"
|
396 |
},
|
397 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
398 |
"audit_params": [
|
399 |
"to",
|
400 |
"subject",
|
250 |
},
|
251 |
"max_free_days": 7,
|
252 |
"events": {
|
253 |
+
"plugin_activated": {
|
254 |
"audit_params": [
|
255 |
"plugin"
|
256 |
],
|
257 |
"level": "notice",
|
258 |
"audit_multiple": true
|
259 |
},
|
260 |
+
"plugin_installed": {
|
261 |
+
"audit_params": [
|
262 |
+
"plugin"
|
263 |
+
],
|
264 |
+
"level": "warning",
|
265 |
+
"audit_multiple": true
|
266 |
+
},
|
267 |
+
"plugin_deactivated": {
|
268 |
"audit_params": [
|
269 |
"plugin"
|
270 |
],
|
271 |
"level": "notice",
|
272 |
"audit_multiple": true
|
273 |
},
|
274 |
+
"plugin_file_edited": {
|
275 |
"audit_params": [
|
276 |
"file"
|
277 |
],
|
278 |
"level": "warning"
|
279 |
},
|
280 |
+
"plugin_upgraded": {
|
281 |
"audit_params": [
|
282 |
"plugin",
|
283 |
"from",
|
286 |
"level": "notice",
|
287 |
"audit_multiple": true
|
288 |
},
|
289 |
+
"theme_activated": {
|
290 |
"audit_params": [
|
291 |
"theme"
|
292 |
],
|
293 |
"level": "notice"
|
294 |
},
|
295 |
+
"theme_installed": {
|
296 |
+
"audit_params": [
|
297 |
+
"theme"
|
298 |
+
],
|
299 |
+
"level": "warning",
|
300 |
+
"audit_multiple": true
|
301 |
+
},
|
302 |
+
"theme_file_edited": {
|
303 |
"audit_params": [
|
304 |
"file"
|
305 |
],
|
306 |
"level": "warning"
|
307 |
},
|
308 |
+
"theme_upgraded": {
|
309 |
"audit_params": [
|
310 |
"theme",
|
311 |
"from",
|
314 |
"level": "notice",
|
315 |
"audit_multiple": true
|
316 |
},
|
317 |
+
"core_updated": {
|
318 |
"audit_params": [
|
319 |
"from",
|
320 |
"to"
|
321 |
],
|
322 |
"level": "notice"
|
323 |
},
|
324 |
+
"permalinks_structure": {
|
325 |
"audit_params": [
|
326 |
"from",
|
327 |
"to"
|
328 |
],
|
329 |
"level": "warning"
|
330 |
},
|
331 |
+
"post_deleted": {
|
332 |
"audit_params": [
|
333 |
"title"
|
334 |
],
|
335 |
"level": "warning",
|
336 |
"audit_multiple": true
|
337 |
},
|
338 |
+
"post_trashed": {
|
339 |
"audit_params": [
|
340 |
"title",
|
341 |
"type"
|
343 |
"level": "warning",
|
344 |
"audit_multiple": true
|
345 |
},
|
346 |
+
"post_recovered": {
|
347 |
"audit_params": [
|
348 |
"title",
|
349 |
"type"
|
351 |
"level": "info",
|
352 |
"audit_multiple": true
|
353 |
},
|
354 |
+
"post_updated": {
|
355 |
"audit_params": [
|
356 |
"title",
|
357 |
"type"
|
359 |
"level": "notice",
|
360 |
"audit_multiple": true
|
361 |
},
|
362 |
+
"post_published": {
|
363 |
"audit_params": [
|
364 |
"title",
|
365 |
"type"
|
367 |
"level": "notice",
|
368 |
"audit_multiple": true
|
369 |
},
|
370 |
+
"post_unpublished": {
|
371 |
"audit_params": [
|
372 |
"title",
|
373 |
"type"
|
375 |
"level": "warning",
|
376 |
"audit_multiple": true
|
377 |
},
|
378 |
+
"user_login": {
|
379 |
"audit_params": [
|
380 |
"user_login"
|
381 |
],
|
382 |
"level": "warning"
|
383 |
},
|
384 |
+
"user_login_app": {
|
385 |
"audit_params": [
|
386 |
"user_login"
|
387 |
],
|
388 |
"level": "warning"
|
389 |
},
|
390 |
+
"user_registered": {
|
391 |
"audit_params": [
|
392 |
"user_login",
|
393 |
"email"
|
394 |
],
|
395 |
"level": "alert"
|
396 |
},
|
397 |
+
"user_deleted": {
|
398 |
"audit_params": [
|
399 |
"user_login",
|
400 |
"email"
|
402 |
"level": "warning",
|
403 |
"audit_multiple": true
|
404 |
},
|
405 |
+
"user_deleted_reassigned": {
|
406 |
+
"audit_params": [
|
407 |
+
"user_login"
|
408 |
+
],
|
409 |
+
"level": "notice"
|
410 |
+
},
|
411 |
+
"app_pass_success": {
|
412 |
"audit_params": [
|
413 |
"user_login"
|
414 |
],
|
415 |
"level": "notice"
|
416 |
},
|
417 |
+
"app_invalid_email": {
|
418 |
+
"level": "warning",
|
419 |
+
"offense": true
|
420 |
+
},
|
421 |
+
"app_invalid_username": {
|
422 |
+
"level": "warning",
|
423 |
+
"offense": true
|
424 |
+
},
|
425 |
+
"app_incorrect_password": {
|
426 |
+
"level": "warning",
|
427 |
+
"offense": true
|
428 |
+
},
|
429 |
+
"app_passwords_disabled": {
|
430 |
+
"level": "warning",
|
431 |
+
"offense": true
|
432 |
+
},
|
433 |
+
"app_passwords_disabled_user": {
|
434 |
+
"level": "warning",
|
435 |
+
"offense": true
|
436 |
+
},
|
437 |
+
"email_attempt_send": {
|
438 |
"audit_params": [
|
439 |
"to",
|
440 |
"subject",
|
config/deprecated/comments_filter.php
CHANGED
@@ -79,6 +79,14 @@
|
|
79 |
"Recommendation - Keep the Comments Filter feature turned on."
|
80 |
]
|
81 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
{
|
83 |
"slug": "section_non_ui",
|
84 |
"hidden": true
|
@@ -131,16 +139,16 @@
|
|
131 |
"description": "Shield doesn't normally scan comments from logged-in or registered users. Specify user roles here that shouldn't be scanned."
|
132 |
},
|
133 |
{
|
134 |
-
"key": "
|
135 |
"section": "section_bot_comment_spam_protection_filter",
|
136 |
"default": "N",
|
137 |
"type": "checkbox",
|
138 |
"link_info": "https://shsec.io/k1",
|
139 |
"link_blog": "https://shsec.io/jo",
|
140 |
"beacon_id": 427,
|
141 |
-
"name": "AntiBot Detection
|
142 |
-
"summary": "Use
|
143 |
-
"description": "Use Shield's AntiBot Detection Engine
|
144 |
},
|
145 |
{
|
146 |
"key": "comments_default_action_spam_bot",
|
@@ -174,7 +182,7 @@
|
|
174 |
},
|
175 |
{
|
176 |
"key": "google_recaptcha_style_comments",
|
177 |
-
"section": "
|
178 |
"default": "disabled",
|
179 |
"type": "select",
|
180 |
"value_options": [
|
@@ -208,7 +216,7 @@
|
|
208 |
},
|
209 |
{
|
210 |
"key": "enable_comments_gasp_protection",
|
211 |
-
"section": "
|
212 |
"default": "N",
|
213 |
"type": "checkbox",
|
214 |
"link_info": "https://shsec.io/3n",
|
@@ -259,7 +267,7 @@
|
|
259 |
},
|
260 |
{
|
261 |
"key": "custom_message_checkbox",
|
262 |
-
"section": "
|
263 |
"sensitive": true,
|
264 |
"default": "default",
|
265 |
"type": "text",
|
@@ -272,7 +280,7 @@
|
|
272 |
},
|
273 |
{
|
274 |
"key": "custom_message_alert",
|
275 |
-
"section": "
|
276 |
"sensitive": true,
|
277 |
"default": "default",
|
278 |
"type": "text",
|
@@ -285,7 +293,7 @@
|
|
285 |
},
|
286 |
{
|
287 |
"key": "custom_message_comment_wait",
|
288 |
-
"section": "
|
289 |
"sensitive": true,
|
290 |
"default": "default",
|
291 |
"type": "text",
|
@@ -298,7 +306,7 @@
|
|
298 |
},
|
299 |
{
|
300 |
"key": "custom_message_comment_reload",
|
301 |
-
"section": "
|
302 |
"sensitive": true,
|
303 |
"default": "default",
|
304 |
"type": "text",
|
@@ -328,6 +336,12 @@
|
|
328 |
"ip_address",
|
329 |
"user_agent"
|
330 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
}
|
332 |
],
|
333 |
"definitions": {
|
79 |
"Recommendation - Keep the Comments Filter feature turned on."
|
80 |
]
|
81 |
},
|
82 |
+
{
|
83 |
+
"slug": "section_deprecated",
|
84 |
+
"title": "Deprecated Options",
|
85 |
+
"title_short": "Deprecated Options",
|
86 |
+
"summary": [
|
87 |
+
"These options will be removed in the future. Please use the ADE option under Bot SPAM section."
|
88 |
+
]
|
89 |
+
},
|
90 |
{
|
91 |
"slug": "section_non_ui",
|
92 |
"hidden": true
|
139 |
"description": "Shield doesn't normally scan comments from logged-in or registered users. Specify user roles here that shouldn't be scanned."
|
140 |
},
|
141 |
{
|
142 |
+
"key": "enable_antibot_comments",
|
143 |
"section": "section_bot_comment_spam_protection_filter",
|
144 |
"default": "N",
|
145 |
"type": "checkbox",
|
146 |
"link_info": "https://shsec.io/k1",
|
147 |
"link_blog": "https://shsec.io/jo",
|
148 |
"beacon_id": 427,
|
149 |
+
"name": "AntiBot Detection Technology",
|
150 |
+
"summary": "Use Shield's Unique AntiBot Detection Technology",
|
151 |
+
"description": "Use Shield's AntiBot Detection Engine To Detect and Block SPAM Bots."
|
152 |
},
|
153 |
{
|
154 |
"key": "comments_default_action_spam_bot",
|
182 |
},
|
183 |
{
|
184 |
"key": "google_recaptcha_style_comments",
|
185 |
+
"section": "section_deprecated",
|
186 |
"default": "disabled",
|
187 |
"type": "select",
|
188 |
"value_options": [
|
216 |
},
|
217 |
{
|
218 |
"key": "enable_comments_gasp_protection",
|
219 |
+
"section": "section_deprecated",
|
220 |
"default": "N",
|
221 |
"type": "checkbox",
|
222 |
"link_info": "https://shsec.io/3n",
|
267 |
},
|
268 |
{
|
269 |
"key": "custom_message_checkbox",
|
270 |
+
"section": "section_deprecated",
|
271 |
"sensitive": true,
|
272 |
"default": "default",
|
273 |
"type": "text",
|
280 |
},
|
281 |
{
|
282 |
"key": "custom_message_alert",
|
283 |
+
"section": "section_deprecated",
|
284 |
"sensitive": true,
|
285 |
"default": "default",
|
286 |
"type": "text",
|
293 |
},
|
294 |
{
|
295 |
"key": "custom_message_comment_wait",
|
296 |
+
"section": "section_deprecated",
|
297 |
"sensitive": true,
|
298 |
"default": "default",
|
299 |
"type": "text",
|
306 |
},
|
307 |
{
|
308 |
"key": "custom_message_comment_reload",
|
309 |
+
"section": "section_deprecated",
|
310 |
"sensitive": true,
|
311 |
"default": "default",
|
312 |
"type": "text",
|
336 |
"ip_address",
|
337 |
"user_agent"
|
338 |
]
|
339 |
+
},
|
340 |
+
{
|
341 |
+
"key": "enable_antibot_check",
|
342 |
+
"section": "section_non_ui",
|
343 |
+
"type": "checkbox",
|
344 |
+
"default": ""
|
345 |
}
|
346 |
],
|
347 |
"definitions": {
|
config/deprecated/data.php
CHANGED
@@ -52,20 +52,52 @@
|
|
52 |
"has_updated_at": false,
|
53 |
"has_deleted_at": false,
|
54 |
"cols_custom": {
|
55 |
-
"req_id":
|
56 |
"macro_type": "varchar",
|
57 |
"length": 10,
|
58 |
"attr": [
|
59 |
"UNIQUE"
|
60 |
]
|
61 |
},
|
62 |
-
"ip_ref":
|
63 |
"macro_type": "foreign_key_id",
|
64 |
"foreign_key": {
|
65 |
"ref_table": "icwp_wpsf_ips"
|
66 |
}
|
67 |
},
|
68 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
"macro_type": "meta"
|
70 |
}
|
71 |
}
|
52 |
"has_updated_at": false,
|
53 |
"has_deleted_at": false,
|
54 |
"cols_custom": {
|
55 |
+
"req_id": {
|
56 |
"macro_type": "varchar",
|
57 |
"length": 10,
|
58 |
"attr": [
|
59 |
"UNIQUE"
|
60 |
]
|
61 |
},
|
62 |
+
"ip_ref": {
|
63 |
"macro_type": "foreign_key_id",
|
64 |
"foreign_key": {
|
65 |
"ref_table": "icwp_wpsf_ips"
|
66 |
}
|
67 |
},
|
68 |
+
"type": {
|
69 |
+
"macro_type": "char",
|
70 |
+
"length": 1,
|
71 |
+
"comment": "Type of requests"
|
72 |
+
},
|
73 |
+
"verb": {
|
74 |
+
"macro_type": "varchar",
|
75 |
+
"length": 8,
|
76 |
+
"comment": "Request Verb"
|
77 |
+
},
|
78 |
+
"path": {
|
79 |
+
"macro_type": "varchar",
|
80 |
+
"length": 256,
|
81 |
+
"comment": "Request Path"
|
82 |
+
},
|
83 |
+
"code": {
|
84 |
+
"macro_type": "unsigned_int",
|
85 |
+
"type": "smallint",
|
86 |
+
"length": 3,
|
87 |
+
"default": 0,
|
88 |
+
"comment": "Response Code"
|
89 |
+
},
|
90 |
+
"uid": {
|
91 |
+
"macro_type": "bigint",
|
92 |
+
"comment": "User ID",
|
93 |
+
"no_length": true
|
94 |
+
},
|
95 |
+
"offense": {
|
96 |
+
"macro_type": "bool",
|
97 |
+
"default": 0,
|
98 |
+
"comment": "Was Offense"
|
99 |
+
},
|
100 |
+
"meta": {
|
101 |
"macro_type": "meta"
|
102 |
}
|
103 |
}
|
config/deprecated/firewall.php
CHANGED
@@ -317,6 +317,7 @@
|
|
317 |
"yoast_wpseo_metadesc",
|
318 |
"icwp_wpsf_new_u2f_response",
|
319 |
"icwp_wpsf_u2f_otp",
|
|
|
320 |
"appId",
|
321 |
"/^et_.*/",
|
322 |
"ping_sites",
|
317 |
"yoast_wpseo_metadesc",
|
318 |
"icwp_wpsf_new_u2f_response",
|
319 |
"icwp_wpsf_u2f_otp",
|
320 |
+
"shield_action",
|
321 |
"appId",
|
322 |
"/^et_.*/",
|
323 |
"ping_sites",
|
config/deprecated/hack_protect.php
CHANGED
@@ -374,6 +374,18 @@
|
|
374 |
}
|
375 |
],
|
376 |
"definitions": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
"all_scan_slugs": [
|
378 |
"apc",
|
379 |
"wpv",
|
374 |
}
|
375 |
],
|
376 |
"definitions": {
|
377 |
+
"rest_api": {
|
378 |
+
"publish": true,
|
379 |
+
"pro_only": true,
|
380 |
+
"route_defs": {
|
381 |
+
"scan_status": {
|
382 |
+
},
|
383 |
+
"scan_start": {
|
384 |
+
},
|
385 |
+
"scan_results": {
|
386 |
+
}
|
387 |
+
}
|
388 |
+
},
|
389 |
"all_scan_slugs": [
|
390 |
"apc",
|
391 |
"wpv",
|
config/deprecated/ips.php
CHANGED
@@ -588,6 +588,20 @@
|
|
588 |
}
|
589 |
],
|
590 |
"definitions": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
591 |
"allowable_ext_404s": [
|
592 |
"js",
|
593 |
"css",
|
588 |
}
|
589 |
],
|
590 |
"definitions": {
|
591 |
+
"rest_api": {
|
592 |
+
"publish": true,
|
593 |
+
"pro_only": true,
|
594 |
+
"route_defs": {
|
595 |
+
"ips_get": {
|
596 |
+
},
|
597 |
+
"lists_get": {
|
598 |
+
},
|
599 |
+
"lists_getip": {
|
600 |
+
},
|
601 |
+
"lists_setip": {
|
602 |
+
}
|
603 |
+
}
|
604 |
+
},
|
605 |
"allowable_ext_404s": [
|
606 |
"js",
|
607 |
"css",
|
config/deprecated/license.php
CHANGED
@@ -143,6 +143,16 @@
|
|
143 |
}
|
144 |
],
|
145 |
"definitions": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
"keyless_cp": "https://shsec.io/c5",
|
147 |
"license_item_name": "Shield Security Pro",
|
148 |
"license_item_id": "6047",
|
143 |
}
|
144 |
],
|
145 |
"definitions": {
|
146 |
+
"rest_api": {
|
147 |
+
"publish": true,
|
148 |
+
"pro_only": false,
|
149 |
+
"route_defs": {
|
150 |
+
"license_check": {
|
151 |
+
},
|
152 |
+
"license_status": {
|
153 |
+
}
|
154 |
+
}
|
155 |
+
},
|
156 |
"keyless_cp": "https://shsec.io/c5",
|
157 |
"license_item_name": "Shield Security Pro",
|
158 |
"license_item_id": "6047",
|
config/deprecated/login_protect.php
CHANGED
@@ -313,8 +313,8 @@
|
|
313 |
"link_blog": "https://shsec.io/jo",
|
314 |
"beacon_id": 426,
|
315 |
"name": "AntiBot",
|
316 |
-
"summary": "Use
|
317 |
-
"description": "Use Shield's AntiBot Detection Engine
|
318 |
},
|
319 |
{
|
320 |
"key": "bot_protection_locations",
|
313 |
"link_blog": "https://shsec.io/jo",
|
314 |
"beacon_id": 426,
|
315 |
"name": "AntiBot",
|
316 |
+
"summary": "Use AntiBot Detection Engine",
|
317 |
+
"description": "Use Shield's AntiBot Detection Engine To Block Bots and Brute Force Attacks"
|
318 |
},
|
319 |
{
|
320 |
"key": "bot_protection_locations",
|
config/deprecated/plugin.php
CHANGED
@@ -541,6 +541,22 @@
|
|
541 |
}
|
542 |
],
|
543 |
"definitions": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
544 |
"href_privacy_policy": "https://shsec.io/wpshieldprivacypolicy",
|
545 |
"db_classes": {
|
546 |
"notes": "\\FernleafSystems\\Wordpress\\Plugin\\Shield\\Databases\\AdminNotes\\Handler"
|
541 |
}
|
542 |
],
|
543 |
"definitions": {
|
544 |
+
"rest_api": {
|
545 |
+
"publish": true,
|
546 |
+
"pro_only": true,
|
547 |
+
"route_defs": {
|
548 |
+
"debug_get": {
|
549 |
+
},
|
550 |
+
"option_get": {
|
551 |
+
},
|
552 |
+
"option_set": {
|
553 |
+
},
|
554 |
+
"options_get": {
|
555 |
+
},
|
556 |
+
"options_set": {
|
557 |
+
}
|
558 |
+
}
|
559 |
+
},
|
560 |
"href_privacy_policy": "https://shsec.io/wpshieldprivacypolicy",
|
561 |
"db_classes": {
|
562 |
"notes": "\\FernleafSystems\\Wordpress\\Plugin\\Shield\\Databases\\AdminNotes\\Handler"
|
config/firewall.json
CHANGED
@@ -317,6 +317,7 @@
|
|
317 |
"yoast_wpseo_metadesc",
|
318 |
"icwp_wpsf_new_u2f_response",
|
319 |
"icwp_wpsf_u2f_otp",
|
|
|
320 |
"appId",
|
321 |
"/^et_.*/",
|
322 |
"ping_sites",
|
317 |
"yoast_wpseo_metadesc",
|
318 |
"icwp_wpsf_new_u2f_response",
|
319 |
"icwp_wpsf_u2f_otp",
|
320 |
+
"shield_action",
|
321 |
"appId",
|
322 |
"/^et_.*/",
|
323 |
"ping_sites",
|
config/login_protect.json
CHANGED
@@ -313,8 +313,8 @@
|
|
313 |
"link_blog": "https://shsec.io/jo",
|
314 |
"beacon_id": 426,
|
315 |
"name": "AntiBot",
|
316 |
-
"summary": "Use
|
317 |
-
"description": "Use Shield's AntiBot Detection Engine
|
318 |
},
|
319 |
{
|
320 |
"key": "bot_protection_locations",
|
313 |
"link_blog": "https://shsec.io/jo",
|
314 |
"beacon_id": 426,
|
315 |
"name": "AntiBot",
|
316 |
+
"summary": "Use AntiBot Detection Engine",
|
317 |
+
"description": "Use Shield's AntiBot Detection Engine To Block Bots and Brute Force Attacks"
|
318 |
},
|
319 |
{
|
320 |
"key": "bot_protection_locations",
|
icwp-wpsf.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Shield Security
|
4 |
* Plugin URI: https://shsec.io/2f
|
5 |
* Description: Powerful, Easy-To-Use #1 Rated WordPress Security System
|
6 |
-
* Version: 14.1.
|
7 |
* Text Domain: wp-simple-firewall
|
8 |
* Domain Path: /languages
|
9 |
* Author: Shield Security
|
3 |
* Plugin Name: Shield Security
|
4 |
* Plugin URI: https://shsec.io/2f
|
5 |
* Description: Powerful, Easy-To-Use #1 Rated WordPress Security System
|
6 |
+
* Version: 14.1.1
|
7 |
* Text Domain: wp-simple-firewall
|
8 |
* Domain Path: /languages
|
9 |
* Author: Shield Security
|
plugin-spec.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
{
|
2 |
"properties": {
|
3 |
-
"version": "14.1.
|
4 |
-
"release_timestamp":
|
5 |
-
"build": "202203.
|
6 |
"slug_parent": "icwp",
|
7 |
"slug_plugin": "wpsf",
|
8 |
"human_name": "Shield Security",
|
@@ -74,7 +74,6 @@
|
|
74 |
"jquery/featherlight",
|
75 |
"jquery/fileDownload",
|
76 |
"shield/tours",
|
77 |
-
"bootstrap-select",
|
78 |
"shield/datatables",
|
79 |
"shield/traffic",
|
80 |
"shield/audit_trail",
|
@@ -96,14 +95,8 @@
|
|
96 |
"bootstrap"
|
97 |
]
|
98 |
},
|
99 |
-
"bootstrap-select": {
|
100 |
-
"url": "https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.18/css/bootstrap-select.min.css",
|
101 |
-
"deps": [
|
102 |
-
"bootstrap"
|
103 |
-
]
|
104 |
-
},
|
105 |
"select2": {
|
106 |
-
"url": "https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.
|
107 |
"deps": [
|
108 |
"plugin"
|
109 |
]
|
@@ -206,7 +199,7 @@
|
|
206 |
]
|
207 |
},
|
208 |
"select2": {
|
209 |
-
"url": "https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.
|
210 |
"deps": [
|
211 |
"plugin"
|
212 |
]
|
@@ -217,12 +210,6 @@
|
|
217 |
"bootstrap"
|
218 |
]
|
219 |
},
|
220 |
-
"bootstrap-select": {
|
221 |
-
"url": "https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.18/js/bootstrap-select.min.js",
|
222 |
-
"deps": [
|
223 |
-
"bootstrap"
|
224 |
-
]
|
225 |
-
},
|
226 |
"datatables": {
|
227 |
"url": "https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js",
|
228 |
"deps": [
|
@@ -467,7 +454,7 @@
|
|
467 |
}
|
468 |
],
|
469 |
"version_upgrades": [
|
470 |
-
"14.1.
|
471 |
"11.2.0",
|
472 |
"12.0.0",
|
473 |
"12.0.1",
|
1 |
{
|
2 |
"properties": {
|
3 |
+
"version": "14.1.1",
|
4 |
+
"release_timestamp": 1647849231,
|
5 |
+
"build": "202203.2101",
|
6 |
"slug_parent": "icwp",
|
7 |
"slug_plugin": "wpsf",
|
8 |
"human_name": "Shield Security",
|
74 |
"jquery/featherlight",
|
75 |
"jquery/fileDownload",
|
76 |
"shield/tours",
|
|
|
77 |
"shield/datatables",
|
78 |
"shield/traffic",
|
79 |
"shield/audit_trail",
|
95 |
"bootstrap"
|
96 |
]
|
97 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
"select2": {
|
99 |
+
"url": "https://cdnjs.cloudflare.com/ajax/libs/select2/4.1.0-rc.0/css/select2.min.css",
|
100 |
"deps": [
|
101 |
"plugin"
|
102 |
]
|
199 |
]
|
200 |
},
|
201 |
"select2": {
|
202 |
+
"url": "https://cdnjs.cloudflare.com/ajax/libs/select2/4.1.0-rc.0/js/select2.min.js",
|
203 |
"deps": [
|
204 |
"plugin"
|
205 |
]
|
210 |
"bootstrap"
|
211 |
]
|
212 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
"datatables": {
|
214 |
"url": "https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js",
|
215 |
"deps": [
|
454 |
}
|
455 |
],
|
456 |
"version_upgrades": [
|
457 |
+
"14.1.1",
|
458 |
"11.2.0",
|
459 |
"12.0.0",
|
460 |
"12.0.1",
|
plugin.json
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
{
|
2 |
"properties": {
|
3 |
-
"version": "14.1.
|
4 |
-
"release_timestamp":
|
5 |
-
"build": "202203.
|
6 |
"slug_parent": "icwp",
|
7 |
"slug_plugin": "wpsf",
|
8 |
"human_name": "Shield Security",
|
@@ -74,7 +74,6 @@
|
|
74 |
"jquery/featherlight",
|
75 |
"jquery/fileDownload",
|
76 |
"shield/tours",
|
77 |
-
"bootstrap-select",
|
78 |
"shield/datatables",
|
79 |
"shield/traffic",
|
80 |
"shield/audit_trail",
|
@@ -96,14 +95,8 @@
|
|
96 |
"bootstrap"
|
97 |
]
|
98 |
},
|
99 |
-
"bootstrap-select": {
|
100 |
-
"url": "https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.18/css/bootstrap-select.min.css",
|
101 |
-
"deps": [
|
102 |
-
"bootstrap"
|
103 |
-
]
|
104 |
-
},
|
105 |
"select2": {
|
106 |
-
"url": "https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.
|
107 |
"deps": [
|
108 |
"plugin"
|
109 |
]
|
@@ -206,7 +199,7 @@
|
|
206 |
]
|
207 |
},
|
208 |
"select2": {
|
209 |
-
"url": "https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.
|
210 |
"deps": [
|
211 |
"plugin"
|
212 |
]
|
@@ -217,12 +210,6 @@
|
|
217 |
"bootstrap"
|
218 |
]
|
219 |
},
|
220 |
-
"bootstrap-select": {
|
221 |
-
"url": "https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.18/js/bootstrap-select.min.js",
|
222 |
-
"deps": [
|
223 |
-
"bootstrap"
|
224 |
-
]
|
225 |
-
},
|
226 |
"datatables": {
|
227 |
"url": "https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js",
|
228 |
"deps": [
|
@@ -467,7 +454,7 @@
|
|
467 |
}
|
468 |
],
|
469 |
"version_upgrades": [
|
470 |
-
"14.1.
|
471 |
"11.2.0",
|
472 |
"12.0.0",
|
473 |
"12.0.1",
|
1 |
{
|
2 |
"properties": {
|
3 |
+
"version": "14.1.1",
|
4 |
+
"release_timestamp": 1647849231,
|
5 |
+
"build": "202203.2101",
|
6 |
"slug_parent": "icwp",
|
7 |
"slug_plugin": "wpsf",
|
8 |
"human_name": "Shield Security",
|
74 |
"jquery/featherlight",
|
75 |
"jquery/fileDownload",
|
76 |
"shield/tours",
|
|
|
77 |
"shield/datatables",
|
78 |
"shield/traffic",
|
79 |
"shield/audit_trail",
|
95 |
"bootstrap"
|
96 |
]
|
97 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
"select2": {
|
99 |
+
"url": "https://cdnjs.cloudflare.com/ajax/libs/select2/4.1.0-rc.0/css/select2.min.css",
|
100 |
"deps": [
|
101 |
"plugin"
|
102 |
]
|
199 |
]
|
200 |
},
|
201 |
"select2": {
|
202 |
+
"url": "https://cdnjs.cloudflare.com/ajax/libs/select2/4.1.0-rc.0/js/select2.min.js",
|
203 |
"deps": [
|
204 |
"plugin"
|
205 |
]
|
210 |
"bootstrap"
|
211 |
]
|
212 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
"datatables": {
|
214 |
"url": "https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js",
|
215 |
"deps": [
|
454 |
}
|
455 |
],
|
456 |
"version_upgrades": [
|
457 |
+
"14.1.1",
|
458 |
"11.2.0",
|
459 |
"12.0.0",
|
460 |
"12.0.1",
|
readme.txt
CHANGED
@@ -8,7 +8,7 @@ Requires at least: 3.7
|
|
8 |
Requires PHP: 7.0
|
9 |
Recommended PHP: 7.4
|
10 |
Tested up to: 5.9
|
11 |
-
Stable tag: 14.1.
|
12 |
|
13 |
No-Nonsense Security Hardening that protects WordPress against hackers, malicious bots, and spammers (no captchas!). Now with exclusive ShieldNET Technology.
|
14 |
|
8 |
Requires PHP: 7.0
|
9 |
Recommended PHP: 7.4
|
10 |
Tested up to: 5.9
|
11 |
+
Stable tag: 14.1.1
|
12 |
|
13 |
No-Nonsense Security Hardening that protects WordPress against hackers, malicious bots, and spammers (no captchas!). Now with exclusive ShieldNET Technology.
|
14 |
|
resources/js/plugin.js
CHANGED
@@ -369,11 +369,9 @@ jQuery( document ).ready( function () {
|
|
369 |
jQuery( '.select2picker.static' ).select2( {
|
370 |
width: 'resolve'
|
371 |
} );
|
372 |
-
jQuery( '
|
373 |
-
|
374 |
-
width: 'auto'
|
375 |
} );
|
376 |
-
|
377 |
jQuery( '#IpReviewSelect' ).select2( {
|
378 |
minimumInputLength: 2,
|
379 |
ajax: {
|
369 |
jQuery( '.select2picker.static' ).select2( {
|
370 |
width: 'resolve'
|
371 |
} );
|
372 |
+
jQuery( '#SearchDialog select' ).select2( {
|
373 |
+
dropdownParent: jQuery( "#SearchDialog" )
|
|
|
374 |
} );
|
|
|
375 |
jQuery( '#IpReviewSelect' ).select2( {
|
376 |
minimumInputLength: 2,
|
377 |
ajax: {
|
resources/js/shield/audit_trail.js
CHANGED
@@ -160,19 +160,6 @@
|
|
160 |
iCWP_WPSF_BodyOverlay.hide();
|
161 |
} );
|
162 |
},
|
163 |
-
deferRender: true,
|
164 |
-
select: {
|
165 |
-
style: 'multi'
|
166 |
-
},
|
167 |
-
dom: 'PBfrptip',
|
168 |
-
searchPanes: {
|
169 |
-
cascadePanes: false,
|
170 |
-
viewTotal: false,
|
171 |
-
viewCount: false,
|
172 |
-
initCollapsed: true
|
173 |
-
},
|
174 |
-
search: {
|
175 |
-
},
|
176 |
buttons: [
|
177 |
{
|
178 |
text: 'Reload',
|
@@ -183,8 +170,21 @@
|
|
183 |
}
|
184 |
}
|
185 |
],
|
|
|
|
|
186 |
language: {
|
187 |
-
emptyTable: "There are no items to display."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
}
|
189 |
}
|
190 |
) );
|
160 |
iCWP_WPSF_BodyOverlay.hide();
|
161 |
} );
|
162 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
buttons: [
|
164 |
{
|
165 |
text: 'Reload',
|
170 |
}
|
171 |
}
|
172 |
],
|
173 |
+
deferRender: true,
|
174 |
+
dom: 'PBfrptip',
|
175 |
language: {
|
176 |
+
emptyTable: "There are no items to display.",
|
177 |
+
zeroRecords: "No entries found - please consider adjusting your search filters."
|
178 |
+
},
|
179 |
+
search: {},
|
180 |
+
searchPanes: {
|
181 |
+
cascadePanes: false,
|
182 |
+
viewTotal: false,
|
183 |
+
viewCount: false,
|
184 |
+
initCollapsed: true
|
185 |
+
},
|
186 |
+
select: {
|
187 |
+
style: 'multi'
|
188 |
}
|
189 |
}
|
190 |
) );
|
resources/js/shield/ipanalyse.js
CHANGED
@@ -27,7 +27,7 @@ jQuery.fn.icwpWpsfIpAnalyse = function ( options ) {
|
|
27 |
|
28 |
jQuery( '#IpReviewContent' ).html( 'loading IP info ...' );
|
29 |
|
30 |
-
var aReqData = aOpts[ '
|
31 |
jQuery.post( ajaxurl, jQuery.extend( aReqData, params ),
|
32 |
function ( oResponse ) {
|
33 |
|
27 |
|
28 |
jQuery( '#IpReviewContent' ).html( 'loading IP info ...' );
|
29 |
|
30 |
+
var aReqData = aOpts[ 'ajax_ip_analyse_build' ];
|
31 |
jQuery.post( ajaxurl, jQuery.extend( aReqData, params ),
|
32 |
function ( oResponse ) {
|
33 |
|
resources/js/shield/userprofile.js
CHANGED
@@ -16,14 +16,14 @@ jQuery.fn.ShieldUserProfile = function ( options ) {
|
|
16 |
);
|
17 |
if ( $gaCode.val().length === 6 ) {
|
18 |
$gaCode.prop( 'disabled', 'disabled' );
|
19 |
-
shield_vars.ajax.
|
20 |
-
sendReq( shield_vars.ajax.
|
21 |
}
|
22 |
} );
|
23 |
}
|
24 |
|
25 |
jQuery( document ).on( 'click', '#shield_ga_remove', function ( evt ) {
|
26 |
-
sendReq( shield_vars.ajax.
|
27 |
} );
|
28 |
}
|
29 |
|
@@ -38,10 +38,10 @@ jQuery.fn.ShieldUserProfile = function ( options ) {
|
|
38 |
|
39 |
let initBackupcodes = function ( shield_vars ) {
|
40 |
jQuery( document ).on( 'click', '#IcwpWpsfGenBackupLoginCode', function ( evt ) {
|
41 |
-
sendReq( shield_vars.ajax.
|
42 |
} );
|
43 |
jQuery( document ).on( 'click', '#IcwpWpsfDelBackupLoginCode', function ( evt ) {
|
44 |
-
sendReq( shield_vars.ajax.
|
45 |
} );
|
46 |
};
|
47 |
|
@@ -50,7 +50,7 @@ jQuery.fn.ShieldUserProfile = function ( options ) {
|
|
50 |
jQuery( 'a.shield_sms_remove' ).on( 'click', function ( evt ) {
|
51 |
evt.preventDefault();
|
52 |
if ( confirm( shield_vars_userprofile.strings.are_you_sure ) ) {
|
53 |
-
sendReq( shield_vars.ajax.
|
54 |
}
|
55 |
return false;
|
56 |
} );
|
@@ -66,7 +66,7 @@ jQuery.fn.ShieldUserProfile = function ( options ) {
|
|
66 |
|
67 |
jQuery( document ).on( 'click', '#shield_mfasms_verify', function ( evt ) {
|
68 |
let $this = jQuery( this );
|
69 |
-
let reqAddParams = shield_vars.ajax.
|
70 |
|
71 |
let $countrySelect = jQuery( 'select#shield_mfasms_country' );
|
72 |
reqAddParams.sms_country = $countrySelect.val();
|
@@ -92,7 +92,7 @@ jQuery.fn.ShieldUserProfile = function ( options ) {
|
|
92 |
|
93 |
let verifyCode = prompt( response.data.message )
|
94 |
if ( verifyCode !== null ) {
|
95 |
-
let reqVerifyParams = shield_vars.ajax.
|
96 |
reqVerifyParams.sms_country = jQuery( 'select#shield_mfasms_country' ).val();
|
97 |
reqVerifyParams.sms_phone = jQuery( 'input[type=text]#shield_mfasms_phone' ).val();
|
98 |
reqVerifyParams.sms_code = verifyCode;
|
@@ -123,16 +123,16 @@ jQuery.fn.ShieldUserProfile = function ( options ) {
|
|
123 |
jQuery( document ).on( 'keydown', $yubiText, function ( evt ) {
|
124 |
if ( evt.key === 'Enter' || evt.keyCode === 13 ) {
|
125 |
evt.preventDefault();
|
126 |
-
shield_vars.ajax.
|
127 |
-
sendReq( shield_vars.ajax.
|
128 |
return false;
|
129 |
}
|
130 |
} );
|
131 |
|
132 |
jQuery( 'a.shield_yubi_remove' ).on( 'click', function ( evt ) {
|
133 |
evt.preventDefault();
|
134 |
-
shield_vars.ajax.
|
135 |
-
sendReq( shield_vars.ajax.
|
136 |
return false;
|
137 |
} );
|
138 |
};
|
@@ -142,8 +142,8 @@ jQuery.fn.ShieldUserProfile = function ( options ) {
|
|
142 |
jQuery( document ).on( 'change', $emailCheckbox, function ( evt ) {
|
143 |
if ( $emailStartState !== $emailCheckbox.is( ':checked' ) ) {
|
144 |
$emailCheckbox.prop( 'disabled', true );
|
145 |
-
shield_vars.ajax.
|
146 |
-
sendReq( shield_vars.ajax.
|
147 |
}
|
148 |
} );
|
149 |
}
|
@@ -170,8 +170,8 @@ jQuery.fn.ShieldUserProfile = function ( options ) {
|
|
170 |
u2fApi.register( shield_vars.reg_request, shield_vars.signs )
|
171 |
.then( function ( u2fResponse ) {
|
172 |
u2fResponse.label = label;
|
173 |
-
shield_vars.ajax.
|
174 |
-
sendReq( shield_vars.ajax.
|
175 |
} )
|
176 |
.catch( function ( response ) {
|
177 |
$oU2fStatus.text( shield_vars.strings.failed );
|
@@ -190,8 +190,8 @@ jQuery.fn.ShieldUserProfile = function ( options ) {
|
|
190 |
|
191 |
jQuery( 'a.icwpWpsf-U2FRemove' ).on( 'click', function ( evt ) {
|
192 |
evt.preventDefault();
|
193 |
-
shield_vars.ajax.
|
194 |
-
sendReq( shield_vars.ajax.
|
195 |
return false;
|
196 |
} );
|
197 |
};
|
16 |
);
|
17 |
if ( $gaCode.val().length === 6 ) {
|
18 |
$gaCode.prop( 'disabled', 'disabled' );
|
19 |
+
shield_vars.ajax.profile_ga_toggle.ga_otp = $gaCode.val();
|
20 |
+
sendReq( shield_vars.ajax.profile_ga_toggle );
|
21 |
}
|
22 |
} );
|
23 |
}
|
24 |
|
25 |
jQuery( document ).on( 'click', '#shield_ga_remove', function ( evt ) {
|
26 |
+
sendReq( shield_vars.ajax.profile_ga_toggle );
|
27 |
} );
|
28 |
}
|
29 |
|
38 |
|
39 |
let initBackupcodes = function ( shield_vars ) {
|
40 |
jQuery( document ).on( 'click', '#IcwpWpsfGenBackupLoginCode', function ( evt ) {
|
41 |
+
sendReq( shield_vars.ajax.profile_backup_codes_gen );
|
42 |
} );
|
43 |
jQuery( document ).on( 'click', '#IcwpWpsfDelBackupLoginCode', function ( evt ) {
|
44 |
+
sendReq( shield_vars.ajax.profile_backup_codes_del );
|
45 |
} );
|
46 |
};
|
47 |
|
50 |
jQuery( 'a.shield_sms_remove' ).on( 'click', function ( evt ) {
|
51 |
evt.preventDefault();
|
52 |
if ( confirm( shield_vars_userprofile.strings.are_you_sure ) ) {
|
53 |
+
sendReq( shield_vars.ajax.profile_sms2fa_remove );
|
54 |
}
|
55 |
return false;
|
56 |
} );
|
66 |
|
67 |
jQuery( document ).on( 'click', '#shield_mfasms_verify', function ( evt ) {
|
68 |
let $this = jQuery( this );
|
69 |
+
let reqAddParams = shield_vars.ajax.profile_sms2fa_add;
|
70 |
|
71 |
let $countrySelect = jQuery( 'select#shield_mfasms_country' );
|
72 |
reqAddParams.sms_country = $countrySelect.val();
|
92 |
|
93 |
let verifyCode = prompt( response.data.message )
|
94 |
if ( verifyCode !== null ) {
|
95 |
+
let reqVerifyParams = shield_vars.ajax.profile_sms2fa_verify;
|
96 |
reqVerifyParams.sms_country = jQuery( 'select#shield_mfasms_country' ).val();
|
97 |
reqVerifyParams.sms_phone = jQuery( 'input[type=text]#shield_mfasms_phone' ).val();
|
98 |
reqVerifyParams.sms_code = verifyCode;
|
123 |
jQuery( document ).on( 'keydown', $yubiText, function ( evt ) {
|
124 |
if ( evt.key === 'Enter' || evt.keyCode === 13 ) {
|
125 |
evt.preventDefault();
|
126 |
+
shield_vars.ajax.profile_yubikey_toggle.otp = $yubiText.val();
|
127 |
+
sendReq( shield_vars.ajax.profile_yubikey_toggle );
|
128 |
return false;
|
129 |
}
|
130 |
} );
|
131 |
|
132 |
jQuery( 'a.shield_yubi_remove' ).on( 'click', function ( evt ) {
|
133 |
evt.preventDefault();
|
134 |
+
shield_vars.ajax.profile_yubikey_toggle.otp = jQuery( evt.currentTarget ).data( 'yubikeyid' );
|
135 |
+
sendReq( shield_vars.ajax.profile_yubikey_toggle );
|
136 |
return false;
|
137 |
} );
|
138 |
};
|
142 |
jQuery( document ).on( 'change', $emailCheckbox, function ( evt ) {
|
143 |
if ( $emailStartState !== $emailCheckbox.is( ':checked' ) ) {
|
144 |
$emailCheckbox.prop( 'disabled', true );
|
145 |
+
shield_vars.ajax.profile_email2fa_toggle.direction = $emailCheckbox.is( ':checked' ) ? 'on' : 'off';
|
146 |
+
sendReq( shield_vars.ajax.profile_email2fa_toggle );
|
147 |
}
|
148 |
} );
|
149 |
}
|
170 |
u2fApi.register( shield_vars.reg_request, shield_vars.signs )
|
171 |
.then( function ( u2fResponse ) {
|
172 |
u2fResponse.label = label;
|
173 |
+
shield_vars.ajax.profile_u2f_add.icwp_wpsf_new_u2f_response = u2fResponse;
|
174 |
+
sendReq( shield_vars.ajax.profile_u2f_add );
|
175 |
} )
|
176 |
.catch( function ( response ) {
|
177 |
$oU2fStatus.text( shield_vars.strings.failed );
|
190 |
|
191 |
jQuery( 'a.icwpWpsf-U2FRemove' ).on( 'click', function ( evt ) {
|
192 |
evt.preventDefault();
|
193 |
+
shield_vars.ajax.profile_u2f_remove.u2fid = jQuery( evt.currentTarget ).data( 'u2fid' );
|
194 |
+
sendReq( shield_vars.ajax.profile_u2f_remove );
|
195 |
return false;
|
196 |
} );
|
197 |
};
|
src/lib/src/ChangeTrack/Snapshot/BuildComments.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class BuildComments
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot
|
10 |
-
*/
|
11 |
class BuildComments {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class BuildComments {
|
8 |
|
9 |
/**
|
src/lib/src/ChangeTrack/Snapshot/BuildMedia.php
CHANGED
@@ -2,10 +2,6 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class BuildMedia
|
7 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot
|
8 |
-
*/
|
9 |
class BuildMedia extends BuildPosts {
|
10 |
|
11 |
/**
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class BuildMedia extends BuildPosts {
|
6 |
|
7 |
/**
|
src/lib/src/ChangeTrack/Snapshot/BuildPages.php
CHANGED
@@ -2,10 +2,6 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class BuildPages
|
7 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot
|
8 |
-
*/
|
9 |
class BuildPages extends BuildPosts {
|
10 |
|
11 |
/**
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class BuildPages extends BuildPosts {
|
6 |
|
7 |
/**
|
src/lib/src/ChangeTrack/Snapshot/BuildPlugins.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class BuildPlugins
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot
|
10 |
-
*/
|
11 |
class BuildPlugins {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class BuildPlugins {
|
8 |
|
9 |
/**
|
src/lib/src/ChangeTrack/Snapshot/BuildPosts.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class BuildPosts
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot
|
10 |
-
*/
|
11 |
class BuildPosts {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class BuildPosts {
|
8 |
|
9 |
/**
|
src/lib/src/ChangeTrack/Snapshot/BuildThemes.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class BuildThemes
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot
|
10 |
-
*/
|
11 |
class BuildThemes {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class BuildThemes {
|
8 |
|
9 |
/**
|
src/lib/src/ChangeTrack/Snapshot/BuildUsers.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class BuildUsers
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot
|
10 |
-
*/
|
11 |
class BuildUsers {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class BuildUsers {
|
8 |
|
9 |
/**
|
src/lib/src/ChangeTrack/Snapshot/Collate.php
CHANGED
@@ -1,19 +1,13 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot;
|
4 |
|
5 |
-
use FernleafSystems\Wordpress\Services\Services;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Class Collate
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot
|
10 |
-
*/
|
11 |
class Collate {
|
12 |
|
13 |
/**
|
14 |
* @return array
|
15 |
*/
|
16 |
-
public function run() {
|
17 |
return [
|
18 |
'users' => ( new BuildUsers() )->run(),
|
19 |
'post' => ( new BuildPosts() )->run(),
|
1 |
+
<?php declare( strict_types=1 );
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\ChangeTrack\Snapshot;
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
class Collate {
|
6 |
|
7 |
/**
|
8 |
* @return array
|
9 |
*/
|
10 |
+
public function run() :array {
|
11 |
return [
|
12 |
'users' => ( new BuildUsers() )->run(),
|
13 |
'post' => ( new BuildPosts() )->run(),
|
src/lib/src/Controller/Ajax/Init.php
CHANGED
@@ -25,6 +25,7 @@ class Init {
|
|
25 |
}
|
26 |
|
27 |
private function ajaxAction( bool $forceDie = true ) {
|
|
|
28 |
$req = Services::Request();
|
29 |
$nonceAction = $req->request( 'exec' );
|
30 |
|
@@ -33,24 +34,22 @@ class Init {
|
|
33 |
check_ajax_referer( $nonceAction, 'exec_nonce',
|
34 |
$forceDie || !in_array( $nonceAction, $this->getAllowedNoPrivExecs() ) );
|
35 |
|
36 |
-
|
37 |
-
$
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
if ( is_array( $response ) && isset( $response[ 'success' ] ) ) {
|
44 |
-
$success = $response[ 'success' ];
|
45 |
}
|
46 |
else {
|
47 |
-
$success = false;
|
48 |
$response = [];
|
|
|
49 |
}
|
50 |
|
51 |
( new Response() )->issue(
|
52 |
[
|
53 |
-
'success' => $success,
|
54 |
'data' => $response,
|
55 |
'noise' => $noise
|
56 |
],
|
@@ -58,6 +57,26 @@ class Init {
|
|
58 |
);
|
59 |
}
|
60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
private function getAllowedNoPrivExecs() :array {
|
62 |
return [];
|
63 |
}
|
25 |
}
|
26 |
|
27 |
private function ajaxAction( bool $forceDie = true ) {
|
28 |
+
$con = $this->getCon();
|
29 |
$req = Services::Request();
|
30 |
$nonceAction = $req->request( 'exec' );
|
31 |
|
34 |
check_ajax_referer( $nonceAction, 'exec_nonce',
|
35 |
$forceDie || !in_array( $nonceAction, $this->getAllowedNoPrivExecs() ) );
|
36 |
|
37 |
+
/** @var callable[] $handlers */
|
38 |
+
$handlers = apply_filters( $con->prefix( 'ajax_handlers' ), [], Services::WpUsers()->isUserLoggedIn() );
|
39 |
+
if ( isset( $handlers[ $nonceAction ] ) ) {
|
40 |
+
ob_start();
|
41 |
+
$response = $handlers[ $nonceAction ]();
|
42 |
+
$noise = ob_get_clean();
|
43 |
+
$response = $this->normaliseAjaxResponse( $response );
|
|
|
|
|
44 |
}
|
45 |
else {
|
|
|
46 |
$response = [];
|
47 |
+
$noise = [];
|
48 |
}
|
49 |
|
50 |
( new Response() )->issue(
|
51 |
[
|
52 |
+
'success' => $response[ 'success' ] ?? false,
|
53 |
'data' => $response,
|
54 |
'noise' => $noise
|
55 |
],
|
57 |
);
|
58 |
}
|
59 |
|
60 |
+
/**
|
61 |
+
* We check for empty since if it's empty, there's nothing to normalize. It's a filter,
|
62 |
+
* so if we send something back non-empty, it'll be treated like a "handled" response and
|
63 |
+
* processing will finish
|
64 |
+
*/
|
65 |
+
protected function normaliseAjaxResponse( array $ajaxResponse ) :array {
|
66 |
+
if ( !empty( $ajaxResponse ) ) {
|
67 |
+
$ajaxResponse = array_merge(
|
68 |
+
[
|
69 |
+
'success' => false,
|
70 |
+
'page_reload' => false,
|
71 |
+
'message' => 'Unknown',
|
72 |
+
'html' => '',
|
73 |
+
],
|
74 |
+
$ajaxResponse
|
75 |
+
);
|
76 |
+
}
|
77 |
+
return $ajaxResponse;
|
78 |
+
}
|
79 |
+
|
80 |
private function getAllowedNoPrivExecs() :array {
|
81 |
return [];
|
82 |
}
|
src/lib/src/Databases/AuditTrail/EntryVO.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Databases\AuditTrail;
|
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\Base;
|
6 |
|
7 |
/**
|
8 |
-
* Class EntryVO
|
9 |
-
*
|
10 |
* @property int $rid
|
11 |
* @property string $ip
|
12 |
* @property string $message
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\Base;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property int $rid
|
9 |
* @property string $ip
|
10 |
* @property string $message
|
src/lib/src/Databases/Base/HandlerConsumer.php
CHANGED
@@ -2,10 +2,6 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Databases\Base;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class HandlerConsumer
|
7 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Databases\Base
|
8 |
-
*/
|
9 |
trait HandlerConsumer {
|
10 |
|
11 |
/**
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Databases\Base;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
trait HandlerConsumer {
|
6 |
|
7 |
/**
|
src/lib/src/Databases/ChangeTracking/EntryVO.php
CHANGED
@@ -5,7 +5,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Databases\ChangeTracking;
|
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\Base;
|
6 |
|
7 |
/**
|
8 |
-
* Class EntryVO
|
9 |
* @property string ip
|
10 |
* @property array data
|
11 |
* @property array meta
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\Base;
|
6 |
|
7 |
/**
|
|
|
8 |
* @property string ip
|
9 |
* @property array data
|
10 |
* @property array meta
|
src/lib/src/Databases/Events/EntryVO.php
CHANGED
@@ -5,7 +5,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Databases\Events;
|
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\Base;
|
6 |
|
7 |
/**
|
8 |
-
* Class EntryVO
|
9 |
* @property string $event
|
10 |
* @property int $count
|
11 |
*/
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\Base;
|
6 |
|
7 |
/**
|
|
|
8 |
* @property string $event
|
9 |
* @property int $count
|
10 |
*/
|
src/lib/src/Databases/FileLocker/EntryVO.php
CHANGED
@@ -5,7 +5,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Databases\FileLocker;
|
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\Base;
|
6 |
|
7 |
/**
|
8 |
-
* Class EntryVO
|
9 |
* @property string $file
|
10 |
* @property string $hash_original
|
11 |
* @property string $hash_current
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\Base;
|
6 |
|
7 |
/**
|
|
|
8 |
* @property string $file
|
9 |
* @property string $hash_original
|
10 |
* @property string $hash_current
|
src/lib/src/Databases/Reports/EntryVO.php
CHANGED
@@ -5,7 +5,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Databases\Reports;
|
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\Base;
|
6 |
|
7 |
/**
|
8 |
-
* Class EntryVO
|
9 |
* @property int $rid
|
10 |
* @property string $type
|
11 |
* @property string $frequency
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\Base;
|
6 |
|
7 |
/**
|
|
|
8 |
* @property int $rid
|
9 |
* @property string $type
|
10 |
* @property string $frequency
|
src/lib/src/Databases/ScanQueue/EntryVO.php
CHANGED
@@ -5,7 +5,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Databases\ScanQueue;
|
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\Base;
|
6 |
|
7 |
/**
|
8 |
-
* Class EntryVO
|
9 |
* @property string $scan
|
10 |
* @property array $items
|
11 |
* @property array $results
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\Base;
|
6 |
|
7 |
/**
|
|
|
8 |
* @property string $scan
|
9 |
* @property array $items
|
10 |
* @property array $results
|
src/lib/src/Databases/Session/EntryVO.php
CHANGED
@@ -5,7 +5,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Databases\Session;
|
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\Base;
|
6 |
|
7 |
/**
|
8 |
-
* Class EntryVO
|
9 |
* @property string ip
|
10 |
* @property string browser
|
11 |
* @property string wp_username
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\Base;
|
6 |
|
7 |
/**
|
|
|
8 |
* @property string ip
|
9 |
* @property string browser
|
10 |
* @property string wp_username
|
src/lib/src/Logging/Processors/BaseMetaProcessor.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php declare( strict_types=1 );
|
2 |
+
|
3 |
+
namespace FernleafSystems\Wordpress\Plugin\Shield\Logging\Processors;
|
4 |
+
|
5 |
+
use FernleafSystems\Wordpress\Plugin\Shield\Modules\PluginControllerConsumer;
|
6 |
+
use Monolog\Processor\ProcessorInterface;
|
7 |
+
|
8 |
+
abstract class BaseMetaProcessor implements ProcessorInterface {
|
9 |
+
|
10 |
+
use PluginControllerConsumer;
|
11 |
+
}
|
src/lib/src/Logging/Processors/RequestMetaProcessor.php
CHANGED
@@ -4,12 +4,11 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Logging\Processors;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\Data\DB\ReqLogs\Ops\Handler;
|
6 |
use FernleafSystems\Wordpress\Services\Services;
|
7 |
-
use Monolog\Processor\ProcessorInterface;
|
8 |
|
9 |
-
class RequestMetaProcessor
|
10 |
|
11 |
/**
|
12 |
-
* @
|
13 |
*/
|
14 |
public function __invoke( array $record ) {
|
15 |
$WP = Services::WpGeneral();
|
@@ -43,6 +42,15 @@ class RequestMetaProcessor implements ProcessorInterface {
|
|
43 |
elseif ( $WP->isCron() ) {
|
44 |
$type = Handler::TYPE_CRON;
|
45 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
else {
|
47 |
$type = Handler::TYPE_HTTP;
|
48 |
}
|
4 |
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\Data\DB\ReqLogs\Ops\Handler;
|
6 |
use FernleafSystems\Wordpress\Services\Services;
|
|
|
7 |
|
8 |
+
class RequestMetaProcessor extends BaseMetaProcessor {
|
9 |
|
10 |
/**
|
11 |
+
* @inheritDoc
|
12 |
*/
|
13 |
public function __invoke( array $record ) {
|
14 |
$WP = Services::WpGeneral();
|
42 |
elseif ( $WP->isCron() ) {
|
43 |
$type = Handler::TYPE_CRON;
|
44 |
}
|
45 |
+
elseif ( $WP->isLoginRequest() ) {
|
46 |
+
$type = Handler::TYPE_LOGIN;
|
47 |
+
}
|
48 |
+
elseif ( $WP->isLoginUrl() && $req->isPost() && $req->query( 'shield_action' ) === 'wp_login_2fa_verify' ) {
|
49 |
+
$type = Handler::TYPE_2FA;
|
50 |
+
}
|
51 |
+
elseif ( Services::WpComments()->isCommentSubmission() ) {
|
52 |
+
$type = Handler::TYPE_COMMENT;
|
53 |
+
}
|
54 |
else {
|
55 |
$type = Handler::TYPE_HTTP;
|
56 |
}
|
src/lib/src/Logging/Processors/ShieldMetaProcessor.php
CHANGED
@@ -1,13 +1,8 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Logging\Processors;
|
4 |
|
5 |
-
|
6 |
-
use Monolog\Processor\ProcessorInterface;
|
7 |
-
|
8 |
-
class ShieldMetaProcessor implements ProcessorInterface {
|
9 |
-
|
10 |
-
use PluginControllerConsumer;
|
11 |
|
12 |
/**
|
13 |
* @return array
|
1 |
+
<?php declare( strict_types=1 );
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Logging\Processors;
|
4 |
|
5 |
+
class ShieldMetaProcessor extends BaseMetaProcessor {
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
/**
|
8 |
* @return array
|
src/lib/src/Logging/Processors/UserMetaProcessor.php
CHANGED
@@ -1,35 +1,18 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Logging\Processors;
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
-
use Monolog\Processor\ProcessorInterface;
|
7 |
|
8 |
-
class UserMetaProcessor
|
9 |
|
10 |
/**
|
11 |
* @return array
|
12 |
*/
|
13 |
public function __invoke( array $record ) {
|
14 |
-
$WP = Services::WpGeneral();
|
15 |
-
|
16 |
-
$uid = Services::WpUsers()->getCurrentWpUserId();
|
17 |
-
if ( empty( $uid ) ) {
|
18 |
-
if ( $WP->isWpCli() ) {
|
19 |
-
$uid = 'cli';
|
20 |
-
}
|
21 |
-
elseif ( $WP->isCron() ) {
|
22 |
-
$uid = 'cron';
|
23 |
-
}
|
24 |
-
else {
|
25 |
-
$uid = false;
|
26 |
-
}
|
27 |
-
}
|
28 |
-
|
29 |
$record[ 'extra' ][ 'meta_user' ] = array_filter( [
|
30 |
-
'uid' =>
|
31 |
] );
|
32 |
-
|
33 |
return $record;
|
34 |
}
|
35 |
}
|
1 |
+
<?php declare( strict_types=1 );
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Logging\Processors;
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
|
|
6 |
|
7 |
+
class UserMetaProcessor extends BaseMetaProcessor {
|
8 |
|
9 |
/**
|
10 |
* @return array
|
11 |
*/
|
12 |
public function __invoke( array $record ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
$record[ 'extra' ][ 'meta_user' ] = array_filter( [
|
14 |
+
'uid' => Services::WpUsers()->getCurrentWpUserId(),
|
15 |
] );
|
|
|
16 |
return $record;
|
17 |
}
|
18 |
}
|
src/lib/src/Logging/Processors/WpMetaProcessor.php
CHANGED
@@ -1,10 +1,8 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Logging\Processors;
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
class WpMetaProcessor implements ProcessorInterface {
|
8 |
|
9 |
/**
|
10 |
* @return array
|
1 |
+
<?php declare( strict_types=1 );
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Logging\Processors;
|
4 |
|
5 |
+
class WpMetaProcessor extends BaseMetaProcessor {
|
|
|
|
|
6 |
|
7 |
/**
|
8 |
* @return array
|
src/lib/src/Modules/AuditTrail/AjaxHandler.php
CHANGED
@@ -3,35 +3,64 @@
|
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\AuditTrail;
|
4 |
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield;
|
|
|
6 |
use FernleafSystems\Wordpress\Services\Services;
|
7 |
|
8 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
9 |
|
10 |
-
protected function
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
default:
|
17 |
-
$response = parent::processAjaxAction( $action );
|
18 |
}
|
19 |
-
|
20 |
-
return $response;
|
21 |
}
|
22 |
|
23 |
-
|
24 |
try {
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|
29 |
catch ( \Exception $e ) {
|
30 |
-
|
31 |
'success' => false,
|
32 |
'page_reload' => true,
|
33 |
'message' => $e->getMessage(),
|
34 |
];
|
35 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
37 |
}
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\AuditTrail;
|
4 |
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield;
|
6 |
+
use FernleafSystems\Wordpress\Plugin\Shield\Modules\AuditTrail\Lib\LogTable\BuildAuditTableData;
|
7 |
use FernleafSystems\Wordpress\Services\Services;
|
8 |
|
9 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
10 |
|
11 |
+
protected function getAjaxActionCallbackMap( bool $isAuth ) :array {
|
12 |
+
$map = parent::getAjaxActionCallbackMap( $isAuth );
|
13 |
+
if ( $isAuth ) {
|
14 |
+
$map = array_merge( $map, [
|
15 |
+
'logtable_action' => [ $this, 'ajaxExec_AuditTrailTableAction' ]
|
16 |
+
] );
|
|
|
|
|
17 |
}
|
18 |
+
return $map;
|
|
|
19 |
}
|
20 |
|
21 |
+
public function ajaxExec_AuditTrailTableAction() :array {
|
22 |
try {
|
23 |
+
$action = Services::Request()->post( 'sub_action' );
|
24 |
+
switch ( $action ) {
|
25 |
+
|
26 |
+
case 'retrieve_table_data':
|
27 |
+
$response = $this->retrieveTableData();
|
28 |
+
break;
|
29 |
+
|
30 |
+
case 'get_request_meta':
|
31 |
+
$response = $this->getRequestMeta();
|
32 |
+
break;
|
33 |
+
|
34 |
+
default:
|
35 |
+
throw new \Exception( 'Not a supported Audit Trail table sub_action: '.$action );
|
36 |
+
}
|
37 |
}
|
38 |
catch ( \Exception $e ) {
|
39 |
+
$response = [
|
40 |
'success' => false,
|
41 |
'page_reload' => true,
|
42 |
'message' => $e->getMessage(),
|
43 |
];
|
44 |
}
|
45 |
+
|
46 |
+
return $response;
|
47 |
+
}
|
48 |
+
|
49 |
+
private function retrieveTableData() :array {
|
50 |
+
$builder = ( new BuildAuditTableData() )->setMod( $this->getMod() );
|
51 |
+
$builder->table_data = (array)Services::Request()->post( 'table_data', [] );
|
52 |
+
return [
|
53 |
+
'success' => true,
|
54 |
+
'datatable_data' => $builder->build(),
|
55 |
+
];
|
56 |
+
}
|
57 |
+
|
58 |
+
private function getRequestMeta() :array {
|
59 |
+
return [
|
60 |
+
'success' => true,
|
61 |
+
'html' => ( new Shield\Modules\Data\DB\ReqLogs\GetRequestMeta() )
|
62 |
+
->setMod( $this->getCon()->getModule_Data() )
|
63 |
+
->retrieve( Services::Request()->post( 'rid' ) )
|
64 |
+
];
|
65 |
}
|
66 |
}
|
src/lib/src/Modules/AuditTrail/Lib/AuditLogger.php
CHANGED
@@ -66,15 +66,24 @@ class AuditLogger extends EventsListener {
|
|
66 |
|
67 |
public function getLogger() :Logger {
|
68 |
if ( !isset( $this->logger ) ) {
|
69 |
-
$this->logger = new Logger( 'audit', [],
|
70 |
-
|
71 |
-
new
|
72 |
-
|
73 |
-
|
|
|
74 |
}
|
75 |
return $this->logger;
|
76 |
}
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
protected function captureEvent( string $evt, array $meta = [], array $def = [] ) {
|
79 |
|
80 |
$meta = apply_filters( 'shield/audit_event_meta', $meta, $evt );
|
66 |
|
67 |
public function getLogger() :Logger {
|
68 |
if ( !isset( $this->logger ) ) {
|
69 |
+
$this->logger = new Logger( 'audit', [], array_map( function ( $class ) {
|
70 |
+
/** @var Processors\BaseMetaProcessor $p */
|
71 |
+
$p = new $class();
|
72 |
+
$p->setCon( $this->getCon() );
|
73 |
+
return $p;
|
74 |
+
}, $this->enumMetaProcessors() ) );
|
75 |
}
|
76 |
return $this->logger;
|
77 |
}
|
78 |
|
79 |
+
protected function enumMetaProcessors() :array {
|
80 |
+
return [
|
81 |
+
Processors\RequestMetaProcessor::class,
|
82 |
+
Processors\UserMetaProcessor::class,
|
83 |
+
Processors\WpMetaProcessor::class,
|
84 |
+
];
|
85 |
+
}
|
86 |
+
|
87 |
protected function captureEvent( string $evt, array $meta = [], array $def = [] ) {
|
88 |
|
89 |
$meta = apply_filters( 'shield/audit_event_meta', $meta, $evt );
|
src/lib/src/Modules/AuditTrail/Lib/LogTable/BuildAuditTableData.php
CHANGED
@@ -8,6 +8,7 @@ use FernleafSystems\Wordpress\Plugin\Shield\Modules\AuditTrail\Lib\AuditMessageB
|
|
8 |
use FernleafSystems\Wordpress\Plugin\Shield\Tables\DataTables\Build\AuditTrail\ForAuditTrail;
|
9 |
use FernleafSystems\Wordpress\Plugin\Shield\Tables\DataTables\LoadData\BaseBuildTableData;
|
10 |
use FernleafSystems\Wordpress\Services\Services;
|
|
|
11 |
|
12 |
class BuildAuditTableData extends BaseBuildTableData {
|
13 |
|
@@ -118,7 +119,29 @@ class BuildAuditTableData extends BaseBuildTableData {
|
|
118 |
}
|
119 |
|
120 |
private function getColumnContent_RequestDetails() :string {
|
121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
}
|
123 |
|
124 |
private function getColumnContent_UserID() :string {
|
8 |
use FernleafSystems\Wordpress\Plugin\Shield\Tables\DataTables\Build\AuditTrail\ForAuditTrail;
|
9 |
use FernleafSystems\Wordpress\Plugin\Shield\Tables\DataTables\LoadData\BaseBuildTableData;
|
10 |
use FernleafSystems\Wordpress\Services\Services;
|
11 |
+
use FernleafSystems\Wordpress\Services\Utilities\Net\IpID;
|
12 |
|
13 |
class BuildAuditTableData extends BaseBuildTableData {
|
14 |
|
119 |
}
|
120 |
|
121 |
private function getColumnContent_RequestDetails() :string {
|
122 |
+
if ( !empty( $this->log->ip ) ) {
|
123 |
+
try {
|
124 |
+
$ipID = ( new IpID( (string)$this->log->ip ) )->run();
|
125 |
+
if ( $ipID[ 0 ] === IpID::THIS_SERVER ) {
|
126 |
+
$id = __( 'This Server', 'wp-simple-firewall' );
|
127 |
+
}
|
128 |
+
elseif ( $ipID[ 0 ] === IpID::VISITOR ) {
|
129 |
+
$id = __( 'This Is You', 'wp-simple-firewall' );
|
130 |
+
}
|
131 |
+
else {
|
132 |
+
$id = $ipID[ 1 ];
|
133 |
+
}
|
134 |
+
}
|
135 |
+
catch ( \Exception $e ) {
|
136 |
+
$id = '';
|
137 |
+
}
|
138 |
+
$content = sprintf( '<h6>%s%s</h6>', $this->getIpAnalysisLink( (string)$this->log->ip ),
|
139 |
+
empty( $id ) ? '' : sprintf( '<br/><small>%s</small>', esc_html( $id ) ) );
|
140 |
+
}
|
141 |
+
else {
|
142 |
+
$content = 'No IP';
|
143 |
+
}
|
144 |
+
return $content;
|
145 |
}
|
146 |
|
147 |
private function getColumnContent_UserID() :string {
|
src/lib/src/Modules/Base/AdminNotices.php
CHANGED
@@ -7,43 +7,16 @@ use FernleafSystems\Wordpress\Plugin\Shield\Utilities\AdminNotices\NoticeVO;
|
|
7 |
use FernleafSystems\Wordpress\Services\Services;
|
8 |
use FernleafSystems\Wordpress\Services\Utilities\PluginUserMeta;
|
9 |
|
10 |
-
class AdminNotices {
|
11 |
-
|
12 |
-
use Shield\Modules\ModConsumer;
|
13 |
|
14 |
protected static $nCount = 0;
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
add_filter( $this->getCon()->prefix( 'ajaxAuthAction' ), [ $this, 'handleAuthAjax' ] );
|
19 |
}
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
$ajaxResponse = $this->ajaxExec_DismissAdminNotice();
|
24 |
-
}
|
25 |
-
return $ajaxResponse;
|
26 |
-
}
|
27 |
-
|
28 |
-
protected function ajaxExec_DismissAdminNotice() :array {
|
29 |
-
$ajaxResponse = [];
|
30 |
-
|
31 |
-
$noticeID = sanitize_key( Services::Request()->query( 'notice_id', '' ) );
|
32 |
-
|
33 |
-
foreach ( $this->getAdminNotices() as $notice ) {
|
34 |
-
if ( $noticeID == $notice->id ) {
|
35 |
-
$this->setNoticeDismissed( $notice );
|
36 |
-
$ajaxResponse = [
|
37 |
-
'success' => true,
|
38 |
-
'message' => 'Admin notice dismissed', //not currently rendered
|
39 |
-
'notice_id' => $notice->id,
|
40 |
-
];
|
41 |
-
break;
|
42 |
-
}
|
43 |
-
}
|
44 |
-
|
45 |
-
// leave response empty if it doesn't apply here, so other modules can process it.
|
46 |
-
return $ajaxResponse;
|
47 |
}
|
48 |
|
49 |
/**
|
@@ -80,7 +53,7 @@ class AdminNotices {
|
|
80 |
/**
|
81 |
* @return NoticeVO[]
|
82 |
*/
|
83 |
-
|
84 |
return array_map(
|
85 |
function ( $noticeDef ) {
|
86 |
$noticeDef = Services::DataManipulation()
|
@@ -96,6 +69,7 @@ class AdminNotices {
|
|
96 |
'display' => false,
|
97 |
'min_install_days' => 0,
|
98 |
'twig' => true,
|
|
|
99 |
],
|
100 |
$noticeDef
|
101 |
);
|
@@ -193,7 +167,7 @@ class AdminNotices {
|
|
193 |
throw new \Exception( 'Unsupported Notice ID: '.$notice->id );
|
194 |
}
|
195 |
|
196 |
-
|
197 |
$ts = Services::Request()->ts();
|
198 |
|
199 |
$meta = $this->getCon()->getCurrentUserMeta();
|
@@ -220,4 +194,11 @@ class AdminNotices {
|
|
220 |
private function getNoticeMetaKey( NoticeVO $notice ) :string {
|
221 |
return 'notice_'.str_replace( [ '-', '_' ], '', $notice->id );
|
222 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
}
|
7 |
use FernleafSystems\Wordpress\Services\Services;
|
8 |
use FernleafSystems\Wordpress\Services\Utilities\PluginUserMeta;
|
9 |
|
10 |
+
class AdminNotices extends Shield\Modules\Base\Common\ExecOnceModConsumer {
|
|
|
|
|
11 |
|
12 |
protected static $nCount = 0;
|
13 |
|
14 |
+
protected function canRun() :bool {
|
15 |
+
return Services::WpUsers()->isUserLoggedIn();
|
|
|
16 |
}
|
17 |
|
18 |
+
protected function run() {
|
19 |
+
add_filter( $this->getCon()->prefix( 'collectNotices' ), [ $this, 'addNotices' ] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
}
|
21 |
|
22 |
/**
|
53 |
/**
|
54 |
* @return NoticeVO[]
|
55 |
*/
|
56 |
+
public function getAdminNotices() :array {
|
57 |
return array_map(
|
58 |
function ( $noticeDef ) {
|
59 |
$noticeDef = Services::DataManipulation()
|
69 |
'display' => false,
|
70 |
'min_install_days' => 0,
|
71 |
'twig' => true,
|
72 |
+
'mod' => $this->getMod()->getSlug(),
|
73 |
],
|
74 |
$noticeDef
|
75 |
);
|
167 |
throw new \Exception( 'Unsupported Notice ID: '.$notice->id );
|
168 |
}
|
169 |
|
170 |
+
public function setNoticeDismissed( NoticeVO $notice ) {
|
171 |
$ts = Services::Request()->ts();
|
172 |
|
173 |
$meta = $this->getCon()->getCurrentUserMeta();
|
194 |
private function getNoticeMetaKey( NoticeVO $notice ) :string {
|
195 |
return 'notice_'.str_replace( [ '-', '_' ], '', $notice->id );
|
196 |
}
|
197 |
+
|
198 |
+
/**
|
199 |
+
* @deprecated 14.1
|
200 |
+
*/
|
201 |
+
public function handleAuthAjax( array $ajaxResponse ) :array {
|
202 |
+
return $ajaxResponse;
|
203 |
+
}
|
204 |
}
|
src/lib/src/Modules/Base/AjaxHandler.php
CHANGED
@@ -1,61 +1,110 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\Base;
|
4 |
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\ModConsumer;
|
|
|
6 |
|
7 |
abstract class AjaxHandler {
|
8 |
|
9 |
use ModConsumer;
|
10 |
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
}
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
}
|
19 |
|
20 |
-
public function
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
|
|
|
|
24 |
return $ajaxResponse;
|
25 |
}
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
return $ajaxResponse;
|
32 |
}
|
33 |
|
34 |
-
|
|
|
|
|
|
|
|
|
35 |
return [];
|
36 |
}
|
37 |
|
38 |
-
|
|
|
|
|
|
|
39 |
return [];
|
40 |
}
|
41 |
|
42 |
/**
|
43 |
-
*
|
44 |
-
* so if we send something back non-empty, it'll be treated like a "handled" response and
|
45 |
-
* processing will finish
|
46 |
*/
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
60 |
}
|
61 |
}
|
1 |
+
<?php declare( strict_types=1 );
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\Base;
|
4 |
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\ModConsumer;
|
6 |
+
use FernleafSystems\Wordpress\Services\Services;
|
7 |
|
8 |
abstract class AjaxHandler {
|
9 |
|
10 |
use ModConsumer;
|
11 |
|
12 |
+
/**
|
13 |
+
* @param ModCon|mixed $mod
|
14 |
+
*/
|
15 |
+
public function __construct( $mod ) {
|
16 |
+
$this->setMod( $mod );
|
17 |
+
add_filter( $mod->prefix( 'ajax_handlers' ),
|
18 |
+
function ( array $ajaxHandlers, bool $isAuth ) {
|
19 |
+
return \array_merge( $ajaxHandlers, $this->getAjaxActionCallbackMap( $isAuth ) );
|
20 |
+
},
|
21 |
+
10, 2
|
22 |
+
);
|
23 |
}
|
24 |
|
25 |
+
/**
|
26 |
+
* @return callable[]
|
27 |
+
*/
|
28 |
+
protected function getAjaxActionCallbackMap( bool $isAuth ) :array {
|
29 |
+
$map = [];
|
30 |
+
if ( $isAuth ) {
|
31 |
+
$map[ 'dismiss_admin_notice' ] = [ $this, 'ajaxExec_DismissAdminNotice' ];
|
32 |
+
}
|
33 |
+
return $map;
|
34 |
}
|
35 |
|
36 |
+
public function ajaxExec_DismissAdminNotice() :array {
|
37 |
+
$ajaxResponse = [];
|
38 |
+
$noticeID = sanitize_key( Services::Request()->query( 'notice_id', '' ) );
|
39 |
+
|
40 |
+
$notices = $this->getMod()->getAdminNotices();
|
41 |
+
foreach ( $notices->getAdminNotices() as $notice ) {
|
42 |
+
if ( $noticeID == $notice->id ) {
|
43 |
+
$notices->setNoticeDismissed( $notice );
|
44 |
+
$ajaxResponse = [
|
45 |
+
'success' => true,
|
46 |
+
'message' => 'Admin notice dismissed', //not currently rendered
|
47 |
+
'notice_id' => $notice->id,
|
48 |
+
];
|
49 |
+
break;
|
50 |
+
}
|
51 |
}
|
52 |
+
|
53 |
+
// leave response empty if it doesn't apply here, so other modules can process it.
|
54 |
return $ajaxResponse;
|
55 |
}
|
56 |
|
57 |
+
/**
|
58 |
+
* @deprecated 14.1
|
59 |
+
*/
|
60 |
+
public function init() {
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* We check for empty since if it's empty, there's nothing to normalize. It's a filter,
|
65 |
+
* so if we send something back non-empty, it'll be treated like a "handled" response and
|
66 |
+
* processing will finish
|
67 |
+
* @deprecated 14.1
|
68 |
+
*/
|
69 |
+
protected function normaliseAjaxResponse( array $ajaxResponse ) :array {
|
70 |
return $ajaxResponse;
|
71 |
}
|
72 |
|
73 |
+
/**
|
74 |
+
* @throws \Exception
|
75 |
+
* @deprecated 14.1
|
76 |
+
*/
|
77 |
+
protected function processAjaxAction() :array {
|
78 |
return [];
|
79 |
}
|
80 |
|
81 |
+
/**
|
82 |
+
* @deprecated 14.1
|
83 |
+
*/
|
84 |
+
public function handleAjaxAuth( array $ajaxResponse, string $ajaxAction ) :array {
|
85 |
return [];
|
86 |
}
|
87 |
|
88 |
/**
|
89 |
+
* @deprecated 14.1
|
|
|
|
|
90 |
*/
|
91 |
+
public function handleAjaxNonAuth( array $ajaxResponse, string $ajaxAction ) :array {
|
92 |
+
return [];
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* @throws \Exception
|
97 |
+
* @deprecated 14.1
|
98 |
+
*/
|
99 |
+
protected function processAuthAjaxAction() :array {
|
100 |
+
return [];
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* @throws \Exception
|
105 |
+
* @deprecated 14.1
|
106 |
+
*/
|
107 |
+
protected function processNonAuthAjaxAction() :array {
|
108 |
+
return [];
|
109 |
}
|
110 |
}
|
src/lib/src/Modules/Base/ModCon.php
CHANGED
@@ -45,7 +45,7 @@ abstract class ModCon {
|
|
45 |
/**
|
46 |
* @var Shield\Modules\Base\UI
|
47 |
*/
|
48 |
-
private $
|
49 |
|
50 |
/**
|
51 |
* @var Shield\Modules\Base\Options
|
@@ -77,6 +77,11 @@ abstract class ModCon {
|
|
77 |
*/
|
78 |
private $dbHandler;
|
79 |
|
|
|
|
|
|
|
|
|
|
|
80 |
/**
|
81 |
* @param Shield\Controller\Controller $pluginCon
|
82 |
* @param array $mod
|
@@ -120,10 +125,6 @@ abstract class ModCon {
|
|
120 |
add_action( $con->prefix( 'deactivate_plugin' ), [ $this, 'onPluginDeactivate' ] );
|
121 |
add_action( $con->prefix( 'delete_plugin' ), [ $this, 'onPluginDelete' ] );
|
122 |
|
123 |
-
if ( is_admin() || is_network_admin() ) {
|
124 |
-
$this->loadAdminNotices();
|
125 |
-
}
|
126 |
-
|
127 |
// if ( $this->isAdminOptionsPage() ) {
|
128 |
// add_action( 'current_screen', array( $this, 'onSetCurrentScreen' ) );
|
129 |
// }
|
@@ -335,6 +336,10 @@ abstract class ModCon {
|
|
335 |
add_filter( $this->prefix( 'wpPrivacyErase' ), [ $this, 'onWpPrivacyErase' ], 10, 3 );
|
336 |
}
|
337 |
|
|
|
|
|
|
|
|
|
338 |
$this->loadDebug();
|
339 |
}
|
340 |
|
@@ -1155,42 +1160,6 @@ abstract class ModCon {
|
|
1155 |
protected function display( $aData = [], $sSubView = '' ) {
|
1156 |
}
|
1157 |
|
1158 |
-
/**
|
1159 |
-
* @param array $aData
|
1160 |
-
* @return string
|
1161 |
-
* @throws \Exception
|
1162 |
-
*/
|
1163 |
-
public function renderAdminNotice( $aData ) {
|
1164 |
-
if ( empty( $aData[ 'notice_attributes' ] ) ) {
|
1165 |
-
throw new \Exception( 'notice_attributes is empty' );
|
1166 |
-
}
|
1167 |
-
|
1168 |
-
if ( !isset( $aData[ 'icwp_admin_notice_template' ] ) ) {
|
1169 |
-
$aData[ 'icwp_admin_notice_template' ] = $aData[ 'notice_attributes' ][ 'notice_id' ];
|
1170 |
-
}
|
1171 |
-
|
1172 |
-
if ( !isset( $aData[ 'notice_classes' ] ) ) {
|
1173 |
-
$aData[ 'notice_classes' ] = [];
|
1174 |
-
}
|
1175 |
-
if ( is_array( $aData[ 'notice_classes' ] ) ) {
|
1176 |
-
$aData[ 'notice_classes' ][] = $aData[ 'notice_attributes' ][ 'type' ];
|
1177 |
-
if ( empty( $aData[ 'notice_classes' ] )
|
1178 |
-
|| ( !in_array( 'error', $aData[ 'notice_classes' ] ) && !in_array( 'updated', $aData[ 'notice_classes' ] ) ) ) {
|
1179 |
-
$aData[ 'notice_classes' ][] = 'updated';
|
1180 |
-
}
|
1181 |
-
}
|
1182 |
-
$aData[ 'notice_classes' ] = implode( ' ', $aData[ 'notice_classes' ] );
|
1183 |
-
|
1184 |
-
$aAjaxData = $this->getAjaxActionData( 'dismiss_admin_notice' );
|
1185 |
-
$aAjaxData[ 'hide' ] = 1;
|
1186 |
-
$aAjaxData[ 'notice_id' ] = $aData[ 'notice_attributes' ][ 'notice_id' ];
|
1187 |
-
$aData[ 'ajax' ][ 'dismiss_admin_notice' ] = json_encode( $aAjaxData );
|
1188 |
-
|
1189 |
-
$bTwig = $aData[ 'notice_attributes' ][ 'twig' ];
|
1190 |
-
$sTemplate = $bTwig ? '/notices/'.$aAjaxData[ 'notice_id' ] : 'notices/admin-notice-template';
|
1191 |
-
return $this->renderTemplate( $sTemplate, $aData, $bTwig );
|
1192 |
-
}
|
1193 |
-
|
1194 |
public function renderTemplate( string $template, array $data = [], bool $isTwig = false ) :string {
|
1195 |
if ( empty( $data[ 'unique_render_id' ] ) ) {
|
1196 |
$data[ 'unique_render_id' ] = 'noticeid-'.substr( md5( mt_rand() ), 0, 5 );
|
@@ -1296,14 +1265,10 @@ abstract class ModCon {
|
|
1296 |
* @return Shield\Modules\Base\UI
|
1297 |
*/
|
1298 |
public function getUIHandler() {
|
1299 |
-
if ( !isset( $this->
|
1300 |
-
$this->
|
1301 |
-
if ( !$this->oUI instanceof Shield\Modules\Base\UI ) {
|
1302 |
-
// TODO: autoloader for base classes
|
1303 |
-
$this->oUI = $this->loadModElement( 'ShieldUI' );
|
1304 |
-
}
|
1305 |
}
|
1306 |
-
return $this->
|
1307 |
}
|
1308 |
|
1309 |
/**
|
@@ -1316,15 +1281,23 @@ abstract class ModCon {
|
|
1316 |
return $this->oReporting;
|
1317 |
}
|
1318 |
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
$N->run();
|
1323 |
}
|
|
|
1324 |
}
|
1325 |
|
1326 |
protected function loadAjaxHandler() {
|
1327 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1328 |
}
|
1329 |
|
1330 |
protected function loadDebug() {
|
45 |
/**
|
46 |
* @var Shield\Modules\Base\UI
|
47 |
*/
|
48 |
+
private $UI;
|
49 |
|
50 |
/**
|
51 |
* @var Shield\Modules\Base\Options
|
77 |
*/
|
78 |
private $dbHandler;
|
79 |
|
80 |
+
/**
|
81 |
+
* @var AdminNotices
|
82 |
+
*/
|
83 |
+
private $adminNotices;
|
84 |
+
|
85 |
/**
|
86 |
* @param Shield\Controller\Controller $pluginCon
|
87 |
* @param array $mod
|
125 |
add_action( $con->prefix( 'deactivate_plugin' ), [ $this, 'onPluginDeactivate' ] );
|
126 |
add_action( $con->prefix( 'delete_plugin' ), [ $this, 'onPluginDelete' ] );
|
127 |
|
|
|
|
|
|
|
|
|
128 |
// if ( $this->isAdminOptionsPage() ) {
|
129 |
// add_action( 'current_screen', array( $this, 'onSetCurrentScreen' ) );
|
130 |
// }
|
336 |
add_filter( $this->prefix( 'wpPrivacyErase' ), [ $this, 'onWpPrivacyErase' ], 10, 3 );
|
337 |
}
|
338 |
|
339 |
+
if ( is_admin() || is_network_admin() ) {
|
340 |
+
$this->getAdminNotices()->execute();
|
341 |
+
}
|
342 |
+
|
343 |
$this->loadDebug();
|
344 |
}
|
345 |
|
1160 |
protected function display( $aData = [], $sSubView = '' ) {
|
1161 |
}
|
1162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1163 |
public function renderTemplate( string $template, array $data = [], bool $isTwig = false ) :string {
|
1164 |
if ( empty( $data[ 'unique_render_id' ] ) ) {
|
1165 |
$data[ 'unique_render_id' ] = 'noticeid-'.substr( md5( mt_rand() ), 0, 5 );
|
1265 |
* @return Shield\Modules\Base\UI
|
1266 |
*/
|
1267 |
public function getUIHandler() {
|
1268 |
+
if ( !isset( $this->UI ) ) {
|
1269 |
+
$this->UI = $this->loadModElement( 'UI' );
|
|
|
|
|
|
|
|
|
1270 |
}
|
1271 |
+
return $this->UI;
|
1272 |
}
|
1273 |
|
1274 |
/**
|
1281 |
return $this->oReporting;
|
1282 |
}
|
1283 |
|
1284 |
+
public function getAdminNotices() {
|
1285 |
+
if ( !isset( $this->adminNotices ) ) {
|
1286 |
+
$this->adminNotices = $this->loadModElement( 'AdminNotices' );
|
|
|
1287 |
}
|
1288 |
+
return $this->adminNotices;
|
1289 |
}
|
1290 |
|
1291 |
protected function loadAjaxHandler() {
|
1292 |
+
try {
|
1293 |
+
$class = $this->findElementClass( 'AjaxHandler', true );
|
1294 |
+
/** @var Shield\Modules\ModConsumer $AH */
|
1295 |
+
if ( !empty( $class ) && @class_exists( $class ) ) {
|
1296 |
+
new $class( $this );
|
1297 |
+
}
|
1298 |
+
}
|
1299 |
+
catch ( \Exception $e ) {
|
1300 |
+
}
|
1301 |
}
|
1302 |
|
1303 |
protected function loadDebug() {
|
src/lib/src/Modules/Base/Strings.php
CHANGED
@@ -183,16 +183,6 @@ class Strings {
|
|
183 |
|
184 |
switch ( $section ) {
|
185 |
|
186 |
-
case 'section_user_messages' :
|
187 |
-
$title = __( 'User Messages', 'wp-simple-firewall' );
|
188 |
-
$titleShort = __( 'Messages', 'wp-simple-firewall' );
|
189 |
-
$summary = [
|
190 |
-
sprintf( '%s - %s', __( 'Purpose', 'wp-simple-firewall' ), __( 'Customize the messages displayed to the user.', 'wp-simple-firewall' ) ),
|
191 |
-
sprintf( '%s - %s', __( 'Recommendation', 'wp-simple-firewall' ), __( 'Use this section if you need to communicate to the user in a particular manner.', 'wp-simple-firewall' ) ),
|
192 |
-
sprintf( '%s: %s', __( 'Hint', 'wp-simple-firewall' ), sprintf( __( 'To reset any message to its default, enter the text exactly: %s', 'wp-simple-firewall' ), 'default' ) )
|
193 |
-
];
|
194 |
-
break;
|
195 |
-
|
196 |
default:
|
197 |
$section = $this->getOptions()->getSection( $section );
|
198 |
if ( is_array( $section ) && !empty( $section[ 'title' ] ) && !empty( $section[ 'title_short' ] ) ) {
|
183 |
|
184 |
switch ( $section ) {
|
185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
default:
|
187 |
$section = $this->getOptions()->getSection( $section );
|
188 |
if ( is_array( $section ) && !empty( $section[ 'title' ] ) && !empty( $section[ 'title_short' ] ) ) {
|
src/lib/src/Modules/BaseShield/AjaxHandler.php
CHANGED
@@ -6,41 +6,20 @@ use FernleafSystems\Wordpress\Plugin\Shield\Modules\Base;
|
|
6 |
|
7 |
class AjaxHandler extends Base\AjaxHandler {
|
8 |
|
9 |
-
protected function
|
10 |
-
$
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
case 'mod_options':
|
20 |
-
$response = $this->ajaxExec_ModOptions();
|
21 |
-
break;
|
22 |
-
|
23 |
-
case 'wiz_process_step':
|
24 |
-
if ( $mod->hasWizard() ) {
|
25 |
-
$response = $mod->getWizardHandler()->ajaxExec_WizProcessStep();
|
26 |
-
}
|
27 |
-
break;
|
28 |
-
|
29 |
-
case 'wiz_render_step':
|
30 |
-
if ( $mod->hasWizard() ) {
|
31 |
-
$response = $mod->getWizardHandler()->ajaxExec_WizRenderStep();
|
32 |
-
}
|
33 |
-
break;
|
34 |
-
|
35 |
-
default:
|
36 |
-
$response = parent::processAjaxAction( $action );
|
37 |
}
|
38 |
-
|
39 |
-
return $response;
|
40 |
}
|
41 |
|
42 |
-
|
43 |
-
|
44 |
$name = $this->getCon()->getHumanName();
|
45 |
|
46 |
try {
|
@@ -51,7 +30,7 @@ class AjaxHandler extends Base\AjaxHandler {
|
|
51 |
catch ( \Exception $e ) {
|
52 |
$success = false;
|
53 |
$msg = sprintf( __( 'Failed to update %s plugin options.', 'wp-simple-firewall' ), $name )
|
54 |
-
|
55 |
}
|
56 |
|
57 |
return [
|
@@ -61,7 +40,7 @@ class AjaxHandler extends Base\AjaxHandler {
|
|
61 |
];
|
62 |
}
|
63 |
|
64 |
-
|
65 |
return [
|
66 |
'success' => true,
|
67 |
'html' => $this->getMod()->renderOptionsForm(),
|
6 |
|
7 |
class AjaxHandler extends Base\AjaxHandler {
|
8 |
|
9 |
+
protected function getAjaxActionCallbackMap( bool $isAuth ) :array {
|
10 |
+
$map = parent::getAjaxActionCallbackMap( $isAuth );
|
11 |
+
if ( $isAuth ) {
|
12 |
+
$map = array_merge( $map, [
|
13 |
+
'mod_opts_form_render' => [ $this, 'ajaxExec_ModOptionsFormRender' ],
|
14 |
+
'mod_options' => [ $this, 'ajaxExec_ModOptions' ],
|
15 |
+
'wiz_process_step' => [ $this->getMod()->getWizardHandler(), 'ajaxExec_WizProcessStep' ],
|
16 |
+
'wiz_render_step' => [ $this->getMod()->getWizardHandler(), 'ajaxExec_WizRenderStep' ],
|
17 |
+
] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
}
|
19 |
+
return $map;
|
|
|
20 |
}
|
21 |
|
22 |
+
public function ajaxExec_ModOptions() :array {
|
|
|
23 |
$name = $this->getCon()->getHumanName();
|
24 |
|
25 |
try {
|
30 |
catch ( \Exception $e ) {
|
31 |
$success = false;
|
32 |
$msg = sprintf( __( 'Failed to update %s plugin options.', 'wp-simple-firewall' ), $name )
|
33 |
+
.' '.$e->getMessage();
|
34 |
}
|
35 |
|
36 |
return [
|
40 |
];
|
41 |
}
|
42 |
|
43 |
+
public function ajaxExec_ModOptionsFormRender() :array {
|
44 |
return [
|
45 |
'success' => true,
|
46 |
'html' => $this->getMod()->renderOptionsForm(),
|
src/lib/src/Modules/CommentsFilter/AjaxHandler.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\CommentsFilter;
|
4 |
|
@@ -7,21 +7,13 @@ use FernleafSystems\Wordpress\Services\Services;
|
|
7 |
|
8 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
9 |
|
10 |
-
protected function
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
$response = $this->ajaxExec_GenCommentToken();
|
15 |
-
break;
|
16 |
-
|
17 |
-
default:
|
18 |
-
$response = parent::processAjaxAction( $action );
|
19 |
-
}
|
20 |
-
|
21 |
-
return $response;
|
22 |
}
|
23 |
|
24 |
-
|
25 |
$req = Services::Request();
|
26 |
return [
|
27 |
'success' => true,
|
1 |
+
<?php declare( strict_types=1 );
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\CommentsFilter;
|
4 |
|
7 |
|
8 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
9 |
|
10 |
+
protected function getAjaxActionCallbackMap( bool $isAuth ) :array {
|
11 |
+
return array_merge( parent::getAjaxActionCallbackMap( $isAuth ), [
|
12 |
+
'comment_token'.Services::IP()->getRequestIp() => [ $this, 'ajaxExec_GenCommentToken' ],
|
13 |
+
] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
15 |
|
16 |
+
public function ajaxExec_GenCommentToken() :array {
|
17 |
$req = Services::Request();
|
18 |
return [
|
19 |
'success' => true,
|
src/lib/src/Modules/CommentsFilter/ModCon.php
CHANGED
@@ -65,8 +65,8 @@ class ModCon extends BaseShield\ModCon {
|
|
65 |
// clean roles
|
66 |
$opts->setOpt( 'trusted_user_roles',
|
67 |
array_unique( array_filter( array_map(
|
68 |
-
function ( $
|
69 |
-
return sanitize_key( strtolower( $
|
70 |
},
|
71 |
$opts->getTrustedRoles()
|
72 |
) ) )
|
@@ -87,10 +87,6 @@ class ModCon extends BaseShield\ModCon {
|
|
87 |
&& $this->getCaptchaCfg()->ready;
|
88 |
}
|
89 |
|
90 |
-
public function setEnabledAntiBot( bool $enabled = true ) {
|
91 |
-
$this->getOptions()->setOpt( 'enable_antibot_check', $enabled ? 'Y' : 'N' );
|
92 |
-
}
|
93 |
-
|
94 |
public function getSpamBlacklistFile() :string {
|
95 |
return $this->getCon()->paths->forCacheItem( 'spamblacklist.txt' );
|
96 |
}
|
65 |
// clean roles
|
66 |
$opts->setOpt( 'trusted_user_roles',
|
67 |
array_unique( array_filter( array_map(
|
68 |
+
function ( $role ) {
|
69 |
+
return sanitize_key( strtolower( $role ) );
|
70 |
},
|
71 |
$opts->getTrustedRoles()
|
72 |
) ) )
|
87 |
&& $this->getCaptchaCfg()->ready;
|
88 |
}
|
89 |
|
|
|
|
|
|
|
|
|
90 |
public function getSpamBlacklistFile() :string {
|
91 |
return $this->getCon()->paths->forCacheItem( 'spamblacklist.txt' );
|
92 |
}
|
src/lib/src/Modules/CommentsFilter/Options.php
CHANGED
@@ -58,7 +58,11 @@ class Options extends BaseShield\Options {
|
|
58 |
}
|
59 |
|
60 |
public function isEnabledAntiBot() :bool {
|
61 |
-
|
|
|
|
|
|
|
|
|
62 |
}
|
63 |
|
64 |
public function isEnabledCaptcha() :bool {
|
@@ -69,4 +73,8 @@ class Options extends BaseShield\Options {
|
|
69 |
return $this->isOpt( 'enable_comments_human_spam_filter', 'Y' )
|
70 |
&& count( $this->getHumanSpamFilterItems() ) > 0;
|
71 |
}
|
|
|
|
|
|
|
|
|
72 |
}
|
58 |
}
|
59 |
|
60 |
public function isEnabledAntiBot() :bool {
|
61 |
+
if ( $this->isOpt( 'enable_antibot_check', 'Y' ) ) {
|
62 |
+
/** @deprecated 14.1 - remove the older option */
|
63 |
+
$this->setOpt( 'enable_antibot_comments', 'Y' );
|
64 |
+
}
|
65 |
+
return $this->isOpt( 'enable_antibot_comments', 'Y' );
|
66 |
}
|
67 |
|
68 |
public function isEnabledCaptcha() :bool {
|
73 |
return $this->isOpt( 'enable_comments_human_spam_filter', 'Y' )
|
74 |
&& count( $this->getHumanSpamFilterItems() ) > 0;
|
75 |
}
|
76 |
+
|
77 |
+
public function setEnabledAntiBot( bool $enabled = true ) {
|
78 |
+
$this->setOpt( 'enable_antibot_comments', $enabled ? 'Y' : 'N' );
|
79 |
+
}
|
80 |
}
|
src/lib/src/Modules/CommentsFilter/Scan/AntiBot.php
CHANGED
@@ -9,7 +9,6 @@ class AntiBot {
|
|
9 |
use ModConsumer;
|
10 |
|
11 |
/**
|
12 |
-
* @return bool
|
13 |
* @throws \Exception
|
14 |
*/
|
15 |
public function scan() :bool {
|
9 |
use ModConsumer;
|
10 |
|
11 |
/**
|
|
|
12 |
* @throws \Exception
|
13 |
*/
|
14 |
public function scan() :bool {
|
src/lib/src/Modules/CommentsFilter/Scan/IsEmailTrusted.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\CommentsFilter\Scan;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class IsEmailTrusted
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\CommentsFilter\Scan
|
10 |
-
*/
|
11 |
class IsEmailTrusted {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class IsEmailTrusted {
|
8 |
|
9 |
/**
|
src/lib/src/Modules/CommentsFilter/Strings.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\CommentsFilter;
|
4 |
|
@@ -7,9 +7,6 @@ use FernleafSystems\Wordpress\Services\Services;
|
|
7 |
|
8 |
class Strings extends Base\Strings {
|
9 |
|
10 |
-
/**
|
11 |
-
* @inheritDoc
|
12 |
-
*/
|
13 |
public function getEventStrings() :array {
|
14 |
return [
|
15 |
'spam_block_antibot' => [
|
@@ -58,11 +55,6 @@ class Strings extends Base\Strings {
|
|
58 |
];
|
59 |
}
|
60 |
|
61 |
-
/**
|
62 |
-
* @param string $section
|
63 |
-
* @return array
|
64 |
-
* @throws \Exception
|
65 |
-
*/
|
66 |
public function getSectionStrings( string $section ) :array {
|
67 |
|
68 |
switch ( $section ) {
|
@@ -114,11 +106,6 @@ class Strings extends Base\Strings {
|
|
114 |
];
|
115 |
}
|
116 |
|
117 |
-
/**
|
118 |
-
* @param string $key
|
119 |
-
* @return array
|
120 |
-
* @throws \Exception
|
121 |
-
*/
|
122 |
public function getOptionStrings( string $key ) :array {
|
123 |
/** @var ModCon $mod */
|
124 |
$mod = $this->getMod();
|
@@ -142,22 +129,22 @@ class Strings extends Base\Strings {
|
|
142 |
case 'trusted_user_roles' :
|
143 |
$name = __( 'Trusted User Roles', 'wp-simple-firewall' );
|
144 |
$summary = __( "Comments From Users With These Roles Will Never Be Scanned", 'wp-simple-firewall' );
|
145 |
-
$desc =
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
|
|
|
|
150 |
break;
|
151 |
|
152 |
-
case '
|
153 |
$name = __( 'AntiBot Detection Engine (ADE)', 'wp-simple-firewall' );
|
154 |
$summary = __( "Use ADE To Detect SPAM Bots And Block Comment SPAM", 'wp-simple-firewall' );
|
155 |
$desc = [
|
156 |
sprintf( __( "AntiBot Detection Engine is %s's exclusive bot-detection technology that removes the needs for CAPTCHA and other challenges.", 'wp-simple-firewall' ),
|
157 |
$this->getCon()->getHumanName() ),
|
158 |
__( 'This feature is designed to replace the CAPTCHA and Bot Protection options.', 'wp-simple-firewall' ),
|
159 |
-
sprintf( '%s - %s', __( 'Important', 'wp-simple-firewall' ),
|
160 |
-
__( "Switching on this feature will disable the CAPTCHA and Bot Protection settings.", 'wp-simple-firewall' ) )
|
161 |
];
|
162 |
break;
|
163 |
|
@@ -201,8 +188,10 @@ class Strings extends Base\Strings {
|
|
201 |
case 'custom_message_checkbox' :
|
202 |
$name = __( 'GASP Checkbox Message', 'wp-simple-firewall' );
|
203 |
$summary = __( 'If you want a custom checkbox message, please provide this here', 'wp-simple-firewall' );
|
204 |
-
$desc =
|
205 |
-
|
|
|
|
|
206 |
break;
|
207 |
|
208 |
case 'google_recaptcha_style_comments' :
|
@@ -229,22 +218,28 @@ class Strings extends Base\Strings {
|
|
229 |
case 'custom_message_alert' :
|
230 |
$name = __( 'GASP Alert Message', 'wp-simple-firewall' );
|
231 |
$summary = __( 'If you want a custom alert message, please provide this here', 'wp-simple-firewall' );
|
232 |
-
$desc =
|
233 |
-
|
|
|
|
|
234 |
break;
|
235 |
|
236 |
case 'custom_message_comment_wait' :
|
237 |
$name = __( 'GASP Wait Message', 'wp-simple-firewall' );
|
238 |
$summary = __( 'If you want a custom submit-button wait message, please provide this here.', 'wp-simple-firewall' );
|
239 |
-
$desc =
|
240 |
-
|
|
|
|
|
241 |
break;
|
242 |
|
243 |
case 'custom_message_comment_reload' :
|
244 |
$name = __( 'GASP Reload Message', 'wp-simple-firewall' );
|
245 |
$summary = __( 'If you want a custom message when the comment token has expired, please provide this here.', 'wp-simple-firewall' );
|
246 |
-
$desc =
|
247 |
-
|
|
|
|
|
248 |
break;
|
249 |
|
250 |
default:
|
1 |
+
<?php declare( strict_types=1 );
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\CommentsFilter;
|
4 |
|
7 |
|
8 |
class Strings extends Base\Strings {
|
9 |
|
|
|
|
|
|
|
10 |
public function getEventStrings() :array {
|
11 |
return [
|
12 |
'spam_block_antibot' => [
|
55 |
];
|
56 |
}
|
57 |
|
|
|
|
|
|
|
|
|
|
|
58 |
public function getSectionStrings( string $section ) :array {
|
59 |
|
60 |
switch ( $section ) {
|
106 |
];
|
107 |
}
|
108 |
|
|
|
|
|
|
|
|
|
|
|
109 |
public function getOptionStrings( string $key ) :array {
|
110 |
/** @var ModCon $mod */
|
111 |
$mod = $this->getMod();
|
129 |
case 'trusted_user_roles' :
|
130 |
$name = __( 'Trusted User Roles', 'wp-simple-firewall' );
|
131 |
$summary = __( "Comments From Users With These Roles Will Never Be Scanned", 'wp-simple-firewall' );
|
132 |
+
$desc = [
|
133 |
+
__( "Shield doesn't normally scan comments from logged-in or registered users.", 'wp-simple-firewall' ),
|
134 |
+
__( "Specify user roles here that shouldn't be scanned.", 'wp-simple-firewall' ),
|
135 |
+
sprintf( '%s: %s', __( 'Important', 'wp-simple-firewall' ), __( 'Take a new line for each user role.', 'wp-simple-firewall' ) ),
|
136 |
+
sprintf( '%s: %s', __( 'Available Roles', 'wp-simple-firewall' ),
|
137 |
+
implode( ', ', Services::WpUsers()->getAvailableUserRoles() ) )
|
138 |
+
];
|
139 |
break;
|
140 |
|
141 |
+
case 'enable_antibot_comments' :
|
142 |
$name = __( 'AntiBot Detection Engine (ADE)', 'wp-simple-firewall' );
|
143 |
$summary = __( "Use ADE To Detect SPAM Bots And Block Comment SPAM", 'wp-simple-firewall' );
|
144 |
$desc = [
|
145 |
sprintf( __( "AntiBot Detection Engine is %s's exclusive bot-detection technology that removes the needs for CAPTCHA and other challenges.", 'wp-simple-firewall' ),
|
146 |
$this->getCon()->getHumanName() ),
|
147 |
__( 'This feature is designed to replace the CAPTCHA and Bot Protection options.', 'wp-simple-firewall' ),
|
|
|
|
|
148 |
];
|
149 |
break;
|
150 |
|
188 |
case 'custom_message_checkbox' :
|
189 |
$name = __( 'GASP Checkbox Message', 'wp-simple-firewall' );
|
190 |
$summary = __( 'If you want a custom checkbox message, please provide this here', 'wp-simple-firewall' );
|
191 |
+
$desc = [
|
192 |
+
__( "You can customise the message beside the checkbox.", 'wp-simple-firewall' ),
|
193 |
+
sprintf( __( 'Default Message: %s', 'wp-simple-firewall' ), __( "Please check the box to confirm you're not a spammer", 'wp-simple-firewall' ) )
|
194 |
+
];
|
195 |
break;
|
196 |
|
197 |
case 'google_recaptcha_style_comments' :
|
218 |
case 'custom_message_alert' :
|
219 |
$name = __( 'GASP Alert Message', 'wp-simple-firewall' );
|
220 |
$summary = __( 'If you want a custom alert message, please provide this here', 'wp-simple-firewall' );
|
221 |
+
$desc = [
|
222 |
+
__( "This alert message is displayed when a visitor attempts to submit a comment without checking the box.", 'wp-simple-firewall' ),
|
223 |
+
sprintf( __( 'Default Message: %s', 'wp-simple-firewall' ), __( "Please check the box to confirm you're not a spammer", 'wp-simple-firewall' ) )
|
224 |
+
];
|
225 |
break;
|
226 |
|
227 |
case 'custom_message_comment_wait' :
|
228 |
$name = __( 'GASP Wait Message', 'wp-simple-firewall' );
|
229 |
$summary = __( 'If you want a custom submit-button wait message, please provide this here.', 'wp-simple-firewall' );
|
230 |
+
$desc = [
|
231 |
+
__( "Where you see the '%s' this will be the number of seconds. You must ensure you include 1, and only 1, of these.", 'wp-simple-firewall' ),
|
232 |
+
sprintf( __( 'Default Message: %s', 'wp-simple-firewall' ), __( 'Please wait %s seconds before posting your comment', 'wp-simple-firewall' ) )
|
233 |
+
];
|
234 |
break;
|
235 |
|
236 |
case 'custom_message_comment_reload' :
|
237 |
$name = __( 'GASP Reload Message', 'wp-simple-firewall' );
|
238 |
$summary = __( 'If you want a custom message when the comment token has expired, please provide this here.', 'wp-simple-firewall' );
|
239 |
+
$desc = [
|
240 |
+
__( 'This message is displayed on the submit-button when the comment token is expired', 'wp-simple-firewall' ),
|
241 |
+
sprintf( __( 'Default Message: %s', 'wp-simple-firewall' ), __( "Please reload this page to post a comment", 'wp-simple-firewall' ) )
|
242 |
+
];
|
243 |
break;
|
244 |
|
245 |
default:
|
src/lib/src/Modules/CommentsFilter/Upgrade.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\CommentsFilter;
|
4 |
|
@@ -6,4 +6,17 @@ use FernleafSystems\Wordpress\Plugin\Shield\Modules\Base;
|
|
6 |
|
7 |
class Upgrade extends Base\Upgrade {
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
}
|
1 |
+
<?php declare( strict_types=1 );
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\CommentsFilter;
|
4 |
|
6 |
|
7 |
class Upgrade extends Base\Upgrade {
|
8 |
|
9 |
+
/**
|
10 |
+
* 'enable_antibot_check' option key was used in both Comments and Login Guard.
|
11 |
+
* So we needed to move 1 of them to a new, unique, option key.
|
12 |
+
*
|
13 |
+
* In this upgrade we switch over the spam bot detection to now use ADE
|
14 |
+
*/
|
15 |
+
protected function upgrade_1411() {
|
16 |
+
/** @var Options $opts */
|
17 |
+
$opts = $this->getOptions();
|
18 |
+
if ( $opts->isOpt( 'enable_antibot_check', 'Y' ) || $opts->isEnabledCaptcha() || $opts->isEnabledGaspCheck() ) {
|
19 |
+
$opts->setEnabledAntiBot();
|
20 |
+
}
|
21 |
+
}
|
22 |
}
|
src/lib/src/Modules/Comms/Strings.php
CHANGED
@@ -26,11 +26,6 @@ class Strings extends Base\Strings {
|
|
26 |
];
|
27 |
}
|
28 |
|
29 |
-
/**
|
30 |
-
* @param string $section
|
31 |
-
* @return array
|
32 |
-
* @throws \Exception
|
33 |
-
*/
|
34 |
public function getSectionStrings( string $section ) :array {
|
35 |
switch ( $section ) {
|
36 |
case 'section_suresend' :
|
@@ -49,11 +44,6 @@ class Strings extends Base\Strings {
|
|
49 |
];
|
50 |
}
|
51 |
|
52 |
-
/**
|
53 |
-
* @param string $key
|
54 |
-
* @return array
|
55 |
-
* @throws \Exception
|
56 |
-
*/
|
57 |
public function getOptionStrings( string $key ) :array {
|
58 |
switch ( $key ) {
|
59 |
|
26 |
];
|
27 |
}
|
28 |
|
|
|
|
|
|
|
|
|
|
|
29 |
public function getSectionStrings( string $section ) :array {
|
30 |
switch ( $section ) {
|
31 |
case 'section_suresend' :
|
44 |
];
|
45 |
}
|
46 |
|
|
|
|
|
|
|
|
|
|
|
47 |
public function getOptionStrings( string $key ) :array {
|
48 |
switch ( $key ) {
|
49 |
|
src/lib/src/Modules/Data/DB/ReqLogs/LoadLogs.php
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\Data\DB\ReqLogs;
|
4 |
|
|
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\Data\ModCon;
|
6 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\IPs\Components\IpAddressConsumer;
|
7 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\ModConsumer;
|
@@ -13,7 +14,7 @@ use FernleafSystems\Wordpress\Services\Services;
|
|
13 |
* @property string[] $wheres
|
14 |
* @property string $order_dir
|
15 |
*/
|
16 |
-
class LoadLogs {
|
17 |
|
18 |
use ModConsumer;
|
19 |
use IpAddressConsumer;
|
@@ -57,6 +58,7 @@ class LoadLogs {
|
|
57 |
$selectFields = [
|
58 |
'req.id',
|
59 |
'req.req_id as rid',
|
|
|
60 |
'req.type',
|
61 |
'req.path',
|
62 |
'req.code',
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\Data\DB\ReqLogs;
|
4 |
|
5 |
+
use FernleafSystems\Utilities\Data\Adapter\DynPropertiesClass;
|
6 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\Data\ModCon;
|
7 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\IPs\Components\IpAddressConsumer;
|
8 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\ModConsumer;
|
14 |
* @property string[] $wheres
|
15 |
* @property string $order_dir
|
16 |
*/
|
17 |
+
class LoadLogs extends DynPropertiesClass {
|
18 |
|
19 |
use ModConsumer;
|
20 |
use IpAddressConsumer;
|
58 |
$selectFields = [
|
59 |
'req.id',
|
60 |
'req.req_id as rid',
|
61 |
+
'req.uid',
|
62 |
'req.type',
|
63 |
'req.path',
|
64 |
'req.code',
|
src/lib/src/Modules/Data/DB/ReqLogs/Ops/Handler.php
CHANGED
@@ -6,28 +6,46 @@ use FernleafSystems\Wordpress\Plugin\Core\Databases\Base;
|
|
6 |
|
7 |
class Handler extends Base\Handler {
|
8 |
|
9 |
-
const TYPE_AJAX = '
|
10 |
-
const TYPE_CRON = '
|
11 |
-
const
|
12 |
-
const
|
13 |
-
const
|
14 |
-
const
|
|
|
|
|
|
|
15 |
|
16 |
public static function GetTypeName( string $type ) :string {
|
17 |
switch ( $type ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
case Handler::TYPE_REST:
|
19 |
$type = 'REST API';
|
20 |
break;
|
21 |
-
case Handler::TYPE_XMLRPC:
|
22 |
-
$type = 'XML-RPC';
|
23 |
-
break;
|
24 |
case Handler::TYPE_WPCLI:
|
25 |
$type = 'WP-CLI';
|
26 |
break;
|
|
|
|
|
|
|
|
|
27 |
case Handler::TYPE_HTTP:
|
28 |
-
case Handler::TYPE_AJAX:
|
29 |
-
case Handler::TYPE_CRON:
|
30 |
default:
|
|
|
31 |
break;
|
32 |
}
|
33 |
return $type;
|
6 |
|
7 |
class Handler extends Base\Handler {
|
8 |
|
9 |
+
const TYPE_AJAX = 'A';
|
10 |
+
const TYPE_CRON = 'C';
|
11 |
+
const TYPE_COMMENT = 'M';
|
12 |
+
const TYPE_HTTP = 'H';
|
13 |
+
const TYPE_LOGIN = 'L';
|
14 |
+
const TYPE_2FA = '2';
|
15 |
+
const TYPE_REST = 'R';
|
16 |
+
const TYPE_WPCLI = 'W';
|
17 |
+
const TYPE_XMLRPC = 'X';
|
18 |
|
19 |
public static function GetTypeName( string $type ) :string {
|
20 |
switch ( $type ) {
|
21 |
+
case Handler::TYPE_AJAX:
|
22 |
+
$type = 'AJAX';
|
23 |
+
break;
|
24 |
+
case Handler::TYPE_COMMENT:
|
25 |
+
$type = 'COMMENT';
|
26 |
+
break;
|
27 |
+
case Handler::TYPE_CRON:
|
28 |
+
$type = 'CRON';
|
29 |
+
break;
|
30 |
+
case Handler::TYPE_LOGIN:
|
31 |
+
$type = 'LOGIN';
|
32 |
+
break;
|
33 |
+
case Handler::TYPE_2FA:
|
34 |
+
$type = '2FA';
|
35 |
+
break;
|
36 |
case Handler::TYPE_REST:
|
37 |
$type = 'REST API';
|
38 |
break;
|
|
|
|
|
|
|
39 |
case Handler::TYPE_WPCLI:
|
40 |
$type = 'WP-CLI';
|
41 |
break;
|
42 |
+
case Handler::TYPE_XMLRPC:
|
43 |
+
$type = 'XML-RPC';
|
44 |
+
break;
|
45 |
+
|
46 |
case Handler::TYPE_HTTP:
|
|
|
|
|
47 |
default:
|
48 |
+
$type = 'HTTP';
|
49 |
break;
|
50 |
}
|
51 |
return $type;
|
src/lib/src/Modules/Data/DB/ReqLogs/Ops/Record.php
CHANGED
@@ -9,6 +9,7 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\Data\DB\ReqLogs\Ops;
|
|
9 |
* @property string $path
|
10 |
* @property string $verb
|
11 |
* @property int $code
|
|
|
12 |
* @property bool $offense
|
13 |
*/
|
14 |
class Record extends \FernleafSystems\Wordpress\Plugin\Core\Databases\Base\Record {
|
@@ -23,6 +24,11 @@ class Record extends \FernleafSystems\Wordpress\Plugin\Core\Databases\Base\Recor
|
|
23 |
$value = (bool)$value;
|
24 |
break;
|
25 |
|
|
|
|
|
|
|
|
|
|
|
26 |
default:
|
27 |
break;
|
28 |
}
|
9 |
* @property string $path
|
10 |
* @property string $verb
|
11 |
* @property int $code
|
12 |
+
* @property int $uid
|
13 |
* @property bool $offense
|
14 |
*/
|
15 |
class Record extends \FernleafSystems\Wordpress\Plugin\Core\Databases\Base\Record {
|
24 |
$value = (bool)$value;
|
25 |
break;
|
26 |
|
27 |
+
case 'code':
|
28 |
+
case 'uid':
|
29 |
+
$value = (int)$value;
|
30 |
+
break;
|
31 |
+
|
32 |
default:
|
33 |
break;
|
34 |
}
|
src/lib/src/Modules/Data/Lib/UpgradeReqLogsTable.php
CHANGED
@@ -53,7 +53,7 @@ class UpgradeReqLogsTable extends ExecOnceModConsumer {
|
|
53 |
|
54 |
if ( $meta[ 'ua' ] === 'wpcli' ) {
|
55 |
$isWpCli = true;
|
56 |
-
$upgradeData[ 'type' ] =
|
57 |
unset( $meta[ 'ua' ] );
|
58 |
}
|
59 |
else {
|
@@ -82,18 +82,23 @@ class UpgradeReqLogsTable extends ExecOnceModConsumer {
|
|
82 |
unset( $meta[ 'verb' ] );
|
83 |
}
|
84 |
|
|
|
|
|
|
|
|
|
|
|
85 |
if ( ( $meta[ 'ua' ] ?? '' ) === 'wpcli' ) {
|
86 |
$upgradeData[ 'type' ] = 'WPCLI';
|
87 |
unset( $meta[ 'ua' ] );
|
88 |
}
|
89 |
elseif ( wp_parse_url( admin_url( 'admin-ajax.php' ), PHP_URL_PATH ) === $upgradeData[ 'path' ] ) {
|
90 |
-
$upgradeData[ 'type' ] =
|
91 |
}
|
92 |
elseif ( wp_parse_url( home_url( 'wp-cron.php' ), PHP_URL_PATH ) === $upgradeData[ 'path' ] ) {
|
93 |
-
$upgradeData[ 'type' ] =
|
94 |
}
|
95 |
elseif ( wp_parse_url( home_url( 'xmlrpc.php' ), PHP_URL_PATH ) === $upgradeData[ 'path' ] ) {
|
96 |
-
$upgradeData[ 'type' ] =
|
97 |
}
|
98 |
|
99 |
$record->meta = $meta;
|
53 |
|
54 |
if ( $meta[ 'ua' ] === 'wpcli' ) {
|
55 |
$isWpCli = true;
|
56 |
+
$upgradeData[ 'type' ] = Handler::TYPE_WPCLI;
|
57 |
unset( $meta[ 'ua' ] );
|
58 |
}
|
59 |
else {
|
82 |
unset( $meta[ 'verb' ] );
|
83 |
}
|
84 |
|
85 |
+
if ( !empty( $meta[ 'uid' ] ) ) {
|
86 |
+
$upgradeData[ 'uid' ] = (int)$meta[ 'uid' ];
|
87 |
+
unset( $meta[ 'uid' ] );
|
88 |
+
}
|
89 |
+
|
90 |
if ( ( $meta[ 'ua' ] ?? '' ) === 'wpcli' ) {
|
91 |
$upgradeData[ 'type' ] = 'WPCLI';
|
92 |
unset( $meta[ 'ua' ] );
|
93 |
}
|
94 |
elseif ( wp_parse_url( admin_url( 'admin-ajax.php' ), PHP_URL_PATH ) === $upgradeData[ 'path' ] ) {
|
95 |
+
$upgradeData[ 'type' ] = Handler::TYPE_AJAX;
|
96 |
}
|
97 |
elseif ( wp_parse_url( home_url( 'wp-cron.php' ), PHP_URL_PATH ) === $upgradeData[ 'path' ] ) {
|
98 |
+
$upgradeData[ 'type' ] = Handler::TYPE_CRON;
|
99 |
}
|
100 |
elseif ( wp_parse_url( home_url( 'xmlrpc.php' ), PHP_URL_PATH ) === $upgradeData[ 'path' ] ) {
|
101 |
+
$upgradeData[ 'type' ] = Handler::TYPE_XMLRPC;
|
102 |
}
|
103 |
|
104 |
$record->meta = $meta;
|
src/lib/src/Modules/Data/Upgrade.php
CHANGED
@@ -7,7 +7,7 @@ use FernleafSystems\Wordpress\Plugin\Shield\Modules\Data\Lib\UpgradeReqLogsTable
|
|
7 |
|
8 |
class Upgrade extends Base\Upgrade {
|
9 |
|
10 |
-
protected function
|
11 |
( new UpgradeReqLogsTable() )
|
12 |
->setMod( $this->getMod() )
|
13 |
->execute();
|
7 |
|
8 |
class Upgrade extends Base\Upgrade {
|
9 |
|
10 |
+
protected function upgrade_1411() {
|
11 |
( new UpgradeReqLogsTable() )
|
12 |
->setMod( $this->getMod() )
|
13 |
->execute();
|
src/lib/src/Modules/Firewall/Strings.php
CHANGED
@@ -6,11 +6,6 @@ use FernleafSystems\Wordpress\Plugin\Shield\Modules\Base;
|
|
6 |
|
7 |
class Strings extends Base\Strings {
|
8 |
|
9 |
-
/**
|
10 |
-
* @param string $section
|
11 |
-
* @return array
|
12 |
-
* @throws \Exception
|
13 |
-
*/
|
14 |
public function getSectionStrings( string $section ) :array {
|
15 |
|
16 |
switch ( $section ) {
|
@@ -65,11 +60,6 @@ class Strings extends Base\Strings {
|
|
65 |
];
|
66 |
}
|
67 |
|
68 |
-
/**
|
69 |
-
* @param string $key
|
70 |
-
* @return array
|
71 |
-
* @throws \Exception
|
72 |
-
*/
|
73 |
public function getOptionStrings( string $key ) :array {
|
74 |
|
75 |
$sModName = $this->getMod()->getMainFeatureName();
|
6 |
|
7 |
class Strings extends Base\Strings {
|
8 |
|
|
|
|
|
|
|
|
|
|
|
9 |
public function getSectionStrings( string $section ) :array {
|
10 |
|
11 |
switch ( $section ) {
|
60 |
];
|
61 |
}
|
62 |
|
|
|
|
|
|
|
|
|
|
|
63 |
public function getOptionStrings( string $key ) :array {
|
64 |
|
65 |
$sModName = $this->getMod()->getMainFeatureName();
|
src/lib/src/Modules/HackGuard/AjaxHandler.php
CHANGED
@@ -11,42 +11,22 @@ use FernleafSystems\Wordpress\Services\Services;
|
|
11 |
|
12 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
13 |
|
14 |
-
protected function
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
case 'scans_check':
|
27 |
-
$response = $this->ajaxExec_CheckScans();
|
28 |
-
break;
|
29 |
-
|
30 |
-
case 'plugin_reinstall':
|
31 |
-
$response = $this->ajaxExec_PluginReinstall();
|
32 |
-
break;
|
33 |
-
|
34 |
-
case 'filelocker_showdiff':
|
35 |
-
$response = $this->ajaxExec_FileLockerShowDiff();
|
36 |
-
break;
|
37 |
-
|
38 |
-
case 'filelocker_fileaction':
|
39 |
-
$response = $this->ajaxExec_FileLockerFileAction();
|
40 |
-
break;
|
41 |
-
|
42 |
-
default:
|
43 |
-
$response = parent::processAjaxAction( $action );
|
44 |
}
|
45 |
-
|
46 |
-
return $response;
|
47 |
}
|
48 |
|
49 |
-
|
50 |
/** @var ModCon $mod */
|
51 |
$mod = $this->getMod();
|
52 |
$FLCon = $mod->getFileLocker();
|
@@ -151,7 +131,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
151 |
];
|
152 |
}
|
153 |
|
154 |
-
|
155 |
/** @var ModCon $mod */
|
156 |
$mod = $this->getMod();
|
157 |
$FLCon = $mod->getFileLocker();
|
@@ -180,7 +160,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
180 |
];
|
181 |
}
|
182 |
|
183 |
-
|
184 |
/** @var ModCon $mod */
|
185 |
$mod = $this->getMod();
|
186 |
$req = Services::Request();
|
@@ -201,7 +181,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
201 |
return [ 'success' => true ];
|
202 |
}
|
203 |
|
204 |
-
|
205 |
/** @var ModCon $mod */
|
206 |
$mod = $this->getMod();
|
207 |
/** @var Strings $strings */
|
@@ -249,7 +229,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
249 |
];
|
250 |
}
|
251 |
|
252 |
-
|
253 |
/** @var ModCon $mod */
|
254 |
$mod = $this->getMod();
|
255 |
/** @var Options $opts */
|
@@ -282,7 +262,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
282 |
];
|
283 |
}
|
284 |
|
285 |
-
|
286 |
try {
|
287 |
return ( new Lib\ScanTables\DelegateAjaxHandler() )
|
288 |
->setMod( $this->getMod() )
|
11 |
|
12 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
13 |
|
14 |
+
protected function getAjaxActionCallbackMap( bool $isAuth ) :array {
|
15 |
+
$map = parent::getAjaxActionCallbackMap( $isAuth );
|
16 |
+
if ( $isAuth ) {
|
17 |
+
$map = array_merge( $map, [
|
18 |
+
'scanresults_action' => [ $this, 'ajaxExec_ScanResultsAction' ],
|
19 |
+
'scans_start' => [ $this, 'ajaxExec_StartScans' ],
|
20 |
+
'scans_check' => [ $this, 'ajaxExec_CheckScans' ],
|
21 |
+
'plugin_reinstall' => [ $this, 'ajaxExec_PluginReinstall' ],
|
22 |
+
'filelocker_showdiff' => [ $this, 'ajaxExec_FileLockerShowDiff' ],
|
23 |
+
'filelocker_fileaction' => [ $this, 'ajaxExec_FileLockerFileAction' ],
|
24 |
+
] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
}
|
26 |
+
return $map;
|
|
|
27 |
}
|
28 |
|
29 |
+
public function ajaxExec_FileLockerShowDiff() :array {
|
30 |
/** @var ModCon $mod */
|
31 |
$mod = $this->getMod();
|
32 |
$FLCon = $mod->getFileLocker();
|
131 |
];
|
132 |
}
|
133 |
|
134 |
+
public function ajaxExec_FileLockerFileAction() :array {
|
135 |
/** @var ModCon $mod */
|
136 |
$mod = $this->getMod();
|
137 |
$FLCon = $mod->getFileLocker();
|
160 |
];
|
161 |
}
|
162 |
|
163 |
+
public function ajaxExec_PluginReinstall() :array {
|
164 |
/** @var ModCon $mod */
|
165 |
$mod = $this->getMod();
|
166 |
$req = Services::Request();
|
181 |
return [ 'success' => true ];
|
182 |
}
|
183 |
|
184 |
+
public function ajaxExec_CheckScans() :array {
|
185 |
/** @var ModCon $mod */
|
186 |
$mod = $this->getMod();
|
187 |
/** @var Strings $strings */
|
229 |
];
|
230 |
}
|
231 |
|
232 |
+
public function ajaxExec_StartScans() :array {
|
233 |
/** @var ModCon $mod */
|
234 |
$mod = $this->getMod();
|
235 |
/** @var Options $opts */
|
262 |
];
|
263 |
}
|
264 |
|
265 |
+
public function ajaxExec_ScanResultsAction() :array {
|
266 |
try {
|
267 |
return ( new Lib\ScanTables\DelegateAjaxHandler() )
|
268 |
->setMod( $this->getMod() )
|
src/lib/src/Modules/HackGuard/Lib/FileLocker/Ops/Accept.php
CHANGED
@@ -6,10 +6,6 @@ use FernleafSystems\Wordpress\Plugin\Shield\Databases\FileLocker;
|
|
6 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\ModCon;
|
7 |
use FernleafSystems\Wordpress\Services\Services;
|
8 |
|
9 |
-
/**
|
10 |
-
* Class Accept
|
11 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\Lib\FileLocker\Ops
|
12 |
-
*/
|
13 |
class Accept extends BaseOps {
|
14 |
|
15 |
/**
|
6 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\ModCon;
|
7 |
use FernleafSystems\Wordpress\Services\Services;
|
8 |
|
|
|
|
|
|
|
|
|
9 |
class Accept extends BaseOps {
|
10 |
|
11 |
/**
|
src/lib/src/Modules/HackGuard/Lib/FileLocker/Ops/BuildEncryptedFilePayload.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\Lib\FileLock
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class BuildEncryptedFilePayload
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\Lib\FileLocker\Ops
|
10 |
-
*/
|
11 |
class BuildEncryptedFilePayload extends BaseOps {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class BuildEncryptedFilePayload extends BaseOps {
|
8 |
|
9 |
/**
|
src/lib/src/Modules/HackGuard/Lib/FileLocker/Ops/Verify.php
CHANGED
@@ -5,10 +5,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\Lib\FileLock
|
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\FileLocker\EntryVO;
|
6 |
use FernleafSystems\Wordpress\Services\Utilities\File\Compare\CompareHash;
|
7 |
|
8 |
-
/**
|
9 |
-
* Class Verify
|
10 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\Lib\FileLocker\Ops
|
11 |
-
*/
|
12 |
class Verify {
|
13 |
|
14 |
/**
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\FileLocker\EntryVO;
|
6 |
use FernleafSystems\Wordpress\Services\Utilities\File\Compare\CompareHash;
|
7 |
|
|
|
|
|
|
|
|
|
8 |
class Verify {
|
9 |
|
10 |
/**
|
src/lib/src/Modules/HackGuard/Lib/Hashes/Query.php
CHANGED
@@ -23,8 +23,6 @@ class Query {
|
|
23 |
use ModConsumer;
|
24 |
|
25 |
/**
|
26 |
-
* @param string $path
|
27 |
-
* @return array
|
28 |
* @throws AssetHashesNotFound
|
29 |
* @throws NoneAssetFileException
|
30 |
* @throws UnrecognisedAssetFile
|
@@ -53,7 +51,6 @@ class Query {
|
|
53 |
}
|
54 |
|
55 |
/**
|
56 |
-
* @param string $path
|
57 |
* @return WpPluginVo|WpThemeVo
|
58 |
* @throws NoneAssetFileException
|
59 |
*/
|
23 |
use ModConsumer;
|
24 |
|
25 |
/**
|
|
|
|
|
26 |
* @throws AssetHashesNotFound
|
27 |
* @throws NoneAssetFileException
|
28 |
* @throws UnrecognisedAssetFile
|
51 |
}
|
52 |
|
53 |
/**
|
|
|
54 |
* @return WpPluginVo|WpThemeVo
|
55 |
* @throws NoneAssetFileException
|
56 |
*/
|
src/lib/src/Modules/HackGuard/Lib/Hashes/Retrieve.php
CHANGED
@@ -3,14 +3,14 @@
|
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\Lib\Hashes;
|
4 |
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\Lib\Hashes\Exceptions\AssetHashesNotFound;
|
6 |
-
use FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\CrowdSourcedHashes\Query;
|
7 |
-
use FernleafSystems\Wordpress\Plugin\Shield\Modules\ModConsumer;
|
8 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\Lib\Snapshots\StoreAction;
|
|
|
9 |
use FernleafSystems\Wordpress\Services\Core\VOs\Assets\{
|
10 |
WpPluginVo,
|
11 |
WpThemeVo
|
12 |
};
|
13 |
use FernleafSystems\Wordpress\Services\Services;
|
|
|
14 |
|
15 |
class Retrieve {
|
16 |
|
@@ -29,7 +29,6 @@ class Retrieve {
|
|
29 |
|
30 |
/**
|
31 |
* @param WpPluginVo|WpThemeVo $vo
|
32 |
-
* @param array $hashes
|
33 |
*/
|
34 |
private function addItemHashesToCache( $vo, array $hashes ) {
|
35 |
if ( $vo->asset_type == 'plugin' ) {
|
@@ -42,7 +41,7 @@ class Retrieve {
|
|
42 |
|
43 |
/**
|
44 |
* @param WpPluginVo|WpThemeVo $vo
|
45 |
-
* @return
|
46 |
*/
|
47 |
private function getAssetHashesFromCache( $vo ) {
|
48 |
$key = ( $vo->asset_type == 'plugin' ) ? 'plugins' : 'themes';
|
@@ -62,8 +61,6 @@ class Retrieve {
|
|
62 |
}
|
63 |
|
64 |
/**
|
65 |
-
* @param string $slug
|
66 |
-
* @return array
|
67 |
* @throws AssetHashesNotFound
|
68 |
* @throws \Exception
|
69 |
*/
|
@@ -80,7 +77,6 @@ class Retrieve {
|
|
80 |
|
81 |
/**
|
82 |
* @param WpPluginVo|WpThemeVo $vo
|
83 |
-
* @return array
|
84 |
* @throws AssetHashesNotFound|\Exception
|
85 |
*/
|
86 |
public function byVO( $vo ) :array {
|
@@ -107,7 +103,6 @@ class Retrieve {
|
|
107 |
|
108 |
/**
|
109 |
* @param WpPluginVo|WpThemeVo $vo
|
110 |
-
* @return array
|
111 |
*/
|
112 |
public function fromCsHashes( $vo ) :array {
|
113 |
$query = ( $vo->asset_type == 'plugin' ) ? new Query\Plugin() : new Query\Theme();
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\Lib\Hashes;
|
4 |
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\Lib\Hashes\Exceptions\AssetHashesNotFound;
|
|
|
|
|
6 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\Lib\Snapshots\StoreAction;
|
7 |
+
use FernleafSystems\Wordpress\Plugin\Shield\Modules\ModConsumer;
|
8 |
use FernleafSystems\Wordpress\Services\Core\VOs\Assets\{
|
9 |
WpPluginVo,
|
10 |
WpThemeVo
|
11 |
};
|
12 |
use FernleafSystems\Wordpress\Services\Services;
|
13 |
+
use FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\CrowdSourcedHashes\Query;
|
14 |
|
15 |
class Retrieve {
|
16 |
|
29 |
|
30 |
/**
|
31 |
* @param WpPluginVo|WpThemeVo $vo
|
|
|
32 |
*/
|
33 |
private function addItemHashesToCache( $vo, array $hashes ) {
|
34 |
if ( $vo->asset_type == 'plugin' ) {
|
41 |
|
42 |
/**
|
43 |
* @param WpPluginVo|WpThemeVo $vo
|
44 |
+
* @return array|null
|
45 |
*/
|
46 |
private function getAssetHashesFromCache( $vo ) {
|
47 |
$key = ( $vo->asset_type == 'plugin' ) ? 'plugins' : 'themes';
|
61 |
}
|
62 |
|
63 |
/**
|
|
|
|
|
64 |
* @throws AssetHashesNotFound
|
65 |
* @throws \Exception
|
66 |
*/
|
77 |
|
78 |
/**
|
79 |
* @param WpPluginVo|WpThemeVo $vo
|
|
|
80 |
* @throws AssetHashesNotFound|\Exception
|
81 |
*/
|
82 |
public function byVO( $vo ) :array {
|
103 |
|
104 |
/**
|
105 |
* @param WpPluginVo|WpThemeVo $vo
|
|
|
106 |
*/
|
107 |
public function fromCsHashes( $vo ) :array {
|
108 |
$query = ( $vo->asset_type == 'plugin' ) ? new Query\Plugin() : new Query\Theme();
|
src/lib/src/Modules/HackGuard/Lib/ScanTables/DelegateAjaxHandler.php
CHANGED
@@ -13,7 +13,6 @@ class DelegateAjaxHandler {
|
|
13 |
use Shield\Modules\ModConsumer;
|
14 |
|
15 |
/**
|
16 |
-
* @return array
|
17 |
* @throws \Exception
|
18 |
*/
|
19 |
public function processAjaxAction() :array {
|
13 |
use Shield\Modules\ModConsumer;
|
14 |
|
15 |
/**
|
|
|
16 |
* @throws \Exception
|
17 |
*/
|
18 |
public function processAjaxAction() :array {
|
src/lib/src/Modules/HackGuard/Lib/Snapshots/Build/BuildHashesForAsset.php
CHANGED
@@ -7,10 +7,6 @@ use FernleafSystems\Wordpress\Services\Core\VOs\Assets\{
|
|
7 |
WpThemeVo
|
8 |
};
|
9 |
|
10 |
-
/**
|
11 |
-
* Class BuildHashesForAsset
|
12 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\Lib\Snapshots\Build
|
13 |
-
*/
|
14 |
class BuildHashesForAsset {
|
15 |
|
16 |
/**
|
7 |
WpThemeVo
|
8 |
};
|
9 |
|
|
|
|
|
|
|
|
|
10 |
class BuildHashesForAsset {
|
11 |
|
12 |
/**
|
src/lib/src/Modules/HackGuard/Lib/Snapshots/Build/BuildHashesFromApi.php
CHANGED
@@ -8,10 +8,6 @@ use FernleafSystems\Wordpress\Services\Core\VOs\Assets\{
|
|
8 |
};
|
9 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Hashes;
|
10 |
|
11 |
-
/**
|
12 |
-
* Class BuildHashesFromApi
|
13 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\Lib\Snapshots\Build
|
14 |
-
*/
|
15 |
class BuildHashesFromApi {
|
16 |
|
17 |
/**
|
8 |
};
|
9 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Hashes;
|
10 |
|
|
|
|
|
|
|
|
|
11 |
class BuildHashesFromApi {
|
12 |
|
13 |
/**
|
src/lib/src/Modules/HackGuard/Lib/Snapshots/Build/BuildHashesFromDir.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\Lib\Snapshot
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Scans\Helpers\StandardDirectoryIterator;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class BuildHashesFromDir
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\HackGuard\Lib\Snapshots\Build
|
10 |
-
*/
|
11 |
class BuildHashesFromDir {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Scans\Helpers\StandardDirectoryIterator;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class BuildHashesFromDir {
|
8 |
|
9 |
/**
|
src/lib/src/Modules/Headers/Processor.php
CHANGED
@@ -131,8 +131,7 @@ class Processor extends BaseShield\Processor {
|
|
131 |
private function getReferrerPolicyHeader() :array {
|
132 |
/** @var Options $opts */
|
133 |
$opts = $this->getOptions();
|
134 |
-
return $opts->isReferrerPolicyEnabled() ?
|
135 |
-
[ 'Referrer-Policy' => $opts->getReferrerPolicyValue() ] : [];
|
136 |
}
|
137 |
|
138 |
private function setContentSecurityPolicyHeader() :array {
|
131 |
private function getReferrerPolicyHeader() :array {
|
132 |
/** @var Options $opts */
|
133 |
$opts = $this->getOptions();
|
134 |
+
return $opts->isReferrerPolicyEnabled() ? [ 'Referrer-Policy' => $opts->getReferrerPolicyValue() ] : [];
|
|
|
135 |
}
|
136 |
|
137 |
private function setContentSecurityPolicyHeader() :array {
|
src/lib/src/Modules/Headers/Strings.php
CHANGED
@@ -6,41 +6,35 @@ use FernleafSystems\Wordpress\Plugin\Shield\Modules\Base;
|
|
6 |
|
7 |
class Strings extends Base\Strings {
|
8 |
|
9 |
-
/**
|
10 |
-
* @param string $section
|
11 |
-
* @return array
|
12 |
-
* @throws \Exception
|
13 |
-
*/
|
14 |
public function getSectionStrings( string $section ) :array {
|
15 |
|
16 |
switch ( $section ) {
|
17 |
|
18 |
case 'section_enable_plugin_feature_headers' :
|
19 |
-
$
|
20 |
-
$
|
21 |
-
|
22 |
-
$aSummary = [
|
23 |
sprintf( '%s - %s', __( 'Purpose', 'wp-simple-firewall' ), __( 'Protect visitors to your site by implementing increased security response headers.', 'wp-simple-firewall' ) ),
|
24 |
sprintf( '%s - %s', __( 'Recommendation', 'wp-simple-firewall' ), __( 'Enabling these features are advised, but you must test them on your site thoroughly.', 'wp-simple-firewall' ) )
|
25 |
];
|
26 |
break;
|
27 |
|
28 |
case 'section_security_headers' :
|
29 |
-
$
|
30 |
-
$
|
|
|
31 |
sprintf( '%s - %s', __( 'Purpose', 'wp-simple-firewall' ), __( 'Protect visitors to your site by implementing increased security response headers.', 'wp-simple-firewall' ) ),
|
32 |
sprintf( '%s - %s', __( 'Recommendation', 'wp-simple-firewall' ), __( 'Enabling these features are advised, but you must test them on your site thoroughly.', 'wp-simple-firewall' ) )
|
33 |
];
|
34 |
-
$sTitleShort = __( 'Security Headers', 'wp-simple-firewall' );
|
35 |
break;
|
36 |
|
37 |
case 'section_content_security_policy' :
|
38 |
-
$
|
39 |
-
$
|
40 |
sprintf( '%s - %s', __( 'Purpose', 'wp-simple-firewall' ), __( 'Restrict the sources and types of content that may be loaded and processed by visitor browsers.', 'wp-simple-firewall' ) ),
|
41 |
sprintf( '%s - %s', __( 'Recommendation', 'wp-simple-firewall' ), __( 'Enabling these features are advised, but you must test them on your site thoroughly.', 'wp-simple-firewall' ) )
|
42 |
];
|
43 |
-
$
|
44 |
break;
|
45 |
|
46 |
default:
|
@@ -48,17 +42,12 @@ class Strings extends Base\Strings {
|
|
48 |
}
|
49 |
|
50 |
return [
|
51 |
-
'title' => $
|
52 |
-
'title_short' => $
|
53 |
-
'summary' =>
|
54 |
];
|
55 |
}
|
56 |
|
57 |
-
/**
|
58 |
-
* @param string $key
|
59 |
-
* @return array
|
60 |
-
* @throws \Exception
|
61 |
-
*/
|
62 |
public function getOptionStrings( string $key ) :array {
|
63 |
$sModName = $this->getMod()->getMainFeatureName();
|
64 |
|
6 |
|
7 |
class Strings extends Base\Strings {
|
8 |
|
|
|
|
|
|
|
|
|
|
|
9 |
public function getSectionStrings( string $section ) :array {
|
10 |
|
11 |
switch ( $section ) {
|
12 |
|
13 |
case 'section_enable_plugin_feature_headers' :
|
14 |
+
$titleShort = sprintf( '%s/%s', __( 'On', 'wp-simple-firewall' ), __( 'Off', 'wp-simple-firewall' ) );
|
15 |
+
$title = sprintf( __( 'Enable Module: %s', 'wp-simple-firewall' ), $this->getMod()->getMainFeatureName() );
|
16 |
+
$summary = [
|
|
|
17 |
sprintf( '%s - %s', __( 'Purpose', 'wp-simple-firewall' ), __( 'Protect visitors to your site by implementing increased security response headers.', 'wp-simple-firewall' ) ),
|
18 |
sprintf( '%s - %s', __( 'Recommendation', 'wp-simple-firewall' ), __( 'Enabling these features are advised, but you must test them on your site thoroughly.', 'wp-simple-firewall' ) )
|
19 |
];
|
20 |
break;
|
21 |
|
22 |
case 'section_security_headers' :
|
23 |
+
$title = __( 'Advanced Security Headers', 'wp-simple-firewall' );
|
24 |
+
$titleShort = __( 'Security Headers', 'wp-simple-firewall' );
|
25 |
+
$summary = [
|
26 |
sprintf( '%s - %s', __( 'Purpose', 'wp-simple-firewall' ), __( 'Protect visitors to your site by implementing increased security response headers.', 'wp-simple-firewall' ) ),
|
27 |
sprintf( '%s - %s', __( 'Recommendation', 'wp-simple-firewall' ), __( 'Enabling these features are advised, but you must test them on your site thoroughly.', 'wp-simple-firewall' ) )
|
28 |
];
|
|
|
29 |
break;
|
30 |
|
31 |
case 'section_content_security_policy' :
|
32 |
+
$title = __( 'Content Security Policy', 'wp-simple-firewall' );
|
33 |
+
$summary = [
|
34 |
sprintf( '%s - %s', __( 'Purpose', 'wp-simple-firewall' ), __( 'Restrict the sources and types of content that may be loaded and processed by visitor browsers.', 'wp-simple-firewall' ) ),
|
35 |
sprintf( '%s - %s', __( 'Recommendation', 'wp-simple-firewall' ), __( 'Enabling these features are advised, but you must test them on your site thoroughly.', 'wp-simple-firewall' ) )
|
36 |
];
|
37 |
+
$titleShort = __( 'Content Security Policy', 'wp-simple-firewall' );
|
38 |
break;
|
39 |
|
40 |
default:
|
42 |
}
|
43 |
|
44 |
return [
|
45 |
+
'title' => $title,
|
46 |
+
'title_short' => $titleShort,
|
47 |
+
'summary' => $summary,
|
48 |
];
|
49 |
}
|
50 |
|
|
|
|
|
|
|
|
|
|
|
51 |
public function getOptionStrings( string $key ) :array {
|
52 |
$sModName = $this->getMod()->getMainFeatureName();
|
53 |
|
src/lib/src/Modules/IPs/AjaxHandler.php
CHANGED
@@ -11,58 +11,24 @@ use FernleafSystems\Wordpress\Services\Utilities\Net\IpID;
|
|
11 |
|
12 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
13 |
|
14 |
-
protected function
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
break;
|
28 |
-
|
29 |
-
case 'build_ip_analyse':
|
30 |
-
$response = $this->ajaxExec_BuildIpAnalyse();
|
31 |
-
break;
|
32 |
-
|
33 |
-
case 'ip_analyse_action':
|
34 |
-
$response = $this->ajaxExec_IpAnalyseAction();
|
35 |
-
break;
|
36 |
-
|
37 |
-
case 'ip_review_select':
|
38 |
-
$response = $this->ajaxExec_IpReviewSelect();
|
39 |
-
break;
|
40 |
-
|
41 |
-
case 'not_bot':
|
42 |
-
$response = $this->ajaxExec_CaptureNotBot();
|
43 |
-
break;
|
44 |
-
|
45 |
-
default:
|
46 |
-
$response = parent::processAjaxAction( $action );
|
47 |
}
|
48 |
-
|
49 |
-
return $response;
|
50 |
-
}
|
51 |
-
|
52 |
-
protected function processNonAuthAjaxAction( string $action ) :array {
|
53 |
-
|
54 |
-
switch ( $action ) {
|
55 |
-
case 'not_bot':
|
56 |
-
$response = $this->ajaxExec_CaptureNotBot();
|
57 |
-
break;
|
58 |
-
default:
|
59 |
-
$response = parent::processNonAuthAjaxAction( $action );
|
60 |
-
}
|
61 |
-
|
62 |
-
return $response;
|
63 |
}
|
64 |
|
65 |
-
|
66 |
/** @var ModCon $mod */
|
67 |
$mod = $this->getMod();
|
68 |
return [
|
@@ -72,7 +38,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
72 |
];
|
73 |
}
|
74 |
|
75 |
-
|
76 |
/** @var ModCon $mod */
|
77 |
$mod = $this->getMod();
|
78 |
$srvIP = Services::IP();
|
@@ -152,7 +118,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
152 |
];
|
153 |
}
|
154 |
|
155 |
-
|
156 |
/** @var ModCon $mod */
|
157 |
$mod = $this->getMod();
|
158 |
$success = false;
|
@@ -183,7 +149,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
183 |
];
|
184 |
}
|
185 |
|
186 |
-
|
187 |
/** @var ModCon $mod */
|
188 |
$mod = $this->getMod();
|
189 |
|
@@ -199,7 +165,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
199 |
];
|
200 |
}
|
201 |
|
202 |
-
|
203 |
$req = Services::Request();
|
204 |
|
205 |
$filter = preg_replace( '#[^0-9a-f:.]#', '', strtolower( (string)$req->post( 'search' ) ) );
|
@@ -220,7 +186,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
220 |
];
|
221 |
}
|
222 |
|
223 |
-
|
224 |
$req = Services::Request();
|
225 |
|
226 |
$ip = $req->post( 'ip' );
|
@@ -317,7 +283,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
317 |
];
|
318 |
}
|
319 |
|
320 |
-
|
321 |
try {
|
322 |
$ip = Services::Request()->post( 'fIp', '' );
|
323 |
$response = ( new Shield\Modules\IPs\Lib\IpAnalyse\BuildDisplay() )
|
11 |
|
12 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
13 |
|
14 |
+
protected function getAjaxActionCallbackMap( bool $isAuth ) :array {
|
15 |
+
$map = array_merge( parent::getAjaxActionCallbackMap( $isAuth ), [
|
16 |
+
'not_bot' => [ $this, 'ajaxExec_CaptureNotBot' ],
|
17 |
+
] );
|
18 |
+
if ( $isAuth ) {
|
19 |
+
$map = array_merge( $map, [
|
20 |
+
'ip_insert' => [ $this, 'ajaxExec_AddIp' ],
|
21 |
+
'ip_delete' => [ $this, 'ajaxExec_IpDelete' ],
|
22 |
+
'render_table_ip' => [ $this, 'ajaxExec_BuildTableIps' ],
|
23 |
+
'ip_analyse_build' => [ $this, 'ajaxExec_BuildIpAnalyse' ],
|
24 |
+
'ip_analyse_action' => [ $this, 'ajaxExec_IpAnalyseAction' ],
|
25 |
+
'ip_review_select' => [ $this, 'ajaxExec_IpReviewSelect' ],
|
26 |
+
] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
}
|
28 |
+
return $map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
}
|
30 |
|
31 |
+
public function ajaxExec_CaptureNotBot() :array {
|
32 |
/** @var ModCon $mod */
|
33 |
$mod = $this->getMod();
|
34 |
return [
|
38 |
];
|
39 |
}
|
40 |
|
41 |
+
public function ajaxExec_AddIp() :array {
|
42 |
/** @var ModCon $mod */
|
43 |
$mod = $this->getMod();
|
44 |
$srvIP = Services::IP();
|
118 |
];
|
119 |
}
|
120 |
|
121 |
+
public function ajaxExec_IpDelete() :array {
|
122 |
/** @var ModCon $mod */
|
123 |
$mod = $this->getMod();
|
124 |
$success = false;
|
149 |
];
|
150 |
}
|
151 |
|
152 |
+
public function ajaxExec_BuildTableIps() :array {
|
153 |
/** @var ModCon $mod */
|
154 |
$mod = $this->getMod();
|
155 |
|
165 |
];
|
166 |
}
|
167 |
|
168 |
+
public function ajaxExec_IpReviewSelect() :array {
|
169 |
$req = Services::Request();
|
170 |
|
171 |
$filter = preg_replace( '#[^0-9a-f:.]#', '', strtolower( (string)$req->post( 'search' ) ) );
|
186 |
];
|
187 |
}
|
188 |
|
189 |
+
public function ajaxExec_IpAnalyseAction() :array {
|
190 |
$req = Services::Request();
|
191 |
|
192 |
$ip = $req->post( 'ip' );
|
283 |
];
|
284 |
}
|
285 |
|
286 |
+
public function ajaxExec_BuildIpAnalyse() :array {
|
287 |
try {
|
288 |
$ip = Services::Request()->post( 'fIp', '' );
|
289 |
$response = ( new Shield\Modules\IPs\Lib\IpAnalyse\BuildDisplay() )
|
src/lib/src/Modules/IPs/BotTrack/TrackLinkCheese.php
CHANGED
@@ -7,8 +7,6 @@ use FernleafSystems\Wordpress\Services\Services;
|
|
7 |
|
8 |
/**
|
9 |
* Works by inserting a random, nofollow link to the footer of the page and appending to robots.txt
|
10 |
-
* Class LinkCheese
|
11 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\IPs\BotTrack
|
12 |
*/
|
13 |
class TrackLinkCheese extends Base {
|
14 |
|
7 |
|
8 |
/**
|
9 |
* Works by inserting a random, nofollow link to the footer of the page and appending to robots.txt
|
|
|
|
|
10 |
*/
|
11 |
class TrackLinkCheese extends Base {
|
12 |
|
src/lib/src/Modules/IPs/Components/ProcessOffense.php
CHANGED
@@ -8,8 +8,6 @@ use FernleafSystems\Wordpress\Plugin\Shield\Modules\IPs;
|
|
8 |
|
9 |
/**
|
10 |
* NOT IMPLEMENTED
|
11 |
-
* Class ProcessOffense
|
12 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\IPs\Components
|
13 |
*/
|
14 |
class ProcessOffense {
|
15 |
|
8 |
|
9 |
/**
|
10 |
* NOT IMPLEMENTED
|
|
|
|
|
11 |
*/
|
12 |
class ProcessOffense {
|
13 |
|
src/lib/src/Modules/IPs/Components/QueryIpBlock.php
CHANGED
@@ -15,8 +15,8 @@ class QueryIpBlock {
|
|
15 |
public function run() :bool {
|
16 |
$isBlocked = false;
|
17 |
|
18 |
-
$
|
19 |
-
if ( $
|
20 |
|
21 |
$isBlocked = true;
|
22 |
|
@@ -24,7 +24,7 @@ class QueryIpBlock {
|
|
24 |
$mod = $this->getMod();
|
25 |
/** @var Databases\IPs\Update $upd */
|
26 |
$upd = $mod->getDbHandler_IPs()->getQueryUpdater();
|
27 |
-
$upd->updateLastAccessAt( $
|
28 |
}
|
29 |
return $isBlocked;
|
30 |
}
|
15 |
public function run() :bool {
|
16 |
$isBlocked = false;
|
17 |
|
18 |
+
$oIP = $this->getBlockedIpRecord();
|
19 |
+
if ( $oIP instanceof Databases\IPs\EntryVO ) {
|
20 |
|
21 |
$isBlocked = true;
|
22 |
|
24 |
$mod = $this->getMod();
|
25 |
/** @var Databases\IPs\Update $upd */
|
26 |
$upd = $mod->getDbHandler_IPs()->getQueryUpdater();
|
27 |
+
$upd->updateLastAccessAt( $oIP );
|
28 |
}
|
29 |
return $isBlocked;
|
30 |
}
|
src/lib/src/Modules/IPs/Components/QueryRemainingOffenses.php
CHANGED
@@ -6,10 +6,6 @@ use FernleafSystems\Wordpress\Plugin\Shield;
|
|
6 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases;
|
7 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\IPs;
|
8 |
|
9 |
-
/**
|
10 |
-
* Class QueryRemainingOffenses
|
11 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\IPs\Components
|
12 |
-
*/
|
13 |
class QueryRemainingOffenses {
|
14 |
|
15 |
use Shield\Modules\ModConsumer;
|
6 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases;
|
7 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\IPs;
|
8 |
|
|
|
|
|
|
|
|
|
9 |
class QueryRemainingOffenses {
|
10 |
|
11 |
use Shield\Modules\ModConsumer;
|
src/lib/src/Modules/IPs/Lib/IpAnalyse/BuildDisplay.php
CHANGED
@@ -290,10 +290,6 @@ class BuildDisplay {
|
|
290 |
}
|
291 |
$asArray[ 'query' ] = esc_js( $asArray[ 'query' ] );
|
292 |
$asArray[ 'trans' ] = (bool)$asArray[ 'offense' ];
|
293 |
-
|
294 |
-
if ( empty( $asArray[ 'path' ] ) ) {
|
295 |
-
$asArray = null;
|
296 |
-
}
|
297 |
$requests[ $key ] = $asArray;
|
298 |
}
|
299 |
|
290 |
}
|
291 |
$asArray[ 'query' ] = esc_js( $asArray[ 'query' ] );
|
292 |
$asArray[ 'trans' ] = (bool)$asArray[ 'offense' ];
|
|
|
|
|
|
|
|
|
293 |
$requests[ $key ] = $asArray;
|
294 |
}
|
295 |
|
src/lib/src/Modules/IPs/Lib/Ops/AddIp.php
CHANGED
@@ -7,10 +7,6 @@ use FernleafSystems\Wordpress\Plugin\Shield\Modules;
|
|
7 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\IPs\ModCon;
|
8 |
use FernleafSystems\Wordpress\Services\Services;
|
9 |
|
10 |
-
/**
|
11 |
-
* Class AddIp
|
12 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\IPs\Lib\Ops
|
13 |
-
*/
|
14 |
class AddIp {
|
15 |
|
16 |
use Modules\ModConsumer;
|
7 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\IPs\ModCon;
|
8 |
use FernleafSystems\Wordpress\Services\Services;
|
9 |
|
|
|
|
|
|
|
|
|
10 |
class AddIp {
|
11 |
|
12 |
use Modules\ModConsumer;
|
src/lib/src/Modules/IPs/Strings.php
CHANGED
@@ -157,11 +157,6 @@ class Strings extends Base\Strings {
|
|
157 |
];
|
158 |
}
|
159 |
|
160 |
-
/**
|
161 |
-
* @param string $section
|
162 |
-
* @return array
|
163 |
-
* @throws \Exception
|
164 |
-
*/
|
165 |
public function getSectionStrings( string $section ) :array {
|
166 |
/** @var ModCon $mod */
|
167 |
$mod = $this->getMod();
|
157 |
];
|
158 |
}
|
159 |
|
|
|
|
|
|
|
|
|
|
|
160 |
public function getSectionStrings( string $section ) :array {
|
161 |
/** @var ModCon $mod */
|
162 |
$mod = $this->getMod();
|
src/lib/src/Modules/IPs/UI.php
CHANGED
@@ -123,7 +123,7 @@ class UI extends BaseShield\UI {
|
|
123 |
'/wpadmin_pages/insights/ips/ip_analyse/index.twig',
|
124 |
[
|
125 |
'ajax' => [
|
126 |
-
'
|
127 |
'ip_analyse_action' => $mod->getAjaxActionData( 'ip_analyse_action', true ),
|
128 |
'ip_review_select' => $mod->getAjaxActionData( 'ip_review_select', true ),
|
129 |
],
|
123 |
'/wpadmin_pages/insights/ips/ip_analyse/index.twig',
|
124 |
[
|
125 |
'ajax' => [
|
126 |
+
'ip_analyse_build' => $mod->getAjaxActionData( 'ip_analyse_build', true ),
|
127 |
'ip_analyse_action' => $mod->getAjaxActionData( 'ip_analyse_action', true ),
|
128 |
'ip_review_select' => $mod->getAjaxActionData( 'ip_review_select', true ),
|
129 |
],
|
src/lib/src/Modules/Insights/AjaxHandler.php
CHANGED
@@ -6,22 +6,17 @@ use FernleafSystems\Wordpress\Plugin\Shield;
|
|
6 |
|
7 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
8 |
|
9 |
-
protected function
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
default:
|
17 |
-
$response = parent::processAjaxAction( $action );
|
18 |
}
|
19 |
-
|
20 |
-
return $response;
|
21 |
}
|
22 |
|
23 |
-
|
24 |
-
|
25 |
try {
|
26 |
$pageData = ( new Lib\Requests\DynamicPageLoader() )
|
27 |
->setMod( $this->getMod() )
|
6 |
|
7 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
8 |
|
9 |
+
protected function getAjaxActionCallbackMap( bool $isAuth ) :array {
|
10 |
+
$map = parent::getAjaxActionCallbackMap( $isAuth );
|
11 |
+
if ( $isAuth ) {
|
12 |
+
$map = array_merge( $map, [
|
13 |
+
'dynamic_load' => [ $this, 'ajaxExec_DynamicLoad' ],
|
14 |
+
] );
|
|
|
|
|
|
|
15 |
}
|
16 |
+
return $map;
|
|
|
17 |
}
|
18 |
|
19 |
+
public function ajaxExec_DynamicLoad() :array {
|
|
|
20 |
try {
|
21 |
$pageData = ( new Lib\Requests\DynamicPageLoader() )
|
22 |
->setMod( $this->getMod() )
|
src/lib/src/Modules/Insights/Lib/Requests/DynamicPageLoader.php
CHANGED
@@ -7,8 +7,6 @@ use FernleafSystems\Wordpress\Plugin\Shield\Modules\Base\ModCon;
|
|
7 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\ModConsumer;
|
8 |
|
9 |
/**
|
10 |
-
* Class DynamicPageLoader
|
11 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\Insights\Lib\Requests
|
12 |
* @property string $load_type
|
13 |
* @property string $load_variant
|
14 |
*/
|
7 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\ModConsumer;
|
8 |
|
9 |
/**
|
|
|
|
|
10 |
* @property string $load_type
|
11 |
* @property string $load_variant
|
12 |
*/
|
src/lib/src/Modules/Integrations/Lib/Bots/Spam/Handlers/NinjaForms.php
CHANGED
@@ -12,9 +12,6 @@ use FernleafSystems\Wordpress\Plugin\Shield\Modules\Integrations\Lib\Bots\Spam\H
|
|
12 |
* registered action.
|
13 |
*
|
14 |
* Unfortunately the action register is executed early and so hooking to Init breaks it.
|
15 |
-
*
|
16 |
-
* Class NinjaForms
|
17 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\Integrations\Lib\Bots\Spam\Handlers
|
18 |
*/
|
19 |
class NinjaForms extends Base {
|
20 |
|
12 |
* registered action.
|
13 |
*
|
14 |
* Unfortunately the action register is executed early and so hooking to Init breaks it.
|
|
|
|
|
|
|
15 |
*/
|
16 |
class NinjaForms extends Base {
|
17 |
|
src/lib/src/Modules/Integrations/Lib/Bots/UserForms/Handlers/MemberPress.php
CHANGED
@@ -4,9 +4,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\Integrations\Lib\Bots\
|
|
4 |
|
5 |
/**
|
6 |
* Errors are passed about using an array of strings.
|
7 |
-
*
|
8 |
-
* Class MemberPress
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\Integrations\Lib\Bots\UserForms\Handlers
|
10 |
*/
|
11 |
class MemberPress extends Base {
|
12 |
|
4 |
|
5 |
/**
|
6 |
* Errors are passed about using an array of strings.
|
|
|
|
|
|
|
7 |
*/
|
8 |
class MemberPress extends Base {
|
9 |
|
src/lib/src/Modules/Integrations/Lib/MainWP/Client/Auth/ReproduceClientAuthByKey.php
CHANGED
@@ -7,9 +7,6 @@ use MainWP\Child\MainWP_Connect;
|
|
7 |
|
8 |
/**
|
9 |
* This reproduces the authentication done by the MainWP client in MainWP_Child::parse_init().
|
10 |
-
*
|
11 |
-
* Class ReproduceClientAuthByKey
|
12 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\Integrations\Lib\MainWP\Client\Auth
|
13 |
*/
|
14 |
class ReproduceClientAuthByKey {
|
15 |
|
7 |
|
8 |
/**
|
9 |
* This reproduces the authentication done by the MainWP client in MainWP_Child::parse_init().
|
|
|
|
|
|
|
10 |
*/
|
11 |
class ReproduceClientAuthByKey {
|
12 |
|
src/lib/src/Modules/Integrations/Lib/MainWP/Common/MWPExtensionVO.php
CHANGED
@@ -6,8 +6,6 @@ use FernleafSystems\Utilities\Data\Adapter\DynPropertiesClass;
|
|
6 |
use MainWP\Dashboard\MainWP_Extensions_Handler;
|
7 |
|
8 |
/**
|
9 |
-
* Class MWPExtensionVO
|
10 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\Integrations\Lib\MainWP\Common
|
11 |
* @property string $page - e.g. Extensions-Wp-Simple-Firewall
|
12 |
*/
|
13 |
class MWPExtensionVO extends DynPropertiesClass {
|
6 |
use MainWP\Dashboard\MainWP_Extensions_Handler;
|
7 |
|
8 |
/**
|
|
|
|
|
9 |
* @property string $page - e.g. Extensions-Wp-Simple-Firewall
|
10 |
*/
|
11 |
class MWPExtensionVO extends DynPropertiesClass {
|
src/lib/src/Modules/Integrations/Lib/MainWP/Common/MWPSiteVO.php
CHANGED
@@ -7,8 +7,6 @@ use FernleafSystems\Wordpress\Services\Services;
|
|
7 |
use MainWP\Dashboard\MainWP_DB;
|
8 |
|
9 |
/**
|
10 |
-
* Class MWPSiteVO
|
11 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\Integrations\Lib\MainWP\Common
|
12 |
* @property object $siteobj // For use with MainWP functions
|
13 |
* @property array[] $plugins
|
14 |
* @property array[] $themes
|
7 |
use MainWP\Dashboard\MainWP_DB;
|
8 |
|
9 |
/**
|
|
|
|
|
10 |
* @property object $siteobj // For use with MainWP functions
|
11 |
* @property array[] $plugins
|
12 |
* @property array[] $themes
|
src/lib/src/Modules/Integrations/Lib/MainWP/Common/MainWPVO.php
CHANGED
@@ -6,8 +6,6 @@ use FernleafSystems\Utilities\Data\Adapter\DynPropertiesClass;
|
|
6 |
use MainWP\Dashboard\MainWP_Extensions_Handler;
|
7 |
|
8 |
/**
|
9 |
-
* Class MainwpVO
|
10 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\Integrations\Lib\MainWP\Common
|
11 |
* @property string $child_key
|
12 |
* @property string $child_file
|
13 |
* @property bool $is_client
|
6 |
use MainWP\Dashboard\MainWP_Extensions_Handler;
|
7 |
|
8 |
/**
|
|
|
|
|
9 |
* @property string $child_key
|
10 |
* @property string $child_file
|
11 |
* @property bool $is_client
|
src/lib/src/Modules/Integrations/Lib/MainWP/Server/Ajax/AjaxHandlerMainwp.php
CHANGED
@@ -8,34 +8,18 @@ use FernleafSystems\Wordpress\Services\Services;
|
|
8 |
|
9 |
class AjaxHandlerMainwp extends Shield\Modules\BaseShield\AjaxHandler {
|
10 |
|
11 |
-
protected function
|
12 |
-
$
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
case 'mwp_sh_ext_table':
|
19 |
-
$resp = $this->ajaxExec_ExtensionTableSites();
|
20 |
-
break;
|
21 |
-
|
22 |
-
case 'mwp_sh_site_action':
|
23 |
-
$resp = $this->ajaxExec_SiteAction();
|
24 |
-
break;
|
25 |
-
|
26 |
-
default:
|
27 |
-
$resp = [
|
28 |
-
'success' => false,
|
29 |
-
'message' => sprintf( __( 'Not a supported MainWP+%s action.' ),
|
30 |
-
$this->getCon()->getHumanName() )
|
31 |
-
];
|
32 |
-
}
|
33 |
}
|
34 |
-
|
35 |
-
return $resp;
|
36 |
}
|
37 |
|
38 |
-
|
39 |
$req = Services::Request();
|
40 |
|
41 |
$siteID = (int)$req->post( 'sid' );
|
@@ -59,7 +43,7 @@ class AjaxHandlerMainwp extends Shield\Modules\BaseShield\AjaxHandler {
|
|
59 |
return $resp;
|
60 |
}
|
61 |
|
62 |
-
|
63 |
-
|
64 |
}
|
65 |
}
|
8 |
|
9 |
class AjaxHandlerMainwp extends Shield\Modules\BaseShield\AjaxHandler {
|
10 |
|
11 |
+
protected function getAjaxActionCallbackMap( bool $isAuth ) :array {
|
12 |
+
$map = parent::getAjaxActionCallbackMap( $isAuth );
|
13 |
+
if ( $isAuth ) {
|
14 |
+
$map = array_merge( $map, [
|
15 |
+
'mwp_sh_ext_table' => [ $this, 'ajaxExec_ExtensionTableSites' ],
|
16 |
+
'mwp_sh_site_action' => [ $this, 'ajaxExec_SiteAction' ],
|
17 |
+
] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
}
|
19 |
+
return $map;
|
|
|
20 |
}
|
21 |
|
22 |
+
public function ajaxExec_SiteAction() :array {
|
23 |
$req = Services::Request();
|
24 |
|
25 |
$siteID = (int)$req->post( 'sid' );
|
43 |
return $resp;
|
44 |
}
|
45 |
|
46 |
+
public function ajaxExec_ExtensionTableSites() :array {
|
47 |
+
return [];
|
48 |
}
|
49 |
}
|
src/lib/src/Modules/Integrations/Lib/MainWP/Server/Init.php
CHANGED
@@ -56,7 +56,7 @@ class Init {
|
|
56 |
$extensionsPage->execute();
|
57 |
|
58 |
if ( $this->getMod()->isModuleRequest() && Services::WpGeneral()->isAjax() ) {
|
59 |
-
|
60 |
}
|
61 |
}
|
62 |
|
56 |
$extensionsPage->execute();
|
57 |
|
58 |
if ( $this->getMod()->isModuleRequest() && Services::WpGeneral()->isAjax() ) {
|
59 |
+
new AjaxHandlerMainwp( $this->getMod() );
|
60 |
}
|
61 |
}
|
62 |
|
src/lib/src/Modules/License/AjaxHandler.php
CHANGED
@@ -8,24 +8,18 @@ use FernleafSystems\Wordpress\Services\Utilities\Licenses\Keyless;
|
|
8 |
|
9 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
10 |
|
11 |
-
protected function
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
$response = $this->ajaxExec_ConnectionDebug();
|
19 |
-
break;
|
20 |
-
|
21 |
-
default:
|
22 |
-
$response = parent::processAjaxAction( $action );
|
23 |
}
|
24 |
-
|
25 |
-
return $response;
|
26 |
}
|
27 |
|
28 |
-
|
29 |
|
30 |
$success = ( new Keyless\Ping() )->ping();
|
31 |
$host = wp_parse_url( Keyless\Base::DEFAULT_URL_STUB, PHP_URL_HOST );
|
@@ -46,7 +40,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
46 |
];
|
47 |
}
|
48 |
|
49 |
-
|
50 |
/** @var ModCon $mod */
|
51 |
$mod = $this->getMod();
|
52 |
$licHandler = $mod->getLicenseHandler();
|
@@ -54,29 +48,27 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
54 |
$success = false;
|
55 |
$msg = 'Unsupported license action';
|
56 |
|
57 |
-
$
|
58 |
|
59 |
-
if ( $
|
60 |
$success = true;
|
61 |
$licHandler->deactivate( false );
|
62 |
$licHandler->clearLicense();
|
63 |
-
$msg = __( 'Success', 'wp-simple-firewall' ).'! '
|
64 |
-
.__( 'Reloading page', 'wp-simple-firewall' ).'...';
|
65 |
}
|
66 |
-
elseif ( $
|
67 |
|
68 |
-
$
|
69 |
-
if ( $
|
70 |
-
$
|
71 |
$msg = sprintf(
|
72 |
__( 'Please wait %s before attempting another license check.', 'wp-simple-firewall' ),
|
73 |
-
sprintf( _n( '%s second', '%s seconds', $
|
74 |
);
|
75 |
}
|
76 |
else {
|
77 |
try {
|
78 |
-
$success = $licHandler->verify( true )
|
79 |
-
->hasValidWorkingLicense();
|
80 |
$msg = $success ? __( 'Valid license found.', 'wp-simple-firewall' ) : __( "Valid license couldn't be found.", 'wp-simple-firewall' );
|
81 |
}
|
82 |
catch ( \Exception $e ) {
|
8 |
|
9 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
10 |
|
11 |
+
protected function getAjaxActionCallbackMap( bool $isAuth ) :array {
|
12 |
+
$map = parent::getAjaxActionCallbackMap( $isAuth );
|
13 |
+
if ( $isAuth ) {
|
14 |
+
$map = array_merge( $map, [
|
15 |
+
'license_action' => [ $this, 'ajaxExec_LicenseHandling' ],
|
16 |
+
'connection_debug' => [ $this, 'ajaxExec_ConnectionDebug' ],
|
17 |
+
] );
|
|
|
|
|
|
|
|
|
|
|
18 |
}
|
19 |
+
return $map;
|
|
|
20 |
}
|
21 |
|
22 |
+
public function ajaxExec_ConnectionDebug() :array {
|
23 |
|
24 |
$success = ( new Keyless\Ping() )->ping();
|
25 |
$host = wp_parse_url( Keyless\Base::DEFAULT_URL_STUB, PHP_URL_HOST );
|
40 |
];
|
41 |
}
|
42 |
|
43 |
+
public function ajaxExec_LicenseHandling() :array {
|
44 |
/** @var ModCon $mod */
|
45 |
$mod = $this->getMod();
|
46 |
$licHandler = $mod->getLicenseHandler();
|
48 |
$success = false;
|
49 |
$msg = 'Unsupported license action';
|
50 |
|
51 |
+
$licenseAction = Services::Request()->post( 'license-action' );
|
52 |
|
53 |
+
if ( $licenseAction == 'clear' ) {
|
54 |
$success = true;
|
55 |
$licHandler->deactivate( false );
|
56 |
$licHandler->clearLicense();
|
57 |
+
$msg = __( 'Success', 'wp-simple-firewall' ).'! '.__( 'Reloading page', 'wp-simple-firewall' ).'...';
|
|
|
58 |
}
|
59 |
+
elseif ( $licenseAction == 'check' ) {
|
60 |
|
61 |
+
$checkInterval = $licHandler->getLicenseNotCheckedForInterval();
|
62 |
+
if ( $checkInterval < 20 ) {
|
63 |
+
$waitFor = 20 - $checkInterval;
|
64 |
$msg = sprintf(
|
65 |
__( 'Please wait %s before attempting another license check.', 'wp-simple-firewall' ),
|
66 |
+
sprintf( _n( '%s second', '%s seconds', $waitFor, 'wp-simple-firewall' ), $waitFor )
|
67 |
);
|
68 |
}
|
69 |
else {
|
70 |
try {
|
71 |
+
$success = $licHandler->verify( true )->hasValidWorkingLicense();
|
|
|
72 |
$msg = $success ? __( 'Valid license found.', 'wp-simple-firewall' ) : __( "Valid license couldn't be found.", 'wp-simple-firewall' );
|
73 |
}
|
74 |
catch ( \Exception $e ) {
|
src/lib/src/Modules/License/Strings.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\License;
|
4 |
|
@@ -23,7 +23,7 @@ class Strings extends Base\Strings {
|
|
23 |
__( 'License check failed. Sending Warning Email.', 'wp-simple-firewall' ),
|
24 |
],
|
25 |
],
|
26 |
-
'lic_fail_deactivate'
|
27 |
'name' => __( 'License Deactivated', 'wp-simple-firewall' ),
|
28 |
'audit' => [
|
29 |
__( 'License check failed. Deactivating Pro.', 'wp-simple-firewall' ),
|
1 |
+
<?php declare( strict_types=1 );
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\License;
|
4 |
|
23 |
__( 'License check failed. Sending Warning Email.', 'wp-simple-firewall' ),
|
24 |
],
|
25 |
],
|
26 |
+
'lic_fail_deactivate' => [
|
27 |
'name' => __( 'License Deactivated', 'wp-simple-firewall' ),
|
28 |
'audit' => [
|
29 |
__( 'License check failed. Deactivating Pro.', 'wp-simple-firewall' ),
|
src/lib/src/Modules/License/UI.php
CHANGED
@@ -25,9 +25,9 @@ class UI extends BaseShield\UI {
|
|
25 |
// Expires At has a random addition added to disperse future license lookups
|
26 |
// So we bring the license expiration back down to normal for user display.
|
27 |
$endOfExpireDay = Services::Request()
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
$expiresAtHuman = sprintf( '%s<br/><small>%s</small>',
|
32 |
$carb->setTimestamp( $endOfExpireDay )->diffForHumans(),
|
33 |
$WP->getTimeStampForDisplay( $endOfExpireDay )
|
@@ -74,7 +74,7 @@ class UI extends BaseShield\UI {
|
|
74 |
]
|
75 |
],
|
76 |
'ajax' => [
|
77 |
-
'
|
78 |
'connection_debug' => $mod->getAjaxActionData( 'connection_debug' )
|
79 |
],
|
80 |
'aHrefs' => [
|
25 |
// Expires At has a random addition added to disperse future license lookups
|
26 |
// So we bring the license expiration back down to normal for user display.
|
27 |
$endOfExpireDay = Services::Request()
|
28 |
+
->carbon()
|
29 |
+
->setTimestamp( $expiresAt )
|
30 |
+
->startOfDay()->timestamp - 1;
|
31 |
$expiresAtHuman = sprintf( '%s<br/><small>%s</small>',
|
32 |
$carb->setTimestamp( $endOfExpireDay )->diffForHumans(),
|
33 |
$WP->getTimeStampForDisplay( $endOfExpireDay )
|
74 |
]
|
75 |
],
|
76 |
'ajax' => [
|
77 |
+
'license_action' => $mod->getAjaxActionData( 'license_action' ),
|
78 |
'connection_debug' => $mod->getAjaxActionData( 'connection_debug' )
|
79 |
],
|
80 |
'aHrefs' => [
|
src/lib/src/Modules/Lockdown/Strings.php
CHANGED
@@ -26,11 +26,6 @@ class Strings extends Base\Strings {
|
|
26 |
];
|
27 |
}
|
28 |
|
29 |
-
/**
|
30 |
-
* @param string $section
|
31 |
-
* @return array
|
32 |
-
* @throws \Exception
|
33 |
-
*/
|
34 |
public function getSectionStrings( string $section ) :array {
|
35 |
|
36 |
switch ( $section ) {
|
26 |
];
|
27 |
}
|
28 |
|
|
|
|
|
|
|
|
|
|
|
29 |
public function getSectionStrings( string $section ) :array {
|
30 |
|
31 |
switch ( $section ) {
|
src/lib/src/Modules/LoginGuard/AdminNotices.php
CHANGED
@@ -44,7 +44,7 @@ class AdminNotices extends Shield\Modules\Base\AdminNotices {
|
|
44 |
],
|
45 |
'ajax' => [
|
46 |
'resend_verification_email' => $mod->getAjaxActionData( 'resend_verification_email', true ),
|
47 |
-
'
|
48 |
]
|
49 |
];
|
50 |
}
|
44 |
],
|
45 |
'ajax' => [
|
46 |
'resend_verification_email' => $mod->getAjaxActionData( 'resend_verification_email', true ),
|
47 |
+
'profile_email2fa_disable' => $mod->getAjaxActionData( 'profile_email2fa_disable', true ),
|
48 |
]
|
49 |
];
|
50 |
}
|
src/lib/src/Modules/LoginGuard/AjaxHandler.php
CHANGED
@@ -8,86 +8,35 @@ use FernleafSystems\Wordpress\Services\Services;
|
|
8 |
|
9 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
10 |
|
11 |
-
protected function
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
}
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
protected function processAjaxAction( string $action ) :array {
|
25 |
-
|
26 |
-
switch ( $action ) {
|
27 |
-
case 'mfa_remove_all':
|
28 |
-
$response = $this->ajaxExec_MfaRemoveAll();
|
29 |
-
break;
|
30 |
-
|
31 |
-
case 'gen_backup_codes':
|
32 |
-
$response = $this->ajaxExec_GenBackupCodes();
|
33 |
-
break;
|
34 |
-
|
35 |
-
case 'del_backup_codes':
|
36 |
-
$response = $this->ajaxExec_DeleteBackupCodes();
|
37 |
-
break;
|
38 |
-
|
39 |
-
case 'disable_2fa_email':
|
40 |
-
$response = $this->ajaxExec_Disable2faEmail();
|
41 |
-
break;
|
42 |
-
|
43 |
-
case 'user_sms2fa_add':
|
44 |
-
$response = $this->ajaxExec_UserSmsAdd();
|
45 |
-
break;
|
46 |
-
|
47 |
-
case 'user_sms2fa_remove':
|
48 |
-
$response = $this->ajaxExec_UserSmsRemove();
|
49 |
-
break;
|
50 |
-
|
51 |
-
case 'user_sms2fa_verify':
|
52 |
-
$response = $this->ajaxExec_UserSmsVerify();
|
53 |
-
break;
|
54 |
-
|
55 |
-
case 'intent_sms_send':
|
56 |
-
$response = $this->ajaxExec_UserSmsIntentStart();
|
57 |
-
break;
|
58 |
-
|
59 |
-
case 'user_ga_toggle':
|
60 |
-
$response = $this->ajaxExec_UserGaToggle();
|
61 |
-
break;
|
62 |
-
|
63 |
-
case 'user_email2fa_toggle':
|
64 |
-
$response = $this->ajaxExec_User2faEmailToggle();
|
65 |
-
break;
|
66 |
-
|
67 |
-
case 'resend_verification_email':
|
68 |
-
$response = $this->ajaxExec_ResendEmailVerification();
|
69 |
-
break;
|
70 |
-
|
71 |
-
case 'u2f_add':
|
72 |
-
$response = $this->ajaxExec_ProfileU2fAdd();
|
73 |
-
break;
|
74 |
-
|
75 |
-
case 'u2f_remove':
|
76 |
-
$response = $this->ajaxExec_ProfileU2fRemove();
|
77 |
-
break;
|
78 |
-
|
79 |
-
case 'user_yubikey_toggle':
|
80 |
-
$response = $this->ajaxExec_UserYubikeyToggle();
|
81 |
-
break;
|
82 |
-
|
83 |
-
default:
|
84 |
-
$response = parent::processAjaxAction( $action );
|
85 |
}
|
86 |
-
|
87 |
-
return $response;
|
88 |
}
|
89 |
|
90 |
-
|
91 |
/** @var ModCon $mod */
|
92 |
$mod = $this->getMod();
|
93 |
$userID = Services::Request()->post( 'user_id' );
|
@@ -108,7 +57,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
108 |
return $response;
|
109 |
}
|
110 |
|
111 |
-
|
112 |
/** @var ModCon $mod */
|
113 |
$mod = $this->getMod();
|
114 |
/** @var TwoFactor\Provider\BackupCodes $provider */
|
@@ -125,7 +74,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
125 |
];
|
126 |
}
|
127 |
|
128 |
-
|
129 |
/** @var ModCon $mod */
|
130 |
$mod = $this->getMod();
|
131 |
/** @var TwoFactor\Provider\BackupCodes $provider */
|
@@ -141,7 +90,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
141 |
];
|
142 |
}
|
143 |
|
144 |
-
|
145 |
/** @var ModCon $mod */
|
146 |
$mod = $this->getMod();
|
147 |
/** @var TwoFactor\Provider\GoogleAuth $provider */
|
@@ -158,7 +107,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
158 |
];
|
159 |
}
|
160 |
|
161 |
-
|
162 |
/** @var ModCon $mod */
|
163 |
$mod = $this->getMod();
|
164 |
/** @var TwoFactor\Provider\Email $provider */
|
@@ -184,7 +133,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
184 |
];
|
185 |
}
|
186 |
|
187 |
-
|
188 |
/** @var ModCon $mod */
|
189 |
$mod = $this->getMod();
|
190 |
$mod->setEnabled2FaEmail( false );
|
@@ -195,7 +144,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
195 |
];
|
196 |
}
|
197 |
|
198 |
-
|
199 |
/** @var ModCon $mod */
|
200 |
$mod = $this->getMod();
|
201 |
/** @var TwoFactor\Provider\U2F $provider */
|
@@ -221,7 +170,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
221 |
return $response;
|
222 |
}
|
223 |
|
224 |
-
|
225 |
/** @var ModCon $mod */
|
226 |
$mod = $this->getMod();
|
227 |
$req = Services::Request();
|
@@ -266,7 +215,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
266 |
return $response;
|
267 |
}
|
268 |
|
269 |
-
|
270 |
/** @var ModCon $mod */
|
271 |
$mod = $this->getMod();
|
272 |
/** @var TwoFactor\Provider\Sms $provider */
|
@@ -280,7 +229,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
280 |
];
|
281 |
}
|
282 |
|
283 |
-
|
284 |
/** @var ModCon $mod */
|
285 |
$mod = $this->getMod();
|
286 |
$mfaCon = $mod->getMfaController();
|
@@ -307,7 +256,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
307 |
];
|
308 |
}
|
309 |
|
310 |
-
|
311 |
/** @var ModCon $mod */
|
312 |
$mod = $this->getMod();
|
313 |
/** @var TwoFactor\Provider\Sms $provider */
|
@@ -331,7 +280,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
331 |
return $response;
|
332 |
}
|
333 |
|
334 |
-
|
335 |
/** @var ModCon $mod */
|
336 |
$mod = $this->getMod();
|
337 |
$req = Services::Request();
|
@@ -376,7 +325,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
376 |
return $response;
|
377 |
}
|
378 |
|
379 |
-
|
380 |
/** @var ModCon $mod */
|
381 |
$mod = $this->getMod();
|
382 |
/** @var TwoFactor\Provider\U2F $provider */
|
@@ -395,7 +344,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
395 |
];
|
396 |
}
|
397 |
|
398 |
-
|
399 |
/** @var ModCon $mod */
|
400 |
$mod = $this->getMod();
|
401 |
/** @var TwoFactor\Provider\Yubikey $provider */
|
@@ -412,7 +361,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
412 |
];
|
413 |
}
|
414 |
|
415 |
-
|
416 |
/** @var ModCon $mod */
|
417 |
$mod = $this->getMod();
|
418 |
/** @var Options $opts */
|
8 |
|
9 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
10 |
|
11 |
+
protected function getAjaxActionCallbackMap( bool $isAuth ) :array {
|
12 |
+
$parentMap = parent::getAjaxActionCallbackMap( $isAuth );
|
13 |
+
if ( $isAuth ) {
|
14 |
+
$map = array_merge( $parentMap, [
|
15 |
+
'mfa_remove_all' => [ $this, 'ajaxExec_MfaRemoveAll' ],
|
16 |
+
'profile_backup_codes_gen' => [ $this, 'ajaxExec_BackupCodesCreate' ],
|
17 |
+
'profile_backup_codes_del' => [ $this, 'ajaxExec_BackupCodesDelete' ],
|
18 |
+
'profile_email2fa_disable' => [ $this, 'ajaxExec_Profile2faEmailDisable' ],
|
19 |
+
'profile_email2fa_toggle' => [ $this, 'ajaxExec_Profile2faEmailToggle' ],
|
20 |
+
'profile_ga_toggle' => [ $this, 'ajaxExec_ProfileGaToggle' ],
|
21 |
+
'profile_sms2fa_add' => [ $this, 'ajaxExec_ProfileSmsAdd' ],
|
22 |
+
'profile_sms2fa_remove' => [ $this, 'ajaxExec_ProfileSmsRemove' ],
|
23 |
+
'profile_sms2fa_verify' => [ $this, 'ajaxExec_ProfileSmsVerify' ],
|
24 |
+
'intent_sms_send' => [ $this, 'ajaxExec_UserSmsIntentStart' ],
|
25 |
+
'resend_verification_email' => [ $this, 'ajaxExec_ResendEmailVerification' ],
|
26 |
+
'profile_u2f_add' => [ $this, 'ajaxExec_ProfileU2fAdd' ],
|
27 |
+
'profile_u2f_remove' => [ $this, 'ajaxExec_ProfileU2fRemove' ],
|
28 |
+
'profile_yubikey_toggle' => [ $this, 'ajaxExec_ProfileYubikeyToggle' ],
|
29 |
+
] );
|
30 |
}
|
31 |
+
else {
|
32 |
+
$map = array_merge( $parentMap, [
|
33 |
+
'intent_email_send' => [ $this, 'ajaxExec_IntentEmailSend' ],
|
34 |
+
] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
+
return $map;
|
|
|
37 |
}
|
38 |
|
39 |
+
public function ajaxExec_MfaRemoveAll() :array {
|
40 |
/** @var ModCon $mod */
|
41 |
$mod = $this->getMod();
|
42 |
$userID = Services::Request()->post( 'user_id' );
|
57 |
return $response;
|
58 |
}
|
59 |
|
60 |
+
public function ajaxExec_BackupCodesCreate() :array {
|
61 |
/** @var ModCon $mod */
|
62 |
$mod = $this->getMod();
|
63 |
/** @var TwoFactor\Provider\BackupCodes $provider */
|
74 |
];
|
75 |
}
|
76 |
|
77 |
+
public function ajaxExec_BackupCodesDelete() :array {
|
78 |
/** @var ModCon $mod */
|
79 |
$mod = $this->getMod();
|
80 |
/** @var TwoFactor\Provider\BackupCodes $provider */
|
90 |
];
|
91 |
}
|
92 |
|
93 |
+
public function ajaxExec_ProfileGaToggle() :array {
|
94 |
/** @var ModCon $mod */
|
95 |
$mod = $this->getMod();
|
96 |
/** @var TwoFactor\Provider\GoogleAuth $provider */
|
107 |
];
|
108 |
}
|
109 |
|
110 |
+
public function ajaxExec_Profile2faEmailToggle() :array {
|
111 |
/** @var ModCon $mod */
|
112 |
$mod = $this->getMod();
|
113 |
/** @var TwoFactor\Provider\Email $provider */
|
133 |
];
|
134 |
}
|
135 |
|
136 |
+
public function ajaxExec_Profile2faEmailDisable() :array {
|
137 |
/** @var ModCon $mod */
|
138 |
$mod = $this->getMod();
|
139 |
$mod->setEnabled2FaEmail( false );
|
144 |
];
|
145 |
}
|
146 |
|
147 |
+
public function ajaxExec_ProfileU2fAdd() :array {
|
148 |
/** @var ModCon $mod */
|
149 |
$mod = $this->getMod();
|
150 |
/** @var TwoFactor\Provider\U2F $provider */
|
170 |
return $response;
|
171 |
}
|
172 |
|
173 |
+
public function ajaxExec_ProfileSmsAdd() :array {
|
174 |
/** @var ModCon $mod */
|
175 |
$mod = $this->getMod();
|
176 |
$req = Services::Request();
|
215 |
return $response;
|
216 |
}
|
217 |
|
218 |
+
public function ajaxExec_ProfileSmsRemove() :array {
|
219 |
/** @var ModCon $mod */
|
220 |
$mod = $this->getMod();
|
221 |
/** @var TwoFactor\Provider\Sms $provider */
|
229 |
];
|
230 |
}
|
231 |
|
232 |
+
public function ajaxExec_IntentEmailSend() :array {
|
233 |
/** @var ModCon $mod */
|
234 |
$mod = $this->getMod();
|
235 |
$mfaCon = $mod->getMfaController();
|
256 |
];
|
257 |
}
|
258 |
|
259 |
+
public function ajaxExec_UserSmsIntentStart() :array {
|
260 |
/** @var ModCon $mod */
|
261 |
$mod = $this->getMod();
|
262 |
/** @var TwoFactor\Provider\Sms $provider */
|
280 |
return $response;
|
281 |
}
|
282 |
|
283 |
+
public function ajaxExec_ProfileSmsVerify() :array {
|
284 |
/** @var ModCon $mod */
|
285 |
$mod = $this->getMod();
|
286 |
$req = Services::Request();
|
325 |
return $response;
|
326 |
}
|
327 |
|
328 |
+
public function ajaxExec_ProfileU2fRemove() :array {
|
329 |
/** @var ModCon $mod */
|
330 |
$mod = $this->getMod();
|
331 |
/** @var TwoFactor\Provider\U2F $provider */
|
344 |
];
|
345 |
}
|
346 |
|
347 |
+
public function ajaxExec_ProfileYubikeyToggle() :array {
|
348 |
/** @var ModCon $mod */
|
349 |
$mod = $this->getMod();
|
350 |
/** @var TwoFactor\Provider\Yubikey $provider */
|
361 |
];
|
362 |
}
|
363 |
|
364 |
+
public function ajaxExec_ResendEmailVerification() :array {
|
365 |
/** @var ModCon $mod */
|
366 |
$mod = $this->getMod();
|
367 |
/** @var Options $opts */
|
src/lib/src/Modules/LoginGuard/Lib/AntiBot/FormProviders/LearnPress.php
CHANGED
@@ -4,8 +4,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard\Lib\AntiBot
|
|
4 |
|
5 |
/**
|
6 |
* LearnPress actually uses action 'init' to process forms, so that's why we hook AntibotSetup so early (-100).
|
7 |
-
* Class LearnPress
|
8 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard\Lib\AntiBot\FormProviders
|
9 |
*/
|
10 |
class LearnPress extends BaseFormProvider {
|
11 |
|
4 |
|
5 |
/**
|
6 |
* LearnPress actually uses action 'init' to process forms, so that's why we hook AntibotSetup so early (-100).
|
|
|
|
|
7 |
*/
|
8 |
class LearnPress extends BaseFormProvider {
|
9 |
|
src/lib/src/Modules/LoginGuard/Lib/AntiBot/FormProviders/PaidMemberSubscriptions.php
CHANGED
@@ -3,8 +3,6 @@
|
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard\Lib\AntiBot\FormProviders;
|
4 |
|
5 |
/**
|
6 |
-
* Class PaidMemberSubscriptions
|
7 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard\Lib\AntiBot\FormProviders
|
8 |
* https://wordpress.org/plugins/paid-member-subscriptions
|
9 |
*/
|
10 |
class PaidMemberSubscriptions extends BaseFormProvider {
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard\Lib\AntiBot\FormProviders;
|
4 |
|
5 |
/**
|
|
|
|
|
6 |
* https://wordpress.org/plugins/paid-member-subscriptions
|
7 |
*/
|
8 |
class PaidMemberSubscriptions extends BaseFormProvider {
|
src/lib/src/Modules/LoginGuard/Lib/AntiBot/FormProviders/ProfileBuilder.php
CHANGED
@@ -3,8 +3,6 @@
|
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard\Lib\AntiBot\FormProviders;
|
4 |
|
5 |
/**
|
6 |
-
* Class ProfileBuilder
|
7 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard\Lib\AntiBot\FormProviders
|
8 |
* https://wordpress.org/plugins/profile-builder/
|
9 |
*/
|
10 |
class ProfileBuilder extends BaseFormProvider {
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard\Lib\AntiBot\FormProviders;
|
4 |
|
5 |
/**
|
|
|
|
|
6 |
* https://wordpress.org/plugins/profile-builder/
|
7 |
*/
|
8 |
class ProfileBuilder extends BaseFormProvider {
|
src/lib/src/Modules/LoginGuard/Lib/AntiBot/FormProviders/UltimateMember.php
CHANGED
@@ -3,8 +3,6 @@
|
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard\Lib\AntiBot\FormProviders;
|
4 |
|
5 |
/**
|
6 |
-
* Class UltimateMember
|
7 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard\Lib\AntiBot\FormProviders
|
8 |
* https://wordpress.org/plugins/ultimate-member/
|
9 |
*/
|
10 |
class UltimateMember extends BaseFormProvider {
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard\Lib\AntiBot\FormProviders;
|
4 |
|
5 |
/**
|
|
|
|
|
6 |
* https://wordpress.org/plugins/ultimate-member/
|
7 |
*/
|
8 |
class UltimateMember extends BaseFormProvider {
|
src/lib/src/Modules/LoginGuard/Lib/AntiBot/FormProviders/UserRegistration.php
CHANGED
@@ -4,8 +4,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard\Lib\AntiBot
|
|
4 |
|
5 |
/**
|
6 |
* TODO: Not ready
|
7 |
-
* Class UserRegistration
|
8 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard\Lib\AntiBot\FormProviders
|
9 |
* https://wordpress.org/plugins/user-registration/
|
10 |
*/
|
11 |
class UserRegistration extends BaseFormProvider {
|
4 |
|
5 |
/**
|
6 |
* TODO: Not ready
|
|
|
|
|
7 |
* https://wordpress.org/plugins/user-registration/
|
8 |
*/
|
9 |
class UserRegistration extends BaseFormProvider {
|
src/lib/src/Modules/LoginGuard/Lib/AntiBot/FormProviders/WPMembers.php
CHANGED
@@ -3,8 +3,6 @@
|
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard\Lib\AntiBot\FormProviders;
|
4 |
|
5 |
/**
|
6 |
-
* Class WPMembers
|
7 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard\Lib\AntiBot\FormProviders
|
8 |
* https://wordpress.org/plugins/wp-members/
|
9 |
*/
|
10 |
class WPMembers extends BaseFormProvider {
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard\Lib\AntiBot\FormProviders;
|
4 |
|
5 |
/**
|
|
|
|
|
6 |
* https://wordpress.org/plugins/wp-members/
|
7 |
*/
|
8 |
class WPMembers extends BaseFormProvider {
|
src/lib/src/Modules/LoginGuard/Lib/TwoFactor/Provider/BackupCodes.php
CHANGED
@@ -17,8 +17,8 @@ class BackupCodes extends BaseProvider {
|
|
17 |
public function getJavascriptVars() :array {
|
18 |
return [
|
19 |
'ajax' => [
|
20 |
-
'
|
21 |
-
'
|
22 |
],
|
23 |
];
|
24 |
}
|
17 |
public function getJavascriptVars() :array {
|
18 |
return [
|
19 |
'ajax' => [
|
20 |
+
'profile_backup_codes_gen' => $this->getMod()->getAjaxActionData( 'profile_backup_codes_gen' ),
|
21 |
+
'profile_backup_codes_del' => $this->getMod()->getAjaxActionData( 'profile_backup_codes_del' ),
|
22 |
],
|
23 |
];
|
24 |
}
|
src/lib/src/Modules/LoginGuard/Lib/TwoFactor/Provider/Email.php
CHANGED
@@ -13,7 +13,7 @@ class Email extends BaseProvider {
|
|
13 |
public function getJavascriptVars() :array {
|
14 |
return [
|
15 |
'ajax' => [
|
16 |
-
'
|
17 |
],
|
18 |
];
|
19 |
}
|
13 |
public function getJavascriptVars() :array {
|
14 |
return [
|
15 |
'ajax' => [
|
16 |
+
'profile_email2fa_toggle' => $this->getMod()->getAjaxActionData( 'profile_email2fa_toggle' ),
|
17 |
],
|
18 |
];
|
19 |
}
|
src/lib/src/Modules/LoginGuard/Lib/TwoFactor/Provider/GoogleAuth.php
CHANGED
@@ -29,7 +29,7 @@ class GoogleAuth extends BaseProvider {
|
|
29 |
public function getJavascriptVars() :array {
|
30 |
return [
|
31 |
'ajax' => [
|
32 |
-
'
|
33 |
],
|
34 |
];
|
35 |
}
|
29 |
public function getJavascriptVars() :array {
|
30 |
return [
|
31 |
'ajax' => [
|
32 |
+
'profile_ga_toggle' => $this->getMod()->getAjaxActionData( 'profile_ga_toggle' ),
|
33 |
],
|
34 |
];
|
35 |
}
|
src/lib/src/Modules/LoginGuard/Lib/TwoFactor/Provider/Sms.php
CHANGED
@@ -13,9 +13,9 @@ class Sms extends BaseProvider {
|
|
13 |
public function getJavascriptVars() :array {
|
14 |
return [
|
15 |
'ajax' => [
|
16 |
-
'
|
17 |
-
'
|
18 |
-
'
|
19 |
],
|
20 |
];
|
21 |
}
|
13 |
public function getJavascriptVars() :array {
|
14 |
return [
|
15 |
'ajax' => [
|
16 |
+
'profile_sms2fa_add' => $this->getMod()->getAjaxActionData( 'profile_sms2fa_add' ),
|
17 |
+
'profile_sms2fa_remove' => $this->getMod()->getAjaxActionData( 'profile_sms2fa_remove' ),
|
18 |
+
'profile_sms2fa_verify' => $this->getMod()->getAjaxActionData( 'profile_sms2fa_verify' ),
|
19 |
],
|
20 |
];
|
21 |
}
|
src/lib/src/Modules/LoginGuard/Lib/TwoFactor/Provider/U2F.php
CHANGED
@@ -23,8 +23,8 @@ class U2F extends BaseProvider {
|
|
23 |
'reg_request' => $reg,
|
24 |
'signs' => $signs,
|
25 |
'ajax' => [
|
26 |
-
'
|
27 |
-
'
|
28 |
],
|
29 |
'flags' => [
|
30 |
'has_validated' => $this->hasValidatedProfile()
|
23 |
'reg_request' => $reg,
|
24 |
'signs' => $signs,
|
25 |
'ajax' => [
|
26 |
+
'profile_u2f_add' => $this->getMod()->getAjaxActionData( 'profile_u2f_add' ),
|
27 |
+
'profile_u2f_remove' => $this->getMod()->getAjaxActionData( 'profile_u2f_remove' ),
|
28 |
],
|
29 |
'flags' => [
|
30 |
'has_validated' => $this->hasValidatedProfile()
|
src/lib/src/Modules/LoginGuard/Lib/TwoFactor/Provider/Yubikey.php
CHANGED
@@ -15,8 +15,7 @@ class Yubikey extends BaseProvider {
|
|
15 |
public function getJavascriptVars() :array {
|
16 |
return [
|
17 |
'ajax' => [
|
18 |
-
'
|
19 |
-
'user_yubikey_remove' => $this->getMod()->getAjaxActionData( 'user_yubikey_remove' )
|
20 |
],
|
21 |
];
|
22 |
}
|
15 |
public function getJavascriptVars() :array {
|
16 |
return [
|
17 |
'ajax' => [
|
18 |
+
'profile_yubikey_toggle' => $this->getMod()->getAjaxActionData( 'profile_yubikey_toggle' ),
|
|
|
19 |
],
|
20 |
];
|
21 |
}
|
src/lib/src/Modules/LoginGuard/ModCon.php
CHANGED
@@ -262,8 +262,8 @@ class ModCon extends BaseShield\ModCon {
|
|
262 |
'icwp_wpsf_vars_lg',
|
263 |
[
|
264 |
'ajax' => [
|
265 |
-
'
|
266 |
-
'
|
267 |
],
|
268 |
]
|
269 |
];
|
262 |
'icwp_wpsf_vars_lg',
|
263 |
[
|
264 |
'ajax' => [
|
265 |
+
'profile_backup_codes_gen' => $this->getAjaxActionData( 'profile_backup_codes_gen' ),
|
266 |
+
'profile_backup_codes_del' => $this->getAjaxActionData( 'profile_backup_codes_del' ),
|
267 |
],
|
268 |
]
|
269 |
];
|
src/lib/src/Modules/LoginGuard/Strings.php
CHANGED
@@ -63,11 +63,6 @@ class Strings extends Base\Strings {
|
|
63 |
];
|
64 |
}
|
65 |
|
66 |
-
/**
|
67 |
-
* @param string $section
|
68 |
-
* @return array
|
69 |
-
* @throws \Exception
|
70 |
-
*/
|
71 |
public function getSectionStrings( string $section ) :array {
|
72 |
|
73 |
switch ( $section ) {
|
@@ -148,11 +143,6 @@ class Strings extends Base\Strings {
|
|
148 |
];
|
149 |
}
|
150 |
|
151 |
-
/**
|
152 |
-
* @param string $key
|
153 |
-
* @return array
|
154 |
-
* @throws \Exception
|
155 |
-
*/
|
156 |
public function getOptionStrings( string $key ) :array {
|
157 |
$con = $this->getCon();
|
158 |
/** @var ModCon $mod */
|
63 |
];
|
64 |
}
|
65 |
|
|
|
|
|
|
|
|
|
|
|
66 |
public function getSectionStrings( string $section ) :array {
|
67 |
|
68 |
switch ( $section ) {
|
143 |
];
|
144 |
}
|
145 |
|
|
|
|
|
|
|
|
|
|
|
146 |
public function getOptionStrings( string $key ) :array {
|
147 |
$con = $this->getCon();
|
148 |
/** @var ModCon $mod */
|
src/lib/src/Modules/Plugin/AdminNotices.php
CHANGED
@@ -59,30 +59,6 @@ class AdminNotices extends Shield\Modules\Base\AdminNotices {
|
|
59 |
}
|
60 |
}
|
61 |
|
62 |
-
public function handleAuthAjax( array $ajaxResponse ) :array {
|
63 |
-
|
64 |
-
if ( empty( $ajaxResponse ) ) {
|
65 |
-
switch ( Services::Request()->request( 'exec' ) ) {
|
66 |
-
|
67 |
-
case 'set_plugin_tracking':
|
68 |
-
$ajaxResponse = $this->ajaxExec_SetPluginTrackingPerm();
|
69 |
-
break;
|
70 |
-
|
71 |
-
default:
|
72 |
-
$ajaxResponse = parent::handleAuthAjax( $ajaxResponse );
|
73 |
-
break;
|
74 |
-
}
|
75 |
-
}
|
76 |
-
return $ajaxResponse;
|
77 |
-
}
|
78 |
-
|
79 |
-
private function ajaxExec_SetPluginTrackingPerm() :array {
|
80 |
-
/** @var Options $opts */
|
81 |
-
$opts = $this->getOptions();
|
82 |
-
$opts->setPluginTrackingPermission( (bool)Services::Request()->query( 'agree', false ) );
|
83 |
-
return $this->ajaxExec_DismissAdminNotice();
|
84 |
-
}
|
85 |
-
|
86 |
private function buildNotice_PluginTooOld( NoticeVO $notice ) {
|
87 |
$name = $this->getCon()->getHumanName();
|
88 |
|
@@ -178,9 +154,9 @@ class AdminNotices extends Shield\Modules\Base\AdminNotices {
|
|
178 |
$notice->render_data = [
|
179 |
'notice_attributes' => [],
|
180 |
'strings' => [
|
181 |
-
'yes'
|
182 |
-
'dismiss'
|
183 |
-
'summary'
|
184 |
and to provide guidance with the %s plugin.', $name, $name ),
|
185 |
],
|
186 |
'hrefs' => [
|
@@ -188,8 +164,8 @@ class AdminNotices extends Shield\Modules\Base\AdminNotices {
|
|
188 |
],
|
189 |
'install_days' => $opts->getInstallationDays(),
|
190 |
'vars' => [
|
191 |
-
'name'
|
192 |
-
'user_email'
|
193 |
]
|
194 |
];
|
195 |
}
|
@@ -332,4 +308,10 @@ class AdminNotices extends Shield\Modules\Base\AdminNotices {
|
|
332 |
}
|
333 |
return $needed;
|
334 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
}
|
59 |
}
|
60 |
}
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
private function buildNotice_PluginTooOld( NoticeVO $notice ) {
|
63 |
$name = $this->getCon()->getHumanName();
|
64 |
|
154 |
$notice->render_data = [
|
155 |
'notice_attributes' => [],
|
156 |
'strings' => [
|
157 |
+
'yes' => "Yes please! I'd love to join in and learn more",
|
158 |
+
'dismiss' => "No thanks",
|
159 |
+
'summary' => sprintf( 'The %s team is helping raise awareness of WP Security issues
|
160 |
and to provide guidance with the %s plugin.', $name, $name ),
|
161 |
],
|
162 |
'hrefs' => [
|
164 |
],
|
165 |
'install_days' => $opts->getInstallationDays(),
|
166 |
'vars' => [
|
167 |
+
'name' => $user->first_name,
|
168 |
+
'user_email' => $user->user_email,
|
169 |
]
|
170 |
];
|
171 |
}
|
308 |
}
|
309 |
return $needed;
|
310 |
}
|
311 |
+
|
312 |
+
/**
|
313 |
+
* @deprecated 14.1
|
314 |
+
*/
|
315 |
+
public function handleAuthAjax( array $ajaxResponse ) :array {
|
316 |
+
}
|
317 |
}
|
src/lib/src/Modules/Plugin/AjaxHandler.php
CHANGED
@@ -10,63 +10,30 @@ use FernleafSystems\Wordpress\Services\Utilities\Net\FindSourceFromIp;
|
|
10 |
|
11 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
12 |
|
13 |
-
protected function
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
$response = $this->ajaxExec_AdminNotesInsert();
|
33 |
-
break;
|
34 |
-
|
35 |
-
case 'import_from_site':
|
36 |
-
$response = $this->ajaxExec_ImportFromSite();
|
37 |
-
break;
|
38 |
-
|
39 |
-
case 'plugin_badge_close':
|
40 |
-
$response = $this->ajaxExec_PluginBadgeClose();
|
41 |
-
break;
|
42 |
-
|
43 |
-
case 'set_plugin_tracking':
|
44 |
-
$response = $this->ajaxExec_SetPluginTrackingPerm();
|
45 |
-
break;
|
46 |
-
|
47 |
-
case 'sgoptimizer_turnoff':
|
48 |
-
$response = $this->ajaxExec_TurnOffSiteGroundOptions();
|
49 |
-
break;
|
50 |
-
|
51 |
-
case 'ipdetect':
|
52 |
-
$response = $this->ajaxExec_IpDetect();
|
53 |
-
break;
|
54 |
-
|
55 |
-
case 'mark_tour_finished':
|
56 |
-
$response = $this->ajaxExec_MarkTourFinished();
|
57 |
-
break;
|
58 |
-
|
59 |
-
case 'wizard_step':
|
60 |
-
$response = $this->ajaxExec_Wizard();
|
61 |
-
break;
|
62 |
-
default:
|
63 |
-
$response = parent::processAjaxAction( $action );
|
64 |
}
|
65 |
-
|
66 |
-
return $response;
|
67 |
}
|
68 |
|
69 |
-
|
70 |
$params = FormParams::Retrieve();
|
71 |
// step will be step1, step2 etc.
|
72 |
$currentStep = intval( str_replace( 'step', '', $params[ 'step' ] ) );
|
@@ -78,7 +45,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
78 |
];
|
79 |
}
|
80 |
|
81 |
-
|
82 |
/** @var ModCon $mod */
|
83 |
$mod = $this->getMod();
|
84 |
$success = $mod->getPluginBadgeCon()->setBadgeStateClosed();
|
@@ -88,36 +55,35 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
88 |
];
|
89 |
}
|
90 |
|
91 |
-
|
92 |
/** @var Options $opts */
|
93 |
$opts = $this->getOptions();
|
94 |
if ( !$opts->isTrackingPermissionSet() ) {
|
95 |
$opts->setPluginTrackingPermission( (bool)Services::Request()->query( 'agree', false ) );
|
96 |
}
|
97 |
-
return
|
98 |
}
|
99 |
|
100 |
-
|
101 |
/** @var ModCon $mod */
|
102 |
$mod = $this->getMod();
|
103 |
$req = Services::Request();
|
104 |
|
105 |
$success = false;
|
106 |
|
107 |
-
$
|
108 |
-
if ( empty( $
|
109 |
-
$success = false;
|
110 |
$msg = __( 'No items selected.', 'wp-simple-firewall' );
|
111 |
}
|
112 |
elseif ( $req->post( 'bulk_action' ) != 'delete' ) {
|
113 |
$msg = __( 'Not a supported action.', 'wp-simple-firewall' );
|
114 |
}
|
115 |
else {
|
116 |
-
/** @var Shield\Databases\AdminNotes\Delete $
|
117 |
-
$
|
118 |
-
foreach ( $
|
119 |
-
if ( is_numeric( $
|
120 |
-
$
|
121 |
}
|
122 |
}
|
123 |
$success = true;
|
@@ -130,7 +96,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
130 |
];
|
131 |
}
|
132 |
|
133 |
-
|
134 |
$stillActive = $this->getCon()
|
135 |
->deleteForceOffFile()
|
136 |
->getIfForceOffActive();
|
@@ -141,7 +107,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
141 |
return [ 'success' => !$stillActive ];
|
142 |
}
|
143 |
|
144 |
-
|
145 |
/** @var ModCon $mod */
|
146 |
$mod = $this->getMod();
|
147 |
return [
|
@@ -153,7 +119,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
153 |
];
|
154 |
}
|
155 |
|
156 |
-
|
157 |
/** @var ModCon $mod */
|
158 |
$mod = $this->getMod();
|
159 |
|
@@ -185,7 +151,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
185 |
];
|
186 |
}
|
187 |
|
188 |
-
|
189 |
$success = false;
|
190 |
$formParams = array_merge(
|
191 |
[
|
@@ -224,7 +190,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
224 |
];
|
225 |
}
|
226 |
|
227 |
-
|
228 |
/** @var ModCon $mod */
|
229 |
$mod = $this->getMod();
|
230 |
$success = false;
|
@@ -249,7 +215,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
249 |
];
|
250 |
}
|
251 |
|
252 |
-
|
253 |
$success = ( new Plugin\Components\SiteGroundPluginCompatibility() )->switchOffOptions();
|
254 |
return [
|
255 |
'success' => $success,
|
@@ -258,7 +224,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
258 |
];
|
259 |
}
|
260 |
|
261 |
-
|
262 |
/** @var Options $opts */
|
263 |
$opts = $this->getOptions();
|
264 |
$source = ( new FindSourceFromIp() )->run( Services::Request()->post( 'ip' ) );
|
@@ -271,7 +237,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
271 |
];
|
272 |
}
|
273 |
|
274 |
-
|
275 |
/** @var ModCon $mod */
|
276 |
$mod = $this->getMod();
|
277 |
$mod->getTourManager()->setCompleted( Services::Request()->post( 'tour_key' ) );
|
10 |
|
11 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
12 |
|
13 |
+
protected function getAjaxActionCallbackMap( bool $isAuth ) :array {
|
14 |
+
$map = array_merge( parent::getAjaxActionCallbackMap( $isAuth ), [
|
15 |
+
'plugin_badge_close' => [ $this, 'ajaxExec_PluginBadgeClose' ],
|
16 |
+
] );
|
17 |
+
if ( $isAuth ) {
|
18 |
+
$map = array_merge( $map, [
|
19 |
+
'bulk_action' => [ $this, 'ajaxExec_BulkItemAction' ],
|
20 |
+
'delete_forceoff' => [ $this, 'ajaxExec_DeleteForceOff' ],
|
21 |
+
'import_from_site' => [ $this, 'ajaxExec_ImportFromSite' ],
|
22 |
+
'ipdetect' => [ $this, 'ajaxExec_IpDetect' ],
|
23 |
+
'mark_tour_finished' => [ $this, 'ajaxExec_MarkTourFinished' ],
|
24 |
+
'note_delete' => [ $this, 'ajaxExec_AdminNotesDelete' ],
|
25 |
+
'note_insert' => [ $this, 'ajaxExec_AdminNotesInsert' ],
|
26 |
+
'plugin_badge_close' => [ $this, 'ajaxExec_PluginBadgeClose' ],
|
27 |
+
'render_table_adminnotes' => [ $this, 'ajaxExec_RenderTableAdminNotes' ],
|
28 |
+
'set_plugin_tracking' => [ $this, 'ajaxExec_SetPluginTrackingPerm' ],
|
29 |
+
'sgoptimizer_turnoff' => [ $this, 'ajaxExec_TurnOffSiteGroundOptions' ],
|
30 |
+
'wizard_step' => [ $this, 'ajaxExec_Wizard' ],
|
31 |
+
] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
}
|
33 |
+
return $map;
|
|
|
34 |
}
|
35 |
|
36 |
+
public function ajaxExec_Wizard() :array {
|
37 |
$params = FormParams::Retrieve();
|
38 |
// step will be step1, step2 etc.
|
39 |
$currentStep = intval( str_replace( 'step', '', $params[ 'step' ] ) );
|
45 |
];
|
46 |
}
|
47 |
|
48 |
+
public function ajaxExec_PluginBadgeClose() :array {
|
49 |
/** @var ModCon $mod */
|
50 |
$mod = $this->getMod();
|
51 |
$success = $mod->getPluginBadgeCon()->setBadgeStateClosed();
|
55 |
];
|
56 |
}
|
57 |
|
58 |
+
public function ajaxExec_SetPluginTrackingPerm() :array {
|
59 |
/** @var Options $opts */
|
60 |
$opts = $this->getOptions();
|
61 |
if ( !$opts->isTrackingPermissionSet() ) {
|
62 |
$opts->setPluginTrackingPermission( (bool)Services::Request()->query( 'agree', false ) );
|
63 |
}
|
64 |
+
return $this->ajaxExec_DismissAdminNotice();
|
65 |
}
|
66 |
|
67 |
+
public function ajaxExec_BulkItemAction() :array {
|
68 |
/** @var ModCon $mod */
|
69 |
$mod = $this->getMod();
|
70 |
$req = Services::Request();
|
71 |
|
72 |
$success = false;
|
73 |
|
74 |
+
$IDs = $req->post( 'ids' );
|
75 |
+
if ( empty( $IDs ) || !is_array( $IDs ) ) {
|
|
|
76 |
$msg = __( 'No items selected.', 'wp-simple-firewall' );
|
77 |
}
|
78 |
elseif ( $req->post( 'bulk_action' ) != 'delete' ) {
|
79 |
$msg = __( 'Not a supported action.', 'wp-simple-firewall' );
|
80 |
}
|
81 |
else {
|
82 |
+
/** @var Shield\Databases\AdminNotes\Delete $deleter */
|
83 |
+
$deleter = $mod->getDbHandler_Notes()->getQueryDeleter();
|
84 |
+
foreach ( $IDs as $id ) {
|
85 |
+
if ( is_numeric( $id ) ) {
|
86 |
+
$deleter->deleteById( $id );
|
87 |
}
|
88 |
}
|
89 |
$success = true;
|
96 |
];
|
97 |
}
|
98 |
|
99 |
+
public function ajaxExec_DeleteForceOff() :array {
|
100 |
$stillActive = $this->getCon()
|
101 |
->deleteForceOffFile()
|
102 |
->getIfForceOffActive();
|
107 |
return [ 'success' => !$stillActive ];
|
108 |
}
|
109 |
|
110 |
+
public function ajaxExec_RenderTableAdminNotes() :array {
|
111 |
/** @var ModCon $mod */
|
112 |
$mod = $this->getMod();
|
113 |
return [
|
119 |
];
|
120 |
}
|
121 |
|
122 |
+
public function ajaxExec_AdminNotesDelete() :array {
|
123 |
/** @var ModCon $mod */
|
124 |
$mod = $this->getMod();
|
125 |
|
151 |
];
|
152 |
}
|
153 |
|
154 |
+
public function ajaxExec_ImportFromSite() :array {
|
155 |
$success = false;
|
156 |
$formParams = array_merge(
|
157 |
[
|
190 |
];
|
191 |
}
|
192 |
|
193 |
+
public function ajaxExec_AdminNotesInsert() :array {
|
194 |
/** @var ModCon $mod */
|
195 |
$mod = $this->getMod();
|
196 |
$success = false;
|
215 |
];
|
216 |
}
|
217 |
|
218 |
+
public function ajaxExec_TurnOffSiteGroundOptions() :array {
|
219 |
$success = ( new Plugin\Components\SiteGroundPluginCompatibility() )->switchOffOptions();
|
220 |
return [
|
221 |
'success' => $success,
|
224 |
];
|
225 |
}
|
226 |
|
227 |
+
public function ajaxExec_IpDetect() :array {
|
228 |
/** @var Options $opts */
|
229 |
$opts = $this->getOptions();
|
230 |
$source = ( new FindSourceFromIp() )->run( Services::Request()->post( 'ip' ) );
|
237 |
];
|
238 |
}
|
239 |
|
240 |
+
public function ajaxExec_MarkTourFinished() :array {
|
241 |
/** @var ModCon $mod */
|
242 |
$mod = $this->getMod();
|
243 |
$mod->getTourManager()->setCompleted( Services::Request()->post( 'tour_key' ) );
|
src/lib/src/Modules/Plugin/Components/PluginBadge.php
CHANGED
@@ -6,10 +6,6 @@ use FernleafSystems\Wordpress\Plugin\Shield\Modules;
|
|
6 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\Plugin;
|
7 |
use FernleafSystems\Wordpress\Services\Services;
|
8 |
|
9 |
-
/**
|
10 |
-
* Class PluginBadge
|
11 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\Plugin\Components
|
12 |
-
*/
|
13 |
class PluginBadge extends Modules\Base\Common\ExecOnceModConsumer {
|
14 |
|
15 |
protected function run() {
|
6 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\Plugin;
|
7 |
use FernleafSystems\Wordpress\Services\Services;
|
8 |
|
|
|
|
|
|
|
|
|
9 |
class PluginBadge extends Modules\Base\Common\ExecOnceModConsumer {
|
10 |
|
11 |
protected function run() {
|
src/lib/src/Modules/Plugin/Lib/Captcha/CaptchaConfigVO.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\Plugin\Lib\Captcha;
|
|
5 |
use FernleafSystems\Utilities\Data\Adapter\DynPropertiesClass;
|
6 |
|
7 |
/**
|
8 |
-
* Class CaptchaConfigVO
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\Plugin\Lib\Captcha
|
10 |
* @property string $provider
|
11 |
* @property string $key
|
12 |
* @property string $secret
|
5 |
use FernleafSystems\Utilities\Data\Adapter\DynPropertiesClass;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property string $provider
|
9 |
* @property string $key
|
10 |
* @property string $secret
|
src/lib/src/Modules/Plugin/Options.php
CHANGED
@@ -72,11 +72,10 @@ class Options extends BaseShield\Options {
|
|
72 |
}
|
73 |
|
74 |
/**
|
75 |
-
* @param bool $bOnOrOff
|
76 |
* @return $this
|
77 |
*/
|
78 |
-
public function setPluginTrackingPermission( $
|
79 |
-
return $this->setOpt( 'enable_tracking', $
|
80 |
->setOpt( 'tracking_permission_set_at', Services::Request()->ts() );
|
81 |
}
|
82 |
|
72 |
}
|
73 |
|
74 |
/**
|
|
|
75 |
* @return $this
|
76 |
*/
|
77 |
+
public function setPluginTrackingPermission( bool $onOrOff = true ) {
|
78 |
+
return $this->setOpt( 'enable_tracking', $onOrOff ? 'Y' : 'N' )
|
79 |
->setOpt( 'tracking_permission_set_at', Services::Request()->ts() );
|
80 |
}
|
81 |
|
src/lib/src/Modules/Plugin/Strings.php
CHANGED
@@ -119,11 +119,6 @@ class Strings extends Base\Strings {
|
|
119 |
];
|
120 |
}
|
121 |
|
122 |
-
/**
|
123 |
-
* @param string $section
|
124 |
-
* @return array
|
125 |
-
* @throws \Exception
|
126 |
-
*/
|
127 |
public function getSectionStrings( string $section ) :array {
|
128 |
$sPlugName = $this->getCon()->getHumanName();
|
129 |
|
@@ -196,11 +191,6 @@ class Strings extends Base\Strings {
|
|
196 |
];
|
197 |
}
|
198 |
|
199 |
-
/**
|
200 |
-
* @param string $key
|
201 |
-
* @return array
|
202 |
-
* @throws \Exception
|
203 |
-
*/
|
204 |
public function getOptionStrings( string $key ) :array {
|
205 |
/** @var ModCon $mod */
|
206 |
$mod = $this->getMod();
|
119 |
];
|
120 |
}
|
121 |
|
|
|
|
|
|
|
|
|
|
|
122 |
public function getSectionStrings( string $section ) :array {
|
123 |
$sPlugName = $this->getCon()->getHumanName();
|
124 |
|
191 |
];
|
192 |
}
|
193 |
|
|
|
|
|
|
|
|
|
|
|
194 |
public function getOptionStrings( string $key ) :array {
|
195 |
/** @var ModCon $mod */
|
196 |
$mod = $this->getMod();
|
src/lib/src/Modules/Reporting/AjaxHandler.php
CHANGED
@@ -7,29 +7,22 @@ use FernleafSystems\Wordpress\Plugin\Shield\Modules\Base\Lib\Request\FormParams;
|
|
7 |
|
8 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
9 |
|
10 |
-
protected function
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
case 'render_summary_chart':
|
18 |
-
$response = $this->ajaxExec_RenderSummaryChart();
|
19 |
-
break;
|
20 |
-
|
21 |
-
default:
|
22 |
-
$response = parent::processAjaxAction( $action );
|
23 |
}
|
24 |
-
|
25 |
-
return $response;
|
26 |
}
|
27 |
|
28 |
-
|
29 |
return $this->renderChart( FormParams::Retrieve() );
|
30 |
}
|
31 |
|
32 |
-
|
33 |
return $this->renderChart( $_POST );
|
34 |
}
|
35 |
|
7 |
|
8 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
9 |
|
10 |
+
protected function getAjaxActionCallbackMap( bool $isAuth ) :array {
|
11 |
+
$map = parent::getAjaxActionCallbackMap( $isAuth );
|
12 |
+
if ( $isAuth ) {
|
13 |
+
$map = array_merge( $map, [
|
14 |
+
'render_custom_chart' => [ $this, 'ajaxExec_RenderCustomChart' ],
|
15 |
+
'render_summary_chart' => [ $this, 'ajaxExec_RenderSummaryChart' ],
|
16 |
+
] );
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
}
|
18 |
+
return $map;
|
|
|
19 |
}
|
20 |
|
21 |
+
public function ajaxExec_RenderCustomChart() :array {
|
22 |
return $this->renderChart( FormParams::Retrieve() );
|
23 |
}
|
24 |
|
25 |
+
public function ajaxExec_RenderSummaryChart() :array {
|
26 |
return $this->renderChart( $_POST );
|
27 |
}
|
28 |
|
src/lib/src/Modules/Reporting/Charts/ChartRequestVO.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\Reporting\Charts;
|
|
5 |
use FernleafSystems\Utilities\Data\Adapter\DynPropertiesClass;
|
6 |
|
7 |
/**
|
8 |
-
* Class ChartRequestVO
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\Reporting\Charts
|
10 |
* @property string $interval
|
11 |
* @property string $ticks
|
12 |
* @property string[] $events
|
5 |
use FernleafSystems\Utilities\Data\Adapter\DynPropertiesClass;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property string $interval
|
9 |
* @property string $ticks
|
10 |
* @property string[] $events
|
src/lib/src/Modules/Reporting/Charts/CustomChartRequestVO.php
CHANGED
@@ -3,8 +3,6 @@
|
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\Reporting\Charts;
|
4 |
|
5 |
/**
|
6 |
-
* Class CustomChartRequestVO
|
7 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\Reporting\Charts
|
8 |
* @property string $render_location
|
9 |
*/
|
10 |
class CustomChartRequestVO extends ChartRequestVO {
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\Reporting\Charts;
|
4 |
|
5 |
/**
|
|
|
|
|
6 |
* @property string $render_location
|
7 |
*/
|
8 |
class CustomChartRequestVO extends ChartRequestVO {
|
src/lib/src/Modules/Reporting/Lib/Reports/ReportVO.php
CHANGED
@@ -6,8 +6,6 @@ use FernleafSystems\Utilities\Data\Adapter\DynProperties;
|
|
6 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\Reports\EntryVO;
|
7 |
|
8 |
/**
|
9 |
-
* Class ReportVO
|
10 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Modules\Reporting\Lib\Reports\Build
|
11 |
* @property int $rid
|
12 |
* @property string $type
|
13 |
* @property string $interval
|
6 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\Reports\EntryVO;
|
7 |
|
8 |
/**
|
|
|
|
|
9 |
* @property int $rid
|
10 |
* @property string $type
|
11 |
* @property string $interval
|
src/lib/src/Modules/Reporting/Strings.php
CHANGED
@@ -27,11 +27,6 @@ class Strings extends Base\Strings {
|
|
27 |
];
|
28 |
}
|
29 |
|
30 |
-
/**
|
31 |
-
* @param string $key
|
32 |
-
* @return array
|
33 |
-
* @throws \Exception
|
34 |
-
*/
|
35 |
public function getOptionStrings( string $key ) :array {
|
36 |
$con = $this->getCon();
|
37 |
|
@@ -74,11 +69,6 @@ class Strings extends Base\Strings {
|
|
74 |
];
|
75 |
}
|
76 |
|
77 |
-
/**
|
78 |
-
* @param string $section
|
79 |
-
* @return array
|
80 |
-
* @throws \Exception
|
81 |
-
*/
|
82 |
public function getSectionStrings( string $section ) :array {
|
83 |
|
84 |
switch ( $section ) {
|
27 |
];
|
28 |
}
|
29 |
|
|
|
|
|
|
|
|
|
|
|
30 |
public function getOptionStrings( string $key ) :array {
|
31 |
$con = $this->getCon();
|
32 |
|
69 |
];
|
70 |
}
|
71 |
|
|
|
|
|
|
|
|
|
|
|
72 |
public function getSectionStrings( string $section ) :array {
|
73 |
|
74 |
switch ( $section ) {
|
src/lib/src/Modules/SecurityAdmin/AjaxHandler.php
CHANGED
@@ -7,30 +7,20 @@ use FernleafSystems\Wordpress\Services\Services;
|
|
7 |
|
8 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
9 |
|
10 |
-
protected function
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
$response = $this->ajaxExec_SecAdminLogin();
|
20 |
-
break;
|
21 |
-
|
22 |
-
case 'req_email_remove':
|
23 |
-
$response = $this->ajaxExec_SendEmailRemove();
|
24 |
-
break;
|
25 |
-
|
26 |
-
default:
|
27 |
-
$response = parent::processAjaxAction( $action );
|
28 |
}
|
29 |
-
|
30 |
-
return $response;
|
31 |
}
|
32 |
|
33 |
-
|
34 |
/** @var ModCon $mod */
|
35 |
$mod = $this->getMod();
|
36 |
$secAdminCon = $mod->getSecurityAdminController();
|
@@ -40,7 +30,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
40 |
];
|
41 |
}
|
42 |
|
43 |
-
|
44 |
/** @var ModCon $mod */
|
45 |
$mod = $this->getMod();
|
46 |
|
@@ -74,7 +64,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
74 |
];
|
75 |
}
|
76 |
|
77 |
-
|
78 |
( new Lib\SecurityAdmin\Ops\RemoveSecAdmin() )
|
79 |
->setMod( $this->getMod() )
|
80 |
->sendConfirmationEmail();
|
7 |
|
8 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
9 |
|
10 |
+
protected function getAjaxActionCallbackMap( bool $isAuth ) :array {
|
11 |
+
$map = parent::getAjaxActionCallbackMap( $isAuth );
|
12 |
+
if ( $isAuth ) {
|
13 |
+
$map = array_merge( $map, [
|
14 |
+
'sec_admin_check' => [ $this, 'ajaxExec_SecAdminCheck' ],
|
15 |
+
'sec_admin_login' => [ $this, 'ajaxExec_SecAdminLogin' ],
|
16 |
+
'restricted_access' => [ $this, 'ajaxExec_SecAdminLogin' ],
|
17 |
+
'req_email_remove' => [ $this, 'ajaxExec_SendEmailRemove' ],
|
18 |
+
] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
}
|
20 |
+
return $map;
|
|
|
21 |
}
|
22 |
|
23 |
+
public function ajaxExec_SecAdminCheck() :array {
|
24 |
/** @var ModCon $mod */
|
25 |
$mod = $this->getMod();
|
26 |
$secAdminCon = $mod->getSecurityAdminController();
|
30 |
];
|
31 |
}
|
32 |
|
33 |
+
public function ajaxExec_SecAdminLogin() :array {
|
34 |
/** @var ModCon $mod */
|
35 |
$mod = $this->getMod();
|
36 |
|
64 |
];
|
65 |
}
|
66 |
|
67 |
+
public function ajaxExec_SendEmailRemove() :array {
|
68 |
( new Lib\SecurityAdmin\Ops\RemoveSecAdmin() )
|
69 |
->setMod( $this->getMod() )
|
70 |
->sendConfirmationEmail();
|
src/lib/src/Modules/Sessions/Strings.php
CHANGED
@@ -38,11 +38,6 @@ class Strings extends Base\Strings {
|
|
38 |
];
|
39 |
}
|
40 |
|
41 |
-
/**
|
42 |
-
* @param string $section
|
43 |
-
* @return array
|
44 |
-
* @throws \Exception
|
45 |
-
*/
|
46 |
public function getSectionStrings( string $section ) :array {
|
47 |
$sModName = $this->getMod()->getMainFeatureName();
|
48 |
|
@@ -68,11 +63,6 @@ class Strings extends Base\Strings {
|
|
68 |
];
|
69 |
}
|
70 |
|
71 |
-
/**
|
72 |
-
* @param string $key
|
73 |
-
* @return array
|
74 |
-
* @throws \Exception
|
75 |
-
*/
|
76 |
public function getOptionStrings( string $key ) :array {
|
77 |
$sModName = $this->getMod()->getMainFeatureName();
|
78 |
|
38 |
];
|
39 |
}
|
40 |
|
|
|
|
|
|
|
|
|
|
|
41 |
public function getSectionStrings( string $section ) :array {
|
42 |
$sModName = $this->getMod()->getMainFeatureName();
|
43 |
|
63 |
];
|
64 |
}
|
65 |
|
|
|
|
|
|
|
|
|
|
|
66 |
public function getOptionStrings( string $key ) :array {
|
67 |
$sModName = $this->getMod()->getMainFeatureName();
|
68 |
|
src/lib/src/Modules/Traffic/AjaxHandler.php
CHANGED
@@ -1,38 +1,58 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\Traffic;
|
4 |
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield;
|
|
|
|
|
|
|
6 |
|
7 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
8 |
|
9 |
-
protected function
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
break;
|
16 |
-
|
17 |
-
default:
|
18 |
-
$response = parent::processAjaxAction( $action );
|
19 |
}
|
20 |
-
|
21 |
-
return $response;
|
22 |
}
|
23 |
|
24 |
-
|
25 |
try {
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
}
|
30 |
catch ( \Exception $e ) {
|
31 |
-
|
32 |
'success' => false,
|
33 |
'page_reload' => true,
|
34 |
'message' => $e->getMessage(),
|
35 |
];
|
36 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
}
|
38 |
}
|
1 |
+
<?php declare( strict_types=1 );
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\Traffic;
|
4 |
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield;
|
6 |
+
use FernleafSystems\Wordpress\Plugin\Shield\Modules\Data\Lib\UpgradeReqLogsTable;
|
7 |
+
use FernleafSystems\Wordpress\Plugin\Shield\Modules\Traffic\Lib\TrafficTable\BuildTrafficTableData;
|
8 |
+
use FernleafSystems\Wordpress\Services\Services;
|
9 |
|
10 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
11 |
|
12 |
+
protected function getAjaxActionCallbackMap( bool $isAuth ) :array {
|
13 |
+
$map = parent::getAjaxActionCallbackMap( $isAuth );
|
14 |
+
if ( $isAuth ) {
|
15 |
+
$map = array_merge( $map, [
|
16 |
+
'traffictable_action' => [ $this, 'ajaxExec_TrafficTableAction' ],
|
17 |
+
] );
|
|
|
|
|
|
|
|
|
18 |
}
|
19 |
+
return $map;
|
|
|
20 |
}
|
21 |
|
22 |
+
public function ajaxExec_TrafficTableAction() :array {
|
23 |
try {
|
24 |
+
$action = Services::Request()->post( 'sub_action' );
|
25 |
+
switch ( $action ) {
|
26 |
+
|
27 |
+
case 'retrieve_table_data':
|
28 |
+
$response = $this->retrieveTableData();
|
29 |
+
break;
|
30 |
+
|
31 |
+
default:
|
32 |
+
throw new \Exception( 'Not a supported Audit Trail table sub_action: '.$action );
|
33 |
+
}
|
34 |
}
|
35 |
catch ( \Exception $e ) {
|
36 |
+
$response = [
|
37 |
'success' => false,
|
38 |
'page_reload' => true,
|
39 |
'message' => $e->getMessage(),
|
40 |
];
|
41 |
}
|
42 |
+
|
43 |
+
return $response;
|
44 |
+
}
|
45 |
+
|
46 |
+
private function retrieveTableData() :array {
|
47 |
+
( new UpgradeReqLogsTable() )
|
48 |
+
->setMod( $this->getCon()->getModule_Data() )
|
49 |
+
->execute();
|
50 |
+
|
51 |
+
$builder = ( new BuildTrafficTableData() )->setMod( $this->getMod() );
|
52 |
+
$builder->table_data = Services::Request()->post( 'table_data', [] );
|
53 |
+
return [
|
54 |
+
'success' => true,
|
55 |
+
'datatable_data' => $builder->build(),
|
56 |
+
];
|
57 |
}
|
58 |
}
|
src/lib/src/Modules/Traffic/Lib/LogHandlers/LocalDbWriter.php
CHANGED
@@ -45,7 +45,7 @@ class LocalDbWriter extends AbstractProcessingHandler {
|
|
45 |
);
|
46 |
|
47 |
$updateData = [];
|
48 |
-
foreach ( [ 'verb', 'code', 'path', 'type' ] as $item ) {
|
49 |
if ( !empty( $meta[ $item ] ) ) {
|
50 |
$updateData[ $item ] = $meta[ $item ];
|
51 |
unset( $meta[ $item ] );
|
45 |
);
|
46 |
|
47 |
$updateData = [];
|
48 |
+
foreach ( [ 'verb', 'code', 'path', 'type', 'uid' ] as $item ) {
|
49 |
if ( !empty( $meta[ $item ] ) ) {
|
50 |
$updateData[ $item ] = $meta[ $item ];
|
51 |
unset( $meta[ $item ] );
|
src/lib/src/Modules/Traffic/Lib/RequestLogger.php
CHANGED
@@ -48,16 +48,25 @@ class RequestLogger extends ExecOnceModConsumer {
|
|
48 |
|
49 |
public function getLogger() :Logger {
|
50 |
if ( !isset( $this->logger ) ) {
|
51 |
-
$this->logger = new Logger( 'request', [],
|
52 |
-
|
53 |
-
new
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
}
|
58 |
return $this->logger;
|
59 |
}
|
60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
private function isRequestTypeExcluded() :bool {
|
62 |
$srvProviders = Services::ServiceProviders();
|
63 |
$ipIdentity = Services::IP()->getIpDetector()->getIPIdentity();
|
48 |
|
49 |
public function getLogger() :Logger {
|
50 |
if ( !isset( $this->logger ) ) {
|
51 |
+
$this->logger = new Logger( 'request', [], array_map( function ( $class ) {
|
52 |
+
/** @var Processors\BaseMetaProcessor $p */
|
53 |
+
$p = new $class();
|
54 |
+
$p->setCon( $this->getCon() );
|
55 |
+
return $p;
|
56 |
+
}, $this->enumMetaProcessors() ) );
|
57 |
}
|
58 |
return $this->logger;
|
59 |
}
|
60 |
|
61 |
+
protected function enumMetaProcessors() :array {
|
62 |
+
return [
|
63 |
+
Processors\ShieldMetaProcessor::class,
|
64 |
+
Processors\RequestMetaProcessor::class,
|
65 |
+
Processors\UserMetaProcessor::class,
|
66 |
+
Processors\WpMetaProcessor::class,
|
67 |
+
];
|
68 |
+
}
|
69 |
+
|
70 |
private function isRequestTypeExcluded() :bool {
|
71 |
$srvProviders = Services::ServiceProviders();
|
72 |
$ipIdentity = Services::IP()->getIpDetector()->getIPIdentity();
|
src/lib/src/Modules/Traffic/Lib/TrafficTable/BuildTrafficTableData.php
CHANGED
@@ -62,7 +62,6 @@ class BuildTrafficTableData extends BaseBuildTableData {
|
|
62 |
$data = $log->getRawData();
|
63 |
|
64 |
$data[ 'ip' ] = $this->log->ip;
|
65 |
-
$data[ 'code' ] = $this->log->code;
|
66 |
$data[ 'offense' ] = $this->log->offense ? 'Offense' : 'Not Offense';
|
67 |
$data[ 'rid' ] = $this->log->rid ?? __( 'Unknown', 'wp-simple-firewall' );
|
68 |
$data[ 'path' ] = empty( $this->log->path ) ? '-' : $this->log->path;
|
@@ -71,14 +70,12 @@ class BuildTrafficTableData extends BaseBuildTableData {
|
|
71 |
$data[ 'country' ] = empty( $geo->countryCode ) ?
|
72 |
__( 'Unknown', 'wp-simple-firewall' ) : $geo->countryName;
|
73 |
|
74 |
-
$userID = $this->log->
|
75 |
-
if ( $userID > 0 ) {
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
$WPU->getAdminUrl_ProfileEdit( $user ), $user->user_login );
|
81 |
-
}
|
82 |
}
|
83 |
|
84 |
$data[ 'page' ] = $this->getColumnContent_Page();
|
@@ -174,7 +171,7 @@ class BuildTrafficTableData extends BaseBuildTableData {
|
|
174 |
$content = sprintf( '<div>%s</div>', implode( '</div><div>', [
|
175 |
sprintf( '%s: %s', __( 'IP', 'wp-simple-firewall' ), $this->getIpAnalysisLink( $this->log->ip ) ),
|
176 |
sprintf( '%s: %s', __( 'IP Status', 'wp-simple-firewall' ), $this->getIpInfo( $this->log->ip ) ),
|
177 |
-
sprintf( '%s: %s', __( 'Logged-In', 'wp-simple-firewall' ), $this->users[ $this->log->
|
178 |
sprintf( '%s: %s', __( 'Location', 'wp-simple-firewall' ), $country ),
|
179 |
esc_html( esc_js( sprintf( '%s - %s', __( 'User Agent', 'wp-simple-firewall' ), $this->log->meta[ 'ua' ] ) ) ),
|
180 |
] ) );
|
@@ -210,7 +207,7 @@ class BuildTrafficTableData extends BaseBuildTableData {
|
|
210 |
private function getColumnContent_Page() :string {
|
211 |
$query = $this->log->meta[ 'query' ] ?? '';
|
212 |
|
213 |
-
$content = sprintf( '
|
214 |
if ( $this->isWpCli() ) {
|
215 |
$content .= sprintf( '<code>:> %s</code>', esc_html( $this->log->path.' '.$query ) );
|
216 |
}
|
62 |
$data = $log->getRawData();
|
63 |
|
64 |
$data[ 'ip' ] = $this->log->ip;
|
|
|
65 |
$data[ 'offense' ] = $this->log->offense ? 'Offense' : 'Not Offense';
|
66 |
$data[ 'rid' ] = $this->log->rid ?? __( 'Unknown', 'wp-simple-firewall' );
|
67 |
$data[ 'path' ] = empty( $this->log->path ) ? '-' : $this->log->path;
|
70 |
$data[ 'country' ] = empty( $geo->countryCode ) ?
|
71 |
__( 'Unknown', 'wp-simple-firewall' ) : $geo->countryName;
|
72 |
|
73 |
+
$userID = (int)$this->log->uid;
|
74 |
+
if ( $userID > 0 && !isset( $users[ $userID ] ) ) {
|
75 |
+
$user = $WPU->getUserById( $userID );
|
76 |
+
$this->users[ $userID ] = empty( $user ) ? __( 'Unknown', 'wp-simple-firewall' ) :
|
77 |
+
sprintf( '<a href="%s" target="_blank" title="Go To Profile">%s</a>',
|
78 |
+
$WPU->getAdminUrl_ProfileEdit( $user ), $user->user_login );
|
|
|
|
|
79 |
}
|
80 |
|
81 |
$data[ 'page' ] = $this->getColumnContent_Page();
|
171 |
$content = sprintf( '<div>%s</div>', implode( '</div><div>', [
|
172 |
sprintf( '%s: %s', __( 'IP', 'wp-simple-firewall' ), $this->getIpAnalysisLink( $this->log->ip ) ),
|
173 |
sprintf( '%s: %s', __( 'IP Status', 'wp-simple-firewall' ), $this->getIpInfo( $this->log->ip ) ),
|
174 |
+
sprintf( '%s: %s', __( 'Logged-In', 'wp-simple-firewall' ), $this->users[ $this->log->uid ] ),
|
175 |
sprintf( '%s: %s', __( 'Location', 'wp-simple-firewall' ), $country ),
|
176 |
esc_html( esc_js( sprintf( '%s - %s', __( 'User Agent', 'wp-simple-firewall' ), $this->log->meta[ 'ua' ] ) ) ),
|
177 |
] ) );
|
207 |
private function getColumnContent_Page() :string {
|
208 |
$query = $this->log->meta[ 'query' ] ?? '';
|
209 |
|
210 |
+
$content = sprintf( '<span class="badge bg-secondary me-1">%s</span>', Handler::GetTypeName( $this->log->type ) );
|
211 |
if ( $this->isWpCli() ) {
|
212 |
$content .= sprintf( '<code>:> %s</code>', esc_html( $this->log->path.' '.$query ) );
|
213 |
}
|
src/lib/src/Modules/Traffic/ModCon.php
CHANGED
@@ -24,18 +24,14 @@ class ModCon extends BaseShield\ModCon {
|
|
24 |
protected function preProcessOptions() {
|
25 |
/** @var Options $opts */
|
26 |
$opts = $this->getOptions();
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
}
|
34 |
|
35 |
-
/**
|
36 |
-
* @return bool
|
37 |
-
* @throws \Exception
|
38 |
-
*/
|
39 |
protected function isReadyToExecute() :bool {
|
40 |
$IP = Services::IP();
|
41 |
return $IP->isValidIp_PublicRange( $IP->getRequestIp() )
|
24 |
protected function preProcessOptions() {
|
25 |
/** @var Options $opts */
|
26 |
$opts = $this->getOptions();
|
27 |
+
$opts->setOpt( 'custom_exclusions', array_filter( array_map(
|
28 |
+
function ( $excl ) {
|
29 |
+
return trim( esc_js( $excl ) );
|
30 |
+
},
|
31 |
+
$opts->getCustomExclusions()
|
32 |
+
) ) );
|
33 |
}
|
34 |
|
|
|
|
|
|
|
|
|
35 |
protected function isReadyToExecute() :bool {
|
36 |
$IP = Services::IP();
|
37 |
return $IP->isValidIp_PublicRange( $IP->getRequestIp() )
|
src/lib/src/Modules/Traffic/Options.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\Traffic;
|
4 |
|
1 |
+
<?php declare( strict_types=1 );
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\Traffic;
|
4 |
|
src/lib/src/Modules/Traffic/Strings.php
CHANGED
@@ -20,11 +20,6 @@ class Strings extends Base\Strings {
|
|
20 |
];
|
21 |
}
|
22 |
|
23 |
-
/**
|
24 |
-
* @param string $section
|
25 |
-
* @return array
|
26 |
-
* @throws \Exception
|
27 |
-
*/
|
28 |
public function getSectionStrings( string $section ) :array {
|
29 |
$sModName = $this->getMod()->getMainFeatureName();
|
30 |
|
@@ -70,11 +65,6 @@ class Strings extends Base\Strings {
|
|
70 |
];
|
71 |
}
|
72 |
|
73 |
-
/**
|
74 |
-
* @param string $key
|
75 |
-
* @return array
|
76 |
-
* @throws \Exception
|
77 |
-
*/
|
78 |
public function getOptionStrings( string $key ) :array {
|
79 |
/** @var ModCon $mod */
|
80 |
$mod = $this->getMod();
|
20 |
];
|
21 |
}
|
22 |
|
|
|
|
|
|
|
|
|
|
|
23 |
public function getSectionStrings( string $section ) :array {
|
24 |
$sModName = $this->getMod()->getMainFeatureName();
|
25 |
|
65 |
];
|
66 |
}
|
67 |
|
|
|
|
|
|
|
|
|
|
|
68 |
public function getOptionStrings( string $key ) :array {
|
69 |
/** @var ModCon $mod */
|
70 |
$mod = $this->getMod();
|
src/lib/src/Modules/Traffic/Upgrade.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\Traffic;
|
4 |
|
1 |
+
<?php declare( strict_types=1 );
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\Traffic;
|
4 |
|
src/lib/src/Modules/UserManagement/AjaxHandler.php
CHANGED
@@ -9,29 +9,19 @@ use FernleafSystems\Wordpress\Services\Services;
|
|
9 |
|
10 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
11 |
|
12 |
-
protected function
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
$response = $this->ajaxExec_BulkItemAction();
|
21 |
-
break;
|
22 |
-
|
23 |
-
case 'session_delete':
|
24 |
-
$response = $this->ajaxExec_SessionDelete();
|
25 |
-
break;
|
26 |
-
|
27 |
-
default:
|
28 |
-
$response = parent::processAjaxAction( $action );
|
29 |
}
|
30 |
-
|
31 |
-
return $response;
|
32 |
}
|
33 |
|
34 |
-
|
35 |
$con = $this->getCon();
|
36 |
/** @var ModCon $mod */
|
37 |
$mod = $this->getMod();
|
@@ -42,19 +32,17 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
42 |
|
43 |
/** @var Shield\Modules\SecurityAdmin\Options $optsSecAdmin */
|
44 |
$optsSecAdmin = $con->getModule_SecAdmin()->getOptions();
|
45 |
-
|
46 |
-
$oTableBuilder = ( new Shield\Tables\Build\Sessions() )
|
47 |
-
->setMod( $mod )
|
48 |
-
->setDbHandler( $con->getModule_Sessions()->getDbHandler_Sessions() )
|
49 |
-
->setSecAdminUsers( $optsSecAdmin->getSecurityAdminUsers() );
|
50 |
-
|
51 |
return [
|
52 |
'success' => true,
|
53 |
-
'html' =>
|
|
|
|
|
|
|
|
|
54 |
];
|
55 |
}
|
56 |
|
57 |
-
|
58 |
/** @var ModCon $mod */
|
59 |
$mod = $this->getMod();
|
60 |
$req = Services::Request();
|
@@ -98,7 +86,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
|
98 |
];
|
99 |
}
|
100 |
|
101 |
-
|
102 |
$con = $this->getCon();
|
103 |
/** @var ModCon $mod */
|
104 |
$mod = $this->getMod();
|
9 |
|
10 |
class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
|
11 |
|
12 |
+
protected function getAjaxActionCallbackMap( bool $isAuth ) :array {
|
13 |
+
$map = parent::getAjaxActionCallbackMap( $isAuth );
|
14 |
+
if ( $isAuth ) {
|
15 |
+
$map = array_merge( $map, [
|
16 |
+
'render_table_sessions' => [ $this, 'ajaxExec_BuildTableSessions' ],
|
17 |
+
'bulk_action' => [ $this, 'ajaxExec_BulkItemAction' ],
|
18 |
+
'session_delete' => [ $this, 'ajaxExec_SessionDelete' ],
|
19 |
+
] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
}
|
21 |
+
return $map;
|
|
|
22 |
}
|
23 |
|
24 |
+
public function ajaxExec_BuildTableSessions() :array {
|
25 |
$con = $this->getCon();
|
26 |
/** @var ModCon $mod */
|
27 |
$mod = $this->getMod();
|
32 |
|
33 |
/** @var Shield\Modules\SecurityAdmin\Options $optsSecAdmin */
|
34 |
$optsSecAdmin = $con->getModule_SecAdmin()->getOptions();
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
return [
|
36 |
'success' => true,
|
37 |
+
'html' => ( new Shield\Tables\Build\Sessions() )
|
38 |
+
->setMod( $mod )
|
39 |
+
->setDbHandler( $con->getModule_Sessions()->getDbHandler_Sessions() )
|
40 |
+
->setSecAdminUsers( $optsSecAdmin->getSecurityAdminUsers() )
|
41 |
+
->render()
|
42 |
];
|
43 |
}
|
44 |
|
45 |
+
public function ajaxExec_BulkItemAction() :array {
|
46 |
/** @var ModCon $mod */
|
47 |
$mod = $this->getMod();
|
48 |
$req = Services::Request();
|
86 |
];
|
87 |
}
|
88 |
|
89 |
+
public function ajaxExec_SessionDelete() :array {
|
90 |
$con = $this->getCon();
|
91 |
/** @var ModCon $mod */
|
92 |
$mod = $this->getMod();
|
src/lib/src/Modules/UserManagement/Options.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\UserManagement;
|
4 |
|
1 |
+
<?php declare( strict_types=1 );
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Modules\UserManagement;
|
4 |
|
src/lib/src/Modules/UserManagement/Strings.php
CHANGED
@@ -95,11 +95,6 @@ class Strings extends Base\Strings {
|
|
95 |
];
|
96 |
}
|
97 |
|
98 |
-
/**
|
99 |
-
* @param string $section
|
100 |
-
* @return array
|
101 |
-
* @throws \Exception
|
102 |
-
*/
|
103 |
public function getSectionStrings( string $section ) :array {
|
104 |
$sModName = $this->getMod()->getMainFeatureName();
|
105 |
|
@@ -171,11 +166,6 @@ class Strings extends Base\Strings {
|
|
171 |
];
|
172 |
}
|
173 |
|
174 |
-
/**
|
175 |
-
* @param string $key
|
176 |
-
* @return array
|
177 |
-
* @throws \Exception
|
178 |
-
*/
|
179 |
public function getOptionStrings( string $key ) :array {
|
180 |
$oOpts = $this->getOptions();
|
181 |
$sModName = $this->getMod()->getMainFeatureName();
|
95 |
];
|
96 |
}
|
97 |
|
|
|
|
|
|
|
|
|
|
|
98 |
public function getSectionStrings( string $section ) :array {
|
99 |
$sModName = $this->getMod()->getMainFeatureName();
|
100 |
|
166 |
];
|
167 |
}
|
168 |
|
|
|
|
|
|
|
|
|
|
|
169 |
public function getOptionStrings( string $key ) :array {
|
170 |
$oOpts = $this->getOptions();
|
171 |
$sModName = $this->getMod()->getMainFeatureName();
|
src/lib/src/Scans/Base/BaseFileScanActionVO.php
CHANGED
@@ -3,8 +3,6 @@
|
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Scans\Base;
|
4 |
|
5 |
/**
|
6 |
-
* Class BaseFileScanActionVO
|
7 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Scans\Base
|
8 |
* @property string[] $paths_whitelisted
|
9 |
*/
|
10 |
abstract class BaseFileScanActionVO extends BaseScanActionVO {
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Scans\Base;
|
4 |
|
5 |
/**
|
|
|
|
|
6 |
* @property string[] $paths_whitelisted
|
7 |
*/
|
8 |
abstract class BaseFileScanActionVO extends BaseScanActionVO {
|
src/lib/src/Scans/Base/BaseMergeItems.php
CHANGED
@@ -2,22 +2,18 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Scans\Base;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class BaseMergeItems
|
7 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Scans\Base
|
8 |
-
*/
|
9 |
class BaseMergeItems {
|
10 |
|
11 |
/**
|
12 |
* Merges any data from $oMergeItem into $oBaseItem, overwriting Base Item data
|
13 |
-
* @param ResultItem $
|
14 |
-
* @param ResultItem $
|
15 |
* @return ResultItem
|
16 |
*/
|
17 |
-
public function mergeItemTo( $
|
18 |
-
foreach ( $
|
19 |
-
$
|
20 |
}
|
21 |
-
return $
|
22 |
}
|
23 |
}
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Scans\Base;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class BaseMergeItems {
|
6 |
|
7 |
/**
|
8 |
* Merges any data from $oMergeItem into $oBaseItem, overwriting Base Item data
|
9 |
+
* @param ResultItem $baseItem
|
10 |
+
* @param ResultItem $mergeItem
|
11 |
* @return ResultItem
|
12 |
*/
|
13 |
+
public function mergeItemTo( $baseItem, $mergeItem ) {
|
14 |
+
foreach ( $mergeItem->getRawData() as $sKey => $mVal ) {
|
15 |
+
$baseItem->{$sKey} = $mVal;
|
16 |
}
|
17 |
+
return $baseItem;
|
18 |
}
|
19 |
}
|
src/lib/src/Scans/Helpers/BuildHashesFromDir.php
CHANGED
@@ -2,10 +2,6 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Scans\Helpers;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class BuildHashesFromDir
|
7 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Scans\Ptg
|
8 |
-
*/
|
9 |
class BuildHashesFromDir {
|
10 |
|
11 |
/**
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Scans\Helpers;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class BuildHashesFromDir {
|
6 |
|
7 |
/**
|
src/lib/src/Scans/Helpers/CopyResultsSets.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Scans\Helpers;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Scans\Base\ResultsSet;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class CopyResultsSets
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Scans\Helpers
|
10 |
-
*/
|
11 |
class CopyResultsSets {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Scans\Base\ResultsSet;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class CopyResultsSets {
|
8 |
|
9 |
/**
|
src/lib/src/Scans/Helpers/MergeResultsSets.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Scans\Helpers;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Scans\Base\ResultsSet;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class MergeResultsSets
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Scans\Helpers
|
10 |
-
*/
|
11 |
class MergeResultsSets {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Scans\Base\ResultsSet;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class MergeResultsSets {
|
8 |
|
9 |
/**
|
src/lib/src/Scans/Helpers/ScannerRecursiveFilterIterator.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Scans\Helpers;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class ScannerRecursiveFilterIterator
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Scans\Helpers
|
10 |
-
*/
|
11 |
class ScannerRecursiveFilterIterator extends \RecursiveFilterIterator {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class ScannerRecursiveFilterIterator extends \RecursiveFilterIterator {
|
8 |
|
9 |
/**
|
src/lib/src/Scans/Helpers/StandardDirectoryIterator.php
CHANGED
@@ -2,10 +2,6 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Scans\Helpers;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class StandardDirectoryIterator
|
7 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Scans\Helpers
|
8 |
-
*/
|
9 |
class StandardDirectoryIterator {
|
10 |
|
11 |
/**
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Scans\Helpers;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class StandardDirectoryIterator {
|
6 |
|
7 |
/**
|
src/lib/src/Scans/Mal/ScanActionVO.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Scans\Mal;
|
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Scans\Base\BaseScanActionVO;
|
6 |
|
7 |
/**
|
8 |
-
* Class ScanActionVO
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Scans\Mal
|
10 |
* @property string[] $file_exts
|
11 |
* @property string[] $scan_root_dirs
|
12 |
* @property string[] $paths_whitelisted
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Scans\Base\BaseScanActionVO;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property string[] $file_exts
|
9 |
* @property string[] $scan_root_dirs
|
10 |
* @property string[] $paths_whitelisted
|
src/lib/src/Scans/Wcf/ScanActionVO.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Scans\Wcf;
|
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Scans\Base\BaseScanActionVO;
|
6 |
|
7 |
/**
|
8 |
-
* Class ScanActionVO
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Scans\Wcf
|
10 |
* @property string $exclusions_missing_regex
|
11 |
* @property string $exclusions_files_regex
|
12 |
*/
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Scans\Base\BaseScanActionVO;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property string $exclusions_missing_regex
|
9 |
* @property string $exclusions_files_regex
|
10 |
*/
|
src/lib/src/ShieldNetApi/Common/BaseApi.php
CHANGED
@@ -7,8 +7,6 @@ use FernleafSystems\Wordpress\Services\Services;
|
|
7 |
use FernleafSystems\Wordpress\Services\Utilities\HttpRequest;
|
8 |
|
9 |
/**
|
10 |
-
* Class Lookup
|
11 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Licenses\Keyless
|
12 |
* @property string $lookup_url_stub
|
13 |
* @property string $request_method
|
14 |
* @property int $timeout
|
7 |
use FernleafSystems\Wordpress\Services\Utilities\HttpRequest;
|
8 |
|
9 |
/**
|
|
|
|
|
10 |
* @property string $lookup_url_stub
|
11 |
* @property string $request_method
|
12 |
* @property int $timeout
|
src/lib/src/Tables/Build/AdminNotes.php
CHANGED
@@ -5,10 +5,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Tables\Build;
|
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\AdminNotes\EntryVO;
|
6 |
use FernleafSystems\Wordpress\Plugin\Shield\Tables;
|
7 |
|
8 |
-
/**
|
9 |
-
* Class AdminNotes
|
10 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Tables\Build
|
11 |
-
*/
|
12 |
class AdminNotes extends BaseBuild {
|
13 |
|
14 |
/**
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Databases\AdminNotes\EntryVO;
|
6 |
use FernleafSystems\Wordpress\Plugin\Shield\Tables;
|
7 |
|
|
|
|
|
|
|
|
|
8 |
class AdminNotes extends BaseBuild {
|
9 |
|
10 |
/**
|
src/lib/src/Tables/Build/Ip.php
CHANGED
@@ -50,23 +50,23 @@ class Ip extends BaseBuild {
|
|
50 |
|
51 |
foreach ( $this->getEntriesRaw() as $key => $entry ) {
|
52 |
/** @var IPs\EntryVO $entry */
|
53 |
-
$
|
54 |
$bBlocked = $entry->blocked_at > 0 || $entry->transgressions >= $nTransLimit;
|
55 |
-
$
|
56 |
->carbon( true )
|
57 |
->setTimestamp( $entry->last_access_at )
|
58 |
->diffForHumans();
|
59 |
-
$
|
60 |
-
$
|
61 |
-
$
|
62 |
-
$
|
63 |
-
$
|
64 |
-
$
|
65 |
$this->getIpAnalysisLink( $entry->ip ),
|
66 |
-
$
|
67 |
);
|
68 |
|
69 |
-
$entries[ $key ] = $
|
70 |
}
|
71 |
return $entries;
|
72 |
}
|
50 |
|
51 |
foreach ( $this->getEntriesRaw() as $key => $entry ) {
|
52 |
/** @var IPs\EntryVO $entry */
|
53 |
+
$aE = $entry->getRawData();
|
54 |
$bBlocked = $entry->blocked_at > 0 || $entry->transgressions >= $nTransLimit;
|
55 |
+
$aE[ 'last_trans_at' ] = Services::Request()
|
56 |
->carbon( true )
|
57 |
->setTimestamp( $entry->last_access_at )
|
58 |
->diffForHumans();
|
59 |
+
$aE[ 'last_access_at' ] = $this->formatTimestampField( $entry->last_access_at );
|
60 |
+
$aE[ 'created_at' ] = $this->formatTimestampField( $entry->created_at );
|
61 |
+
$aE[ 'blocked' ] = $bBlocked ? __( 'Yes' ) : __( 'No' );
|
62 |
+
$aE[ 'expires_at' ] = $this->formatTimestampField( $entry->last_access_at + $opts->getAutoExpireTime() );
|
63 |
+
$aE[ 'is_you' ] = $srvIP->checkIp( $you, $entry->ip );
|
64 |
+
$aE[ 'ip' ] = sprintf( '%s%s',
|
65 |
$this->getIpAnalysisLink( $entry->ip ),
|
66 |
+
$aE[ 'is_you' ] ? ' <span class="small">('.__( 'You', 'wp-simple-firewall' ).')</span>' : ''
|
67 |
);
|
68 |
|
69 |
+
$entries[ $key ] = $aE;
|
70 |
}
|
71 |
return $entries;
|
72 |
}
|
src/lib/src/Tests/VerifyUniqueEvents.php
CHANGED
@@ -6,8 +6,6 @@ use FernleafSystems\Wordpress\Plugin\Shield\Modules\PluginControllerConsumer;
|
|
6 |
|
7 |
/**
|
8 |
* Detects any duplicate event keys
|
9 |
-
* Class VerifyUniqueEvents
|
10 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Tests
|
11 |
*/
|
12 |
class VerifyUniqueEvents {
|
13 |
|
6 |
|
7 |
/**
|
8 |
* Detects any duplicate event keys
|
|
|
|
|
9 |
*/
|
10 |
class VerifyUniqueEvents {
|
11 |
|
src/lib/src/Utilities/AdminNotices/Controller.php
CHANGED
@@ -87,23 +87,23 @@ class Controller {
|
|
87 |
* @return NoticeVO|null
|
88 |
*/
|
89 |
public function getFlashNotice() {
|
90 |
-
$
|
91 |
-
$
|
92 |
-
if ( is_array( $
|
93 |
-
$
|
94 |
-
$
|
95 |
-
$
|
96 |
'notice_classes' => [
|
97 |
'flash',
|
98 |
-
$
|
99 |
],
|
100 |
-
'message' => sanitize_text_field( $
|
101 |
];
|
102 |
-
$
|
103 |
-
$
|
104 |
$this->clearFlashMessage();
|
105 |
}
|
106 |
-
return $
|
107 |
}
|
108 |
|
109 |
/**
|
@@ -148,7 +148,9 @@ class Controller {
|
|
148 |
$data[ 'unique_render_id' ] = uniqid( $notice->id );
|
149 |
$data[ 'notice_id' ] = $notice->id;
|
150 |
|
151 |
-
$ajaxData = $this->getCon()
|
|
|
|
|
152 |
$ajaxData[ 'hide' ] = 1;
|
153 |
$ajaxData[ 'notice_id' ] = $notice->id;
|
154 |
$data[ 'ajax' ][ 'dismiss_admin_notice' ] = json_encode( $ajaxData );
|
87 |
* @return NoticeVO|null
|
88 |
*/
|
89 |
public function getFlashNotice() {
|
90 |
+
$notice = null;
|
91 |
+
$msg = $this->retrieveFlashMessage();
|
92 |
+
if ( is_array( $msg ) ) {
|
93 |
+
$notice = new NoticeVO();
|
94 |
+
$notice->type = $msg[ 'error' ] ? 'error' : 'updated';
|
95 |
+
$notice->render_data = [
|
96 |
'notice_classes' => [
|
97 |
'flash',
|
98 |
+
$notice->type
|
99 |
],
|
100 |
+
'message' => sanitize_text_field( $msg[ 'message' ] ),
|
101 |
];
|
102 |
+
$notice->template = '/notices/flash-message.twig';
|
103 |
+
$notice->display = true;
|
104 |
$this->clearFlashMessage();
|
105 |
}
|
106 |
+
return $notice;
|
107 |
}
|
108 |
|
109 |
/**
|
148 |
$data[ 'unique_render_id' ] = uniqid( $notice->id );
|
149 |
$data[ 'notice_id' ] = $notice->id;
|
150 |
|
151 |
+
$ajaxData = $this->getCon()
|
152 |
+
->getModule( $notice->mod ?? 'plugin' )
|
153 |
+
->getNonceActionData( 'dismiss_admin_notice' );
|
154 |
$ajaxData[ 'hide' ] = 1;
|
155 |
$ajaxData[ 'notice_id' ] = $notice->id;
|
156 |
$data[ 'ajax' ][ 'dismiss_admin_notice' ] = json_encode( $ajaxData );
|
src/lib/src/Utilities/AdminNotices/NoticeVO.php
CHANGED
@@ -2,12 +2,11 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Utilities\AdminNotices;
|
4 |
|
5 |
-
use FernleafSystems\Utilities\Data\Adapter\
|
6 |
|
7 |
/**
|
8 |
-
* Class NoticeVO
|
9 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Utilities\Notices
|
10 |
* @property string $id
|
|
|
11 |
* @property bool $display
|
12 |
* @property string $non_display_reason
|
13 |
* @property array $render_data
|
@@ -22,7 +21,6 @@ use FernleafSystems\Utilities\Data\Adapter\DynProperties;
|
|
22 |
* @property int $min_install_days
|
23 |
* @property bool $twig
|
24 |
*/
|
25 |
-
class NoticeVO {
|
26 |
|
27 |
-
use DynProperties;
|
28 |
}
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Utilities\AdminNotices;
|
4 |
|
5 |
+
use FernleafSystems\Utilities\Data\Adapter\DynPropertiesClass;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property string $id
|
9 |
+
* @property string $mod
|
10 |
* @property bool $display
|
11 |
* @property string $non_display_reason
|
12 |
* @property array $render_data
|
21 |
* @property int $min_install_days
|
22 |
* @property bool $twig
|
23 |
*/
|
24 |
+
class NoticeVO extends DynPropertiesClass {
|
25 |
|
|
|
26 |
}
|
src/lib/src/Utilities/ReCaptcha/WordpressPost.php
CHANGED
@@ -5,10 +5,6 @@ namespace FernleafSystems\Wordpress\Plugin\Shield\Utilities\ReCaptcha;
|
|
5 |
use ReCaptcha\RequestMethod;
|
6 |
use ReCaptcha\RequestParameters;
|
7 |
|
8 |
-
/**
|
9 |
-
* Class WordpressPost
|
10 |
-
* @package ReCaptcha\RequestMethod
|
11 |
-
*/
|
12 |
class WordpressPost implements RequestMethod {
|
13 |
|
14 |
/**
|
5 |
use ReCaptcha\RequestMethod;
|
6 |
use ReCaptcha\RequestParameters;
|
7 |
|
|
|
|
|
|
|
|
|
8 |
class WordpressPost implements RequestMethod {
|
9 |
|
10 |
/**
|
src/lib/src/Utilities/Tool/FormatBytes.php
CHANGED
@@ -2,10 +2,6 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Utilities\Tool;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class FormatBytes
|
7 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Utilities\Tool
|
8 |
-
*/
|
9 |
class FormatBytes {
|
10 |
|
11 |
/**
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Utilities\Tool;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class FormatBytes {
|
6 |
|
7 |
/**
|
src/lib/src/Utilities/Tool/IpListSort.php
CHANGED
@@ -2,10 +2,6 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Utilities\Tool;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class IpListSort
|
7 |
-
* @package FernleafSystems\Wordpress\Plugin\Shield\Utilities\Tool
|
8 |
-
*/
|
9 |
class IpListSort {
|
10 |
|
11 |
/**
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Plugin\Shield\Utilities\Tool;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class IpListSort {
|
6 |
|
7 |
/**
|
src/lib/vendor/composer/autoload_classmap.php
CHANGED
@@ -193,6 +193,7 @@ return array(
|
|
193 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Databases\\Session\\Update' => $baseDir . '/src/Databases/Session/Update.php',
|
194 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Helpers\\QuickAccess' => $baseDir . '/src/Helpers/QuickAccess.php',
|
195 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\License\\EddLicenseVO' => $baseDir . '/src/License/EddLicenseVO.php',
|
|
|
196 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Logging\\Processors\\RequestMetaProcessor' => $baseDir . '/src/Logging/Processors/RequestMetaProcessor.php',
|
197 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Logging\\Processors\\ShieldMetaProcessor' => $baseDir . '/src/Logging/Processors/ShieldMetaProcessor.php',
|
198 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Logging\\Processors\\UserMetaProcessor' => $baseDir . '/src/Logging/Processors/UserMetaProcessor.php',
|
@@ -229,7 +230,6 @@ return array(
|
|
229 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\LogHandlers\\Utility\\LogFileRotate' => $baseDir . '/src/Modules/AuditTrail/Lib/LogHandlers/Utility/LogFileRotate.php',
|
230 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\LogTable\\BuildAuditTableData' => $baseDir . '/src/Modules/AuditTrail/Lib/LogTable/BuildAuditTableData.php',
|
231 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\LogTable\\BuildSearchPanesData' => $baseDir . '/src/Modules/AuditTrail/Lib/LogTable/BuildSearchPanesData.php',
|
232 |
-
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\LogTable\\DelegateAjaxHandler' => $baseDir . '/src/Modules/AuditTrail/Lib/LogTable/DelegateAjaxHandler.php',
|
233 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\Utility\\GetLogFileContent' => $baseDir . '/src/Modules/AuditTrail/Lib/Utility/GetLogFileContent.php',
|
234 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\ModCon' => $baseDir . '/src/Modules/AuditTrail/ModCon.php',
|
235 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Options' => $baseDir . '/src/Modules/AuditTrail/Options.php',
|
@@ -883,7 +883,6 @@ return array(
|
|
883 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Lib\\RequestLogger' => $baseDir . '/src/Modules/Traffic/Lib/RequestLogger.php',
|
884 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Lib\\TrafficTable\\BuildSearchPanesData' => $baseDir . '/src/Modules/Traffic/Lib/TrafficTable/BuildSearchPanesData.php',
|
885 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Lib\\TrafficTable\\BuildTrafficTableData' => $baseDir . '/src/Modules/Traffic/Lib/TrafficTable/BuildTrafficTableData.php',
|
886 |
-
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Lib\\TrafficTable\\DelegateAjaxHandler' => $baseDir . '/src/Modules/Traffic/Lib/TrafficTable/DelegateAjaxHandler.php',
|
887 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\ModCon' => $baseDir . '/src/Modules/Traffic/ModCon.php',
|
888 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Options' => $baseDir . '/src/Modules/Traffic/Options.php',
|
889 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Processor' => $baseDir . '/src/Modules/Traffic/Processor.php',
|
193 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Databases\\Session\\Update' => $baseDir . '/src/Databases/Session/Update.php',
|
194 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Helpers\\QuickAccess' => $baseDir . '/src/Helpers/QuickAccess.php',
|
195 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\License\\EddLicenseVO' => $baseDir . '/src/License/EddLicenseVO.php',
|
196 |
+
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Logging\\Processors\\BaseMetaProcessor' => $baseDir . '/src/Logging/Processors/BaseMetaProcessor.php',
|
197 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Logging\\Processors\\RequestMetaProcessor' => $baseDir . '/src/Logging/Processors/RequestMetaProcessor.php',
|
198 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Logging\\Processors\\ShieldMetaProcessor' => $baseDir . '/src/Logging/Processors/ShieldMetaProcessor.php',
|
199 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Logging\\Processors\\UserMetaProcessor' => $baseDir . '/src/Logging/Processors/UserMetaProcessor.php',
|
230 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\LogHandlers\\Utility\\LogFileRotate' => $baseDir . '/src/Modules/AuditTrail/Lib/LogHandlers/Utility/LogFileRotate.php',
|
231 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\LogTable\\BuildAuditTableData' => $baseDir . '/src/Modules/AuditTrail/Lib/LogTable/BuildAuditTableData.php',
|
232 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\LogTable\\BuildSearchPanesData' => $baseDir . '/src/Modules/AuditTrail/Lib/LogTable/BuildSearchPanesData.php',
|
|
|
233 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\Utility\\GetLogFileContent' => $baseDir . '/src/Modules/AuditTrail/Lib/Utility/GetLogFileContent.php',
|
234 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\ModCon' => $baseDir . '/src/Modules/AuditTrail/ModCon.php',
|
235 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Options' => $baseDir . '/src/Modules/AuditTrail/Options.php',
|
883 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Lib\\RequestLogger' => $baseDir . '/src/Modules/Traffic/Lib/RequestLogger.php',
|
884 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Lib\\TrafficTable\\BuildSearchPanesData' => $baseDir . '/src/Modules/Traffic/Lib/TrafficTable/BuildSearchPanesData.php',
|
885 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Lib\\TrafficTable\\BuildTrafficTableData' => $baseDir . '/src/Modules/Traffic/Lib/TrafficTable/BuildTrafficTableData.php',
|
|
|
886 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\ModCon' => $baseDir . '/src/Modules/Traffic/ModCon.php',
|
887 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Options' => $baseDir . '/src/Modules/Traffic/Options.php',
|
888 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Processor' => $baseDir . '/src/Modules/Traffic/Processor.php',
|
src/lib/vendor/composer/autoload_static.php
CHANGED
@@ -380,6 +380,7 @@ class ComposerStaticInit4fc2c6daaffaf40b64b79b6d26830171
|
|
380 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Databases\\Session\\Update' => __DIR__ . '/../..' . '/src/Databases/Session/Update.php',
|
381 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Helpers\\QuickAccess' => __DIR__ . '/../..' . '/src/Helpers/QuickAccess.php',
|
382 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\License\\EddLicenseVO' => __DIR__ . '/../..' . '/src/License/EddLicenseVO.php',
|
|
|
383 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Logging\\Processors\\RequestMetaProcessor' => __DIR__ . '/../..' . '/src/Logging/Processors/RequestMetaProcessor.php',
|
384 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Logging\\Processors\\ShieldMetaProcessor' => __DIR__ . '/../..' . '/src/Logging/Processors/ShieldMetaProcessor.php',
|
385 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Logging\\Processors\\UserMetaProcessor' => __DIR__ . '/../..' . '/src/Logging/Processors/UserMetaProcessor.php',
|
@@ -416,7 +417,6 @@ class ComposerStaticInit4fc2c6daaffaf40b64b79b6d26830171
|
|
416 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\LogHandlers\\Utility\\LogFileRotate' => __DIR__ . '/../..' . '/src/Modules/AuditTrail/Lib/LogHandlers/Utility/LogFileRotate.php',
|
417 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\LogTable\\BuildAuditTableData' => __DIR__ . '/../..' . '/src/Modules/AuditTrail/Lib/LogTable/BuildAuditTableData.php',
|
418 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\LogTable\\BuildSearchPanesData' => __DIR__ . '/../..' . '/src/Modules/AuditTrail/Lib/LogTable/BuildSearchPanesData.php',
|
419 |
-
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\LogTable\\DelegateAjaxHandler' => __DIR__ . '/../..' . '/src/Modules/AuditTrail/Lib/LogTable/DelegateAjaxHandler.php',
|
420 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\Utility\\GetLogFileContent' => __DIR__ . '/../..' . '/src/Modules/AuditTrail/Lib/Utility/GetLogFileContent.php',
|
421 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\ModCon' => __DIR__ . '/../..' . '/src/Modules/AuditTrail/ModCon.php',
|
422 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Options' => __DIR__ . '/../..' . '/src/Modules/AuditTrail/Options.php',
|
@@ -1070,7 +1070,6 @@ class ComposerStaticInit4fc2c6daaffaf40b64b79b6d26830171
|
|
1070 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Lib\\RequestLogger' => __DIR__ . '/../..' . '/src/Modules/Traffic/Lib/RequestLogger.php',
|
1071 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Lib\\TrafficTable\\BuildSearchPanesData' => __DIR__ . '/../..' . '/src/Modules/Traffic/Lib/TrafficTable/BuildSearchPanesData.php',
|
1072 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Lib\\TrafficTable\\BuildTrafficTableData' => __DIR__ . '/../..' . '/src/Modules/Traffic/Lib/TrafficTable/BuildTrafficTableData.php',
|
1073 |
-
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Lib\\TrafficTable\\DelegateAjaxHandler' => __DIR__ . '/../..' . '/src/Modules/Traffic/Lib/TrafficTable/DelegateAjaxHandler.php',
|
1074 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\ModCon' => __DIR__ . '/../..' . '/src/Modules/Traffic/ModCon.php',
|
1075 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Options' => __DIR__ . '/../..' . '/src/Modules/Traffic/Options.php',
|
1076 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Processor' => __DIR__ . '/../..' . '/src/Modules/Traffic/Processor.php',
|
380 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Databases\\Session\\Update' => __DIR__ . '/../..' . '/src/Databases/Session/Update.php',
|
381 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Helpers\\QuickAccess' => __DIR__ . '/../..' . '/src/Helpers/QuickAccess.php',
|
382 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\License\\EddLicenseVO' => __DIR__ . '/../..' . '/src/License/EddLicenseVO.php',
|
383 |
+
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Logging\\Processors\\BaseMetaProcessor' => __DIR__ . '/../..' . '/src/Logging/Processors/BaseMetaProcessor.php',
|
384 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Logging\\Processors\\RequestMetaProcessor' => __DIR__ . '/../..' . '/src/Logging/Processors/RequestMetaProcessor.php',
|
385 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Logging\\Processors\\ShieldMetaProcessor' => __DIR__ . '/../..' . '/src/Logging/Processors/ShieldMetaProcessor.php',
|
386 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Logging\\Processors\\UserMetaProcessor' => __DIR__ . '/../..' . '/src/Logging/Processors/UserMetaProcessor.php',
|
417 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\LogHandlers\\Utility\\LogFileRotate' => __DIR__ . '/../..' . '/src/Modules/AuditTrail/Lib/LogHandlers/Utility/LogFileRotate.php',
|
418 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\LogTable\\BuildAuditTableData' => __DIR__ . '/../..' . '/src/Modules/AuditTrail/Lib/LogTable/BuildAuditTableData.php',
|
419 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\LogTable\\BuildSearchPanesData' => __DIR__ . '/../..' . '/src/Modules/AuditTrail/Lib/LogTable/BuildSearchPanesData.php',
|
|
|
420 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Lib\\Utility\\GetLogFileContent' => __DIR__ . '/../..' . '/src/Modules/AuditTrail/Lib/Utility/GetLogFileContent.php',
|
421 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\ModCon' => __DIR__ . '/../..' . '/src/Modules/AuditTrail/ModCon.php',
|
422 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\AuditTrail\\Options' => __DIR__ . '/../..' . '/src/Modules/AuditTrail/Options.php',
|
1070 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Lib\\RequestLogger' => __DIR__ . '/../..' . '/src/Modules/Traffic/Lib/RequestLogger.php',
|
1071 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Lib\\TrafficTable\\BuildSearchPanesData' => __DIR__ . '/../..' . '/src/Modules/Traffic/Lib/TrafficTable/BuildSearchPanesData.php',
|
1072 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Lib\\TrafficTable\\BuildTrafficTableData' => __DIR__ . '/../..' . '/src/Modules/Traffic/Lib/TrafficTable/BuildTrafficTableData.php',
|
|
|
1073 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\ModCon' => __DIR__ . '/../..' . '/src/Modules/Traffic/ModCon.php',
|
1074 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Options' => __DIR__ . '/../..' . '/src/Modules/Traffic/Options.php',
|
1075 |
'FernleafSystems\\Wordpress\\Plugin\\Shield\\Modules\\Traffic\\Processor' => __DIR__ . '/../..' . '/src/Modules/Traffic/Processor.php',
|
src/lib/vendor/fernleafsystems/utilities/src/Data/Adapter/DynProperties.php
CHANGED
@@ -6,6 +6,11 @@ trait DynProperties {
|
|
6 |
|
7 |
private $raw = [];
|
8 |
|
|
|
|
|
|
|
|
|
|
|
9 |
/**
|
10 |
* @param string $key
|
11 |
* @return mixed
|
@@ -33,6 +38,13 @@ trait DynProperties {
|
|
33 |
unset( $this->raw[ $key ] );
|
34 |
}
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
public function applyFromArray( array $data, array $restrictedKeys = [] ) {
|
37 |
if ( !empty( $restrictedKeys ) ) {
|
38 |
$data = array_intersect_key( $data, array_flip( $restrictedKeys ) );
|
6 |
|
7 |
private $raw = [];
|
8 |
|
9 |
+
public function isEmpty( string $key ) :bool {
|
10 |
+
$value = $this->{$key};
|
11 |
+
return empty( $value );
|
12 |
+
}
|
13 |
+
|
14 |
/**
|
15 |
* @param string $key
|
16 |
* @return mixed
|
38 |
unset( $this->raw[ $key ] );
|
39 |
}
|
40 |
|
41 |
+
/**
|
42 |
+
* @param string $key
|
43 |
+
*/
|
44 |
+
public function __empty( string $key ) {
|
45 |
+
unset( $this->raw[ $key ] );
|
46 |
+
}
|
47 |
+
|
48 |
public function applyFromArray( array $data, array $restrictedKeys = [] ) {
|
49 |
if ( !empty( $restrictedKeys ) ) {
|
50 |
$data = array_intersect_key( $data, array_flip( $restrictedKeys ) );
|
src/lib/vendor/fernleafsystems/wordpress-plugin-core/src/Databases/Common/BuildColumnFromDef.php
CHANGED
@@ -9,6 +9,7 @@ class BuildColumnFromDef {
|
|
9 |
const MACROTYPE_PRIMARYID = 'primary_id';
|
10 |
const MACROTYPE_TIMESTAMP = 'timestamp';
|
11 |
const MACROTYPE_UNSIGNEDINT = 'unsigned_int';
|
|
|
12 |
const MACROTYPE_FOREIGN_KEY_ID = 'foreign_key_id';
|
13 |
const MACROTYPE_BINARYHASH = 'binary_hash';
|
14 |
const MACROTYPE_HASH = 'hash';
|
@@ -45,24 +46,34 @@ class BuildColumnFromDef {
|
|
45 |
}
|
46 |
|
47 |
public function buildStructure() :array {
|
48 |
-
|
49 |
$this->getMacroTypeDef( $this->def[ 'macro_type' ] ?? '' ),
|
50 |
$this->def
|
51 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
}
|
53 |
|
54 |
protected function getMacroTypeDef( string $macroType ) :array {
|
55 |
switch ( $macroType ) {
|
56 |
|
57 |
case self::MACROTYPE_BOOL:
|
58 |
-
$def = array_merge(
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
|
|
|
|
|
|
66 |
break;
|
67 |
|
68 |
case self::MACROTYPE_CHAR:
|
@@ -180,13 +191,10 @@ class BuildColumnFromDef {
|
|
180 |
break;
|
181 |
|
182 |
case self::MACROTYPE_TIMESTAMP:
|
183 |
-
$def = array_merge(
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
'comment' => 'Epoch Timestamp',
|
188 |
-
]
|
189 |
-
);
|
190 |
break;
|
191 |
|
192 |
case self::MACROTYPE_UNSIGNEDINT:
|
9 |
const MACROTYPE_PRIMARYID = 'primary_id';
|
10 |
const MACROTYPE_TIMESTAMP = 'timestamp';
|
11 |
const MACROTYPE_UNSIGNEDINT = 'unsigned_int';
|
12 |
+
const MACROTYPE_BIGINT = 'bigint';
|
13 |
const MACROTYPE_FOREIGN_KEY_ID = 'foreign_key_id';
|
14 |
const MACROTYPE_BINARYHASH = 'binary_hash';
|
15 |
const MACROTYPE_HASH = 'hash';
|
46 |
}
|
47 |
|
48 |
public function buildStructure() :array {
|
49 |
+
$structure = Services::DataManipulation()->mergeArraysRecursive(
|
50 |
$this->getMacroTypeDef( $this->def[ 'macro_type' ] ?? '' ),
|
51 |
$this->def
|
52 |
);
|
53 |
+
|
54 |
+
if ( $this->def[ 'no_length' ] ?? false ) {
|
55 |
+
unset( $structure[ 'length' ] );
|
56 |
+
}
|
57 |
+
|
58 |
+
return $structure;
|
59 |
}
|
60 |
|
61 |
protected function getMacroTypeDef( string $macroType ) :array {
|
62 |
switch ( $macroType ) {
|
63 |
|
64 |
case self::MACROTYPE_BOOL:
|
65 |
+
$def = array_merge( $this->getMacroTypeDef( self::MACROTYPE_UNSIGNEDINT ), [
|
66 |
+
'type' => 'tinyint',
|
67 |
+
'length' => 1,
|
68 |
+
'comment' => 'Boolean',
|
69 |
+
] );
|
70 |
+
break;
|
71 |
+
|
72 |
+
case self::MACROTYPE_BIGINT:
|
73 |
+
$def = array_merge( $this->getMacroTypeDef( self::MACROTYPE_UNSIGNEDINT ), [
|
74 |
+
'type' => 'bigint',
|
75 |
+
'comment' => 'BIG Int',
|
76 |
+
] );
|
77 |
break;
|
78 |
|
79 |
case self::MACROTYPE_CHAR:
|
191 |
break;
|
192 |
|
193 |
case self::MACROTYPE_TIMESTAMP:
|
194 |
+
$def = array_merge( $this->getMacroTypeDef( self::MACROTYPE_UNSIGNEDINT ), [
|
195 |
+
'length' => 15,
|
196 |
+
'comment' => 'Epoch Timestamp',
|
197 |
+
] );
|
|
|
|
|
|
|
198 |
break;
|
199 |
|
200 |
case self::MACROTYPE_UNSIGNEDINT:
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Core/Fs.php
CHANGED
@@ -533,13 +533,13 @@ class Fs {
|
|
533 |
}
|
534 |
|
535 |
/**
|
536 |
-
* @param string $
|
537 |
-
* @param array $
|
538 |
* @return array|false
|
539 |
* @deprecated
|
540 |
*/
|
541 |
-
public function getUrl( $
|
542 |
-
return Services::HttpRequest()->requestUrl( $
|
543 |
}
|
544 |
|
545 |
/**
|
533 |
}
|
534 |
|
535 |
/**
|
536 |
+
* @param string $url
|
537 |
+
* @param array $args
|
538 |
* @return array|false
|
539 |
* @deprecated
|
540 |
*/
|
541 |
+
public function getUrl( $url, $args = [] ) {
|
542 |
+
return Services::HttpRequest()->requestUrl( $url, $args, 'GET' );
|
543 |
}
|
544 |
|
545 |
/**
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Core/VOs/Assets/WpBaseVo.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Services\Core\VOs\Assets;
|
|
5 |
use FernleafSystems\Utilities\Data\Adapter\DynPropertiesClass;
|
6 |
|
7 |
/**
|
8 |
-
* Class WpBaseVo
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Core\VOs
|
10 |
* @property string Name
|
11 |
* @property string Version
|
12 |
* @property string Description
|
5 |
use FernleafSystems\Utilities\Data\Adapter\DynPropertiesClass;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property string Name
|
9 |
* @property string Version
|
10 |
* @property string Description
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Core/VOs/Assets/WpPluginVo.php
CHANGED
@@ -6,8 +6,6 @@ use FernleafSystems\Wordpress\Services\Services;
|
|
6 |
use FernleafSystems\Wordpress\Services\Utilities\WpOrg\Plugin;
|
7 |
|
8 |
/**
|
9 |
-
* Class WpPluginVo
|
10 |
-
* @package FernleafSystems\Wordpress\Services\Core\VOs
|
11 |
* @property string PluginURI
|
12 |
* @property bool Network
|
13 |
* @property string Title
|
6 |
use FernleafSystems\Wordpress\Services\Utilities\WpOrg\Plugin;
|
7 |
|
8 |
/**
|
|
|
|
|
9 |
* @property string PluginURI
|
10 |
* @property bool Network
|
11 |
* @property string Title
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Core/VOs/Assets/WpThemeVo.php
CHANGED
@@ -6,8 +6,6 @@ use FernleafSystems\Wordpress\Services\Services;
|
|
6 |
use FernleafSystems\Wordpress\Services\Utilities\WpOrg\Theme;
|
7 |
|
8 |
/**
|
9 |
-
* Class WpThemeVo
|
10 |
-
* @package FernleafSystems\Wordpress\Services\Core\VOs
|
11 |
* @property string $theme - the stylesheet
|
12 |
* @property string $stylesheet - the stylesheet
|
13 |
* @property \WP_Theme $wp_theme
|
6 |
use FernleafSystems\Wordpress\Services\Utilities\WpOrg\Theme;
|
7 |
|
8 |
/**
|
|
|
|
|
9 |
* @property string $theme - the stylesheet
|
10 |
* @property string $stylesheet - the stylesheet
|
11 |
* @property \WP_Theme $wp_theme
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Core/VOs/WpBaseVo.php
CHANGED
@@ -8,8 +8,6 @@ use FernleafSystems\Wordpress\Services\Utilities\WpOrg\Plugin;
|
|
8 |
use FernleafSystems\Wordpress\Services\Utilities\WpOrg\Theme;
|
9 |
|
10 |
/**
|
11 |
-
* Class WpBaseVo
|
12 |
-
* @package FernleafSystems\Wordpress\Services\Core\VOs
|
13 |
* @property string Name
|
14 |
* @property string Version
|
15 |
* @property string Description
|
8 |
use FernleafSystems\Wordpress\Services\Utilities\WpOrg\Theme;
|
9 |
|
10 |
/**
|
|
|
|
|
11 |
* @property string Name
|
12 |
* @property string Version
|
13 |
* @property string Description
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Core/VOs/WpHttpResponseVo.php
CHANGED
@@ -2,21 +2,17 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Core\VOs;
|
4 |
|
5 |
-
use FernleafSystems\Utilities\Data\Adapter\
|
6 |
|
7 |
/**
|
8 |
-
* Class WpHttpResponseVo
|
9 |
* @see class-wp-http-requests-response.php to_array()
|
10 |
-
* @package FernleafSystems\Wordpress\Services\Core\VOs
|
11 |
* @property string $body
|
12 |
* @property string $headers
|
13 |
* @property array $response
|
14 |
* @property string $cookies
|
15 |
* @property string $filename
|
16 |
*/
|
17 |
-
class WpHttpResponseVo {
|
18 |
-
|
19 |
-
use StdClassAdapter;
|
20 |
|
21 |
/**
|
22 |
* @return int
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Core\VOs;
|
4 |
|
5 |
+
use FernleafSystems\Utilities\Data\Adapter\DynPropertiesClass;
|
6 |
|
7 |
/**
|
|
|
8 |
* @see class-wp-http-requests-response.php to_array()
|
|
|
9 |
* @property string $body
|
10 |
* @property string $headers
|
11 |
* @property array $response
|
12 |
* @property string $cookies
|
13 |
* @property string $filename
|
14 |
*/
|
15 |
+
class WpHttpResponseVo extends DynPropertiesClass {
|
|
|
|
|
16 |
|
17 |
/**
|
18 |
* @return int
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Core/VOs/WpPluginVo.php
CHANGED
@@ -6,8 +6,6 @@ use FernleafSystems\Wordpress\Services\Services;
|
|
6 |
use FernleafSystems\Wordpress\Services\Utilities\WpOrg\Plugin;
|
7 |
|
8 |
/**
|
9 |
-
* Class WpPluginVo
|
10 |
-
* @package FernleafSystems\Wordpress\Services\Core\VOs
|
11 |
* @property string PluginURI
|
12 |
* @property bool Network
|
13 |
* @property string Title
|
6 |
use FernleafSystems\Wordpress\Services\Utilities\WpOrg\Plugin;
|
7 |
|
8 |
/**
|
|
|
|
|
9 |
* @property string PluginURI
|
10 |
* @property bool Network
|
11 |
* @property string Title
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Core/VOs/WpThemeVo.php
CHANGED
@@ -6,8 +6,6 @@ use FernleafSystems\Wordpress\Services\Services;
|
|
6 |
use FernleafSystems\Wordpress\Services\Utilities\WpOrg\Theme;
|
7 |
|
8 |
/**
|
9 |
-
* Class WpThemeVo
|
10 |
-
* @package FernleafSystems\Wordpress\Services\Core\VOs
|
11 |
* @property string $theme - the stylesheet
|
12 |
* @property string $stylesheet - the stylesheet
|
13 |
* @property \WP_Theme $wp_theme
|
6 |
use FernleafSystems\Wordpress\Services\Utilities\WpOrg\Theme;
|
7 |
|
8 |
/**
|
|
|
|
|
9 |
* @property string $theme - the stylesheet
|
10 |
* @property string $stylesheet - the stylesheet
|
11 |
* @property \WP_Theme $wp_theme
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/ClassicPress/Checksums.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\ClassicPress;
|
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
/**
|
8 |
-
* Class Checksums
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\ClassicPress
|
10 |
* @deprecated
|
11 |
*/
|
12 |
class Checksums {
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @deprecated
|
9 |
*/
|
10 |
class Checksums {
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/Cache/Base.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\File\Cache;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class Base
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\File\Cache
|
10 |
-
*/
|
11 |
class Base {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class Base {
|
8 |
|
9 |
/**
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/Cache/CacheDefVO.php
CHANGED
@@ -3,8 +3,6 @@
|
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\File\Cache;
|
4 |
|
5 |
/**
|
6 |
-
* Class CacheDefVO
|
7 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\File\Cache
|
8 |
* @property string $dir
|
9 |
* @property string $file_fragment
|
10 |
* @property string $expiration
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\File\Cache;
|
4 |
|
5 |
/**
|
|
|
|
|
6 |
* @property string $dir
|
7 |
* @property string $file_fragment
|
8 |
* @property string $expiration
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/Cache/LoadFromCache.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\File\Cache;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class LoadFromCache
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\File\Cache
|
10 |
-
*/
|
11 |
class LoadFromCache extends Base {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class LoadFromCache extends Base {
|
8 |
|
9 |
/**
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/Cache/StoreToCache.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\File\Cache;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class StoreToCache
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\File\Cache
|
10 |
-
*/
|
11 |
class StoreToCache extends Base {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class StoreToCache extends Base {
|
8 |
|
9 |
/**
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/ExtractLineFromFile.php
CHANGED
@@ -2,25 +2,21 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\File;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class ExtractLineFromFile
|
7 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\File
|
8 |
-
*/
|
9 |
class ExtractLineFromFile {
|
10 |
|
11 |
/**
|
12 |
-
* @param string $
|
13 |
-
* @param int $
|
14 |
* @return string
|
15 |
* @throws \Exception
|
16 |
*/
|
17 |
-
public function run( $
|
18 |
|
19 |
-
$
|
20 |
-
if ( !isset( $
|
21 |
throw new \Exception( 'Line does not exist.' );
|
22 |
}
|
23 |
|
24 |
-
return $
|
25 |
}
|
26 |
}
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\File;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class ExtractLineFromFile {
|
6 |
|
7 |
/**
|
8 |
+
* @param string $path
|
9 |
+
* @param int $lineNum
|
10 |
* @return string
|
11 |
* @throws \Exception
|
12 |
*/
|
13 |
+
public function run( $path, $lineNum ) {
|
14 |
|
15 |
+
$lines = ( new ExtractLinesFromFile() )->run( $path, [ $lineNum ] );
|
16 |
+
if ( !isset( $lines[ $lineNum ] ) ) {
|
17 |
throw new \Exception( 'Line does not exist.' );
|
18 |
}
|
19 |
|
20 |
+
return $lines[ $lineNum ];
|
21 |
}
|
22 |
}
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/ExtractLinesFromFile.php
CHANGED
@@ -2,23 +2,18 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\File;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class ExtractLineFromFile
|
7 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\File
|
8 |
-
*/
|
9 |
class ExtractLinesFromFile {
|
10 |
|
11 |
/**
|
12 |
-
* @param string $
|
13 |
-
* @param int[] $
|
14 |
* @return string[]
|
15 |
* @throws \Exception
|
16 |
*/
|
17 |
-
public function run( $
|
18 |
-
|
19 |
-
( new GetFileAsArray() )->run( $
|
20 |
-
array_flip( $
|
21 |
);
|
22 |
-
return $aLines;
|
23 |
}
|
24 |
}
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\File;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class ExtractLinesFromFile {
|
6 |
|
7 |
/**
|
8 |
+
* @param string $path
|
9 |
+
* @param int[] $lineNumbers
|
10 |
* @return string[]
|
11 |
* @throws \Exception
|
12 |
*/
|
13 |
+
public function run( $path, $lineNumbers ) :array {
|
14 |
+
return array_intersect_key(
|
15 |
+
( new GetFileAsArray() )->run( $path ),
|
16 |
+
array_flip( $lineNumbers )
|
17 |
);
|
|
|
18 |
}
|
19 |
}
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/LocateStrInFile.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\File;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class LocateStrInFile
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\File
|
10 |
-
*/
|
11 |
class LocateStrInFile {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class LocateStrInFile {
|
8 |
|
9 |
/**
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/ReadDataFromFileEncrypted.php
CHANGED
@@ -5,10 +5,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\File;
|
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
use FernleafSystems\Wordpress\Services\Utilities\Encrypt\OpenSslEncryptVo;
|
7 |
|
8 |
-
/**
|
9 |
-
* Class ReadDataFromFileEncrypted
|
10 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\File
|
11 |
-
*/
|
12 |
class ReadDataFromFileEncrypted {
|
13 |
|
14 |
/**
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
use FernleafSystems\Wordpress\Services\Utilities\Encrypt\OpenSslEncryptVo;
|
7 |
|
|
|
|
|
|
|
|
|
8 |
class ReadDataFromFileEncrypted {
|
9 |
|
10 |
/**
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/RemoveLineFromFile.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\File;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class RemoveLineFromFile
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\File
|
10 |
-
*/
|
11 |
class RemoveLineFromFile {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class RemoveLineFromFile {
|
8 |
|
9 |
/**
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/TestFileWritable.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\File;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class TestFileWritable
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\File
|
10 |
-
*/
|
11 |
class TestFileWritable {
|
12 |
|
13 |
const TEST_STRING = '/** ODP TEST STRING %s */';
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class TestFileWritable {
|
8 |
|
9 |
const TEST_STRING = '/** ODP TEST STRING %s */';
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/File/WriteDataToFileEncrypted.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\File;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class WriteDataToFileEncrypted
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\File
|
10 |
-
*/
|
11 |
class WriteDataToFileEncrypted {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class WriteDataToFileEncrypted {
|
8 |
|
9 |
/**
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/HttpRequest.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities;
|
4 |
|
5 |
-
use FernleafSystems\Utilities\Data\Adapter\
|
6 |
use FernleafSystems\Wordpress\Services\Core\VOs\WpHttpResponseVo;
|
7 |
|
8 |
/**
|
@@ -11,80 +11,70 @@ use FernleafSystems\Wordpress\Services\Core\VOs\WpHttpResponseVo;
|
|
11 |
* @property WpHttpResponseVo $lastResponse
|
12 |
* @property \WP_Error $lastError
|
13 |
*/
|
14 |
-
class HttpRequest {
|
15 |
-
|
16 |
-
use StdClassAdapter;
|
17 |
|
18 |
/**
|
19 |
-
* @param string $
|
20 |
-
* @param array $
|
21 |
-
* @return bool
|
22 |
*/
|
23 |
-
public function get( $
|
24 |
-
return $this->request( $
|
25 |
}
|
26 |
|
27 |
/**
|
28 |
-
* @param
|
29 |
-
* @param array $aArg
|
30 |
-
* @return string
|
31 |
*/
|
32 |
-
public function getContent( $
|
33 |
-
return $this->get( $
|
34 |
}
|
35 |
|
36 |
/**
|
37 |
-
* @param
|
38 |
-
* @param array $aArg
|
39 |
-
* @return bool
|
40 |
*/
|
41 |
-
public function post( $
|
42 |
-
return $this->request( $
|
43 |
}
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
*/
|
48 |
-
public function isSuccess() {
|
49 |
-
return ( $this->lastResponse instanceof WpHttpResponseVo );
|
50 |
}
|
51 |
|
52 |
/**
|
53 |
* This is provided for backward compatibility with the old requestUrl
|
54 |
-
* @param string $
|
55 |
-
* @param array $
|
56 |
-
* @param string $
|
57 |
* @return array|false
|
58 |
*/
|
59 |
-
public function requestUrl( $
|
60 |
-
return $this->request( $
|
61 |
-
$this->lastResponse->
|
62 |
}
|
63 |
|
64 |
/**
|
65 |
* A helper method for making quick requests. At least a valid URL will need to be supplied.
|
66 |
* All requests default to empty data and GET
|
67 |
-
* @param string $
|
68 |
-
* @param array $
|
69 |
-
* @param string $
|
70 |
* @return $this
|
71 |
*/
|
72 |
-
public function request( $
|
73 |
$this->resetResponses();
|
74 |
try {
|
75 |
-
if ( !empty( $
|
76 |
-
$this->
|
77 |
}
|
78 |
-
if ( is_array( $
|
79 |
-
$this->setRequestArgs( $
|
80 |
}
|
81 |
-
if ( !empty( $
|
82 |
-
$this->setMethod( $
|
83 |
}
|
84 |
$this->lastResponse = $this->send();
|
85 |
}
|
86 |
-
catch ( \Exception $
|
87 |
-
$this->lastError = new \WP_Error( 'odp-http-error', $
|
88 |
}
|
89 |
return $this;
|
90 |
}
|
@@ -94,20 +84,18 @@ class HttpRequest {
|
|
94 |
*/
|
95 |
private function getRequestArgs() {
|
96 |
if ( !is_array( $this->requestArgs ) ) {
|
97 |
-
$this->requestArgs;
|
98 |
}
|
99 |
-
$this->requestArgs = array_merge(
|
100 |
-
|
101 |
-
|
102 |
-
);
|
103 |
return $this->requestArgs;
|
104 |
}
|
105 |
|
106 |
/**
|
107 |
-
* @return WpHttpResponseVo
|
108 |
* @throws \Exception
|
109 |
*/
|
110 |
-
private function send() {
|
111 |
if ( wp_http_validate_url( $this->url ) === false ) {
|
112 |
throw new \Exception( 'URL is invalid' );
|
113 |
}
|
@@ -115,43 +103,46 @@ class HttpRequest {
|
|
115 |
if ( is_wp_error( $mResult ) ) {
|
116 |
throw new \Exception( $mResult->get_error_message() );
|
117 |
}
|
|
|
|
|
|
|
118 |
return ( new WpHttpResponseVo() )->applyFromArray( $mResult );
|
119 |
}
|
120 |
|
121 |
/**
|
122 |
-
* @param string $
|
123 |
* @return $this
|
124 |
*/
|
125 |
-
public function setMethod( $
|
126 |
-
return $this->setRequestArg( 'method', strtoupper( $
|
127 |
}
|
128 |
|
129 |
/**
|
130 |
-
* @param string $
|
131 |
-
* @param mixed $
|
132 |
* @return $this
|
133 |
*/
|
134 |
-
public function setRequestArg( $
|
135 |
-
$
|
136 |
-
$
|
137 |
-
return $this->setRequestArgs( $
|
138 |
}
|
139 |
|
140 |
/**
|
141 |
-
* @param array $
|
142 |
* @return $this
|
143 |
*/
|
144 |
-
public function setRequestArgs( $
|
145 |
-
$this->requestArgs = is_array( $
|
146 |
return $this;
|
147 |
}
|
148 |
|
149 |
/**
|
150 |
-
* @param string $
|
151 |
* @return $this
|
152 |
*/
|
153 |
-
public function setUrl( $
|
154 |
-
$this->url = $
|
155 |
return $this;
|
156 |
}
|
157 |
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities;
|
4 |
|
5 |
+
use FernleafSystems\Utilities\Data\Adapter\DynPropertiesClass;
|
6 |
use FernleafSystems\Wordpress\Services\Core\VOs\WpHttpResponseVo;
|
7 |
|
8 |
/**
|
11 |
* @property WpHttpResponseVo $lastResponse
|
12 |
* @property \WP_Error $lastError
|
13 |
*/
|
14 |
+
class HttpRequest extends DynPropertiesClass {
|
|
|
|
|
15 |
|
16 |
/**
|
17 |
+
* @param string $url
|
18 |
+
* @param array $args
|
|
|
19 |
*/
|
20 |
+
public function get( $url, $args = [] ) :bool {
|
21 |
+
return $this->request( $url, $args, 'GET' )->isSuccess();
|
22 |
}
|
23 |
|
24 |
/**
|
25 |
+
* @param array $args
|
|
|
|
|
26 |
*/
|
27 |
+
public function getContent( string $url, $args = [] ) :string {
|
28 |
+
return $this->get( $url, $args ) ? trim( (string)$this->lastResponse->body ) : '';
|
29 |
}
|
30 |
|
31 |
/**
|
32 |
+
* @param array $args
|
|
|
|
|
33 |
*/
|
34 |
+
public function post( string $url, $args = [] ) :bool {
|
35 |
+
return $this->request( $url, $args, 'POST' )->isSuccess();
|
36 |
}
|
37 |
|
38 |
+
public function isSuccess() :bool {
|
39 |
+
return $this->lastResponse instanceof WpHttpResponseVo;
|
|
|
|
|
|
|
40 |
}
|
41 |
|
42 |
/**
|
43 |
* This is provided for backward compatibility with the old requestUrl
|
44 |
+
* @param string $url
|
45 |
+
* @param array $args
|
46 |
+
* @param string $method
|
47 |
* @return array|false
|
48 |
*/
|
49 |
+
public function requestUrl( $url, $args = [], $method = 'GET' ) {
|
50 |
+
return $this->request( $url, $args, $method )->isSuccess() ?
|
51 |
+
$this->lastResponse->getRawData() : false;
|
52 |
}
|
53 |
|
54 |
/**
|
55 |
* A helper method for making quick requests. At least a valid URL will need to be supplied.
|
56 |
* All requests default to empty data and GET
|
57 |
+
* @param string $url
|
58 |
+
* @param array $args
|
59 |
+
* @param string $method
|
60 |
* @return $this
|
61 |
*/
|
62 |
+
public function request( $url = null, $args = null, $method = null ) {
|
63 |
$this->resetResponses();
|
64 |
try {
|
65 |
+
if ( !empty( $url ) ) {
|
66 |
+
$this->url = $url;
|
67 |
}
|
68 |
+
if ( is_array( $args ) ) {
|
69 |
+
$this->setRequestArgs( $args );
|
70 |
}
|
71 |
+
if ( !empty( $method ) ) {
|
72 |
+
$this->setMethod( $method );
|
73 |
}
|
74 |
$this->lastResponse = $this->send();
|
75 |
}
|
76 |
+
catch ( \Exception $e ) {
|
77 |
+
$this->lastError = new \WP_Error( 'odp-http-error', $e->getMessage() );
|
78 |
}
|
79 |
return $this;
|
80 |
}
|
84 |
*/
|
85 |
private function getRequestArgs() {
|
86 |
if ( !is_array( $this->requestArgs ) ) {
|
87 |
+
$this->requestArgs = [];
|
88 |
}
|
89 |
+
$this->requestArgs = array_merge( [
|
90 |
+
'method' => 'GET'
|
91 |
+
], $this->requestArgs );
|
|
|
92 |
return $this->requestArgs;
|
93 |
}
|
94 |
|
95 |
/**
|
|
|
96 |
* @throws \Exception
|
97 |
*/
|
98 |
+
private function send() :WpHttpResponseVo {
|
99 |
if ( wp_http_validate_url( $this->url ) === false ) {
|
100 |
throw new \Exception( 'URL is invalid' );
|
101 |
}
|
103 |
if ( is_wp_error( $mResult ) ) {
|
104 |
throw new \Exception( $mResult->get_error_message() );
|
105 |
}
|
106 |
+
if ( !is_array( $mResult ) ) {
|
107 |
+
throw new \Exception( 'WP Remote Request response should be an array' );
|
108 |
+
}
|
109 |
return ( new WpHttpResponseVo() )->applyFromArray( $mResult );
|
110 |
}
|
111 |
|
112 |
/**
|
113 |
+
* @param string $method
|
114 |
* @return $this
|
115 |
*/
|
116 |
+
public function setMethod( $method ) {
|
117 |
+
return $this->setRequestArg( 'method', strtoupper( $method ) );
|
118 |
}
|
119 |
|
120 |
/**
|
121 |
+
* @param string $key
|
122 |
+
* @param mixed $value
|
123 |
* @return $this
|
124 |
*/
|
125 |
+
public function setRequestArg( $key, $value ) {
|
126 |
+
$args = $this->getRequestArgs();
|
127 |
+
$args[ $key ] = $value;
|
128 |
+
return $this->setRequestArgs( $args );
|
129 |
}
|
130 |
|
131 |
/**
|
132 |
+
* @param array $args
|
133 |
* @return $this
|
134 |
*/
|
135 |
+
public function setRequestArgs( $args ) {
|
136 |
+
$this->requestArgs = is_array( $args ) ? $args : [];
|
137 |
return $this;
|
138 |
}
|
139 |
|
140 |
/**
|
141 |
+
* @param string $url
|
142 |
* @return $this
|
143 |
*/
|
144 |
+
public function setUrl( $url ) {
|
145 |
+
$this->url = $url;
|
146 |
return $this;
|
147 |
}
|
148 |
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/Ipify/Api.php
CHANGED
@@ -20,25 +20,18 @@ class Api {
|
|
20 |
] ) );
|
21 |
}
|
22 |
|
23 |
-
|
24 |
-
* @return string
|
25 |
-
*/
|
26 |
-
public function getMyIp4() {
|
27 |
return $this->sendReq( static::IpifyEndpoint4 );
|
28 |
}
|
29 |
|
30 |
-
|
31 |
-
* @return string
|
32 |
-
*/
|
33 |
-
public function getMyIp6() {
|
34 |
return $this->sendReq( static::IpifyEndpoint6 );
|
35 |
}
|
36 |
|
37 |
/**
|
38 |
-
* @param string $
|
39 |
-
* @return string
|
40 |
*/
|
41 |
-
protected function sendReq( $
|
42 |
-
return trim( Services::HttpRequest()->getContent( $
|
43 |
}
|
44 |
}
|
20 |
] ) );
|
21 |
}
|
22 |
|
23 |
+
public function getMyIp4() :string {
|
|
|
|
|
|
|
24 |
return $this->sendReq( static::IpifyEndpoint4 );
|
25 |
}
|
26 |
|
27 |
+
public function getMyIp6() :string {
|
|
|
|
|
|
|
28 |
return $this->sendReq( static::IpifyEndpoint6 );
|
29 |
}
|
30 |
|
31 |
/**
|
32 |
+
* @param string $endpoint
|
|
|
33 |
*/
|
34 |
+
protected function sendReq( $endpoint ) :string {
|
35 |
+
return trim( Services::HttpRequest()->getContent( $endpoint ) );
|
36 |
}
|
37 |
}
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/ApiBase.php
CHANGED
@@ -5,10 +5,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes;
|
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\HttpRequest;
|
6 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations\RequestVO;
|
7 |
|
8 |
-
/**
|
9 |
-
* Class ApiBase
|
10 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes
|
11 |
-
*/
|
12 |
abstract class ApiBase {
|
13 |
|
14 |
const API_URL = 'https://wphashes.com/api/apto-wphashes';
|
@@ -86,14 +82,11 @@ abstract class ApiBase {
|
|
86 |
* @return array|null - null on failure
|
87 |
*/
|
88 |
protected function fireRequestDecodeResponse() {
|
89 |
-
$
|
90 |
-
return empty( $
|
91 |
}
|
92 |
|
93 |
-
|
94 |
-
* @return string
|
95 |
-
*/
|
96 |
-
protected function fireRequest() {
|
97 |
$this->preRequest();
|
98 |
switch ( static::REQUEST_TYPE ) {
|
99 |
case 'POST':
|
@@ -104,16 +97,13 @@ abstract class ApiBase {
|
|
104 |
$response = $this->fireRequest_GET();
|
105 |
break;
|
106 |
}
|
107 |
-
return $response;
|
108 |
}
|
109 |
|
110 |
protected function preRequest() {
|
111 |
}
|
112 |
|
113 |
-
|
114 |
-
* @return string
|
115 |
-
*/
|
116 |
-
protected function fireRequest_GET() {
|
117 |
$response = null;
|
118 |
|
119 |
$url = add_query_arg( $this->getQueryData(), $this->getApiUrl() );
|
@@ -124,31 +114,26 @@ abstract class ApiBase {
|
|
124 |
}
|
125 |
|
126 |
if ( is_null( $response ) ) {
|
127 |
-
$response = ( new HttpRequest() )->getContent( $url );
|
128 |
if ( $this->isUseQueryCache() ) {
|
129 |
self::$QueryCache[ $sig ] = $response;
|
130 |
}
|
131 |
}
|
132 |
|
133 |
-
return $response;
|
134 |
}
|
135 |
|
136 |
-
|
137 |
-
* @return string|null
|
138 |
-
*/
|
139 |
-
protected function fireRequest_POST() {
|
140 |
$http = new HttpRequest();
|
141 |
-
$http
|
142 |
-
->
|
143 |
-
|
144 |
-
|
145 |
-
)
|
146 |
-
|
|
|
147 |
}
|
148 |
|
149 |
-
/**
|
150 |
-
* @return bool
|
151 |
-
*/
|
152 |
public function isUseQueryCache() :bool {
|
153 |
return (bool)$this->useQueryCache;
|
154 |
}
|
@@ -165,11 +150,14 @@ abstract class ApiBase {
|
|
165 |
}
|
166 |
|
167 |
/**
|
168 |
-
* @param bool $useQueryCache
|
169 |
* @return $this
|
170 |
*/
|
171 |
public function setUseQueryCache( bool $useQueryCache ) {
|
172 |
$this->useQueryCache = $useQueryCache;
|
173 |
return $this;
|
174 |
}
|
|
|
|
|
|
|
|
|
175 |
}
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\HttpRequest;
|
6 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations\RequestVO;
|
7 |
|
|
|
|
|
|
|
|
|
8 |
abstract class ApiBase {
|
9 |
|
10 |
const API_URL = 'https://wphashes.com/api/apto-wphashes';
|
82 |
* @return array|null - null on failure
|
83 |
*/
|
84 |
protected function fireRequestDecodeResponse() {
|
85 |
+
$response = $this->fireRequest();
|
86 |
+
return empty( $response ) ? null : json_decode( $response, true );
|
87 |
}
|
88 |
|
89 |
+
protected function fireRequest() :string {
|
|
|
|
|
|
|
90 |
$this->preRequest();
|
91 |
switch ( static::REQUEST_TYPE ) {
|
92 |
case 'POST':
|
97 |
$response = $this->fireRequest_GET();
|
98 |
break;
|
99 |
}
|
100 |
+
return trim( $response );
|
101 |
}
|
102 |
|
103 |
protected function preRequest() {
|
104 |
}
|
105 |
|
106 |
+
protected function fireRequest_GET() :string {
|
|
|
|
|
|
|
107 |
$response = null;
|
108 |
|
109 |
$url = add_query_arg( $this->getQueryData(), $this->getApiUrl() );
|
114 |
}
|
115 |
|
116 |
if ( is_null( $response ) ) {
|
117 |
+
$response = ( new HttpRequest() )->getContent( $url, $this->getRequestDefaults() );
|
118 |
if ( $this->isUseQueryCache() ) {
|
119 |
self::$QueryCache[ $sig ] = $response;
|
120 |
}
|
121 |
}
|
122 |
|
123 |
+
return (string)$response;
|
124 |
}
|
125 |
|
126 |
+
protected function fireRequest_POST() :string {
|
|
|
|
|
|
|
127 |
$http = new HttpRequest();
|
128 |
+
$http->post(
|
129 |
+
add_query_arg( $this->getQueryData(), $this->getApiUrl() ),
|
130 |
+
array_merge( $this->getRequestDefaults(), [
|
131 |
+
'body' => $this->getRequestVO()->getRawData()
|
132 |
+
] )
|
133 |
+
);
|
134 |
+
return $http->isSuccess() ? (string)$http->lastResponse->body : '';
|
135 |
}
|
136 |
|
|
|
|
|
|
|
137 |
public function isUseQueryCache() :bool {
|
138 |
return (bool)$this->useQueryCache;
|
139 |
}
|
150 |
}
|
151 |
|
152 |
/**
|
|
|
153 |
* @return $this
|
154 |
*/
|
155 |
public function setUseQueryCache( bool $useQueryCache ) {
|
156 |
$this->useQueryCache = $useQueryCache;
|
157 |
return $this;
|
158 |
}
|
159 |
+
|
160 |
+
protected function getRequestDefaults() :array {
|
161 |
+
return [];
|
162 |
+
}
|
163 |
}
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/CrowdSourcedHashes/Query/AssetHashesBase.php
CHANGED
@@ -24,4 +24,10 @@ abstract class AssetHashesBase extends Base {
|
|
24 |
$result = $this->query();
|
25 |
return is_array( $result ) ? $result : [];
|
26 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
}
|
24 |
$result = $this->query();
|
25 |
return is_array( $result ) ? $result : [];
|
26 |
}
|
27 |
+
|
28 |
+
protected function getRequestDefaults() :array {
|
29 |
+
$defs = parent::getRequestDefaults();
|
30 |
+
$defs[ 'timeout' ] = 10;
|
31 |
+
return $defs;
|
32 |
+
}
|
33 |
}
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/CrowdSourcedHashes/Query/RequestVO.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Cro
|
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
8 |
-
* Class RequestVO
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\CrowdSourcedHashes\Query
|
10 |
* @property string $type
|
11 |
* @property string $version
|
12 |
* @property string $slug
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property string $type
|
9 |
* @property string $version
|
10 |
* @property string $slug
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/CrowdSourcedHashes/Submit/RequestVO.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Cro
|
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
8 |
-
* Class RequestVO
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Hashes
|
10 |
* @property string $type
|
11 |
* @property string $version
|
12 |
* @property string $slug
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property string $type
|
9 |
* @property string $version
|
10 |
* @property string $slug
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Hashes/ApiInfo.php
CHANGED
@@ -2,10 +2,6 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Hashes;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class ApiInfo
|
7 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Hashes
|
8 |
-
*/
|
9 |
class ApiInfo extends Base {
|
10 |
|
11 |
const RESPONSE_DATA_KEY = 'info';
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Hashes;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class ApiInfo extends Base {
|
6 |
|
7 |
const RESPONSE_DATA_KEY = 'info';
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Hashes/Plugin.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Has
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class Plugin
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Hashes
|
10 |
-
*/
|
11 |
class Plugin extends PluginThemeBase {
|
12 |
|
13 |
const TYPE = 'plugin';
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class Plugin extends PluginThemeBase {
|
8 |
|
9 |
const TYPE = 'plugin';
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Hashes/PluginThemeBase.php
CHANGED
@@ -2,10 +2,6 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Hashes;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class PluginThemeBase
|
7 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Hashes
|
8 |
-
*/
|
9 |
abstract class PluginThemeBase extends AssetHashesBase {
|
10 |
|
11 |
/**
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Hashes;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
abstract class PluginThemeBase extends AssetHashesBase {
|
6 |
|
7 |
/**
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Hashes/RequestVO.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Has
|
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
8 |
-
* Class RequestVO
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Hashes
|
10 |
* @property string $type
|
11 |
* @property string $version
|
12 |
* @property string $hash
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property string $type
|
9 |
* @property string $version
|
10 |
* @property string $hash
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Hashes/Theme.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Has
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class Theme
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Hashes
|
10 |
-
*/
|
11 |
class Theme extends PluginThemeBase {
|
12 |
|
13 |
const TYPE = 'theme';
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class Theme extends PluginThemeBase {
|
8 |
|
9 |
const TYPE = 'theme';
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Hashes/WordPress.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Has
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class WordPress
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Hashes
|
10 |
-
*/
|
11 |
class WordPress extends AssetHashesBase {
|
12 |
|
13 |
const TYPE = 'wordpress';
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class WordPress extends AssetHashesBase {
|
8 |
|
9 |
const TYPE = 'wordpress';
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Malware/Confidence/RequestVO.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Mal
|
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
8 |
-
* Class RequestVO
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Malware\Confidence
|
10 |
* @property string $type
|
11 |
* @property string $file
|
12 |
* @property string $hash
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property string $type
|
9 |
* @property string $file
|
10 |
* @property string $hash
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Malware/Confidence/Retrieve.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Mal
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class Retrieve
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Malware\Confidence
|
10 |
-
*/
|
11 |
class Retrieve extends Base {
|
12 |
|
13 |
const RESPONSE_DATA_KEY = 'confidence';
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class Retrieve extends Base {
|
8 |
|
9 |
const RESPONSE_DATA_KEY = 'confidence';
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Malware/Patterns/Retrieve.php
CHANGED
@@ -2,10 +2,6 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Malware\Patterns;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class Retrieve
|
7 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Malware\Patterns
|
8 |
-
*/
|
9 |
class Retrieve extends Base {
|
10 |
|
11 |
const RESPONSE_DATA_KEY = 'patterns';
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Malware\Patterns;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class Retrieve extends Base {
|
6 |
|
7 |
const RESPONSE_DATA_KEY = 'patterns';
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Malware/Signatures/ReportFalsePositive.php
CHANGED
@@ -2,10 +2,6 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Malware\Signatures;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class SubmitFalsePositive
|
7 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Malware\Signatures
|
8 |
-
*/
|
9 |
class ReportFalsePositive extends Base {
|
10 |
|
11 |
const REQUEST_TYPE = 'POST';
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Malware\Signatures;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class ReportFalsePositive extends Base {
|
6 |
|
7 |
const REQUEST_TYPE = 'POST';
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Malware/Signatures/RequestVO.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Mal
|
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
8 |
-
* Class RequestVO
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Malware\Signatures
|
10 |
* @property string $file
|
11 |
* @property string $signature
|
12 |
* @property string $hash
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property string $file
|
9 |
* @property string $signature
|
10 |
* @property string $hash
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Malware/Whitelist/ReportFalsePositive.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Mal
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class SubmitFalsePositive
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Malware\Whitelist
|
10 |
-
*/
|
11 |
class ReportFalsePositive extends Base {
|
12 |
|
13 |
const REQUEST_TYPE = 'POST';
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class ReportFalsePositive extends Base {
|
8 |
|
9 |
const REQUEST_TYPE = 'POST';
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Malware/Whitelist/RequestVO.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Mal
|
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
8 |
-
* Class RequestVO
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Malware\Whitelist
|
10 |
* @property string $file
|
11 |
* @property string[] $hashes
|
12 |
* @property string $algo
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property string $file
|
9 |
* @property string[] $hashes
|
10 |
* @property string $algo
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Services/IPs.php
CHANGED
@@ -2,10 +2,6 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Services;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class IPs
|
7 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Services
|
8 |
-
*/
|
9 |
class IPs extends Base {
|
10 |
|
11 |
const RESPONSE_DATA_KEY = 'service_ips';
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Services;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class IPs extends Base {
|
6 |
|
7 |
const RESPONSE_DATA_KEY = 'service_ips';
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Services/RequestVO.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Ser
|
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
8 |
-
* Class RequestVO
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Services
|
10 |
* @property string $action
|
11 |
*/
|
12 |
class RequestVO extends Integrations\RequestVO {
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property string $action
|
9 |
*/
|
10 |
class RequestVO extends Integrations\RequestVO {
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Token/RequestVO.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Tok
|
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
8 |
-
* Class RequestVO
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Token
|
10 |
* @property string $action
|
11 |
* @property string $install_id
|
12 |
* @property string $url
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property string $action
|
9 |
* @property string $install_id
|
10 |
* @property string $url
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Token/Solicit.php
CHANGED
@@ -2,23 +2,19 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Token;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class Solicit
|
7 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Token
|
8 |
-
*/
|
9 |
class Solicit extends Base {
|
10 |
|
11 |
/**
|
12 |
-
* @param string $
|
13 |
-
* @param string $
|
14 |
* @return array|null
|
15 |
*/
|
16 |
-
public function retrieve( $
|
17 |
/** @var RequestVO $oReq */
|
18 |
$oReq = $this->getRequestVO();
|
19 |
$oReq->action = 'solicit';
|
20 |
-
$oReq->install_id = $
|
21 |
-
$oReq->url = strpos( $
|
22 |
return $this->query();
|
23 |
}
|
24 |
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Token;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class Solicit extends Base {
|
6 |
|
7 |
/**
|
8 |
+
* @param string $url
|
9 |
+
* @param string $installID
|
10 |
* @return array|null
|
11 |
*/
|
12 |
+
public function retrieve( $url, $installID ) {
|
13 |
/** @var RequestVO $oReq */
|
14 |
$oReq = $this->getRequestVO();
|
15 |
$oReq->action = 'solicit';
|
16 |
+
$oReq->install_id = $installID;
|
17 |
+
$oReq->url = strpos( $url, '?' ) ? explode( '?', $url, 2 )[ 0 ] : $url;
|
18 |
return $this->query();
|
19 |
}
|
20 |
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Util/Diff.php
CHANGED
@@ -2,10 +2,6 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Util;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class Diff
|
7 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Util
|
8 |
-
*/
|
9 |
class Diff extends Base {
|
10 |
|
11 |
const API_ENDPOINT = 'util/diff';
|
@@ -13,14 +9,14 @@ class Diff extends Base {
|
|
13 |
const RESPONSE_DATA_KEY = 'diff';
|
14 |
|
15 |
/**
|
16 |
-
* @param string $
|
17 |
-
* @param string $
|
18 |
* @return array|null
|
19 |
*/
|
20 |
-
public function getDiff( $
|
21 |
-
$
|
22 |
-
$
|
23 |
-
$
|
24 |
return $this->query();
|
25 |
}
|
26 |
}
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Util;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class Diff extends Base {
|
6 |
|
7 |
const API_ENDPOINT = 'util/diff';
|
9 |
const RESPONSE_DATA_KEY = 'diff';
|
10 |
|
11 |
/**
|
12 |
+
* @param string $left
|
13 |
+
* @param string $right
|
14 |
* @return array|null
|
15 |
*/
|
16 |
+
public function getDiff( $left, $right ) {
|
17 |
+
$req = $this->getRequestVO();
|
18 |
+
$req->left = $left;
|
19 |
+
$req->right = $right;
|
20 |
return $this->query();
|
21 |
}
|
22 |
}
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Util/RequestVO.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Uti
|
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
8 |
-
* Class RequestVO
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Util
|
10 |
* @property string $left
|
11 |
* @property string $right
|
12 |
*/
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property string $left
|
9 |
* @property string $right
|
10 |
*/
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Verify/Email.php
CHANGED
@@ -2,10 +2,6 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Verify;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class Email
|
7 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Verify
|
8 |
-
*/
|
9 |
class Email extends Base {
|
10 |
|
11 |
/**
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Verify;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class Email extends Base {
|
6 |
|
7 |
/**
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Verify/RequestVO.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Ver
|
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
8 |
-
* Class RequestVO
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Verify
|
10 |
* @property string $action
|
11 |
* @property string $address
|
12 |
*/
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property string $action
|
9 |
* @property string $address
|
10 |
*/
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Vulnerabilities/BasePluginTheme.php
CHANGED
@@ -2,10 +2,6 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Vulnerabilities;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class BasePluginTheme
|
7 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Vulnerabilities
|
8 |
-
*/
|
9 |
abstract class BasePluginTheme extends Base {
|
10 |
|
11 |
/**
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Vulnerabilities;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
abstract class BasePluginTheme extends Base {
|
6 |
|
7 |
/**
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Vulnerabilities/Plugin.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Vul
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Core\VOs\Assets\WpPluginVo;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class Plugin
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Vulnerabilities
|
10 |
-
*/
|
11 |
class Plugin extends BasePluginTheme {
|
12 |
|
13 |
const ASSET_TYPE = 'plugin';
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Core\VOs\Assets\WpPluginVo;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class Plugin extends BasePluginTheme {
|
8 |
|
9 |
const ASSET_TYPE = 'plugin';
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Vulnerabilities/RequestVO.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Vul
|
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
8 |
-
* Class RequestVO
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Vulnerabilities
|
10 |
* @property string $type
|
11 |
* @property string $version
|
12 |
* @property string $slug
|
5 |
use FernleafSystems\Wordpress\Services\Utilities\Integrations;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @property string $type
|
9 |
* @property string $version
|
10 |
* @property string $slug
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Vulnerabilities/Theme.php
CHANGED
@@ -2,10 +2,6 @@
|
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Vulnerabilities;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class Theme
|
7 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Vulnerabilities
|
8 |
-
*/
|
9 |
class Theme extends BasePluginTheme {
|
10 |
|
11 |
const ASSET_TYPE = 'theme';
|
2 |
|
3 |
namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Vulnerabilities;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class Theme extends BasePluginTheme {
|
6 |
|
7 |
const ASSET_TYPE = 'theme';
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Integrations/WpHashes/Vulnerabilities/WordPress.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Vul
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class WordPress
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Integrations\WpHashes\Hashes
|
10 |
-
*/
|
11 |
class WordPress extends Base {
|
12 |
|
13 |
const ASSET_TYPE = 'wordpress';
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
class WordPress extends Base {
|
8 |
|
9 |
const ASSET_TYPE = 'wordpress';
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/Net/IpIdentify.php
CHANGED
@@ -5,8 +5,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\Net;
|
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
/**
|
8 |
-
* Class IpIdentify
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\Net
|
10 |
* @deprecated 2.11
|
11 |
*/
|
12 |
class IpIdentify {
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
|
7 |
/**
|
|
|
|
|
8 |
* @deprecated 2.11
|
9 |
*/
|
10 |
class IpIdentify {
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/PluginUserMeta.php
CHANGED
@@ -6,7 +6,6 @@ use FernleafSystems\Utilities\Data\Adapter\StdClassAdapter;
|
|
6 |
use FernleafSystems\Wordpress\Services\Services;
|
7 |
|
8 |
/**
|
9 |
-
* Class PluginUserMeta
|
10 |
* @property string $prefix
|
11 |
* @property int $user_id
|
12 |
* @property array $flash_msg
|
6 |
use FernleafSystems\Wordpress\Services\Services;
|
7 |
|
8 |
/**
|
|
|
9 |
* @property string $prefix
|
10 |
* @property int $user_id
|
11 |
* @property array $flash_msg
|
src/lib/vendor/fernleafsystems/wordpress-services/src/Utilities/WpOrg/Base/PluginThemeFilesBase.php
CHANGED
@@ -4,10 +4,6 @@ namespace FernleafSystems\Wordpress\Services\Utilities\WpOrg\Base;
|
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services;
|
6 |
|
7 |
-
/**
|
8 |
-
* Class PluginThemeFilesBase
|
9 |
-
* @package FernleafSystems\Wordpress\Services\Utilities\WpOrg\Base
|
10 |
-
*/
|
11 |
abstract class PluginThemeFilesBase {
|
12 |
|
13 |
/**
|
4 |
|
5 |
use FernleafSystems\Wordpress\Services;
|
6 |
|
|
|
|
|
|
|
|
|
7 |
abstract class PluginThemeFilesBase {
|
8 |
|
9 |
/**
|
src/wizards/base.php
CHANGED
@@ -5,10 +5,6 @@ use FernleafSystems\Wordpress\Plugin\Shield;
|
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\Plugin\ModCon;
|
6 |
use FernleafSystems\Wordpress\Services\Services;
|
7 |
|
8 |
-
/**
|
9 |
-
* @uses php 5.4+
|
10 |
-
* Class ICWP_WPSF_Wizard_Base
|
11 |
-
*/
|
12 |
abstract class ICWP_WPSF_Wizard_Base {
|
13 |
|
14 |
use Shield\Modules\ModConsumer;
|
5 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\Plugin\ModCon;
|
6 |
use FernleafSystems\Wordpress\Services\Services;
|
7 |
|
|
|
|
|
|
|
|
|
8 |
abstract class ICWP_WPSF_Wizard_Base {
|
9 |
|
10 |
use Shield\Modules\ModConsumer;
|
src/wizards/base_wpsf.php
CHANGED
@@ -2,9 +2,6 @@
|
|
2 |
|
3 |
use FernleafSystems\Wordpress\Services\Services;
|
4 |
|
5 |
-
/**
|
6 |
-
* Class ICWP_WPSF_Wizard_BaseWpsf
|
7 |
-
*/
|
8 |
abstract class ICWP_WPSF_Wizard_BaseWpsf extends ICWP_WPSF_Wizard_Base {
|
9 |
|
10 |
/**
|
2 |
|
3 |
use FernleafSystems\Wordpress\Services\Services;
|
4 |
|
|
|
|
|
|
|
5 |
abstract class ICWP_WPSF_Wizard_BaseWpsf extends ICWP_WPSF_Wizard_Base {
|
6 |
|
7 |
/**
|
src/wizards/login_protect.php
CHANGED
@@ -3,9 +3,6 @@
|
|
3 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard;
|
4 |
use FernleafSystems\Wordpress\Services\Services;
|
5 |
|
6 |
-
/**
|
7 |
-
* Class ICWP_WPSF_Processor_LoginProtect_Wizard
|
8 |
-
*/
|
9 |
class ICWP_WPSF_Wizard_LoginProtect extends ICWP_WPSF_Wizard_BaseWpsf {
|
10 |
|
11 |
/**
|
3 |
use FernleafSystems\Wordpress\Plugin\Shield\Modules\LoginGuard;
|
4 |
use FernleafSystems\Wordpress\Services\Services;
|
5 |
|
|
|
|
|
|
|
6 |
class ICWP_WPSF_Wizard_LoginProtect extends ICWP_WPSF_Wizard_BaseWpsf {
|
7 |
|
8 |
/**
|
src/wizards/plugin.php
CHANGED
@@ -5,9 +5,6 @@ use FernleafSystems\Wordpress\Plugin\Shield\Modules\Plugin;
|
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
use FernleafSystems\Wordpress\Services\Utilities\Net\FindSourceFromIp;
|
7 |
|
8 |
-
/**
|
9 |
-
* Class ICWP_WPSF_Processor_LoginProtect_Wizard
|
10 |
-
*/
|
11 |
class ICWP_WPSF_Wizard_Plugin extends ICWP_WPSF_Wizard_BaseWpsf {
|
12 |
|
13 |
/**
|
@@ -679,29 +676,29 @@ class ICWP_WPSF_Wizard_Plugin extends ICWP_WPSF_Wizard_BaseWpsf {
|
|
679 |
*/
|
680 |
private function wizardOptin() {
|
681 |
$oReq = Services::Request();
|
682 |
-
$
|
683 |
-
/** @var Plugin\Options $
|
684 |
-
$
|
685 |
|
686 |
-
$
|
687 |
$sMessage = __( 'No changes were made as no option was selected', 'wp-simple-firewall' );
|
688 |
|
689 |
$sInput = $oReq->post( 'BadgeOption' );
|
690 |
if ( !empty( $sInput ) ) {
|
691 |
-
$
|
692 |
-
$
|
693 |
-
$
|
694 |
}
|
695 |
|
696 |
$sInput = $oReq->post( 'AnonymousOption' );
|
697 |
if ( !empty( $sInput ) ) {
|
698 |
-
$
|
699 |
-
$
|
700 |
-
$
|
701 |
}
|
702 |
|
703 |
return ( new \FernleafSystems\Utilities\Response() )
|
704 |
-
->setSuccessful( $
|
705 |
->setMessageText( $sMessage );
|
706 |
}
|
707 |
|
@@ -752,14 +749,14 @@ class ICWP_WPSF_Wizard_Plugin extends ICWP_WPSF_Wizard_BaseWpsf {
|
|
752 |
$toEnable = $input === 'Y';
|
753 |
|
754 |
$modComm = $this->getCon()->getModule_Comments();
|
|
|
|
|
755 |
if ( $toEnable ) { // we don't disable the whole module
|
756 |
$modComm->setIsMainFeatureEnabled( true );
|
757 |
}
|
758 |
-
$
|
759 |
$modComm->saveModOptions();
|
760 |
|
761 |
-
/** @var \FernleafSystems\Wordpress\Plugin\Shield\Modules\CommentsFilter\Options $optsComm */
|
762 |
-
$optsComm = $modComm->getOptions();
|
763 |
$success = $optsComm->isEnabledAntiBot() === $toEnable;
|
764 |
if ( $success ) {
|
765 |
$msg = sprintf( '%s has been %s.', __( 'Comment SPAM Protection', 'wp-simple-firewall' ),
|
5 |
use FernleafSystems\Wordpress\Services\Services;
|
6 |
use FernleafSystems\Wordpress\Services\Utilities\Net\FindSourceFromIp;
|
7 |
|
|
|
|
|
|
|
8 |
class ICWP_WPSF_Wizard_Plugin extends ICWP_WPSF_Wizard_BaseWpsf {
|
9 |
|
10 |
/**
|
676 |
*/
|
677 |
private function wizardOptin() {
|
678 |
$oReq = Services::Request();
|
679 |
+
$mod = $this->getCon()->getModule_Plugin();
|
680 |
+
/** @var Plugin\Options $opts */
|
681 |
+
$opts = $this->getOptions();
|
682 |
|
683 |
+
$success = false;
|
684 |
$sMessage = __( 'No changes were made as no option was selected', 'wp-simple-firewall' );
|
685 |
|
686 |
$sInput = $oReq->post( 'BadgeOption' );
|
687 |
if ( !empty( $sInput ) ) {
|
688 |
+
$enabled = $sInput === 'Y';
|
689 |
+
$mod->getPluginBadgeCon()->setIsDisplayPluginBadge( $enabled );
|
690 |
+
$success = true;
|
691 |
}
|
692 |
|
693 |
$sInput = $oReq->post( 'AnonymousOption' );
|
694 |
if ( !empty( $sInput ) ) {
|
695 |
+
$enabled = $sInput === 'Y';
|
696 |
+
$opts->setPluginTrackingPermission( $enabled );
|
697 |
+
$success = true;
|
698 |
}
|
699 |
|
700 |
return ( new \FernleafSystems\Utilities\Response() )
|
701 |
+
->setSuccessful( $success )
|
702 |
->setMessageText( $sMessage );
|
703 |
}
|
704 |
|
749 |
$toEnable = $input === 'Y';
|
750 |
|
751 |
$modComm = $this->getCon()->getModule_Comments();
|
752 |
+
/** @var \FernleafSystems\Wordpress\Plugin\Shield\Modules\CommentsFilter\Options $optsComm */
|
753 |
+
$optsComm = $modComm->getOptions();
|
754 |
if ( $toEnable ) { // we don't disable the whole module
|
755 |
$modComm->setIsMainFeatureEnabled( true );
|
756 |
}
|
757 |
+
$optsComm->setEnabledAntiBot( $toEnable );
|
758 |
$modComm->saveModOptions();
|
759 |
|
|
|
|
|
760 |
$success = $optsComm->isEnabledAntiBot() === $toEnable;
|
761 |
if ( $success ) {
|
762 |
$msg = sprintf( '%s has been %s.', __( 'Comment SPAM Protection', 'wp-simple-firewall' ),
|
templates/twig/components/search/dialog.twig
CHANGED
@@ -1,8 +1,4 @@
|
|
1 |
-
<div class="modal fade"
|
2 |
-
role="dialog"
|
3 |
-
id="SearchDialog"
|
4 |
-
tabindex="-1" aria-labelledby="ShieldOptionsSearch" aria-hidden="true"
|
5 |
-
>
|
6 |
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
|
7 |
<div class="modal-content">
|
8 |
<div class="modal-header">
|
1 |
+
<div class="modal fade" role="dialog" id="SearchDialog" aria-labelledby="ShieldOptionsSearch" tabindex="-1" aria-hidden="true">
|
|
|
|
|
|
|
|
|
2 |
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
|
3 |
<div class="modal-content">
|
4 |
<div class="modal-header">
|
templates/twig/components/search/options.twig
CHANGED
@@ -1,8 +1,6 @@
|
|
|
|
1 |
{% if vars.search_select is defined %}
|
2 |
-
<select class="
|
3 |
-
title="Search for options"
|
4 |
-
data-size="10"
|
5 |
-
data-header="Search for options"
|
6 |
onchange="location = this.value;"
|
7 |
style="max-width: 100%; width: 100%"
|
8 |
>
|
1 |
+
{# https://stackoverflow.com/questions/31620292/bootstrap-modal-with-select2-z-index #}
|
2 |
{% if vars.search_select is defined %}
|
3 |
+
<select class="select2picker static"
|
|
|
|
|
|
|
4 |
onchange="location = this.value;"
|
5 |
style="max-width: 100%; width: 100%"
|
6 |
>
|
templates/twig/notices/email-verification-sent.twig
CHANGED
@@ -14,47 +14,47 @@
|
|
14 |
/
|
15 |
<span>
|
16 |
<a class="odp-notice-link-action text-warning" href="#"
|
17 |
-
data-action="
|
18 |
</span>
|
19 |
</p>
|
20 |
|
21 |
<script type="text/javascript">
|
22 |
jQuery( document ).on(
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
}
|
43 |
-
else {
|
44 |
-
sMessage = oResponse.data.message;
|
45 |
-
}
|
46 |
-
iCWP_WPSF_Toaster.showMessage( sMessage, oResponse.success );
|
47 |
-
if ( oResponse.data.page_reload ) {
|
48 |
-
location.reload();
|
49 |
-
}
|
50 |
}
|
51 |
-
|
52 |
-
|
53 |
}
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
</script>
|
60 |
{% endblock %}
|
14 |
/
|
15 |
<span>
|
16 |
<a class="odp-notice-link-action text-warning" href="#"
|
17 |
+
data-action="profile_email2fa_disable">{{ strings.how_turn_off }}</a>
|
18 |
</span>
|
19 |
</p>
|
20 |
|
21 |
<script type="text/javascript">
|
22 |
jQuery( document ).on(
|
23 |
+
'click',
|
24 |
+
'a.odp-notice-link-action',
|
25 |
+
function ( evt ) {
|
26 |
+
iCWP_WPSF_BodyOverlay.show();
|
27 |
+
var aReqData;
|
28 |
+
var $oThis = jQuery( evt.target );
|
29 |
+
if ( $oThis.data( 'action' ) === 'resend_verification_email' ) {
|
30 |
+
aReqData = {{ ajax.resend_verification_email|raw }};
|
31 |
+
}
|
32 |
+
else if ( $oThis.data( 'action' ) === 'profile_email2fa_disable' ) {
|
33 |
+
aReqData = {{ ajax.profile_email2fa_disable|raw }};
|
34 |
+
}
|
35 |
|
36 |
+
jQuery.post( ajaxurl, aReqData,
|
37 |
+
function ( oResponse ) {
|
38 |
+
var sMessage;
|
39 |
+
if ( oResponse === null || typeof oResponse.data === 'undefined'
|
40 |
+
|| typeof oResponse.data.message === 'undefined' ) {
|
41 |
+
sMessage = oResponse.success ? 'Success' : 'Failure';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
+
else {
|
44 |
+
sMessage = oResponse.data.message;
|
45 |
}
|
46 |
+
iCWP_WPSF_Toaster.showMessage( sMessage, oResponse.success );
|
47 |
+
if ( oResponse.data.page_reload ) {
|
48 |
+
location.reload();
|
49 |
+
}
|
50 |
+
}
|
51 |
+
).always( function () {
|
52 |
+
iCWP_WPSF_BodyOverlay.hide();
|
53 |
+
}
|
54 |
+
);
|
55 |
|
56 |
+
return false;
|
57 |
+
}
|
58 |
+
);
|
59 |
</script>
|
60 |
{% endblock %}
|
templates/twig/wpadmin_pages/insights/ips/ip_analyse/index.twig
CHANGED
@@ -33,7 +33,7 @@
|
|
33 |
jQuery( document ).ready( function () {
|
34 |
jQuery( 'document' ).icwpWpsfIpAnalyse(
|
35 |
{
|
36 |
-
'
|
37 |
'ajax_ip_analyse_action':{{ ajax.ip_analyse_action|raw }}
|
38 |
}
|
39 |
);
|
33 |
jQuery( document ).ready( function () {
|
34 |
jQuery( 'document' ).icwpWpsfIpAnalyse(
|
35 |
{
|
36 |
+
'ajax_ip_analyse_build':{{ ajax.ip_analyse_build|raw }},
|
37 |
'ajax_ip_analyse_action':{{ ajax.ip_analyse_action|raw }}
|
38 |
}
|
39 |
);
|
templates/twig/wpadmin_pages/insights/ips/ip_analyse/ip_traffic.twig
CHANGED
@@ -9,14 +9,24 @@
|
|
9 |
<table class="table">
|
10 |
<thead class="thead-light">
|
11 |
<tr>
|
|
|
12 |
<th scope="col">{{ strings.requested_at }}</th>
|
13 |
<th scope="col">{{ strings.response }}</th>
|
14 |
-
<th scope="col">{{ strings.verb }}</th>
|
15 |
</tr>
|
16 |
</thead>
|
17 |
<tbody>
|
18 |
{% for request in vars.requests %}
|
19 |
<tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
<td>
|
21 |
{{ request.created_at_ago }}
|
22 |
<div class="timestamp-small">{{ request.created_at }}</div>
|
@@ -36,17 +46,6 @@
|
|
36 |
</div>
|
37 |
</td>
|
38 |
|
39 |
-
<td class="text-wrap" style="word-break: break-all">
|
40 |
-
<div>
|
41 |
-
{{ strings.verb }}:<code class="text-uppercase d-inline-block">{{ request.verb }}</code>
|
42 |
-
</div>
|
43 |
-
<div>
|
44 |
-
{{ strings.path }}:<code>{{ request.path }}</code>
|
45 |
-
</div>
|
46 |
-
{% if request.query is not empty %}
|
47 |
-
<div>{{ strings.query }}:<code>?{{ request.query }}</code></div>
|
48 |
-
{% endif %}
|
49 |
-
</td>
|
50 |
</tr>
|
51 |
{% endfor %}
|
52 |
</tbody>
|
9 |
<table class="table">
|
10 |
<thead class="thead-light">
|
11 |
<tr>
|
12 |
+
<th scope="col">{{ strings.verb }}</th>
|
13 |
<th scope="col">{{ strings.requested_at }}</th>
|
14 |
<th scope="col">{{ strings.response }}</th>
|
|
|
15 |
</tr>
|
16 |
</thead>
|
17 |
<tbody>
|
18 |
{% for request in vars.requests %}
|
19 |
<tr>
|
20 |
+
<td class="text-wrap" style="word-break: break-all">
|
21 |
+
<code class="text-uppercase d-inline-block">{{ request.verb }}</code> :
|
22 |
+
<div>
|
23 |
+
<code>{{ request.path }}</code>
|
24 |
+
</div>
|
25 |
+
{% if request.query is not empty %}
|
26 |
+
<div>{{ strings.query }}:<code>?{{ request.query }}</code></div>
|
27 |
+
{% endif %}
|
28 |
+
</td>
|
29 |
+
|
30 |
<td>
|
31 |
{{ request.created_at_ago }}
|
32 |
<div class="timestamp-small">{{ request.created_at }}</div>
|
46 |
</div>
|
47 |
</td>
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
</tr>
|
50 |
{% endfor %}
|
51 |
</tbody>
|
templates/twig/wpadmin_pages/insights/license/license.twig
CHANGED
@@ -56,7 +56,7 @@
|
|
56 |
</ol>
|
57 |
|
58 |
<form method="post" class="licenseForm">
|
59 |
-
{% for ajax_key, ajax_val in ajax.
|
60 |
<input type="hidden" name="{{ ajax_key }}" value="{{ ajax_val }}" />
|
61 |
{% endfor %}
|
62 |
<input type="hidden" name="license-action" value="check" />
|
@@ -72,7 +72,7 @@
|
|
72 |
<div class="col-6 text-start">
|
73 |
{% if flags.is_pro %}
|
74 |
<form method="post" class="licenseForm">
|
75 |
-
{% for ajax_key, ajax_val in ajax.
|
76 |
<input type="hidden" name="{{ ajax_key }}" value="{{ ajax_val }}" />
|
77 |
{% endfor %}
|
78 |
<input type="hidden" name="license-action" value="clear" />
|
56 |
</ol>
|
57 |
|
58 |
<form method="post" class="licenseForm">
|
59 |
+
{% for ajax_key, ajax_val in ajax.license_action %}
|
60 |
<input type="hidden" name="{{ ajax_key }}" value="{{ ajax_val }}" />
|
61 |
{% endfor %}
|
62 |
<input type="hidden" name="license-action" value="check" />
|
72 |
<div class="col-6 text-start">
|
73 |
{% if flags.is_pro %}
|
74 |
<form method="post" class="licenseForm">
|
75 |
+
{% for ajax_key, ajax_val in ajax.license_action %}
|
76 |
<input type="hidden" name="{{ ajax_key }}" value="{{ ajax_val }}" />
|
77 |
{% endfor %}
|
78 |
<input type="hidden" name="license-action" value="clear" />
|