[wp-trac] [WordPress Trac] #31361: WP_SITEURL and WP_HOME breaks the admin bar and disables styles in the login page

WordPress Trac noreply at wordpress.org
Tue Feb 17 14:02:54 UTC 2015


#31361: WP_SITEURL and WP_HOME breaks the admin bar and disables styles in the
login page
------------------------------------------+-----------------------------
 Reporter:  gemjeweled                    |      Owner:
     Type:  defect (bug)                  |     Status:  new
 Priority:  normal                        |  Milestone:  Awaiting Review
Component:  Administration                |    Version:  4.1
 Severity:  normal                        |   Keywords:
  Focuses:  ui, administration, template  |
------------------------------------------+-----------------------------
 Steps to reproduce:

 1. add the following lines in wp-config.php just above the line {{{/*
 That's all, stop editing! Happy blogging. */}}}:
 {{{
 define( 'WP_SITEURL', 'http://sample.wordpress.org' );
 define( 'WP_HOME', 'http://sample.wordpress.org' );
 }}}

 2. refresh the front end and check via Network in Chrome Developer Tools.
 dashicons.min.css, admin-bar.min.css and admin.bar.min.js are not loaded.
 Even the two jQuery files have loading problems as well.
 [[Image(http://i.imgur.com/ujgM34I.jpg)]]

 3. On view source of the page, the incorrect URLs can be seen (that is,
 those that start with http://www.... with the slug of the page attached).
 The slug of the posts are appended as well, which is not desired.
 [[Image(http://i.imgur.com/zi81tHe.jpg)]]

 4. The same problem can also be seen at the login page - only if a query
 string is appended to the URL. The stylesheets and scripts do not load
 properly because the query string is passed along to the stylesheet and
 script urls. The login page looks fine if there is no query string.
 [[Image(http://i.imgur.com/z9aBiX3.jpg)]]

 5. Same problem still exists even if all plugins are disabled, theme is
 switched to the default theme (Twenty Fifteen, etc) and even with a
 clean/reinstalled copy of WordPress.

 6. Even if the the site and home URL indicated in the database is equal to
 that of the WP_SITEURL and WP_HOME respectively (that is,
 {{{http://sample.wordpress.org}}}
  is also indicated in the database), the same problem still persists. In
 other words, as long as WP_SITEURL and WP_HOME is specified in wp-
 config.php, this problem occurs.

 7. Remove/uncomment the two WP_HOME and WP_SITEURL lines above and
 everything works as expected.

 The only resolution is to avoid the use of both constants and simply
 change the values onto the database.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31361>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list