| @@ -32,11 +32,12 @@ | ||
| 32 | 32 | if ( isset( $args['force'] ) && $args['force'] === 'true' ) { |
| 33 | 33 | wp_update_plugins(); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - $response = []; | |
| 37 | - $plugins = get_plugins(); | |
| 38 | - $updates = get_plugin_updates(); | |
| 36 | + $response = []; | |
| 37 | + $plugins = get_plugins(); | |
| 38 | + $updates = get_plugin_updates(); | |
| 39 | + $auto_updates = get_site_option( 'auto_update_plugins', [] ); | |
| 39 | 40 | |
| 40 | 41 | foreach ( $plugins as $file => $details ) { |
| 41 | 42 | $plugin_status = $this->get_status( $file ); |
| 42 | 43 | $update = $this->get_update( $file, $updates ); |
| @@ -57,8 +58,9 @@ | ||
| 57 | 58 | 'status' => $plugin_status, |
| 58 | 59 | 'textdomain' => $details['TextDomain'], |
| 59 | 60 | 'description' => $details['Description'], |
| 60 | 61 | 'php' => $details['RequiresPHP'], |
| 62 | + 'auto_update' => in_array( $file, $auto_updates, true ), | |
| 61 | 63 | ]; |
| 62 | 64 | } |
| 63 | 65 | |
| 64 | 66 | wp_send_json( $response ); |