$plugin ) { if ( empty( $plugin['UpdateURI'] ) ) { continue; } $plugin_id = get_file_data( $plugin_path . $file, [ 'PluginID' => 'Plugin ID' ] )['PluginID']; if ( ! empty( $plugin_id ) ) { $packages['plugins'][] = $plugin_path . $file; } } $theme_path = WP_CONTENT_DIR . '/themes/'; $themes = wp_get_themes(); foreach ( $themes as $file => $theme ) { if ( empty( $theme->get( 'UpdateURI' ) ) ) { continue; } $theme_id = get_file_data( $theme_path . $file . '/style.css', [ 'ThemeID' => 'Theme ID' ] )['ThemeID']; if ( ! empty( $theme_id ) ) { $packages['themes'][] = $theme_path . $file . '/style.css'; } } return $packages; } /** * Run Git Updater Lite for potential packages. * * @return void */ function run() { $packages = get_packages(); $plugins = $packages['plugins'] ?? []; $themes = $packages['themes'] ?? []; $packages = array_merge( $plugins, $themes); foreach ( $packages as $package ) { ( new Git_Updater\Lite( $package ) )->run(); } }