We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75d435a commit 726e133Copy full SHA for 726e133
1 file changed
classes/rest/class-stats.php
@@ -175,6 +175,17 @@ public function get_stats( \WP_REST_Request $request ) {
175
176
$data['plugin_url'] = \esc_url( \get_admin_url( null, 'admin.php?page=progress-planner' ) );
177
178
+ $active_plugins = \get_option( 'active_plugins' );
179
+ $data['plugins'] = [];
180
+ foreach ( $active_plugins as $plugin ) {
181
+ $plugin_data = \get_plugin_data( \WP_PLUGIN_DIR . '/' . $plugin );
182
+ $data['plugins'][] = [
183
+ 'plugin' => $plugin,
184
+ 'name' => $plugin_data['Name'] ?? 'N/A', // @phpstan-ignore-line nullCoalesce.offset
185
+ 'version' => $plugin_data['Version'] ?? 'N/A', // @phpstan-ignore-line nullCoalesce.offset
186
+ ];
187
+ }
188
+
189
return new \WP_REST_Response( $data );
190
}
191
0 commit comments