Changeset 3246625
- Timestamp:
- 02/25/2025 05:03:27 PM (13 months ago)
- Location:
- logtivity
- Files:
-
- 94 edited
- 1 copied
-
tags/3.1.5 (copied) (copied from logtivity/trunk)
-
tags/3.1.5/Admin/Logtivity_Admin.php (modified) (5 diffs)
-
tags/3.1.5/Admin/Logtivity_Dismiss_Notice_Controller.php (modified) (2 diffs)
-
tags/3.1.5/Admin/Logtivity_Log_Index_Controller.php (modified) (2 diffs)
-
tags/3.1.5/Admin/Logtivity_Options.php (modified) (1 diff)
-
tags/3.1.5/Errors/Logtivity_Error_Log.php (modified) (1 diff)
-
tags/3.1.5/Errors/Logtivity_Error_Logger.php (modified) (1 diff)
-
tags/3.1.5/Errors/Logtivity_Stack_Trace.php (modified) (1 diff)
-
tags/3.1.5/Errors/Logtivity_Stack_Trace_Snippet.php (modified) (1 diff)
-
tags/3.1.5/Helpers/Helpers.php (modified) (6 diffs)
-
tags/3.1.5/Helpers/Logtivity_Log_Global_Function.php (modified) (1 diff)
-
tags/3.1.5/Helpers/Logtivity_Wp_User.php (modified) (1 diff)
-
tags/3.1.5/Logs/Code_Snippets/Logtivity_Code_Snippets.php (modified) (1 diff)
-
tags/3.1.5/Logs/Core/Logtivity_Comment.php (modified) (1 diff)
-
tags/3.1.5/Logs/Core/Logtivity_Core.php (modified) (1 diff)
-
tags/3.1.5/Logs/Core/Logtivity_Meta.php (modified) (1 diff)
-
tags/3.1.5/Logs/Core/Logtivity_Plugin.php (modified) (1 diff)
-
tags/3.1.5/Logs/Core/Logtivity_Post.php (modified) (1 diff)
-
tags/3.1.5/Logs/Core/Logtivity_Term.php (modified) (1 diff)
-
tags/3.1.5/Logs/Core/Logtivity_Theme.php (modified) (1 diff)
-
tags/3.1.5/Logs/Core/Logtivity_User.php (modified) (1 diff)
-
tags/3.1.5/Logs/Download_Monitor/Logtivity_Download_Monitor.php (modified) (1 diff)
-
tags/3.1.5/Logs/Easy_Digital_Downloads/Logtivity_Abstract_Easy_Digital_Downloads.php (modified) (1 diff)
-
tags/3.1.5/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads.php (modified) (1 diff)
-
tags/3.1.5/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads_Recurring.php (modified) (1 diff)
-
tags/3.1.5/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads_Software_Licensing.php (modified) (1 diff)
-
tags/3.1.5/Logs/Formidable/Logtivity_Formidable.php (modified) (1 diff)
-
tags/3.1.5/Logs/Formidable/Logtivity_FrmEntryFormatter.php (modified) (1 diff)
-
tags/3.1.5/Logs/Logtivity_Abstract_Logger.php (modified) (1 diff)
-
tags/3.1.5/Logs/Memberpress/Logtivity_Memberpress.php (modified) (1 diff)
-
tags/3.1.5/Logs/WP_All_Import/Logtivity_WP_All_Import.php (modified) (1 diff)
-
tags/3.1.5/Services/Logtivity_Api.php (modified) (1 diff)
-
tags/3.1.5/Services/Logtivity_Check_For_Disabled_Individual_Logs.php (modified) (1 diff)
-
tags/3.1.5/Services/Logtivity_Check_For_New_Settings.php (modified) (1 diff)
-
tags/3.1.5/Services/Logtivity_Logger.php (modified) (1 diff)
-
tags/3.1.5/Services/Logtivity_Register_Site.php (modified) (1 diff)
-
tags/3.1.5/Services/Logtivity_User_Logger_Trait.php (modified) (1 diff)
-
tags/3.1.5/logtivity.php (modified) (5 diffs)
-
tags/3.1.5/readme.txt (modified) (2 diffs)
-
tags/3.1.5/views/_admin-footer.php (modified) (1 diff)
-
tags/3.1.5/views/_admin-header.php (modified) (1 diff)
-
tags/3.1.5/views/_admin-sidebar.php (modified) (1 diff)
-
tags/3.1.5/views/_log-show.php (modified) (1 diff)
-
tags/3.1.5/views/_logs-loop.php (modified) (1 diff)
-
tags/3.1.5/views/activation.php (modified) (1 diff)
-
tags/3.1.5/views/log-index.php (modified) (1 diff)
-
tags/3.1.5/views/settings.php (modified) (1 diff)
-
tags/3.1.5/views/site-url-changed-notice.php (modified) (1 diff)
-
trunk/Admin/Logtivity_Admin.php (modified) (5 diffs)
-
trunk/Admin/Logtivity_Dismiss_Notice_Controller.php (modified) (2 diffs)
-
trunk/Admin/Logtivity_Log_Index_Controller.php (modified) (2 diffs)
-
trunk/Admin/Logtivity_Options.php (modified) (1 diff)
-
trunk/Errors/Logtivity_Error_Log.php (modified) (1 diff)
-
trunk/Errors/Logtivity_Error_Logger.php (modified) (1 diff)
-
trunk/Errors/Logtivity_Stack_Trace.php (modified) (1 diff)
-
trunk/Errors/Logtivity_Stack_Trace_Snippet.php (modified) (1 diff)
-
trunk/Helpers/Helpers.php (modified) (6 diffs)
-
trunk/Helpers/Logtivity_Log_Global_Function.php (modified) (1 diff)
-
trunk/Helpers/Logtivity_Wp_User.php (modified) (1 diff)
-
trunk/Logs/Code_Snippets/Logtivity_Code_Snippets.php (modified) (1 diff)
-
trunk/Logs/Core/Logtivity_Comment.php (modified) (1 diff)
-
trunk/Logs/Core/Logtivity_Core.php (modified) (1 diff)
-
trunk/Logs/Core/Logtivity_Meta.php (modified) (1 diff)
-
trunk/Logs/Core/Logtivity_Plugin.php (modified) (1 diff)
-
trunk/Logs/Core/Logtivity_Post.php (modified) (1 diff)
-
trunk/Logs/Core/Logtivity_Term.php (modified) (1 diff)
-
trunk/Logs/Core/Logtivity_Theme.php (modified) (1 diff)
-
trunk/Logs/Core/Logtivity_User.php (modified) (1 diff)
-
trunk/Logs/Download_Monitor/Logtivity_Download_Monitor.php (modified) (1 diff)
-
trunk/Logs/Easy_Digital_Downloads/Logtivity_Abstract_Easy_Digital_Downloads.php (modified) (1 diff)
-
trunk/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads.php (modified) (1 diff)
-
trunk/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads_Recurring.php (modified) (1 diff)
-
trunk/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads_Software_Licensing.php (modified) (1 diff)
-
trunk/Logs/Formidable/Logtivity_Formidable.php (modified) (1 diff)
-
trunk/Logs/Formidable/Logtivity_FrmEntryFormatter.php (modified) (1 diff)
-
trunk/Logs/Logtivity_Abstract_Logger.php (modified) (1 diff)
-
trunk/Logs/Memberpress/Logtivity_Memberpress.php (modified) (1 diff)
-
trunk/Logs/WP_All_Import/Logtivity_WP_All_Import.php (modified) (1 diff)
-
trunk/Services/Logtivity_Api.php (modified) (1 diff)
-
trunk/Services/Logtivity_Check_For_Disabled_Individual_Logs.php (modified) (1 diff)
-
trunk/Services/Logtivity_Check_For_New_Settings.php (modified) (1 diff)
-
trunk/Services/Logtivity_Logger.php (modified) (1 diff)
-
trunk/Services/Logtivity_Register_Site.php (modified) (1 diff)
-
trunk/Services/Logtivity_User_Logger_Trait.php (modified) (1 diff)
-
trunk/logtivity.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/views/_admin-footer.php (modified) (1 diff)
-
trunk/views/_admin-header.php (modified) (1 diff)
-
trunk/views/_admin-sidebar.php (modified) (1 diff)
-
trunk/views/_log-show.php (modified) (1 diff)
-
trunk/views/_logs-loop.php (modified) (1 diff)
-
trunk/views/activation.php (modified) (1 diff)
-
trunk/views/log-index.php (modified) (1 diff)
-
trunk/views/settings.php (modified) (1 diff)
-
trunk/views/site-url-changed-notice.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
logtivity/tags/3.1.5/Admin/Logtivity_Admin.php
r3219912 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * … … 106 106 ($this->options->isWhiteLabelMode() ? 'Logs' : 'Logtivity'), 107 107 ($this->options->isWhiteLabelMode() ? 'Logs' : 'Logtivity'), 108 'manage_options',108 Logtivity::ACCESS_LOGS, 109 109 ($this->options->isWhiteLabelMode() ? 'lgtvy-logs' : 'logtivity'), 110 110 [$this, 'showLogIndexPage'], … … 119 119 'Logtivity Settings', 120 120 'Settings', 121 'manage_options',121 Logtivity::ACCESS_SETTINGS, 122 122 'logtivity' . '-settings', 123 123 [$this, 'showLogtivitySettingsPage'] … … 133 133 public function showLogIndexPage() 134 134 { 135 if (!current_user_can( 'manage_options')) {135 if (!current_user_can(Logtivity::ACCESS_LOGS)) { 136 136 wp_die(__('You do not have sufficient permissions to access this page.')); 137 137 } … … 149 149 public function showLogtivitySettingsPage() 150 150 { 151 if (!current_user_can( 'manage_options')) {151 if (!current_user_can(Logtivity::ACCESS_SETTINGS)) { 152 152 wp_die(__('You do not have sufficient permissions to access this page.')); 153 153 } -
logtivity/tags/3.1.5/Admin/Logtivity_Dismiss_Notice_Controller.php
r3219912 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * … … 47 47 public function dismiss(): void 48 48 { 49 if (!current_user_can( 'manage_options')) {49 if (!current_user_can(Logtivity::ACCESS_SETTINGS)) { 50 50 wp_die(__('You do not have sufficient permissions to access this page.')); 51 51 } -
logtivity/tags/3.1.5/Admin/Logtivity_Log_Index_Controller.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * … … 23 23 */ 24 24 25 // @phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols 26 // @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 27 // @phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps 28 25 29 class Logtivity_Log_Index_Controller 26 30 { 27 public function __construct()28 {29 add_action("wp_ajax_nopriv_logtivity_log_index_filter", [$this, 'search']);30 add_action("wp_ajax_logtivity_log_index_filter", [$this, 'search']);31 }31 public function __construct() 32 { 33 add_action('wp_ajax_nopriv_logtivity_log_index_filter', [$this, 'search']); 34 add_action('wp_ajax_logtivity_log_index_filter', [$this, 'search']); 35 } 32 36 33 public function search() 34 { 35 if ( !current_user_can( 'manage_options' ) ) { 36 wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); 37 } 37 /** 38 * @return void 39 */ 40 public function search(): void 41 { 42 if (!current_user_can(Logtivity::ACCESS_LOGS)) { 43 wp_die(__('You do not have sufficient permissions to access this page.')); 44 } 38 45 39 $response = json_decode( 40 (new Logtivity_Api)->get('/logs', [ 41 'page' => $this->getInput('page'), 42 'action' => $this->getInput('search_action'), 43 'context' => $this->getInput('search_context'), 44 'action_user' => $this->getInput('action_user'), 45 ]) 46 ); 47 48 if (!$response) { 49 return $this->errorReponse('Please connect to Logtivity.'); 50 } 46 $response = json_decode( 47 (new Logtivity_Api())->get('/logs', [ 48 'page' => $this->getInput('page'), 49 'action' => $this->getInput('search_action'), 50 'context' => $this->getInput('search_context'), 51 'action_user' => $this->getInput('action_user'), 52 ]) 53 ); 51 54 52 if (property_exists($response, 'message') && $response->message) {53 return $this->errorReponse($response->message);54 }55 if (!$response) { 56 $this->errorReponse('Please connect to Logtivity.'); 57 } 55 58 56 return $this->successResponse($response); 57 } 59 if (property_exists($response, 'message') && $response->message) { 60 $this->errorReponse($response->message); 61 } 58 62 59 private function successResponse($response) 60 { 61 return wp_send_json([ 62 'view' => logtivity_view('_logs-loop', [ 63 'logs' => $response->data, 64 'meta' => $response->meta, 65 'hasNextPage' => $response->links->next, 66 ]) 67 ]); 68 } 63 $this->successResponse($response); 64 } 69 65 70 private function errorReponse($message) 71 { 72 return wp_send_json([ 73 'view' => logtivity_view('_logs-loop', [ 74 'message' => $message, 75 'logs' => [], 76 ]) 77 ]); 78 } 66 /** 67 * @param object $response 68 * 69 * @return void 70 */ 71 private function successResponse(object $response): void 72 { 73 wp_send_json([ 74 'view' => logtivity_view('_logs-loop', [ 75 'logs' => $response->data, 76 'meta' => $response->meta, 77 'hasNextPage' => $response->links->next, 78 ]), 79 ]); 80 } 79 81 80 private function getInput($field) 81 { 82 return ( isset($_GET[$field]) && is_string($_GET[$field]) ? $_GET[$field] : null); 83 } 82 /** 83 * @param string $message 84 * 85 * @return void 86 */ 87 private function errorReponse(string $message): void 88 { 89 wp_send_json([ 90 'view' => logtivity_view('_logs-loop', [ 91 'message' => $message, 92 'logs' => [], 93 ]), 94 ]); 95 } 96 97 /** 98 * @param string $field 99 * 100 * @return ?string 101 */ 102 private function getInput(string $field): ?string 103 { 104 return (isset($_GET[$field]) && is_string($_GET[$field]) ? $_GET[$field] : null); 105 } 84 106 } 85 107 86 new Logtivity_Log_Index_Controller ;108 new Logtivity_Log_Index_Controller(); -
logtivity/tags/3.1.5/Admin/Logtivity_Options.php
r3219912 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Errors/Logtivity_Error_Log.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Errors/Logtivity_Error_Logger.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Errors/Logtivity_Stack_Trace.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Errors/Logtivity_Stack_Trace_Snippet.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Helpers/Helpers.php
r3194447 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * … … 32 32 function logtivity_dd($dump) 33 33 { 34 echo "<pre>";34 echo '<pre>'; 35 35 var_export($dump); 36 echo "</pre>";36 echo '</pre>'; 37 37 die(); 38 38 } … … 41 41 * Load a view and pass variables into it 42 42 * 43 * To ou put a view you would want to echo it43 * To output a view you would want to echo it 44 44 * 45 45 * @param string $fileName excluding file extension … … 50 50 function logtivity_view(string $fileName, array $vars = []): string 51 51 { 52 53 foreach ($vars as $key => $value) { 54 55 ${$key} = $value; 56 57 } 52 extract($vars); 58 53 59 54 ob_start(); 60 55 61 include( dirname(__FILE__). '/../views/' . str_replace('.', '/', $fileName) . '.php');56 include(__DIR__ . '/../views/' . str_replace('.', '/', $fileName) . '.php'); 62 57 63 58 return ob_get_clean(); … … 72 67 { 73 68 return sanitize_text_field( 74 (new Logtivity_Options )->getOption('logtivity_site_api_key')69 (new Logtivity_Options())->getOption('logtivity_site_api_key') 75 70 ); 76 71 } 77 72 78 73 /** 79 * @param $postId74 * @param int $postId 80 75 * 81 76 * @return string … … 123 118 function logtivity_has_site_url_changed(): bool 124 119 { 125 $hash = (new Logtivity_Options )->urlHash();120 $hash = (new Logtivity_Options())->urlHash(); 126 121 127 122 if (!$hash) { -
logtivity/tags/3.1.5/Helpers/Logtivity_Log_Global_Function.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Helpers/Logtivity_Wp_User.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Code_Snippets/Logtivity_Code_Snippets.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Core/Logtivity_Comment.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Core/Logtivity_Core.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Core/Logtivity_Meta.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Core/Logtivity_Plugin.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Core/Logtivity_Post.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Core/Logtivity_Term.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Core/Logtivity_Theme.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Core/Logtivity_User.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Download_Monitor/Logtivity_Download_Monitor.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Easy_Digital_Downloads/Logtivity_Abstract_Easy_Digital_Downloads.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads_Recurring.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads_Software_Licensing.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Formidable/Logtivity_Formidable.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Formidable/Logtivity_FrmEntryFormatter.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Logtivity_Abstract_Logger.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/Memberpress/Logtivity_Memberpress.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Logs/WP_All_Import/Logtivity_WP_All_Import.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Services/Logtivity_Api.php
r3194447 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Services/Logtivity_Check_For_Disabled_Individual_Logs.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Services/Logtivity_Check_For_New_Settings.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Services/Logtivity_Logger.php
r3194447 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Services/Logtivity_Register_Site.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/Services/Logtivity_User_Logger_Trait.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/logtivity.php
r3219912 r3246625 5 5 * Plugin URI: https://logtivity.io 6 6 * Description: Record activity logs and errors logs across all your WordPress sites. 7 * Version: 3.1. 47 * Version: 3.1.5 8 8 * Author: Logtivity 9 9 * Text Domain: logtivity … … 13 13 * @package Logtivity 14 14 * @contact logtivity.io, [email protected] 15 * @copyright 2024 Logtivity. All rights reserved15 * @copyright 2024-2025 Logtivity. All rights reserved 16 16 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 17 17 * … … 37 37 class Logtivity 38 38 { 39 public const ACCESS_LOGS = 'view_logs'; 40 public const ACCESS_SETTINGS = 'view_log_settings'; 41 39 42 /** 40 43 * @var string 41 44 */ 42 protected string $version = '3.1. 4';45 protected string $version = '3.1.5'; 43 46 44 47 /** … … 262 265 public function activated(): void 263 266 { 267 if ($role = get_role('administrator')) { 268 if ($role->has_cap(Logtivity::ACCESS_LOGS) == false) { 269 $role->add_cap(Logtivity::ACCESS_LOGS); 270 } 271 if ($role->has_cap(Logtivity::ACCESS_SETTINGS) == false) { 272 $role->add_cap(Logtivity::ACCESS_SETTINGS); 273 } 274 } 275 264 276 if (apply_filters('logtivity_hide_settings_page', false)) { 265 277 return; … … 287 299 { 288 300 if ( 289 current_user_can( 'manage_options')301 current_user_can(static::ACCESS_SETTINGS) 290 302 && logtivity_has_site_url_changed() 291 303 && !get_transient('dismissed-logtivity-site-url-has-changed-notice') -
logtivity/tags/3.1.5/readme.txt
r3219912 r3246625 5 5 Requires at least: 4.7 6 6 Tested up to: 6.6.2 7 Stable tag: 3.1. 47 Stable tag: 3.1.5 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 263 263 == Changelog == 264 264 265 = 3.1.5 = 266 267 * Add: new capabilities - 'view logs', 'view log settings' 268 269 _Release Date - Pending_ 270 265 271 = 3.1.4 = 266 272 267 _Release Date - T BD273 _Release Date - Thursday, January 9th 2025_ 268 274 269 275 * Fix: Deprecation warning, #50 -
logtivity/tags/3.1.5/views/_admin-footer.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/views/_admin-header.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/views/_admin-sidebar.php
r3194447 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/views/_log-show.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/views/_logs-loop.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/views/activation.php
r3194447 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/views/log-index.php
r3160076 r3246625 3 3 * @package Logtivity 4 4 * @contact logtivity.io, [email protected] 5 * @copyright 2024 Logtivity. All rights reserved5 * @copyright 2024-2025 Logtivity. All rights reserved 6 6 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 7 7 * -
logtivity/tags/3.1.5/views/settings.php
r3194447 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/tags/3.1.5/views/site-url-changed-notice.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Admin/Logtivity_Admin.php
r3219912 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * … … 106 106 ($this->options->isWhiteLabelMode() ? 'Logs' : 'Logtivity'), 107 107 ($this->options->isWhiteLabelMode() ? 'Logs' : 'Logtivity'), 108 'manage_options',108 Logtivity::ACCESS_LOGS, 109 109 ($this->options->isWhiteLabelMode() ? 'lgtvy-logs' : 'logtivity'), 110 110 [$this, 'showLogIndexPage'], … … 119 119 'Logtivity Settings', 120 120 'Settings', 121 'manage_options',121 Logtivity::ACCESS_SETTINGS, 122 122 'logtivity' . '-settings', 123 123 [$this, 'showLogtivitySettingsPage'] … … 133 133 public function showLogIndexPage() 134 134 { 135 if (!current_user_can( 'manage_options')) {135 if (!current_user_can(Logtivity::ACCESS_LOGS)) { 136 136 wp_die(__('You do not have sufficient permissions to access this page.')); 137 137 } … … 149 149 public function showLogtivitySettingsPage() 150 150 { 151 if (!current_user_can( 'manage_options')) {151 if (!current_user_can(Logtivity::ACCESS_SETTINGS)) { 152 152 wp_die(__('You do not have sufficient permissions to access this page.')); 153 153 } -
logtivity/trunk/Admin/Logtivity_Dismiss_Notice_Controller.php
r3219912 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * … … 47 47 public function dismiss(): void 48 48 { 49 if (!current_user_can( 'manage_options')) {49 if (!current_user_can(Logtivity::ACCESS_SETTINGS)) { 50 50 wp_die(__('You do not have sufficient permissions to access this page.')); 51 51 } -
logtivity/trunk/Admin/Logtivity_Log_Index_Controller.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * … … 23 23 */ 24 24 25 // @phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols 26 // @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 27 // @phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps 28 25 29 class Logtivity_Log_Index_Controller 26 30 { 27 public function __construct()28 {29 add_action("wp_ajax_nopriv_logtivity_log_index_filter", [$this, 'search']);30 add_action("wp_ajax_logtivity_log_index_filter", [$this, 'search']);31 }31 public function __construct() 32 { 33 add_action('wp_ajax_nopriv_logtivity_log_index_filter', [$this, 'search']); 34 add_action('wp_ajax_logtivity_log_index_filter', [$this, 'search']); 35 } 32 36 33 public function search() 34 { 35 if ( !current_user_can( 'manage_options' ) ) { 36 wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); 37 } 37 /** 38 * @return void 39 */ 40 public function search(): void 41 { 42 if (!current_user_can(Logtivity::ACCESS_LOGS)) { 43 wp_die(__('You do not have sufficient permissions to access this page.')); 44 } 38 45 39 $response = json_decode( 40 (new Logtivity_Api)->get('/logs', [ 41 'page' => $this->getInput('page'), 42 'action' => $this->getInput('search_action'), 43 'context' => $this->getInput('search_context'), 44 'action_user' => $this->getInput('action_user'), 45 ]) 46 ); 47 48 if (!$response) { 49 return $this->errorReponse('Please connect to Logtivity.'); 50 } 46 $response = json_decode( 47 (new Logtivity_Api())->get('/logs', [ 48 'page' => $this->getInput('page'), 49 'action' => $this->getInput('search_action'), 50 'context' => $this->getInput('search_context'), 51 'action_user' => $this->getInput('action_user'), 52 ]) 53 ); 51 54 52 if (property_exists($response, 'message') && $response->message) {53 return $this->errorReponse($response->message);54 }55 if (!$response) { 56 $this->errorReponse('Please connect to Logtivity.'); 57 } 55 58 56 return $this->successResponse($response); 57 } 59 if (property_exists($response, 'message') && $response->message) { 60 $this->errorReponse($response->message); 61 } 58 62 59 private function successResponse($response) 60 { 61 return wp_send_json([ 62 'view' => logtivity_view('_logs-loop', [ 63 'logs' => $response->data, 64 'meta' => $response->meta, 65 'hasNextPage' => $response->links->next, 66 ]) 67 ]); 68 } 63 $this->successResponse($response); 64 } 69 65 70 private function errorReponse($message) 71 { 72 return wp_send_json([ 73 'view' => logtivity_view('_logs-loop', [ 74 'message' => $message, 75 'logs' => [], 76 ]) 77 ]); 78 } 66 /** 67 * @param object $response 68 * 69 * @return void 70 */ 71 private function successResponse(object $response): void 72 { 73 wp_send_json([ 74 'view' => logtivity_view('_logs-loop', [ 75 'logs' => $response->data, 76 'meta' => $response->meta, 77 'hasNextPage' => $response->links->next, 78 ]), 79 ]); 80 } 79 81 80 private function getInput($field) 81 { 82 return ( isset($_GET[$field]) && is_string($_GET[$field]) ? $_GET[$field] : null); 83 } 82 /** 83 * @param string $message 84 * 85 * @return void 86 */ 87 private function errorReponse(string $message): void 88 { 89 wp_send_json([ 90 'view' => logtivity_view('_logs-loop', [ 91 'message' => $message, 92 'logs' => [], 93 ]), 94 ]); 95 } 96 97 /** 98 * @param string $field 99 * 100 * @return ?string 101 */ 102 private function getInput(string $field): ?string 103 { 104 return (isset($_GET[$field]) && is_string($_GET[$field]) ? $_GET[$field] : null); 105 } 84 106 } 85 107 86 new Logtivity_Log_Index_Controller ;108 new Logtivity_Log_Index_Controller(); -
logtivity/trunk/Admin/Logtivity_Options.php
r3219912 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Errors/Logtivity_Error_Log.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Errors/Logtivity_Error_Logger.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Errors/Logtivity_Stack_Trace.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Errors/Logtivity_Stack_Trace_Snippet.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Helpers/Helpers.php
r3194447 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * … … 32 32 function logtivity_dd($dump) 33 33 { 34 echo "<pre>";34 echo '<pre>'; 35 35 var_export($dump); 36 echo "</pre>";36 echo '</pre>'; 37 37 die(); 38 38 } … … 41 41 * Load a view and pass variables into it 42 42 * 43 * To ou put a view you would want to echo it43 * To output a view you would want to echo it 44 44 * 45 45 * @param string $fileName excluding file extension … … 50 50 function logtivity_view(string $fileName, array $vars = []): string 51 51 { 52 53 foreach ($vars as $key => $value) { 54 55 ${$key} = $value; 56 57 } 52 extract($vars); 58 53 59 54 ob_start(); 60 55 61 include( dirname(__FILE__). '/../views/' . str_replace('.', '/', $fileName) . '.php');56 include(__DIR__ . '/../views/' . str_replace('.', '/', $fileName) . '.php'); 62 57 63 58 return ob_get_clean(); … … 72 67 { 73 68 return sanitize_text_field( 74 (new Logtivity_Options )->getOption('logtivity_site_api_key')69 (new Logtivity_Options())->getOption('logtivity_site_api_key') 75 70 ); 76 71 } 77 72 78 73 /** 79 * @param $postId74 * @param int $postId 80 75 * 81 76 * @return string … … 123 118 function logtivity_has_site_url_changed(): bool 124 119 { 125 $hash = (new Logtivity_Options )->urlHash();120 $hash = (new Logtivity_Options())->urlHash(); 126 121 127 122 if (!$hash) { -
logtivity/trunk/Helpers/Logtivity_Log_Global_Function.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Helpers/Logtivity_Wp_User.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Code_Snippets/Logtivity_Code_Snippets.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Core/Logtivity_Comment.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Core/Logtivity_Core.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Core/Logtivity_Meta.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Core/Logtivity_Plugin.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Core/Logtivity_Post.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Core/Logtivity_Term.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Core/Logtivity_Theme.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Core/Logtivity_User.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Download_Monitor/Logtivity_Download_Monitor.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Easy_Digital_Downloads/Logtivity_Abstract_Easy_Digital_Downloads.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads_Recurring.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads_Software_Licensing.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Formidable/Logtivity_Formidable.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Formidable/Logtivity_FrmEntryFormatter.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Logtivity_Abstract_Logger.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/Memberpress/Logtivity_Memberpress.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Logs/WP_All_Import/Logtivity_WP_All_Import.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Services/Logtivity_Api.php
r3194447 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Services/Logtivity_Check_For_Disabled_Individual_Logs.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Services/Logtivity_Check_For_New_Settings.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Services/Logtivity_Logger.php
r3194447 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Services/Logtivity_Register_Site.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/Services/Logtivity_User_Logger_Trait.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/logtivity.php
r3219912 r3246625 5 5 * Plugin URI: https://logtivity.io 6 6 * Description: Record activity logs and errors logs across all your WordPress sites. 7 * Version: 3.1. 47 * Version: 3.1.5 8 8 * Author: Logtivity 9 9 * Text Domain: logtivity … … 13 13 * @package Logtivity 14 14 * @contact logtivity.io, [email protected] 15 * @copyright 2024 Logtivity. All rights reserved15 * @copyright 2024-2025 Logtivity. All rights reserved 16 16 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 17 17 * … … 37 37 class Logtivity 38 38 { 39 public const ACCESS_LOGS = 'view_logs'; 40 public const ACCESS_SETTINGS = 'view_log_settings'; 41 39 42 /** 40 43 * @var string 41 44 */ 42 protected string $version = '3.1. 4';45 protected string $version = '3.1.5'; 43 46 44 47 /** … … 262 265 public function activated(): void 263 266 { 267 if ($role = get_role('administrator')) { 268 if ($role->has_cap(Logtivity::ACCESS_LOGS) == false) { 269 $role->add_cap(Logtivity::ACCESS_LOGS); 270 } 271 if ($role->has_cap(Logtivity::ACCESS_SETTINGS) == false) { 272 $role->add_cap(Logtivity::ACCESS_SETTINGS); 273 } 274 } 275 264 276 if (apply_filters('logtivity_hide_settings_page', false)) { 265 277 return; … … 287 299 { 288 300 if ( 289 current_user_can( 'manage_options')301 current_user_can(static::ACCESS_SETTINGS) 290 302 && logtivity_has_site_url_changed() 291 303 && !get_transient('dismissed-logtivity-site-url-has-changed-notice') -
logtivity/trunk/readme.txt
r3219912 r3246625 5 5 Requires at least: 4.7 6 6 Tested up to: 6.6.2 7 Stable tag: 3.1. 47 Stable tag: 3.1.5 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 263 263 == Changelog == 264 264 265 = 3.1.5 = 266 267 * Add: new capabilities - 'view logs', 'view log settings' 268 269 _Release Date - Pending_ 270 265 271 = 3.1.4 = 266 272 267 _Release Date - T BD273 _Release Date - Thursday, January 9th 2025_ 268 274 269 275 * Fix: Deprecation warning, #50 -
logtivity/trunk/views/_admin-footer.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/views/_admin-header.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/views/_admin-sidebar.php
r3194447 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/views/_log-show.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/views/_logs-loop.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/views/activation.php
r3194447 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/views/log-index.php
r3160076 r3246625 3 3 * @package Logtivity 4 4 * @contact logtivity.io, [email protected] 5 * @copyright 2024 Logtivity. All rights reserved5 * @copyright 2024-2025 Logtivity. All rights reserved 6 6 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 7 7 * -
logtivity/trunk/views/settings.php
r3194447 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 * -
logtivity/trunk/views/site-url-changed-notice.php
r3160076 r3246625 4 4 * @package Logtivity 5 5 * @contact logtivity.io, [email protected] 6 * @copyright 2024 Logtivity. All rights reserved6 * @copyright 2024-2025 Logtivity. All rights reserved 7 7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 8 *
Note: See TracChangeset
for help on using the changeset viewer.