Changeset 3441603
- Timestamp:
- 01/17/2026 02:00:09 PM (5 weeks ago)
- Location:
- winterlock
- Files:
-
- 414 added
- 2 deleted
- 19 edited
-
tags/1.2.7 (added)
-
tags/1.2.7/LICENSE.txt (added)
-
tags/1.2.7/README.txt (added)
-
tags/1.2.7/admin (added)
-
tags/1.2.7/admin/class-winter-activity-log-admin.php (added)
-
tags/1.2.7/admin/css (added)
-
tags/1.2.7/admin/css/basic.css (added)
-
tags/1.2.7/admin/css/font-awesome.css (added)
-
tags/1.2.7/admin/css/font-awesome.min.css (added)
-
tags/1.2.7/admin/css/frontend-dashboard.css (added)
-
tags/1.2.7/admin/css/select.dataTables.min.css (added)
-
tags/1.2.7/admin/css/style.css (added)
-
tags/1.2.7/admin/css/style_rtl.css (added)
-
tags/1.2.7/admin/css/unwrapped.css (added)
-
tags/1.2.7/admin/css/winter-activity-log-admin.css (added)
-
tags/1.2.7/admin/fonts (added)
-
tags/1.2.7/admin/fonts/FontAwesome.otf (added)
-
tags/1.2.7/admin/fonts/fontawesome-webfont.eot (added)
-
tags/1.2.7/admin/fonts/fontawesome-webfont.svg (added)
-
tags/1.2.7/admin/fonts/fontawesome-webfont.ttf (added)
-
tags/1.2.7/admin/fonts/fontawesome-webfont.woff (added)
-
tags/1.2.7/admin/fonts/fontawesome-webfont.woff2 (added)
-
tags/1.2.7/admin/fonts/glyphicons-halflings-regular.eot (added)
-
tags/1.2.7/admin/fonts/glyphicons-halflings-regular.svg (added)
-
tags/1.2.7/admin/fonts/glyphicons-halflings-regular.ttf (added)
-
tags/1.2.7/admin/fonts/glyphicons-halflings-regular.woff (added)
-
tags/1.2.7/admin/fonts/glyphicons-halflings-regular.woff2 (added)
-
tags/1.2.7/admin/fonts/verdana.ttf (added)
-
tags/1.2.7/admin/img (added)
-
tags/1.2.7/admin/img/details_close.png (added)
-
tags/1.2.7/admin/img/details_open.png (added)
-
tags/1.2.7/admin/img/icon-256x256.png (added)
-
tags/1.2.7/admin/img/log_bullet.jpg (added)
-
tags/1.2.7/admin/img/plugins (added)
-
tags/1.2.7/admin/img/plugins/banner-activitytime.png (added)
-
tags/1.2.7/admin/index.php (added)
-
tags/1.2.7/admin/js (added)
-
tags/1.2.7/admin/js/dataTables.responsive.js (added)
-
tags/1.2.7/admin/js/dataTables.select.min.js (added)
-
tags/1.2.7/admin/js/datatables.min.js (added)
-
tags/1.2.7/admin/js/datetime-picker (added)
-
tags/1.2.7/admin/js/datetime-picker/css (added)
-
tags/1.2.7/admin/js/datetime-picker/css/bootstrap-datetimepicker-standalone.css (added)
-
tags/1.2.7/admin/js/datetime-picker/css/bootstrap-datetimepicker.css (added)
-
tags/1.2.7/admin/js/datetime-picker/css/bootstrap-datetimepicker.min.css (added)
-
tags/1.2.7/admin/js/datetime-picker/js (added)
-
tags/1.2.7/admin/js/datetime-picker/js/bootstrap-datetimepicker.min.js (added)
-
tags/1.2.7/admin/js/datetime-picker/js/moment-with-locales.js (added)
-
tags/1.2.7/admin/js/jquery-confirm (added)
-
tags/1.2.7/admin/js/jquery-confirm/jquery-confirm.min.css (added)
-
tags/1.2.7/admin/js/jquery-confirm/jquery-confirm.min.js (added)
-
tags/1.2.7/admin/js/winter-activity-log-admin.js (added)
-
tags/1.2.7/admin/partials (added)
-
tags/1.2.7/admin/partials/winter-activity-log-admin-display.php (added)
-
tags/1.2.7/admin/resources (added)
-
tags/1.2.7/admin/resources/details_close.png (added)
-
tags/1.2.7/admin/resources/details_open.png (added)
-
tags/1.2.7/admin/resources/logo.png (added)
-
tags/1.2.7/application (added)
-
tags/1.2.7/application/controllers (added)
-
tags/1.2.7/application/controllers/Wal_cloudintegration.php (added)
-
tags/1.2.7/application/controllers/Wal_controlsecurity.php (added)
-
tags/1.2.7/application/controllers/Wal_dashwidgets.php (added)
-
tags/1.2.7/application/controllers/Wal_disabledlogs.php (added)
-
tags/1.2.7/application/controllers/Wal_favouritelogs.php (added)
-
tags/1.2.7/application/controllers/Wal_history.php (added)
-
tags/1.2.7/application/controllers/Wal_logalerts.php (added)
-
tags/1.2.7/application/controllers/Wal_related.php (added)
-
tags/1.2.7/application/controllers/Wal_reports.php (added)
-
tags/1.2.7/application/controllers/Wal_usersessions.php (added)
-
tags/1.2.7/application/controllers/Winteractivitylog.php (added)
-
tags/1.2.7/application/core (added)
-
tags/1.2.7/application/core/MY_Model.php (added)
-
tags/1.2.7/application/core/index.html (added)
-
tags/1.2.7/application/models (added)
-
tags/1.2.7/application/models/Cloud_m.php (added)
-
tags/1.2.7/application/models/Control_m.php (added)
-
tags/1.2.7/application/models/History_m.php (added)
-
tags/1.2.7/application/models/Log_m.php (added)
-
tags/1.2.7/application/models/Report_m.php (added)
-
tags/1.2.7/application/models/Sessions_m.php (added)
-
tags/1.2.7/application/views (added)
-
tags/1.2.7/application/views/general (added)
-
tags/1.2.7/application/views/general/footer.php (added)
-
tags/1.2.7/application/views/wal_cloudintegration (added)
-
tags/1.2.7/application/views/wal_cloudintegration/cloud_edit.php (added)
-
tags/1.2.7/application/views/wal_cloudintegration/cloud_test.php (added)
-
tags/1.2.7/application/views/wal_cloudintegration/index.php (added)
-
tags/1.2.7/application/views/wal_cloudintegration/mysql_edit.php (added)
-
tags/1.2.7/application/views/wal_cloudintegration/mysql_test.php (added)
-
tags/1.2.7/application/views/wal_controlsecurity (added)
-
tags/1.2.7/application/views/wal_controlsecurity/control_log.php (added)
-
tags/1.2.7/application/views/wal_controlsecurity/index.php (added)
-
tags/1.2.7/application/views/wal_dashwidgets (added)
-
tags/1.2.7/application/views/wal_dashwidgets/logs_list.php (added)
-
tags/1.2.7/application/views/wal_disabledlogs (added)
-
tags/1.2.7/application/views/wal_disabledlogs/index.php (added)
-
tags/1.2.7/application/views/wal_favouritelogs (added)
-
tags/1.2.7/application/views/wal_favouritelogs/index.php (added)
-
tags/1.2.7/application/views/wal_history (added)
-
tags/1.2.7/application/views/wal_history/edit_history.php (added)
-
tags/1.2.7/application/views/wal_history/index.php (added)
-
tags/1.2.7/application/views/wal_logalerts (added)
-
tags/1.2.7/application/views/wal_logalerts/index.php (added)
-
tags/1.2.7/application/views/wal_related (added)
-
tags/1.2.7/application/views/wal_related/index.php (added)
-
tags/1.2.7/application/views/wal_reports (added)
-
tags/1.2.7/application/views/wal_reports/index.php (added)
-
tags/1.2.7/application/views/wal_reports/report_edit.php (added)
-
tags/1.2.7/application/views/wal_usersessions (added)
-
tags/1.2.7/application/views/wal_usersessions/index.php (added)
-
tags/1.2.7/application/views/winteractivitylog (added)
-
tags/1.2.7/application/views/winteractivitylog/edit_log.php (added)
-
tags/1.2.7/application/views/winteractivitylog/index.php (added)
-
tags/1.2.7/freemius (added)
-
tags/1.2.7/freemius/LICENSE.txt (added)
-
tags/1.2.7/freemius/README.md (added)
-
tags/1.2.7/freemius/assets (added)
-
tags/1.2.7/freemius/assets/css (added)
-
tags/1.2.7/freemius/assets/css/admin (added)
-
tags/1.2.7/freemius/assets/css/admin/account.css (added)
-
tags/1.2.7/freemius/assets/css/admin/add-ons.css (added)
-
tags/1.2.7/freemius/assets/css/admin/affiliation.css (added)
-
tags/1.2.7/freemius/assets/css/admin/checkout.css (added)
-
tags/1.2.7/freemius/assets/css/admin/clone-resolution.css (added)
-
tags/1.2.7/freemius/assets/css/admin/common.css (added)
-
tags/1.2.7/freemius/assets/css/admin/connect.css (added)
-
tags/1.2.7/freemius/assets/css/admin/debug.css (added)
-
tags/1.2.7/freemius/assets/css/admin/dialog-boxes.css (added)
-
tags/1.2.7/freemius/assets/css/admin/gdpr-optin-notice.css (added)
-
tags/1.2.7/freemius/assets/css/admin/index.php (added)
-
tags/1.2.7/freemius/assets/css/admin/optout.css (added)
-
tags/1.2.7/freemius/assets/css/admin/plugins.css (added)
-
tags/1.2.7/freemius/assets/css/customizer.css (added)
-
tags/1.2.7/freemius/assets/css/index.php (added)
-
tags/1.2.7/freemius/assets/img (added)
-
tags/1.2.7/freemius/assets/img/index.php (added)
-
tags/1.2.7/freemius/assets/img/plugin-icon.png (added)
-
tags/1.2.7/freemius/assets/img/theme-icon.png (added)
-
tags/1.2.7/freemius/assets/index.php (added)
-
tags/1.2.7/freemius/assets/js (added)
-
tags/1.2.7/freemius/assets/js/index.php (added)
-
tags/1.2.7/freemius/assets/js/jquery.form.js (added)
-
tags/1.2.7/freemius/assets/js/nojquery.ba-postmessage.js (added)
-
tags/1.2.7/freemius/assets/js/postmessage.js (added)
-
tags/1.2.7/freemius/assets/js/pricing (added)
-
tags/1.2.7/freemius/assets/js/pricing/14fb1bd5b7c41648488b06147f50a0dc.svg (added)
-
tags/1.2.7/freemius/assets/js/pricing/178afa6030e76635dbe835e111d2c507.png (added)
-
tags/1.2.7/freemius/assets/js/pricing/27b5a722a5553d9de0170325267fccec.png (added)
-
tags/1.2.7/freemius/assets/js/pricing/4375c4a3ddc6f637c2ab9a2d7220f91e.png (added)
-
tags/1.2.7/freemius/assets/js/pricing/4529cac82a2d1f300d3c4702b7b5e8f3.svg (added)
-
tags/1.2.7/freemius/assets/js/pricing/5480ed23b199531a8cbc05924f26952b.png (added)
-
tags/1.2.7/freemius/assets/js/pricing/b4f3b958f4a019862d81b15f3f8eee3a.svg (added)
-
tags/1.2.7/freemius/assets/js/pricing/c03f665db27af43971565560adfba594.png (added)
-
tags/1.2.7/freemius/assets/js/pricing/cb5fc4f6ec7ada72e986f6e7dde365bf.png (added)
-
tags/1.2.7/freemius/assets/js/pricing/dd89563360f0272635c8f0ab7d7f1402.png (added)
-
tags/1.2.7/freemius/assets/js/pricing/e366d70661d8ad2493bd6afbd779f125.png (added)
-
tags/1.2.7/freemius/assets/js/pricing/f18006f6535a1a6e9c6bfbffafe6f18a.svg (added)
-
tags/1.2.7/freemius/assets/js/pricing/f3aac72a8e63997d6bb888f816457e9b.png (added)
-
tags/1.2.7/freemius/assets/js/pricing/f928f1be99776af83e8e6be4baf8ffe7.svg (added)
-
tags/1.2.7/freemius/assets/js/pricing/fde48e4609a6ddc11d639fc2421f2afd.png (added)
-
tags/1.2.7/freemius/assets/js/pricing/freemius-pricing.js (added)
-
tags/1.2.7/freemius/assets/js/pricing/freemius-pricing.js.LICENSE.txt (added)
-
tags/1.2.7/freemius/config.php (added)
-
tags/1.2.7/freemius/includes (added)
-
tags/1.2.7/freemius/includes/class-freemius-abstract.php (added)
-
tags/1.2.7/freemius/includes/class-freemius.php (added)
-
tags/1.2.7/freemius/includes/class-fs-admin-notices.php (added)
-
tags/1.2.7/freemius/includes/class-fs-api.php (added)
-
tags/1.2.7/freemius/includes/class-fs-garbage-collector.php (added)
-
tags/1.2.7/freemius/includes/class-fs-lock.php (added)
-
tags/1.2.7/freemius/includes/class-fs-logger.php (added)
-
tags/1.2.7/freemius/includes/class-fs-options.php (added)
-
tags/1.2.7/freemius/includes/class-fs-plugin-updater.php (added)
-
tags/1.2.7/freemius/includes/class-fs-security.php (added)
-
tags/1.2.7/freemius/includes/class-fs-storage.php (added)
-
tags/1.2.7/freemius/includes/class-fs-user-lock.php (added)
-
tags/1.2.7/freemius/includes/customizer (added)
-
tags/1.2.7/freemius/includes/customizer/class-fs-customizer-support-section.php (added)
-
tags/1.2.7/freemius/includes/customizer/class-fs-customizer-upsell-control.php (added)
-
tags/1.2.7/freemius/includes/customizer/index.php (added)
-
tags/1.2.7/freemius/includes/debug (added)
-
tags/1.2.7/freemius/includes/debug/class-fs-debug-bar-panel.php (added)
-
tags/1.2.7/freemius/includes/debug/debug-bar-start.php (added)
-
tags/1.2.7/freemius/includes/debug/index.php (added)
-
tags/1.2.7/freemius/includes/entities (added)
-
tags/1.2.7/freemius/includes/entities/class-fs-affiliate-terms.php (added)
-
tags/1.2.7/freemius/includes/entities/class-fs-affiliate.php (added)
-
tags/1.2.7/freemius/includes/entities/class-fs-billing.php (added)
-
tags/1.2.7/freemius/includes/entities/class-fs-entity.php (added)
-
tags/1.2.7/freemius/includes/entities/class-fs-payment.php (added)
-
tags/1.2.7/freemius/includes/entities/class-fs-plugin-info.php (added)
-
tags/1.2.7/freemius/includes/entities/class-fs-plugin-license.php (added)
-
tags/1.2.7/freemius/includes/entities/class-fs-plugin-plan.php (added)
-
tags/1.2.7/freemius/includes/entities/class-fs-plugin-tag.php (added)
-
tags/1.2.7/freemius/includes/entities/class-fs-plugin.php (added)
-
tags/1.2.7/freemius/includes/entities/class-fs-pricing.php (added)
-
tags/1.2.7/freemius/includes/entities/class-fs-scope-entity.php (added)
-
tags/1.2.7/freemius/includes/entities/class-fs-site.php (added)
-
tags/1.2.7/freemius/includes/entities/class-fs-subscription.php (added)
-
tags/1.2.7/freemius/includes/entities/class-fs-user.php (added)
-
tags/1.2.7/freemius/includes/entities/index.php (added)
-
tags/1.2.7/freemius/includes/fs-core-functions.php (added)
-
tags/1.2.7/freemius/includes/fs-essential-functions.php (added)
-
tags/1.2.7/freemius/includes/fs-html-escaping-functions.php (added)
-
tags/1.2.7/freemius/includes/fs-plugin-info-dialog.php (added)
-
tags/1.2.7/freemius/includes/index.php (added)
-
tags/1.2.7/freemius/includes/l10n.php (added)
-
tags/1.2.7/freemius/includes/managers (added)
-
tags/1.2.7/freemius/includes/managers/class-fs-admin-menu-manager.php (added)
-
tags/1.2.7/freemius/includes/managers/class-fs-admin-notice-manager.php (added)
-
tags/1.2.7/freemius/includes/managers/class-fs-cache-manager.php (added)
-
tags/1.2.7/freemius/includes/managers/class-fs-checkout-manager.php (added)
-
tags/1.2.7/freemius/includes/managers/class-fs-clone-manager.php (added)
-
tags/1.2.7/freemius/includes/managers/class-fs-contact-form-manager.php (added)
-
tags/1.2.7/freemius/includes/managers/class-fs-debug-manager.php (added)
-
tags/1.2.7/freemius/includes/managers/class-fs-gdpr-manager.php (added)
-
tags/1.2.7/freemius/includes/managers/class-fs-key-value-storage.php (added)
-
tags/1.2.7/freemius/includes/managers/class-fs-license-manager.php (added)
-
tags/1.2.7/freemius/includes/managers/class-fs-option-manager.php (added)
-
tags/1.2.7/freemius/includes/managers/class-fs-permission-manager.php (added)
-
tags/1.2.7/freemius/includes/managers/class-fs-plan-manager.php (added)
-
tags/1.2.7/freemius/includes/managers/class-fs-plugin-manager.php (added)
-
tags/1.2.7/freemius/includes/managers/index.php (added)
-
tags/1.2.7/freemius/includes/sdk (added)
-
tags/1.2.7/freemius/includes/sdk/Exceptions (added)
-
tags/1.2.7/freemius/includes/sdk/Exceptions/ArgumentNotExistException.php (added)
-
tags/1.2.7/freemius/includes/sdk/Exceptions/EmptyArgumentException.php (added)
-
tags/1.2.7/freemius/includes/sdk/Exceptions/Exception.php (added)
-
tags/1.2.7/freemius/includes/sdk/Exceptions/InvalidArgumentException.php (added)
-
tags/1.2.7/freemius/includes/sdk/Exceptions/OAuthException.php (added)
-
tags/1.2.7/freemius/includes/sdk/Exceptions/index.php (added)
-
tags/1.2.7/freemius/includes/sdk/FreemiusBase.php (added)
-
tags/1.2.7/freemius/includes/sdk/FreemiusWordPress.php (added)
-
tags/1.2.7/freemius/includes/sdk/LICENSE.txt (added)
-
tags/1.2.7/freemius/includes/sdk/index.php (added)
-
tags/1.2.7/freemius/includes/supplements (added)
-
tags/1.2.7/freemius/includes/supplements/fs-essential-functions-1.1.7.1.php (added)
-
tags/1.2.7/freemius/includes/supplements/fs-essential-functions-2.2.1.php (added)
-
tags/1.2.7/freemius/includes/supplements/fs-migration-2.5.1.php (added)
-
tags/1.2.7/freemius/includes/supplements/index.php (added)
-
tags/1.2.7/freemius/index.php (added)
-
tags/1.2.7/freemius/languages (added)
-
tags/1.2.7/freemius/languages/freemius-cs_CZ.mo (added)
-
tags/1.2.7/freemius/languages/freemius-da_DK.mo (added)
-
tags/1.2.7/freemius/languages/freemius-de_DE.mo (added)
-
tags/1.2.7/freemius/languages/freemius-es_ES.mo (added)
-
tags/1.2.7/freemius/languages/freemius-fr_FR.mo (added)
-
tags/1.2.7/freemius/languages/freemius-he_IL.mo (added)
-
tags/1.2.7/freemius/languages/freemius-hu_HU.mo (added)
-
tags/1.2.7/freemius/languages/freemius-it_IT.mo (added)
-
tags/1.2.7/freemius/languages/freemius-ja.mo (added)
-
tags/1.2.7/freemius/languages/freemius-nl_NL.mo (added)
-
tags/1.2.7/freemius/languages/freemius-ru_RU.mo (added)
-
tags/1.2.7/freemius/languages/freemius-ta.mo (added)
-
tags/1.2.7/freemius/languages/freemius-zh_CN.mo (added)
-
tags/1.2.7/freemius/languages/freemius.pot (added)
-
tags/1.2.7/freemius/languages/index.php (added)
-
tags/1.2.7/freemius/require.php (added)
-
tags/1.2.7/freemius/start.php (added)
-
tags/1.2.7/freemius/templates (added)
-
tags/1.2.7/freemius/templates/account (added)
-
tags/1.2.7/freemius/templates/account.php (added)
-
tags/1.2.7/freemius/templates/account/billing.php (added)
-
tags/1.2.7/freemius/templates/account/index.php (added)
-
tags/1.2.7/freemius/templates/account/partials (added)
-
tags/1.2.7/freemius/templates/account/partials/activate-license-button.php (added)
-
tags/1.2.7/freemius/templates/account/partials/addon.php (added)
-
tags/1.2.7/freemius/templates/account/partials/deactivate-license-button.php (added)
-
tags/1.2.7/freemius/templates/account/partials/disconnect-button.php (added)
-
tags/1.2.7/freemius/templates/account/partials/index.php (added)
-
tags/1.2.7/freemius/templates/account/partials/site.php (added)
-
tags/1.2.7/freemius/templates/account/payments.php (added)
-
tags/1.2.7/freemius/templates/add-ons.php (added)
-
tags/1.2.7/freemius/templates/add-trial-to-pricing.php (added)
-
tags/1.2.7/freemius/templates/admin-notice.php (added)
-
tags/1.2.7/freemius/templates/ajax-loader.php (added)
-
tags/1.2.7/freemius/templates/api-connectivity-message-js.php (added)
-
tags/1.2.7/freemius/templates/auto-installation.php (added)
-
tags/1.2.7/freemius/templates/checkout (added)
-
tags/1.2.7/freemius/templates/checkout.php (added)
-
tags/1.2.7/freemius/templates/checkout/frame.php (added)
-
tags/1.2.7/freemius/templates/checkout/process-redirect.php (added)
-
tags/1.2.7/freemius/templates/checkout/redirect.php (added)
-
tags/1.2.7/freemius/templates/clone-resolution-js.php (added)
-
tags/1.2.7/freemius/templates/connect (added)
-
tags/1.2.7/freemius/templates/connect.php (added)
-
tags/1.2.7/freemius/templates/connect/index.php (added)
-
tags/1.2.7/freemius/templates/connect/permission.php (added)
-
tags/1.2.7/freemius/templates/connect/permissions-group.php (added)
-
tags/1.2.7/freemius/templates/contact.php (added)
-
tags/1.2.7/freemius/templates/debug (added)
-
tags/1.2.7/freemius/templates/debug.php (added)
-
tags/1.2.7/freemius/templates/debug/api-calls.php (added)
-
tags/1.2.7/freemius/templates/debug/index.php (added)
-
tags/1.2.7/freemius/templates/debug/logger.php (added)
-
tags/1.2.7/freemius/templates/debug/plugins-themes-sync.php (added)
-
tags/1.2.7/freemius/templates/debug/scheduled-crons.php (added)
-
tags/1.2.7/freemius/templates/email.php (added)
-
tags/1.2.7/freemius/templates/forms (added)
-
tags/1.2.7/freemius/templates/forms/affiliation.php (added)
-
tags/1.2.7/freemius/templates/forms/data-debug-mode.php (added)
-
tags/1.2.7/freemius/templates/forms/deactivation (added)
-
tags/1.2.7/freemius/templates/forms/deactivation/contact.php (added)
-
tags/1.2.7/freemius/templates/forms/deactivation/form.php (added)
-
tags/1.2.7/freemius/templates/forms/deactivation/index.php (added)
-
tags/1.2.7/freemius/templates/forms/deactivation/retry-skip.php (added)
-
tags/1.2.7/freemius/templates/forms/email-address-update.php (added)
-
tags/1.2.7/freemius/templates/forms/index.php (added)
-
tags/1.2.7/freemius/templates/forms/license-activation.php (added)
-
tags/1.2.7/freemius/templates/forms/optout.php (added)
-
tags/1.2.7/freemius/templates/forms/premium-versions-upgrade-handler.php (added)
-
tags/1.2.7/freemius/templates/forms/premium-versions-upgrade-metadata.php (added)
-
tags/1.2.7/freemius/templates/forms/resend-key.php (added)
-
tags/1.2.7/freemius/templates/forms/subscription-cancellation.php (added)
-
tags/1.2.7/freemius/templates/forms/trial-start.php (added)
-
tags/1.2.7/freemius/templates/forms/user-change.php (added)
-
tags/1.2.7/freemius/templates/gdpr-optin-js.php (added)
-
tags/1.2.7/freemius/templates/index.php (added)
-
tags/1.2.7/freemius/templates/js (added)
-
tags/1.2.7/freemius/templates/js/index.php (added)
-
tags/1.2.7/freemius/templates/js/jquery.content-change.php (added)
-
tags/1.2.7/freemius/templates/js/open-license-activation.php (added)
-
tags/1.2.7/freemius/templates/js/permissions.php (added)
-
tags/1.2.7/freemius/templates/js/style-premium-theme.php (added)
-
tags/1.2.7/freemius/templates/partials (added)
-
tags/1.2.7/freemius/templates/partials/index.php (added)
-
tags/1.2.7/freemius/templates/partials/network-activation.php (added)
-
tags/1.2.7/freemius/templates/plugin-icon.php (added)
-
tags/1.2.7/freemius/templates/plugin-info (added)
-
tags/1.2.7/freemius/templates/plugin-info/description.php (added)
-
tags/1.2.7/freemius/templates/plugin-info/features.php (added)
-
tags/1.2.7/freemius/templates/plugin-info/index.php (added)
-
tags/1.2.7/freemius/templates/plugin-info/screenshots.php (added)
-
tags/1.2.7/freemius/templates/pricing.php (added)
-
tags/1.2.7/freemius/templates/secure-https-header.php (added)
-
tags/1.2.7/freemius/templates/sticky-admin-notice-js.php (added)
-
tags/1.2.7/freemius/templates/tabs-capture-js.php (added)
-
tags/1.2.7/freemius/templates/tabs.php (added)
-
tags/1.2.7/includes (added)
-
tags/1.2.7/includes/class-winter-activity-log-activator.php (added)
-
tags/1.2.7/includes/class-winter-activity-log-browserdetector.php (added)
-
tags/1.2.7/includes/class-winter-activity-log-deactivator.php (added)
-
tags/1.2.7/includes/class-winter-activity-log-global.php (added)
-
tags/1.2.7/includes/class-winter-activity-log-i18n.php (added)
-
tags/1.2.7/includes/class-winter-activity-log-loader.php (added)
-
tags/1.2.7/includes/class-winter-activity-log-logger.php (added)
-
tags/1.2.7/includes/class-winter-activity-log.php (added)
-
tags/1.2.7/includes/class-winterlock-review-request.php (added)
-
tags/1.2.7/includes/dash-widgets (added)
-
tags/1.2.7/includes/dash-widgets/logs-list.php (added)
-
tags/1.2.7/includes/helper-functions.php (added)
-
tags/1.2.7/includes/index.php (added)
-
tags/1.2.7/index.php (added)
-
tags/1.2.7/languages (added)
-
tags/1.2.7/languages/winter-activity-log-hr.mo (added)
-
tags/1.2.7/languages/winter-activity-log-hr.po (added)
-
tags/1.2.7/languages/winter-activity-log.pot (added)
-
tags/1.2.7/predefined_events.xml (added)
-
tags/1.2.7/premium_functions.php (added)
-
tags/1.2.7/public (added)
-
tags/1.2.7/public/class-winter-activity-log-public.php (added)
-
tags/1.2.7/public/css (added)
-
tags/1.2.7/public/css/winter-activity-log-public.css (added)
-
tags/1.2.7/public/index.php (added)
-
tags/1.2.7/public/js (added)
-
tags/1.2.7/public/js/winter-activity-log-public.js (added)
-
tags/1.2.7/public/partials (added)
-
tags/1.2.7/public/partials/winter-activity-log-public-display.php (added)
-
tags/1.2.7/screenshot-1.jpg (added)
-
tags/1.2.7/screenshot-2.jpg (added)
-
tags/1.2.7/screenshot-3.jpg (added)
-
tags/1.2.7/screenshot-4.jpg (added)
-
tags/1.2.7/vendor (added)
-
tags/1.2.7/vendor/Winter_MVC (added)
-
tags/1.2.7/vendor/Winter_MVC/LICENSE (added)
-
tags/1.2.7/vendor/Winter_MVC/assets (added)
-
tags/1.2.7/vendor/Winter_MVC/assets/css (added)
-
tags/1.2.7/vendor/Winter_MVC/assets/css/winter_mvc.css (added)
-
tags/1.2.7/vendor/Winter_MVC/assets/js (added)
-
tags/1.2.7/vendor/Winter_MVC/assets/js/jquery.wpmediaelement.js (added)
-
tags/1.2.7/vendor/Winter_MVC/assets/js/jquery.wpmediaelement_file.js (added)
-
tags/1.2.7/vendor/Winter_MVC/assets/js/jquery.wpmediamultiple.js (added)
-
tags/1.2.7/vendor/Winter_MVC/core (added)
-
tags/1.2.7/vendor/Winter_MVC/core/database.php (added)
-
tags/1.2.7/vendor/Winter_MVC/core/form.php (added)
-
tags/1.2.7/vendor/Winter_MVC/core/helpers.php (added)
-
tags/1.2.7/vendor/Winter_MVC/core/input.php (added)
-
tags/1.2.7/vendor/Winter_MVC/core/mvc_loader.php (added)
-
tags/1.2.7/vendor/Winter_MVC/core/winter_mvc_controller.php (added)
-
tags/1.2.7/vendor/Winter_MVC/core/winter_mvc_model.php (added)
-
tags/1.2.7/vendor/Winter_MVC/init.php (added)
-
tags/1.2.7/vendor/boo-settings-helper (added)
-
tags/1.2.7/vendor/boo-settings-helper/class-boo-settings-helper.php (added)
-
tags/1.2.7/vendor/boo-settings-helper/readme.md (added)
-
tags/1.2.7/vendor/fontawesome (added)
-
tags/1.2.7/vendor/fontawesome/LICENSE.txt (added)
-
tags/1.2.7/vendor/fontawesome/css (added)
-
tags/1.2.7/vendor/fontawesome/css/fontawesome.min.css (added)
-
tags/1.2.7/vendor/fontawesome/webfonts (added)
-
tags/1.2.7/vendor/fontawesome/webfonts/fa-regular-400.eot (added)
-
tags/1.2.7/vendor/fontawesome/webfonts/fa-regular-400.svg (added)
-
tags/1.2.7/vendor/fontawesome/webfonts/fa-regular-400.ttf (added)
-
tags/1.2.7/vendor/fontawesome/webfonts/fa-regular-400.woff (added)
-
tags/1.2.7/vendor/fontawesome/webfonts/fa-regular-400.woff2 (added)
-
tags/1.2.7/vendor/fontawesome/webfonts/fa-solid-900.eot (added)
-
tags/1.2.7/vendor/fontawesome/webfonts/fa-solid-900.svg (added)
-
tags/1.2.7/vendor/fontawesome/webfonts/fa-solid-900.ttf (added)
-
tags/1.2.7/vendor/fontawesome/webfonts/fa-solid-900.woff (added)
-
tags/1.2.7/vendor/fontawesome/webfonts/fa-solid-900.woff2 (added)
-
tags/1.2.7/winterlock.php (added)
-
tags/1.2.7/wp-includes (added)
-
tags/1.2.7/wp-includes/fonts (added)
-
tags/1.2.7/wp-includes/fonts/dashicons.eot (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/application/controllers/Wal_cloudintegration.php (modified) (1 diff)
-
trunk/application/controllers/Wal_controlsecurity.php (modified) (1 diff)
-
trunk/application/controllers/Wal_disabledlogs.php (modified) (1 diff)
-
trunk/application/controllers/Wal_history.php (modified) (5 diffs)
-
trunk/application/controllers/Wal_logalerts.php (modified) (1 diff)
-
trunk/application/controllers/Wal_reports.php (modified) (1 diff)
-
trunk/application/controllers/Wal_usersessions.php (modified) (1 diff)
-
trunk/application/controllers/Winteractivitylog.php (modified) (4 diffs)
-
trunk/application/views/wal_cloudintegration/index.php (modified) (10 diffs)
-
trunk/application/views/wal_controlsecurity/index.php (modified) (1 diff)
-
trunk/application/views/wal_disabledlogs/index.php (modified) (1 diff)
-
trunk/application/views/wal_history/index.php (modified) (4 diffs)
-
trunk/application/views/wal_logalerts/index.php (modified) (1 diff)
-
trunk/application/views/wal_reports/index.php (modified) (10 diffs)
-
trunk/application/views/wal_usersessions/index.php (modified) (1 diff)
-
trunk/application/views/winteractivitylog/index.php (modified) (31 diffs)
-
trunk/freemius/README.md (deleted)
-
trunk/includes/helper-functions.php (modified) (1 diff)
-
trunk/premium_functions.php (deleted)
-
trunk/winterlock.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
winterlock/trunk/README.txt
r3419393 r3441603 5 5 Requires at least: 5.0 6 6 Tested up to: 6.9 7 Stable tag: 1.2. 77 Stable tag: 1.2.8 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 143 143 == Changelog == 144 144 145 = 1.2.8 = 146 * Security fix 147 145 148 = 1.2.7 = 146 149 * Security fix -
winterlock/trunk/application/controllers/Wal_cloudintegration.php
r3227676 r3441603 278 278 public function datatable() 279 279 { 280 281 if ( ! current_user_can( 'administrator' ) ) { 282 exit(); 283 } 284 285 check_ajax_referer('winterlock_secure_ajax', 'winterlock_secure'); 286 287 280 288 //$this->enable_error_reporting(); 281 289 remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 ); -
winterlock/trunk/application/controllers/Wal_controlsecurity.php
r3227676 r3441603 18 18 public function datatable() 19 19 { 20 if ( ! current_user_can( 'administrator' ) ) { 21 exit(); 22 } 23 24 check_ajax_referer('winterlock_secure_ajax', 'winterlock_secure'); 25 20 26 //$this->enable_error_reporting(); 21 27 remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 ); -
winterlock/trunk/application/controllers/Wal_disabledlogs.php
r2620073 r3441603 18 18 public function datatable() 19 19 { 20 if ( ! current_user_can( 'administrator' ) ) { 21 exit(); 22 } 23 24 check_ajax_referer('winterlock_secure_ajax', 'winterlock_secure'); 25 20 26 //$this->enable_error_reporting(); 21 27 remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 ); -
winterlock/trunk/application/controllers/Wal_history.php
r3227676 r3441603 72 72 public function datatable() 73 73 { 74 75 if ( ! current_user_can( 'administrator' ) ) { 76 exit(); 77 } 78 79 check_ajax_referer('winterlock_secure_ajax', 'winterlock_secure'); 80 74 81 //$this->enable_error_reporting(); 75 82 remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 ); … … 245 252 246 253 public function filter_save ($id = NULL, $redirect='1') { 254 if ( ! current_user_can( 'administrator' ) ) { 255 exit(); 256 } 257 258 check_ajax_referer('winterlock_secure_ajax', 'winterlock_secure'); 259 247 260 if(!wal_access_allowed('winterlock_logs')) 248 261 { … … 292 305 293 306 public function filter_get ($id = NULL, $redirect='1') { 307 if ( ! current_user_can( 'administrator' ) ) { 308 exit(); 309 } 310 311 check_ajax_referer('winterlock_secure_ajax', 'winterlock_secure'); 312 294 313 if(!wal_access_allowed('winterlock_logs')) 295 314 { … … 329 348 330 349 public function filter_remove ($id = NULL, $redirect='1') { 350 if ( ! current_user_can( 'administrator' ) ) { 351 exit(); 352 } 353 354 check_ajax_referer('winterlock_secure_ajax', 'winterlock_secure'); 355 331 356 if(!wal_access_allowed('winterlock_logs')) 332 357 { … … 352 377 } 353 378 354 $ajax_output['results'] = $results ;379 $ajax_output['results'] = $results ?? ''; 355 380 $ajax_output['success'] = true; 356 381 $json_output = json_encode($ajax_output); -
winterlock/trunk/application/controllers/Wal_logalerts.php
r2620073 r3441603 18 18 public function datatable() 19 19 { 20 21 if ( ! current_user_can( 'administrator' ) ) { 22 exit(); 23 } 24 25 check_ajax_referer('winterlock_secure_ajax', 'winterlock_secure'); 26 20 27 //$this->enable_error_reporting(); 21 28 remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 ); -
winterlock/trunk/application/controllers/Wal_reports.php
r3227676 r3441603 130 130 public function datatable() 131 131 { 132 133 if ( ! current_user_can( 'administrator' ) ) { 134 exit(); 135 } 136 137 check_ajax_referer('winterlock_secure_ajax', 'winterlock_secure'); 138 132 139 //$this->enable_error_reporting(); 133 140 remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 ); -
winterlock/trunk/application/controllers/Wal_usersessions.php
r3227676 r3441603 28 28 public function datatable() 29 29 { 30 31 if ( ! current_user_can( 'administrator' ) ) { 32 exit(); 33 } 34 35 check_ajax_referer('winterlock_secure_ajax', 'winterlock_secure'); 36 30 37 //$this->enable_error_reporting(); 31 38 remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 ); -
winterlock/trunk/application/controllers/Winteractivitylog.php
r3227676 r3441603 80 80 public function datatable() 81 81 { 82 83 if ( ! current_user_can( 'administrator' ) ) { 84 exit(); 85 } 86 87 check_ajax_referer('winterlock_secure_ajax', 'winterlock_secure'); 88 82 89 //$this->enable_error_reporting(); 83 90 remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 ); … … 250 257 251 258 public function filter_save ($id = NULL, $redirect='1') { 259 if ( ! current_user_can( 'administrator' ) ) { 260 exit(); 261 } 262 263 check_ajax_referer('winterlock_secure_ajax', 'winterlock_secure'); 252 264 if(!wal_access_allowed('winterlock_logs')) 253 265 { … … 297 309 298 310 public function filter_get ($id = NULL, $redirect='1') { 311 if ( ! current_user_can( 'administrator' ) ) { 312 exit(); 313 } 314 315 check_ajax_referer('winterlock_secure_ajax', 'winterlock_secure'); 316 299 317 if(!wal_access_allowed('winterlock_logs')) 300 318 { … … 334 352 335 353 public function filter_remove ($id = NULL, $redirect='1') { 354 if ( ! current_user_can( 'administrator' ) ) { 355 exit(); 356 } 357 358 check_ajax_referer('winterlock_secure_ajax', 'winterlock_secure'); 359 336 360 if(!wal_access_allowed('winterlock_logs')) 337 361 { -
winterlock/trunk/application/views/wal_cloudintegration/index.php
r3419393 r3441603 18 18 <div class="wrap winterlock_wrap"> 19 19 20 <h1><?php echo __('Cloud integration', 'winter-activity-log'); ?> 21 <a href="<?php menu_page_url( 'wal_cloudintegration', true ); ?>&function=cloud_edit" class="page-title-action"><i class="fa fa-plus"></i> <?php echo __('Add New Papertrail Cloud','sw_win')?></a> 22 <a href="<?php menu_page_url( 'wal_cloudintegration', true ); ?>&function=mysql_edit" class="page-title-action"><i class="fa fa-plus"></i> <?php echo __('Add New External MySQL Connection','sw_win')?></a> 20 <h1><?php 21 echo __( 'Cloud integration', 'winter-activity-log' ); 22 ?> 23 <a href="<?php 24 menu_page_url( 'wal_cloudintegration', true ); 25 ?>&function=cloud_edit" class="page-title-action"><i class="fa fa-plus"></i> <?php 26 echo __( 'Add New Papertrail Cloud', 'sw_win' ); 27 ?></a> 28 <a href="<?php 29 menu_page_url( 'wal_cloudintegration', true ); 30 ?>&function=mysql_edit" class="page-title-action"><i class="fa fa-plus"></i> <?php 31 echo __( 'Add New External MySQL Connection', 'sw_win' ); 32 ?></a> 23 33 24 34 </h1> … … 28 38 <div class="panel panel-default"> 29 39 <div class="panel-heading"> 30 <h3 class="panel-title"><?php echo __('Manage Cloud integration Data','winter-activity-log'); ?></h3> 40 <h3 class="panel-title"><?php 41 echo __( 'Manage Cloud integration Data', 'winter-activity-log' ); 42 ?></h3> 31 43 </div> 32 44 <div class="panel-body"> … … 39 51 <tr> 40 52 <th data-priority="1">#</th> 41 <th data-priority="2"><?php echo __('Title', 'winter-activity-log'); ?></th> 42 <th data-priority="3"><?php echo __('Component', 'winter-activity-log'); ?></th> 43 <th data-priority="4"><?php echo __('Program name', 'winter-activity-log'); ?></th> 53 <th data-priority="2"><?php 54 echo __( 'Title', 'winter-activity-log' ); 55 ?></th> 56 <th data-priority="3"><?php 57 echo __( 'Component', 'winter-activity-log' ); 58 ?></th> 59 <th data-priority="4"><?php 60 echo __( 'Program name', 'winter-activity-log' ); 61 ?></th> 44 62 <th data-priority="5"><i class="glyphicon glyphicon-edit"></i></th> 45 63 <th><input type="checkbox" class="selectAll" name="selectAll" value="all"></th> … … 63 81 </div> 64 82 <div class="footer-btns"> 65 <a href="#bulk_remove-form" id="bulk_remove" class="btn btn-danger pull-right popup-with-form"><i class="fa fa-remove"></i> <?php echo __('Bulk remove','winter-activity-log')?><i class="fa fa-spinner fa-spin fa-custom-ajax-indicator-opc ajax-indicator-masking hidden_opacity"></i></a> 66 <a href="#clear_filters" id="clear_filters" class="btn btn-danger pull-right "><i class="fa fa-trash"></i> <?php echo __('Clear all filters','winter-activity-log')?></a> 83 <a href="#bulk_remove-form" id="bulk_remove" class="btn btn-danger pull-right popup-with-form"><i class="fa fa-remove"></i> <?php 84 echo __( 'Bulk remove', 'winter-activity-log' ); 85 ?><i class="fa fa-spinner fa-spin fa-custom-ajax-indicator-opc ajax-indicator-masking hidden_opacity"></i></a> 86 <a href="#clear_filters" id="clear_filters" class="btn btn-danger pull-right "><i class="fa fa-trash"></i> <?php 87 echo __( 'Clear all filters', 'winter-activity-log' ); 88 ?></a> 67 89 </div> 68 90 </div> 69 91 </div> 70 92 71 <div class="alert alert-info" role="alert"><?php echo __('Here you can configure cloud loging to Papertrail app', 'winter-activity-log'); ?></div> 93 <div class="alert alert-info" role="alert"><?php 94 echo __( 'Here you can configure cloud loging to Papertrail app', 'winter-activity-log' ); 95 ?></div> 72 96 73 97 <?php 74 if ( winteractivitylog()->is__premium_only() ) { 75 if ( !winteractivitylog()->is_plan_or_trial('premium') ){ ?> 76 <div class="alert alert-danger" role="alert"><?php echo __('Min. premium package is required for cloud integration', 'winter-activity-log'); ?></div> 77 <?php }} ?> 78 79 <?php if(get_option('wal_checkbox_disable_hints', '0') == '0'): ?> 98 ?> 99 100 <?php 101 if ( get_option( 'wal_checkbox_disable_hints', '0' ) == '0' ) { 102 ?> 80 103 81 104 <iframe width="560" height="315" src="https://www.youtube.com/embed/4QvmA3HkdDY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> 82 105 83 <?php endif; ?> 106 <?php 107 } 108 ?> 84 109 </div> 85 110 </div> … … 87 112 88 113 89 <?php 90 91 wp_enqueue_style('winter-activity-log_basic_wrapper'); 114 <?php 115 wp_enqueue_style( 'winter-activity-log_basic_wrapper' ); 92 116 wp_enqueue_script( 'datatables' ); 93 117 wp_enqueue_script( 'dataTables-responsive' ); 94 118 wp_enqueue_script( 'dataTables-select' ); 95 96 119 wp_enqueue_style( 'dataTables-select' ); 97 120 ?> … … 121 144 if(count == 0) 122 145 { 123 alert('<?php echo esc_attr__('Please select reports to remove', 'winter-activity-log'); ?>'); 146 alert('<?php 147 echo esc_attr__( 'Please select reports to remove', 'winter-activity-log' ); 148 ?>'); 124 149 load_indicator_opc.addClass('hidden_opacity'); 125 150 return false; … … 128 153 { 129 154 130 if(confirm('<?php esc_js(__('Are you sure?', 'winter-activity-log')); ?>')) 155 if(confirm('<?php 156 esc_js( __( 'Are you sure?', 'winter-activity-log' ) ); 157 ?>')) 131 158 { 132 159 $('img#ajax-indicator-masking').show(); … … 136 163 137 164 // ajax to remove rows 138 $.post('<?php menu_page_url( 'wal_cloudintegration', true ); ?>&function=bulk_remove&_wpnonce=<?php echo esc_js(wp_create_nonce( 'winteractivitylog-bulk'));?>', { cloud_ids: ids }, function(data) { 165 $.post('<?php 166 menu_page_url( 'wal_cloudintegration', true ); 167 ?>&function=bulk_remove&_wpnonce=<?php 168 echo esc_js( wp_create_nonce( 'winteractivitylog-bulk' ) ); 169 ?>', { cloud_ids: ids }, function(data) { 139 170 140 171 $('img#ajax-indicator-masking').hide(); … … 170 201 "page": 'wal_cloudintegration', 171 202 "function": 'datatable', 172 "action": 'winter_activity_log_action' 203 "action": 'winter_activity_log_action', 204 "winterlock_secure": '<?php 205 echo esc_js( wp_create_nonce( 'winterlock_secure_ajax' ) ); 206 ?>' 173 207 } ); 174 208 } 175 209 }, 176 210 "language": { 177 search: "<?php esc_js(__('Search', 'winter-activity-log')); ?>", 178 searchPlaceholder: "<?php esc_js(__('Enter here filter tag for any column', 'winter-activity-log')); ?>" 211 search: "<?php 212 esc_js( __( 'Search', 'winter-activity-log' ) ); 213 ?>", 214 searchPlaceholder: "<?php 215 esc_js( __( 'Enter here filter tag for any column', 'winter-activity-log' ) ); 216 ?>" 179 217 }, 180 218 "fnDrawCallback": function (oSettings){ 181 219 $('a.delete_button').click(function(){ 182 220 183 if(confirm('<?php esc_js(__('Are you sure?', 'winter-activity-log')); ?>')) 221 if(confirm('<?php 222 esc_js( __( 'Are you sure?', 'winter-activity-log' ) ); 223 ?>')) 184 224 { 185 225 // ajax to remove row … … 275 315 'sNext': '<i class="fa fa-angle-right"></i>' 276 316 }, 277 'sSearch': "<?php esc_js(__('Search', 'winter-activity-log')); ?>", 278 "sLengthMenu": "<?php esc_js(__('Show _MENU_ entries', 'winter-activity-log')); ?>", 279 "sInfoEmpty": "<?php esc_js(__('Showing 0 to 0 of 0 entries', 'winter-activity-log')); ?>", 280 "sInfo": "<?php esc_js( __('Showing _START_ to _END_ of _TOTAL_ entries', 'winter-activity-log')); ?>", 281 "sEmptyTable": "<?php esc_js(__('No data available in table', 'winter-activity-log')); ?>", 317 'sSearch': "<?php 318 esc_js( __( 'Search', 'winter-activity-log' ) ); 319 ?>", 320 "sLengthMenu": "<?php 321 esc_js( __( 'Show _MENU_ entries', 'winter-activity-log' ) ); 322 ?>", 323 "sInfoEmpty": "<?php 324 esc_js( __( 'Showing 0 to 0 of 0 entries', 'winter-activity-log' ) ); 325 ?>", 326 "sInfo": "<?php 327 esc_js( __( 'Showing _START_ to _END_ of _TOTAL_ entries', 'winter-activity-log' ) ); 328 ?>", 329 "sEmptyTable": "<?php 330 esc_js( __( 'No data available in table', 'winter-activity-log' ) ); 331 ?>", 282 332 }, 283 333 'dom': "<'row'<'col-sm-7 col-md-5'f><'col-sm-5 col-md-6'l>>" + "<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-5'i><'col-sm-7'p>>" -
winterlock/trunk/application/views/wal_controlsecurity/index.php
r3227676 r3441603 177 177 "page": 'wal_controlsecurity', 178 178 "function": 'datatable', 179 "action": 'winter_activity_log_action' 179 "action": 'winter_activity_log_action', 180 "winterlock_secure": '<?php echo esc_js(wp_create_nonce( 'winterlock_secure_ajax' ));?>' 180 181 } ); 181 182 } -
winterlock/trunk/application/views/wal_disabledlogs/index.php
r3227676 r3441603 171 171 "page": 'wal_disabledlogs', 172 172 "function": 'datatable', 173 "action": 'winter_activity_log_action' 173 "action": 'winter_activity_log_action', 174 "winterlock_secure": '<?php echo esc_js(wp_create_nonce( 'winterlock_secure_ajax' ));?>' 174 175 } ); 175 176 } -
winterlock/trunk/application/views/wal_history/index.php
r3227676 r3441603 242 242 'function': 'filter_get', 243 243 "action": 'winter_activity_log_action', 244 "winterlock_secure": '<?php echo esc_js(wp_create_nonce( 'winterlock_secure_ajax' ));?>' 244 245 }; 245 246 … … 295 296 "action": 'winter_activity_log_action', 296 297 "filter_id": $(this).attr('data-fielderid') || '', 298 "winterlock_secure": '<?php echo esc_js(wp_create_nonce( 'winterlock_secure_ajax' ));?>' 297 299 }; 298 300 sw_log_notify('<?php echo __('Removing filter', 'winter-activity-log'); ?> '+title, 'loading'); … … 350 352 "action": 'winter_activity_log_action', 351 353 "filter_name": filter_name, 352 "filter_param": generate_json_filter() 354 "filter_param": generate_json_filter(), 355 "winterlock_secure": '<?php echo esc_js(wp_create_nonce( 'winterlock_secure_ajax' ));?>' 353 356 }; 354 357 … … 481 484 "page": 'wal_history', 482 485 "function": 'datatable', 483 "action": 'winter_activity_log_action' 486 "action": 'winter_activity_log_action', 487 "winterlock_secure": '<?php echo esc_js(wp_create_nonce( 'winterlock_secure_ajax' ));?>' 484 488 } ); 485 489 -
winterlock/trunk/application/views/wal_logalerts/index.php
r3227676 r3441603 171 171 "page": 'wal_logalerts', 172 172 "function": 'datatable', 173 "action": 'winter_activity_log_action' 173 "action": 'winter_activity_log_action', 174 "winterlock_secure": '<?php echo esc_js(wp_create_nonce( 'winterlock_secure_ajax' ));?>' 174 175 } ); 175 176 } -
winterlock/trunk/application/views/wal_reports/index.php
r3419393 r3441603 18 18 <div class="wrap winterlock_wrap"> 19 19 20 <h1><?php echo __('Reports','winter-activity-log'); ?> <a href="<?php menu_page_url( 'wal_reports', true ); ?>&function=report_edit" class="page-title-action"><i class="fa fa-plus"></i> <?php echo __('Add New','sw_win')?></a></h1> 20 <h1><?php 21 echo __( 'Reports', 'winter-activity-log' ); 22 ?> <a href="<?php 23 menu_page_url( 'wal_reports', true ); 24 ?>&function=report_edit" class="page-title-action"><i class="fa fa-plus"></i> <?php 25 echo __( 'Add New', 'sw_win' ); 26 ?></a></h1> 21 27 22 28 … … 24 30 <div class="panel panel-default"> 25 31 <div class="panel-heading"> 26 <h3 class="panel-title"><?php echo __('Manage Reports Data','winter-activity-log'); ?></h3> 32 <h3 class="panel-title"><?php 33 echo __( 'Manage Reports Data', 'winter-activity-log' ); 34 ?></h3> 27 35 </div> 28 36 <div class="panel-body"> … … 35 43 <tr> 36 44 <th data-priority="1">#</th> 37 <th data-priority="2"><?php echo __('Name', 'winter-activity-log'); ?></th> 38 <th data-priority="3"><?php echo __('Email', 'winter-activity-log'); ?></th> 39 <th data-priority="4"><?php echo __('Scheduling period', 'winter-activity-log'); ?></th> 40 <th data-priority="5"><?php echo __('Format', 'winter-activity-log'); ?></th> 45 <th data-priority="2"><?php 46 echo __( 'Name', 'winter-activity-log' ); 47 ?></th> 48 <th data-priority="3"><?php 49 echo __( 'Email', 'winter-activity-log' ); 50 ?></th> 51 <th data-priority="4"><?php 52 echo __( 'Scheduling period', 'winter-activity-log' ); 53 ?></th> 54 <th data-priority="5"><?php 55 echo __( 'Format', 'winter-activity-log' ); 56 ?></th> 41 57 <th data-priority="6"><i class="glyphicon glyphicon-search"></i></th> 42 58 <th><input type="checkbox" class="selectAll" name="selectAll" value="all"></th> … … 61 77 </div> 62 78 <div class="footer-btns"> 63 <a href="#bulk_remove-form" id="bulk_remove" class="btn btn-danger pull-right popup-with-form"><i class="fa fa-remove"></i> <?php echo __('Bulk remove','winter-activity-log')?><i class="fa fa-spinner fa-spin fa-custom-ajax-indicator-opc ajax-indicator-masking hidden_opacity"></i></a> 64 <a href="#clear_filters" id="clear_filters" class="btn btn-danger pull-right "><i class="fa fa-trash"></i> <?php echo __('Clear all filters','winter-activity-log')?></a> 79 <a href="#bulk_remove-form" id="bulk_remove" class="btn btn-danger pull-right popup-with-form"><i class="fa fa-remove"></i> <?php 80 echo __( 'Bulk remove', 'winter-activity-log' ); 81 ?><i class="fa fa-spinner fa-spin fa-custom-ajax-indicator-opc ajax-indicator-masking hidden_opacity"></i></a> 82 <a href="#clear_filters" id="clear_filters" class="btn btn-danger pull-right "><i class="fa fa-trash"></i> <?php 83 echo __( 'Clear all filters', 'winter-activity-log' ); 84 ?></a> 65 85 </div> 66 86 </div> 67 87 </div> 68 88 69 <div class="alert alert-info" role="alert"><?php echo __('Here you can define regular or scheduling reports', 'winter-activity-log'); ?></div> 89 <div class="alert alert-info" role="alert"><?php 90 echo __( 'Here you can define regular or scheduling reports', 'winter-activity-log' ); 91 ?></div> 70 92 71 93 <?php 72 if ( winteractivitylog()->is__premium_only() ) { 73 if ( !winteractivitylog()->is_plan_or_trial('standard') ){ ?> 74 <div class="alert alert-danger" role="alert"><?php echo __('Min. standard package is required for log repors', 'winter-activity-log'); ?></div> 75 <?php }} ?> 76 77 <?php if(get_option('wal_checkbox_disable_hints', '0') == '0'): ?> 94 ?> 95 96 <?php 97 if ( get_option( 'wal_checkbox_disable_hints', '0' ) == '0' ) { 98 ?> 78 99 79 100 <iframe width="560" height="315" src="https://www.youtube.com/embed/YF2VesF1NC8" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> 80 101 81 <?php endif; ?> 102 <?php 103 } 104 ?> 82 105 83 106 </div> … … 86 109 87 110 88 <?php 89 90 wp_enqueue_style('winter-activity-log_basic_wrapper'); 111 <?php 112 wp_enqueue_style( 'winter-activity-log_basic_wrapper' ); 91 113 wp_enqueue_script( 'datatables' ); 92 114 wp_enqueue_script( 'dataTables-responsive' ); 93 115 wp_enqueue_script( 'dataTables-select' ); 94 95 116 wp_enqueue_style( 'dataTables-select' ); 96 117 ?> … … 120 141 if(count == 0) 121 142 { 122 alert('<?php echo esc_attr__('Please select reports to remove', 'winter-activity-log'); ?>'); 143 alert('<?php 144 echo esc_attr__( 'Please select reports to remove', 'winter-activity-log' ); 145 ?>'); 123 146 load_indicator_opc.addClass('hidden_opacity'); 124 147 return false; … … 127 150 { 128 151 129 if(confirm('<?php esc_js(__('Are you sure?', 'winter-activity-log')); ?>')) 152 if(confirm('<?php 153 esc_js( __( 'Are you sure?', 'winter-activity-log' ) ); 154 ?>')) 130 155 { 131 156 $('img#ajax-indicator-masking').show(); … … 135 160 136 161 // ajax to remove rows 137 $.post('<?php menu_page_url( 'wal_reports', true ); ?>&function=bulk_remove&_wpnonce=<?php echo esc_js(wp_create_nonce( 'winteractivitylog-bulk'));?>', { report_ids: ids }, function(data) { 162 $.post('<?php 163 menu_page_url( 'wal_reports', true ); 164 ?>&function=bulk_remove&_wpnonce=<?php 165 echo esc_js( wp_create_nonce( 'winteractivitylog-bulk' ) ); 166 ?>', { report_ids: ids }, function(data) { 138 167 139 168 $('img#ajax-indicator-masking').hide(); … … 169 198 "page": 'wal_reports', 170 199 "function": 'datatable', 171 "action": 'winter_activity_log_action' 200 "action": 'winter_activity_log_action', 201 "winterlock_secure": '<?php 202 echo esc_js( wp_create_nonce( 'winterlock_secure_ajax' ) ); 203 ?>' 172 204 } ); 173 205 } 174 206 }, 175 207 "language": { 176 search: "<?php esc_js(__('Search', 'winter-activity-log')); ?>", 177 searchPlaceholder: "<?php esc_js(__('Enter here filter tag for any column', 'winter-activity-log')); ?>" 208 search: "<?php 209 esc_js( __( 'Search', 'winter-activity-log' ) ); 210 ?>", 211 searchPlaceholder: "<?php 212 esc_js( __( 'Enter here filter tag for any column', 'winter-activity-log' ) ); 213 ?>" 178 214 }, 179 215 "fnDrawCallback": function (oSettings){ 180 216 $('a.delete_button').click(function(){ 181 217 182 if(confirm('<?php esc_js(__('Are you sure?', 'winter-activity-log')); ?>')) 218 if(confirm('<?php 219 esc_js( __( 'Are you sure?', 'winter-activity-log' ) ); 220 ?>')) 183 221 { 184 222 // ajax to remove row … … 279 317 'sNext': '<i class="fa fa-angle-right"></i>' 280 318 }, 281 'sSearch': "<?php esc_js(__('Search', 'winter-activity-log')); ?>", 282 "sLengthMenu": "<?php esc_js(__('Show _MENU_ entries', 'winter-activity-log')); ?>", 283 "sInfoEmpty": "<?php esc_js(__('Showing 0 to 0 of 0 entries', 'winter-activity-log')); ?>", 284 "sInfo": "<?php esc_js( __('Showing _START_ to _END_ of _TOTAL_ entries', 'winter-activity-log')); ?>", 285 "sEmptyTable": "<?php esc_js(__('No data available in table', 'winter-activity-log')); ?>", 319 'sSearch': "<?php 320 esc_js( __( 'Search', 'winter-activity-log' ) ); 321 ?>", 322 "sLengthMenu": "<?php 323 esc_js( __( 'Show _MENU_ entries', 'winter-activity-log' ) ); 324 ?>", 325 "sInfoEmpty": "<?php 326 esc_js( __( 'Showing 0 to 0 of 0 entries', 'winter-activity-log' ) ); 327 ?>", 328 "sInfo": "<?php 329 esc_js( __( 'Showing _START_ to _END_ of _TOTAL_ entries', 'winter-activity-log' ) ); 330 ?>", 331 "sEmptyTable": "<?php 332 esc_js( __( 'No data available in table', 'winter-activity-log' ) ); 333 ?>", 286 334 }, 287 335 'dom': "<'row'<'col-sm-7 col-md-5'f><'col-sm-5 col-md-6'l>>" + "<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-5'i><'col-sm-7'p>>" -
winterlock/trunk/application/views/wal_usersessions/index.php
r3227676 r3441603 169 169 "page": 'wal_usersessions', 170 170 "function": 'datatable', 171 "action": 'winter_activity_log_action' 171 "action": 'winter_activity_log_action', 172 "winterlock_secure": '<?php echo esc_js(wp_create_nonce( 'winterlock_secure_ajax' ));?>' 172 173 } ); 173 174 } -
winterlock/trunk/application/views/winteractivitylog/index.php
r3419393 r3441603 14 14 ?> 15 15 16 <?php 16 <?php 17 17 $def_col_level = 0; 18 18 $def_col_date = 0; … … 22 22 $def_col_description = 0; 23 23 $def_col_select = 1; 24 $def_cols = ['level','date','avatar','user','ip','description']; 25 foreach ($def_cols as $def_column){ 26 if(sw_wal_log_is_visible_table_column($def_column)){ 24 $def_cols = [ 25 'level', 26 'date', 27 'avatar', 28 'user', 29 'ip', 30 'description' 31 ]; 32 foreach ( $def_cols as $def_column ) { 33 if ( sw_wal_log_is_visible_table_column( $def_column ) ) { 27 34 $s_plus = false; 28 foreach ($def_cols as $col) { 29 if($col == $def_column) $s_plus = true; 30 if($s_plus) 31 ${'def_col_'.$col}++; 35 foreach ( $def_cols as $col ) { 36 if ( $col == $def_column ) { 37 $s_plus = true; 38 } 39 if ( $s_plus ) { 40 ${'def_col_' . $col}++; 41 } 32 42 } 33 43 $def_col_select++; 34 44 } 35 45 } 36 37 46 ?> 38 47 … … 42 51 43 52 <h1> 44 <?php echo __('Activity log','winter-activity-log'); ?> 45 <?php if(get_option('wal_checkbox_disable_hints', '0') == '0'): ?> 46 <a href="#popup_tutorial" id="popup_tutorial" class="page-title-action pull-right"><i class="fa fa-video-camera"></i> <?php echo __('Need help? Check Video tutorials!','winter-activity-log'); ?></a> 47 <?php endif; ?> 53 <?php 54 echo __( 'Activity log', 'winter-activity-log' ); 55 ?> 56 <?php 57 if ( get_option( 'wal_checkbox_disable_hints', '0' ) == '0' ) { 58 ?> 59 <a href="#popup_tutorial" id="popup_tutorial" class="page-title-action pull-right"><i class="fa fa-video-camera"></i> <?php 60 echo __( 'Need help? Check Video tutorials!', 'winter-activity-log' ); 61 ?></a> 62 <?php 63 } 64 ?> 48 65 </h1> 49 66 … … 51 68 <div class="panel panel-default"> 52 69 <div class="panel-heading flex"> 53 <h3 class="panel-title"><?php echo __('Logged data','winter-activity-log'); ?></h3> 70 <h3 class="panel-title"><?php 71 echo __( 'Logged data', 'winter-activity-log' ); 72 ?></h3> 54 73 </div> 55 74 <div class="panel-body"> … … 61 80 <tr> 62 81 <th data-priority="1" width="40px">#</th> 63 <?php if(sw_wal_log_is_visible_table_column('level')):?> 64 <th data-priority="2" width="40px"><?php echo __('Level', 'winter-activity-log'); ?></th> 65 <?php endif;?> 66 <?php if(sw_wal_log_is_visible_table_column('date')):?> 67 <th data-priority="4"><?php echo __('Date', 'winter-activity-log'); ?></th> 68 <?php endif;?> 69 <?php if(sw_wal_log_is_visible_table_column('avatar')):?> 70 <th data-priority="2"><?php echo __('Avatar', 'winter-activity-log'); ?></th> 71 <?php endif;?> 72 <?php if(sw_wal_log_is_visible_table_column('user')):?> 73 <th data-priority="2"><?php echo __('User', 'winter-activity-log'); ?></th> 74 <?php endif;?> 75 <?php if(sw_wal_log_is_visible_table_column('ip')):?> 76 <th><?php echo __('IP', 'winter-activity-log'); ?></th> 77 <?php endif;?> 78 <?php if(sw_wal_log_is_visible_table_column('description')):?> 79 <th><?php echo __('Description', 'winter-activity-log'); ?></th> 80 <?php endif;?> 82 <?php 83 if ( sw_wal_log_is_visible_table_column( 'level' ) ) { 84 ?> 85 <th data-priority="2" width="40px"><?php 86 echo __( 'Level', 'winter-activity-log' ); 87 ?></th> 88 <?php 89 } 90 ?> 91 <?php 92 if ( sw_wal_log_is_visible_table_column( 'date' ) ) { 93 ?> 94 <th data-priority="4"><?php 95 echo __( 'Date', 'winter-activity-log' ); 96 ?></th> 97 <?php 98 } 99 ?> 100 <?php 101 if ( sw_wal_log_is_visible_table_column( 'avatar' ) ) { 102 ?> 103 <th data-priority="2"><?php 104 echo __( 'Avatar', 'winter-activity-log' ); 105 ?></th> 106 <?php 107 } 108 ?> 109 <?php 110 if ( sw_wal_log_is_visible_table_column( 'user' ) ) { 111 ?> 112 <th data-priority="2"><?php 113 echo __( 'User', 'winter-activity-log' ); 114 ?></th> 115 <?php 116 } 117 ?> 118 <?php 119 if ( sw_wal_log_is_visible_table_column( 'ip' ) ) { 120 ?> 121 <th><?php 122 echo __( 'IP', 'winter-activity-log' ); 123 ?></th> 124 <?php 125 } 126 ?> 127 <?php 128 if ( sw_wal_log_is_visible_table_column( 'description' ) ) { 129 ?> 130 <th><?php 131 echo __( 'Description', 'winter-activity-log' ); 132 ?></th> 133 <?php 134 } 135 ?> 81 136 <th data-priority="3" width="100px"></th> 82 137 <th width="10px"><input type="checkbox" class="selectAll" name="selectAll" value="all"></th> … … 88 143 <tfoot> 89 144 <tr> 90 <th><input type="text" name="filter_id" class="dinamic_par" placeholder="<?php echo __('Filter #', 'winter-activity-log'); ?>" /></th> 91 <?php if(sw_wal_log_is_visible_table_column('level')):?> 92 <th><input type="text" name="filter_level" class="dinamic_par" placeholder="<?php echo __('Filter Level', 'winter-activity-log'); ?>" /></th> 93 <?php endif;?> 94 <?php if(sw_wal_log_is_visible_table_column('date')):?> 95 <th><input type="text" id="filter_date" name="filter_date" class="dinamic_par" placeholder="<?php echo __('Filter Date From', 'winter-activity-log'); ?>" /></th> 96 <?php endif;?> 97 <?php if(sw_wal_log_is_visible_table_column('avatar')):?> 145 <th><input type="text" name="filter_id" class="dinamic_par" placeholder="<?php 146 echo __( 'Filter #', 'winter-activity-log' ); 147 ?>" /></th> 148 <?php 149 if ( sw_wal_log_is_visible_table_column( 'level' ) ) { 150 ?> 151 <th><input type="text" name="filter_level" class="dinamic_par" placeholder="<?php 152 echo __( 'Filter Level', 'winter-activity-log' ); 153 ?>" /></th> 154 <?php 155 } 156 ?> 157 <?php 158 if ( sw_wal_log_is_visible_table_column( 'date' ) ) { 159 ?> 160 <th><input type="text" id="filter_date" name="filter_date" class="dinamic_par" placeholder="<?php 161 echo __( 'Filter Date From', 'winter-activity-log' ); 162 ?>" /></th> 163 <?php 164 } 165 ?> 166 <?php 167 if ( sw_wal_log_is_visible_table_column( 'avatar' ) ) { 168 ?> 98 169 <th></th> 99 <?php endif;?> 100 <?php if(sw_wal_log_is_visible_table_column('user')):?> 101 <th><input type="text" id="filter_user" name="filter_user" value="<?php echo esc_attr(wmvc_show_data('filter_user', $_GET, '')); ?>" class="dinamic_par" placeholder="<?php echo __('Filter User', 'winter-activity-log'); ?>" /></th> 102 <?php endif;?> 103 <?php if(sw_wal_log_is_visible_table_column('ip')):?> 104 <th><input type="text" name="filter_ip" class="dinamic_par" placeholder="<?php echo __('Filter IP', 'winter-activity-log'); ?>" /></th> 105 <?php endif;?> 106 <?php if(sw_wal_log_is_visible_table_column('description')):?> 107 <th><input type="text" name="filter_description" class="dinamic_par" placeholder="<?php echo __('Filter Description', 'winter-activity-log'); ?>" /></th> 108 <?php endif;?> 170 <?php 171 } 172 ?> 173 <?php 174 if ( sw_wal_log_is_visible_table_column( 'user' ) ) { 175 ?> 176 <th><input type="text" id="filter_user" name="filter_user" value="<?php 177 echo esc_attr( wmvc_show_data( 'filter_user', $_GET, '' ) ); 178 ?>" class="dinamic_par" placeholder="<?php 179 echo __( 'Filter User', 'winter-activity-log' ); 180 ?>" /></th> 181 <?php 182 } 183 ?> 184 <?php 185 if ( sw_wal_log_is_visible_table_column( 'ip' ) ) { 186 ?> 187 <th><input type="text" name="filter_ip" class="dinamic_par" placeholder="<?php 188 echo __( 'Filter IP', 'winter-activity-log' ); 189 ?>" /></th> 190 <?php 191 } 192 ?> 193 <?php 194 if ( sw_wal_log_is_visible_table_column( 'description' ) ) { 195 ?> 196 <th><input type="text" name="filter_description" class="dinamic_par" placeholder="<?php 197 echo __( 'Filter Description', 'winter-activity-log' ); 198 ?>" /></th> 199 <?php 200 } 201 ?> 109 202 <th colspan="2"> 110 203 <div class="winterlock_save_search_filter"> 111 204 <div class="winterlock_save_search_filter_btn"> 112 <a href="#" class="btn btn_save"><?php echo __('Save', 'winter-activity-log'); ?></a> 205 <a href="#" class="btn btn_save"><?php 206 echo __( 'Save', 'winter-activity-log' ); 207 ?></a> 113 208 <a href="#" class="btn-toggle"><i class="fa fa-angle-down"></i></a> 114 209 </div> … … 124 219 125 220 <div class="form-inline"> 126 <div class="checkbox <?php if ( !winteractivitylog()->is_plan_or_trial('standard') ) echo 'wal-pro'; ?>"> 221 <div class="checkbox <?php 222 if ( !winteractivitylog()->is_plan_or_trial( 'standard' ) ) { 223 echo 'wal-pro'; 224 } 225 ?>"> 127 226 <label> 128 <input id="wal_live_monitoring" type="checkbox"> <?php echo __('Live monitoring enable (autorefresh each 10 sec)', 'winter-activity-log'); ?> 227 <input id="wal_live_monitoring" type="checkbox"> <?php 228 echo __( 'Live monitoring enable (autorefresh each 10 sec)', 'winter-activity-log' ); 229 ?> 129 230 </label> 130 231 </div> 131 232 132 233 <div class="footer-btns"> 133 <a href="<?php echo admin_url("admin.php?page=wal_reports&function=report_edit"); ?>" class="btn btn-warning pull-right"><i class="fa fa-download"></i> <?php echo __('Export/Generate Report','winter-activity-log')?></a> 134 <a href="#bulk_remove-form" id="bulk_remove" class="btn btn-danger pull-right popup-with-form"><i class="fa fa-remove"></i> <?php echo __('Bulk remove','winter-activity-log')?><i class="fa fa-spinner fa-spin fa-custom-ajax-indicator-opc ajax-indicator-masking hidden_opacity"></i></a> 135 <a href="#clear_filters" id="clear_filters" class="btn btn-danger pull-right "><i class="fa fa-trash"></i> <?php echo __('Clear all filters','winter-activity-log')?></a> 234 <a href="<?php 235 echo admin_url( "admin.php?page=wal_reports&function=report_edit" ); 236 ?>" class="btn btn-warning pull-right"><i class="fa fa-download"></i> <?php 237 echo __( 'Export/Generate Report', 'winter-activity-log' ); 238 ?></a> 239 <a href="#bulk_remove-form" id="bulk_remove" class="btn btn-danger pull-right popup-with-form"><i class="fa fa-remove"></i> <?php 240 echo __( 'Bulk remove', 'winter-activity-log' ); 241 ?><i class="fa fa-spinner fa-spin fa-custom-ajax-indicator-opc ajax-indicator-masking hidden_opacity"></i></a> 242 <a href="#clear_filters" id="clear_filters" class="btn btn-danger pull-right "><i class="fa fa-trash"></i> <?php 243 echo __( 'Clear all filters', 'winter-activity-log' ); 244 ?></a> 136 245 </div> 137 246 </div> … … 140 249 141 250 <?php 142 if ( winteractivitylog()->is__premium_only() ) { 143 if ( !winteractivitylog()->is_plan_or_trial('standard') ){ ?> 144 <div class="alert alert-danger" role="alert"><?php echo __('Min. standard package is required for live monitoring feature', 'winter-activity-log'); ?></div> 145 <?php }} ?> 251 ?> 146 252 147 253 </div> … … 149 255 150 256 151 <?php 152 153 wp_enqueue_style('winter-activity-log_basic_wrapper'); 257 <?php 258 wp_enqueue_style( 'winter-activity-log_basic_wrapper' ); 154 259 wp_enqueue_script( 'datatables' ); 155 260 wp_enqueue_script( 'dataTables-responsive' ); 156 261 wp_enqueue_script( 'dataTables-select' ); 157 158 262 wp_enqueue_style( 'dataTables-select' ); 159 263 ?> … … 179 283 }); 180 284 181 <?php if(sw_wal_log_is_visible_table_column('date')):?> 285 <?php 286 if ( sw_wal_log_is_visible_table_column( 'date' ) ) { 287 ?> 182 288 $("#filter_date").on("dp.change", function (e) { 183 289 $("#filter_date").trigger('change'); 184 table.columns(<?php $def_col_date;?>).search( $('#filter_date').val() ).draw(); 290 table.columns(<?php 291 $def_col_date; 292 ?>).search( $('#filter_date').val() ).draw(); 185 293 }); 186 <?php endif;?> 294 <?php 295 } 296 ?> 187 297 188 298 /* winterlock_save_search_filter */ … … 243 353 'function': 'filter_get', 244 354 "action": 'winter_activity_log_action', 355 "winterlock_secure": '<?php 356 echo esc_js( wp_create_nonce( 'winterlock_secure_ajax' ) ); 357 ?>' 245 358 }; 246 359 247 $.post('<?php echo esc_url(admin_url( 'admin-ajax.php' ));?>', data, 360 $.post('<?php 361 echo esc_url( admin_url( 'admin-ajax.php' ) ); 362 ?>', data, 248 363 function(data){ 249 364 var html =''; … … 283 398 setTimeout(function(){jQuery('.dinamic_par[name=\"sw_log_search\"]').trigger('change');},1500); 284 399 285 sw_log_notify('<?php echo __('Loaded filter', 'winter-activity-log'); ?> '+$(this).contents()[0].textContent); 400 sw_log_notify('<?php 401 echo __( 'Loaded filter', 'winter-activity-log' ); 402 ?> '+$(this).contents()[0].textContent); 286 403 $(this).closest('.winterlock_save_search_filter').removeClass('show'); 287 404 }) … … 296 413 "action": 'winter_activity_log_action', 297 414 "filter_id": $(this).attr('data-fielderid') || '', 415 "winterlock_secure": '<?php 416 echo esc_js( wp_create_nonce( 'winterlock_secure_ajax' ) ); 417 ?>' 298 418 }; 299 sw_log_notify('<?php echo __('Removing filter', 'winter-activity-log'); ?> '+title, 'loading'); 300 301 $.post('<?php echo esc_url(admin_url( 'admin-ajax.php' ));?>', data, 419 sw_log_notify('<?php 420 echo __( 'Removing filter', 'winter-activity-log' ); 421 ?> '+title, 'loading'); 422 423 $.post('<?php 424 echo esc_url( admin_url( 'admin-ajax.php' ) ); 425 ?>', data, 302 426 function(data){ 303 427 304 428 }, "json").success(function(){ 305 sw_log_notify('<?php echo __('Removed filter', 'winter-activity-log'); ?> '+title); 429 sw_log_notify('<?php 430 echo __( 'Removed filter', 'winter-activity-log' ); 431 ?> '+title); 306 432 reload_filters(); 307 433 }); … … 319 445 320 446 if(is_empty) { 321 sw_log_notify('<?php echo __('Fitlers are empty', 'winter-activity-log'); ?>', 'error'); 447 sw_log_notify('<?php 448 echo __( 'Fitlers are empty', 'winter-activity-log' ); 449 ?>', 'error'); 322 450 return false; 323 451 } … … 327 455 boxWidth: '400px', 328 456 useBootstrap: false, 329 title: '<?php echo __('Save', 'winter-activity-log'); ?>', 457 title: '<?php 458 echo __( 'Save', 'winter-activity-log' ); 459 ?>', 330 460 content: '' + 331 461 '<form action="" class="winterlock_list_filters_form formName">' + 332 462 '<div class="form-group">' + 333 '<label><?php echo __('Filter name', 'winter-activity-log'); ?></label>' + 334 '<input type="text" placeholder="<?php echo __('Filter name', 'winter-activity-log'); ?>" class="filter_name form-control" required />' + 463 '<label><?php 464 echo __( 'Filter name', 'winter-activity-log' ); 465 ?></label>' + 466 '<input type="text" placeholder="<?php 467 echo __( 'Filter name', 'winter-activity-log' ); 468 ?>" class="filter_name form-control" required />' + 335 469 '</div>' + 336 470 '</form>', 337 471 buttons: { 338 472 formSubmit: { 339 text: '<?php echo __('Save', 'winter-activity-log'); ?>', 473 text: '<?php 474 echo __( 'Save', 'winter-activity-log' ); 475 ?>', 340 476 btnClass: 'btn-blue', 341 477 action: function () { … … 351 487 "action": 'winter_activity_log_action', 352 488 "filter_name": filter_name, 353 "filter_param": generate_json_filter() 489 "filter_param": generate_json_filter(), 490 "winterlock_secure": '<?php 491 echo esc_js( wp_create_nonce( 'winterlock_secure_ajax' ) ); 492 ?>' 354 493 }; 355 494 356 $.post('<?php echo esc_url(admin_url( 'admin-ajax.php' ));?>', data, 495 $.post('<?php 496 echo esc_url( admin_url( 'admin-ajax.php' ) ); 497 ?>', data, 357 498 function(data){ 358 499 }, "json").success(function(){ 359 sw_log_notify('<?php echo __('Saved filter', 'winter-activity-log'); ?> '+filter_name); 500 sw_log_notify('<?php 501 echo __( 'Saved filter', 'winter-activity-log' ); 502 ?> '+filter_name); 360 503 reload_filters(); 361 504 } ); … … 364 507 }, 365 508 cancel: { 366 text: '<?php echo __('Cancel', 'winter-activity-log'); ?>', 509 text: '<?php 510 echo __( 'Cancel', 'winter-activity-log' ); 511 ?>', 367 512 action: function () { 368 513 } … … 434 579 if(count == 0) 435 580 { 436 alert('<?php echo esc_attr__('Please select listings to remove', 'winter-activity-log'); ?>'); 581 alert('<?php 582 echo esc_attr__( 'Please select listings to remove', 'winter-activity-log' ); 583 ?>'); 437 584 load_indicator_opc.addClass('hidden_opacity'); 438 585 return false; … … 441 588 { 442 589 443 if(confirm('<?php esc_js(__('Are you sure?', 'winter-activity-log')); ?>')) 590 if(confirm('<?php 591 esc_js( __( 'Are you sure?', 'winter-activity-log' ) ); 592 ?>')) 444 593 { 445 594 $('img#ajax-indicator-masking').show(); … … 449 598 450 599 // ajax to remove rows 451 $.post('<?php menu_page_url( 'winteractivitylog', true ); ?>&function=bulk_remove&_wpnonce=<?php echo esc_js(wp_create_nonce( 'winteractivitylog-bulk'));?>', { log_ids: ids }, function(data) { 600 $.post('<?php 601 menu_page_url( 'winteractivitylog', true ); 602 ?>&function=bulk_remove&_wpnonce=<?php 603 echo esc_js( wp_create_nonce( 'winteractivitylog-bulk' ) ); 604 ?>', { log_ids: ids }, function(data) { 452 605 453 606 $('img#ajax-indicator-masking').hide(); … … 495 648 "page": 'winteractivitylog', 496 649 "function": 'datatable', 497 "action": 'winter_activity_log_action' 650 "action": 'winter_activity_log_action', 651 "winterlock_secure": '<?php 652 echo esc_js( wp_create_nonce( 'winterlock_secure_ajax' ) ); 653 ?>', 498 654 } ); 499 655 … … 502 658 }, 503 659 "language": { 504 search: "<?php esc_js(__('Search', 'winter-activity-log')); ?>", 505 searchPlaceholder: "<?php esc_js(__('Enter here filter tag for any column', 'winter-activity-log')); ?>" 660 search: "<?php 661 esc_js( __( 'Search', 'winter-activity-log' ) ); 662 ?>", 663 searchPlaceholder: "<?php 664 esc_js( __( 'Enter here filter tag for any column', 'winter-activity-log' ) ); 665 ?>" 506 666 }, 507 667 "initComplete": function(settings, json) { … … 512 672 { 513 673 sw_log_s_table_load_counter++; 514 <?php if(sw_wal_log_is_visible_table_column('user')):?> 674 <?php 675 if ( sw_wal_log_is_visible_table_column( 'user' ) ) { 676 ?> 515 677 if($('#filter_user').val() != '') 516 setTimeout(function(){ table.columns(<?php echo intval($def_col_user);?>).search( $('#filter_user').val() ).draw(); }, 1000); 517 <?php endif;?> 678 setTimeout(function(){ table.columns(<?php 679 echo intval( $def_col_user ); 680 ?>).search( $('#filter_user').val() ).draw(); }, 1000); 681 <?php 682 } 683 ?> 518 684 519 685 } … … 521 687 $('a.delete_button').click(function(){ 522 688 523 if(confirm('<?php esc_js(__('Are you sure?', 'winter-activity-log')); ?>')) 689 if(confirm('<?php 690 esc_js( __( 'Are you sure?', 'winter-activity-log' ) ); 691 ?>')) 524 692 { 525 693 // ajax to remove row … … 563 731 'columns': [ 564 732 { data: "idlog" }, 565 <?php if(sw_wal_log_is_visible_table_column('level')):?> 733 <?php 734 if ( sw_wal_log_is_visible_table_column( 'level' ) ) { 735 ?> 566 736 { data: "level" }, 567 <?php endif;?> 568 <?php if(sw_wal_log_is_visible_table_column('date')):?> 737 <?php 738 } 739 ?> 740 <?php 741 if ( sw_wal_log_is_visible_table_column( 'date' ) ) { 742 ?> 569 743 { data: "date" }, 570 <?php endif;?> 571 <?php if(sw_wal_log_is_visible_table_column('avatar')):?> 744 <?php 745 } 746 ?> 747 <?php 748 if ( sw_wal_log_is_visible_table_column( 'avatar' ) ) { 749 ?> 572 750 { data: "avatar" }, 573 <?php endif;?> 574 <?php if(sw_wal_log_is_visible_table_column('user')):?> 751 <?php 752 } 753 ?> 754 <?php 755 if ( sw_wal_log_is_visible_table_column( 'user' ) ) { 756 ?> 575 757 { data: "user_info" }, 576 <?php endif;?> 577 <?php if(sw_wal_log_is_visible_table_column('ip')):?> 758 <?php 759 } 760 ?> 761 <?php 762 if ( sw_wal_log_is_visible_table_column( 'ip' ) ) { 763 ?> 578 764 { data: "ip" }, 579 <?php endif;?> 580 <?php if(sw_wal_log_is_visible_table_column('description')):?> 765 <?php 766 } 767 ?> 768 <?php 769 if ( sw_wal_log_is_visible_table_column( 'description' ) ) { 770 ?> 581 771 { data: "description"}, 582 <?php endif;?> 772 <?php 773 } 774 ?> 583 775 584 776 { data: "edit" }, … … 597 789 order: [[ 0, 'desc' ]], 598 790 columnDefs: [ 599 <?php if(sw_wal_log_is_visible_table_column('avatar')):?> 791 <?php 792 if ( sw_wal_log_is_visible_table_column( 'avatar' ) ) { 793 ?> 600 794 { 601 targets: <?php echo intval($def_col_avatar);?>, 795 targets: <?php 796 echo intval( $def_col_avatar ); 797 ?>, 602 798 orderable: false 603 799 }, 604 <?php endif;?> 800 <?php 801 } 802 ?> 605 803 { 606 804 //className: 'control', … … 609 807 targets: 0 610 808 }, 611 <?php if(sw_wal_log_is_visible_table_column('user')):?> 809 <?php 810 if ( sw_wal_log_is_visible_table_column( 'user' ) ) { 811 ?> 612 812 { 613 813 //className: 'control', 614 814 //className: 'details-control', 615 815 orderable: false, 616 targets: <?php echo intval($def_col_user);?> 816 targets: <?php 817 echo intval( $def_col_user ); 818 ?> 617 819 }, 618 <?php endif;?> 619 <?php if(sw_wal_log_is_visible_table_column('ip')):?> 820 <?php 821 } 822 ?> 823 <?php 824 if ( sw_wal_log_is_visible_table_column( 'ip' ) ) { 825 ?> 620 826 { 621 targets: <?php echo intval($def_col_ip);?>, 827 targets: <?php 828 echo intval( $def_col_ip ); 829 ?>, 622 830 orderable: false, 623 831 defaultContent: '2', 624 832 }, 625 <?php endif;?> 626 <?php if(sw_wal_log_is_visible_table_column('description')):?> 833 <?php 834 } 835 ?> 836 <?php 837 if ( sw_wal_log_is_visible_table_column( 'description' ) ) { 838 ?> 627 839 { 628 targets: <?php echo intval($def_col_description);?>, 840 targets: <?php 841 echo intval( $def_col_description ); 842 ?>, 629 843 orderable: false 630 844 }, 631 <?php endif;?> 845 <?php 846 } 847 ?> 632 848 { 633 targets: <?php echo intval($def_col_select);?>, 849 targets: <?php 850 echo intval( $def_col_select ); 851 ?>, 634 852 orderable: false 635 853 }, … … 638 856 orderable: false, 639 857 defaultContent: '', 640 targets: <?php echo intval($def_col_select+1);?> 858 targets: <?php 859 echo intval( $def_col_select + 1 ); 860 ?> 641 861 } 642 862 ], … … 650 870 'sNext': '<i class="fa fa-angle-right"></i>' 651 871 }, 652 'sSearch': "<?php esc_js(__('Search', 'winter-activity-log')); ?>", 653 "sLengthMenu": "<?php esc_js(__('Show _MENU_ entries', 'winter-activity-log')); ?>", 654 "sInfoEmpty": "<?php esc_js(__('Showing 0 to 0 of 0 entries', 'winter-activity-log')); ?>", 655 "sInfo": "<?php esc_js( __('Showing _START_ to _END_ of _TOTAL_ entries', 'winter-activity-log')); ?>", 656 "sEmptyTable": "<?php esc_js(__('No data available in table', 'winter-activity-log')); ?>", 872 'sSearch': "<?php 873 esc_js( __( 'Search', 'winter-activity-log' ) ); 874 ?>", 875 "sLengthMenu": "<?php 876 esc_js( __( 'Show _MENU_ entries', 'winter-activity-log' ) ); 877 ?>", 878 "sInfoEmpty": "<?php 879 esc_js( __( 'Showing 0 to 0 of 0 entries', 'winter-activity-log' ) ); 880 ?>", 881 "sInfo": "<?php 882 esc_js( __( 'Showing _START_ to _END_ of _TOTAL_ entries', 'winter-activity-log' ) ); 883 ?>", 884 "sEmptyTable": "<?php 885 esc_js( __( 'No data available in table', 'winter-activity-log' ) ); 886 ?>", 657 887 }, 658 888 'dom': "<'row'<'col-sm-7 col-md-5'f><'col-sm-5 col-md-6'l>>" + "<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-5'i><'col-sm-7'p>>" … … 783 1013 draggable: true, 784 1014 backgroundDismiss: true, // this will just close the modal 785 title: '<?php echo esc_html__('Tutorials', 'winter-activity-log');?>', 1015 title: '<?php 1016 echo esc_html__( 'Tutorials', 'winter-activity-log' ); 1017 ?>', 786 1018 content: '<div class="winterlock_wrap wl_popup_tutorial">' + 787 '<div class="alert alert-warning" role="alert"><a target="_blank" href="https://www.youtube.com/watch?v=VWI1WvlQQa8&list=PL0MjUuUth-hVFykhkW_UN8fsoAYJVbhf2"><i class="fa fa-youtube-play" aria-hidden="true"></i> <?php echo __('How to use quick search filtering?', 'winter-activity-log'); ?></a></div>'+ 788 '<div class="alert alert-warning" role="alert"><a target="_blank" href="https://www.youtube.com/watch?v=v8jJcRkEfjI&list=PL0MjUuUth-hVFykhkW_UN8fsoAYJVbhf2"><i class="fa fa-youtube-play" aria-hidden="true"></i> <?php echo __('How to Live Montor with auto refresh and detect login users?', 'winter-activity-log'); ?></a></div>'+ 789 '<div class="alert alert-warning" role="alert"><a target="_blank" href="https://www.youtube.com/watch?v=utDuznzhsHg&list=PL0MjUuUth-hVFykhkW_UN8fsoAYJVbhf2"><i class="fa fa-youtube-play" aria-hidden="true"></i> <?php echo __('How to check Login History and Block Failed Login Attempts?', 'winter-activity-log'); ?></a></div>'+ 790 '<div class="alert alert-warning" role="alert"><a target="_blank" href="https://www.youtube.com/watch?v=bLG_HZrpEX0&list=PL0MjUuUth-hVFykhkW_UN8fsoAYJVbhf2"><i class="fa fa-youtube-play" aria-hidden="true"></i> <?php echo __('How to Block IP, Username, some words in title or any other criteria?', 'winter-activity-log'); ?></a></div>'+ 791 '<div class="alert alert-warning" role="alert"><a target="_blank" href="https://www.youtube.com/watch?v=v9dJ8F9ekVI&list=PL0MjUuUth-hVFykhkW_UN8fsoAYJVbhf2"><i class="fa fa-youtube-play" aria-hidden="true"></i> <?php echo __('How to Log Content Editing and check Revisions?', 'winter-activity-log'); ?></a></div>'+ 792 '<div class="alert alert-warning" role="alert"><a target="_blank" href="https://www.youtube.com/watch?v=rVwcz6pbBWM&list=PL0MjUuUth-hVFykhkW_UN8fsoAYJVbhf2"><i class="fa fa-youtube-play" aria-hidden="true"></i> <?php echo __('How to Detect File Changes?', 'winter-activity-log'); ?></a></div>'+ 1019 '<div class="alert alert-warning" role="alert"><a target="_blank" href="https://www.youtube.com/watch?v=VWI1WvlQQa8&list=PL0MjUuUth-hVFykhkW_UN8fsoAYJVbhf2"><i class="fa fa-youtube-play" aria-hidden="true"></i> <?php 1020 echo __( 'How to use quick search filtering?', 'winter-activity-log' ); 1021 ?></a></div>'+ 1022 '<div class="alert alert-warning" role="alert"><a target="_blank" href="https://www.youtube.com/watch?v=v8jJcRkEfjI&list=PL0MjUuUth-hVFykhkW_UN8fsoAYJVbhf2"><i class="fa fa-youtube-play" aria-hidden="true"></i> <?php 1023 echo __( 'How to Live Montor with auto refresh and detect login users?', 'winter-activity-log' ); 1024 ?></a></div>'+ 1025 '<div class="alert alert-warning" role="alert"><a target="_blank" href="https://www.youtube.com/watch?v=utDuznzhsHg&list=PL0MjUuUth-hVFykhkW_UN8fsoAYJVbhf2"><i class="fa fa-youtube-play" aria-hidden="true"></i> <?php 1026 echo __( 'How to check Login History and Block Failed Login Attempts?', 'winter-activity-log' ); 1027 ?></a></div>'+ 1028 '<div class="alert alert-warning" role="alert"><a target="_blank" href="https://www.youtube.com/watch?v=bLG_HZrpEX0&list=PL0MjUuUth-hVFykhkW_UN8fsoAYJVbhf2"><i class="fa fa-youtube-play" aria-hidden="true"></i> <?php 1029 echo __( 'How to Block IP, Username, some words in title or any other criteria?', 'winter-activity-log' ); 1030 ?></a></div>'+ 1031 '<div class="alert alert-warning" role="alert"><a target="_blank" href="https://www.youtube.com/watch?v=v9dJ8F9ekVI&list=PL0MjUuUth-hVFykhkW_UN8fsoAYJVbhf2"><i class="fa fa-youtube-play" aria-hidden="true"></i> <?php 1032 echo __( 'How to Log Content Editing and check Revisions?', 'winter-activity-log' ); 1033 ?></a></div>'+ 1034 '<div class="alert alert-warning" role="alert"><a target="_blank" href="https://www.youtube.com/watch?v=rVwcz6pbBWM&list=PL0MjUuUth-hVFykhkW_UN8fsoAYJVbhf2"><i class="fa fa-youtube-play" aria-hidden="true"></i> <?php 1035 echo __( 'How to Detect File Changes?', 'winter-activity-log' ); 1036 ?></a></div>'+ 793 1037 '<iframe width="560" height="315" src="https://www.youtube.com/embed/bLG_HZrpEX0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'+ 794 1038 '</div>', 795 1039 buttons: { 796 1040 cancel: { 797 text: '<?php echo esc_html__('Close', 'winter-activity-log');?>', 1041 text: '<?php 1042 echo esc_html__( 'Close', 'winter-activity-log' ); 1043 ?>', 798 1044 } 799 1045 }, … … 999 1245 </style> 1000 1246 1001 <?php $this->view('general/footer', $data); ?> 1247 <?php 1248 $this->view( 'general/footer', $data ); -
winterlock/trunk/includes/helper-functions.php
r3419393 r3441603 1 1 <?php 2 2 3 // If this file is called directly, abort. 3 if ( ! defined( 'ABSPATH' ) ) { 4 die; 5 } 6 7 8 if ( ! function_exists( 'wal_is_single_or_archive_book' ) ): 9 function wal_is_single_or_archive_book() { 10 return 11 ( 12 is_singular( 'book' ) 13 || 14 wal_is_archive_book() 15 ) 16 ? true 17 : false; 18 19 } 20 endif; 21 22 if ( ! function_exists( 'wal_is_archive_book' ) ): 23 function wal_is_archive_book() { 24 return 25 ( 26 is_post_type_archive( 'book' ) 27 || is_tax( 'genre' ) 28 ) 29 ? true 30 : false; 31 32 } 33 endif; 34 35 if ( ! function_exists( 'wal_get_template_loader' ) ): 36 function wal_get_template_loader() { 37 return Winter_Activity_Log_Global::template_loader(); 38 } 39 endif; 40 41 42 if ( ! function_exists( 'wal_get_column_class' ) ): 43 /** 44 * @param $int int 45 * 46 * @return $css_class string 47 */ 48 function wal_get_column_class( $int ) { 49 50 switch ( $int ) { 51 52 case( 1 ): 53 return 'column-one'; 54 break; 55 case( 2 ): 56 return 'column-two'; 57 break; 58 case( 3 ): 59 return 'column-three'; 60 break; 61 case( 4 ): 62 return 'column-four'; 63 break; 64 case( 5 ): 65 return 'column-five'; 66 break; 67 68 default: 69 return 'column-three'; 70 71 } 72 73 } 74 endif; 75 76 if ( ! function_exists( 'wal_sanitize_color' ) ): 77 function wal_sanitize_color( $value ) { 78 79 if ( false === strpos( $value, 'rgba' ) ) { 80 return sanitize_hex_color( $value ); 81 } else { 82 // By now we know the string is formatted as an rgba color so we need to further sanitize it. 83 84 $value = trim( $value, ' ' ); 85 $red = $green = $blue = $alpha = ''; 86 sscanf( $value, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha ); 87 88 return 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $alpha . ')'; 89 } 90 } 91 endif; 92 93 94 4 if ( !defined( 'ABSPATH' ) ) { 5 die; 6 } 7 if ( !function_exists( 'wal_is_single_or_archive_book' ) ) { 8 function wal_is_single_or_archive_book() { 9 return ( is_singular( 'book' ) || wal_is_archive_book() ? true : false ); 10 } 11 12 } 13 if ( !function_exists( 'wal_is_archive_book' ) ) { 14 function wal_is_archive_book() { 15 return ( is_post_type_archive( 'book' ) || is_tax( 'genre' ) ? true : false ); 16 } 17 18 } 19 if ( !function_exists( 'wal_get_template_loader' ) ) { 20 function wal_get_template_loader() { 21 return Winter_Activity_Log_Global::template_loader(); 22 } 23 24 } 25 if ( !function_exists( 'wal_get_column_class' ) ) { 26 /** 27 * @param $int int 28 * 29 * @return $css_class string 30 */ 31 function wal_get_column_class( $int ) { 32 switch ( $int ) { 33 case 1: 34 return 'column-one'; 35 break; 36 case 2: 37 return 'column-two'; 38 break; 39 case 3: 40 return 'column-three'; 41 break; 42 case 4: 43 return 'column-four'; 44 break; 45 case 5: 46 return 'column-five'; 47 break; 48 default: 49 return 'column-three'; 50 } 51 } 52 53 } 54 if ( !function_exists( 'wal_sanitize_color' ) ) { 55 function wal_sanitize_color( $value ) { 56 if ( false === strpos( $value, 'rgba' ) ) { 57 return sanitize_hex_color( $value ); 58 } else { 59 // By now we know the string is formatted as an rgba color so we need to further sanitize it. 60 $value = trim( $value, ' ' ); 61 $red = $green = $blue = $alpha = ''; 62 sscanf( 63 $value, 64 'rgba(%d,%d,%d,%f)', 65 $red, 66 $green, 67 $blue, 68 $alpha 69 ); 70 return 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $alpha . ')'; 71 } 72 } 73 74 } 95 75 // Display User IP in WordPress 96 97 if ( ! function_exists( 'wal_get_the_user_ip' ) ): 98 function wal_get_the_user_ip() { 99 if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) { 100 //check ip from share internet 101 $ip = $_SERVER['HTTP_CLIENT_IP']; 102 } elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { 103 //to check ip is pass from proxy 104 $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; 105 } else { 106 $ip = $_SERVER['REMOTE_ADDR']; 107 } 108 109 if (filter_var($ip, FILTER_VALIDATE_IP)) { 76 if ( !function_exists( 'wal_get_the_user_ip' ) ) { 77 function wal_get_the_user_ip() { 78 if ( !empty( $_SERVER['HTTP_CLIENT_IP'] ) ) { 79 //check ip from share internet 80 $ip = $_SERVER['HTTP_CLIENT_IP']; 81 } elseif ( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { 82 //to check ip is pass from proxy 83 $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; 84 } else { 85 $ip = $_SERVER['REMOTE_ADDR']; 86 } 87 if ( filter_var( $ip, FILTER_VALIDATE_IP ) ) { 110 88 // $ip is a valid IP address" 111 89 } else { 112 90 return ''; 113 91 } 114 115 return apply_filters( 'wpb_get_ip', $ip ); 116 } 117 endif; 118 119 if ( ! function_exists( 'wal_get_uri' ) ): 120 function wal_get_uri($skip_query_string = FALSE) 121 { 122 $filename = $_SERVER['REQUEST_URI']; 123 $ipos = strpos($filename, "?"); 124 if ( !($ipos === false) && $skip_query_string === TRUE) $filename = substr($filename, 0, $ipos); 125 return urldecode($filename); 126 } 127 endif; 128 129 function wal_post_for_log() 130 { 92 return apply_filters( 'wpb_get_ip', $ip ); 93 } 94 95 } 96 if ( !function_exists( 'wal_get_uri' ) ) { 97 function wal_get_uri( $skip_query_string = FALSE ) { 98 $filename = $_SERVER['REQUEST_URI']; 99 $ipos = strpos( $filename, "?" ); 100 if ( !($ipos === false) && $skip_query_string === TRUE ) { 101 $filename = substr( $filename, 0, $ipos ); 102 } 103 return urldecode( $filename ); 104 } 105 106 } 107 function wal_post_for_log() { 131 108 $log_array = array(); 132 133 foreach($_POST as $key => $val) 134 { 135 if(is_array($val)) 136 { 137 return wal_sen_rec($_POST); 138 } 139 elseif($key == 'content') 140 { 141 $log_array[sanitize_text_field($key)] = wp_kses_post($val); 142 } 143 else 144 { 145 $log_array[sanitize_text_field($key)] = sanitize_text_field($val); 146 } 147 } 148 109 foreach ( $_POST as $key => $val ) { 110 if ( is_array( $val ) ) { 111 return wal_sen_rec( $_POST ); 112 } elseif ( $key == 'content' ) { 113 $log_array[sanitize_text_field( $key )] = wp_kses_post( $val ); 114 } else { 115 $log_array[sanitize_text_field( $key )] = sanitize_text_field( $val ); 116 } 117 } 149 118 return $log_array; 150 119 } 151 120 152 function wal_get_for_log() 153 { 121 function wal_get_for_log() { 154 122 $log_array = array(); 155 156 foreach($_GET as $key => $val) 157 { 158 if(is_array($val)) 159 { 160 return wal_sen_rec($_POST); 161 } 162 elseif($key == 'newcontent' || $key == 'content') 163 { 164 $log_array[sanitize_text_field($key)] = wp_kses_post($val); 165 } 166 else 167 { 168 $log_array[sanitize_text_field($key)] = sanitize_text_field($val); 169 } 170 } 171 123 foreach ( $_GET as $key => $val ) { 124 if ( is_array( $val ) ) { 125 return wal_sen_rec( $_POST ); 126 } elseif ( $key == 'newcontent' || $key == 'content' ) { 127 $log_array[sanitize_text_field( $key )] = wp_kses_post( $val ); 128 } else { 129 $log_array[sanitize_text_field( $key )] = sanitize_text_field( $val ); 130 } 131 } 172 132 return $log_array; 173 133 } 174 134 175 function wal_sen_rec($array) 176 { 135 function wal_sen_rec( $array ) { 177 136 $arr_cleaned = array(); 178 foreach($array as $key=>$val) 179 { 180 if(is_array($val)) 181 { 182 $arr_cleaned[sanitize_text_field($key)] = wal_sen_rec($val); 183 } 184 elseif($key == 'newcontent' || $key == 'content') 185 { 186 $arr_cleaned[sanitize_text_field($key)] = wp_kses_post($val); 187 } 188 else 189 { 190 $arr_cleaned[sanitize_text_field($key)] = sanitize_text_field($val); 191 } 192 193 } 194 137 foreach ( $array as $key => $val ) { 138 if ( is_array( $val ) ) { 139 $arr_cleaned[sanitize_text_field( $key )] = wal_sen_rec( $val ); 140 } elseif ( $key == 'newcontent' || $key == 'content' ) { 141 $arr_cleaned[sanitize_text_field( $key )] = wp_kses_post( $val ); 142 } else { 143 $arr_cleaned[sanitize_text_field( $key )] = sanitize_text_field( $val ); 144 } 145 } 195 146 //dump($arr_cleaned); 196 197 147 return $arr_cleaned; 198 148 } 199 149 200 201 202 if ( ! function_exists('wal_resolve_level')) 203 { 204 function wal_resolve_level($request_uri = NULL, $post = NULL, $get = NULL, $request_method = NULL, $body = NULL, $fixed_level = NULL) 205 { 206 if(!empty($fixed_level)) 207 { 208 return $fixed_level; 209 } 210 211 $level = 1; 212 213 if($request_uri === NULL && $post === NULL && $get === NULL) 214 { 215 $request_uri = wal_get_uri(); 216 $post = wal_post_for_log(); 217 $get = wal_get_for_log(); 218 $request_method = sanitize_text_field($_SERVER['REQUEST_METHOD']); 219 } 220 221 if($request_method == 'POST' && (count($post) > 0 || is_array($body))) 222 $level = 2; 223 224 // standard wp ajax requests defined to level q 225 if( 226 strpos($request_uri, 'admin-ajax.php') === FALSE && 227 strpos($request_uri, 'wp-cron.php') === FALSE && 228 strpos($request_uri, 'wp_scrape_nonce') === FALSE && 229 strpos($request_uri, 'wp-json') === FALSE 230 ) 231 { 232 if(count($post) > 0) 233 $level = 3; 234 } 235 236 // if ajax 237 if(strpos($request_uri, 'admin-ajax.php') !== FALSE) 238 { 239 // action post contain get- 240 if(substr($post['action'], 0, 4) == 'get-') 241 $level = 1; 242 } 243 244 if(strpos($request_uri, 'post-new.php') !== FALSE) 245 { 246 $level = 4; 247 } 248 249 if(strpos($request_uri, 'edit.php') !== FALSE) 250 { 251 $level = 4; 252 } 253 254 if( isset($body['edit_date']) || 255 isset($body['post_type']) || 256 isset($body['post_ID']) || 257 isset($body['post_status']) || 258 isset($body['content']) || 259 isset($post['post_type']) || 260 isset($post['post_ID']) || 261 isset($post['post_status']) || 262 isset($post['edit_date']) || 263 isset($post['content']) ) 264 { 265 $level = 4; 266 } 267 268 if(isset($post['action']) && $post['action'] == 'edit-theme-plugin-file') 269 { 270 $level = 4; 271 } 272 273 if(isset($get['action']) && $get['action'] == 'delete') 274 { 275 $level = 4; 276 } 277 278 if(isset($get['action']) && $get['action'] == 'trash') 279 { 280 $level = 4; 281 } 282 283 if(isset($get['action']) && $get['action'] == 'logout') 284 { 285 $level = 2; 286 } 287 288 if(isset($get['plugin']) || isset($get['deleted']) || isset($get['trashed'])) 289 { 290 $level = 4; 291 } 292 293 return $level; 294 } 295 } 296 297 if ( ! function_exists('wal_generate_label_by_level')) 298 { 299 function wal_generate_label_by_level($level, $message = '') 300 { 301 if(empty($message))$message = $level; 302 303 if($level==1) 304 { 305 return '<span class="label label-default" title="'.__('Most basic activities log, like when someone open some page','winter-activity-log').'">'.$message.'</span>'; 306 } 307 if($level==2) 308 { 309 return '<span class="label label-primary" title="'.__('Something is sent in POST via ajax, sometimes this mean change in database','winter-activity-log').'">'.$message.'</span>'; 310 } 311 if($level==3) 312 { 313 return '<span class="label label-success" title="'.__('Something general is sent in POST to regular page, mostly this mean change in database','winter-activity-log').'">'.$message.'</span>'; 314 } 315 if($level==4) 316 { 317 return '<span class="label label-info" title="'.__('Editing known contents like post, page or similar','winter-activity-log').'">'.$message.'</span>'; 318 } 319 if($level==5) 320 { 321 return '<span class="label label-warning" title="'.__('Critical tasks like FAILED login','winter-activity-log').'">'.$message.'</span>'; 322 } 323 if($level==6) 324 { 325 return '<span class="label label-danger" title="'.__('Very critical tasks like hacking','winter-activity-log').'">'.$message.'</span>'; 326 } 327 328 return $message; 329 } 330 } 331 332 if ( ! function_exists('wal_resolve_wp_menu')) 333 { 334 function wal_resolve_wp_menu($page=NULL, $request_uri=NULL) 335 { 336 global $submenu, $menu, $pagenow; 337 338 $submenu_c = $submenu; 339 $menu_c = $menu; 340 $pagenow_c = $pagenow; 341 342 if(empty($page) && empty($request_uri))return; 343 344 if(!isset($submenu_c)) 345 { 346 $menu_c = get_option( 'winter-activity-log-menuitems' ); 347 $submenu_c = get_option( 'winter-activity-log-submenuitems' ); 348 } 349 350 $text = ''; 351 352 if(is_array($menu_c) && !empty($page)) 353 foreach($menu_c as $key=>$row) 354 { 355 if(in_array($page, $row)) 356 { 357 $text.=$row[0]; 358 } 359 } 360 361 if(is_array($submenu_c) && !empty($page)) 362 foreach($submenu_c as $key=>$row) 363 { 364 foreach($row as $key2=>$row2) 365 { 366 if(in_array($page, $row2)) 367 { 368 if(empty($text)) 369 { 370 $text.=$row2[0]; 371 } 372 else 373 { 374 $text.=' > '.$row2[0]; 375 } 376 } 377 378 } 379 } 380 381 382 383 if(strpos($request_uri, 'wp-admin') !== FALSE) 384 $request_uri = basename($request_uri); 385 386 if(is_array($menu_c) && !empty($request_uri)) 387 foreach($menu_c as $key=>$row) 388 { 389 if(in_array($request_uri, $row)) 390 { 391 if(empty($text)) 392 { 393 $text.=$row[0]; 394 } 395 else 396 { 397 $text.=' > '.$row[0]; 398 } 399 } 400 } 401 402 if(is_array($submenu_c) && !empty($request_uri)) 403 foreach($submenu_c as $key=>$row) 404 { 405 foreach($row as $key2=>$row2) 406 { 407 if(in_array($request_uri, $row2)) 408 { 409 if(empty($text)) 410 { 411 $text.=$row2[0]; 412 } 413 else 414 { 415 $text.=' > '.$row2[0]; 416 } 417 } 418 419 } 420 } 421 422 if(strpos($request_uri, 'post.php') !== FALSE) 423 { 424 if(empty($text)) 425 { 426 $text.='Post'; 427 } 428 else 429 { 430 $text.=' > Post'; 431 } 432 } 433 434 if(strpos($request_uri, 'plugins.php') !== FALSE) 435 { 436 if(empty($text)) 437 { 438 $text.='Plugins'; 439 } 440 else 441 { 442 $text.=' > Plugins'; 443 } 444 } 445 446 if(strpos($request_uri, 'post-new.php') !== FALSE) 447 { 448 if(empty($text)) 449 { 450 $text.='Post Created'; 451 } 452 else 453 { 454 $text.=' > Post Created'; 455 } 456 } 457 458 if(strpos($request_uri, 'edit.php') !== FALSE && strpos($request_uri, 'trashed') !== FALSE) 459 { 460 if(empty($text)) 461 { 462 $text.='Post'; 463 } 464 else 465 { 466 $text.=' > Post'; 467 } 468 } 469 470 if(strpos($request_uri, 'edit.php') !== FALSE && strpos($request_uri, 'deleted') !== FALSE) 471 { 472 if(empty($text)) 473 { 474 $text.='Post'; 475 } 476 else 477 { 478 $text.=' > Post'; 479 } 480 } 481 482 if(strpos($request_uri, 'edit.php') !== FALSE && strpos($request_uri, 'post_status') !== FALSE) 483 { 484 if(empty($text)) 485 { 486 $text.='Edit Post'; 487 } 488 else 489 { 490 $text.=' > Edit Post'; 491 } 492 } 493 494 if(!empty($text))return $text; 495 496 497 if(strpos($request_uri, 'admin-ajax.php') !== FALSE) 498 { 499 return 'Ajax request'; 500 } 501 502 if(strpos($request_uri, 'wp-cron.php') !== FALSE) 503 { 504 return 'WP Cron'; 505 } 506 507 if(strpos($request_uri, 'wp_scrape_nonce') !== FALSE) 508 { 509 return 'WP Scraping'; 510 } 511 512 if(strpos($request_uri, 'wp-json') !== FALSE) 513 { 514 return 'WP JSON'; 515 } 516 517 if(strpos($request_uri, 'post.php?') !== FALSE) 518 { 519 return 'Edit post/page'; 520 } 521 522 if(strpos($request_uri, 'wp-login.php') !== FALSE) 523 { 524 return 'wp-login.php'; 525 } 526 527 if(strpos($request_uri, 'options.php') !== FALSE) 528 { 529 return 'WP Options'; 530 } 531 532 533 534 return $request_uri; 535 } 536 } 537 538 function wal_generate_description($row, $failed_login = false) 539 { 540 $desc = ''; 541 542 $desc .= wal_resolve_wp_menu($row['page'], $row['request_uri']); 543 544 if(!empty($row['action'])) 545 $desc .= ' > '.$row['action']; 546 547 548 //check for "function" query string 549 $request_data = unserialize($row['request_data']); 550 551 if(isset($request_data['GET']['function'])) 552 { 553 $desc .= ' > '.$request_data['GET']['function']; 554 } 555 556 if(isset($request_data['GET']['trashed'])) 557 { 558 $desc .= ' > Trashed'; 559 } 560 561 if(isset($request_data['GET']['deleted'])) 562 { 563 $desc .= ' > Deleted'; 564 } 565 566 if(isset($request_data['POST']['post_ID'])) 567 { 568 $post_link = get_edit_post_link($request_data['POST']['post_ID']); 569 570 $post_title = ''; 571 if(isset($request_data['POST']['post_title'])) 572 $post_title = ' ('.$request_data['POST']['post_title'].')'; 573 574 $desc .= ' > '."Editing post with ID: <a target=\"_blank\" href=\"$post_link\">".$request_data['POST']['post_ID'].$post_title.'</a>'; 575 } 576 577 $other_data = unserialize($row['other_data']); 578 if(isset($other_data['post_revision_id'])) 579 { 580 $revision_link = get_admin_url().'revision.php?revision='.$other_data['post_revision_id']; 581 582 $desc .= ' > '.'Post revision: <a target="_blank" href="'.$revision_link.'">'.$other_data['post_revision_id'].'</a>'; 583 } 584 585 if($row['action'] == 'edit-theme-plugin-file') 586 { 587 if(isset($request_data['POST']['file'])) 588 { 589 $desc .= ' > '.'File: '.$request_data['POST']['file']; 590 } 591 } 592 593 if(isset($request_data['GET']['plugin'])) 594 { 595 $desc .= ' > Plugin: '.$request_data['GET']['plugin']; 596 } 597 598 if( (strpos($row['request_uri'], 'wp-login.php') !== FALSE || $row['action'] == 'wordfence_ls_authenticate') && isset($request_data['POST']['pwd'])) 599 { 600 601 if($failed_login) 602 { 603 $desc = 'FAILED Login with data'; 604 } 605 else 606 { 607 $desc = 'Login with data'; 608 } 609 610 if(isset($request_data['POST']['log'])) 611 $desc .= ' > Username: '.$request_data['POST']['log']; 612 } 613 614 if(isset($request_data['GET']['post_type'])) 615 { 616 $desc .= ' > Post Type: '.$request_data['GET']['post_type']; 617 } 618 619 if(isset($request_data['GET']['post_status'])) 620 { 621 $desc .= ' > Post status: '.$request_data['GET']['post_status']; 622 } 623 624 if(isset($request_data['GET']['ids'])) 625 { 626 $desc .= ' > Ids: '.$request_data['GET']['ids']; 627 } 628 629 if(isset($request_data['GET']['post']) && is_numeric($request_data['GET']['post'])) 630 { 631 $desc .= ' > Post ID: '.$request_data['GET']['post']; 632 } 633 634 if(isset($request_data['GET']['loggedout'])) 635 { 636 $desc .= ' > Logged Out: '.$request_data['GET']['loggedout']; 637 } 638 639 640 //$desc .= $row->request_uri; 641 642 643 return $desc; 644 } 645 646 if ( ! function_exists('wal_visitor_type')) 647 { 648 function wal_visitor_type($page=NULL, $request_uri=NULL, $user_agent = NULL) 649 { 650 if(empty($page) && empty($request_uri))return NULL; 651 652 if(strpos($request_uri, 'wp-cron.php') !== FALSE) 653 { 654 return 'system'; 655 } 656 657 if(strpos($request_uri, 'wp_scrape_nonce') !== FALSE) 658 { 659 return 'system'; 660 } 661 662 if($user_agent !== NULL) 663 { 664 $obj = new Winter_Activity_Log_BrowserDetector($user_agent); 665 666 $info = $obj->detect()->getBrowser(); 667 668 if(!empty($info)) 669 return 'guest'; 670 } 671 672 673 return 'unknown'; 674 } 675 } 676 677 function wal_basic_user_info($user_id) 678 { 679 $user_info = get_userdata($user_id); 680 681 $text = ''; 682 683 if(isset($user_info->user_login)) 684 $text = "#$user_info->ID <a target=\"_blank\" href=\"".admin_url('user-edit.php?user_id='.$user_info->ID)."\">$user_info->user_login</a> <br /> ".implode(', ', $user_info->roles) . " "; 685 686 if(empty($text)) 687 { 688 $text = 'IP: '.wal_get_the_user_ip(); 689 } 690 691 return $text; 692 } 693 694 function wal_user_info($user_id, $header_data = array(), $page=NULL, $request_uri=NULL) 695 { 696 $user_info = get_userdata($user_id); 697 698 $text = ''; 699 700 if(isset($user_info->user_login)) 701 $text = "#$user_info->ID <a target=\"_blank\" href=\"".admin_url('user-edit.php?user_id='.$user_info->ID)."\">$user_info->user_login</a> <br /> ".implode(', ', $user_info->roles) . " "; 702 703 $user_agent = NULL; 704 if(!empty($header_data["User-Agent"])) 705 { 706 $user_agent = $header_data["User-Agent"]; 707 } 708 709 710 if(empty($text)) 711 { 712 $text = '-'; 713 } 714 715 if(isset($user_info->ID)) 716 { 717 718 } 719 elseif(wal_visitor_type($page, $request_uri, $user_agent ) === 'system') 720 { 721 $text = 'System'; 722 } 723 elseif(wal_visitor_type($page, $request_uri, $user_agent ) === 'guest') 724 { 725 $text = 'Guest'; 726 727 } 728 elseif(wal_visitor_type($page, $request_uri, $user_agent ) === 'unknown') 729 { 730 $text = 'Not logged in'; 731 } 732 733 return $text; 734 } 735 736 function &wal_get_instance() 737 { 738 global $Winter_MVC; 739 740 return $Winter_MVC; 741 } 742 743 if ( ! function_exists('wal_prepare_search_query_GET')) 744 { 745 function wal_prepare_search_query_GET($columns = array(), $model_name = NULL, $external_columns = array()) 746 { 747 $CI = &wal_get_instance(); 748 $search_par = array_merge(wal_get_for_log(), wal_post_for_log()); 749 $search_par = wmvc_xss_clean($search_par); 750 150 if ( !function_exists( 'wal_resolve_level' ) ) { 151 function wal_resolve_level( 152 $request_uri = NULL, 153 $post = NULL, 154 $get = NULL, 155 $request_method = NULL, 156 $body = NULL, 157 $fixed_level = NULL 158 ) { 159 if ( !empty( $fixed_level ) ) { 160 return $fixed_level; 161 } 162 $level = 1; 163 if ( $request_uri === NULL && $post === NULL && $get === NULL ) { 164 $request_uri = wal_get_uri(); 165 $post = wal_post_for_log(); 166 $get = wal_get_for_log(); 167 $request_method = sanitize_text_field( $_SERVER['REQUEST_METHOD'] ); 168 } 169 if ( $request_method == 'POST' && (count( $post ) > 0 || is_array( $body )) ) { 170 $level = 2; 171 } 172 // standard wp ajax requests defined to level q 173 if ( strpos( $request_uri, 'admin-ajax.php' ) === FALSE && strpos( $request_uri, 'wp-cron.php' ) === FALSE && strpos( $request_uri, 'wp_scrape_nonce' ) === FALSE && strpos( $request_uri, 'wp-json' ) === FALSE ) { 174 if ( count( $post ) > 0 ) { 175 $level = 3; 176 } 177 } 178 // if ajax 179 if ( strpos( $request_uri, 'admin-ajax.php' ) !== FALSE ) { 180 // action post contain get- 181 if ( substr( $post['action'], 0, 4 ) == 'get-' ) { 182 $level = 1; 183 } 184 } 185 if ( strpos( $request_uri, 'post-new.php' ) !== FALSE ) { 186 $level = 4; 187 } 188 if ( strpos( $request_uri, 'edit.php' ) !== FALSE ) { 189 $level = 4; 190 } 191 if ( isset( $body['edit_date'] ) || isset( $body['post_type'] ) || isset( $body['post_ID'] ) || isset( $body['post_status'] ) || isset( $body['content'] ) || isset( $post['post_type'] ) || isset( $post['post_ID'] ) || isset( $post['post_status'] ) || isset( $post['edit_date'] ) || isset( $post['content'] ) ) { 192 $level = 4; 193 } 194 if ( isset( $post['action'] ) && $post['action'] == 'edit-theme-plugin-file' ) { 195 $level = 4; 196 } 197 if ( isset( $get['action'] ) && $get['action'] == 'delete' ) { 198 $level = 4; 199 } 200 if ( isset( $get['action'] ) && $get['action'] == 'trash' ) { 201 $level = 4; 202 } 203 if ( isset( $get['action'] ) && $get['action'] == 'logout' ) { 204 $level = 2; 205 } 206 if ( isset( $get['plugin'] ) || isset( $get['deleted'] ) || isset( $get['trashed'] ) ) { 207 $level = 4; 208 } 209 return $level; 210 } 211 212 } 213 if ( !function_exists( 'wal_generate_label_by_level' ) ) { 214 function wal_generate_label_by_level( $level, $message = '' ) { 215 if ( empty( $message ) ) { 216 $message = $level; 217 } 218 if ( $level == 1 ) { 219 return '<span class="label label-default" title="' . __( 'Most basic activities log, like when someone open some page', 'winter-activity-log' ) . '">' . $message . '</span>'; 220 } 221 if ( $level == 2 ) { 222 return '<span class="label label-primary" title="' . __( 'Something is sent in POST via ajax, sometimes this mean change in database', 'winter-activity-log' ) . '">' . $message . '</span>'; 223 } 224 if ( $level == 3 ) { 225 return '<span class="label label-success" title="' . __( 'Something general is sent in POST to regular page, mostly this mean change in database', 'winter-activity-log' ) . '">' . $message . '</span>'; 226 } 227 if ( $level == 4 ) { 228 return '<span class="label label-info" title="' . __( 'Editing known contents like post, page or similar', 'winter-activity-log' ) . '">' . $message . '</span>'; 229 } 230 if ( $level == 5 ) { 231 return '<span class="label label-warning" title="' . __( 'Critical tasks like FAILED login', 'winter-activity-log' ) . '">' . $message . '</span>'; 232 } 233 if ( $level == 6 ) { 234 return '<span class="label label-danger" title="' . __( 'Very critical tasks like hacking', 'winter-activity-log' ) . '">' . $message . '</span>'; 235 } 236 return $message; 237 } 238 239 } 240 if ( !function_exists( 'wal_resolve_wp_menu' ) ) { 241 function wal_resolve_wp_menu( $page = NULL, $request_uri = NULL ) { 242 global $submenu, $menu, $pagenow; 243 $submenu_c = $submenu; 244 $menu_c = $menu; 245 $pagenow_c = $pagenow; 246 if ( empty( $page ) && empty( $request_uri ) ) { 247 return; 248 } 249 if ( !isset( $submenu_c ) ) { 250 $menu_c = get_option( 'winter-activity-log-menuitems' ); 251 $submenu_c = get_option( 'winter-activity-log-submenuitems' ); 252 } 253 $text = ''; 254 if ( is_array( $menu_c ) && !empty( $page ) ) { 255 foreach ( $menu_c as $key => $row ) { 256 if ( in_array( $page, $row ) ) { 257 $text .= $row[0]; 258 } 259 } 260 } 261 if ( is_array( $submenu_c ) && !empty( $page ) ) { 262 foreach ( $submenu_c as $key => $row ) { 263 foreach ( $row as $key2 => $row2 ) { 264 if ( in_array( $page, $row2 ) ) { 265 if ( empty( $text ) ) { 266 $text .= $row2[0]; 267 } else { 268 $text .= ' > ' . $row2[0]; 269 } 270 } 271 } 272 } 273 } 274 if ( strpos( $request_uri, 'wp-admin' ) !== FALSE ) { 275 $request_uri = basename( $request_uri ); 276 } 277 if ( is_array( $menu_c ) && !empty( $request_uri ) ) { 278 foreach ( $menu_c as $key => $row ) { 279 if ( in_array( $request_uri, $row ) ) { 280 if ( empty( $text ) ) { 281 $text .= $row[0]; 282 } else { 283 $text .= ' > ' . $row[0]; 284 } 285 } 286 } 287 } 288 if ( is_array( $submenu_c ) && !empty( $request_uri ) ) { 289 foreach ( $submenu_c as $key => $row ) { 290 foreach ( $row as $key2 => $row2 ) { 291 if ( in_array( $request_uri, $row2 ) ) { 292 if ( empty( $text ) ) { 293 $text .= $row2[0]; 294 } else { 295 $text .= ' > ' . $row2[0]; 296 } 297 } 298 } 299 } 300 } 301 if ( strpos( $request_uri, 'post.php' ) !== FALSE ) { 302 if ( empty( $text ) ) { 303 $text .= 'Post'; 304 } else { 305 $text .= ' > Post'; 306 } 307 } 308 if ( strpos( $request_uri, 'plugins.php' ) !== FALSE ) { 309 if ( empty( $text ) ) { 310 $text .= 'Plugins'; 311 } else { 312 $text .= ' > Plugins'; 313 } 314 } 315 if ( strpos( $request_uri, 'post-new.php' ) !== FALSE ) { 316 if ( empty( $text ) ) { 317 $text .= 'Post Created'; 318 } else { 319 $text .= ' > Post Created'; 320 } 321 } 322 if ( strpos( $request_uri, 'edit.php' ) !== FALSE && strpos( $request_uri, 'trashed' ) !== FALSE ) { 323 if ( empty( $text ) ) { 324 $text .= 'Post'; 325 } else { 326 $text .= ' > Post'; 327 } 328 } 329 if ( strpos( $request_uri, 'edit.php' ) !== FALSE && strpos( $request_uri, 'deleted' ) !== FALSE ) { 330 if ( empty( $text ) ) { 331 $text .= 'Post'; 332 } else { 333 $text .= ' > Post'; 334 } 335 } 336 if ( strpos( $request_uri, 'edit.php' ) !== FALSE && strpos( $request_uri, 'post_status' ) !== FALSE ) { 337 if ( empty( $text ) ) { 338 $text .= 'Edit Post'; 339 } else { 340 $text .= ' > Edit Post'; 341 } 342 } 343 if ( !empty( $text ) ) { 344 return $text; 345 } 346 if ( strpos( $request_uri, 'admin-ajax.php' ) !== FALSE ) { 347 return 'Ajax request'; 348 } 349 if ( strpos( $request_uri, 'wp-cron.php' ) !== FALSE ) { 350 return 'WP Cron'; 351 } 352 if ( strpos( $request_uri, 'wp_scrape_nonce' ) !== FALSE ) { 353 return 'WP Scraping'; 354 } 355 if ( strpos( $request_uri, 'wp-json' ) !== FALSE ) { 356 return 'WP JSON'; 357 } 358 if ( strpos( $request_uri, 'post.php?' ) !== FALSE ) { 359 return 'Edit post/page'; 360 } 361 if ( strpos( $request_uri, 'wp-login.php' ) !== FALSE ) { 362 return 'wp-login.php'; 363 } 364 if ( strpos( $request_uri, 'options.php' ) !== FALSE ) { 365 return 'WP Options'; 366 } 367 return $request_uri; 368 } 369 370 } 371 function wal_generate_description( $row, $failed_login = false ) { 372 $desc = ''; 373 $desc .= wal_resolve_wp_menu( $row['page'], $row['request_uri'] ); 374 if ( !empty( $row['action'] ) ) { 375 $desc .= ' > ' . $row['action']; 376 } 377 //check for "function" query string 378 $request_data = unserialize( $row['request_data'] ); 379 if ( isset( $request_data['GET']['function'] ) ) { 380 $desc .= ' > ' . $request_data['GET']['function']; 381 } 382 if ( isset( $request_data['GET']['trashed'] ) ) { 383 $desc .= ' > Trashed'; 384 } 385 if ( isset( $request_data['GET']['deleted'] ) ) { 386 $desc .= ' > Deleted'; 387 } 388 if ( isset( $request_data['POST']['post_ID'] ) ) { 389 $post_link = get_edit_post_link( $request_data['POST']['post_ID'] ); 390 $post_title = ''; 391 if ( isset( $request_data['POST']['post_title'] ) ) { 392 $post_title = ' (' . $request_data['POST']['post_title'] . ')'; 393 } 394 $desc .= ' > ' . "Editing post with ID: <a target=\"_blank\" href=\"{$post_link}\">" . $request_data['POST']['post_ID'] . $post_title . '</a>'; 395 } 396 $other_data = unserialize( $row['other_data'] ); 397 if ( isset( $other_data['post_revision_id'] ) ) { 398 $revision_link = get_admin_url() . 'revision.php?revision=' . $other_data['post_revision_id']; 399 $desc .= ' > ' . 'Post revision: <a target="_blank" href="' . $revision_link . '">' . $other_data['post_revision_id'] . '</a>'; 400 } 401 if ( $row['action'] == 'edit-theme-plugin-file' ) { 402 if ( isset( $request_data['POST']['file'] ) ) { 403 $desc .= ' > ' . 'File: ' . $request_data['POST']['file']; 404 } 405 } 406 if ( isset( $request_data['GET']['plugin'] ) ) { 407 $desc .= ' > Plugin: ' . $request_data['GET']['plugin']; 408 } 409 if ( (strpos( $row['request_uri'], 'wp-login.php' ) !== FALSE || $row['action'] == 'wordfence_ls_authenticate') && isset( $request_data['POST']['pwd'] ) ) { 410 if ( $failed_login ) { 411 $desc = 'FAILED Login with data'; 412 } else { 413 $desc = 'Login with data'; 414 } 415 if ( isset( $request_data['POST']['log'] ) ) { 416 $desc .= ' > Username: ' . $request_data['POST']['log']; 417 } 418 } 419 if ( isset( $request_data['GET']['post_type'] ) ) { 420 $desc .= ' > Post Type: ' . $request_data['GET']['post_type']; 421 } 422 if ( isset( $request_data['GET']['post_status'] ) ) { 423 $desc .= ' > Post status: ' . $request_data['GET']['post_status']; 424 } 425 if ( isset( $request_data['GET']['ids'] ) ) { 426 $desc .= ' > Ids: ' . $request_data['GET']['ids']; 427 } 428 if ( isset( $request_data['GET']['post'] ) && is_numeric( $request_data['GET']['post'] ) ) { 429 $desc .= ' > Post ID: ' . $request_data['GET']['post']; 430 } 431 if ( isset( $request_data['GET']['loggedout'] ) ) { 432 $desc .= ' > Logged Out: ' . $request_data['GET']['loggedout']; 433 } 434 //$desc .= $row->request_uri; 435 return $desc; 436 } 437 438 if ( !function_exists( 'wal_visitor_type' ) ) { 439 function wal_visitor_type( $page = NULL, $request_uri = NULL, $user_agent = NULL ) { 440 if ( empty( $page ) && empty( $request_uri ) ) { 441 return NULL; 442 } 443 if ( strpos( $request_uri, 'wp-cron.php' ) !== FALSE ) { 444 return 'system'; 445 } 446 if ( strpos( $request_uri, 'wp_scrape_nonce' ) !== FALSE ) { 447 return 'system'; 448 } 449 if ( $user_agent !== NULL ) { 450 $obj = new Winter_Activity_Log_BrowserDetector($user_agent); 451 $info = $obj->detect()->getBrowser(); 452 if ( !empty( $info ) ) { 453 return 'guest'; 454 } 455 } 456 return 'unknown'; 457 } 458 459 } 460 function wal_basic_user_info( $user_id ) { 461 $user_info = get_userdata( $user_id ); 462 $text = ''; 463 if ( isset( $user_info->user_login ) ) { 464 $text = "#{$user_info->ID} <a target=\"_blank\" href=\"" . admin_url( 'user-edit.php?user_id=' . $user_info->ID ) . "\">{$user_info->user_login}</a> <br /> " . implode( ', ', $user_info->roles ) . " "; 465 } 466 if ( empty( $text ) ) { 467 $text = 'IP: ' . wal_get_the_user_ip(); 468 } 469 return $text; 470 } 471 472 function wal_user_info( 473 $user_id, 474 $header_data = array(), 475 $page = NULL, 476 $request_uri = NULL 477 ) { 478 $user_info = get_userdata( $user_id ); 479 $text = ''; 480 if ( isset( $user_info->user_login ) ) { 481 $text = "#{$user_info->ID} <a target=\"_blank\" href=\"" . admin_url( 'user-edit.php?user_id=' . $user_info->ID ) . "\">{$user_info->user_login}</a> <br /> " . implode( ', ', $user_info->roles ) . " "; 482 } 483 $user_agent = NULL; 484 if ( !empty( $header_data["User-Agent"] ) ) { 485 $user_agent = $header_data["User-Agent"]; 486 } 487 if ( empty( $text ) ) { 488 $text = '-'; 489 } 490 if ( isset( $user_info->ID ) ) { 491 } elseif ( wal_visitor_type( $page, $request_uri, $user_agent ) === 'system' ) { 492 $text = 'System'; 493 } elseif ( wal_visitor_type( $page, $request_uri, $user_agent ) === 'guest' ) { 494 $text = 'Guest'; 495 } elseif ( wal_visitor_type( $page, $request_uri, $user_agent ) === 'unknown' ) { 496 $text = 'Not logged in'; 497 } 498 return $text; 499 } 500 501 function &wal_get_instance() { 502 global $Winter_MVC; 503 return $Winter_MVC; 504 } 505 506 if ( !function_exists( 'wal_prepare_search_query_GET' ) ) { 507 function wal_prepare_search_query_GET( $columns = array(), $model_name = NULL, $external_columns = array() ) { 508 $CI =& wal_get_instance(); 509 $search_par = array_merge( wal_get_for_log(), wal_post_for_log() ); 510 $search_par = wmvc_xss_clean( $search_par ); 751 511 $smart_search = ''; 752 if(isset($search_par['search'])) 753 $smart_search = sanitize_text_field($search_par['search']['value']); 754 755 $available_fields = $CI->$model_name->get_available_fields(); 756 757 //$table_name = substr($model_name, 0, -2); 758 512 if ( isset( $search_par['search'] ) ) { 513 $smart_search = sanitize_text_field( $search_par['search']['value'] ); 514 } 515 $available_fields = $CI->{$model_name}->get_available_fields(); 516 //$table_name = substr($model_name, 0, -2); 759 517 $columns_original = array(); 760 foreach($columns as $key=>$val) 761 { 518 foreach ( $columns as $key => $val ) { 762 519 $columns_original[$val] = $val; 763 764 520 // if column contain also "table_name.*" 765 $splited = explode( '.', $val);766 if (wmvc_count($splited) == 2)521 $splited = explode( '.', $val ); 522 if ( wmvc_count( $splited ) == 2 ) { 767 523 $val = $splited[1]; 768 769 if(isset($available_fields[$val])) 770 { 771 772 } 773 else 774 { 775 if(!in_array($columns[$key], $external_columns)) 776 { 524 } 525 if ( isset( $available_fields[$val] ) ) { 526 } else { 527 if ( !in_array( $columns[$key], $external_columns ) ) { 777 528 unset($columns[$key]); 778 529 } 779 530 } 780 531 } 781 782 if(wmvc_count($search_par) > 0) 783 { 532 if ( wmvc_count( $search_par ) > 0 ) { 784 533 unset($search_par['search']); 785 786 534 // For quick/smart search 787 if(wmvc_count($columns) > 0 && !empty($smart_search)) 788 { 535 if ( wmvc_count( $columns ) > 0 && !empty( $smart_search ) ) { 789 536 $gen_q = ''; 790 foreach($columns as $key=>$value) 791 { 792 $value = sanitize_text_field($value); 793 794 if(substr_count($value, 'id') > 0 && is_numeric($smart_search)) 795 { 796 $gen_q.="$value = $smart_search OR "; 537 foreach ( $columns as $key => $value ) { 538 $value = sanitize_text_field( $value ); 539 if ( substr_count( $value, 'id' ) > 0 && is_numeric( $smart_search ) ) { 540 $gen_q .= "{$value} = {$smart_search} OR "; 541 } else { 542 if ( substr_count( $value, 'date' ) > 0 ) { 543 //$gen_search = wmvc_generate_slug($smart_search, ' '); 544 $gen_q .= "{$value} LIKE '%{$smart_search}%' OR "; 545 } else { 546 $gen_q .= "{$value} LIKE '%{$smart_search}%' OR "; 547 } 797 548 } 798 else if(substr_count($value, 'date') > 0) 799 { 800 //$gen_search = wmvc_generate_slug($smart_search, ' '); 801 802 $gen_q.="$value LIKE '%$smart_search%' OR "; 803 } 804 else 805 { 806 $gen_q.="$value LIKE '%$smart_search%' OR "; 807 } 808 } 809 $gen_q = substr($gen_q, 0, -4); 810 811 if(!empty($gen_q)) 812 $CI->db->where("($gen_q)"); 813 } 814 549 } 550 $gen_q = substr( $gen_q, 0, -4 ); 551 if ( !empty( $gen_q ) ) { 552 $CI->db->where( "({$gen_q})" ); 553 } 554 } 815 555 // For column search 816 if(isset($search_par['columns'])) 817 { 556 if ( isset( $search_par['columns'] ) ) { 818 557 $gen_q = ''; 819 820 558 //var_dump($search_par['columns']); 821 822 foreach($search_par['columns'] as $key=>$row) 823 { 824 825 if(!empty($row['search']['value'])) 826 if(isset($row['data']) && !empty($row['data']) && in_array($row['data'], $columns)) 827 { 828 829 $col_name = sanitize_text_field($columns[$key]); 830 if(isset($row['data'])) 831 $col_name = sanitize_text_field($row['data']); 832 833 if(substr_count($row['data'], 'id') > 0 && is_numeric($row['search']['value'])) 834 { 835 // ID is always numeric 836 837 $gen_q.=$col_name." = ".sanitize_text_field($row['search']['value'])." AND "; 838 } 839 else if(substr_count($row['data'], 'date') > 0) 840 { 841 // DATE VALUES 842 843 $gen_search = $row['search']['value']; 844 845 $detect_date = strtotime($gen_search); 846 847 if(is_numeric($detect_date) && $detect_date > 1000) 848 { 849 $gen_search = date('Y-m-d H:i:s', $detect_date); 850 $gen_q.=$col_name." > '".$gen_search."' AND "; 851 } 852 else 853 { 854 $gen_q.=$col_name." LIKE '%".$gen_search."%' AND "; 855 } 856 } 857 else if(substr_count($row['data'], 'is_') > 0) 858 { 859 // CHECKBOXES 860 861 if($row['search']['value']=='on') 862 { 863 $gen_search = 1; 864 $gen_q.=$col_name." LIKE '%".$gen_search."%' AND "; 559 foreach ( $search_par['columns'] as $key => $row ) { 560 if ( !empty( $row['search']['value'] ) ) { 561 if ( isset( $row['data'] ) && !empty( $row['data'] ) && in_array( $row['data'], $columns ) ) { 562 $col_name = sanitize_text_field( $columns[$key] ); 563 if ( isset( $row['data'] ) ) { 564 $col_name = sanitize_text_field( $row['data'] ); 865 565 } 866 else if($row['search']['value']=='off') 867 { 868 $gen_q.=$col_name." IS NULL AND "; 566 if ( substr_count( $row['data'], 'id' ) > 0 && is_numeric( $row['search']['value'] ) ) { 567 // ID is always numeric 568 $gen_q .= $col_name . " = " . sanitize_text_field( $row['search']['value'] ) . " AND "; 569 } else { 570 if ( substr_count( $row['data'], 'date' ) > 0 ) { 571 // DATE VALUES 572 $gen_search = $row['search']['value']; 573 $detect_date = strtotime( $gen_search ); 574 if ( is_numeric( $detect_date ) && $detect_date > 1000 ) { 575 $gen_search = date( 'Y-m-d H:i:s', $detect_date ); 576 $gen_q .= $col_name . " > '" . $gen_search . "' AND "; 577 } else { 578 $gen_q .= $col_name . " LIKE '%" . $gen_search . "%' AND "; 579 } 580 } else { 581 if ( substr_count( $row['data'], 'is_' ) > 0 ) { 582 // CHECKBOXES 583 if ( $row['search']['value'] == 'on' ) { 584 $gen_search = 1; 585 $gen_q .= $col_name . " LIKE '%" . $gen_search . "%' AND "; 586 } else { 587 if ( $row['search']['value'] == 'off' ) { 588 $gen_q .= $col_name . " IS NULL AND "; 589 } 590 } 591 } else { 592 $gen_q .= $col_name . " LIKE '%" . sanitize_text_field( $row['search']['value'] ) . "%' AND "; 593 } 594 } 869 595 } 870 596 } 871 else872 {873 $gen_q.=$col_name." LIKE '%".sanitize_text_field($row['search']['value'])."%' AND ";874 }875 597 } 876 877 } 878 879 $gen_q = substr($gen_q, 0, -5); 880 881 if(!empty($gen_q)) 882 $CI->db->where("($gen_q)"); 883 } 884 885 886 // order 887 888 /* 889 ["order"]=> 890 array(1) { 891 [0]=> 892 array(2) { 893 ["column"]=> 894 string(1) "0" 895 ["dir"]=> 896 string(4) "desc" 897 } 898 } 899 */ 900 901 if(isset($search_par['order'])) 902 { 903 foreach($search_par['order'] as $order_row) 904 { 905 $CI->db->order_by(sanitize_sql_orderby($columns[$order_row['column']].' '.$order_row['dir'])); 906 } 907 } 908 909 } 910 } 911 } 912 913 598 } 599 $gen_q = substr( $gen_q, 0, -5 ); 600 if ( !empty( $gen_q ) ) { 601 $CI->db->where( "({$gen_q})" ); 602 } 603 } 604 // order 605 /* 606 ["order"]=> 607 array(1) { 608 [0]=> 609 array(2) { 610 ["column"]=> 611 string(1) "0" 612 ["dir"]=> 613 string(4) "desc" 614 } 615 } 616 */ 617 if ( isset( $search_par['order'] ) ) { 618 foreach ( $search_par['order'] as $order_row ) { 619 $CI->db->order_by( sanitize_sql_orderby( $columns[$order_row['column']] . ' ' . $order_row['dir'] ) ); 620 } 621 } 622 } 623 } 624 625 } 914 626 # replace PAPERTRAIL_HOSTNAME and PAPERTRAIL_PORT 915 627 # see http://help.papertrailapp.com/ for additional PHP syslog options 916 917 function wal_send_remote_syslog($PAPERTRAIL_HOSTNAME, $PAPERTRAIL_PORT, $message, $component = "web", $program = "next_big_thing") 918 { 919 if(!function_exists('socket_create'))return; 920 921 $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); 922 foreach(explode("\n", $message) as $line) { 923 $syslog_message = "<22>" . date('M d H:i:s ') . $program . ' ' . $component . ': ' . $line; 924 $ret = socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, $PAPERTRAIL_HOSTNAME, $PAPERTRAIL_PORT); 925 926 //if($ret === FALSE) 927 // echo "error: " . socket_strerror(socket_last_error($sock)) . "\n"; 928 } 929 socket_close($sock); 930 } 931 628 function wal_send_remote_syslog( 629 $PAPERTRAIL_HOSTNAME, 630 $PAPERTRAIL_PORT, 631 $message, 632 $component = "web", 633 $program = "next_big_thing" 634 ) { 635 if ( !function_exists( 'socket_create' ) ) { 636 return; 637 } 638 $sock = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP ); 639 foreach ( explode( "\n", $message ) as $line ) { 640 $syslog_message = "<22>" . date( 'M d H:i:s ' ) . $program . ' ' . $component . ': ' . $line; 641 $ret = socket_sendto( 642 $sock, 643 $syslog_message, 644 strlen( $syslog_message ), 645 0, 646 $PAPERTRAIL_HOSTNAME, 647 $PAPERTRAIL_PORT 648 ); 649 //if($ret === FALSE) 650 // echo "error: " . socket_strerror(socket_last_error($sock)) . "\n"; 651 } 652 socket_close( $sock ); 653 } 654 932 655 # send_remote_syslog("Test"); 933 656 # send_remote_syslog("Any log message"); 934 657 # send_remote_syslog("Something just happened", "other-component"); 935 658 # send_remote_syslog("Something just happened", "a-background-job-name", "whatever-app-name"); 936 937 function wal_remotedb_log($row_cloud, $log_message, $insert_array) 938 { 939 global $wpdb; 940 941 942 $servername = $row_cloud->host.':'.$row_cloud->port; 943 $username = $row_cloud->database_username; 944 $password = $row_cloud->database_password; 945 $dbname = $row_cloud->database_name; 946 947 // Create connection 948 $conn = mysqli_connect($servername, $username, $password, $dbname); 949 950 // Check connection 951 if (!$conn) { 952 //die("Connection failed: " . mysqli_connect_error()); 953 954 return; 955 } 956 957 // sql to create table 958 959 $table_name = $row_cloud->database_tablename; 960 961 $charset_collate = $wpdb->get_charset_collate(); 962 963 $sql = "CREATE TABLE IF NOT EXISTS $table_name ( 964 `idlog` int(11) NOT NULL AUTO_INCREMENT, 965 `level` int(11) DEFAULT NULL, 966 `date` datetime DEFAULT NULL, 967 `user_id` int(11) DEFAULT NULL, 968 `user_info`text COLLATE utf8_unicode_ci, 969 `ip` varchar(160) COLLATE utf8_unicode_ci NULL, 970 `page` varchar(160) COLLATE utf8_unicode_ci NULL, 971 `request_uri` varchar(160) COLLATE utf8_unicode_ci NULL, 972 `action` varchar(160) COLLATE utf8_unicode_ci DEFAULT NULL, 973 `is_favourite` tinyint(1) DEFAULT NULL, 974 `request_data` longtext COLLATE utf8_unicode_ci, 975 `header_data` text COLLATE utf8_unicode_ci, 976 `other_data`text COLLATE utf8_unicode_ci, 977 `description`text COLLATE utf8_unicode_ci, 978 PRIMARY KEY (idlog) 979 ) $charset_collate COMMENT='Winter Activity Log Plugin Data';"; 980 981 if ($conn->query($sql) === TRUE) { 982 //echo "Table $table_name created successfully"; 983 } else { 984 //echo "Error creating table: " . $conn->error; 985 } 986 987 $values = ''; 988 989 foreach($insert_array as $key=>$row) 990 { 991 $values.="'".str_replace("'", "\'", $row)."',"; 992 } 993 994 $values = substr($values, 0, -1); 995 996 $sql = "INSERT INTO $table_name (".join(', ', array_keys($insert_array)).") 997 VALUES ($values)"; 998 999 if ($conn->query($sql) === TRUE) { 1000 //echo "New record created successfully"; 1001 } else { 1002 //echo "Error: " . $sql . "<br>" . $conn->error; 1003 } 1004 1005 //exit(); 1006 1007 $conn->close(); 1008 } 1009 1010 function wal_access_allowed($cap) 1011 { 1012 $allowed_admins = get_option('wal_allowed_admins'); 1013 1014 if(wmvc_user_in_role('administrator') || wmvc_user_in_role('super-admin')) 1015 { 1016 if(is_array($allowed_admins) && count($allowed_admins) > 0) 1017 { 1018 if(!in_array(get_current_user_id(), $allowed_admins)) 1019 return false; 1020 } 1021 1022 return true; 1023 } 1024 1025 $allowed_roles = get_option('wal_allowed_roles'); 1026 1027 if(is_array($allowed_roles) && count($allowed_roles) > 0) 1028 { 1029 foreach($allowed_roles as $key => $val) 1030 { 1031 if(wmvc_user_in_role($key)) 1032 { 1033 return true; 1034 } 1035 } 1036 } 1037 1038 return false; 1039 } 1040 1041 1042 function wal_send_sms($phone_number, $message) 1043 { 1044 if(!empty(get_option('wal_clickatell_one_api_key'))) 1045 { 1046 wal_send_sms_one($phone_number, $message); 1047 } 1048 else if(!empty(get_option('wal_clickatell_http_api_key'))) 1049 { 1050 wal_send_sms_http($phone_number, $message); 1051 } 1052 else if(!empty(get_option('wal_smsapicom_http_api_key'))) 1053 { 1054 wal_sms_send_smsapicom($phone_number, $message); 1055 } 1056 else if(!empty(get_option('wal_smsto_api_key'))) 1057 { 1058 wal_smsto($phone_number, $message); 1059 } 1060 } 1061 1062 if ( winteractivitylog()->is__premium_only() ) { 1063 1064 1065 /* 1066 1067 curl -i \ 1068 -X POST \ 1069 -H "Content-Type: application/json" \ 1070 -H "Accept: application/json" \ 1071 -H "Authorization: XXX" \ 1072 -d '{"messages": [{ "channel": "whatsapp", "to": "1234567890", "content": "Test WhatsApp Message Text" }, { "channel": "sms", "to": "1234567890", "content": "Test SMS Message Text" }]}' \ 1073 -s https://platform.clickatell.com/v1/message 1074 1075 */ 1076 1077 function wal_send_sms_one($phone_number, $message) 1078 { 1079 $message = substr($message, 0, 150); 1080 1081 $channel = "sms"; 1082 1083 if(get_option('wal_checkbox_enable_whatsapp_clickatell', '0') == '1') 1084 { 1085 $channel = "whatsapp"; 1086 } 1087 1088 $url = 'https://platform.clickatell.com/v1/message'; 1089 $data = array("messages" => array ( array("channel" => $channel, "to" => $phone_number, "content" => $message ))); 1090 $auth_code = get_option('wal_clickatell_one_api_key'); 1091 1092 $data_string = json_encode($data); 1093 1094 $ch = curl_init($url); 1095 1096 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 1097 curl_setopt($ch, CURLOPT_POST, TRUE); 1098 curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); 1099 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); 1100 curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json', 'Authorization: '.$auth_code)); 1101 curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); 1102 1103 $result = curl_exec($ch); 1104 curl_close($ch); 1105 } 1106 1107 /* 1108 1109 curl "https://platform.clickatell.com/messages/http/send?apiKey=XXX&to=XXX&content=XXX" 1110 1111 1112 */ 1113 1114 function wal_send_sms_http($phone_number, $message) 1115 { 1116 $message = urlencode(substr($message, 0, 150)); 1117 1118 $auth_code = get_option('wal_clickatell_http_api_key'); 1119 1120 $url = 'https://platform.clickatell.com/messages/http/send?apiKey='.$auth_code.'&to='.$phone_number.'&content='.$message; 1121 1122 1123 $ch = curl_init($url); 1124 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 1125 curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); 1126 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); 1127 1128 $result = curl_exec($ch); 1129 curl_close($ch); 1130 } 1131 1132 function wal_sms_send_smsapicom($phone_number, $message, $from = 'Test') 1133 { 1134 1135 static $content; 1136 1137 if(!empty(get_option('wal_smsapicom_sender_name'))) 1138 { 1139 $from = get_option('wal_smsapicom_sender_name'); 1140 } 1141 1142 $params = array( 1143 'to' => $phone_number, //destination number 1144 'from' => $from, //sender name has to be active 1145 'message' => $message, //message content 1146 'format' => 'json', 1147 ); 1148 1149 $backup = false; 1150 1151 $token = get_option('wal_smsapicom_http_api_key'); 1152 1153 if ($backup == true) { 1154 $url = 'https://api2.smsapi.com/sms.do'; 659 function wal_remotedb_log( $row_cloud, $log_message, $insert_array ) { 660 global $wpdb; 661 $servername = $row_cloud->host . ':' . $row_cloud->port; 662 $username = $row_cloud->database_username; 663 $password = $row_cloud->database_password; 664 $dbname = $row_cloud->database_name; 665 // Create connection 666 $conn = mysqli_connect( 667 $servername, 668 $username, 669 $password, 670 $dbname 671 ); 672 // Check connection 673 if ( !$conn ) { 674 //die("Connection failed: " . mysqli_connect_error()); 675 return; 676 } 677 // sql to create table 678 $table_name = $row_cloud->database_tablename; 679 $charset_collate = $wpdb->get_charset_collate(); 680 $sql = "CREATE TABLE IF NOT EXISTS {$table_name} (\r\n\t\t`idlog` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t`level` int(11) DEFAULT NULL,\r\n\t\t`date` datetime DEFAULT NULL,\r\n\t\t`user_id` int(11) DEFAULT NULL,\r\n\t\t`user_info`text COLLATE utf8_unicode_ci,\r\n\t\t`ip` varchar(160) COLLATE utf8_unicode_ci NULL,\r\n\t\t`page` varchar(160) COLLATE utf8_unicode_ci NULL,\r\n\t\t`request_uri` varchar(160) COLLATE utf8_unicode_ci NULL,\r\n\t\t`action` varchar(160) COLLATE utf8_unicode_ci DEFAULT NULL,\r\n\t\t`is_favourite` tinyint(1) DEFAULT NULL,\r\n\t\t`request_data` longtext COLLATE utf8_unicode_ci,\r\n\t\t`header_data` text COLLATE utf8_unicode_ci,\r\n\t\t`other_data`text COLLATE utf8_unicode_ci,\r\n\t\t`description`text COLLATE utf8_unicode_ci,\r\n\t\tPRIMARY KEY (idlog)\r\n\t) {$charset_collate} COMMENT='Winter Activity Log Plugin Data';"; 681 if ( $conn->query( $sql ) === TRUE ) { 682 //echo "Table $table_name created successfully"; 1155 683 } else { 1156 $url = 'https://api.smsapi.com/sms.do'; 1157 } 1158 1159 $c = curl_init(); 1160 curl_setopt($c, CURLOPT_URL, $url); 1161 curl_setopt($c, CURLOPT_POST, true); 1162 curl_setopt($c, CURLOPT_POSTFIELDS, $params); 1163 curl_setopt($c, CURLOPT_RETURNTRANSFER, true); 1164 curl_setopt($c, CURLOPT_HTTPHEADER, array( 1165 "Authorization: Bearer $token" 1166 )); 1167 1168 $content = curl_exec($c); 1169 $http_status = curl_getinfo($c, CURLINFO_HTTP_CODE); 1170 1171 if ($http_status != 200 && $backup == false) { 1172 $backup = true; 1173 sms_send($params, $token, $backup); 1174 } 1175 1176 curl_close($c); 1177 1178 //var_dump($content); 1179 //exit(); 1180 1181 return $content; 1182 } 1183 1184 function wal_smsto($phone_number, $message, $senderID = 'WinterLock') 1185 { 1186 $curl = curl_init(); 1187 1188 $apikey = get_option('wal_smsto_api_key'); 1189 1190 if(!empty(get_option('wal_smsto_senderid'))) 1191 { 1192 $senderID = get_option('wal_smsto_senderid'); 1193 } 1194 1195 curl_setopt_array($curl, array( 1196 CURLOPT_URL => "https://api.sms.to/sms/send", 1197 CURLOPT_RETURNTRANSFER => true, 1198 CURLOPT_ENCODING => "", 1199 CURLOPT_MAXREDIRS => 10, 1200 CURLOPT_TIMEOUT => 0, 1201 CURLOPT_FOLLOWLOCATION => true, 1202 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, 1203 CURLOPT_CUSTOMREQUEST => "POST", 1204 CURLOPT_POSTFIELDS =>"{\n \"message\": \"$message\",\n \"to\": \"$phone_number\",\n \"sender_id\": \"$senderID\",\n \"callback_url\": \"https://sms.to/callback/handler\"\n}", 1205 CURLOPT_HTTPHEADER => array( 1206 "Content-Type: application/json", 1207 "Accept: application/json", 1208 "Authorization: Bearer $apikey" 1209 ), 1210 )); 1211 1212 $response = curl_exec($curl); 1213 1214 curl_close($curl); 1215 } 1216 1217 1218 } 1219 1220 1221 684 //echo "Error creating table: " . $conn->error; 685 } 686 $values = ''; 687 foreach ( $insert_array as $key => $row ) { 688 $values .= "'" . str_replace( "'", "\\'", $row ) . "',"; 689 } 690 $values = substr( $values, 0, -1 ); 691 $sql = "INSERT INTO {$table_name} (" . join( ', ', array_keys( $insert_array ) ) . ")\r\n\t\t\tVALUES ({$values})"; 692 if ( $conn->query( $sql ) === TRUE ) { 693 //echo "New record created successfully"; 694 } else { 695 //echo "Error: " . $sql . "<br>" . $conn->error; 696 } 697 //exit(); 698 $conn->close(); 699 } 700 701 function wal_access_allowed( $cap ) { 702 $allowed_admins = get_option( 'wal_allowed_admins' ); 703 if ( wmvc_user_in_role( 'administrator' ) || wmvc_user_in_role( 'super-admin' ) ) { 704 if ( is_array( $allowed_admins ) && count( $allowed_admins ) > 0 ) { 705 if ( !in_array( get_current_user_id(), $allowed_admins ) ) { 706 return false; 707 } 708 } 709 return true; 710 } 711 $allowed_roles = get_option( 'wal_allowed_roles' ); 712 if ( is_array( $allowed_roles ) && count( $allowed_roles ) > 0 ) { 713 foreach ( $allowed_roles as $key => $val ) { 714 if ( wmvc_user_in_role( $key ) ) { 715 return true; 716 } 717 } 718 } 719 return false; 720 } 721 722 function wal_send_sms( $phone_number, $message ) { 723 if ( !empty( get_option( 'wal_clickatell_one_api_key' ) ) ) { 724 wal_send_sms_one( $phone_number, $message ); 725 } else { 726 if ( !empty( get_option( 'wal_clickatell_http_api_key' ) ) ) { 727 wal_send_sms_http( $phone_number, $message ); 728 } else { 729 if ( !empty( get_option( 'wal_smsapicom_http_api_key' ) ) ) { 730 wal_sms_send_smsapicom( $phone_number, $message ); 731 } else { 732 if ( !empty( get_option( 'wal_smsto_api_key' ) ) ) { 733 wal_smsto( $phone_number, $message ); 734 } 735 } 736 } 737 } 738 } 1222 739 1223 740 function wal_get_date() { 1224 $date_format = get_option('date_format'); 1225 $time_format = get_option('time_format'); 1226 $date = date("{$date_format} {$time_format}", current_time('timestamp')); 1227 return $date; 1228 } 1229 1230 function wal_wp_authenticate( $username, $password ) { 1231 $username = sanitize_user( $username ); 1232 $password = trim( $password ); 1233 1234 // get user by login via the supplied username (form input) 1235 $user = get_user_by('login', $username); 1236 1237 if(!isset($user->user_pass)) 1238 { 1239 $user = get_user_by('email', $username); 1240 1241 if(!isset($user->user_pass)) 1242 return NULL; 1243 } 1244 1245 if ( ! wp_check_password( $password, $user->user_pass, $user->ID ) ) 1246 { 1247 return NULL; 1248 } 1249 1250 return $user; 1251 } 1252 741 $date_format = get_option( 'date_format' ); 742 $time_format = get_option( 'time_format' ); 743 $date = date( "{$date_format} {$time_format}", current_time( 'timestamp' ) ); 744 return $date; 745 } 746 747 function wal_wp_authenticate( $username, $password ) { 748 $username = sanitize_user( $username ); 749 $password = trim( $password ); 750 // get user by login via the supplied username (form input) 751 $user = get_user_by( 'login', $username ); 752 if ( !isset( $user->user_pass ) ) { 753 $user = get_user_by( 'email', $username ); 754 if ( !isset( $user->user_pass ) ) { 755 return NULL; 756 } 757 } 758 if ( !wp_check_password( $password, $user->user_pass, $user->ID ) ) { 759 return NULL; 760 } 761 return $user; 762 } -
winterlock/trunk/winterlock.php
r3419393 r3441603 10 10 * 11 11 * @link https://activity-log.com/ 12 * @since 1.0. 412 * @since 1.0. 13 13 * @package Winter_Activity_Log 14 14 * … … 17 17 * Plugin URI: https://activity-log.com/ 18 18 * Description: Detailed WordPress Activity Log with user request tracking, instant logout, request restrictions, locking, blocking, alerts, and more. 19 * Version: 1.2. 719 * Version: 1.2.8 20 20 * Author: SWIT 21 21 * Author URI: https://swit.hr/ … … 25 25 * Domain Path: /languages 26 26 * 27 * @fs_premium_only /premium_functions.php28 27 * 29 28 */ 30 29 // If this file is called directly, abort. 31 if ( !defined('WPINC')) {30 if ( !defined( 'WPINC' ) ) { 32 31 die; 33 32 } 34 35 $time_before = microtime(true); 36 37 if (!function_exists('activate_winter_activity_log')) { 33 $time_before = microtime( true ); 34 if ( !function_exists( 'activate_winter_activity_log' ) ) { 38 35 /** 39 36 * Currently plugin version. … … 41 38 * Rename this for your plugin and update it as you release new versions. 42 39 */ 43 define( 'WINTER_ACTIVITY_LOG_VERSION', '1.2.6');44 define( 'WINTER_ACTIVITY_LOG_NAME', 'winter-activity-log');45 define( 'WINTER_ACTIVITY_LOG_PATH', plugin_dir_path(__FILE__));46 define( 'WINTER_ACTIVITY_LOG_URL', plugin_dir_url(__FILE__));40 define( 'WINTER_ACTIVITY_LOG_VERSION', '1.2.8' ); 41 define( 'WINTER_ACTIVITY_LOG_NAME', 'winter-activity-log' ); 42 define( 'WINTER_ACTIVITY_LOG_PATH', plugin_dir_path( __FILE__ ) ); 43 define( 'WINTER_ACTIVITY_LOG_URL', plugin_dir_url( __FILE__ ) ); 47 44 /** 48 45 * The code that runs during plugin activation. 49 46 * This action is documented in includes/class-winter-activity-log-activator.php 50 47 */ 51 function activate_winter_activity_log() 52 { 53 require_once plugin_dir_path(__FILE__) . 'includes/class-winter-activity-log-activator.php'; 48 function activate_winter_activity_log() { 49 require_once plugin_dir_path( __FILE__ ) . 'includes/class-winter-activity-log-activator.php'; 54 50 Winter_Activity_Log_Activator::activate(); 55 51 } … … 59 55 * This action is documented in includes/class-winter-activity-log-deactivator.php 60 56 */ 61 function deactivate_winter_activity_log() 62 { 63 require_once plugin_dir_path(__FILE__) . 'includes/class-winter-activity-log-deactivator.php'; 57 function deactivate_winter_activity_log() { 58 require_once plugin_dir_path( __FILE__ ) . 'includes/class-winter-activity-log-deactivator.php'; 64 59 Winter_Activity_Log_Deactivator::deactivate(); 65 60 } 66 61 67 register_activation_hook( __FILE__, 'activate_winter_activity_log');68 register_deactivation_hook( __FILE__, 'deactivate_winter_activity_log');62 register_activation_hook( __FILE__, 'activate_winter_activity_log' ); 63 register_deactivation_hook( __FILE__, 'deactivate_winter_activity_log' ); 69 64 /** 70 65 * The core plugin class that is used to define internationalization, 71 66 * admin-specific hooks, and public-facing site hooks. 72 67 */ 73 require plugin_dir_path( __FILE__) . 'includes/class-winter-activity-log.php';68 require plugin_dir_path( __FILE__ ) . 'includes/class-winter-activity-log.php'; 74 69 /** 75 70 * Begins execution of the plugin. … … 81 76 * @since 1.0.0 82 77 */ 83 function run_winter_activity_log() 84 { 78 function run_winter_activity_log() { 85 79 $plugin = new Winter_Activity_Log(); 86 80 $plugin->run(); … … 88 82 89 83 // [Freemius] 90 91 if (function_exists('winteractivitylog')) { 92 winteractivitylog()->set_basename(false, __FILE__); 84 if ( function_exists( 'winteractivitylog' ) ) { 85 winteractivitylog()->set_basename( false, __FILE__ ); 93 86 } else { 94 95 if (!function_exists('winteractivitylog')) { 87 if ( !function_exists( 'winteractivitylog' ) ) { 96 88 // Create a helper function for easy SDK access. 97 function winteractivitylog() 98 { 99 global $winteractivitylog; 100 101 if (!isset($winteractivitylog)) { 89 function winteractivitylog() { 90 global $winteractivitylog; 91 if ( !isset( $winteractivitylog ) ) { 102 92 // Include Freemius SDK. 103 require_once dirname( __FILE__) . '/freemius/start.php';104 $winteractivitylog = fs_dynamic_init( array(93 require_once dirname( __FILE__ ) . '/freemius/start.php'; 94 $winteractivitylog = fs_dynamic_init( array( 105 95 'id' => '5253', 106 96 'slug' => 'winterlock', 107 97 'type' => 'plugin', 108 98 'public_key' => 'pk_453c5698d371cb2dcc7a41e27cfb8', 109 'is_premium' => true,99 'is_premium' => false, 110 100 'has_addons' => false, 111 101 'has_paid_plans' => true, … … 115 105 ), 116 106 'menu' => array( 117 'slug' => 'winteractivitylog', 118 //'support' => false, 107 'slug' => 'winteractivitylog', 119 108 ), 120 'anonymous_mode' => !file_exists( WINTER_ACTIVITY_LOG_PATH . 'premium_functions.php'),121 //'is_live' => true,122 ) );109 'anonymous_mode' => !file_exists( WINTER_ACTIVITY_LOG_PATH . 'premium_functions.php' ), 110 'is_live' => true, 111 ) ); 123 112 } 124 125 113 return $winteractivitylog; 126 114 } … … 129 117 winteractivitylog(); 130 118 // Signal that SDK was initiated. 131 do_action( 'winteractivitylog_loaded');119 do_action( 'winteractivitylog_loaded' ); 132 120 } 133 134 121 // ... Your plugin's main file logic ... 135 122 run_winter_activity_log(); 136 123 } 137 138 124 function winteractivitylog_custom_connect_message_on_update( 139 125 $message, … … 145 131 ) { 146 132 return sprintf( 147 __( 'Hey %1$s') . ',<br>' . __('Please help us improve %2$s! If you opt-in, some data about your usage of %2$s will be sent to %5$s. If you skip this, that\'s okay! %2$s will still work just fine.', 'winterlock'),133 __( 'Hey %1$s' ) . ',<br>' . __( 'Please help us improve %2$s! If you opt-in, some data about your usage of %2$s will be sent to %5$s. If you skip this, that\'s okay! %2$s will still work just fine.', 'winterlock' ), 148 134 $user_first_name, 149 135 '<b>' . $plugin_title . '</b>', … … 162 148 // [/Freemius] 163 149 } 164 165 $time_executing = microtime(true) - $time_before; 166 150 $time_executing = microtime( true ) - $time_before; 167 151 //echo '<!-- TimeWinterLock: '.esc_html($time_executing).' -->';
Note: See TracChangeset
for help on using the changeset viewer.