diff --git a/plugins/versionpress/.versionpress/hooks.php b/plugins/versionpress/.versionpress/hooks.php index e6cb71aec..1669496e8 100644 --- a/plugins/versionpress/.versionpress/hooks.php +++ b/plugins/versionpress/.versionpress/hooks.php @@ -426,7 +426,7 @@ /** @var DbSchemaInfo $dbSchema */ $dbSchema = $versionPressContainer->resolve(VersionPressServices::DB_SCHEMA); $tableSchemaStorage = $versionPressContainer->resolve(VersionPressServices::TABLE_SCHEMA_STORAGE); - $dbSchema->refreshDbSchema(PluginDefinitionDiscovery::getPathsForActivePlugins('schema.yml')); + $dbSchema->refreshDbSchema(PluginDefinitionDiscovery::getPathsForPlugins('schema.yml')); vp_update_table_ddl_scripts($dbSchema, $tableSchemaStorage); @@ -443,7 +443,7 @@ /** @var DbSchemaInfo $dbSchema */ $dbSchema = $versionPressContainer->resolve(VersionPressServices::DB_SCHEMA); $tableSchemaStorage = $versionPressContainer->resolve(VersionPressServices::TABLE_SCHEMA_STORAGE); - $dbSchema->refreshDbSchema(PluginDefinitionDiscovery::getPathsForActivePlugins('schema.yml')); + $dbSchema->refreshDbSchema(PluginDefinitionDiscovery::getPathsForPlugins('schema.yml')); vp_update_table_ddl_scripts($dbSchema, $tableSchemaStorage); @@ -492,7 +492,7 @@ $dbSchema = $versionPressContainer->resolve(VersionPressServices::DB_SCHEMA); $tableSchemaStorage = $versionPressContainer->resolve(VersionPressServices::TABLE_SCHEMA_STORAGE); - $dbSchema->refreshDbSchema(PluginDefinitionDiscovery::getPathsForActivePlugins('schema.yml')); + $dbSchema->refreshDbSchema(PluginDefinitionDiscovery::getPathsForPlugins('schema.yml')); vp_update_table_ddl_scripts($dbSchema, $tableSchemaStorage); diff --git a/plugins/versionpress/src/Actions/PluginDefinitionDiscovery.php b/plugins/versionpress/src/Actions/PluginDefinitionDiscovery.php index 209a3d2f0..ecb38f418 100644 --- a/plugins/versionpress/src/Actions/PluginDefinitionDiscovery.php +++ b/plugins/versionpress/src/Actions/PluginDefinitionDiscovery.php @@ -24,13 +24,13 @@ public static function getPathForPlugin($pluginSlug, $definitionFile) return null; } - public static function getPathsForActivePlugins($definitionFile) + public static function getPathsForPlugins($definitionFile) { if (!function_exists('get_plugins')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } - $plugins = get_option('active_plugins'); + $plugins = array_keys(get_plugins()); foreach ($plugins as $pluginFile) { $pluginSlug = dirname($pluginFile); diff --git a/plugins/versionpress/src/DI/DIContainer.php b/plugins/versionpress/src/DI/DIContainer.php index f6aaf856f..cc6faee7c 100644 --- a/plugins/versionpress/src/DI/DIContainer.php +++ b/plugins/versionpress/src/DI/DIContainer.php @@ -92,7 +92,7 @@ public static function getConfiguredInstance() $dic->register(VersionPressServices::DB_SCHEMA, function () { global $table_prefix, $wp_db_version; return new DbSchemaInfo( - PluginDefinitionDiscovery::getPathsForActivePlugins('schema.yml'), + PluginDefinitionDiscovery::getPathsForPlugins('schema.yml'), $table_prefix, $wp_db_version ); @@ -107,7 +107,7 @@ public static function getConfiguredInstance() }); $dic->register(VersionPressServices::ACTIONSINFO_PROVIDER_ACTIVE_PLUGINS, function () { - return new ActionsInfoProvider(PluginDefinitionDiscovery::getPathsForActivePlugins('actions.yml')); + return new ActionsInfoProvider(PluginDefinitionDiscovery::getPathsForPlugins('actions.yml')); }); $dic->register(VersionPressServices::CHANGEINFO_FACTORY, function () use ($dic) { @@ -208,7 +208,7 @@ public static function getConfiguredInstance() }); $dic->register(VersionPressServices::SHORTCODES_INFO, function () { - return new ShortcodesInfo(PluginDefinitionDiscovery::getPathsForActivePlugins('shortcodes.yml')); + return new ShortcodesInfo(PluginDefinitionDiscovery::getPathsForPlugins('shortcodes.yml')); }); $dic->register(VersionPressServices::SQL_QUERY_PARSER, function () use ($dic) {