@@ -18,13 +18,6 @@ import {
18
18
wordPressRewriteRules ,
19
19
} from '.' ;
20
20
import { joinPaths } from '@php-wasm/util' ;
21
- import { logger } from '@php-wasm/logger' ;
22
- import { removeURLScope } from '@php-wasm/scopes' ;
23
- import {
24
- getLoadedWordPressVersion ,
25
- isSupportedWordPressVersion ,
26
- } from './version-detect' ;
27
- import { wpVersionToStaticAssetsDirectory } from '@wp-playground/wordpress-builds' ;
28
21
29
22
export type PhpIniOptions = Record < string , string > ;
30
23
export type Hook = ( php : PHP ) => void | Promise < void > ;
@@ -199,45 +192,6 @@ export async function bootWordPress(options: BootOptions) {
199
192
200
193
// @TODO Assert WordPress core files are in place
201
194
202
- const remoteAssetListPath = joinPaths (
203
- requestHandler . documentRoot ,
204
- 'wordpress-remote-asset-paths'
205
- ) ;
206
- // Use a common WP static asset to guess whether we are using a minified WP build.
207
- const commonStaticAssetPath = joinPaths (
208
- requestHandler . documentRoot ,
209
- 'wp-admin/css/common.css'
210
- ) ;
211
- if (
212
- ! php . fileExists ( remoteAssetListPath ) &&
213
- ! php . fileExists ( commonStaticAssetPath )
214
- ) {
215
- // We are missing the remote asset listing and a common static file.
216
- // This looks like a minified WP build missing a remote asset listing.
217
- const loadedWordPressVersion = await getLoadedWordPressVersion (
218
- requestHandler
219
- ) ;
220
- if ( isSupportedWordPressVersion ( loadedWordPressVersion ) ) {
221
- const unscopedBaseUrl = removeURLScope (
222
- new URL ( requestHandler . absoluteUrl )
223
- ) ;
224
- const wpStaticAssetsDir = wpVersionToStaticAssetsDirectory (
225
- loadedWordPressVersion
226
- ) ;
227
- const listUrl = `${ unscopedBaseUrl . href } /${ wpStaticAssetsDir } /wordpress-remote-asset-paths` ;
228
- try {
229
- const remoteAssetPaths = await fetch ( listUrl ) . then ( ( res ) =>
230
- res . text ( )
231
- ) ;
232
- php . writeFile ( remoteAssetListPath , remoteAssetPaths ) ;
233
- } catch ( e ) {
234
- logger . warn (
235
- `Failed to fetch remote asset paths from ${ listUrl } `
236
- ) ;
237
- }
238
- }
239
- }
240
-
241
195
// Run "before database" hooks to mount/copy more files in
242
196
if ( options . hooks ?. beforeDatabaseSetup ) {
243
197
await options . hooks . beforeDatabaseSetup ( php ) ;
0 commit comments