Plugin Directory

Changeset 2861741


Ignore:
Timestamp:
02/07/2023 10:27:31 PM (3 years ago)
Author:
logtivity
Message:

release 2.2.0

Location:
logtivity
Files:
68 added
8 edited

Legend:

Unmodified
Added
Removed
  • logtivity/trunk/Admin/Logtivity_Options.php

    r2829637 r2861741  
    1111        'logtivity_site_api_key',
    1212        'logtivity_disable_default_logging',
     13        'logtivity_enable_options_table_logging',
     14        'logtivity_enable_post_meta_logging',
    1315        'logtivity_should_store_user_id',
    1416        'logtivity_should_store_ip',
     
    155157    }
    156158
    157     /**
    158      * Is it time to check in with the latest API response incase of any new global settings?
    159      *
    160      * @return bool
    161      */
    162159    public function shouldCheckInWithApi()
    163160    {
    164         $latestReponse = $this->getOption('logtivity_latest_response');
     161        $latestReponse = get_option('logtivity_last_settings_check_in_at');
    165162
    166163        if (is_array($latestReponse) && isset($latestReponse['date'])) {
  • logtivity/trunk/Logs/Core/Logtivity_Core.php

    r2829637 r2861741  
    102102            'logtivity_disable_default_logging',
    103103            'logtivity_site_api_key',
     104            'logtivity_last_settings_check_in_at',
     105            'logtivity_enable_options_table_logging',
     106            'logtivity_enable_post_meta_logging',
    104107            'recently_activated',
    105108            'active_plugins',
     
    152155            'edd_sl',
    153156            'frm_',
     157            'queue',
     158            'cron',
     159            'sync',
     160            'last_run',
    154161        ];
    155162
     
    158165                return;
    159166            }
     167        }
     168
     169        $logtivity_enable_options_table_logging = get_option('logtivity_enable_options_table_logging');
     170
     171        if ($logtivity_enable_options_table_logging === 0 || $logtivity_enable_options_table_logging === '0') {
     172            return;
    160173        }
    161174
  • logtivity/trunk/Logs/Core/Logtivity_Meta.php

    r2743367 r2861741  
    7979        }
    8080
     81        $logtivity_enable_post_meta_logging = get_option('logtivity_enable_post_meta_logging');
     82
     83        if ($logtivity_enable_post_meta_logging === 0 || $logtivity_enable_post_meta_logging === '0') {
     84            return;
     85        }
     86
    8187        return Logtivity_Logger::log()
    8288            ->setAction($this->getPostTypeLabel($object_id) . ' Meta '. $keyword)
  • logtivity/trunk/Services/Logtivity_Api.php

    r2829637 r2861741  
    124124            );
    125125
     126            update_option('logtivity_last_settings_check_in_at', ['date' => date("Y-m-d H:i:s")]);
     127
    126128            $body = json_decode($response, true);
    127129
    128             if (isset($body['settings'])) {
    129                 $this->options->update([
    130                         'logtivity_global_disabled_logs' => $body['settings']['disabled_logs'],
    131                         'logtivity_enable_white_label_mode' => $body['settings']['enable_white_label_mode'],
    132                         'logtivity_disabled_error_levels' => $body['settings']['disabled_error_levels'],
    133                         'logtivity_disable_error_logging' => $body['settings']['disable_error_logging'],
    134                         'logtivity_hide_plugin_from_ui' => $body['settings']['hide_plugin_from_ui'] ?? null,
    135                         // 'logtivity_disable_default_logging' => $body['settings']['disable_default_logging'],
    136                     ],
    137                     false
    138                 );
    139             }
     130            $this->updateSettings($body);
    140131        }
    141132
    142133        return $response;
     134    }
     135
     136    public function updateSettings($body)
     137    {
     138        if (isset($body['settings'])) {
     139            $this->options->update([
     140                    'logtivity_global_disabled_logs' => $body['settings']['disabled_logs'] ?? null,
     141                    'logtivity_enable_white_label_mode' => $body['settings']['enable_white_label_mode'] ?? null,
     142                    'logtivity_disabled_error_levels' => $body['settings']['disabled_error_levels'] ?? null,
     143                    'logtivity_disable_error_logging' => $body['settings']['disable_error_logging'] ?? null,
     144                    'logtivity_hide_plugin_from_ui' => $body['settings']['hide_plugin_from_ui'] ?? null,
     145                    'logtivity_disable_default_logging' => $body['settings']['disable_default_logging'] ?? null,
     146                    'logtivity_enable_options_table_logging' => $body['settings']['enable_options_table_logging'] ?? null,
     147                    'logtivity_enable_post_meta_logging' => $body['settings']['enable_post_meta_logging'] ?? null,
     148                ],
     149                false
     150            );
     151        }
    143152    }
    144153
  • logtivity/trunk/logtivity.php

    r2850788 r2861741  
    55 * Plugin URI:  https://logtivity.io
    66 * Description: Dedicated Event Monitoring for WordPress using Logtivity.io.
    7  * Version:     2.1.1
     7 * Version:     2.2.0
    88 * Author:      Logtivity
    99 * Text Domain: logtivity
     
    1212class Logtivity
    1313{
    14     protected $version = '2.1.1';
     14    protected $version = '2.2.0';
    1515
    1616    /**
     
    3333        'Logs/Logtivity_Abstract_Logger',
    3434        'Services/Logtivity_Check_For_Disabled_Individual_Logs',
     35        'Services/Logtivity_Check_For_New_Settings',
    3536        /**
    3637         * Error logging
     
    143144
    144145        add_action('plugins_loaded', function() {
     146            if ($this->defaultLoggingDisabled()) {
     147                return;
     148            }
     149           
    145150            $this->maybeLoadLogClasses();
    146151
     
    151156    public function maybeLoadLogClasses()
    152157    {
    153         if ($this->defaultLoggingDisabled()) {
    154             return;
    155         }
    156 
    157158        foreach ($this->logClasses as $filePath)
    158159        {
  • logtivity/trunk/readme.md

    r2850788 r2861741  
    55Requires at least: 4.7
    66Tested up to: 6.0
    7 Stable tag: 2.1.1
     7Stable tag: 2.2.0
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    262262
    263263== Changelog ==
     264
     265= 2.2.0 =
     266
     267_Release Date – Tuesday 7th February 2023_
     268
     269* Add support for globally disabling default logs and enabling/disabling Options table and Post Meta changes.
    264270
    265271= 2.1.1 =
  • logtivity/trunk/readme.txt

    r2850788 r2861741  
    55Requires at least: 4.7
    66Tested up to: 6.0
    7 Stable tag: 2.1.1
     7Stable tag: 2.2.0
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    262262
    263263== Changelog ==
     264
     265= 2.2.0 =
     266
     267_Release Date – Tuesday 7th February 2023_
     268
     269* Add support for globally disabling default logs and enabling/disabling Options table and Post Meta changes.
    264270
    265271= 2.1.1 =
  • logtivity/trunk/views/settings.php

    r2805342 r2861741  
    3535                        </td>
    3636                    </tr>           
    37                     <tr class="user-user-login-wrap">
    38                         <th>
    39                             <label for="logtivity_disable_default_logging">Disable built in Event Logging.</label>
    40                             <?php if (has_filter('logtivity_disable_default_logging')): ?>
    41                                 <div class="logtivity-constant">This option has been set in code.</div>
    42                             <?php endif ?>
    43                         </th>
    44                         <td>
    45                             <input type="hidden" name="logtivity_disable_default_logging" id="logtivity_disable_default_logging" value="0">
    46 
    47                             <input <?php echo ( has_filter('logtivity_disable_default_logging') ? 'readonly' : ''); ?> type="checkbox" name="logtivity_disable_default_logging" id="logtivity_disable_default_logging" value="1" class="regular-checkbox" <?php echo ( absint($options['logtivity_disable_default_logging']) ? 'checked' : ''); ?>>
    48                         </td>
    49                         <td>
    50                             <span class="description">Check this box if you do not want the plugin to log actions automatically and you would prefer to manually log specific actions with code.</span>
    51                         </td>
    52                     </tr>
    5337                    <tr class="user-user-login-wrap">
    5438                        <th>
Note: See TracChangeset for help on using the changeset viewer.