Plugin Directory

Changeset 3246625


Ignore:
Timestamp:
02/25/2025 05:03:27 PM (13 months ago)
Author:
logtivity
Message:

Add new capabilities for log viewing and settings

Location:
logtivity
Files:
94 edited
1 copied

Legend:

Unmodified
Added
Removed
  • logtivity/tags/3.1.5/Admin/Logtivity_Admin.php

    r3219912 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
     
    106106                ($this->options->isWhiteLabelMode() ? 'Logs' : 'Logtivity'),
    107107                ($this->options->isWhiteLabelMode() ? 'Logs' : 'Logtivity'),
    108                 'manage_options',
     108                Logtivity::ACCESS_LOGS,
    109109                ($this->options->isWhiteLabelMode() ? 'lgtvy-logs' : 'logtivity'),
    110110                [$this, 'showLogIndexPage'],
     
    119119                'Logtivity Settings',
    120120                'Settings',
    121                 'manage_options',
     121                Logtivity::ACCESS_SETTINGS,
    122122                'logtivity' . '-settings',
    123123                [$this, 'showLogtivitySettingsPage']
     
    133133    public function showLogIndexPage()
    134134    {
    135         if (!current_user_can('manage_options')) {
     135        if (!current_user_can(Logtivity::ACCESS_LOGS)) {
    136136            wp_die(__('You do not have sufficient permissions to access this page.'));
    137137        }
     
    149149    public function showLogtivitySettingsPage()
    150150    {
    151         if (!current_user_can('manage_options')) {
     151        if (!current_user_can(Logtivity::ACCESS_SETTINGS)) {
    152152            wp_die(__('You do not have sufficient permissions to access this page.'));
    153153        }
  • logtivity/tags/3.1.5/Admin/Logtivity_Dismiss_Notice_Controller.php

    r3219912 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
     
    4747    public function dismiss(): void
    4848    {
    49         if (!current_user_can('manage_options')) {
     49        if (!current_user_can(Logtivity::ACCESS_SETTINGS)) {
    5050            wp_die(__('You do not have sufficient permissions to access this page.'));
    5151        }
  • logtivity/tags/3.1.5/Admin/Logtivity_Log_Index_Controller.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
     
    2323 */
    2424
     25// @phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols
     26// @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
     27// @phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
     28
    2529class Logtivity_Log_Index_Controller
    2630{
    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    }
    3236
    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        }
    3845
    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        );
    5154
    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        }
    5558
    56         return $this->successResponse($response);
    57     }
     59        if (property_exists($response, 'message') && $response->message) {
     60            $this->errorReponse($response->message);
     61        }
    5862
    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    }
    6965
    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    }
    7981
    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    }
    84106}
    85107
    86 new Logtivity_Log_Index_Controller;
     108new Logtivity_Log_Index_Controller();
  • logtivity/tags/3.1.5/Admin/Logtivity_Options.php

    r3219912 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Errors/Logtivity_Error_Log.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Errors/Logtivity_Error_Logger.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Errors/Logtivity_Stack_Trace.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Errors/Logtivity_Stack_Trace_Snippet.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Helpers/Helpers.php

    r3194447 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
     
    3232function logtivity_dd($dump)
    3333{
    34     echo "<pre>";
     34    echo '<pre>';
    3535    var_export($dump);
    36     echo "</pre>";
     36    echo '</pre>';
    3737    die();
    3838}
     
    4141 * Load a view and pass variables into it
    4242 *
    43  * To ouput a view you would want to echo it
     43 * To output a view you would want to echo it
    4444 *
    4545 * @param string $fileName excluding file extension
     
    5050function logtivity_view(string $fileName, array $vars = []): string
    5151{
    52 
    53     foreach ($vars as $key => $value) {
    54 
    55         ${$key} = $value;
    56 
    57     }
     52    extract($vars);
    5853
    5954    ob_start();
    6055
    61     include(dirname(__FILE__) . '/../views/' . str_replace('.', '/', $fileName) . '.php');
     56    include(__DIR__ . '/../views/' . str_replace('.', '/', $fileName) . '.php');
    6257
    6358    return ob_get_clean();
     
    7267{
    7368    return sanitize_text_field(
    74         (new Logtivity_Options)->getOption('logtivity_site_api_key')
     69        (new Logtivity_Options())->getOption('logtivity_site_api_key')
    7570    );
    7671}
    7772
    7873/**
    79  * @param $postId
     74 * @param int $postId
    8075 *
    8176 * @return string
     
    123118function logtivity_has_site_url_changed(): bool
    124119{
    125     $hash = (new Logtivity_Options)->urlHash();
     120    $hash = (new Logtivity_Options())->urlHash();
    126121
    127122    if (!$hash) {
  • logtivity/tags/3.1.5/Helpers/Logtivity_Log_Global_Function.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Helpers/Logtivity_Wp_User.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Code_Snippets/Logtivity_Code_Snippets.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Core/Logtivity_Comment.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Core/Logtivity_Core.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Core/Logtivity_Meta.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Core/Logtivity_Plugin.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Core/Logtivity_Post.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Core/Logtivity_Term.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Core/Logtivity_Theme.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Core/Logtivity_User.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Download_Monitor/Logtivity_Download_Monitor.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Easy_Digital_Downloads/Logtivity_Abstract_Easy_Digital_Downloads.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads_Recurring.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads_Software_Licensing.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Formidable/Logtivity_Formidable.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Formidable/Logtivity_FrmEntryFormatter.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Logtivity_Abstract_Logger.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/Memberpress/Logtivity_Memberpress.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Logs/WP_All_Import/Logtivity_WP_All_Import.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Services/Logtivity_Api.php

    r3194447 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Services/Logtivity_Check_For_Disabled_Individual_Logs.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Services/Logtivity_Check_For_New_Settings.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Services/Logtivity_Logger.php

    r3194447 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Services/Logtivity_Register_Site.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/Services/Logtivity_User_Logger_Trait.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/logtivity.php

    r3219912 r3246625  
    55 * Plugin URI:  https://logtivity.io
    66 * Description: Record activity logs and errors logs across all your WordPress sites.
    7  * Version:     3.1.4
     7 * Version:     3.1.5
    88 * Author:      Logtivity
    99 * Text Domain: logtivity
     
    1313 * @package   Logtivity
    1414 * @contact   logtivity.io, [email protected]
    15  * @copyright 2024 Logtivity. All rights reserved
     15 * @copyright 2024-2025 Logtivity. All rights reserved
    1616 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    1717 *
     
    3737class Logtivity
    3838{
     39    public const ACCESS_LOGS = 'view_logs';
     40    public const ACCESS_SETTINGS = 'view_log_settings';
     41
    3942    /**
    4043     * @var string
    4144     */
    42     protected string $version = '3.1.4';
     45    protected string $version = '3.1.5';
    4346
    4447    /**
     
    262265    public function activated(): void
    263266    {
     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
    264276        if (apply_filters('logtivity_hide_settings_page', false)) {
    265277            return;
     
    287299    {
    288300        if (
    289             current_user_can('manage_options')
     301            current_user_can(static::ACCESS_SETTINGS)
    290302            && logtivity_has_site_url_changed()
    291303            && !get_transient('dismissed-logtivity-site-url-has-changed-notice')
  • logtivity/tags/3.1.5/readme.txt

    r3219912 r3246625  
    55Requires at least: 4.7
    66Tested up to: 6.6.2
    7 Stable tag: 3.1.4
     7Stable tag: 3.1.5
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    263263== Changelog ==
    264264
     265= 3.1.5 =
     266
     267* Add: new capabilities - 'view logs', 'view log settings'
     268
     269_Release Date - Pending_
     270
    265271= 3.1.4 =
    266272
    267 _Release Date - TBD
     273_Release Date - Thursday, January 9th 2025_
    268274
    269275* Fix: Deprecation warning, #50
  • logtivity/tags/3.1.5/views/_admin-footer.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/views/_admin-header.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/views/_admin-sidebar.php

    r3194447 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/views/_log-show.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/views/_logs-loop.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/views/activation.php

    r3194447 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/views/log-index.php

    r3160076 r3246625  
    33 * @package   Logtivity
    44 * @contact   logtivity.io, [email protected]
    5  * @copyright 2024 Logtivity. All rights reserved
     5 * @copyright 2024-2025 Logtivity. All rights reserved
    66 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    77 *
  • logtivity/tags/3.1.5/views/settings.php

    r3194447 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/tags/3.1.5/views/site-url-changed-notice.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Admin/Logtivity_Admin.php

    r3219912 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
     
    106106                ($this->options->isWhiteLabelMode() ? 'Logs' : 'Logtivity'),
    107107                ($this->options->isWhiteLabelMode() ? 'Logs' : 'Logtivity'),
    108                 'manage_options',
     108                Logtivity::ACCESS_LOGS,
    109109                ($this->options->isWhiteLabelMode() ? 'lgtvy-logs' : 'logtivity'),
    110110                [$this, 'showLogIndexPage'],
     
    119119                'Logtivity Settings',
    120120                'Settings',
    121                 'manage_options',
     121                Logtivity::ACCESS_SETTINGS,
    122122                'logtivity' . '-settings',
    123123                [$this, 'showLogtivitySettingsPage']
     
    133133    public function showLogIndexPage()
    134134    {
    135         if (!current_user_can('manage_options')) {
     135        if (!current_user_can(Logtivity::ACCESS_LOGS)) {
    136136            wp_die(__('You do not have sufficient permissions to access this page.'));
    137137        }
     
    149149    public function showLogtivitySettingsPage()
    150150    {
    151         if (!current_user_can('manage_options')) {
     151        if (!current_user_can(Logtivity::ACCESS_SETTINGS)) {
    152152            wp_die(__('You do not have sufficient permissions to access this page.'));
    153153        }
  • logtivity/trunk/Admin/Logtivity_Dismiss_Notice_Controller.php

    r3219912 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
     
    4747    public function dismiss(): void
    4848    {
    49         if (!current_user_can('manage_options')) {
     49        if (!current_user_can(Logtivity::ACCESS_SETTINGS)) {
    5050            wp_die(__('You do not have sufficient permissions to access this page.'));
    5151        }
  • logtivity/trunk/Admin/Logtivity_Log_Index_Controller.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
     
    2323 */
    2424
     25// @phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols
     26// @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
     27// @phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
     28
    2529class Logtivity_Log_Index_Controller
    2630{
    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    }
    3236
    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        }
    3845
    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        );
    5154
    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        }
    5558
    56         return $this->successResponse($response);
    57     }
     59        if (property_exists($response, 'message') && $response->message) {
     60            $this->errorReponse($response->message);
     61        }
    5862
    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    }
    6965
    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    }
    7981
    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    }
    84106}
    85107
    86 new Logtivity_Log_Index_Controller;
     108new Logtivity_Log_Index_Controller();
  • logtivity/trunk/Admin/Logtivity_Options.php

    r3219912 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Errors/Logtivity_Error_Log.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Errors/Logtivity_Error_Logger.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Errors/Logtivity_Stack_Trace.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Errors/Logtivity_Stack_Trace_Snippet.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Helpers/Helpers.php

    r3194447 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
     
    3232function logtivity_dd($dump)
    3333{
    34     echo "<pre>";
     34    echo '<pre>';
    3535    var_export($dump);
    36     echo "</pre>";
     36    echo '</pre>';
    3737    die();
    3838}
     
    4141 * Load a view and pass variables into it
    4242 *
    43  * To ouput a view you would want to echo it
     43 * To output a view you would want to echo it
    4444 *
    4545 * @param string $fileName excluding file extension
     
    5050function logtivity_view(string $fileName, array $vars = []): string
    5151{
    52 
    53     foreach ($vars as $key => $value) {
    54 
    55         ${$key} = $value;
    56 
    57     }
     52    extract($vars);
    5853
    5954    ob_start();
    6055
    61     include(dirname(__FILE__) . '/../views/' . str_replace('.', '/', $fileName) . '.php');
     56    include(__DIR__ . '/../views/' . str_replace('.', '/', $fileName) . '.php');
    6257
    6358    return ob_get_clean();
     
    7267{
    7368    return sanitize_text_field(
    74         (new Logtivity_Options)->getOption('logtivity_site_api_key')
     69        (new Logtivity_Options())->getOption('logtivity_site_api_key')
    7570    );
    7671}
    7772
    7873/**
    79  * @param $postId
     74 * @param int $postId
    8075 *
    8176 * @return string
     
    123118function logtivity_has_site_url_changed(): bool
    124119{
    125     $hash = (new Logtivity_Options)->urlHash();
     120    $hash = (new Logtivity_Options())->urlHash();
    126121
    127122    if (!$hash) {
  • logtivity/trunk/Helpers/Logtivity_Log_Global_Function.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Helpers/Logtivity_Wp_User.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Code_Snippets/Logtivity_Code_Snippets.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Core/Logtivity_Comment.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Core/Logtivity_Core.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Core/Logtivity_Meta.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Core/Logtivity_Plugin.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Core/Logtivity_Post.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Core/Logtivity_Term.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Core/Logtivity_Theme.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Core/Logtivity_User.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Download_Monitor/Logtivity_Download_Monitor.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Easy_Digital_Downloads/Logtivity_Abstract_Easy_Digital_Downloads.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads_Recurring.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Easy_Digital_Downloads/Logtivity_Easy_Digital_Downloads_Software_Licensing.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Formidable/Logtivity_Formidable.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Formidable/Logtivity_FrmEntryFormatter.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Logtivity_Abstract_Logger.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/Memberpress/Logtivity_Memberpress.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Logs/WP_All_Import/Logtivity_WP_All_Import.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Services/Logtivity_Api.php

    r3194447 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Services/Logtivity_Check_For_Disabled_Individual_Logs.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Services/Logtivity_Check_For_New_Settings.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Services/Logtivity_Logger.php

    r3194447 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Services/Logtivity_Register_Site.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/Services/Logtivity_User_Logger_Trait.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/logtivity.php

    r3219912 r3246625  
    55 * Plugin URI:  https://logtivity.io
    66 * Description: Record activity logs and errors logs across all your WordPress sites.
    7  * Version:     3.1.4
     7 * Version:     3.1.5
    88 * Author:      Logtivity
    99 * Text Domain: logtivity
     
    1313 * @package   Logtivity
    1414 * @contact   logtivity.io, [email protected]
    15  * @copyright 2024 Logtivity. All rights reserved
     15 * @copyright 2024-2025 Logtivity. All rights reserved
    1616 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    1717 *
     
    3737class Logtivity
    3838{
     39    public const ACCESS_LOGS = 'view_logs';
     40    public const ACCESS_SETTINGS = 'view_log_settings';
     41
    3942    /**
    4043     * @var string
    4144     */
    42     protected string $version = '3.1.4';
     45    protected string $version = '3.1.5';
    4346
    4447    /**
     
    262265    public function activated(): void
    263266    {
     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
    264276        if (apply_filters('logtivity_hide_settings_page', false)) {
    265277            return;
     
    287299    {
    288300        if (
    289             current_user_can('manage_options')
     301            current_user_can(static::ACCESS_SETTINGS)
    290302            && logtivity_has_site_url_changed()
    291303            && !get_transient('dismissed-logtivity-site-url-has-changed-notice')
  • logtivity/trunk/readme.txt

    r3219912 r3246625  
    55Requires at least: 4.7
    66Tested up to: 6.6.2
    7 Stable tag: 3.1.4
     7Stable tag: 3.1.5
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    263263== Changelog ==
    264264
     265= 3.1.5 =
     266
     267* Add: new capabilities - 'view logs', 'view log settings'
     268
     269_Release Date - Pending_
     270
    265271= 3.1.4 =
    266272
    267 _Release Date - TBD
     273_Release Date - Thursday, January 9th 2025_
    268274
    269275* Fix: Deprecation warning, #50
  • logtivity/trunk/views/_admin-footer.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/views/_admin-header.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/views/_admin-sidebar.php

    r3194447 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/views/_log-show.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/views/_logs-loop.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/views/activation.php

    r3194447 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/views/log-index.php

    r3160076 r3246625  
    33 * @package   Logtivity
    44 * @contact   logtivity.io, [email protected]
    5  * @copyright 2024 Logtivity. All rights reserved
     5 * @copyright 2024-2025 Logtivity. All rights reserved
    66 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    77 *
  • logtivity/trunk/views/settings.php

    r3194447 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
  • logtivity/trunk/views/site-url-changed-notice.php

    r3160076 r3246625  
    44 * @package   Logtivity
    55 * @contact   logtivity.io, [email protected]
    6  * @copyright 2024 Logtivity. All rights reserved
     6 * @copyright 2024-2025 Logtivity. All rights reserved
    77 * @license   https://www.gnu.org/licenses/gpl.html GNU/GPL
    88 *
Note: See TracChangeset for help on using the changeset viewer.