Skip to content

Commit ca42deb

Browse files
author
Marco Pereirinha
committed
The plugin must have the bootstrap complete before running the activation hook
1 parent 77b10b1 commit ca42deb

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

php/class-plugin.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ private function is_notice_component( $component ) {
421421
* @return void
422422
*/
423423
public function init() {
424-
require_once ABSPATH . 'wp-admin/includes/plugin.php';
425424
$plugin = get_plugin_data( CLDN_CORE );
426425
$location = $this->locate_plugin();
427426
$this->slug = ! empty( $plugin['TextDomain'] ) ? $plugin['TextDomain'] : $location['dir_basename'];

php/class-utils.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ protected static function table_installed() {
331331
* Install our custom table.
332332
*/
333333
public static function install() {
334+
// Ensure that the plugin bootstrap is loaded.
335+
get_plugin_instance()->init();
334336

335337
$sql = self::get_table_sql();
336338

0 commit comments

Comments
 (0)