| 1 |
<?php |
| 2 |
|
| 3 |
class Logtivity_Core extends Logtivity_Abstract_Logger |
| 4 |
{ |
| 5 |
public function registerHooks() |
| 6 |
{ |
| 7 |
add_action( 'upgrader_process_complete', [$this, 'upgradeProcessComplete'], 10, 2); |
| 8 |
} |
| 9 |
|
| 10 |
public function upgradeProcessComplete( $upgrader_object, $options ) |
| 11 |
{ |
| 12 |
if ( $options['type'] != 'core' ) { |
| 13 |
return; |
| 14 |
} |
| 15 |
|
| 16 |
if ($options['action'] == 'update') { |
| 17 |
|
| 18 |
return $this->coreUpdated($upgrader_object, $options); |
| 19 |
|
| 20 |
} |
| 21 |
|
| 22 |
if ($options['action'] == 'install') { |
| 23 |
|
| 24 |
return $this->coreInstalled($upgrader_object, $options); |
| 25 |
|
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
public function coreUpdated($upgrader_object, $options) |
| 30 |
{ |
| 31 |
return Logtivity_Logger::log('WP Core Updated'); |
| 32 |
} |
| 33 |
|
| 34 |
public function coreInstalled($upgrader_object, $options) |
| 35 |
{ |
| 36 |
return Logtivity_Logger::log('WP Core Installed'); |
| 37 |
} |
| 38 |
|
| 39 |
} |
| 40 |
|
| 41 |
$Logtivity_Core = new Logtivity_Core; |