Changeset 13365 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php
- Timestamp:
- 03/20/2024 06:39:08 AM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php
r13335 r13365 1156 1156 $has_self_install_step = false; 1157 1157 if ( isset( $decoded_file[ 'steps' ] ) ) { 1158 foreach ( $decoded_file[ 'steps' ] as $i => $step ) { 1159 if ( 'installPlugin' === $step['step'] 1160 && $plugin_slug === $step['pluginZipFile']['slug'] ) { 1158 foreach ( $decoded_file[ 'steps' ] as &$step ) { 1159 // Normalize a "install plugin from url" to a install-by-slug. 1160 if ( 1161 'installPlugin' === $step['step'] && 1162 isset( $step['pluginZipFile']['url'] ) && 1163 preg_match( '!^https?://downloads\.wordpress\.org/plugin/(?P<slug>[a-z0-9-_]+)(\.(?P<version>.+?))?\.zip($|[?])!i', $step['pluginZipFile']['url'], $m ) 1164 ) { 1165 $step[ 'pluginZipFile' ] = [ 1166 'resource' => 'wordpress.org/plugins', 1167 'slug' => $m['slug'] 1168 ]; 1169 } 1170 1171 // Normalise a "install theme from url" to a install-by-slug. 1172 if ( 1173 'installTheme' === $step['step'] && 1174 isset( $step['themeZipFile']['url'] ) && 1175 preg_match( '!^https?://downloads\.wordpress\.org/theme/(?P<slug>[a-z0-9-_]+)(\.(?P<version>.+?))?\.zip($|[?])!i', $step['themeZipFile']['url'], $m ) 1176 ) { 1177 $step[ 'themeZipFile' ] = [ 1178 'resource' => 'wordpress.org/themes', 1179 'slug' => $m['slug'] 1180 ]; 1181 } 1182 1183 // Check if this is a "install this plugin" step. 1184 if ( 1185 'installPlugin' === $step['step'] && 1186 isset( $step['pluginZipFile']['slug'] ) && 1187 $plugin_slug === $step['pluginZipFile']['slug'] 1188 ) { 1161 1189 $has_self_install_step = true; 1162 1190 1163 1191 if ( true != $step['options']['activate'] ) { 1164 $ decoded_file[ 'steps' ][ $i ][ 'options' ][ 'activate' ] = true;1192 $step[ 'options' ][ 'activate' ] = true; 1165 1193 } 1166 1194 } … … 1169 1197 1170 1198 // Akismet is a special case because the plugin is bundled with WordPress. 1171 if ( ! $has_self_install_step && 'akismet' !== $plugin_slug ) {1199 if ( ! $has_self_install_step && 'akismet' !== $plugin_slug ) { 1172 1200 $decoded_file['steps'][] = array( 1173 1201 'step' => 'installPlugin',
Note: See TracChangeset
for help on using the changeset viewer.