Make WordPress Core

Opened 4 years ago

Closed 2 years ago

#51162 closed enhancement (wontfix)

Consider adding "offline" as environment on WP_ENVIRONMENT_TYPE

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.5
Component: Bootstrap/Load Keywords: 2nd-opinion needs-patch
Focuses: Cc:

Description

Ticket to consider adding a fifth environment type, offline, to the newly added WP_ENVIRONMENT_TYPE functionality.

Originally proposed by @joostdevalk on #50992, the intention being:

this (usually development) environment can not reach the internet and cannot be reached from the internet.

Personally I'm undecided about this. What's the intention with this type? Is it different enough from local? Is there a use case that this covers that local doesn't?

Feedback welcome.

Change History (6)

#1 @roytanck
4 years ago

This overlaps somewhat with existing constants like WP_LOCAL_DEV and WP_HTTP_BLOCK_EXTERNAL. I'm not sure a server's technical configuration (does it have access to the internet?) is really an environment type. Perhaps a new constant would be a better option?

#2 @azaozz
4 years ago

  • Keywords 2nd-opinion removed
  • Type changed from defect (bug) to enhancement

What's the intention with this type?

I've ran into the need for this when running PHP tests and the local install/server cannot reach the internet. Many tests either take quite long to time out or fail. Having such constant/setting would allow tests that need internet access to be skipped.

Last edited 4 years ago by azaozz (previous) (diff)

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


4 years ago

#4 follow-up: @johnbillion
4 years ago

  • Keywords 2nd-opinion added
  • Milestone changed from 5.5.2 to Future Release

I agree with @roytanck, offline status is distinct from the environment type. I can definitely see a use for an offline flag (Airplane Mode is one of my all time favourite plugins) but I'm not sure that the environment type is the right place for it.

@joostdevalk @azaozz Do you think this needs to be tied to the environment type?

Punting as per bug scrub discussion.

#5 in reply to: ↑ 4 @azaozz
4 years ago

  • Keywords needs-patch added

Replying to johnbillion:

I agree with @roytanck, offline status is distinct from the environment type. I can definitely see a use for an offline flag
...
Do you think this needs to be tied to the environment type?

Right, don't think this belongs together with the environment types, it is rather a "characteristic" of the environment. 'Local', 'development', maybe even 'staging' may not have net access depending on the server/firewall/permissions setup.

In that terms another constant makes most sense, perhaps something like WP_OFFLINE?

Last edited 4 years ago by azaozz (previous) (diff)

#6 @johnbillion
2 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.