1 parent
e2f85f44d2
commit
54ba716ba8
2 files changed
+13
-3
No files matched your search
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- crash from broken plugin loaded hook input from global
|
||||||
|
|
||||||
## 3.3 - 2019-03-27
|
## 3.3 - 2019-03-27
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -32,15 +32,22 @@ class Plugin_Load_Collector implements Record_Collector_Interface {
|
|||||||
*
|
*
|
||||||
* @param string $plugin Plugin file path.
|
* @param string $plugin Plugin file path.
|
||||||
*/
|
*/
|
||||||
public function plugin_loaded( string $plugin ): void {
|
public function plugin_loaded( $plugin ): void {
|
||||||
|
|
||||||
|
$time = microtime( true );
|
||||||
|
|
||||||
|
if ( ! is_string( $plugin ) ) { // Broken hook input from global.
|
||||||
|
$this->last = $time;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$time = microtime( true );
|
|
||||||
$this->entries[] = [
|
$this->entries[] = [
|
||||||
'name' => $plugin,
|
'name' => $plugin,
|
||||||
'origin' => $this->last,
|
'origin' => $this->last,
|
||||||
'duration' => $time - $this->last,
|
'duration' => $time - $this->last,
|
||||||
];
|
];
|
||||||
$this->last = $time;
|
$this->last = $time;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user