-
Notifications
You must be signed in to change notification settings - Fork 382
Closed
Labels
InfrastructureChanges impacting testing infrastructure or build toolingChanges impacting testing infrastructure or build toolingTaskTasks which do not involve engineeringTasks which do not involve engineering
Milestone
Description
In order to help guide users to properly install the plugin when it has been cloned from GitHub, the plugin includes this code:
Lines 148 to 157 in cb0c7e3
| if ( ! file_exists( __DIR__ . '/vendor/autoload.php' ) || ! file_exists( __DIR__ . '/vendor/sabberworm/php-css-parser' ) || ! file_exists( __DIR__ . '/assets/js/amp-block-editor.js' ) ) { | |
| $_amp_load_errors->add( | |
| 'build_required', | |
| sprintf( | |
| /* translators: %s: composer install && npm install && npm run build */ | |
| __( 'You appear to be running the AMP plugin from source. Please do %s to finish installation.', 'amp' ), // phpcs:ignore WordPress.Security.EscapeOutput | |
| '<code>composer install && npm install && npm run build</code>' | |
| ) | |
| ); | |
| } |
As potentially discovered on the support forum, the file_exists() check may return stale results that necessitate calling clearstatcache().
Nevertheless, this entire if statement is irrelevant from being included in plugin builds distributed from WordPress.org because we already know that those files exist at build time. So we can potentially prevent a bug from happening and improve performance a tiiiiiiny bit by just removing it entirely from amp.php during a build.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
InfrastructureChanges impacting testing infrastructure or build toolingChanges impacting testing infrastructure or build toolingTaskTasks which do not involve engineeringTasks which do not involve engineering