@@ -36,10 +36,9 @@ static public function load_config_run() {
36
36
static public function load_plugins_config () {
37
37
self ::$ config_files [] = dirname ( WPM_PLUGIN_FILE ) . '/core-config.json ' ;
38
38
39
- $ plugins = get_option ( 'active_plugins ' );
40
- if ( ! empty ( $ plugins ) ) {
41
- foreach ( $ plugins as $ p ) {
42
- $ plugin_slug = dirname ( $ p );
39
+ foreach ( get_plugins () as $ pf => $ pd ) {
40
+ if ( is_plugin_active ( $ pf ) ) {
41
+ $ plugin_slug = dirname ( $ pf );
43
42
self ::$ active_plugins [] = $ plugin_slug ;
44
43
$ config_file = WP_PLUGIN_DIR . '/ ' . $ plugin_slug . '/wpm-config.json ' ;
45
44
if ( trim ( $ plugin_slug , '\/. ' ) && file_exists ( $ config_file ) ) {
@@ -48,18 +47,14 @@ static public function load_plugins_config() {
48
47
}
49
48
}
50
49
51
- $ mu_plugins = wp_get_mu_plugins ();
52
-
53
- if ( ! empty ( $ mu_plugins ) ) {
54
- foreach ( $ mu_plugins as $ mup ) {
55
- $ plugin_dir_name = dirname ( $ mup );
56
- $ plugin_base_name = basename ( $ mup , '.php ' );
57
- self ::$ active_plugins [] = $ plugin_base_name ;
58
- $ plugin_sub_dir = $ plugin_dir_name . '/ ' . $ plugin_base_name ;
59
- if ( file_exists ( $ plugin_sub_dir . '/wpm-config.json ' ) ) {
60
- $ config_file = $ plugin_sub_dir . '/wpm-config.json ' ;
61
- self ::$ config_files [ $ plugin_base_name ] = $ config_file ;
62
- }
50
+ foreach ( wp_get_mu_plugins () as $ mup ) {
51
+ $ plugin_dir_name = dirname ( $ mup );
52
+ $ plugin_base_name = basename ( $ mup , '.php ' );
53
+ self ::$ active_plugins [] = $ plugin_base_name ;
54
+ $ plugin_sub_dir = $ plugin_dir_name . '/ ' . $ plugin_base_name ;
55
+ if ( file_exists ( $ plugin_sub_dir . '/wpm-config.json ' ) ) {
56
+ $ config_file = $ plugin_sub_dir . '/wpm-config.json ' ;
57
+ self ::$ config_files [ $ plugin_base_name ] = $ config_file ;
63
58
}
64
59
}
65
60
}
0 commit comments