Plugin Directory

Changeset 2813255


Ignore:
Timestamp:
11/07/2022 07:54:42 AM (3 years ago)
Author:
logtivity
Message:

Release 2.0.1

Location:
logtivity
Files:
66 added
7 edited

Legend:

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

    r2723235 r2813255  
    2323            ])
    2424        );
     25       
     26        if (!$response) {
     27            return $this->errorReponse('Please connect to Logtivity.');
     28        }
    2529
    2630        if (property_exists($response, 'message') && $response->message) {
  • logtivity/trunk/Errors/Logtivity_Error_Log.php

    r2805342 r2813255  
    1616    public function errorHandler( $code, $message, $file = '', $line = 0 )
    1717    {
    18         if (isset($_SERVER['HTTP_HOST'])) {
    19             $stack_trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS & ~DEBUG_BACKTRACE_PROVIDE_OBJECT);
    20         } else {
    21             $stack_trace = [
    22                 [
    23                     'line' => $file,
    24                     'file' => $line,
    25                 ]
     18        try {
     19            if (isset($_SERVER['HTTP_HOST'])) {
     20                $stack_trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS & ~DEBUG_BACKTRACE_PROVIDE_OBJECT);
     21            } else {
     22                $stack_trace = [
     23                    [
     24                        'line' => $file,
     25                        'file' => $line,
     26                    ]
     27                ];
     28            }
     29
     30            $error = [
     31                'type' => $code,
     32                'message' => $message,
     33                'file' => $file,
     34                'line' => $line,
     35                'stack_trace' => $stack_trace,
     36                'level' => 'warning',
    2637            ];
    27         }
    2838
    29         $error = [
    30             'type' => $code,
    31             'message' => $message,
    32             'file' => $file,
    33             'line' => $line,
    34             'stack_trace' => $stack_trace,
    35             'level' => 'warning',
    36         ];
     39            if ($this->shouldIgnore($error, 'warnings')) {
     40                return;
     41            }
    3742
    38         if ($this->shouldIgnore($error, 'warnings')) {
    39             return;
    40         }
    41 
    42         try {
    4343            Logtivity::logError($error)->send();
     44        } catch (\Throwable $e) {
     45         
    4446        } catch (\Exception $e) {
    45            
     47         
    4648        }
    4749
     
    5355    public function exceptionHandler(Throwable $throwable)
    5456    {
    55         if (isset($_SERVER['HTTP_HOST'])) {
    56             $stack_trace = array_merge(
    57                 [
     57        try {
     58            if (isset($_SERVER['HTTP_HOST'])) {
     59                $stack_trace = array_merge(
     60                    [
     61                        [
     62                            'line' => $throwable->getLine(),
     63                            'file' => $throwable->getFile(),
     64                        ]
     65                    ],
     66                    $throwable->getTrace(),
     67                );
     68            } else {
     69                $stack_trace = [
    5870                    [
    5971                        'line' => $throwable->getLine(),
    6072                        'file' => $throwable->getFile(),
    6173                    ]
    62                 ],
    63                 $throwable->getTrace(),
    64             );
    65         } else {
    66             $stack_trace = [
    67                 [
    68                     'line' => $throwable->getLine(),
    69                     'file' => $throwable->getFile(),
    70                 ]
     74                ];
     75            }
     76
     77            $error = [
     78                'type' => get_class($throwable),
     79                'message' => $throwable->getMessage(),
     80                'file' => $throwable->getFile(),
     81                'line' => $throwable->getLine(),
     82                'stack_trace' => $stack_trace,
     83                'level' => 'error',
    7184            ];
     85
     86            if ($this->shouldIgnore($error, 'errors')) {
     87                return;
     88            }
     89       
     90            Logtivity::logError($error)->send();
     91        } catch (\Throwable $e) {
     92         
     93        } catch (\Exception $e) {
     94         
    7295        }
    73 
    74         $error = [
    75             'type' => get_class($throwable),
    76             'message' => $throwable->getMessage(),
    77             'file' => $throwable->getFile(),
    78             'line' => $throwable->getLine(),
    79             'stack_trace' => $stack_trace,
    80             'level' => 'error',
    81         ];
    82 
    83         if ($this->shouldIgnore($error, 'errors')) {
    84             return;
    85         }
    86 
    87         Logtivity::logError($error)->send();
    8896
    8997        if ($this->exceptionHandler) {
  • logtivity/trunk/Logs/Core/Logtivity_Core.php

    r2805342 r2813255  
    131131            'limit_login_retries',
    132132            'post_views_count',
     133            'mepr_rules_db_cleanup_last_run',
     134            'mepr_products_db_cleanup_last_run',
     135            'mepr_coupons_expire_last_run',
     136            'mepr_groups_db_cleanup_last_run',
    133137        ];
    134138
     
    156160            ->setAction('Option Updated')
    157161            ->setContext($option)
    158             ->addMeta('Old Value', $old_value)
    159             ->addMeta('New Value', $value)
     162            ->addMetaIf(!is_array($old_value) && !is_object($old_value), 'Old Value', $old_value)
     163            ->addMetaIf(!is_array($value) && !is_object($value), 'New Value', $value)
    160164            ->send();
    161165    }
  • logtivity/trunk/Logs/Logtivity_Abstract_Logger.php

    r2707715 r2813255  
    7777        try {
    7878            return new \DateTime( $date );
    79         } catch ( \Exception $e ) {
     79        } catch (\Throwable $e) {
     80            return new \DateTime( '1970-01-01' );
     81        } catch (\Exception $e) {
    8082            return new \DateTime( '1970-01-01' );
    8183        }
  • logtivity/trunk/logtivity.php

    r2805342 r2813255  
    55 * Plugin URI:  https://logtivity.io
    66 * Description: Dedicated Event Monitoring for WordPress using Logtivity.io.
    7  * Version:     2.0
     7 * Version:     2.0.1
    88 * Author:      Logtivity
    99 * Text Domain: logtivity
     
    1212class Logtivity
    1313{
    14     protected $version = '2.0';
     14    protected $version = '2.0.1';
    1515
    1616    /**
  • logtivity/trunk/readme.md

    r2805342 r2813255  
    55Requires at least: 4.7
    66Tested up to: 6.0
    7 Stable tag: 2.0
     7Stable tag: 2.0.1
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    226226
    227227== Changelog ==
     228
     229= 2.0.1 =
     230
     231_Release Date – Monday 7th November 2022_
     232
     233* Add better messaging on logs page when there are no results.
     234* Refine Option Updated meta sent.
     235* Wrap error logging in try catch just incase of issue during logging.
    228236
    229237= 2.0 =
  • logtivity/trunk/readme.txt

    r2805342 r2813255  
    55Requires at least: 4.7
    66Tested up to: 6.0
    7 Stable tag: 2.0
     7Stable tag: 2.0.1
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    226226
    227227== Changelog ==
     228
     229= 2.0.1 =
     230
     231_Release Date – Monday 7th November 2022_
     232
     233* Wrap better messaging on logs page when there are no results.
     234* Refine Option Updated meta sent.
     235* Add wrap error logging in try catch just incase of issue during logging.
    228236
    229237= 2.0 =
Note: See TracChangeset for help on using the changeset viewer.