[wp-trac] [WordPress Trac] #50992: Consider removing the ability to alter the list of environment types

WordPress Trac noreply at wordpress.org
Thu Aug 27 20:32:14 UTC 2020


#50992: Consider removing the ability to alter the list of environment types
--------------------------------------+---------------------
 Reporter:  johnbillion               |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  5.5.1
Component:  Bootstrap/Load            |     Version:  5.5
 Severity:  normal                    |  Resolution:
 Keywords:  needs-dev-note has-patch  |     Focuses:
--------------------------------------+---------------------

Comment (by TimothyBlynJacobs):

 I think `offline` should be considered in a separate ticket for actually
 introducing an offline mode. I understand what `offline` means, but it
 seems better served by [https://wordpress.org/plugins/airplane-mode/ WP
 Airplane Mode]. If we just add it as an allowed environment, but Core
 doesn't actually do the steps the plugin does it doesn't seem very helpful
 and would be cumbersome for plugins to adopt having to check for `offline`
 before making all their HTTP requests or loading external scripts etc...

 > I don't expect Yoast or any other plugin to know or care what my
 environment type is, and it shouldn't be doing anything different

 @elrae It sounds like you are wanting more to identify the actual
 environment the site is on than the environment type. This feature was
 specifically introduced so plugins and WordPress Core can make decisions
 to alter their behavior based on the type of the environment.

 > I can't, I have to come up with my own new mechanism of defining an
 environment. That's where we are today, so what's different?

 If you need the environment for your own purposes, than why not define
 your own constant and use that? What point is there of WordPress
 standardizing it if WordPress Core and Plugins can't rely on it?

 > All plugins / hosts can have a switch statement and if they don't
 recognize my custom environment name, run the production mode.

 As discussed earlier in the ticket, that is of limited utility. If the
 custom environment name is closer to "development" then running as
 production doesn't make sense. But how can a plugin author or Core know
 whether the environment is closer to "development" or "staging" or
 "production" or "local"?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50992#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list