Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(slic-stack.yml) control the WP_HTTP_BLOCK_EXTERNAL const #173

Merged
merged 2 commits into from
Nov 20, 2023

Conversation

lucatume
Copy link
Contributor

@lucatume lucatume commented Nov 20, 2023

Use the SLIC_WP_HTTP_BLOCK_EXTERNAL env var.

By default slic will set up the embedded WordPress installation to block all outgoing HTTP requests using the WP_HTTP_BLOCK_EXTERNAL constant.

In some instances this might cause issues with projects that need to call outside APIs to work.

This PR explores the possibility of controlling that constant value using the SLIC_WP_HTTP_BLOCK_EXTERNAL env var.

Similarly, this PR introduces control, via the .env.slic.run file, for the DISABLE_WP_CRON constant defined in the wp-config.php file.

Use the SLIC_WP_HTTP_BLOCK_EXTERNAL env var.
@lucatume lucatume self-assigned this Nov 20, 2023
@lucatume lucatume marked this pull request as ready for review November 20, 2023 17:12
Copy link
Contributor

@defunctl defunctl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with SLIC_WP_HTTP_BLOCK_EXTERNAL=false in my .env.slic.local and a slic restart now my plugin activation tests pass.

@defunctl
Copy link
Contributor

Went into the WordPress docker container as well and ran a printenv to 100% confirm:

WORDPRESS_CONFIG_EXTRA=$scheme = empty( $_SERVER['HTTPS'] ) ? 'http' : 'https';
$url    = isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : 'wordpress.test';
define( 'WP_HOME', $scheme . '://' . $url );
define( 'WP_SITEURL', $scheme . '://' . $url );
define( 'WP_REDIS_HOST', 'redis' );
define( 'WP_REDIS_PORT', 6379 );
define( 'TRIBE_NO_FREEMIUS', true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'WP_DEBUG_LOG', true );
define( 'DISABLE_WP_CRON', true );
define( 'WP_HTTP_BLOCK_EXTERNAL', false );

@lucatume lucatume changed the base branch from main to 1.5.1 November 20, 2023 17:16
@lucatume lucatume merged commit 0d75495 into 1.5.1 Nov 20, 2023
@lucatume lucatume deleted the control-wp-http-block branch November 20, 2023 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants