From fd99094437a6a850dcbad43fd85dc933a416a601 Mon Sep 17 00:00:00 2001 From: Milan Petrovic Date: Mon, 2 Feb 2026 20:05:57 +0100 Subject: [PATCH] [library] [composer] Updated Library to 5.5; More library changes. --- changelog.md | 25 +- composer.json | 6 +- composer.lock | 94 ++- core/admin/AJAX.php | 37 +- core/admin/GetBack.php | 22 +- core/admin/Help.php | 15 +- core/admin/Panel.php | 2 +- core/admin/Plugin.php | 32 +- core/admin/PostBack.php | 28 +- core/admin/Settings.php | 8 +- core/admin/meta/Users.php | 17 +- core/admin/panel/About.php | 4 +- core/admin/panel/Dashboard.php | 10 +- core/admin/panel/Events.php | 2 +- core/admin/panel/Logs.php | 2 +- core/admin/panel/Settings.php | 4 +- core/admin/panel/Tools.php | 4 +- core/admin/panel/Wizard.php | 2 +- core/autoload.php | 2 +- core/base/Component.php | 18 +- core/basic/AdminBar.php | 2 +- core/basic/Cache.php | 4 +- core/basic/DB.php | 4 +- core/basic/Information.php | 8 +- core/basic/InstallDB.php | 2 +- core/basic/Jobs.php | 29 +- core/basic/Plugin.php | 30 +- core/basic/Render.php | 10 +- core/basic/Settings.php | 4 +- core/basic/Wizard.php | 2 +- core/bridge.php | 10 +- core/build.php | 1 - core/components/Error.php | 2 +- core/components/Network.php | 4 + core/components/Notification.php | 6 +- core/components/Option.php | 2 +- core/components/RESTAPI.php | 2 +- core/components/User.php | 2 +- core/components/WordPress.php | 8 +- core/functions.php | 10 +- core/location/GeoIP2.php | 8 +- core/location/IP2Location.php | 8 +- core/log/Activity.php | 79 +-- core/log/Cleanup.php | 19 +- core/log/Core.php | 47 +- core/log/Device.php | 9 +- core/log/Display.php | 19 +- core/log/GEO.php | 23 +- core/log/Metas.php | 9 +- core/log/Notifications.php | 51 +- core/log/Statistics.php | 19 +- core/log/Upgrader.php | 9 +- core/log/Users.php | 9 +- core/log/WhoIs.php | 9 +- core/plugins/BuddyPress.php | 2 +- core/table/Events.php | 29 +- core/table/Live.php | 2 +- core/table/Logs.php | 56 +- coreactivity.php | 18 +- coreactivity.pot | 861 +++++++++++++------------ forms/content-about-components.php | 6 +- forms/content-about-minor.php | 32 +- forms/content-about-whatsnew.php | 2 +- forms/content-dashboard-blog.php | 2 +- forms/content-dashboard-database.php | 4 +- forms/content-dashboard-location.php | 2 +- forms/content-dashboard-overall.php | 4 +- forms/content-dashboard-statistics.php | 4 +- forms/content-dashboard.php | 6 +- forms/content-events.php | 2 +- forms/content-install.php | 2 +- forms/content-logs.php | 2 +- forms/content-tools-cleanup.php | 4 +- forms/content-tools-export.php | 2 +- forms/content-tools-notifications.php | 2 +- forms/content-tools-remove.php | 2 +- forms/content-update.php | 2 +- forms/content-wizard-geo.php | 2 +- forms/content-wizard-notifications.php | 2 +- forms/dialog-data.php | 6 +- forms/dialog-logs.php | 4 +- forms/setup-database.php | 2 +- forms/setup-statistics.php | 2 +- history.md | 14 + js/admin.min.js | 2 +- readme.txt | 23 +- 86 files changed, 1030 insertions(+), 869 deletions(-) delete mode 100644 core/build.php diff --git a/changelog.md b/changelog.md index d370fed..2a8fa36 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,17 @@ ## Changelog +### Version: 3.0 / february 6, 2026 + +* **new** plugin tested with `WordPress` up to 6.9 +* **new** plugin tested with `PHP` up to 8.5 +* **new** updated plugin system requirements +* **edit** various updates to the plugin core and code structure +* **edit** Dev4Press Library 5.5.1 +* **edit** Device Detector Library 6.5 +* **edit** IP2Location 9.8.1 +* **fix** a few small code formatting issues + ### Version: 2.8 / June 14, 2025 * **edit** Device Detector Library 6.4.6 @@ -22,17 +33,3 @@ * **edit** Device Detector Library 6.4.3 * **edit** Dev4Press Library 5.3 * **fix** doing it wrong warning for translations on WordPress 6.7 - -### Version: 2.6 / October 24, 2024 - -* **new** component: `SweepPress` with 8 more events -* **new** post meta updated: check for values equality -* **new** comment meta updated: check for values equality -* **new** term meta updated: check for values equality -* **new** user meta updated: check for values equality -* **new** option to control logging options and meta changes -* **edit** option edited event: change to equality detection -* **edit** sitemeta edited event: change to equality detection -* **edit** expanded default values for some settings -* **fix** some metadata logging events used wrong meta arguments -* **fix** minor issue with the generating hidden logs row diff --git a/composer.json b/composer.json index ead3d7b..55c76bf 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { "require": { - "dev4press/library": "~5.4", - "matomo/device-detector": "^6.4", - "ip2location/ip2location-php": "^9.7", + "dev4press/library": "5.5.1", + "matomo/device-detector": "^6.5", + "ip2location/ip2location-php": "^9.8", "geoip2/geoip2": "2.13.0" } } diff --git a/composer.lock b/composer.lock index 4d5f506..153b7fb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e86c7631a21f8044ef95968e549d3a68", + "content-hash": "e7936447bffce2d521ace2feb146f0c4", "packages": [ { "name": "composer/ca-bundle", - "version": "1.5.7", + "version": "1.5.10", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "d665d22c417056996c59019579f1967dfe5c1e82" + "reference": "961a5e4056dd2e4a2eedcac7576075947c28bf63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/d665d22c417056996c59019579f1967dfe5c1e82", - "reference": "d665d22c417056996c59019579f1967dfe5c1e82", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/961a5e4056dd2e4a2eedcac7576075947c28bf63", + "reference": "961a5e4056dd2e4a2eedcac7576075947c28bf63", "shasum": "" }, "require": { @@ -64,7 +64,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.5.7" + "source": "https://github.com/composer/ca-bundle/tree/1.5.10" }, "funding": [ { @@ -74,26 +74,22 @@ { "url": "https://github.com/composer", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" } ], - "time": "2025-05-26T15:08:54+00:00" + "time": "2025-12-08T15:06:51+00:00" }, { "name": "dev4press/library", - "version": "5.4.0", + "version": "5.5.1", "source": { "type": "git", "url": "https://github.com/dev4press/library.git", - "reference": "996d409448d31f3edff9a192879bfef3ca63f5ae" + "reference": "9a22437bbc8216e156bcc41f522eb32d994f52a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dev4press/library/zipball/996d409448d31f3edff9a192879bfef3ca63f5ae", - "reference": "996d409448d31f3edff9a192879bfef3ca63f5ae", + "url": "https://api.github.com/repos/dev4press/library/zipball/9a22437bbc8216e156bcc41f522eb32d994f52a3", + "reference": "9a22437bbc8216e156bcc41f522eb32d994f52a3", "shasum": "" }, "require": { @@ -102,7 +98,7 @@ "ext-curl": "*", "ext-fileinfo": "*", "ext-json": "*", - "php": ">=7.4" + "php": ">=8.0" }, "type": "library", "autoload": { @@ -139,7 +135,7 @@ "type": "ko_fi" } ], - "time": "2025-05-23T18:34:00+00:00" + "time": "2026-02-05T19:04:52+00:00" }, { "name": "erusev/parsedown", @@ -302,16 +298,16 @@ }, { "name": "ip2location/ip2location-php", - "version": "9.7.3", + "version": "9.8.1", "source": { "type": "git", "url": "https://github.com/chrislim2888/IP2Location-PHP-Module.git", - "reference": "67c7bf13b0571b70925435e640ea5598e9fdeee9" + "reference": "e18e5372cfa4b57f33d2dc8c15d24cee1ee6d1ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/chrislim2888/IP2Location-PHP-Module/zipball/67c7bf13b0571b70925435e640ea5598e9fdeee9", - "reference": "67c7bf13b0571b70925435e640ea5598e9fdeee9", + "url": "https://api.github.com/repos/chrislim2888/IP2Location-PHP-Module/zipball/e18e5372cfa4b57f33d2dc8c15d24cee1ee6d1ce", + "reference": "e18e5372cfa4b57f33d2dc8c15d24cee1ee6d1ce", "shasum": "" }, "require": { @@ -357,22 +353,22 @@ ], "support": { "issues": "https://github.com/chrislim2888/IP2Location-PHP-Module/issues", - "source": "https://github.com/chrislim2888/IP2Location-PHP-Module/tree/9.7.3" + "source": "https://github.com/chrislim2888/IP2Location-PHP-Module/tree/9.8.1" }, - "time": "2024-02-26T22:30:40+00:00" + "time": "2025-12-21T22:28:29+00:00" }, { "name": "matomo/device-detector", - "version": "6.4.6", + "version": "6.5.0", "source": { "type": "git", "url": "https://github.com/matomo-org/device-detector.git", - "reference": "6f07f615199851548db47a900815d2ea2cdcde08" + "reference": "e0fff2309dad83eb3cfb2564e524be715cfcf3cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/matomo-org/device-detector/zipball/6f07f615199851548db47a900815d2ea2cdcde08", - "reference": "6f07f615199851548db47a900815d2ea2cdcde08", + "url": "https://api.github.com/repos/matomo-org/device-detector/zipball/e0fff2309dad83eb3cfb2564e524be715cfcf3cf", + "reference": "e0fff2309dad83eb3cfb2564e524be715cfcf3cf", "shasum": "" }, "require": { @@ -386,14 +382,13 @@ "matthiasmullie/scrapbook": "^1.4.7", "mayflower/mo4-coding-standard": "^v9.0.0", "phpstan/phpstan": "^1.10.44", - "phpunit/phpunit": "^8.5.8", - "psr/cache": "^1.0.1", - "psr/simple-cache": "^1.0.1", + "phpunit/phpunit": "^8.5.2 || ^9 || ^10 || ^11 || ^12", + "psr/cache": "^1.0.1 || ^2.0 || ^3.0", + "psr/simple-cache": "^1.0.1 || ^2.0 || ^3.0", "slevomat/coding-standard": "<8.16.0", "symfony/yaml": "^5.1.7" }, "suggest": { - "doctrine/cache": "Can directly be used for caching purpose", "ext-yaml": "Necessary for using the Pecl YAML parser" }, "type": "library", @@ -429,20 +424,20 @@ "source": "https://github.com/matomo-org/matomo", "wiki": "https://dev.matomo.org/" }, - "time": "2025-06-10T10:00:59+00:00" + "time": "2026-01-21T07:53:39+00:00" }, { "name": "maxmind-db/reader", - "version": "v1.12.1", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/maxmind/MaxMind-DB-Reader-php.git", - "reference": "815939e006b7e68062b540ec9e86aaa8be2b6ce4" + "reference": "2194f58d0f024ce923e685cdf92af3daf9951908" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/815939e006b7e68062b540ec9e86aaa8be2b6ce4", - "reference": "815939e006b7e68062b540ec9e86aaa8be2b6ce4", + "url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/2194f58d0f024ce923e685cdf92af3daf9951908", + "reference": "2194f58d0f024ce923e685cdf92af3daf9951908", "shasum": "" }, "require": { @@ -455,12 +450,13 @@ "friendsofphp/php-cs-fixer": "3.*", "phpstan/phpstan": "*", "phpunit/phpunit": ">=8.0.0,<10.0.0", - "squizlabs/php_codesniffer": "3.*" + "squizlabs/php_codesniffer": "4.*" }, "suggest": { "ext-bcmath": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder", "ext-gmp": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder", - "ext-maxminddb": "A C-based database decoder that provides significantly faster lookups" + "ext-maxminddb": "A C-based database decoder that provides significantly faster lookups", + "maxmind-db/reader-ext": "C extension for significantly faster IP lookups (install via PIE: pie install maxmind-db/reader-ext)" }, "type": "library", "autoload": { @@ -490,35 +486,35 @@ ], "support": { "issues": "https://github.com/maxmind/MaxMind-DB-Reader-php/issues", - "source": "https://github.com/maxmind/MaxMind-DB-Reader-php/tree/v1.12.1" + "source": "https://github.com/maxmind/MaxMind-DB-Reader-php/tree/v1.13.1" }, - "time": "2025-05-05T20:56:32+00:00" + "time": "2025-11-21T22:24:26+00:00" }, { "name": "maxmind/web-service-common", - "version": "v0.9.0", + "version": "v0.11.1", "source": { "type": "git", "url": "https://github.com/maxmind/web-service-common-php.git", - "reference": "4dc5a3e8df38aea4ca3b1096cee3a038094e9b53" + "reference": "c309236b5a5555b96cf560089ec3cead12d845d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/4dc5a3e8df38aea4ca3b1096cee3a038094e9b53", - "reference": "4dc5a3e8df38aea4ca3b1096cee3a038094e9b53", + "url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/c309236b5a5555b96cf560089ec3cead12d845d2", + "reference": "c309236b5a5555b96cf560089ec3cead12d845d2", "shasum": "" }, "require": { "composer/ca-bundle": "^1.0.3", "ext-curl": "*", "ext-json": "*", - "php": ">=7.2" + "php": ">=8.1" }, "require-dev": { "friendsofphp/php-cs-fixer": "3.*", "phpstan/phpstan": "*", - "phpunit/phpunit": "^8.0 || ^9.0", - "squizlabs/php_codesniffer": "3.*" + "phpunit/phpunit": "^10.0", + "squizlabs/php_codesniffer": "4.*" }, "type": "library", "autoload": { @@ -541,9 +537,9 @@ "homepage": "https://github.com/maxmind/web-service-common-php", "support": { "issues": "https://github.com/maxmind/web-service-common-php/issues", - "source": "https://github.com/maxmind/web-service-common-php/tree/v0.9.0" + "source": "https://github.com/maxmind/web-service-common-php/tree/v0.11.1" }, - "time": "2022-03-28T17:43:20+00:00" + "time": "2026-01-13T17:56:03+00:00" }, { "name": "mustangostang/spyc", diff --git a/core/admin/AJAX.php b/core/admin/AJAX.php index 7afd1ad..79c943c 100644 --- a/core/admin/AJAX.php +++ b/core/admin/AJAX.php @@ -6,21 +6,27 @@ use Dev4Press\Plugin\CoreActivity\Log\Activity; use Dev4Press\Plugin\CoreActivity\Log\WhoIs; use Dev4Press\Plugin\CoreActivity\Table\Live; -use Dev4Press\v54\Core\Quick\Sanitize; +use Dev4Press\v55\Core\Quick\Sanitize; +use JetBrains\PhpStorm\NoReturn; if ( ! defined( 'ABSPATH' ) ) { exit; } class AJAX { - public function __construct() { + private function __construct() { add_action( 'wp_ajax_coreactivity_toggle_event', array( $this, 'toggle_event' ) ); add_action( 'wp_ajax_coreactivity_toggle_notification', array( $this, 'toggle_notification' ) ); add_action( 'wp_ajax_coreactivity_live_logs', array( $this, 'live_logs' ) ); add_action( 'wp_ajax_coreactivity_whois_ip', array( $this, 'whois_ip' ) ); } - public static function instance() : AJAX { + /** @deprecated 3.0 Use self::i() instead. */ + public static function instance() : static { + return static::i(); + } + + public static function i() : static { static $instance = null; if ( ! isset( $instance ) ) { @@ -30,7 +36,8 @@ public static function instance() : AJAX { return $instance; } - private function json_respond( $response, $code = 200 ) { + #[NoReturn] + private function json_respond( $response, $code = 200 ) : void { status_header( $code ); if ( ! headers_sent() ) { @@ -41,31 +48,33 @@ private function json_respond( $response, $code = 200 ) { die( wp_json_encode( $response ) ); } - public function toggle_event() { + #[NoReturn] + public function toggle_event() : void { $id = isset( $_POST['event'] ) ? absint( $_POST['event'] ) : 0; $toggle = ''; if ( $id > 0 && isset( $_REQUEST['_ajax_nonce'] ) && wp_verify_nonce( sanitize_key( $_REQUEST['_ajax_nonce'] ), 'coreactivity-toggle-event-' . $id ) ) { - $status = Activity::instance()->event_status( $id ); + $status = Activity::i()->event_status( $id ); if ( ! empty( $status ) ) { $new = $status == 'active' ? 'inactive' : 'active'; $toggle = $status == 'active' ? 'off' : 'on'; - DB::instance()->change_event_status( $id, $new ); + DB::i()->change_event_status( $id, $new ); } } $this->json_respond( array( 'toggle' => $toggle ) ); } - public function toggle_notification() { + #[NoReturn] + public function toggle_notification() : void { $id = isset( $_POST['event'] ) ? absint( $_POST['event'] ) : 0; $key = isset( $_POST['notification'] ) ? Sanitize::slug( $_POST['notification'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput $toggle = ''; if ( $id > 0 && isset( $_REQUEST['_ajax_nonce'] ) && wp_verify_nonce( sanitize_key( $_REQUEST['_ajax_nonce'] ), 'coreactivity-toggle-notification-' . $key . '-' . $id ) ) { - $change = Activity::instance()->event_notification_toggle( $id, $key ); + $change = Activity::i()->event_notification_toggle( $id, $key ); if ( ! is_null( $change ) ) { $toggle = $change ? 'on' : 'off'; @@ -75,7 +84,8 @@ public function toggle_notification() { $this->json_respond( array( 'toggle' => $toggle ) ); } - public function live_logs() { + #[NoReturn] + public function live_logs() : void { $output = ''; if ( isset( $_REQUEST['args'] ) ) { @@ -100,7 +110,7 @@ public function live_logs() { ob_end_clean(); if ( ! empty( $output ) ) { - $output = DB::instance()->get_last_log_id() . '.' . $output; + $output = DB::i()->get_last_log_id() . '.' . $output; } } } @@ -108,12 +118,13 @@ public function live_logs() { die( $output ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } - public function whois_ip() { + #[NoReturn] + public function whois_ip() : void { $ip = isset( $_POST['whois'] ) ? Sanitize::text( $_POST['whois'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput $out = __( 'WhoIs check failed', 'coreactivity' ); if ( ! empty( $ip ) && isset( $_REQUEST['_ajax_nonce'] ) && wp_verify_nonce( sanitize_key( $_REQUEST['_ajax_nonce'] ), 'coreactivity-whois-' . $ip ) ) { - $out = nl2br( trim( WhoIs::instance()->get( $ip ) ) ); + $out = nl2br( trim( WhoIs::i()->get( $ip ) ) ); } die( $out ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped diff --git a/core/admin/GetBack.php b/core/admin/GetBack.php index 3c924f2..7afb7fd 100644 --- a/core/admin/GetBack.php +++ b/core/admin/GetBack.php @@ -4,15 +4,15 @@ use Dev4Press\Plugin\CoreActivity\Basic\DB; use Dev4Press\Plugin\CoreActivity\Log\Activity; -use Dev4Press\v54\Core\Admin\GetBack as BaseGetBack; -use Dev4Press\v54\Core\Quick\Sanitize; +use Dev4Press\v55\Core\Admin\GetBack as BaseGetBack; +use Dev4Press\v55\Core\Quick\Sanitize; if ( ! defined( 'ABSPATH' ) ) { exit; } class GetBack extends BaseGetBack { - protected function process() { + protected function process() : void { parent::process(); if ( ! empty( $this->a()->panel ) ) { @@ -34,7 +34,7 @@ protected function process() { do_action( 'coreactivity_admin_getback_handler', $this->p(), $this->a() ); } - private function action_dashboard() { + private function action_dashboard() : void { $action = $this->get_single_action(); if ( in_array( $action, array( 'disable-logging', 'enable-logging' ) ) ) { @@ -49,7 +49,7 @@ private function action_dashboard() { } } - private function action_logs() { + private function action_logs() : void { $action = $this->get_single_action(); if ( $action == 'do-not-log' ) { @@ -75,7 +75,7 @@ private function action_logs() { } } - private function bulk_panel_events() { + private function bulk_panel_events() : void { check_admin_referer( 'bulk-events' ); $action = $this->get_bulk_action(); @@ -88,9 +88,9 @@ private function bulk_panel_events() { $new = $action == 'enable' ? 'active' : 'inactive'; foreach ( $ids as $event_id ) { - DB::instance()->change_event_status( $event_id, $new ); + DB::i()->change_event_status( $event_id, $new ); } - } else if ( substr( $action, 0, 13 ) == 'notifications' ) { + } else if ( str_starts_with( $action, 'notifications' ) ) { $elements = explode( '-', substr( $action, 14 ) ); if ( count( $elements ) == 2 ) { @@ -99,7 +99,7 @@ private function bulk_panel_events() { if ( in_array( $notification, array( 'instant', 'daily', 'weekly' ), true ) && in_array( $status, array( 'on', 'off' ), true ) ) { foreach ( $ids as $event_id ) { - Activity::instance()->event_notification_toggle( $event_id, $notification, $status ); + Activity::i()->event_notification_toggle( $event_id, $notification, $status ); } } } @@ -111,7 +111,7 @@ private function bulk_panel_events() { } } - private function bulk_panel_logs() { + private function bulk_panel_logs() : void { check_admin_referer( 'bulk-logs' ); $action = $this->get_bulk_action(); @@ -121,7 +121,7 @@ private function bulk_panel_logs() { if ( ! empty( $ids ) ) { if ( $action == 'delete' ) { - DB::instance()->delete_log_entries( $ids ); + DB::i()->delete_log_entries( $ids ); wp_redirect( $this->a()->current_url() . '&message=delete-completed' ); exit; diff --git a/core/admin/Help.php b/core/admin/Help.php index 0a16771..63ac6e9 100644 --- a/core/admin/Help.php +++ b/core/admin/Help.php @@ -7,7 +7,7 @@ } class Help { - public function __construct() { + private function __construct() { if ( $this->a()->panel == 'dashboard' ) { $this->_for_dashboard(); } else if ( $this->a()->panel == 'logs' ) { @@ -17,7 +17,12 @@ public function __construct() { } } - public static function instance() : Help { + /** @deprecated 3.0 Use self::i() instead. */ + public static function instance() : static { + return static::i(); + } + + public static function i() : static { static $instance = null; if ( is_null( $instance ) ) { @@ -31,7 +36,7 @@ private function a() : Plugin { return coreactivity_admin(); } - private function _for_dashboard() { + private function _for_dashboard() : void { $this->a()->screen()->add_help_tab( array( 'id' => 'coreactivity-dashboard-events', @@ -59,7 +64,7 @@ private function _for_dashboard() { ); } - private function _for_logs() { + private function _for_logs() : void { $this->a()->screen()->add_help_tab( array( 'id' => 'coreactivity-logs-help', @@ -76,7 +81,7 @@ private function _for_logs() { ); } - private function _for_events() { + private function _for_events() : void { $this->a()->screen()->add_help_tab( array( 'id' => 'coreactivity-events-help', diff --git a/core/admin/Panel.php b/core/admin/Panel.php index 78fddcc..db8c47f 100644 --- a/core/admin/Panel.php +++ b/core/admin/Panel.php @@ -2,7 +2,7 @@ namespace Dev4Press\Plugin\CoreActivity\Admin; -use Dev4Press\v54\Core\UI\Admin\Panel as BasePanel; +use Dev4Press\v55\Core\UI\Admin\Panel as BasePanel; if ( ! defined( 'ABSPATH' ) ) { exit; diff --git a/core/admin/Plugin.php b/core/admin/Plugin.php index 13a278d..b9e83cf 100644 --- a/core/admin/Plugin.php +++ b/core/admin/Plugin.php @@ -6,7 +6,7 @@ use Dev4Press\Plugin\CoreActivity\Basic\Plugin as CorePlugin; use Dev4Press\Plugin\CoreActivity\Basic\Settings as CoreSettings; use Dev4Press\Plugin\CoreActivity\Basic\Wizard; -use Dev4Press\v54\Core\Admin\Network\Plugin as BasePlugin; +use Dev4Press\v55\Core\Admin\Network\Plugin as BasePlugin; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -33,14 +33,14 @@ class Plugin extends BasePlugin { 'coreactivity_events_rows_per_page', ); - public function constructor() { + public function constructor() : void { $this->url = COREACTIVITY_URL; $this->path = COREACTIVITY_PATH; - Users::instance(); + Users::i(); } - public function register_scripts_and_styles() { + public function register_scripts_and_styles() : void { $this->enqueue->register( 'css', 'coreactivity-admin', array( 'path' => 'css/', @@ -71,7 +71,7 @@ public function register_scripts_and_styles() { ) ); } - public function plugins_loaded() { + public function plugins_loaded() : void { parent::plugins_loaded(); add_filter( 'default_hidden_columns', array( $this, 'hide_columns_default' ), 10, 2 ); @@ -92,7 +92,7 @@ public function svg_icon() : string { return coreactivity()->svg_icon; } - public function admin_menu_items() { + public function admin_menu_items() : void { $this->setup_items = array( 'install' => array( 'title' => __( 'Install', 'coreactivity' ), @@ -162,15 +162,15 @@ public function admin_menu_items() { } } - public function run_getback() { + public function run_getback() : void { new GetBack( $this ); } - public function run_postback() { + public function run_postback() : void { new PostBack( $this ); } - public function admin_init() { + public function admin_init() : void { if ( ! coreactivity()->is_logging_active() ) { if ( coreactivity_settings()->get( 'notice_if_logging_is_disabled' ) ) { if ( is_super_admin() ) { @@ -180,7 +180,7 @@ public function admin_init() { } } - public function notice_disabled() { + public function notice_disabled() : void { ?>
@@ -220,7 +220,7 @@ public function settings_definitions() : Settings { return Settings::instance(); } - public function enqueue() { + public function enqueue() : void { $this->e()->css( 'coreactivity-admin' ); $this->e()->js( 'coreactivity-admin' ); @@ -232,22 +232,22 @@ public function enqueue() { } public function wizard() { - return Wizard::instance(); + return Wizard::i(); } - public function help_tab_getting_help() { + public function help_tab_getting_help() : void { if ( ! empty( $this->panel ) ) { - Help::instance(); + Help::i(); } parent::help_tab_getting_help(); } - protected function extra_enqueue_scripts_plugin() { + protected function extra_enqueue_scripts_plugin() : void { $this->enqueue(); } - protected function extra_enqueue_scripts_final( $hook ) { + protected function extra_enqueue_scripts_final( $hook ) : void { $this->e()->css( 'coreactivity-global' ); } } diff --git a/core/admin/PostBack.php b/core/admin/PostBack.php index e7ea2d4..1b9548a 100644 --- a/core/admin/PostBack.php +++ b/core/admin/PostBack.php @@ -6,8 +6,9 @@ use Dev4Press\Plugin\CoreActivity\Basic\Plugin; use Dev4Press\Plugin\CoreActivity\Log\Activity; use Dev4Press\Plugin\CoreActivity\Log\Cleanup; -use Dev4Press\v54\Core\Admin\PostBack as BasePostBack; -use Dev4Press\v54\Core\Quick\Sanitize; +use Dev4Press\v55\Core\Admin\PostBack as BasePostBack; +use Dev4Press\v55\Core\Quick\Sanitize; +use JetBrains\PhpStorm\NoReturn; use WP_Filesystem_Direct; if ( ! defined( 'ABSPATH' ) ) { @@ -15,7 +16,7 @@ } class PostBack extends BasePostBack { - protected function process() { + protected function process() : void { parent::process(); if ( $this->p() == $this->get_page_name( 'wizard' ) ) { @@ -25,7 +26,7 @@ protected function process() { do_action( 'coreactivity_admin_postback_handler', $this->p(), $this->a() ); } - protected function tools() { + protected function tools() : void { if ( $this->a()->subpanel == 'notifications' ) { $this->notifications(); } else if ( $this->a()->subpanel == 'cleanup' ) { @@ -35,7 +36,8 @@ protected function tools() { } } - protected function notifications() { + #[NoReturn] + protected function notifications() : void { $data = $_POST['coreactivity']['tools-notifications'] ?? array(); // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput $msg = 'notifications-updated'; @@ -44,13 +46,14 @@ protected function notifications() { $daily = $data['daily'] ?? 'skip'; $weekly = $data['weekly'] ?? 'skip'; - Activity::instance()->events_notification_bulk_control( $instant, $daily, $weekly ); + Activity::i()->events_notification_bulk_control( $instant, $daily, $weekly ); wp_redirect( $this->a()->current_url() . '&message=' . $msg ); exit; } - protected function cleanup() { + #[NoReturn] + protected function cleanup() : void { $data = $_POST['coreactivity']['tools-cleanup'] ?? array(); // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput $when = $data['period'] ?? ''; @@ -60,7 +63,7 @@ protected function cleanup() { if ( ! empty( $when ) && ! empty( $what ) && strlen( $when ) == 4 ) { $what = Sanitize::ids_list( $what ); - Cleanup::instance()->cleanup_log( $when, $what ); + Cleanup::i()->cleanup_log( $when, $what ); $msg = 'cleanup-completed'; } @@ -69,7 +72,8 @@ protected function cleanup() { exit; } - protected function remove() { + #[NoReturn] + protected function remove() : void { $message = 'nothing-removed'; $remove = Sanitize::_get_switch_array( 'coreactivity-tools', 'remove' ); @@ -79,7 +83,7 @@ protected function remove() { } if ( in_array( 'geo-db', $remove ) ) { - $path = Plugin::instance()->uploads_path(); + $path = Plugin::i()->uploads_path(); if ( $path !== false ) { WP_Filesystem(); @@ -90,13 +94,13 @@ protected function remove() { } if ( in_array( 'drop', $remove ) ) { - InstallDB::instance()->drop(); + InstallDB::i()->drop(); if ( ! isset( $remove['disable'] ) ) { $this->a()->settings()->mark_for_update(); } } else if ( in_array( 'truncate', $remove ) ) { - InstallDB::instance()->truncate(); + InstallDB::i()->truncate(); } if ( in_array( 'disable', $remove ) ) { diff --git a/core/admin/Settings.php b/core/admin/Settings.php index f970311..3668fa4 100644 --- a/core/admin/Settings.php +++ b/core/admin/Settings.php @@ -3,9 +3,9 @@ namespace Dev4Press\Plugin\CoreActivity\Admin; use Dev4Press\Plugin\CoreActivity\Log\Activity; -use Dev4Press\v54\Core\Options\Settings as BaseSettings; -use Dev4Press\v54\Core\Options\Type; -use Dev4Press\v54\Core\Quick\Sanitize; +use Dev4Press\v55\Core\Options\Settings as BaseSettings; +use Dev4Press\v55\Core\Options\Type; +use Dev4Press\v55\Core\Quick\Sanitize; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -49,7 +49,7 @@ public function tools_cleanup() : array { ); $component = isset( $_GET['component'] ) ? Sanitize::text( $_GET['component'] ) : ''; - $listing = empty( $component ) ? Activity::instance()->get_select_events() : Activity::instance()->get_select_events( false, array( $component ) ); + $listing = empty( $component ) ? Activity::i()->get_select_events() : Activity::i()->get_select_events( false, array( $component ) ); $settings['cleanup-events'] = array( 'name' => __( 'Cleanup Events', 'coreactivity' ), diff --git a/core/admin/meta/Users.php b/core/admin/meta/Users.php index c631644..10e905b 100644 --- a/core/admin/meta/Users.php +++ b/core/admin/meta/Users.php @@ -14,11 +14,16 @@ class Users { 'coreactivity_login' => 'coreactivity_last_login', ); - public function __construct() { + private function __construct() { add_action( 'current_screen', array( $this, 'current_screen' ) ); } - public static function instance() : Users { + /** @deprecated 3.0 Use self::i() instead. */ + public static function instance() : self { + return self::i(); + } + + public static function i() : self { static $instance = null; if ( ! isset( $instance ) ) { @@ -28,7 +33,7 @@ public static function instance() : Users { return $instance; } - public function current_screen( $screen ) { + public function current_screen( $screen ) : void { if ( $screen->id == 'users' ) { add_filter( 'manage_users_columns', array( $this, 'manage_columns' ) ); add_filter( 'manage_users_sortable_columns', array( $this, 'sortable_columns' ) ); @@ -62,13 +67,13 @@ public function manage_columns( $columns ) { public function column_values( $value, $column, $user_id ) { switch ( $column ) { case 'coreactivity_online': - if ( Feature::instance()->is_user_online( $user_id ) ) { + if ( Feature::i()->is_user_online( $user_id ) ) { return '
' . __( 'Online', 'coreactivity' ) . '
'; } else { return '
' . __( 'Offline', 'coreactivity' ) . '
'; } case 'coreactivity_activity': - $last_activity = Feature::instance()->get_user_last_activity( $user_id ); + $last_activity = Feature::i()->get_user_last_activity( $user_id ); if ( $last_activity == 0 ) { return '/'; @@ -78,7 +83,7 @@ public function column_values( $value, $column, $user_id ) { return gmdate( 'Y.m.d', $timestamp ) . '
@ ' . gmdate( 'H:i:s', $timestamp ); } case 'coreactivity_login': - $last_login = Feature::instance()->get_user_last_login( $user_id ); + $last_login = Feature::i()->get_user_last_login( $user_id ); if ( $last_login == 0 ) { return '/'; diff --git a/core/admin/panel/About.php b/core/admin/panel/About.php index 4186b7e..35ad516 100644 --- a/core/admin/panel/About.php +++ b/core/admin/panel/About.php @@ -2,7 +2,7 @@ namespace Dev4Press\Plugin\CoreActivity\Admin\Panel; -use Dev4Press\v54\Core\UI\Admin\PanelAbout; +use Dev4Press\v55\Core\UI\Admin\PanelAbout; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -11,7 +11,7 @@ class About extends PanelAbout { protected bool $history = true; - protected function init_default_subpanels() { + protected function init_default_subpanels() : void { parent::init_default_subpanels(); $this->subpanels = array_slice( $this->subpanels(), 0, 2 ) + diff --git a/core/admin/panel/Dashboard.php b/core/admin/panel/Dashboard.php index 9698660..d9771e5 100644 --- a/core/admin/panel/Dashboard.php +++ b/core/admin/panel/Dashboard.php @@ -3,8 +3,8 @@ namespace Dev4Press\Plugin\CoreActivity\Admin\Panel; use Dev4Press\Plugin\CoreActivity\Basic\Render; -use Dev4Press\v54\Core\Scope; -use Dev4Press\v54\Core\UI\Admin\PanelDashboard; +use Dev4Press\v55\Core\Scope; +use Dev4Press\v55\Core\UI\Admin\PanelDashboard; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -14,7 +14,7 @@ class Dashboard extends PanelDashboard { public function __construct( $admin ) { parent::__construct( $admin ); - if ( Scope::instance()->is_master_network_admin() ) { + if ( Scope::i()->is_master_network_admin() ) { $this->sidebar_links['plugin']['events'] = array( 'icon' => $this->a()->menu_items['events']['icon'], 'class' => 'button-primary', @@ -34,13 +34,13 @@ public function __construct( $admin ) { $this->sidebar_links['plugin']['logs'] = array( 'icon' => $this->a()->menu_items['logs']['icon'], - 'class' => Scope::instance()->is_master_network_admin() ? 'button-primary' : 'button-secondary', + 'class' => Scope::i()->is_master_network_admin() ? 'button-primary' : 'button-secondary', 'url' => $this->a()->panel_url( 'logs', '', '', $this->a()->get_menu_item_network_url_flag( 'logs' ) ), 'label' => __( 'Logs', 'coreactivity' ), 'scope' => $this->a()->menu_items['logs']['scope'] ?? array(), ); - if ( ! Scope::instance()->is_master_network_admin() ) { + if ( ! Scope::i()->is_master_network_admin() ) { unset( $this->sidebar_links['basic']['settings'], $this->sidebar_links['basic']['tools'] ); } } diff --git a/core/admin/panel/Events.php b/core/admin/panel/Events.php index 2f1c59c..6359f32 100644 --- a/core/admin/panel/Events.php +++ b/core/admin/panel/Events.php @@ -16,7 +16,7 @@ class Events extends Panel { protected bool $form_multiform = false; protected string $form_method = 'get'; - public function screen_options_show() { + public function screen_options_show() : void { add_screen_option( 'per_page', array( 'label' => __( 'Rows', 'coreactivity' ), 'default' => 50, diff --git a/core/admin/panel/Logs.php b/core/admin/panel/Logs.php index 0dd565b..84a0000 100644 --- a/core/admin/panel/Logs.php +++ b/core/admin/panel/Logs.php @@ -17,7 +17,7 @@ class Logs extends Panel { protected bool $form_multiform = false; protected string $form_method = 'get'; - public function screen_options_show() { + public function screen_options_show() : void { add_screen_option( 'per_page', array( 'label' => __( 'Rows', 'coreactivity' ), 'default' => 25, diff --git a/core/admin/panel/Settings.php b/core/admin/panel/Settings.php index a312c86..592e8fd 100644 --- a/core/admin/panel/Settings.php +++ b/core/admin/panel/Settings.php @@ -2,14 +2,14 @@ namespace Dev4Press\Plugin\CoreActivity\Admin\Panel; -use Dev4Press\v54\Core\UI\Admin\PanelSettings; +use Dev4Press\v55\Core\UI\Admin\PanelSettings; if ( ! defined( 'ABSPATH' ) ) { exit; } class Settings extends PanelSettings { - public $settings_class = '\\Dev4Press\\Plugin\\CoreActivity\\Admin\\Settings'; + public string $settings_class = '\\Dev4Press\\Plugin\\CoreActivity\\Admin\\Settings'; public function __construct( $admin ) { parent::__construct( $admin ); diff --git a/core/admin/panel/Tools.php b/core/admin/panel/Tools.php index 27922bf..d2977a2 100644 --- a/core/admin/panel/Tools.php +++ b/core/admin/panel/Tools.php @@ -2,14 +2,14 @@ namespace Dev4Press\Plugin\CoreActivity\Admin\Panel; -use Dev4Press\v54\Core\UI\Admin\PanelTools; +use Dev4Press\v55\Core\UI\Admin\PanelTools; if ( ! defined( 'ABSPATH' ) ) { exit; } class Tools extends PanelTools { - protected function init_default_subpanels() { + protected function init_default_subpanels() : void { parent::init_default_subpanels(); $this->subpanels = array_slice( $this->subpanels, 0, 2 ) + diff --git a/core/admin/panel/Wizard.php b/core/admin/panel/Wizard.php index c245571..13f9f4d 100644 --- a/core/admin/panel/Wizard.php +++ b/core/admin/panel/Wizard.php @@ -2,7 +2,7 @@ namespace Dev4Press\Plugin\CoreActivity\Admin\Panel; -use Dev4Press\v54\Core\UI\Admin\PanelWizard; +use Dev4Press\v55\Core\UI\Admin\PanelWizard; if ( ! defined( 'ABSPATH' ) ) { exit; diff --git a/core/autoload.php b/core/autoload.php index dbcf2a9..9956424 100644 --- a/core/autoload.php +++ b/core/autoload.php @@ -8,7 +8,7 @@ function dev4press_plugin_coreactivity_autoload( $class ) { $path = __DIR__ . '/'; $base = 'Dev4Press\\Plugin\\CoreActivity\\'; - dev4press_v54_autoload_for_plugin( $class, $base, $path ); + dev4press_v55_autoload_for_plugin( $class, $base, $path ); } spl_autoload_register( 'dev4press_plugin_coreactivity_autoload' ); diff --git a/core/base/Component.php b/core/base/Component.php index 162a296..f3b79d9 100644 --- a/core/base/Component.php +++ b/core/base/Component.php @@ -4,7 +4,7 @@ use Dev4Press\Plugin\CoreActivity\Log\Activity; use Dev4Press\Plugin\CoreActivity\Log\Core; -use Dev4Press\v54\Core\Quick\WPR; +use Dev4Press\v55\Core\Quick\WPR; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -49,7 +49,7 @@ abstract class Component { protected $log_values_if_array_or_object = false; protected $plugin_file = ''; - public function __construct() { + protected function __construct() { $this->log_values_if_array_or_object = coreactivity_settings()->get( 'log_values_if_array_or_object' ); add_action( 'coreactivity_component_registration', array( $this, 'register_component' ) ); @@ -63,8 +63,12 @@ public function __construct() { } } - /** @return static */ - public static function instance() { + /** @deprecated 3.0 Use self::i() instead. */ + public static function instance() : static { + return static::i(); + } + + public static function i() : static { static $instance = array(); if ( ! isset( $instance[ static::class ] ) ) { @@ -141,12 +145,12 @@ public function init() { public function log( string $event, array $data = array(), array $meta = array() ) : int { if ( $this->is_active( $event ) ) { - $event_id = Activity::instance()->get_event_id( $this->code(), $event ); + $event_id = Activity::i()->get_event_id( $this->code(), $event ); if ( $event_id > 0 ) { $data = $this->prepare_data_for_log( $event, $data ); - return Core::instance()->log( $event_id, $data, $meta ); + return Core::i()->log( $event_id, $data, $meta ); } } @@ -158,7 +162,7 @@ public function is_registered( string $event ) : bool { } public function is_active( string $event ) : bool { - return Activity::instance()->is_event_active( $this->code(), $event ); + return Activity::i()->is_event_active( $this->code(), $event ); } public function is_any_event_active() : bool { diff --git a/core/basic/AdminBar.php b/core/basic/AdminBar.php index 67bf933..6db0242 100644 --- a/core/basic/AdminBar.php +++ b/core/basic/AdminBar.php @@ -74,7 +74,7 @@ public function integration() { global $wp_admin_bar; $show = ''; - $count = coreactivity_settings()->get( 'admin_bar_indicator' ) ? DB::instance()->get_new_log_entries_since_last_log_visit() : 0; + $count = coreactivity_settings()->get( 'admin_bar_indicator' ) ? DB::i()->get_new_log_entries_since_last_log_visit() : 0; $title = '' . __( 'coreActivity', 'coreactivity' ) . ''; diff --git a/core/basic/Cache.php b/core/basic/Cache.php index 54687d8..a6ee912 100644 --- a/core/basic/Cache.php +++ b/core/basic/Cache.php @@ -2,7 +2,7 @@ namespace Dev4Press\Plugin\CoreActivity\Basic; -use Dev4Press\v54\Core\Cache\Core; +use Dev4Press\v55\Core\Cache\Core; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -13,7 +13,7 @@ class Cache extends Core { public function get_all_registered_events() { if ( ! $this->in( 'events', 'registered' ) ) { - $events = DB::instance()->get_all_registered_events(); + $events = DB::i()->get_all_registered_events(); $this->set( 'events', 'registered', $events ); } diff --git a/core/basic/DB.php b/core/basic/DB.php index f4b58d4..eed865b 100644 --- a/core/basic/DB.php +++ b/core/basic/DB.php @@ -3,7 +3,7 @@ namespace Dev4Press\Plugin\CoreActivity\Basic; use Dev4Press\Plugin\CoreActivity\Log\Users; -use Dev4Press\v54\Core\Plugins\DB as BaseDB; +use Dev4Press\v55\Core\Plugins\DB as BaseDB; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -344,7 +344,7 @@ public function get_users_without_activity_keys() : array { } public function get_new_log_entries_since_last_log_visit() : int { - $timestamp = Users::instance()->get_user_last_log_visit(); + $timestamp = Users::i()->get_user_last_log_visit(); if ( $timestamp > 0 ) { $datetime = coreactivity()->datetime()->mysql_date( true, $timestamp ); diff --git a/core/basic/Information.php b/core/basic/Information.php index 8a84805..09dcebc 100644 --- a/core/basic/Information.php +++ b/core/basic/Information.php @@ -2,7 +2,7 @@ namespace Dev4Press\Plugin\CoreActivity\Basic; -use Dev4Press\v54\Core\Plugins\Information as BaseInformation; +use Dev4Press\v55\Core\Plugins\Information as BaseInformation; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -11,11 +11,11 @@ class Information extends BaseInformation { public string $code = 'coreactivity'; - public string $version = '2.8'; - public int $build = 2800; + public string $version = '3.0'; + public int $build = 3000; public string $edition = 'free'; public string $status = 'stable'; - public string $updated = '2025.06.14'; + public string $updated = '2026.02.06'; public string $released = '2023.09.06'; public string $github_url = 'https://github.com/dev4press/coreactivity'; diff --git a/core/basic/InstallDB.php b/core/basic/InstallDB.php index 54dc639..9991267 100644 --- a/core/basic/InstallDB.php +++ b/core/basic/InstallDB.php @@ -2,7 +2,7 @@ namespace Dev4Press\Plugin\CoreActivity\Basic; -use Dev4Press\v54\Core\Plugins\InstallDB as BaseInstallDB; +use Dev4Press\v55\Core\Plugins\InstallDB as BaseInstallDB; if ( ! defined( 'ABSPATH' ) ) { exit; diff --git a/core/basic/Jobs.php b/core/basic/Jobs.php index fdd4ce9..9c4a204 100644 --- a/core/basic/Jobs.php +++ b/core/basic/Jobs.php @@ -6,14 +6,14 @@ use Dev4Press\Plugin\CoreActivity\Log\GEO as LogLocation; use Dev4Press\Plugin\CoreActivity\Log\Notifications; use Dev4Press\Plugin\CoreActivity\Log\Statistics; -use Dev4Press\v54\Core\Quick\WPR; +use Dev4Press\v55\Core\Quick\WPR; if ( ! defined( 'ABSPATH' ) ) { exit; } class Jobs { - public function __construct() { + private function __construct() { add_action( 'coreactivity_instant_notification', array( $this, 'instant_notification' ) ); if ( is_main_site() ) { @@ -30,7 +30,12 @@ public function __construct() { } } - public static function instance() : Jobs { + /** @deprecated 3.0 Use self::i() instead. */ + public static function instance() : static { + return static::i(); + } + + public static function i() : static { static $instance = null; if ( ! isset( $instance ) ) { @@ -71,11 +76,11 @@ public function jobs_scheduler_init() { wp_schedule_event( $cron_time, 'weekly', 'coreactivity_weekly_maintenance' ); } - Notifications::instance()->schedule_digests(); + Notifications::i()->schedule_digests(); } public function instant_notification() { - Notifications::instance()->scheduled_instant(); + Notifications::i()->scheduled_instant(); } public function daily_maintenance() { @@ -85,17 +90,17 @@ public function daily_maintenance() { } public function daily_digest() { - Notifications::instance()->scheduled_daily(); + Notifications::i()->scheduled_daily(); } public function daily_statistics() { - Statistics::instance()->daily_update(); + Statistics::i()->daily_update(); } public function weekly_digest() { coreactivity()->clean_cron_jobs(); - Notifications::instance()->scheduled_weekly(); + Notifications::i()->scheduled_weekly(); } public function weekly_maintenance() { @@ -103,21 +108,21 @@ public function weekly_maintenance() { } public function task_log_purge() { - Cleanup::instance()->auto_cleanup_log(); + Cleanup::i()->auto_cleanup_log(); } public function task_geo_db_update() { if ( coreactivity()->s()->get( 'geolocation_method' ) == 'ip2location' ) { - LogLocation::instance()->ip2location_db_update(); + LogLocation::i()->ip2location_db_update(); } if ( coreactivity()->s()->get( 'geolocation_method' ) == 'geoip2' ) { - LogLocation::instance()->geoip2_db_update(); + LogLocation::i()->geoip2_db_update(); } } public function task_users_meta() { - $ids = DB::instance()->get_users_without_activity_keys(); + $ids = DB::i()->get_users_without_activity_keys(); foreach ( $ids as $id ) { $id = absint( $id ); diff --git a/core/basic/Plugin.php b/core/basic/Plugin.php index da652fc..ed4bab7 100644 --- a/core/basic/Plugin.php +++ b/core/basic/Plugin.php @@ -9,8 +9,8 @@ use Dev4Press\Plugin\CoreActivity\Log\Metas as LogMetas; use Dev4Press\Plugin\CoreActivity\Log\Notifications; use Dev4Press\Plugin\CoreActivity\Log\Users as LogUsers; -use Dev4Press\v54\Core\Plugins\Core; -use Dev4Press\v54\Core\Quick\WPR; +use Dev4Press\v55\Core\Plugins\Core; +use Dev4Press\v55\Core\Quick\WPR; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -21,7 +21,7 @@ class Plugin extends Core { public string $plugin = 'coreactivity'; - public function __construct() { + protected function __construct() { $this->url = COREACTIVITY_URL; $this->path = COREACTIVITY_PATH; @@ -47,15 +47,15 @@ public function l() { public function run() { do_action( 'coreactivity_load_settings' ); - LogActivity::instance(); - LogLocation::instance(); - LogMetas::instance(); - LogCore::instance(); - LogUsers::instance(); + LogActivity::i(); + LogLocation::i(); + LogMetas::i(); + LogCore::i(); + LogUsers::i(); do_action( 'coreactivity_plugin_core_ready' ); - Notifications::instance(); + Notifications::i(); add_action( 'init', array( $this, 'init' ), 100 ); add_action( 'debugpress-tracker-plugins-call', array( $this, 'debugpress' ) ); @@ -65,21 +65,21 @@ public function run() { } } - public function after_setup_theme() { + public function after_setup_theme() : void { do_action( 'coreactivity_prepare' ); - Jobs::instance(); + Jobs::i(); } public function debugpress() { if ( function_exists( 'debugpress_store_for_plugin' ) ) { debugpress_store_for_plugin( COREACTIVITY_FILE, array( 'data' => array( - 'components' => Activity::instance()->get_all_components(), - 'events' => Activity::instance()->get_all_events(), - 'statistics' => Activity::instance()->statistics, + 'components' => Activity::i()->get_all_components(), + 'events' => Activity::i()->get_all_events(), + 'statistics' => Activity::i()->statistics, ), - 'log' => LogCore::instance()->get_current_page_log(), + 'log' => LogCore::i()->get_current_page_log(), ) ); } } diff --git a/core/basic/Render.php b/core/basic/Render.php index f6b1bf8..ca2d760 100644 --- a/core/basic/Render.php +++ b/core/basic/Render.php @@ -11,13 +11,13 @@ class Render { public static function panel_header_ip_block() : string { - GEO::instance()->bulk( array( Core::instance()->get( 'server_ip' ), Core::instance()->get( 'ip' ) ) ); + GEO::i()->bulk( array( Core::i()->get( 'server_ip' ), Core::i()->get( 'ip' ) ) ); - $_server_ip = Core::instance()->get( 'server_ip' ); - $_visitor_ip = Core::instance()->get( 'ip' ); + $_server_ip = Core::i()->get( 'server_ip' ); + $_visitor_ip = Core::i()->get( 'ip' ); - $server_ip = empty( $_server_ip ) ? null : GEO::instance()->locate( $_server_ip ); - $visitor_ip = empty( $_visitor_ip ) ? null : GEO::instance()->locate( $_visitor_ip ); + $server_ip = empty( $_server_ip ) ? null : GEO::i()->locate( $_server_ip ); + $visitor_ip = empty( $_visitor_ip ) ? null : GEO::i()->locate( $_visitor_ip ); $render = '
  • '; $render .= '
    '; diff --git a/core/basic/Settings.php b/core/basic/Settings.php index 517ec9d..84ca3b9 100644 --- a/core/basic/Settings.php +++ b/core/basic/Settings.php @@ -2,7 +2,7 @@ namespace Dev4Press\Plugin\CoreActivity\Basic; -use Dev4Press\v54\Core\Plugins\Settings as BaseSettings; +use Dev4Press\v55\Core\Plugins\Settings as BaseSettings; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -130,7 +130,7 @@ protected function constructor() { } protected function _install_db() { - return InstallDB::instance(); + return InstallDB::i(); } public function is_in_exception_list( $list, $value ) : bool { diff --git a/core/basic/Wizard.php b/core/basic/Wizard.php index a45cfd3..7180cc2 100644 --- a/core/basic/Wizard.php +++ b/core/basic/Wizard.php @@ -2,7 +2,7 @@ namespace Dev4Press\Plugin\CoreActivity\Basic; -use Dev4Press\v54\Core\Plugins\Wizard as CoreWizard; +use Dev4Press\v55\Core\Plugins\Wizard as CoreWizard; if ( ! defined( 'ABSPATH' ) ) { exit; diff --git a/core/bridge.php b/core/bridge.php index eef472d..89dbd44 100644 --- a/core/bridge.php +++ b/core/bridge.php @@ -12,7 +12,7 @@ } function coreactivity() : Plugin { - return Plugin::instance(); + return Plugin::i(); } function coreactivity_settings() : Settings { @@ -20,17 +20,17 @@ function coreactivity_settings() : Settings { } function coreactivity_db() : DB { - return DB::instance(); + return DB::i(); } function coreactivity_admin() : AdminPlugin { - return AdminPlugin::instance(); + return AdminPlugin::i(); } function coreactivity_ajax() : AJAX { - return AJAX::instance(); + return AJAX::i(); } function coreactivity_wizard() : Wizard { - return Wizard::instance(); + return Wizard::i(); } diff --git a/core/build.php b/core/build.php deleted file mode 100644 index 1955c51..0000000 --- a/core/build.php +++ /dev/null @@ -1 +0,0 @@ -get( 'request' ); + $url = Core::i()->get( 'request' ); $query = wp_parse_url( $url, PHP_URL_QUERY ); $query = ! empty( $query ) ? trim( $query ) : ''; diff --git a/core/components/Network.php b/core/components/Network.php index 01bd49f..b5c784a 100644 --- a/core/components/Network.php +++ b/core/components/Network.php @@ -6,6 +6,10 @@ use WP_Error; use WP_User; +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + class Network extends Component { protected $plugin = 'coreactivity'; protected $name = 'network'; diff --git a/core/components/Notification.php b/core/components/Notification.php index f97eca4..1ad17fc 100644 --- a/core/components/Notification.php +++ b/core/components/Notification.php @@ -3,7 +3,7 @@ namespace Dev4Press\Plugin\CoreActivity\Components; use Dev4Press\Plugin\CoreActivity\Base\Component; -use Dev4Press\v54\Core\Mailer\Detection; +use Dev4Press\v55\Core\Mailer\Detection; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -48,7 +48,7 @@ public function init() { /** * Filter the list of notification types not to log. Notifications belonging to notification types on this list will not be tracked or logged. * All supported notification types are keys of the array returned by the following call: - * `\Dev4Press\v54\Core\Mailer\Detection::instance()->get_supported_types()` + * `\Dev4Press\v55\Core\Mailer\Detection::i()->get_supported_types()` * * @param array $notifications name of the post types not to log, by default is empty array. * @@ -58,7 +58,7 @@ public function init() { } public function tracking() { - Detection::instance(); + Detection::i(); add_action( 'dev4press_mailer_notification_detected', array( $this, 'prepare_detection' ) ); diff --git a/core/components/Option.php b/core/components/Option.php index 39bd318..8bc5da4 100644 --- a/core/components/Option.php +++ b/core/components/Option.php @@ -163,7 +163,7 @@ class Option extends Component { protected $transient_value; public function init() { - $this->monitor[] = DB::instance()->prefix() . 'user_roles'; + $this->monitor[] = DB::i()->prefix() . 'user_roles'; $this->exceptions = coreactivity_settings()->get( 'exceptions_option_list' ); $this->transient_value = coreactivity_settings()->get( 'log_transient_value' ); diff --git a/core/components/RESTAPI.php b/core/components/RESTAPI.php index 2109261..3594ec3 100644 --- a/core/components/RESTAPI.php +++ b/core/components/RESTAPI.php @@ -115,7 +115,7 @@ public function pre_serve_request( $served, $response, $request, $server ) : boo $this->_log( 'rest-edit-item', $request->get_route(), $rest ); } else { $log = true; - if ( $this->settings['skip_own_server_read'] && Core::instance()->get( 'is_server' ) ) { + if ( $this->settings['skip_own_server_read'] && Core::i()->get( 'is_server' ) ) { $log = false; } diff --git a/core/components/User.php b/core/components/User.php index 4068c75..1567d86 100644 --- a/core/components/User.php +++ b/core/components/User.php @@ -3,7 +3,7 @@ namespace Dev4Press\Plugin\CoreActivity\Components; use Dev4Press\Plugin\CoreActivity\Base\Component; -use Dev4Press\v54\Core\Quick\Request; +use Dev4Press\v55\Core\Quick\Request; use WP_Error; use WP_User; diff --git a/core/components/WordPress.php b/core/components/WordPress.php index 17bff4d..46a3326 100644 --- a/core/components/WordPress.php +++ b/core/components/WordPress.php @@ -3,8 +3,8 @@ namespace Dev4Press\Plugin\CoreActivity\Components; use Dev4Press\Plugin\CoreActivity\Base\Component; -use Dev4Press\v54\Core\Helpers\Source; -use Dev4Press\v54\WordPress as LibWordPress; +use Dev4Press\v55\Core\Helpers\Source; +use Dev4Press\v55\WordPress as LibWordPress; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -109,7 +109,7 @@ protected function get_events() : array { public function prepare_update( $message ) { if ( empty( $this->wp_version ) ) { - $this->wp_version = LibWordPress::instance()->version(); + $this->wp_version = LibWordPress::i()->version(); } return $message; @@ -258,7 +258,7 @@ private function caller( $functions ) : array { } if ( ! empty( $file_path ) ) { - $result = Source::instance()->origin( $file_path ); + $result = Source::i()->origin( $file_path ); $result['line'] = $file_line; return $result; diff --git a/core/functions.php b/core/functions.php index fd58647..2e54bad 100644 --- a/core/functions.php +++ b/core/functions.php @@ -14,7 +14,7 @@ * * @return void */ -function coreactivity_change_logging_status( bool $status ) { +function coreactivity_change_logging_status( bool $status ) : void { coreactivity_settings()->set( 'main_events_log_switch', $status, 'settings', true ); } @@ -25,20 +25,20 @@ function coreactivity_change_logging_status( bool $status ) { * @param string $event name of the event * @param string $status status for the event ('active', 'inactive') * - * @return bool TRUE if the status has been changed, FALSE if the event is not found or status is not valid. + * @return bool TRUE if the status has been changed, FALSE if the event is not found or the status is not valid. */ function coreactivity_change_event_status( string $component, string $event, string $status ) : bool { if ( ! in_array( $status, array( 'active', 'inactive' ) ) ) { return false; } - $event_id = Activity::instance()->get_event_id( $component, $event ); + $event_id = Activity::i()->get_event_id( $component, $event ); if ( $event_id == 0 ) { return false; } - DB::instance()->change_event_status( $event_id, $status ); + DB::i()->change_event_status( $event_id, $status ); return true; } @@ -74,7 +74,7 @@ function coreactivity_view_dialog_tabs() : array { ) ); } -function coreactivity_get_user_by( $field, $value ) { +function coreactivity_get_user_by( $field, $value ) : object|bool { $userdata = WP_User::get_data_by( $field, $value ); if ( ! $userdata ) { diff --git a/core/location/GeoIP2.php b/core/location/GeoIP2.php index 54b8b3e..e7b9646 100644 --- a/core/location/GeoIP2.php +++ b/core/location/GeoIP2.php @@ -3,9 +3,9 @@ namespace Dev4Press\Plugin\CoreActivity\Location; use Dev4Press\Plugin\CoreActivity\Log\GEO; -use Dev4Press\v54\Core\Helpers\IP; -use Dev4Press\v54\Service\GEOIP\Location; -use Dev4Press\v54\Service\GEOIP\Locator; +use Dev4Press\v55\Core\Helpers\IP; +use Dev4Press\v55\Service\GEOIP\Location; +use Dev4Press\v55\Service\GEOIP\Locator; use Exception; use GeoIp2\Database\Reader; @@ -21,7 +21,7 @@ public function locate( string $ip ) : ?Location { ); } - $db = GEO::instance()->geoip2(); + $db = GEO::i()->geoip2(); if ( $db instanceof Reader ) { $data = array( diff --git a/core/location/IP2Location.php b/core/location/IP2Location.php index 4266e3d..25815ec 100644 --- a/core/location/IP2Location.php +++ b/core/location/IP2Location.php @@ -3,9 +3,9 @@ namespace Dev4Press\Plugin\CoreActivity\Location; use Dev4Press\Plugin\CoreActivity\Log\GEO; -use Dev4Press\v54\Core\Helpers\IP; -use Dev4Press\v54\Service\GEOIP\Location; -use Dev4Press\v54\Service\GEOIP\Locator; +use Dev4Press\v55\Core\Helpers\IP; +use Dev4Press\v55\Service\GEOIP\Location; +use Dev4Press\v55\Service\GEOIP\Locator; use IP2Location\Database; class IP2Location extends Locator { @@ -32,7 +32,7 @@ public function locate( string $ip ) : ?Location { ); } - $db = GEO::instance()->ip2location(); + $db = GEO::i()->ip2location(); if ( $db instanceof Database ) { $records = $db->lookup( $ip, Database::ALL ); diff --git a/core/log/Activity.php b/core/log/Activity.php index 9f904f1..2eee120 100644 --- a/core/log/Activity.php +++ b/core/log/Activity.php @@ -32,7 +32,7 @@ use Dev4Press\Plugin\CoreActivity\Plugins\SweepPress; use Dev4Press\Plugin\CoreActivity\Plugins\UserSwitching; use Dev4Press\Plugin\CoreActivity\Plugins\WooCommerce; -use Dev4Press\v54\Core\Quick\Str; +use Dev4Press\v55\Core\Quick\Str; use stdClass; if ( ! defined( 'ABSPATH' ) ) { @@ -64,13 +64,18 @@ class Activity { private $list = array(); private $object_types = array(); - public function __construct() { + private function __construct() { add_action( 'coreactivity_plugin_core_ready', array( $this, 'ready' ), 15 ); add_action( 'coreactivity_prepare', array( $this, 'prepare' ), 15 ); add_action( 'coreactivity_init', array( $this, 'init' ), 1 ); } - public static function instance() : Activity { + /** @deprecated 3.0 Use self::i() instead. */ + public static function instance() : static { + return static::i(); + } + + public static function i() : static { static $instance = null; if ( ! isset( $instance ) ) { @@ -81,7 +86,7 @@ public static function instance() : Activity { } public function ready() { - Upgrader::instance(); + Upgrader::i(); $this->_init_events(); $this->_init_components(); @@ -92,7 +97,7 @@ public function prepare() { do_action( 'coreactivity_component_registration', $this ); do_action( 'coreactivity_events_registration', $this ); - Cache::instance()->set( 'events', 'registered', $this->events ); + Cache::i()->set( 'events', 'registered', $this->events ); foreach ( $this->components as $component ) { $this->statistics['components']['total'] ++; @@ -438,7 +443,7 @@ public function event_notification_toggle( int $event_id, string $notification, $rules = $event->rules; $rules['notifications'] = $event->notifications; - DB::instance()->change_event_rules( $event_id, $rules ); + DB::i()->change_event_rules( $event_id, $rules ); return $event->notifications[ $notification ]; } @@ -466,7 +471,7 @@ public function events_notification_bulk_control( $instant = 'skip', $daily = 's $rules = $event->rules; $rules['notifications'] = $event->notifications; - DB::instance()->change_event_rules( $event_id, $rules ); + DB::i()->change_event_rules( $event_id, $rules ); } } @@ -520,7 +525,7 @@ public function register_event( string $component, string $event, array $args = } else { $category = $this->components[ $component ]->category; - $id = DB::instance()->add_new_event( $category, $component, $event, $obj->status, $rules ); + $id = DB::i()->add_new_event( $category, $component, $event, $obj->status, $rules ); if ( $id > 0 ) { $obj->event_id = $id; @@ -545,7 +550,7 @@ private function _generate_component_label( string $component ) : string { } private function _init_events() { - $events = Cache::instance()->get_all_registered_events(); + $events = Cache::i()->get_all_registered_events(); foreach ( $events as $event ) { if ( ! isset( $this->events[ $event->component ] ) ) { @@ -592,36 +597,36 @@ private function _init_events() { } private function _init_components() { - Internal::instance(); - Network::instance(); - Sitemeta::instance(); - WordPress::instance(); - Option::instance(); - Notification::instance(); - Error::instance(); - Plugin::instance(); - Theme::instance(); - User::instance(); - Post::instance(); - Term::instance(); - Comment::instance(); - Attachment::instance(); - Privacy::instance(); - RESTAPI::instance(); + Internal::i(); + Network::i(); + Sitemeta::i(); + WordPress::i(); + Option::i(); + Notification::i(); + Error::i(); + Plugin::i(); + Theme::i(); + User::i(); + Post::i(); + Term::i(); + Comment::i(); + Attachment::i(); + Privacy::i(); + RESTAPI::i(); } private function _init_plugins() { - bbPress::instance(); - BuddyPress::instance(); - ContactForm7::instance(); - DebugPress::instance(); - DuplicatePost::instance(); - Forminator::instance(); - GDForumManager::instance(); - GravityForms::instance(); - Jetpack::instance(); - SweepPress::instance(); - UserSwitching::instance(); - WooCommerce::instance(); + bbPress::i(); + BuddyPress::i(); + ContactForm7::i(); + DebugPress::i(); + DuplicatePost::i(); + Forminator::i(); + GDForumManager::i(); + GravityForms::i(); + Jetpack::i(); + SweepPress::i(); + UserSwitching::i(); + WooCommerce::i(); } } diff --git a/core/log/Cleanup.php b/core/log/Cleanup.php index 27a3675..f75c6cc 100644 --- a/core/log/Cleanup.php +++ b/core/log/Cleanup.php @@ -9,10 +9,15 @@ } class Cleanup { - public function __construct() { + private function __construct() { } - public static function instance() : Cleanup { + /** @deprecated 3.0 Use self::i() instead. */ + public static function instance() : static { + return static::i(); + } + + public static function i() : static { static $instance = null; if ( ! isset( $instance ) ) { @@ -47,24 +52,24 @@ public function auto_cleanup_log() { } private function cleanup( $interval, $value, $events = null ) : int { - $sql = "DELETE FROM " . DB::instance()->logs; + $sql = "DELETE FROM " . DB::i()->logs; $where = array(); if ( $value > 0 ) { - $where[] = DB::instance()->prepare( "logged < DATE_SUB(NOW(), INTERVAL %d " . ( $interval == 'd' ? 'DAY' : 'MONTH' ) . ")", $value ); + $where[] = DB::i()->prepare( "logged < DATE_SUB(NOW(), INTERVAL %d " . ( $interval == 'd' ? 'DAY' : 'MONTH' ) . ")", $value ); } if ( is_array( $events ) && ! empty( $events ) ) { - $where[] = 'event_id IN (' . DB::instance()->prepare_in_list( $events, '%d' ) . ')'; + $where[] = 'event_id IN (' . DB::i()->prepare_in_list( $events, '%d' ) . ')'; } if ( ! empty( $where ) ) { $sql .= " WHERE " . join( " AND ", $where ); } - $rows = DB::instance()->query( $sql ); + $rows = DB::i()->query( $sql ); - DB::instance()->remove_log_meta_orphans(); + DB::i()->remove_log_meta_orphans(); return is_numeric( $rows ) ? absint( $rows ) : 0; } diff --git a/core/log/Core.php b/core/log/Core.php index 5452de6..b16fa5c 100644 --- a/core/log/Core.php +++ b/core/log/Core.php @@ -3,13 +3,13 @@ namespace Dev4Press\Plugin\CoreActivity\Log; use Dev4Press\Plugin\CoreActivity\Basic\DB; -use Dev4Press\v54\Core\DateTime; -use Dev4Press\v54\Core\Helpers\IP; -use Dev4Press\v54\Core\Quick\Sanitize; -use Dev4Press\v54\Core\Quick\URL; -use Dev4Press\v54\Core\Scope; -use Dev4Press\v54\Service\GEOIP\Location; -use Dev4Press\v54\WordPress; +use Dev4Press\v55\Core\DateTime; +use Dev4Press\v55\Core\Helpers\IP; +use Dev4Press\v55\Core\Quick\Sanitize; +use Dev4Press\v55\Core\Quick\URL; +use Dev4Press\v55\Core\Scope; +use Dev4Press\v55\Service\GEOIP\Location; +use Dev4Press\v55\WordPress; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -44,7 +44,7 @@ class Core { 'SEARCH', ); - public function __construct() { + private function __construct() { $this->cached_data = array( 'ip' => IP::visitor( coreactivity_settings()->get( 'ip_visitor_forwarded' ) ), 'remote_addr' => IP::visitor( false ), @@ -54,8 +54,8 @@ public function __construct() { 'method' => $this->get_request_method(), 'protocol' => wp_get_server_protocol(), 'request' => URL::current_url_request(), - 'context' => WordPress::instance()->context(), - 'multisite' => Scope::instance()->is_multisite(), + 'context' => WordPress::i()->context(), + 'multisite' => Scope::i()->is_multisite(), 'scope' => 'blog', 'local' => false, ); @@ -80,7 +80,7 @@ public function __construct() { } if ( $this->cached_data['multisite'] ) { - if ( Scope::instance()->is_network_admin() ) { + if ( Scope::i()->is_network_admin() ) { $this->cached_data['scope'] = 'network'; } } @@ -98,7 +98,12 @@ public function __construct() { add_action( 'coreactivity_plugin_core_ready', array( $this, 'ready' ), 20 ); } - public static function instance() : Core { + /** @deprecated 3.0 Use self::i() instead. */ + public static function instance() : static { + return static::i(); + } + + public static function i() : static { static $instance = null; if ( ! isset( $instance ) ) { @@ -112,11 +117,11 @@ public function ready() { } public function scope() : Scope { - return Scope::instance(); + return Scope::i(); } public function wp() : WordPress { - return WordPress::instance(); + return WordPress::i(); } public function log( int $event_id, array $data = array(), array $meta = array() ) : int { @@ -124,7 +129,7 @@ public function log( int $event_id, array $data = array(), array $meta = array() return - 1; } - $event = Activity::instance()->get_event_by_id( $event_id ); + $event = Activity::i()->get_event_by_id( $event_id ); /** * Main control filter controlling if the event logging will proceed or not. Only hook to this filter if you want to control the logging process. @@ -145,8 +150,8 @@ public function log( int $event_id, array $data = array(), array $meta = array() $meta = $this->prepare_meta( $meta ); if ( coreactivity_settings()->get( 'skip_duplicated' ) ) { - if ( Activity::instance()->can_event_skip_duplicates( $event_id ) ) { - $hash = $this->calculate_duplication_hash( $data, $meta, Activity::instance()->get_event_skip_duplicates_request( $event_id ) ); + if ( Activity::i()->can_event_skip_duplicates( $event_id ) ) { + $hash = $this->calculate_duplication_hash( $data, $meta, Activity::i()->get_event_skip_duplicates_request( $event_id ) ); if ( ! empty( $this->duplicates ) && in_array( $hash, $this->duplicates ) ) { return 0; @@ -161,7 +166,7 @@ public function log( int $event_id, array $data = array(), array $meta = array() $meta = $this->prepare_device( $meta ); if ( $this->geo_code || $this->geo_meta ) { - $geo = GEO::instance()->locate( $data['ip'] ); + $geo = GEO::i()->locate( $data['ip'] ); if ( $geo instanceof Location ) { if ( ! isset( $data['country_code'] ) && ! empty( $geo->country_code ) ) { @@ -182,7 +187,7 @@ public function log( int $event_id, array $data = array(), array $meta = array() $meta['remote_addr'] = $this->get( 'remote_addr' ); } - $id = DB::instance()->log_event( $data, $meta ); + $id = DB::i()->log_event( $data, $meta ); if ( $id ) { /** @@ -275,7 +280,7 @@ private function prepare_data( int $event_id, array $data = array() ) : array { } if ( ! isset( $data['logged'] ) ) { - $data['logged'] = DateTime::instance()->mysql_date(); + $data['logged'] = DateTime::i()->mysql_date(); } if ( ! isset( $data['ip'] ) ) { @@ -337,7 +342,7 @@ private function prepare_meta( array $meta = array() ) : array { private function prepare_device( array $meta = array() ) : array { if ( $this->device_filter || $this->device_meta ) { - $detect = Device::instance()->detect( $this->cached_data['ua'], true ); + $detect = Device::i()->detect( $this->cached_data['ua'], true ); if ( $this->device_meta ) { $meta['device'] = $detect; diff --git a/core/log/Device.php b/core/log/Device.php index acff7df..5fd68c1 100644 --- a/core/log/Device.php +++ b/core/log/Device.php @@ -12,11 +12,16 @@ class Device { private $obj; - public function __construct() { + private function __construct() { $this->obj = new DeviceDetector(); } - public static function instance() : Device { + /** @deprecated 3.0 Use self::i() instead. */ + public static function instance() : static { + return static::i(); + } + + public static function i() : static { static $instance = null; if ( ! isset( $instance ) ) { diff --git a/core/log/Display.php b/core/log/Display.php index 26aca9a..92ec194 100644 --- a/core/log/Display.php +++ b/core/log/Display.php @@ -3,7 +3,7 @@ namespace Dev4Press\Plugin\CoreActivity\Log; use BP_Groups_Group; -use Dev4Press\v54\Core\Mailer\Detection; +use Dev4Press\v55\Core\Mailer\Detection; use GFAPI; use stdClass; use WP_Comment; @@ -16,7 +16,7 @@ class Display { public $php_errors; - public function __construct() { + private function __construct() { add_filter( 'coreactivity_logs_field_render_object_name', array( $this, 'logs_object_name' ), 10, 2 ); $this->php_errors = array( @@ -39,7 +39,12 @@ public function __construct() { ); } - public static function instance() : Display { + /** @deprecated 3.0 Use self::i() instead. */ + public static function instance() : static { + return static::i(); + } + + public static function i() : static { static $instance = null; if ( ! isset( $instance ) ) { @@ -170,10 +175,10 @@ public function email_object_name( string $render, stdClass $item ) : string { public function components_list_to_markdown() : string { $render = ''; - $components = Activity::instance()->get_all_components(); - $events = Activity::instance()->get_all_events(); + $components = Activity::i()->get_all_components(); + $events = Activity::i()->get_all_events(); - foreach ( Activity::instance()->get_all_categories() as $category => $label ) { + foreach ( Activity::i()->get_all_categories() as $category => $label ) { $render .= PHP_EOL . '## ' . $label . PHP_EOL; foreach ( $components as $component ) { @@ -246,7 +251,7 @@ private function _display_notification( stdClass $item ) : string { } else { $render .= '' . $item->object_name . ''; - $data = Detection::instance()->get_data( $item->object_name ); + $data = Detection::i()->get_data( $item->object_name ); if ( ! empty( $data ) ) { $render .= '
    ' . esc_html__( 'Source', 'coreactivity' ) . ': ' . $data['source'] . ''; diff --git a/core/log/GEO.php b/core/log/GEO.php index f704ba4..badff08 100644 --- a/core/log/GEO.php +++ b/core/log/GEO.php @@ -5,11 +5,11 @@ use Dev4Press\Plugin\CoreActivity\Basic\Plugin; use Dev4Press\Plugin\CoreActivity\Location\GeoIP2; use Dev4Press\Plugin\CoreActivity\Location\IP2Location; -use Dev4Press\v54\Core\Helpers\Data; -use Dev4Press\v54\Core\Quick\File; -use Dev4Press\v54\Core\Quick\Misc; -use Dev4Press\v54\Service\GEOIP\GEOJSIO; -use Dev4Press\v54\Service\GEOIP\Location; +use Dev4Press\v55\Core\Helpers\Data; +use Dev4Press\v55\Core\Quick\File; +use Dev4Press\v55\Core\Quick\Misc; +use Dev4Press\v55\Service\GEOIP\GEOJSIO; +use Dev4Press\v55\Service\GEOIP\Location; use GeoIp2\Database\Reader; use IP2Location\Database; use WP_Filesystem_Direct; @@ -1025,7 +1025,7 @@ class GEO { ), ); - public function __construct() { + private function __construct() { $this->method = coreactivity_settings()->get( 'geolocation_method' ); if ( $this->method == 'ip2download' && ! $this->is_ip2location_valid() ) { @@ -1037,7 +1037,12 @@ public function __construct() { } } - public static function instance() : GEO { + /** @deprecated 3.0 Use self::i() instead. */ + public static function instance() : static { + return static::i(); + } + + public static function i() : static { static $instance = null; if ( ! isset( $instance ) ) { @@ -1106,7 +1111,7 @@ public function is_geoip2_valid() : bool { } public function geoip2_db_update() { - $path = Plugin::instance()->uploads_path(); + $path = Plugin::i()->uploads_path(); if ( $path !== false ) { $path = trailingslashit( $path ) . 'geoip2/'; @@ -1187,7 +1192,7 @@ public function is_ip2location_valid() : bool { } public function ip2location_db_update() { - $path = Plugin::instance()->uploads_path(); + $path = Plugin::i()->uploads_path(); if ( $path !== false ) { $path = trailingslashit( $path ) . 'ip2location/'; diff --git a/core/log/Metas.php b/core/log/Metas.php index c064ff0..d44bf5f 100644 --- a/core/log/Metas.php +++ b/core/log/Metas.php @@ -10,7 +10,7 @@ class Metas { private array $scopes = array( 'post', 'comment', 'term', 'user' ); private array $previous = array(); - public function __construct() { + private function __construct() { foreach ( $this->scopes as $scope ) { add_action( 'added_' . $scope . '_meta', array( $this, 'added_meta' ), 10, 4 ); add_action( 'deleted_' . $scope . '_meta', array( $this, 'deleted_meta' ), 10, 4 ); @@ -21,7 +21,12 @@ public function __construct() { } } - public static function instance() : Metas { + /** @deprecated 3.0 Use self::i() instead. */ + public static function instance() : static { + return static::i(); + } + + public static function i() : static { static $instance = null; if ( ! isset( $instance ) ) { diff --git a/core/log/Notifications.php b/core/log/Notifications.php index e86fa5a..fd7b1a7 100644 --- a/core/log/Notifications.php +++ b/core/log/Notifications.php @@ -3,22 +3,27 @@ namespace Dev4Press\Plugin\CoreActivity\Log; use Dev4Press\Plugin\CoreActivity\Basic\DB; -use Dev4Press\v54\Core\DateTime; -use Dev4Press\v54\Core\Quick\Str; -use Dev4Press\v54\Core\Quick\WPR; +use Dev4Press\v55\Core\DateTime; +use Dev4Press\v55\Core\Quick\Str; +use Dev4Press\v55\Core\Quick\WPR; if ( ! defined( 'ABSPATH' ) ) { exit; } class Notifications { - public function __construct() { + private function __construct() { if ( $this->s( 'instant' ) ) { add_action( 'coreactivity_event_logged', array( $this, 'check_for_instant' ), 10, 3 ); } } - public static function instance() : Notifications { + /** @deprecated 3.0 Use self::i() instead. */ + public static function instance() : static { + return static::i(); + } + + public static function i() : static { static $instance = null; if ( ! isset( $instance ) ) { @@ -171,7 +176,7 @@ public function instant_notify( array $events, string $from = '', string $to = ' return; } - coreactivity_settings()->set( 'instant_datetime', DateTime::instance()->mysql_date(), 'core' ); + coreactivity_settings()->set( 'instant_datetime', DateTime::i()->mysql_date(), 'core' ); coreactivity_settings()->set( 'instant_timestamp', time(), 'core', true ); $notification = array( @@ -214,7 +219,7 @@ public function instant_notify( array $events, string $from = '', string $to = ' } public function check_for_instant( $id, $data, $meta ) { - if ( Activity::instance()->is_instant_notification_enabled( $data['event_id'] ) ) { + if ( Activity::i()->is_instant_notification_enabled( $data['event_id'] ) ) { if ( ! wp_next_scheduled( 'coreactivity_instant_notification' ) ) { if ( ! $this->is_instant_allowed() ) { wp_schedule_single_event( $this->next_instant_timestamp(), 'coreactivity_instant_notification' ); @@ -229,36 +234,36 @@ public function check_for_instant( $id, $data, $meta ) { } public function scheduled_instant() { - $events = Activity::instance()->get_events_with_notifications( 'instant' ); - $to = DateTime::instance()->mysql_date(); + $events = Activity::i()->get_events_with_notifications( 'instant' ); + $to = DateTime::i()->mysql_date(); $from = $this->last_instant_datetime(); - $log = DB::instance()->get_entries_by_event_ids_and_date_range( $events, $from, $to ); + $log = DB::i()->get_entries_by_event_ids_and_date_range( $events, $from, $to ); $this->instant_notify( $log, $from, $to ); } public function scheduled_daily() { - $events = Activity::instance()->get_events_with_notifications( 'daily' ); + $events = Activity::i()->get_events_with_notifications( 'daily' ); if ( ! empty( $events ) ) { - $to = gmdate( DateTime::instance()->mysql_format(), strtotime( 'today' ) - 1 ); - $from = gmdate( DateTime::instance()->mysql_format(), strtotime( 'yesterday' ) ); + $to = gmdate( DateTime::i()->mysql_format(), strtotime( 'today' ) - 1 ); + $from = gmdate( DateTime::i()->mysql_format(), strtotime( 'yesterday' ) ); - $log = DB::instance()->get_entries_counts_by_event_ids_and_date_range( $events, $from, $to ); + $log = DB::i()->get_entries_counts_by_event_ids_and_date_range( $events, $from, $to ); $this->daily_digest( $log, $from, $to ); } } public function scheduled_weekly() { - $events = Activity::instance()->get_events_with_notifications( 'weekly' ); + $events = Activity::i()->get_events_with_notifications( 'weekly' ); if ( ! empty( $events ) ) { - $to = gmdate( DateTime::instance()->mysql_format(), strtotime( 'today' ) - 1 ); - $from = gmdate( DateTime::instance()->mysql_format(), strtotime( 'today' ) - WEEK_IN_SECONDS ); + $to = gmdate( DateTime::i()->mysql_format(), strtotime( 'today' ) - 1 ); + $from = gmdate( DateTime::i()->mysql_format(), strtotime( 'today' ) - WEEK_IN_SECONDS ); - $log = DB::instance()->get_entries_counts_by_event_ids_and_date_range( $events, $from, $to ); + $log = DB::i()->get_entries_counts_by_event_ids_and_date_range( $events, $from, $to ); $this->weekly_digest( $log, $from, $to ); } @@ -299,14 +304,14 @@ private function format_digest_for_email( array $events ) : string { $i = 1; foreach ( $events as $component => $data ) { $item = str_pad( $i, 3, ' ', STR_PAD_LEFT ) . '. '; - $item .= '[' . $component . '] ' . Activity::instance()->get_component_label( $component ) . PHP_EOL; + $item .= '[' . $component . '] ' . Activity::i()->get_component_label( $component ) . PHP_EOL; $item .= ' Logged Entries: ' . $data['total'] . PHP_EOL; $item .= ' View All in Log: ' . network_admin_url( 'admin.php?page=coreactivity-logs&view=component&filter-component=' . $component ) . PHP_EOL; foreach ( $data['events'] as $event => $count ) { - $event_id = Activity::instance()->get_event_id( $component, $event ); + $event_id = Activity::i()->get_event_id( $component, $event ); - $item .= ' * [' . $event . '] ' . Activity::instance()->get_event_label( $event_id, $event ) . ': ' . $count . PHP_EOL; + $item .= ' * [' . $event . '] ' . Activity::i()->get_event_label( $event_id, $event ) . ': ' . $count . PHP_EOL; } $render[] = $item; @@ -322,10 +327,10 @@ private function format_events_for_email( array $events ) : string { $i = 1; foreach ( $events as $event ) { - $object = Display::instance()->email_object_name( '', (object) $event ); + $object = Display::i()->email_object_name( '', (object) $event ); $item = str_pad( $i, 4, ' ', STR_PAD_LEFT ) . '. '; - $item .= Activity::instance()->get_event_display( $event['event_id'] ) . PHP_EOL; + $item .= Activity::i()->get_event_display( $event['event_id'] ) . PHP_EOL; $item .= ' Logged: ' . $event['logged'] . PHP_EOL; $item .= ' IP: ' . $event['ip'] . ' ยท ' . $event['method'] . ( empty( $event['context'] ) ? '' : ' ยท ' . $event['context'] ); diff --git a/core/log/Statistics.php b/core/log/Statistics.php index 362acc1..a1bd3f3 100644 --- a/core/log/Statistics.php +++ b/core/log/Statistics.php @@ -12,10 +12,15 @@ } class Statistics { - public function __construct() { + private function __construct() { } - public static function instance() : Statistics { + /** @deprecated 3.0 Use self::i() instead. */ + public static function instance() : static { + return static::i(); + } + + public static function i() : static { static $instance = null; if ( ! isset( $instance ) ) { @@ -26,11 +31,11 @@ public static function instance() : Statistics { } public function a() : Activity { - return Activity::instance(); + return Activity::i(); } public function db() : DB { - return DB::instance(); + return DB::i(); } public function overall() { @@ -91,7 +96,7 @@ public function count_event_entries( $component, $event, $ip, $seconds = 86400 ) } public function initial_update() { - $statistics = DB::instance()->get_events_statistics(); + $statistics = DB::i()->get_events_statistics(); $this->save_statistics( $statistics ); } @@ -107,8 +112,8 @@ public function daily_update() { if ( ! is_array( $statistics ) ) { $this->initial_update(); } else { - $two = DB::instance()->get_events_statistics( 'two' ); - $one = DB::instance()->get_events_statistics( 'one' ); + $two = DB::i()->get_events_statistics( 'two' ); + $one = DB::i()->get_events_statistics( 'one' ); $statistics = $this->update_statistics_array( $statistics, $two ); $statistics = $this->update_statistics_array( $statistics, $one ); diff --git a/core/log/Upgrader.php b/core/log/Upgrader.php index f471f14..7e5dd48 100644 --- a/core/log/Upgrader.php +++ b/core/log/Upgrader.php @@ -10,12 +10,17 @@ } class Upgrader { - public function __construct() { + private function __construct() { add_filter( 'upgrader_pre_install', array( $this, 'save_pre_install_versions' ), 10, 2 ); add_action( 'upgrader_process_complete', array( $this, 'upgrader_process_complete' ), 10, 2 ); } - public static function instance() : Upgrader { + /** @deprecated 3.0 Use self::i() instead. */ + public static function instance() : static { + return static::i(); + } + + public static function i() : static { static $instance = null; if ( ! isset( $instance ) ) { diff --git a/core/log/Users.php b/core/log/Users.php index 8327e2b..83a4566 100644 --- a/core/log/Users.php +++ b/core/log/Users.php @@ -7,13 +7,18 @@ } class Users { - public function __construct() { + private function __construct() { add_action( 'init', array( $this, 'update_last_user_activity' ) ); add_action( 'wp_login', array( $this, 'update_last_user_login' ), 10, 2 ); add_action( 'wp_logout', array( $this, 'update_last_user_logout' ) ); } - public static function instance() : Users { + /** @deprecated 3.0 Use self::i() instead. */ + public static function instance() : static { + return static::i(); + } + + public static function i() : static { static $instance = null; if ( ! isset( $instance ) ) { diff --git a/core/log/WhoIs.php b/core/log/WhoIs.php index 108c3a4..584457a 100644 --- a/core/log/WhoIs.php +++ b/core/log/WhoIs.php @@ -7,10 +7,15 @@ } class WhoIs { - public function __construct() { + private function __construct() { } - public static function instance() : WhoIs { + /** @deprecated 3.0 Use self::i() instead. */ + public static function instance() : static { + return static::i(); + } + + public static function i() : static { static $instance = null; if ( ! isset( $instance ) ) { diff --git a/core/plugins/BuddyPress.php b/core/plugins/BuddyPress.php index b8ac935..0c8adba 100644 --- a/core/plugins/BuddyPress.php +++ b/core/plugins/BuddyPress.php @@ -3,7 +3,7 @@ namespace Dev4Press\Plugin\CoreActivity\Plugins; use Dev4Press\Plugin\CoreActivity\Base\Plugin; -use Dev4Press\v54\Core\Quick\Request; +use Dev4Press\v55\Core\Quick\Request; if ( ! defined( 'ABSPATH' ) ) { exit; diff --git a/core/table/Events.php b/core/table/Events.php index 536148a..7e7265c 100644 --- a/core/table/Events.php +++ b/core/table/Events.php @@ -3,10 +3,10 @@ namespace Dev4Press\Plugin\CoreActivity\Table; use Dev4Press\Plugin\CoreActivity\Log\Activity; -use Dev4Press\v54\Core\Plugins\DBLite; -use Dev4Press\v54\Core\Quick\Sanitize; -use Dev4Press\v54\Core\UI\Elements; -use Dev4Press\v54\WordPress\Admin\Table; +use Dev4Press\v55\Core\Plugins\DBLite; +use Dev4Press\v55\Core\Quick\Sanitize; +use Dev4Press\v55\Core\UI\Elements; +use Dev4Press\v55\WordPress\Admin\Table; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -75,11 +75,11 @@ public function prepare_items() { foreach ( $this->items as &$item ) { $parts = explode( '/', $item->component ); - $component = Activity::instance()->get_component( $item->component ); + $component = Activity::i()->get_component( $item->component ); $item->event_id = absint( $item->event_id ); $item->plugin = $component->plugin ?? $parts[0]; - $item->source = $component->source ?? Activity::instance()->get_plugin_label( $parts[0] ); + $item->source = $component->source ?? Activity::i()->get_plugin_label( $parts[0] ); if ( ! isset( $this->_logged_counts[ $item->component ] ) ) { $this->_logged_counts[ $item->component ] = 0; @@ -129,21 +129,22 @@ protected function process_request_args() { protected function filter_block_top() { echo '
    '; - Elements::instance()->select( array_merge( array( '' => __( 'All Sources', 'coreactivity' ) ), Activity::instance()->get_all_sources() ), array( + Elements::i()->select( array_merge( array( '' => __( 'All Sources', 'coreactivity' ) ), Activity::i()->get_all_sources() ), array( 'selected' => $this->get_request_arg( 'filter-source' ), 'name' => 'filter-source', ) ); - Elements::instance()->select( array_merge( array( '' => __( 'All Categories', 'coreactivity' ) ), Activity::instance()->get_all_categories() ), array( + Elements::i()->select( array_merge( array( '' => __( 'All Categories', 'coreactivity' ) ), Activity::i()->get_all_categories() ), array( 'selected' => $this->get_request_arg( 'filter-group' ), 'name' => 'filter-group', ) ); - Elements::instance()->select_grouped( Activity::instance()->get_select_event_components( true ), array( + Elements::i()->select_grouped( Activity::i()->get_select_event_components( true ), array( 'empty' => __( 'All Components', 'coreactivity' ), 'selected' => $this->get_request_arg( 'filter-component' ), 'name' => 'filter-component', ) ); + submit_button( __( 'Filter', 'coreactivity' ), 'button', false, false, array( 'id' => 'coreactivity-events-submit' ) ); echo '
    '; } @@ -152,7 +153,7 @@ protected function get_row_classes( $item, $classes = array() ) : array { $classes = array(); if ( ! is_network_admin() ) { - if ( ! Activity::instance()->is_event_available( $item->component, $item->event ) ) { + if ( ! Activity::i()->is_event_available( $item->component, $item->event ) ) { $classes[] = '__is-not-loaded'; } } @@ -196,7 +197,7 @@ protected function column_source( $item ) : string { protected function column_component( $item ) : string { $render = '
    '; - $render .= ''; + $render .= ''; $render .= '' . $item->component . ''; if ( $this->_logged_counts[ $item->component ] > 0 ) { @@ -226,15 +227,15 @@ protected function column_event( $item ) : string { } protected function column_description( $item ) : string { - return Activity::instance()->get_event_description( $item->component, $item->event ); + return Activity::i()->get_event_description( $item->component, $item->event ); } protected function column_available( $item ) : string { - return Activity::instance()->is_event_available( $item->component, $item->event ) ? __( 'Yes', 'coreactivity' ) : __( 'No', 'coreactivity' ); + return Activity::i()->is_event_available( $item->component, $item->event ) ? __( 'Yes', 'coreactivity' ) : __( 'No', 'coreactivity' ); } protected function column_notifications( $item ) : string { - $notifications = Activity::instance()->get_event_notifications( $item->component, $item->event ); + $notifications = Activity::i()->get_event_notifications( $item->component, $item->event ); $render = '
    '; $render .= '
    '; diff --git a/core/table/Live.php b/core/table/Live.php index dbbbf1b..488682b 100644 --- a/core/table/Live.php +++ b/core/table/Live.php @@ -2,7 +2,7 @@ namespace Dev4Press\Plugin\CoreActivity\Table; -use Dev4Press\v54\Core\Quick\Sanitize; +use Dev4Press\v55\Core\Quick\Sanitize; if ( ! defined( 'ABSPATH' ) ) { exit; diff --git a/core/table/Logs.php b/core/table/Logs.php index d11b436..d5732c8 100644 --- a/core/table/Logs.php +++ b/core/table/Logs.php @@ -10,13 +10,13 @@ use Dev4Press\Plugin\CoreActivity\Log\Display; use Dev4Press\Plugin\CoreActivity\Log\GEO; use Dev4Press\Plugin\CoreActivity\Log\Users; -use Dev4Press\v54\Core\Helpers\IP; -use Dev4Press\v54\Core\Plugins\DBLite; -use Dev4Press\v54\Core\Quick\Sanitize; -use Dev4Press\v54\Core\UI\Elements; -use Dev4Press\v54\WordPress\Admin\Table; +use Dev4Press\v55\Core\Helpers\IP; +use Dev4Press\v55\Core\Plugins\DBLite; +use Dev4Press\v55\Core\Quick\Sanitize; +use Dev4Press\v55\Core\UI\Elements; +use Dev4Press\v55\WordPress\Admin\Table; use WP_Site; -use function Dev4Press\v54\Functions\panel; +use function Dev4Press\v55\Functions\panel; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -78,7 +78,7 @@ class Logs extends Table { ); public function __construct( $args = array() ) { - Display::instance(); + Display::i(); foreach ( $args as $key => $value ) { if ( property_exists( $this, $key ) ) { @@ -86,8 +86,8 @@ public function __construct( $args = array() ) { } } - $this->_current_ip = Core::instance()->get( 'ip' ); - $this->_server_ip = Core::instance()->get( 'server_ip' ); + $this->_current_ip = Core::i()->get( 'ip' ); + $this->_server_ip = Core::i()->get( 'server_ip' ); $this->_display_blog_column_linked = coreactivity_settings()->get( 'display_blog_column_linked' ); $this->_display_columns_simplified = coreactivity_settings()->get( 'display_columns_simplified' ); @@ -114,7 +114,7 @@ public function __construct( $args = array() ) { } public function i() : Activity { - return Activity::instance(); + return Activity::i(); } public function get_instance_code() : string { @@ -135,7 +135,7 @@ public function set_filter_lock( $name, $value ) { public function prepare_items() { if ( $this->_logs_instance == 'coreactivity' ) { - Users::instance()->update_last_user_log_visit(); + Users::i()->update_last_user_log_visit(); } do_action( $this->_filter_key . '_prepare_items_start', $this ); @@ -158,7 +158,7 @@ public function prepare_items() { if ( ! isset( $item->device ) || ( ! isset( $item->device['bot'] ) && empty( $item->device['client'] ) && empty( $item->device['os'] ) ) ) { if ( ! empty( $ua ) ) { - $item->{"device"} = Device::instance()->detect( $ua ); + $item->{"device"} = Device::i()->detect( $ua ); } } @@ -172,7 +172,7 @@ public function prepare_items() { } if ( ! empty( $this->_items_ips ) ) { - GEO::instance()->bulk( $this->_items_ips ); + GEO::i()->bulk( $this->_items_ips ); } do_action( $this->_filter_key . '_prepare_items_finish', $this ); @@ -249,7 +249,7 @@ public function live_attributes() { 'limit' => $this->_limit_lock, 'filter' => $this->_filter_key, 'settings' => array(), - 'id' => DB::instance()->get_last_log_id(), + 'id' => DB::i()->get_last_log_id(), 'nonce' => wp_create_nonce( 'coreactivity-live-update' ), 'page' => isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '', // phpcs:ignore WordPress.Security.NonceVerification ); @@ -526,13 +526,13 @@ protected function prepare_the_view() { protected function filter_block_top() { echo '
    '; - Elements::instance()->select( $this->get_period_dropdown( 'logged', coreactivity_db()->logs ), array( + Elements::i()->select( $this->get_period_dropdown( 'logged', coreactivity_db()->logs ), array( 'selected' => $this->get_request_arg( 'period' ), 'name' => 'period', ) ); if ( ! isset( $this->_filter_lock['component'] ) && ! isset( $this->_filter_lock['event_id'] ) ) { - Elements::instance()->select_grouped( $this->get_select_components(), array( + Elements::i()->select_grouped( $this->get_select_components(), array( 'empty' => __( 'All Components', 'coreactivity' ), 'selected' => $this->get_request_arg( 'filter-component' ), 'name' => 'filter-component', @@ -540,7 +540,7 @@ protected function filter_block_top() { } if ( ! isset( $this->_filter_lock['event_id'] ) ) { - Elements::instance()->select_grouped( $this->get_select_events(), array( + Elements::i()->select_grouped( $this->get_select_events(), array( 'empty' => __( 'All Events', 'coreactivity' ), 'selected' => $this->get_request_arg( 'filter-event_id' ), 'name' => 'filter-event_id', @@ -553,17 +553,17 @@ protected function filter_block_top() { '-' => __( 'Normal', 'coreactivity' ), ); - foreach ( Core::instance()->valid_request_contexts() as $context ) { + foreach ( Core::i()->valid_request_contexts() as $context ) { $_contexts[ $context ] = $context; } - Elements::instance()->select( $_contexts, array( + Elements::i()->select( $_contexts, array( 'selected' => $this->get_request_arg( 'filter-context' ), 'name' => 'filter-context', ) ); } - Elements::instance()->select_grouped( $this->get_country_codes(), array( + Elements::i()->select_grouped( $this->get_country_codes(), array( 'empty' => __( 'All Countries', 'coreactivity' ), 'selected' => $this->get_request_arg( 'filter-country_code' ), 'name' => 'filter-country_code', @@ -574,11 +574,11 @@ protected function filter_block_top() { '' => __( 'All Methods', 'coreactivity' ), ); - foreach ( Core::instance()->valid_request_methods() as $method ) { + foreach ( Core::i()->valid_request_methods() as $method ) { $_methods[ $method ] = $method; } - Elements::instance()->select( $_methods, array( + Elements::i()->select( $_methods, array( 'selected' => $this->get_request_arg( 'filter-method' ), 'name' => 'filter-method', ) ); @@ -594,7 +594,7 @@ protected function filter_block_top() { $_types[ $type ] = $value; } - Elements::instance()->select( $_types, array( + Elements::i()->select( $_types, array( 'selected' => $this->get_request_arg( 'filter-object_type' ), 'name' => 'filter-object_type', ) ); @@ -624,7 +624,7 @@ protected function get_country_codes() : array { if ( $code == 'XX' ) { $has_localhost = true; } else { - $list[ $code ] = trim( '[' . $code . '] ' . GEO::instance()->country( $code ) ); + $list[ $code ] = trim( '[' . $code . '] ' . GEO::i()->country( $code ) ); } } @@ -746,7 +746,7 @@ protected function get_views() : array { $current_view = ' ' . esc_html__( 'IP', 'coreactivity' ) . ''; if ( $this->_display_ip_country_flag ) { - $current_view .= '' . esc_html( Render::ip_masked( $this->_filter_lock['ip'] ) ) . ' ' . GEO::instance()->flag( $this->_filter_lock['ip'] ); + $current_view .= '' . esc_html( Render::ip_masked( $this->_filter_lock['ip'] ) ) . ' ' . GEO::i()->flag( $this->_filter_lock['ip'] ); } else { $current_view .= $this->_filter_lock['ip']; } @@ -756,7 +756,7 @@ protected function get_views() : array { break; case 'country_code': $current_view = ' ' . esc_html__( 'Country', 'coreactivity' ) . ''; - $current_view .= '[' . $this->_filter_lock['country_code'] . '] ' . GEO::instance()->country( $this->_filter_lock['country_code'] ) . '' . GEO::instance()->flag_from_country( $this->_filter_lock['country_code'] ); + $current_view .= '[' . $this->_filter_lock['country_code'] . '] ' . GEO::i()->country( $this->_filter_lock['country_code'] ) . '' . GEO::i()->flag_from_country( $this->_filter_lock['country_code'] ); $current_view .= ''; $current_key .= 'ip'; break; @@ -942,9 +942,9 @@ protected function column_ip( $item ) : string { if ( $this->_display_ip_country_flag ) { if ( ! empty( $item->country_code ) ) { - $render = GEO::instance()->flag_from_country( $item->country_code ) . ' ' . $render; + $render = GEO::i()->flag_from_country( $item->country_code ) . ' ' . $render; } else { - $render = GEO::instance()->flag( $item->ip ) . ' ' . $render; + $render = GEO::i()->flag( $item->ip ) . ' ' . $render; } } diff --git a/coreactivity.php b/coreactivity.php index 98895c3..39fff69 100644 --- a/coreactivity.php +++ b/coreactivity.php @@ -6,10 +6,10 @@ * Author: Milan Petrovic * Author URI: https://www.dev4press.com/ * Text Domain: coreactivity - * Version: 2.8 - * Requires at least: 6.0 - * Tested up to: 6.8 - * Requires PHP: 7.4 + * Version: 3.0 + * Requires at least: 6.1 + * Tested up to: 6.9 + * Requires PHP: 8.0 * Requires CP: 2.0 * Network: true * License: GPLv3 or later @@ -18,7 +18,7 @@ * @package coreActivity * * == Copyright == - * Copyright 2008 - 2025 Milan Petrovic (email: support@dev4press.com) + * Copyright 2008 - 2026 Milan Petrovic (email: support@dev4press.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,9 +34,13 @@ * along with this program. If not, see */ -use Dev4Press\v54\WordPress; +use Dev4Press\v55\WordPress; -const COREACTIVITY_VERSION = '2.8'; +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + +const COREACTIVITY_VERSION = '3.0'; const COREACTIVITY_FILE = __FILE__; $coreactivity_dirname_basic = dirname( COREACTIVITY_FILE ) . '/'; diff --git a/coreactivity.pot b/coreactivity.pot index f1306a9..3d0c5ea 100644 --- a/coreactivity.pot +++ b/coreactivity.pot @@ -2,44 +2,44 @@ msgid "" msgstr "" "Plural - Forms: nplurals = INTEGER; plural = EXPRESSION;\n" -"Project-Id-Version: CoreActivity\n" -"POT-Creation-Date: 07/16/2024 10:33:12 PM\n" +"Project-Id-Version: coreActivity\n" +"POT-Creation-Date: 02/05/2026 08:38:39 PM\n" "Language-Team: Milan Petrovic \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: GD i18n 2.8; www.dev4press.com\n" -#: core/admin/meta/Users.php:49 -#: core/admin/Settings.php:503 -#: core/admin/Settings.php:537 -#: core/admin/Settings.php:572 +#: core/admin/meta/Users.php:54 +#: core/admin/Settings.php:528 +#: core/admin/Settings.php:562 +#: core/admin/Settings.php:597 #: core/basic/Wizard.php:186 msgid "Log" msgstr "" -#: core/admin/meta/Users.php:55 -#: core/admin/Settings.php:498 -#: core/admin/Settings.php:532 -#: core/admin/Settings.php:567 -#: core/table/Events.php:97 +#: core/admin/meta/Users.php:60 +#: core/admin/Settings.php:523 +#: core/admin/Settings.php:557 +#: core/admin/Settings.php:592 +#: core/table/Events.php:96 msgid "Status" msgstr "" -#: core/admin/meta/Users.php:56 +#: core/admin/meta/Users.php:61 msgid "Last Active" msgstr "" -#: core/admin/meta/Users.php:57 +#: core/admin/meta/Users.php:62 msgid "Last Login" msgstr "" -#: core/admin/meta/Users.php:66 +#: core/admin/meta/Users.php:71 #: core/admin/Data.php:50 msgid "Online" msgstr "" -#: core/admin/meta/Users.php:68 +#: core/admin/meta/Users.php:73 msgid "Offline" msgstr "" @@ -49,10 +49,10 @@ msgid "Components" msgstr "" #: core/admin/panel/Dashboard.php:22 -#: core/admin/Help.php:83 -#: core/admin/Help.php:84 +#: core/admin/Help.php:88 +#: core/admin/Help.php:89 #: core/admin/Plugin.php:136 -#: core/basic/AdminBar.php:107 +#: core/basic/AdminBar.php:105 #: forms/content-dashboard-overall.php:34 msgid "Events" msgstr "" @@ -63,11 +63,11 @@ msgid "Network Dashboard" msgstr "" #: core/admin/panel/Dashboard.php:39 -#: core/admin/Help.php:66 -#: core/admin/Help.php:67 +#: core/admin/Help.php:71 +#: core/admin/Help.php:72 #: core/admin/Plugin.php:129 -#: core/basic/AdminBar.php:114 -#: core/table/Events.php:102 +#: core/basic/AdminBar.php:112 +#: core/table/Events.php:101 #: core/table/Logs.php:900 #: core/table/Logs.php:920 #: core/table/Logs.php:1017 @@ -112,7 +112,7 @@ msgid "Some of the components can use these exceptions to limit the logging and msgstr "" #: core/admin/panel/Settings.php:36 -#: core/admin/Settings.php:308 +#: core/admin/Settings.php:333 #: core/basic/Wizard.php:185 msgid "Geo Location" msgstr "" @@ -134,9 +134,9 @@ msgid "Settings related to some aspects for the Logs panel display." msgstr "" #: core/admin/panel/Settings.php:48 -#: core/admin/Settings.php:511 -#: core/admin/Settings.php:545 -#: core/admin/Settings.php:580 +#: core/admin/Settings.php:536 +#: core/admin/Settings.php:570 +#: core/admin/Settings.php:605 msgid "Advanced" msgstr "" @@ -160,7 +160,7 @@ msgstr "" #: core/admin/panel/Tools.php:30 #: core/basic/Wizard.php:187 #: core/components/Notification.php:75 -#: core/table/Events.php:105 +#: core/table/Events.php:104 msgid "Notifications" msgstr "" @@ -201,7 +201,7 @@ msgstr "" msgid "Using this tool, bulk enable or disable events for notifications." msgstr "" -#: core/admin/AJAX.php:113 +#: core/admin/AJAX.php:124 msgid "WhoIs check failed" msgstr "" @@ -270,7 +270,7 @@ msgid "Logged data older than 2 years" msgstr "" #: core/admin/Data.php:51 -#: core/admin/Settings.php:329 +#: core/admin/Settings.php:354 msgid "IP2Location Database" msgstr "" @@ -306,95 +306,95 @@ msgstr "" msgid "GeoLite2: Country, City, Location, ZIP, Timezone" msgstr "" -#: core/admin/Help.php:38 +#: core/admin/Help.php:43 msgid "Basics" msgstr "" -#: core/admin/Help.php:39 +#: core/admin/Help.php:44 #: forms/content-dashboard-overall.php:16 msgid "Components and Events" msgstr "" -#: core/admin/Help.php:40 +#: core/admin/Help.php:45 msgid "Some components and events included in coreActivity are not always registered. Some components are made for WordPress Multisite, and some components require specific third-party plugins. The widget on this panel, and list of all Events show actual status of registered components and available events." msgstr "" -#: core/admin/Help.php:41 +#: core/admin/Help.php:46 msgid "To stop all the logging, you can use the Toggle button on the Dashboard to disable or later enable the logging system. This can be useful if you are testing something, and want to temporarily disable the logging." msgstr "" -#: core/admin/Help.php:42 +#: core/admin/Help.php:47 msgid "All Components and Events" msgstr "" -#: core/admin/Help.php:43 +#: core/admin/Help.php:48 #: forms/content-dashboard-database.php:15 msgid "Database Statistics" msgstr "" -#: core/admin/Help.php:44 +#: core/admin/Help.php:49 msgid "Plugin has 3 database tables, and the widget on the dashboard shows the current status of those tables, number of records, total size, free space and more." msgstr "" -#: core/admin/Help.php:45 +#: core/admin/Help.php:50 #: forms/content-dashboard-location.php:16 msgid "GEO Location" msgstr "" -#: core/admin/Help.php:46 +#: core/admin/Help.php:51 msgid "To identify the country for each logged event, plugin can use logged IP to find the country and city. For this process, plugin can use online GEO location service or local database." msgstr "" -#: core/admin/Help.php:47 +#: core/admin/Help.php:52 #: forms/content-dashboard-location.php:81 msgid "GEO Location Settings" msgstr "" -#: core/admin/Help.php:54 +#: core/admin/Help.php:59 msgid "Statistics" msgstr "" -#: core/admin/Help.php:55 +#: core/admin/Help.php:60 msgid "Quick Sweep" msgstr "" -#: core/admin/Help.php:56 +#: core/admin/Help.php:61 msgid "The simple statistical overview, shows number of log entries for all logged components in the last 30 days. Click on the component icon button, to go to the Logs page filtered by the selected component." msgstr "" -#: core/admin/Help.php:57 +#: core/admin/Help.php:62 msgid "Main Events panel lists counts for each component and event based on all the log records currently in the database." msgstr "" -#: core/admin/Help.php:68 +#: core/admin/Help.php:73 msgid "This is the core of the coreActivity plugin, panel where all the logged records are displayed. There are few important things to know." msgstr "" -#: core/admin/Help.php:70 +#: core/admin/Help.php:75 msgid "Depending on your screen size, the table can have strange layout due to the number of columns it can show. Make sure to check out the Screen Options tab to disable some of the columns. And, some columns related options are available in the plugins settings." msgstr "" -#: core/admin/Help.php:71 +#: core/admin/Help.php:76 msgid "To see all additional information about each event, click on the toggle button on the right side of the table to show hidden Metadata row." msgstr "" -#: core/admin/Help.php:72 +#: core/admin/Help.php:77 msgid "Based on the current view mode, some columns and filter elements can be automatically hidden." msgstr "" -#: core/admin/Help.php:74 +#: core/admin/Help.php:79 msgid "Logs Panel Settings" msgstr "" -#: core/admin/Help.php:85 +#: core/admin/Help.php:90 msgid "This panel shows all the registered components and events, along with the status toggle, and toggles for the notifications." msgstr "" -#: core/admin/Help.php:87 +#: core/admin/Help.php:92 msgid "For each event, you have additional buttons to filter or view the Logs for the selected component or event, and button to open the Cleanup tools panel to remove selected component or event only." msgstr "" -#: core/admin/Help.php:88 +#: core/admin/Help.php:93 msgid "Log records counts are based on the current number of records in the logs belonging to each event." msgstr "" @@ -435,17 +435,17 @@ msgid "All the events registered for activity tracking and logging." msgstr "" #: core/admin/Plugin.php:143 -#: core/basic/AdminBar.php:121 +#: core/basic/AdminBar.php:119 msgid "Settings" msgstr "" #: core/admin/Plugin.php:149 -#: core/basic/AdminBar.php:128 +#: core/basic/AdminBar.php:126 msgid "Tools" msgstr "" #: core/admin/Plugin.php:158 -#: core/admin/Settings.php:644 +#: core/admin/Settings.php:669 msgid "Setup Wizard" msgstr "" @@ -537,663 +537,703 @@ msgstr "" msgid "If your website is behind CloudFlare, plugin will be able to detect this, and will get real IP, and this option will not be used." msgstr "" -#: core/admin/Settings.php:114 +#: core/admin/Settings.php:112 +msgid "Additional Settings" +msgstr "" + +#: core/admin/Settings.php:115 +msgid "REST-API" +msgstr "" + +#: core/admin/Settings.php:119 +msgid "Skip read logging for server requests" +msgstr "" + +#: core/admin/Settings.php:119 +msgid "If read requests for REST-API are coming from the website own server, the plugin will skip logging those requests." +msgstr "" + +#: core/admin/Settings.php:127 msgid "IP Location Data" msgstr "" -#: core/admin/Settings.php:121 +#: core/admin/Settings.php:134 #: forms/dialog-data.php:96 msgid "Country Code" msgstr "" -#: core/admin/Settings.php:121 +#: core/admin/Settings.php:134 msgid "Each log entry IP will be geo-located, and if possible, the country code will be stored in the main log database table." msgstr "" -#: core/admin/Settings.php:123 +#: core/admin/Settings.php:136 msgid "Each time logging is requested, plugin will try to determine the country for the IP and save it in the main database." msgstr "" -#: core/admin/Settings.php:124 +#: core/admin/Settings.php:137 msgid "Country for IP can change over time (especially for the IP4), and this will add permanent mark of the country into the log at the time it is logged." msgstr "" -#: core/admin/Settings.php:132 +#: core/admin/Settings.php:145 msgid "GEOLocation Settings" msgstr "" -#: core/admin/Settings.php:136 +#: core/admin/Settings.php:149 msgid "Expanded Meta Information" msgstr "" -#: core/admin/Settings.php:136 +#: core/admin/Settings.php:149 msgid "Any additional geolocation data will be logged as a meta data." msgstr "" -#: core/admin/Settings.php:138 +#: core/admin/Settings.php:151 msgid "This data, along the country code for the IP will be later used to display IP location in the log." msgstr "" -#: core/admin/Settings.php:139 +#: core/admin/Settings.php:152 msgid "Information provided by the geolocation can contain only country, or it can have expanded information." msgstr "" -#: core/admin/Settings.php:147 -#: core/admin/Settings.php:191 -#: core/admin/Settings.php:444 +#: core/admin/Settings.php:160 +#: core/admin/Settings.php:216 +#: core/admin/Settings.php:469 msgid "Meta Data" msgstr "" -#: core/admin/Settings.php:150 +#: core/admin/Settings.php:163 msgid "Standard" msgstr "" -#: core/admin/Settings.php:154 +#: core/admin/Settings.php:167 msgid "User Agent" msgstr "" -#: core/admin/Settings.php:154 +#: core/admin/Settings.php:167 msgid "If the request has user agent string, it will be logged as the log entry meta data." msgstr "" -#: core/admin/Settings.php:155 +#: core/admin/Settings.php:168 msgid "User agent can be used to extract information about the request source device, OS, browsers, and more." msgstr "" -#: core/admin/Settings.php:156 +#: core/admin/Settings.php:169 msgid "User agent data is not always reliable, because request source can spoof the user agent and set it to anything." msgstr "" -#: core/admin/Settings.php:158 +#: core/admin/Settings.php:171 msgid "Referer" msgstr "" -#: core/admin/Settings.php:158 +#: core/admin/Settings.php:171 msgid "If the request has referer, it will be logged as the log entry meta data." msgstr "" -#: core/admin/Settings.php:162 +#: core/admin/Settings.php:175 +msgid "Value Changes" +msgstr "" + +#: core/admin/Settings.php:179 +msgid "Log for Arrays or Objects" +msgstr "" + +#: core/admin/Settings.php:179 +msgid "If the option, sitemeta option or meta value change needs to be logged, value change by default, will be logged for scalars only. To log array or object changes, you need to enable this option." +msgstr "" + +#: core/admin/Settings.php:180 +msgid "Space taken by logging changes of non scalar value will be larger, especially for big objects or array changes." +msgstr "" + +#: core/admin/Settings.php:181 +msgid "If the change is occurring often, and logged objects are large, the log meta table can grow to a huge size and slow down the log process." +msgstr "" + +#: core/admin/Settings.php:182 +msgid "Do not enable this option unless you fully understand what the implications are!" +msgstr "" + +#: core/admin/Settings.php:187 msgid "Device Detection" msgstr "" -#: core/admin/Settings.php:166 +#: core/admin/Settings.php:191 msgid "Device Information" msgstr "" -#: core/admin/Settings.php:166 +#: core/admin/Settings.php:191 msgid "Based on the user agent, detect the information about the device and store it as meta when the request is logged." msgstr "" -#: core/admin/Settings.php:167 +#: core/admin/Settings.php:192 msgid "Device detection will be done at the request log time, and will be stored as meta data." msgstr "" -#: core/admin/Settings.php:168 -#: core/admin/Settings.php:173 +#: core/admin/Settings.php:193 +#: core/admin/Settings.php:198 msgid "Device detection data will take additional space in the meta table." msgstr "" -#: core/admin/Settings.php:169 +#: core/admin/Settings.php:194 msgid "If you don't save this as metadata, plugin can still display device detection data later, if you enable User Agent logging." msgstr "" -#: core/admin/Settings.php:171 +#: core/admin/Settings.php:196 msgid "Filter Information" msgstr "" -#: core/admin/Settings.php:171 +#: core/admin/Settings.php:196 msgid "Simplified detected information will be stored as individual meta elements that can be used for the log filtering." msgstr "" -#: core/admin/Settings.php:172 +#: core/admin/Settings.php:197 msgid "At this time, coreActivity plugin doesn't have filter by meta data implemented!" msgstr "" -#: core/admin/Settings.php:178 +#: core/admin/Settings.php:203 msgid "Event Specific" msgstr "" -#: core/admin/Settings.php:182 +#: core/admin/Settings.php:207 msgid "Plugin or Theme Descriptions" msgstr "" -#: core/admin/Settings.php:182 +#: core/admin/Settings.php:207 msgid "Descriptions are available for plugins and themes, but they can be on the longer side, and usually are not useful for log analysis." msgstr "" -#: core/admin/Settings.php:183 +#: core/admin/Settings.php:208 msgid "Transient Value" msgstr "" -#: core/admin/Settings.php:183 +#: core/admin/Settings.php:208 msgid "In most cases, transient values can be huge, since transients are used as a cache of sorts, and it is not a good idea to log the actual value for transient. Transients are often changing and usually serialized." msgstr "" -#: core/admin/Settings.php:198 -#: core/log/Activity.php:101 +#: core/admin/Settings.php:223 +#: core/log/Activity.php:138 msgid "Post Meta" msgstr "" -#: core/admin/Settings.php:198 -#: core/admin/Settings.php:199 -#: core/admin/Settings.php:200 -#: core/admin/Settings.php:201 +#: core/admin/Settings.php:223 +#: core/admin/Settings.php:224 +#: core/admin/Settings.php:225 +#: core/admin/Settings.php:226 msgid "Add one or more options (exact meta key name) to skip from logging." msgstr "" -#: core/admin/Settings.php:199 -#: core/log/Activity.php:108 +#: core/admin/Settings.php:224 +#: core/log/Activity.php:145 msgid "User Meta" msgstr "" -#: core/admin/Settings.php:200 -#: core/log/Activity.php:104 +#: core/admin/Settings.php:225 +#: core/log/Activity.php:141 msgid "Term Meta" msgstr "" -#: core/admin/Settings.php:201 -#: core/log/Activity.php:106 +#: core/admin/Settings.php:226 +#: core/log/Activity.php:143 msgid "Comment Meta" msgstr "" -#: core/admin/Settings.php:207 +#: core/admin/Settings.php:232 msgid "Component: Options" msgstr "" -#: core/admin/Settings.php:210 +#: core/admin/Settings.php:235 msgid "General Rules" msgstr "" -#: core/admin/Settings.php:214 +#: core/admin/Settings.php:239 msgid "Action Scheduler Locks" msgstr "" -#: core/admin/Settings.php:214 +#: core/admin/Settings.php:239 msgid "Many WordPress plugins use Actions Scheduler (as a plugin or internal component), and it can often change one or more locking options flooding the log with entries. With this enabled, any locking option of the Action Scheduler will be ignored when logging options changes." msgstr "" -#: core/admin/Settings.php:218 -#: core/admin/Settings.php:231 -#: core/admin/Settings.php:244 -#: core/admin/Settings.php:257 -#: core/admin/Settings.php:270 -#: core/admin/Settings.php:283 +#: core/admin/Settings.php:243 +#: core/admin/Settings.php:256 +#: core/admin/Settings.php:269 +#: core/admin/Settings.php:282 +#: core/admin/Settings.php:295 +#: core/admin/Settings.php:308 msgid "Specific Options" msgstr "" -#: core/admin/Settings.php:222 -#: core/admin/Settings.php:235 +#: core/admin/Settings.php:247 +#: core/admin/Settings.php:260 msgid "Options to skip" msgstr "" -#: core/admin/Settings.php:222 -#: core/admin/Settings.php:235 +#: core/admin/Settings.php:247 +#: core/admin/Settings.php:260 msgid "Add one or more options (exact option name) to skip from logging." msgstr "" -#: core/admin/Settings.php:228 +#: core/admin/Settings.php:253 msgid "Component: Sitemeta" msgstr "" -#: core/admin/Settings.php:241 +#: core/admin/Settings.php:266 msgid "Component: Notification" msgstr "" -#: core/admin/Settings.php:248 +#: core/admin/Settings.php:273 msgid "Notifications to Skip" msgstr "" -#: core/admin/Settings.php:248 +#: core/admin/Settings.php:273 msgid "Add one or more notifications (exact option name) to skip from logging." msgstr "" -#: core/admin/Settings.php:254 +#: core/admin/Settings.php:279 msgid "Component: WordPress" msgstr "" -#: core/admin/Settings.php:261 +#: core/admin/Settings.php:286 msgid "CRON to Skip" msgstr "" -#: core/admin/Settings.php:261 +#: core/admin/Settings.php:286 msgid "Add one or more CRON jobs (exact option name) to skip from logging." msgstr "" -#: core/admin/Settings.php:267 +#: core/admin/Settings.php:292 msgid "Component: Plugin" msgstr "" -#: core/admin/Settings.php:274 +#: core/admin/Settings.php:299 msgid "Plugins to Skip" msgstr "" -#: core/admin/Settings.php:274 +#: core/admin/Settings.php:299 msgid "Add one or more plugins (exact option name) to skip from logging." msgstr "" -#: core/admin/Settings.php:280 +#: core/admin/Settings.php:305 msgid "Component: Theme" msgstr "" -#: core/admin/Settings.php:287 +#: core/admin/Settings.php:312 msgid "Themes to Skip" msgstr "" -#: core/admin/Settings.php:287 +#: core/admin/Settings.php:312 msgid "Add one or more themes (exact option name) to skip from logging." msgstr "" -#: core/admin/Settings.php:293 +#: core/admin/Settings.php:318 msgid "Component: Errors" msgstr "" -#: core/admin/Settings.php:296 +#: core/admin/Settings.php:321 msgid "File Names" msgstr "" -#: core/admin/Settings.php:300 +#: core/admin/Settings.php:325 msgid "Regular Expressions" msgstr "" -#: core/admin/Settings.php:300 +#: core/admin/Settings.php:325 msgid "If the request is for a file, it will be checked with provided regular expressions. If the file matches any of these, it will not be logged." msgstr "" -#: core/admin/Settings.php:315 +#: core/admin/Settings.php:340 #: core/table/Logs.php:190 #: forms/dialog-data.php:20 msgid "Method" msgstr "" -#: core/admin/Settings.php:315 +#: core/admin/Settings.php:340 msgid "Online geolocation is usually slower, it does make a call to the online service for geo-locating the IP." msgstr "" -#: core/admin/Settings.php:317 +#: core/admin/Settings.php:342 msgid "Online geolocation can be slower, since it depends on the external services to work. It can also happen for the request to timeout or fail." msgstr "" -#: core/admin/Settings.php:318 +#: core/admin/Settings.php:343 msgid "Database approach is the best solution since the database is on your server, and it is much faster to get the location, without having any issues that online services can have." msgstr "" -#: core/admin/Settings.php:319 +#: core/admin/Settings.php:344 msgid "If the selected database method is not working (database file is missing), plugin will fallback to use Online method." msgstr "" -#: core/admin/Settings.php:339 +#: core/admin/Settings.php:364 msgid "Token" msgstr "" -#: core/admin/Settings.php:339 +#: core/admin/Settings.php:364 msgid "Token is required to download and updated database file." msgstr "" -#: core/admin/Settings.php:341 +#: core/admin/Settings.php:366 msgid "IP2Location has free and premium services and databases. For this plugin purposes, Lite database is quite sufficient." msgstr "" -#: core/admin/Settings.php:342 +#: core/admin/Settings.php:367 msgid "To get the download token, register on the IP2Location Lite website, and once you are logged in there, get the download token and past it in this field." msgstr "" -#: core/admin/Settings.php:343 -#: core/admin/Settings.php:380 +#: core/admin/Settings.php:368 +#: core/admin/Settings.php:405 msgid "Plugin will attempt to download database file once a week during regular weekly maintenance." msgstr "" -#: core/admin/Settings.php:353 +#: core/admin/Settings.php:378 msgid "Register and Get token on IP2Location Lite" msgstr "" -#: core/admin/Settings.php:357 -#: core/admin/Settings.php:394 +#: core/admin/Settings.php:382 +#: core/admin/Settings.php:419 msgid "Database" msgstr "" -#: core/admin/Settings.php:357 -#: core/admin/Settings.php:394 +#: core/admin/Settings.php:382 +#: core/admin/Settings.php:419 msgid "Depending on the database you choose, you will get additional information for each IP." msgstr "" -#: core/admin/Settings.php:359 +#: core/admin/Settings.php:384 msgid "Country database is about 9MB in size, other databases can be up to 200MB in size." msgstr "" -#: core/admin/Settings.php:360 -#: core/admin/Settings.php:396 +#: core/admin/Settings.php:385 +#: core/admin/Settings.php:421 msgid "If you choose Country only database, you will be able to log in only IP country code." msgstr "" -#: core/admin/Settings.php:366 +#: core/admin/Settings.php:391 msgid "GEOIP2 Database" msgstr "" -#: core/admin/Settings.php:376 +#: core/admin/Settings.php:401 msgid "License" msgstr "" -#: core/admin/Settings.php:376 +#: core/admin/Settings.php:401 msgid "License is required to download and updated database file." msgstr "" -#: core/admin/Settings.php:378 +#: core/admin/Settings.php:403 msgid "GEOIP2 has free and premium services and databases. For this plugin purposes, Lite database is quite sufficient." msgstr "" -#: core/admin/Settings.php:379 +#: core/admin/Settings.php:404 msgid "To get the download license, register on the GEOIP2 website, and once you are logged in there, generate new license." msgstr "" -#: core/admin/Settings.php:390 +#: core/admin/Settings.php:415 msgid "Register and Get token on GeoIP2" msgstr "" -#: core/admin/Settings.php:406 +#: core/admin/Settings.php:431 msgid "Content Display" msgstr "" -#: core/admin/Settings.php:409 +#: core/admin/Settings.php:434 #: core/table/Logs.php:196 #: core/table/Logs.php:746 #: forms/dialog-data.php:16 msgid "IP" msgstr "" -#: core/admin/Settings.php:413 +#: core/admin/Settings.php:438 msgid "IP GEO location flag" msgstr "" -#: core/admin/Settings.php:413 +#: core/admin/Settings.php:438 msgid "Show country for the logged IP." msgstr "" -#: core/admin/Settings.php:414 +#: core/admin/Settings.php:439 msgid "IPv4 Display" msgstr "" -#: core/admin/Settings.php:414 +#: core/admin/Settings.php:439 msgid "You can hide parts of the IP address when displayed. This will work for IPv4 address only, and it doesn't affect use of IP in URLs for filtering." msgstr "" -#: core/admin/Settings.php:418 +#: core/admin/Settings.php:443 msgid "Other Information" msgstr "" -#: core/admin/Settings.php:422 +#: core/admin/Settings.php:447 msgid "Simplified values" msgstr "" -#: core/admin/Settings.php:422 +#: core/admin/Settings.php:447 msgid "Values for columns Component and Event will be displayed using labels." msgstr "" -#: core/admin/Settings.php:423 +#: core/admin/Settings.php:448 msgid "User avatar" msgstr "" -#: core/admin/Settings.php:423 +#: core/admin/Settings.php:448 msgid "Show user avatar for logs that are related to the user." msgstr "" -#: core/admin/Settings.php:424 +#: core/admin/Settings.php:449 msgid "Linked Blog ID" msgstr "" -#: core/admin/Settings.php:424 +#: core/admin/Settings.php:449 msgid "In the multisite network mode, link the Blog ID to the Blog URL" msgstr "" -#: core/admin/Settings.php:430 +#: core/admin/Settings.php:455 msgid "Table Layout" msgstr "" -#: core/admin/Settings.php:433 +#: core/admin/Settings.php:458 msgid "Basic Data" msgstr "" -#: core/admin/Settings.php:437 +#: core/admin/Settings.php:462 msgid "Request as Column" msgstr "" -#: core/admin/Settings.php:437 +#: core/admin/Settings.php:462 msgid "Request value can be quite long, and it can cause layout issues if displayed as column. If this option is displayed, Request will be displayed as Meta value in the hidden Meta row." msgstr "" -#: core/admin/Settings.php:438 +#: core/admin/Settings.php:463 msgid "Protocol as Column" msgstr "" -#: core/admin/Settings.php:438 +#: core/admin/Settings.php:463 msgid "Protocol value would most likely be the same for each request, especially if your webserver is behind some sort of proxy setup. If this option is displayed, Protocol will be displayed as Meta value in the hidden Meta row." msgstr "" -#: core/admin/Settings.php:439 +#: core/admin/Settings.php:464 msgid "Object Type Column" msgstr "" -#: core/admin/Settings.php:439 +#: core/admin/Settings.php:464 msgid "If enabled, Object Type will have own column, if disabled, it will be displayed as a part of the Object column." msgstr "" -#: core/admin/Settings.php:440 +#: core/admin/Settings.php:465 msgid "Device Detection Column" msgstr "" -#: core/admin/Settings.php:440 +#: core/admin/Settings.php:465 msgid "Show the Device Detection information, if available." msgstr "" -#: core/admin/Settings.php:448 +#: core/admin/Settings.php:473 msgid "Meta Column" msgstr "" -#: core/admin/Settings.php:448 +#: core/admin/Settings.php:473 msgid "By default, all meta data is displayed in the hidden Meta row under main row because a lot of metadata can be quite large and will break table layout or will be unreadable. If you enable Meta column, some of the meta data will be displayed in this column, depending on the event." msgstr "" -#: core/admin/Settings.php:454 +#: core/admin/Settings.php:479 msgid "Log Panel Updates" msgstr "" -#: core/admin/Settings.php:461 +#: core/admin/Settings.php:486 msgid "Live Updates" msgstr "" -#: core/admin/Settings.php:461 +#: core/admin/Settings.php:486 msgid "Live AJAX requests every 10 seconds to get the latest logged events. The live functionality with take into account the Log panel current filters and view settings." msgstr "" -#: core/admin/Settings.php:469 +#: core/admin/Settings.php:494 msgid "Users Online Status" msgstr "" -#: core/admin/Settings.php:476 +#: core/admin/Settings.php:501 msgid "Online Window" msgstr "" -#: core/admin/Settings.php:476 +#: core/admin/Settings.php:501 msgid "Knowing if the user is online or not is not easy to achieve without session tracking, which is not advisable in WordPress powered websites. The closest online status is the last activity with some added time for approximation." msgstr "" -#: core/admin/Settings.php:477 +#: core/admin/Settings.php:502 msgid "Do not set this value too high, 5 to 10 minutes (in seconds) is more than enough." msgstr "" -#: core/admin/Settings.php:479 +#: core/admin/Settings.php:504 msgid "seconds" msgstr "" -#: core/admin/Settings.php:491 +#: core/admin/Settings.php:516 #: forms/content-tools-notifications.php:20 msgid "Instant Notifications" msgstr "" -#: core/admin/Settings.php:498 +#: core/admin/Settings.php:523 msgid "If enabled, plugin will send instant notifications when eligible events are logged. The notifications will not be completely instant, because that can lead to the huge number of emails sent if some events occur often. Instead, after instant notification is sent, plugin will not send a new one during the predefined delay, and next one will include all eligible events from that period." msgstr "" -#: core/admin/Settings.php:499 -#: core/admin/Settings.php:533 -#: core/admin/Settings.php:568 +#: core/admin/Settings.php:524 +#: core/admin/Settings.php:558 +#: core/admin/Settings.php:593 msgid "Emails" msgstr "" -#: core/admin/Settings.php:499 -#: core/admin/Settings.php:533 -#: core/admin/Settings.php:568 +#: core/admin/Settings.php:524 +#: core/admin/Settings.php:558 +#: core/admin/Settings.php:593 msgid "One or more emails to send the notifications. If empty, it will use the website admin email." msgstr "" -#: core/admin/Settings.php:507 -#: core/admin/Settings.php:541 -#: core/admin/Settings.php:576 +#: core/admin/Settings.php:532 +#: core/admin/Settings.php:566 +#: core/admin/Settings.php:601 msgid "Skip Logging" msgstr "" -#: core/admin/Settings.php:507 -#: core/admin/Settings.php:541 -#: core/admin/Settings.php:576 +#: core/admin/Settings.php:532 +#: core/admin/Settings.php:566 +#: core/admin/Settings.php:601 msgid "If enabled, this email notification will not be logged by the plugin." msgstr "" -#: core/admin/Settings.php:515 +#: core/admin/Settings.php:540 msgid "Delay" msgstr "" -#: core/admin/Settings.php:515 +#: core/admin/Settings.php:540 msgid "This is the shortest delay between two instant notifications emails." msgstr "" -#: core/admin/Settings.php:516 +#: core/admin/Settings.php:541 msgid "Minutes" msgstr "" -#: core/admin/Settings.php:525 +#: core/admin/Settings.php:550 msgid "Daily Digest Notifications" msgstr "" -#: core/admin/Settings.php:532 +#: core/admin/Settings.php:557 msgid "If enabled, plugin will send daily digest email with all eligible events from the previous day." msgstr "" -#: core/admin/Settings.php:549 -#: core/admin/Settings.php:550 -#: core/admin/Settings.php:585 -#: core/admin/Settings.php:586 +#: core/admin/Settings.php:574 +#: core/admin/Settings.php:575 +#: core/admin/Settings.php:610 +#: core/admin/Settings.php:611 msgid "Hour" msgstr "" -#: core/admin/Settings.php:549 -#: core/admin/Settings.php:585 +#: core/admin/Settings.php:574 +#: core/admin/Settings.php:610 msgid "This is the hour of the day when the daily digest is created." msgstr "" -#: core/admin/Settings.php:560 +#: core/admin/Settings.php:585 msgid "Weekly Digest Notifications" msgstr "" -#: core/admin/Settings.php:567 +#: core/admin/Settings.php:592 msgid "If enabled, plugin will send weekly digest email with all eligible events from the previous 7 days." msgstr "" -#: core/admin/Settings.php:584 +#: core/admin/Settings.php:609 msgid "Day" msgstr "" -#: core/admin/Settings.php:584 +#: core/admin/Settings.php:609 msgid "This is day of the week when the daily digest is created." msgstr "" -#: core/admin/Settings.php:598 +#: core/admin/Settings.php:623 msgid "Auto Cleanup" msgstr "" -#: core/admin/Settings.php:605 +#: core/admin/Settings.php:630 msgid "Remove old entries" msgstr "" -#: core/admin/Settings.php:605 +#: core/admin/Settings.php:630 msgid "If enabled, maintenance will be run once a day, and all old entries will be removed." msgstr "" -#: core/admin/Settings.php:606 +#: core/admin/Settings.php:631 msgid "Log entries to keep" msgstr "" -#: core/admin/Settings.php:606 +#: core/admin/Settings.php:631 msgid "All entries older than the number of months specified here, will be removed during the maintenance." msgstr "" -#: core/admin/Settings.php:608 +#: core/admin/Settings.php:633 msgid "months" msgstr "" -#: core/admin/Settings.php:617 +#: core/admin/Settings.php:642 msgid "Notices" msgstr "" -#: core/admin/Settings.php:624 +#: core/admin/Settings.php:649 msgid "Logging is Disabled" msgstr "" -#: core/admin/Settings.php:624 +#: core/admin/Settings.php:649 msgid "If the logging is disabled, on every admin page, plugin will display a notice about it, with link to the plugin dashboard." msgstr "" -#: core/admin/Settings.php:630 +#: core/admin/Settings.php:655 msgid "Admin Bar Integration" msgstr "" -#: core/admin/Settings.php:637 +#: core/admin/Settings.php:662 msgid "Add Menu" msgstr "" -#: core/admin/Settings.php:637 +#: core/admin/Settings.php:662 msgid "Simple menu will be added to the WordPress admin bar, on both admin side and front end, only available to website administrators with quick links to the plugin panels." msgstr "" -#: core/admin/Settings.php:638 +#: core/admin/Settings.php:663 msgid "New log entries counter" msgstr "" -#: core/admin/Settings.php:638 +#: core/admin/Settings.php:663 msgid "Show number with the new logged entries since the last time you visited the Logs panel." msgstr "" -#: core/admin/Settings.php:651 +#: core/admin/Settings.php:676 msgid "Show Setup Wizard" msgstr "" -#: core/admin/Settings.php:651 +#: core/admin/Settings.php:676 msgid "If enabled, the Setup Wizard item will be included in the plugin admin side navigation." msgstr "" -#: core/base/Content.php:172 +#: core/base/Content.php:178 msgid "Post Status Change" msgstr "" -#: core/base/Content.php:175 +#: core/base/Content.php:181 msgid "Post Deleted" msgstr "" -#: core/base/Content.php:178 +#: core/base/Content.php:184 msgid "Post Term Relationship Changes" msgstr "" -#: core/base/Content.php:181 +#: core/base/Content.php:187 msgid "Post Meta Added" msgstr "" -#: core/base/Content.php:186 +#: core/base/Content.php:192 msgid "Post Meta Updated" msgstr "" -#: core/base/Content.php:191 +#: core/base/Content.php:197 msgid "Post Meta Deleted" msgstr "" -#: core/basic/AdminBar.php:81 +#: core/basic/AdminBar.php:79 msgid "coreActivity" msgstr "" @@ -1293,8 +1333,8 @@ msgid "404 Not Found Style" msgstr "" #: core/components/Internal.php:36 -#: core/log/Activity.php:81 -#: core/log/Activity.php:338 +#: core/log/Activity.php:131 +#: core/log/Activity.php:346 msgid "Internal" msgstr "" @@ -1316,73 +1356,73 @@ msgstr "" msgid "Weekly Digest" msgstr "" -#: core/components/Network.php:21 +#: core/components/Network.php:25 #: core/table/Logs.php:185 #: core/table/Logs.php:732 msgid "Blog" msgstr "" -#: core/components/Network.php:85 +#: core/components/Network.php:89 msgid "Multisite Network" msgstr "" -#: core/components/Network.php:97 +#: core/components/Network.php:101 msgid "Blog Created" msgstr "" -#: core/components/Network.php:100 +#: core/components/Network.php:104 msgid "Blog Removed" msgstr "" -#: core/components/Network.php:103 +#: core/components/Network.php:107 msgid "Blog Updated" msgstr "" -#: core/components/Network.php:106 +#: core/components/Network.php:110 msgid "Blog Signup" msgstr "" -#: core/components/Network.php:109 +#: core/components/Network.php:113 msgid "Failed Blog Signup" msgstr "" -#: core/components/Network.php:112 +#: core/components/Network.php:116 msgid "Blog Status Deleted" msgstr "" -#: core/components/Network.php:115 +#: core/components/Network.php:119 msgid "Blog Status Not Deleted" msgstr "" -#: core/components/Network.php:118 +#: core/components/Network.php:122 msgid "Blog Status Archive" msgstr "" -#: core/components/Network.php:121 +#: core/components/Network.php:125 msgid "Blog Status Not Archive" msgstr "" -#: core/components/Network.php:124 +#: core/components/Network.php:128 msgid "Blog Status Public" msgstr "" -#: core/components/Network.php:127 +#: core/components/Network.php:131 msgid "Blog Status Private" msgstr "" -#: core/components/Network.php:130 +#: core/components/Network.php:134 msgid "Blog Status Spam" msgstr "" -#: core/components/Network.php:133 +#: core/components/Network.php:137 msgid "Blog Status Not Spam" msgstr "" -#: core/components/Network.php:136 +#: core/components/Network.php:140 msgid "Blog Status Mature" msgstr "" -#: core/components/Network.php:139 +#: core/components/Network.php:143 msgid "Blog Status Not Mature" msgstr "" @@ -1435,7 +1475,7 @@ msgid "Transient Deleted" msgstr "" #: core/components/Plugin.php:57 -#: core/log/Activity.php:342 +#: core/log/Activity.php:350 msgid "Plugins" msgstr "" @@ -1523,39 +1563,39 @@ msgstr "" msgid "Created Personal Data File" msgstr "" -#: core/components/RESTAPI.php:38 +#: core/components/RESTAPI.php:49 msgid "REST API" msgstr "" -#: core/components/RESTAPI.php:44 +#: core/components/RESTAPI.php:55 msgid "Unknown REST Route" msgstr "" -#: core/components/RESTAPI.php:47 +#: core/components/RESTAPI.php:58 msgid "Unauthorized REST Request" msgstr "" -#: core/components/RESTAPI.php:50 +#: core/components/RESTAPI.php:61 msgid "Invalid REST Request" msgstr "" -#: core/components/RESTAPI.php:53 +#: core/components/RESTAPI.php:64 msgid "REST Server Error" msgstr "" -#: core/components/RESTAPI.php:56 +#: core/components/RESTAPI.php:67 msgid "REST Item Delete" msgstr "" -#: core/components/RESTAPI.php:59 +#: core/components/RESTAPI.php:70 msgid "REST Item Edited" msgstr "" -#: core/components/RESTAPI.php:62 +#: core/components/RESTAPI.php:73 msgid "REST Item Created" msgstr "" -#: core/components/RESTAPI.php:65 +#: core/components/RESTAPI.php:76 msgid "REST Item Read" msgstr "" @@ -1580,6 +1620,7 @@ msgid "Sitemeta Changed" msgstr "" #: core/components/Sitemeta.php:124 +#: core/plugins/SweepPress.php:76 msgid "Sitemeta Deleted" msgstr "" @@ -1740,8 +1781,8 @@ msgid "There is no account with that username or email address." msgstr "" #: core/components/WordPress.php:61 -#: core/log/Activity.php:82 -#: core/log/Activity.php:334 +#: core/log/Activity.php:132 +#: core/log/Activity.php:342 msgid "WordPress" msgstr "" @@ -1777,238 +1818,240 @@ msgstr "" msgid "Database Delta Queries" msgstr "" -#: core/log/Activity.php:83 -#: core/log/Activity.php:109 -#: core/log/Display.php:226 -#: core/log/Display.php:494 +#: core/log/Activity.php:133 +#: core/log/Activity.php:146 +#: core/log/Display.php:231 +#: core/log/Display.php:500 msgid "Plugin" msgstr "" -#: core/log/Activity.php:100 +#: core/log/Activity.php:137 msgid "Post" msgstr "" -#: core/log/Activity.php:102 +#: core/log/Activity.php:139 msgid "Attachment" msgstr "" -#: core/log/Activity.php:103 +#: core/log/Activity.php:140 msgid "Term" msgstr "" -#: core/log/Activity.php:105 +#: core/log/Activity.php:142 msgid "Comment" msgstr "" -#: core/log/Activity.php:107 +#: core/log/Activity.php:144 #: core/table/Logs.php:186 #: core/table/Logs.php:767 msgid "User" msgstr "" -#: core/log/Activity.php:110 -#: core/log/Display.php:203 -#: core/log/Display.php:481 +#: core/log/Activity.php:147 +#: core/log/Display.php:208 +#: core/log/Display.php:487 msgid "Theme" msgstr "" -#: core/log/Activity.php:111 +#: core/log/Activity.php:148 msgid "Cron" msgstr "" -#: core/log/Activity.php:112 +#: core/log/Activity.php:149 msgid "Option" msgstr "" -#: core/log/Activity.php:113 +#: core/log/Activity.php:150 msgid "Site Meta" msgstr "" -#: core/log/Activity.php:114 +#: core/log/Activity.php:151 msgid "Transient" msgstr "" -#: core/log/Activity.php:115 +#: core/log/Activity.php:152 msgid "Notification" msgstr "" -#: core/log/Activity.php:116 +#: core/log/Activity.php:153 msgid "REST Route" msgstr "" -#: core/log/Display.php:200 -#: core/log/Display.php:478 +#: core/log/Display.php:205 +#: core/log/Display.php:484 msgid "Unknown Theme" msgstr "" -#: core/log/Display.php:223 -#: core/log/Display.php:492 +#: core/log/Display.php:228 +#: core/log/Display.php:498 msgid "Unknown Plugin" msgstr "" -#: core/log/Display.php:245 -#: core/log/Display.php:504 +#: core/log/Display.php:250 +#: core/log/Display.php:510 msgid "Unknown Notification Type" msgstr "" -#: core/log/Display.php:296 -#: core/log/Display.php:558 +#: core/log/Display.php:301 +#: core/log/Display.php:564 msgid "KEY" msgstr "" -#: core/log/Display.php:299 +#: core/log/Display.php:305 msgid "Post: %1$s · %2$s
    Post Type: %3$s" msgstr "" -#: core/log/Display.php:316 +#: core/log/Display.php:322 msgid "ID: %1$s · Post: %2$s
    Post Type: %3$s" msgstr "" -#: core/log/Display.php:318 -#: core/log/Display.php:344 -#: core/log/Display.php:363 -#: core/log/Display.php:381 -#: core/log/Display.php:401 -#: core/log/Display.php:434 -#: core/log/Display.php:449 -#: core/log/Display.php:466 -#: core/log/Display.php:545 -#: core/log/Display.php:587 -#: core/log/Display.php:606 -#: core/log/Display.php:624 -#: core/log/Display.php:643 -#: core/log/Display.php:665 -#: core/log/Display.php:680 -#: core/log/Display.php:697 +#: core/log/Display.php:324 +#: core/log/Display.php:350 +#: core/log/Display.php:369 +#: core/log/Display.php:387 +#: core/log/Display.php:407 +#: core/log/Display.php:440 +#: core/log/Display.php:455 +#: core/log/Display.php:472 +#: core/log/Display.php:551 +#: core/log/Display.php:594 +#: core/log/Display.php:613 +#: core/log/Display.php:631 +#: core/log/Display.php:650 +#: core/log/Display.php:672 +#: core/log/Display.php:687 +#: core/log/Display.php:704 msgid "MISSING" msgstr "" -#: core/log/Display.php:338 +#: core/log/Display.php:344 msgid "ID: %1$s · Author: %2$s
    Post: %3$s" msgstr "" -#: core/log/Display.php:341 +#: core/log/Display.php:347 msgid "ID: %1$s · Author: %2$s
    Post: MISSING" msgstr "" -#: core/log/Display.php:361 +#: core/log/Display.php:367 msgid "ID: %1$s · MIME/Type: %2$s
    Name: %3$s" msgstr "" -#: core/log/Display.php:379 -#: core/log/Display.php:399 +#: core/log/Display.php:385 +#: core/log/Display.php:405 msgid "ID: %1$s · Slug: %2$s
    Name: %3$s" msgstr "" -#: core/log/Display.php:384 -#: core/log/Display.php:404 -#: core/log/Display.php:418 -#: core/log/Display.php:422 -#: core/log/Display.php:627 -#: core/log/Display.php:646 +#: core/log/Display.php:390 +#: core/log/Display.php:410 +#: core/log/Display.php:424 +#: core/log/Display.php:428 +#: core/log/Display.php:634 #: core/log/Display.php:653 -#: core/table/Events.php:96 +#: core/log/Display.php:660 +#: core/table/Events.php:95 #: core/table/Logs.php:184 msgid "ID" msgstr "" -#: core/log/Display.php:432 -#: core/log/Display.php:447 +#: core/log/Display.php:438 +#: core/log/Display.php:453 msgid "ID: %1$s
    Post: %2$s" msgstr "" -#: core/log/Display.php:464 +#: core/log/Display.php:470 msgid "ID: %1$s · Term: %2$s
    Taxonomy: %3$s" msgstr "" -#: core/log/Display.php:543 +#: core/log/Display.php:549 msgid "ID: %1$s · Post: %2$s%3$sPost Type: %4$s" msgstr "" -#: core/log/Display.php:561 +#: core/log/Display.php:568 msgid " · Post: %1$s · %2$s%3$sPost Type: %4$s" msgstr "" -#: core/log/Display.php:581 +#: core/log/Display.php:588 msgid "ID: %1$s · Author: %2$s%3$sPost: %4$s" msgstr "" -#: core/log/Display.php:584 +#: core/log/Display.php:591 msgid "ID: %1$s · Author: %2$s%3$sPost: MISSING" msgstr "" -#: core/log/Display.php:604 +#: core/log/Display.php:611 msgid "ID: %1$s · MIME/Type: %2$s%3$sName: %4$s" msgstr "" -#: core/log/Display.php:622 +#: core/log/Display.php:629 msgid "ID: %1$s · Slug: %2$s%3$sName: %4$s" msgstr "" -#: core/log/Display.php:641 +#: core/log/Display.php:648 msgid "ID: %1$s ยท Slug: %2$s%3$sName: %4$s" msgstr "" -#: core/log/Display.php:663 -#: core/log/Display.php:678 +#: core/log/Display.php:670 +#: core/log/Display.php:685 msgid "ID: %1$s%2$sPost: %3$s" msgstr "" -#: core/log/Display.php:695 +#: core/log/Display.php:702 msgid "ID: %1$s · Term: %2$s%3$sTaxonomy: %4$s" msgstr "" -#: core/log/Display.php:205 +#: core/log/Display.php:210 msgid "Directory" msgstr "" -#: core/log/Display.php:208 -#: core/log/Display.php:230 +#: core/log/Display.php:213 +#: core/log/Display.php:235 #: forms/content-about-minor.php:14 #: forms/content-about-minor.php:18 #: forms/content-about-minor.php:22 #: forms/content-about-minor.php:26 #: forms/content-about-minor.php:30 +#: forms/content-about-minor.php:34 +#: forms/content-about-minor.php:38 msgid "Version" msgstr "" -#: core/log/Display.php:212 -#: core/log/Display.php:234 +#: core/log/Display.php:217 +#: core/log/Display.php:239 msgid "New Version" msgstr "" -#: core/log/Display.php:227 +#: core/log/Display.php:232 msgid "File" msgstr "" -#: core/log/Display.php:252 -#: core/table/Events.php:99 +#: core/log/Display.php:257 +#: core/table/Events.php:98 msgid "Source" msgstr "" -#: core/log/Display.php:253 +#: core/log/Display.php:258 #: forms/dialog-data.php:141 msgid "Name" msgstr "" -#: core/log/Display.php:265 -#: core/log/Display.php:516 +#: core/log/Display.php:270 +#: core/log/Display.php:522 msgid "Invalid" msgstr "" -#: core/log/Display.php:272 -#: core/log/Display.php:523 +#: core/log/Display.php:277 +#: core/log/Display.php:529 #: core/table/Logs.php:765 #: core/table/Logs.php:995 msgid "Not Found" msgstr "" -#: core/log/GEO.php:1154 +#: core/log/GEO.php:1159 msgid "File is Missing" msgstr "" -#: core/log/GEO.php:1163 -#: core/log/GEO.php:1232 +#: core/log/GEO.php:1168 +#: core/log/GEO.php:1235 msgid "Token Missing" msgstr "" @@ -2016,31 +2059,31 @@ msgstr "" msgid "bbPress" msgstr "" -#: core/plugins/BuddyPress.php:32 +#: core/plugins/BuddyPress.php:31 msgid "BuddyPress Component" msgstr "" -#: core/plugins/BuddyPress.php:33 +#: core/plugins/BuddyPress.php:32 msgid "BuddyPress Group" msgstr "" -#: core/plugins/BuddyPress.php:60 +#: core/plugins/BuddyPress.php:59 msgid "BuddyPress" msgstr "" -#: core/plugins/BuddyPress.php:66 +#: core/plugins/BuddyPress.php:65 msgid "Group Created" msgstr "" -#: core/plugins/BuddyPress.php:69 +#: core/plugins/BuddyPress.php:68 msgid "Group Updated" msgstr "" -#: core/plugins/BuddyPress.php:72 +#: core/plugins/BuddyPress.php:71 msgid "Component Activated" msgstr "" -#: core/plugins/BuddyPress.php:75 +#: core/plugins/BuddyPress.php:74 msgid "Component Deactivated" msgstr "" @@ -2050,8 +2093,8 @@ msgid "Contact Form 7" msgstr "" #: core/plugins/ContactForm7.php:62 -#: core/plugins/Forminator.php:52 -#: core/plugins/GravityForms.php:62 +#: core/plugins/Forminator.php:51 +#: core/plugins/GravityForms.php:61 msgid "Form Deleted" msgstr "" @@ -2112,8 +2155,8 @@ msgstr "" msgid "Post Duplicated" msgstr "" -#: core/plugins/Forminator.php:34 -#: core/plugins/Forminator.php:46 +#: core/plugins/Forminator.php:33 +#: core/plugins/Forminator.php:45 msgid "Forminator" msgstr "" @@ -2137,35 +2180,35 @@ msgstr "" msgid "Topic Bulk Edit" msgstr "" -#: core/plugins/GravityForms.php:20 +#: core/plugins/GravityForms.php:19 msgid "Gravity Form" msgstr "" -#: core/plugins/GravityForms.php:21 +#: core/plugins/GravityForms.php:20 msgid "Gravity Entry" msgstr "" -#: core/plugins/GravityForms.php:53 +#: core/plugins/GravityForms.php:52 msgid "Gravity Forms" msgstr "" -#: core/plugins/GravityForms.php:59 +#: core/plugins/GravityForms.php:58 msgid "Form Created" msgstr "" -#: core/plugins/GravityForms.php:65 +#: core/plugins/GravityForms.php:64 msgid "Form Trashed" msgstr "" -#: core/plugins/GravityForms.php:68 +#: core/plugins/GravityForms.php:67 msgid "Form Restored" msgstr "" -#: core/plugins/GravityForms.php:71 +#: core/plugins/GravityForms.php:70 msgid "Form Activated" msgstr "" -#: core/plugins/GravityForms.php:74 +#: core/plugins/GravityForms.php:73 msgid "Form Deactivated" msgstr "" @@ -2185,19 +2228,47 @@ msgstr "" msgid "Deactivated Module" msgstr "" -#: core/plugins/SweepPress.php:32 +#: core/plugins/SweepPress.php:64 msgid "SweepPress" msgstr "" -#: core/plugins/SweepPress.php:38 +#: core/plugins/SweepPress.php:70 msgid "Sweeping Completed" msgstr "" -#: core/plugins/SweepPress.php:41 +#: core/plugins/SweepPress.php:73 +msgid "Options Deleted" +msgstr "" + +#: core/plugins/SweepPress.php:79 +msgid "Postmeta Deleted" +msgstr "" + +#: core/plugins/SweepPress.php:82 +msgid "Termmeta Deleted" +msgstr "" + +#: core/plugins/SweepPress.php:85 +msgid "Commentmeta Deleted" +msgstr "" + +#: core/plugins/SweepPress.php:88 +msgid "Usermeta Deleted" +msgstr "" + +#: core/plugins/SweepPress.php:91 +msgid "Blogmeta Deleted" +msgstr "" + +#: core/plugins/SweepPress.php:94 +msgid "Logmeta Deleted" +msgstr "" + +#: core/plugins/SweepPress.php:97 msgid "Run CRON job" msgstr "" -#: core/plugins/SweepPress.php:44 +#: core/plugins/SweepPress.php:100 msgid "Deleted CRON job" msgstr "" @@ -2225,44 +2296,44 @@ msgstr "" msgid "WooCommerce" msgstr "" -#: core/table/Events.php:98 +#: core/table/Events.php:97 #: forms/dialog-data.php:138 msgid "Category" msgstr "" -#: core/table/Events.php:100 +#: core/table/Events.php:99 #: core/table/Logs.php:187 #: core/table/Logs.php:711 #: forms/dialog-data.php:17 msgid "Component" msgstr "" -#: core/table/Events.php:101 +#: core/table/Events.php:100 #: core/table/Logs.php:188 #: core/table/Logs.php:722 #: forms/dialog-data.php:18 msgid "Event" msgstr "" -#: core/table/Events.php:103 +#: core/table/Events.php:102 msgid "Description" msgstr "" -#: core/table/Events.php:104 +#: core/table/Events.php:103 #: forms/content-dashboard-overall.php:24 #: forms/content-dashboard-overall.php:36 msgid "Available" msgstr "" -#: core/table/Events.php:133 +#: core/table/Events.php:132 msgid "All Sources" msgstr "" -#: core/table/Events.php:138 +#: core/table/Events.php:137 msgid "All Categories" msgstr "" -#: core/table/Events.php:144 +#: core/table/Events.php:143 #: core/table/Logs.php:536 msgid "All Components" msgstr "" @@ -2522,7 +2593,7 @@ msgstr "" msgid "Maintenance and Security Releases" msgstr "" -#: forms/content-about-minor.php:37 +#: forms/content-about-minor.php:45 msgid "For more information, see the changelog." msgstr "" @@ -2668,13 +2739,13 @@ msgstr "" msgid "There are no events logged in the past 30 days." msgstr "" -#: forms/content-events.php:20 -#: forms/content-logs.php:31 +#: forms/content-events.php:21 +#: forms/content-logs.php:32 msgid "Search" msgstr "" #: forms/content-install.php:24 -#: forms/content-update.php:29 +#: forms/content-update.php:28 msgid "All Done" msgstr "" @@ -2683,7 +2754,7 @@ msgid "Installation completed." msgstr "" #: forms/content-install.php:32 -#: forms/content-update.php:37 +#: forms/content-update.php:36 msgid "Click here to continue" msgstr "" @@ -2803,7 +2874,7 @@ msgstr "" msgid "Update status" msgstr "" -#: forms/content-update.php:32 +#: forms/content-update.php:31 msgid "Update completed." msgstr "" diff --git a/forms/content-about-components.php b/forms/content-about-components.php index aa81f78..6a083d4 100644 --- a/forms/content-about-components.php +++ b/forms/content-about-components.php @@ -6,14 +6,14 @@ exit; } -$components = Activity::instance()->get_all_components(); -$events = Activity::instance()->get_all_events(); +$components = Activity::i()->get_all_components(); +$events = Activity::i()->get_all_events(); ?>
    get_all_categories() as $category => $label ) { + foreach ( Activity::i()->get_all_categories() as $category => $label ) { echo '

    ' . esc_html( $label ) . '

    '; foreach ( $components as $component ) { diff --git a/forms/content-about-minor.php b/forms/content-about-minor.php index 51a542c..ea36ddd 100644 --- a/forms/content-about-minor.php +++ b/forms/content-about-minor.php @@ -1,7 +1,7 @@

    - 2.5 / 2.6 / 2.7 / 2.7.1 / 2.8 − - Library Updated. Many improvements and changes. -

    -

    - 2.4.1 / 2.4.2 − - Few minor changes. -

    -

    - 2.4 − - New Component. Library Updated. Few minor changes. -

    -

    - 2.3.1 / 2.3.2 / 2.3.3 / 2.3.4 / 2.3.5 / 2.3.6 − - Few minor changes and fixes. -

    -

    - 2.3 − - External libraries updated. Few minor changes and fixes. -

    -

    - 2.2 − - Events link to cleanup. Device Detector library update Library Updated. Few minor changes. -

    -

    - 2.0.1 / 2.1 − - Library Updated. Few minor changes. + 3.0 − + PHP, WordPress system requirements. Dev4Press Library Updated. Many minor changes.

    get_statistics(); +$db_stats = DB::i()->get_statistics(); ?> diff --git a/forms/content-dashboard-location.php b/forms/content-dashboard-location.php index b088d27..4cda9df 100644 --- a/forms/content-dashboard-location.php +++ b/forms/content-dashboard-location.php @@ -1,7 +1,7 @@ overall(); +$statistics = Statistics::i()->overall(); $active = coreactivity()->is_logging_active(); ?> diff --git a/forms/content-dashboard-statistics.php b/forms/content-dashboard-statistics.php index 51e04b1..2070dd7 100644 --- a/forms/content-dashboard-statistics.php +++ b/forms/content-dashboard-statistics.php @@ -1,14 +1,14 @@ detailed( 30, $_blog_id ); +$statistics = Statistics::i()->detailed( 30, $_blog_id ); ?> diff --git a/forms/content-dashboard.php b/forms/content-dashboard.php index c5686f7..dcef384 100644 --- a/forms/content-dashboard.php +++ b/forms/content-dashboard.php @@ -1,6 +1,6 @@ is_master_network_admin() ) { + if ( Scope::i()->is_master_network_admin() ) { include COREACTIVITY_PATH . 'forms/content-dashboard-overall.php'; include COREACTIVITY_PATH . 'forms/content-dashboard-database.php'; } else { @@ -20,7 +20,7 @@ include COREACTIVITY_PATH . 'forms/content-dashboard-statistics.php'; - if ( Scope::instance()->is_master_network_admin() ) { + if ( Scope::i()->is_master_network_admin() ) { include COREACTIVITY_PATH . 'forms/content-dashboard-location.php'; } diff --git a/forms/content-events.php b/forms/content-events.php index 50756df..5a3550f 100644 --- a/forms/content-events.php +++ b/forms/content-events.php @@ -1,6 +1,6 @@

    -
    · diff --git a/forms/dialog-data.php b/forms/dialog-data.php index b06ab26..8e76c8c 100644 --- a/forms/dialog-data.php +++ b/forms/dialog-data.php @@ -38,7 +38,7 @@ function _coreactivity_dialog_tab_info( $item ) { echo ''; - if ( Core::instance()->show_blog_data() ) { + if ( Core::i()->show_blog_data() ) { $blog = get_blog_details( array( 'blog_id' => $item->blog_id ) ); echo '

    '; @@ -96,9 +96,9 @@ function _coreactivity_dialog_tab_location( $item ) { echo '
    ' . esc_html__( 'Country Code', 'coreactivity' ) . '
    '; echo '
    ' . esc_html( $item->country_code ) . '
    '; echo '
    ' . esc_html__( 'Country', 'coreactivity' ) . '
    '; - echo '
    ' . esc_html( GEO::instance()->country( $item->country_code ) ) . '
    '; + echo '
    ' . esc_html( GEO::i()->country( $item->country_code ) ) . '
    '; echo '
    ' . esc_html__( 'Continent', 'coreactivity' ) . '
    '; - echo '
    ' . esc_html( GEO::instance()->continent( $item->country_code ) ) . '
    '; + echo '
    ' . esc_html( GEO::i()->continent( $item->country_code ) ) . '
    '; } else { echo '
    ' . esc_html__( 'Unknown', 'coreactivity' ) . '
    '; echo '
    ' . esc_html__( 'Localhost IP', 'coreactivity' ) . '
    '; diff --git a/forms/dialog-logs.php b/forms/dialog-logs.php index 2bb3f2f..c62081c 100644 --- a/forms/dialog-logs.php +++ b/forms/dialog-logs.php @@ -1,6 +1,6 @@ install(); diff --git a/forms/setup-statistics.php b/forms/setup-statistics.php index a8cf9c6..d922751 100644 --- a/forms/setup-statistics.php +++ b/forms/setup-statistics.php @@ -9,5 +9,5 @@ $statistics = coreactivity_settings()->get( 'statistics', 'storage' ); if ( empty( $statistics ) ) { - Statistics::instance()->initial_update(); + Statistics::i()->initial_update(); } diff --git a/history.md b/history.md index b75b315..87414c7 100644 --- a/history.md +++ b/history.md @@ -2,6 +2,20 @@ ## Changelog +### Version: 2.6 / October 24, 2024 + +* **new** component: `SweepPress` with 8 more events +* **new** post meta updated: check for values equality +* **new** comment meta updated: check for values equality +* **new** term meta updated: check for values equality +* **new** user meta updated: check for values equality +* **new** option to control logging options and meta changes +* **edit** option edited event: change to equality detection +* **edit** sitemeta edited event: change to equality detection +* **edit** expanded default values for some settings +* **fix** some metadata logging events used wrong meta arguments +* **fix** minor issue with the generating hidden logs row + ### Version: 2.5 / October 15, 2024 * **new** use composer to install third party libraries diff --git a/js/admin.min.js b/js/admin.min.js index 4d24ae8..5f67246 100644 --- a/js/admin.min.js +++ b/js/admin.min.js @@ -1 +1 @@ -!function(c,t,e){t.wp=t.wp||{},t.wp.coreactivity=t.wp.coreactivity||{},t.wp.coreactivity.admin={toggles:{on:"d4p-ui-toggle-on",off:"d4p-ui-toggle-off"},counter:{value:10,show:10,status:!0},init:function(){var t=c.extend({},wp.dev4press.dialogs.default_dialog(),{width:600,maxWidth:720,maxHeight:640,minWidth:360,minHeight:240,resizable:!0,buttons:[c.extend({},wp.dev4press.dialogs.default_button("ok",!0),{click:function(){c("#coreactivity-log-dialog").wpdialog("close")}})]}),i=c.extend({},wp.dev4press.dialogs.default_dialog(),{width:600,maxWidth:720,maxHeight:640,minWidth:360,minHeight:360,resizable:!0,buttons:[c.extend({},wp.dev4press.dialogs.default_button("ok",!0),{click:function(){c("#coreactivity-whois-dialog").wpdialog("close")}})]});c("#coreactivity-log-dialog").wpdialog(t),c("#coreactivity-whois-dialog").wpdialog(i),wp.dev4press.dialogs.icons("#coreactivity-log-dialog"),wp.dev4press.dialogs.icons("#coreactivity-whois-dialog"),c(e).on("click",".coreactivity-toggle-notification",function(t){t.preventDefault();const i=c(this),e=i.data("id"),a=i.data("key"),o=i.data("nonce");c.ajax({type:"POST",dataType:"json",data:{event:e,notification:a},url:ajaxurl+"?action=coreactivity_toggle_notification&_ajax_nonce="+o,success:function(t){wp.coreactivity.admin.helpers.toggle(i,t)}})}),c(e).on("click",".coreactivity-toggle-event",function(t){t.preventDefault();const i=c(this),e=i.data("id"),a=i.data("nonce");c.ajax({type:"POST",dataType:"json",data:{event:e},url:ajaxurl+"?action=coreactivity_toggle_event&_ajax_nonce="+a,success:function(t){wp.coreactivity.admin.helpers.toggle(i,t)}})}),c(e).on("click",".coreactivity-show-whois-popup",function(t){t.preventDefault(),c("#coreactivity-whois-dialog").wpdialog("open"),c.ajax({type:"POST",dataType:"html",data:{whois:c(this).data("ip")},url:ajaxurl+"?action=coreactivity_whois_ip&_ajax_nonce="+c(this).data("nonce"),success:function(t){c("#coreactivity-whois-dialog div").html(t)}})}),c(e).on("click",".coreactivity-show-view-popup",function(t){t.preventDefault();t=c(this).data("log");c("#coreactivity-popup-tabs-info").html(c("#coreactivity-popup-data-info-"+t).clone()),c("#coreactivity-popup-tabs-meta").html(c("#coreactivity-popup-data-meta-"+t).clone()),c("#coreactivity-popup-tabs-location").html(c("#coreactivity-popup-data-location-"+t).clone()),c("#coreactivity-popup-tabs-device").html(c("#coreactivity-popup-data-device-"+t).clone()),c("#coreactivity-log-dialog").wpdialog("open")})},columns:function(){c(e).on("change",".hide-column-tog",function(){var t=c(".wp-list-table thead tr > *:not(.hidden)").length;c(".wp-list-table tbody tr.coreactivity-hidden-row td").attr("colspan",t)}),c(e).on("click","thead th.column-meta, tfoot th.column-meta",function(t){t.preventDefault();var t=c(this).find("i"),i=c("thead th.column-meta i, tfoot th.column-meta i"),e=c(this).closest("table"),a=e.find("tbody tr.coreactivity-hidden-row"),e=e.find("tbody td.column-meta button i");t.hasClass("d4p-ui-chevron-square-up")?(a.addClass("__hidden"),e.removeClass("d4p-ui-chevron-square-up d4p-ui-chevron-square-down").addClass("d4p-ui-chevron-square-down"),i.removeClass("d4p-ui-chevron-square-up").addClass("d4p-ui-chevron-square-down")):(a.removeClass("__hidden"),e.removeClass("d4p-ui-chevron-square-up d4p-ui-chevron-square-down").addClass("d4p-ui-chevron-square-up"),i.removeClass("d4p-ui-chevron-square-down").addClass("d4p-ui-chevron-square-up"))}),c(e).on("click","td.column-meta button",function(t){t.preventDefault();var t=c(this).find("i"),i=c(this).parent().parent().next();t.hasClass("d4p-ui-chevron-square-up")?(i.addClass("__hidden"),t.removeClass("d4p-ui-chevron-square-up").addClass("d4p-ui-chevron-square-down")):(i.removeClass("__hidden"),t.removeClass("d4p-ui-chevron-square-down").addClass("d4p-ui-chevron-square-up"))})},helpers:{toggle:function(t,i){var e;i.hasOwnProperty("toggle")&&""!==i.toggle&&(e=wp.coreactivity.admin.toggles,t.find("i").removeClass(e.on).removeClass(e.off).addClass(e[i.toggle]),t.find("span").html(t.data(i.toggle)))}},live:{init:function(){setTimeout(wp.coreactivity.admin.live.ajax,1e4),setInterval(function(){var t;wp.coreactivity.admin.counter.status&&((t=wp.coreactivity.admin.counter.value<1?'':wp.coreactivity.admin.counter.value)!==wp.coreactivity.admin.counter.show&&c(".coreactivity-live-button strong").html(t),wp.coreactivity.admin.counter.value--,wp.coreactivity.admin.counter.show=t)},1e3)},ajax:function(){let a=[];const o=c(".coreactivity-grid-logs #the-list tr.coreactivity-hidden-row td").first().attr("colspan"),t=c(".coreactivity-grid-logs #the-list tr:not(.coreactivity-old-live-row) > td.hidden");c(".coreactivity-live-row").addClass("coreactivity-old-live-row").removeClass("coreactivity-standout").removeClass("coreactivity-live-row"),t.each(function(){var t=c(this).attr("class").split(" ")[0];a.indexOf(t)<0&&a.push(t)}),c.ajax({url:ajaxurl+"?action=coreactivity_live_logs",type:"post",dataType:"html",data:{args:JSON.stringify(coreactivity_live)},success:function(t){var i,e;0 td").each(function(){c(this).attr("colspan",o)}),c(".coreactivity-live-row > td").each(function(){c(this).removeClass("hidden");let t=c(this).attr("class");t&&(t=t.split(" ")[0],-1{t.wp=t.wp||{},t.wp.coreactivity=t.wp.coreactivity||{},t.wp.coreactivity.admin={toggles:{on:"d4p-ui-toggle-on",off:"d4p-ui-toggle-off"},counter:{value:10,show:10,status:!0},init:function(){var t=c.extend({},wp.dev4press.dialogs.default_dialog(),{width:600,maxWidth:720,maxHeight:640,minWidth:360,minHeight:240,resizable:!0,buttons:[c.extend({},wp.dev4press.dialogs.default_button("ok",!0),{click:function(){c("#coreactivity-log-dialog").wpdialog("close")}})]}),i=c.extend({},wp.dev4press.dialogs.default_dialog(),{width:600,maxWidth:720,maxHeight:640,minWidth:360,minHeight:360,resizable:!0,buttons:[c.extend({},wp.dev4press.dialogs.default_button("ok",!0),{click:function(){c("#coreactivity-whois-dialog").wpdialog("close")}})]});c("#coreactivity-log-dialog").wpdialog(t),c("#coreactivity-whois-dialog").wpdialog(i),wp.dev4press.dialogs.icons("#coreactivity-log-dialog"),wp.dev4press.dialogs.icons("#coreactivity-whois-dialog"),c(e).on("click",".coreactivity-toggle-notification",function(t){t.preventDefault();let i=c(this),e=i.data("id"),a=i.data("key"),o=i.data("nonce");c.ajax({type:"POST",dataType:"json",data:{event:e,notification:a},url:ajaxurl+"?action=coreactivity_toggle_notification&_ajax_nonce="+o,success:function(t){wp.coreactivity.admin.helpers.toggle(i,t)}})}),c(e).on("click",".coreactivity-toggle-event",function(t){t.preventDefault();let i=c(this),e=i.data("id"),a=i.data("nonce");c.ajax({type:"POST",dataType:"json",data:{event:e},url:ajaxurl+"?action=coreactivity_toggle_event&_ajax_nonce="+a,success:function(t){wp.coreactivity.admin.helpers.toggle(i,t)}})}),c(e).on("click",".coreactivity-show-whois-popup",function(t){t.preventDefault(),c("#coreactivity-whois-dialog").wpdialog("open"),c.ajax({type:"POST",dataType:"html",data:{whois:c(this).data("ip")},url:ajaxurl+"?action=coreactivity_whois_ip&_ajax_nonce="+c(this).data("nonce"),success:function(t){c("#coreactivity-whois-dialog div").html(t)}})}),c(e).on("click",".coreactivity-show-view-popup",function(t){t.preventDefault();t=c(this).data("log");c("#coreactivity-popup-tabs-info").html(c("#coreactivity-popup-data-info-"+t).clone()),c("#coreactivity-popup-tabs-meta").html(c("#coreactivity-popup-data-meta-"+t).clone()),c("#coreactivity-popup-tabs-location").html(c("#coreactivity-popup-data-location-"+t).clone()),c("#coreactivity-popup-tabs-device").html(c("#coreactivity-popup-data-device-"+t).clone()),c("#coreactivity-log-dialog").wpdialog("open")})},columns:function(){c(e).on("change",".hide-column-tog",function(){var t=c(".wp-list-table thead tr > *:not(.hidden)").length;c(".wp-list-table tbody tr.coreactivity-hidden-row td").attr("colspan",t)}),c(e).on("click","thead th.column-meta, tfoot th.column-meta",function(t){t.preventDefault();var t=c(this).find("i"),i=c("thead th.column-meta i, tfoot th.column-meta i"),e=c(this).closest("table"),a=e.find("tbody tr.coreactivity-hidden-row"),e=e.find("tbody td.column-meta button i");t.hasClass("d4p-ui-chevron-square-up")?(a.addClass("__hidden"),e.removeClass("d4p-ui-chevron-square-up d4p-ui-chevron-square-down").addClass("d4p-ui-chevron-square-down"),i.removeClass("d4p-ui-chevron-square-up").addClass("d4p-ui-chevron-square-down")):(a.removeClass("__hidden"),e.removeClass("d4p-ui-chevron-square-up d4p-ui-chevron-square-down").addClass("d4p-ui-chevron-square-up"),i.removeClass("d4p-ui-chevron-square-down").addClass("d4p-ui-chevron-square-up"))}),c(e).on("click","td.column-meta button",function(t){t.preventDefault();var t=c(this).find("i"),i=c(this).parent().parent().next();t.hasClass("d4p-ui-chevron-square-up")?(i.addClass("__hidden"),t.removeClass("d4p-ui-chevron-square-up").addClass("d4p-ui-chevron-square-down")):(i.removeClass("__hidden"),t.removeClass("d4p-ui-chevron-square-down").addClass("d4p-ui-chevron-square-up"))})},helpers:{toggle:function(t,i){var e;i.hasOwnProperty("toggle")&&""!==i.toggle&&(e=wp.coreactivity.admin.toggles,t.find("i").removeClass(e.on).removeClass(e.off).addClass(e[i.toggle]),t.find("span").html(t.data(i.toggle)))}},live:{init:function(){setTimeout(wp.coreactivity.admin.live.ajax,1e4),setInterval(function(){var t;wp.coreactivity.admin.counter.status&&((t=wp.coreactivity.admin.counter.value<1?'':wp.coreactivity.admin.counter.value)!==wp.coreactivity.admin.counter.show&&c(".coreactivity-live-button strong").html(t),wp.coreactivity.admin.counter.value--,wp.coreactivity.admin.counter.show=t)},1e3)},ajax:function(){let a=[],o=c(".coreactivity-grid-logs #the-list tr.coreactivity-hidden-row td").first().attr("colspan"),t=c(".coreactivity-grid-logs #the-list tr:not(.coreactivity-old-live-row) > td.hidden");c(".coreactivity-live-row").addClass("coreactivity-old-live-row").removeClass("coreactivity-standout").removeClass("coreactivity-live-row"),t.each(function(){var t=c(this).attr("class").split(" ")[0];a.indexOf(t)<0&&a.push(t)}),c.ajax({url:ajaxurl+"?action=coreactivity_live_logs",type:"post",dataType:"html",data:{args:JSON.stringify(coreactivity_live)},success:function(t){var i,e;0 td").each(function(){c(this).attr("colspan",o)}),c(".coreactivity-live-row > td").each(function(){c(this).removeClass("hidden");let t=c(this).attr("class");t&&(t=t.split(" ")[0],-1