Skip to content

Commit a930813

Browse files
committed
feat: add j7-dev/tgm-plugin-activation-forked #3
1 parent 42273ea commit a930813

File tree

4 files changed

+62
-77
lines changed

4 files changed

+62
-77
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"usefulteam/jwt-auth": "^2.1",
2626
"lodash-php/lodash-php": "^0.0.7",
2727
"yahnis-elsts/plugin-update-checker": "^5.3",
28-
"tgmpa/tgm-plugin-activation": "^2.6"
28+
"j7-dev/tgm-plugin-activation-forked": "^1.0"
2929
},
3030
"require-dev": {
3131
"squizlabs/php_codesniffer": "@stable",

composer.lock

Lines changed: 51 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inc/class/class-bootstrap.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace J7\WpReactPlugin;
99

1010
use Kucrut\Vite;
11+
use TGM_Plugin_Activation;
1112

1213
/**
1314
* Class Bootstrap
@@ -24,7 +25,6 @@ public function __construct() {
2425

2526
\add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_script' ), 99 );
2627
\add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_script' ), 99 );
27-
\add_action( 'init', array( $this, 'remove_notices' ), 20 );
2828
}
2929

3030
/**
@@ -89,13 +89,4 @@ public function enqueue_script(): void {
8989
)
9090
);
9191
}
92-
93-
/**
94-
* Remove TGMPA notices
95-
*
96-
* @return void
97-
*/
98-
public function remove_notices(): void {
99-
\remove_action( 'admin_notices', array( TGM_Plugin_Activation::$instance, 'notices' ) );
100-
}
10192
}

plugin.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,18 @@ final class Plugin {
7575
* @var array
7676
*/
7777
public $required_plugins = array(
78-
// [
78+
// array(
7979
// 'name' => 'WooCommerce',
8080
// 'slug' => 'woocommerce',
8181
// 'required' => true,
82-
// 'version' => '7.6.1',
83-
// ],
84-
// [
82+
// 'version' => '7.6.0',
83+
// ),
84+
// array(
8585
// 'name' => 'WP Toolkit',
8686
// 'slug' => 'wp-toolkit',
8787
// 'source' => 'https://github.com/j7-dev/wp-toolkit/releases/latest/download/wp-toolkit.zip',
8888
// 'required' => true,
89-
// ],
89+
// ),
9090
);
9191

9292
/**
@@ -114,6 +114,9 @@ public function __construct() {
114114
public function check_required_plugins() {
115115
$instance = TGM_Plugin_Activation::get_instance();
116116
$is_tgmpa_complete = $instance->is_tgmpa_complete();
117+
ob_start();
118+
print_r( $is_tgmpa_complete ? 'TGMPA is complete' : 'TGMPA is not complete' );
119+
\J7\WpToolkit\Utils::debug_log( '' . ob_get_clean() );
117120

118121
if ( $is_tgmpa_complete ) {
119122
self::$dir = \untrailingslashit( \wp_normalize_path( \plugin_dir_path( __FILE__ ) ) );
@@ -251,7 +254,7 @@ public function register_required_plugins(): void {
251254
),
252255
);
253256

254-
call_user_func( __NAMESPACE__ . '\tgmpa', $this->required_plugins, $config );
257+
\tgmpa($this->required_plugins, $config );
255258
}
256259

257260
/**

0 commit comments

Comments
 (0)