Commit Graph

94 Commits

Author SHA1 Message Date
Sergey Biryukov e72fff9cef Code Modernization: Replace `dirname( __FILE__ )` calls with `__DIR__` magic constant.
This avoids the performance overhead of the function call every time `dirname( __FILE__ )` was used instead of `__DIR__`.

This commit also includes:

* Removing unnecessary parentheses from `include`/`require` statements. These are language constructs, not function calls.
* Replacing `include` statements for several files with `require_once`, for consistency:
 * `wp-admin/admin-header.php`
 * `wp-admin/admin-footer.php`
 * `wp-includes/version.php`

Props ayeshrajans, desrosj, valentinbora, jrf, joostdevalk, netweb.
Fixes #48082.

git-svn-id: https://develop.svn.wordpress.org/trunk@47198 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-06 06:31:22 +00:00
Sergey Biryukov cfc3b57488 Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47122 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-29 00:43:23 +00:00
Sergey Biryukov 00b03f2a6f I18N: Capitalize translator comments consistently, add trailing punctuation.
Includes minor code layout fixes.

See #44360.

git-svn-id: https://develop.svn.wordpress.org/trunk@45932 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-03 00:39:13 +00:00
Sergey Biryukov 3008781746 Bootstrap/Load: Change "Insufficient Requirements" `wp_die()` heading to "Requirements Not Met", which is more appropriate for the context it's used in.
Props yoavf.
Fixes #47575.

git-svn-id: https://develop.svn.wordpress.org/trunk@45770 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-08 12:53:21 +00:00
Sergey Biryukov 1e6420ba55 Docs: Add missing description for `$wp_locale` global.
Props mukesh27.
See #45604, #47110.

git-svn-id: https://develop.svn.wordpress.org/trunk@45737 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-04 01:45:03 +00:00
Sergey Biryukov 77a1f39484 Upgrade/Install: Bring some consistency to installation screen styles.
* Include `forms.css` and `l10n.css`, for consistency with login screen and other admin screens.
* Remove redundant `@import` directives from `login.css` for files already declared as dependencies.
* Adjust margin on password strength meter for consistency with other fields.
* Increase font size for "You will need this password to log in" notice.
* Fix misaligned icon on "Hide" button for the password.

Props iseulde, dan@micamedia.com, bassgang, cdog, johnbillion, nmenescardi, mukesh27, SergeyBiryukov.
Fixes #35776, #47757, #47758.

git-svn-id: https://develop.svn.wordpress.org/trunk@45673 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-25 19:10:33 +00:00
Gary Pendergast 9a1549767e Coding Standards: Fix the `Squiz.PHP.DisallowMultipleAssignments` violations in `wp-admin`.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45583 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 12:50:14 +00:00
Sergey Biryukov a3fbc75237 Accessibility: Make sure layout tables across the admin are correctly linearized.
Adds `role="presentation"` to the `<table>` elements used for layout purposes.

Ideally, HTML tables should be used for tabular data. When tables are used for layout purposes, it's important to remove any native semantics so that assistive technologies can correctly announce the table content in a linearized fashion.

Props greatislander, afercia.
Fixes #46899.

git-svn-id: https://develop.svn.wordpress.org/trunk@45403 602fd350-edb4-49c9-b593-d223f7449a82
2019-05-24 21:55:21 +00:00
Sergey Biryukov 0205cf09f0 Upgrade/Install: Improve error messages displayed when WordPress update fails due to an incompatible PHP version by linking to the Update PHP support page.
Additionally, fix a regression in [44451] where the error message in `wp-admin/upgrade.php` was prepared, but never displayed.

Props afragen, netweb, hareesh-pillai, SergeyBiryukov.
Fixes #46937.

git-svn-id: https://develop.svn.wordpress.org/trunk@45357 602fd350-edb4-49c9-b593-d223f7449a82
2019-05-17 18:10:55 +00:00
Sergey Biryukov 4206fe3e05 Docs: Remove `@global` tag for `$wpdb` from `wp-admin/install.php` and `wp-admin/upgrade.php`.
Per the documentation standards, the `@global` tag is meant to list PHP globals used within functions or methods.

The code in question uses the variable in global namespace, but does not explicitly declare it.

Props jayupadhyay01, dswebsme.
Fixes #46602.

git-svn-id: https://develop.svn.wordpress.org/trunk@45233 602fd350-edb4-49c9-b593-d223f7449a82
2019-04-17 14:06:55 +00:00
Andrea Fercia 238e8991f8 Accessibility: Remove negative tabindex from the login, install, and setup pages header.
Props bamadesigner, rishishah, jainnidhi.
Fixes #42632.


git-svn-id: https://develop.svn.wordpress.org/trunk@44545 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 17:20:59 +00:00
Gary Pendergast 7bf44ed065 Install/Upgrade: Link to HelpHub instead of the Codex.
WordPress version links in the Codex (eg, https://codex.wordpress.org/Version_5.0) are redirected to their HelpHub equivalent.

Rather than relying on the redirect, Core and link directly to HelpHub.

Props swissspidy.
Fixes #45574.



git-svn-id: https://develop.svn.wordpress.org/trunk@44451 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-08 03:28:15 +00:00
Gary Pendergast a75d153eee Coding Standards: Upgrade WPCS to 1.0.0
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.



git-svn-id: https://develop.svn.wordpress.org/trunk@43571 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-17 01:50:26 +00:00
Gary Pendergast 8f95800d52 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-30 23:09:33 +00:00
Gary Pendergast 574821573a General: Fix some precision alignment formatting warnings.
The WPCS `WordPress.WhiteSpace.PrecisionAlignment` rule throws warnings for a bunch of code that will likely cause issues for `wpcbf`. Fixing these manually beforehand gives us better auto-fixed results later.

See #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42228 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-26 23:56:25 +00:00
Dominik Schilling (ocean90) 5f06aaca1c I18N: Allow numbers in locales during installation.
The current regex was a bit to strict for locales like `pt_PT_ao90` which were already supported by `wp_get_installed_translations()`.

Fixes #41794.

git-svn-id: https://develop.svn.wordpress.org/trunk@41335 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-04 19:29:50 +00:00
John Blackbourn 8df2151660 General: Improve terminology used when referring to installations of WordPress and its extensions.
"Install" is not a noun, and while it might be acceptable to use the verb as a noun, it is not correct. Using the correct
noun, "installation", increases clarity, especially for non-native English speakers.

This change fixes the usage in user-facing text and in developer documentation.

Fixes #41620


git-svn-id: https://develop.svn.wordpress.org/trunk@41289 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 11:51:11 +00:00
Sergey Biryukov 90aca8c4d7 Docs: Add a `@global` entry for `$wpdb` in `display_setup_form()`.
Props mitraval192.
Fixes #41300.

git-svn-id: https://develop.svn.wordpress.org/trunk@41030 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-12 21:02:35 +00:00
John Blackbourn eda002a9d5 Login and Registration: Avoid a potentially incorrect value for the cookie hash on multisite installations that don't have a value in the `siteurl` network option.
This reverts [38619].

See #34084

Fixes #39497


git-svn-id: https://develop.svn.wordpress.org/trunk@40320 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-23 19:00:31 +00:00
John Blackbourn f6f0e6098d I18n: Begin introducing translator comments for strings which include placeholders but no accompanying translator comment.
Adds context to one string used in two different contexts for the new user and new site signup email notification.

More to come.

See #38882


git-svn-id: https://develop.svn.wordpress.org/trunk@39323 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 01:21:01 +00:00
Andrea Fercia ee7f970ffa Administration: Improve the usage of the button CSS classes.
Introduces some consistency in the usage of the button CSS classes, fixes the
focus style for accessibility and responsiveness of the buttons.

- Adds the `button` class to all primary buttons make them responsive
- Removes all `secondary-button` classes and replaces it with button when needed. `button-secondary` shouldn't be used and exists just for backward compatibility reasons
- Replaces classes inside `submit_button()` with a shorthand for some buttons, and use an empty string for the default `button` class. Passing `button` is unnecessary
- Adjusts `get_submit_button()` to remove empty items

Props iseulde, dimchik, chris_d2d, mhowell, afercia.
Fixes #27314, #37138, #37448.


git-svn-id: https://develop.svn.wordpress.org/trunk@38672 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-28 19:53:07 +00:00
John Blackbourn bc0a601889 Upgrade/Install: Automatically log users in after installation.
This change means that after entering their site's settings upon installation, users are immediately logged in and redirected to the admin dashboard, instead of being presented with the 'Success!' screen and then being asked to log in. This reduces friction and reduces the number of steps for installation.

Fixes #34084


git-svn-id: https://develop.svn.wordpress.org/trunk@38619 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-18 11:41:53 +00:00
Scott Taylor cba0e2c8f7 Bootstrap: do not go gentle into that good night r38411, r38412, and parts of r38389.
See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38470 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-31 16:30:48 +00:00
Scott Taylor 4225e71a6b Bootstrap: after r38409 and r38410, revert r38402 which reverted r38399.
This fixes the paths in `wp-vendor/` that were including `src`. I want to drop this in so we can find out what else will break.

See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38411 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-27 22:31:11 +00:00
Dion Hulse e353179ce5 Bootstrap: Revert [38399] as it's broken `/build/` and subsequently core.svn.wordpress.org.
The generated classmaps reference `/src/` files and operates in the assumption that the base directory is one level above `wp-settings.php`, which it isn't after our build processes are run.

See #36335


git-svn-id: https://develop.svn.wordpress.org/trunk@38402 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-27 14:36:42 +00:00
Scott Taylor 388690382c Bootstrap: Autoload classes using a Composer-generated PHP 5.2-compatible Autoloader.
* `wp-admin` and `wp-includes` are scanned for classes to autoload
* Several 3rd-party and Ryan McCue-shaped libraries are excluded when the classmap is generated, see `composer.json`: `autoload.exclude-from-classmap`
* `wp-vendor/autoload_52.php` is included at the top of `wp-settings.php` - no changes need to be made to unit tests to include the autoloader
* An avalanche of `require()` and `require_once()` calls that loaded class files have been removed from the codebase.

The following files have been added to `svn:ignore` - they are not 5.2-compatible and fail during pre-commit:
* src/wp-vendor/autoload.php
* src/wp-vendor/composer/autoload_real.php
* src/wp-vendor/composer/autoload_static.php
* src/wp-vendor/composer/ClassLoader.php

We favor these files instead:
* src/wp-vendor/autoload_52.php
* src/wp-vendor/composer/autoload_real_52.php
* src/wp-vendor/composer/ClassLoader52.php

When new PHP classes are added to the codebase, simply run `composer install` or `composer update` from the project root to update the autoloader.

The future is now.

See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38399 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-27 09:15:01 +00:00
Sergey Biryukov 33076b29d6 I18N: Remove `<code>` tags from translatable strings in `wp-admin/install.php`.
Props ramiy.
Fixes #35738.

git-svn-id: https://develop.svn.wordpress.org/trunk@36665 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-24 01:21:05 +00:00
Dominik Schilling (ocean90) d35f13a4e3 Install: Enhance the language of the "Success" message.
Props ckoerner.
Fixes #34897.

git-svn-id: https://develop.svn.wordpress.org/trunk@36553 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-17 18:57:09 +00:00
Dominik Schilling (ocean90) e306e801a9 Install: Only enqueue scripts when necessary.
Props flixos90 for initial patch.
Fixes #34700.

git-svn-id: https://develop.svn.wordpress.org/trunk@36176 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-05 16:41:43 +00:00
Dominik Schilling (ocean90) a6e6501fc8 Install/Upgrade: Keep indexing bots away until a site is ready to be seen.
git-svn-id: https://develop.svn.wordpress.org/trunk@35837 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-08 21:55:48 +00:00
Aaron Jorbin 395bc6e8d8 Adjust heading structure for pages using wp-admin/css/install.css
The readme, installation, upgrade, and repair pages use a common css file. The heading structure for these pages was inconstant with h2s where there should be h1s, h1s where there is no relevant info and sometimes, no h1s at all.

Fixes #34519
Props rianrietveld



git-svn-id: https://develop.svn.wordpress.org/trunk@35508 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-04 17:59:35 +00:00
Dominik Schilling (ocean90) b2bb4ea2d5 Install: Replace the "Privacy" setting with the "Search Engine Visibility" setting from Reading Settings.
Props Clorith, ocean90.
Fixes #27628.
See #16416.

git-svn-id: https://develop.svn.wordpress.org/trunk@34752 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 21:34:38 +00:00
John Blackbourn dc7d968b19 Implement some more uses of `wp_login_url()` in places where wp-login.php is hard-coded.
See #31495


git-svn-id: https://develop.svn.wordpress.org/trunk@34358 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-20 16:53:32 +00:00
Helen Hou-Sandi 0c19c94561 Drop the hyphen from e-mail and standardize on email.
The AP Stylebook changed this in 2011, and we're woefully inconsistent, so let's go with the standard.

props morganestes, voldemortensen, niallkennedy (for patching on the previous AP style).
fixes #26156.


git-svn-id: https://develop.svn.wordpress.org/trunk@33774 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-28 03:16:02 +00:00
Mark Jaquith 37aa0574c4 Persist (and mask) the password on the install screen if the install does not proceed due to errors.
If you forget or enter an invalid username/e-mail, the password choosing shouldn't start over.

fixes #33162

git-svn-id: https://develop.svn.wordpress.org/trunk@33495 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-29 19:21:26 +00:00
Mark Jaquith fff891b1d9 Autogenerate passwords that more reliably fit within their inputs.
fixes #33166

git-svn-id: https://develop.svn.wordpress.org/trunk@33474 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-29 03:55:56 +00:00
Mark Jaquith 220ea93449 Omit the "(required)" text for password on the install screen.
fixes #33163

git-svn-id: https://develop.svn.wordpress.org/trunk@33471 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-29 01:19:45 +00:00
Sergey Biryukov faecac7803 Move the translator note added in [33437] directly before the string it applies to.
fixes #33091.

git-svn-id: https://develop.svn.wordpress.org/trunk@33441 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-27 12:42:14 +00:00
Mark Jaquith 80c9c8cfca Toggle between dashicons-hidden and dashicons-visibility in the password hide/show button.
fixes #33135

git-svn-id: https://develop.svn.wordpress.org/trunk@33438 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-27 03:12:55 +00:00
Mark Jaquith 3ad35be856 Add a translator note for the fix in r33387
props SergeyBiryukov
fixes 33091

git-svn-id: https://develop.svn.wordpress.org/trunk@33437 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-27 01:53:04 +00:00
Sergey Biryukov 7214dc6fb4 Remove unused `pw-weak` ID attributes.
see #33077.

git-svn-id: https://develop.svn.wordpress.org/trunk@33419 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-26 00:57:21 +00:00
Mark Jaquith e42e418450 Prevent 1Password from thinking the text "log in" should trigger a password save prompt
fixes #33091

git-svn-id: https://develop.svn.wordpress.org/trunk@33387 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-23 05:04:55 +00:00
Mark Jaquith fece657158 Fix up and normalize pw_weak/pw-weak IDs and labels.
props johnjamesjacoby
fixes #33077

git-svn-id: https://develop.svn.wordpress.org/trunk@33363 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-22 17:23:27 +00:00
Mark Jaquith d1a1e77e40 Make password field toggling work in IE8, and clean up a bunch of password CSS issues.
fixes #32886
props peterwilsoncc, adamsilverstein

git-svn-id: https://develop.svn.wordpress.org/trunk@33362 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-22 16:55:17 +00:00
Konstantin Obenland 2ab769b1b9 Passwords: Add password strength meter feedback for screen readers.
Also gives context to the show/hide button.

Props rianrietveld, afercia.
Fixes #33032.



git-svn-id: https://develop.svn.wordpress.org/trunk@33353 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-22 00:14:37 +00:00
Konstantin Obenland a48af6ef86 Passwords: Make show/hide toggle translatable.
See #32589.


git-svn-id: https://develop.svn.wordpress.org/trunk@33249 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-13 22:34:18 +00:00
Konstantin Obenland 05c4803450 Passwords: New UI for install screen.
Also synchronises the use of `pw_weak` as an input name and removes trailing
periods from checkbox labels.

Props MikeHansenMe, adamsilverstein, obenland.
See #32589.



git-svn-id: https://develop.svn.wordpress.org/trunk@33246 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-13 22:21:39 +00:00
Aaron Jorbin b095afe2db Remove Truthy check from DO_NOT_UPGRADE_GLOBAL_TABLES
Some, but not all, of the checks for DO_NOT_UPGRADE_GLOBAL_TABLES just check if it is defined, so checking for truthiness could cause the issue to not be fully fixed.

In the words of Colonel Jessep: You can't handle the truth!

Introduced in [32714]

Fixes #32011



git-svn-id: https://develop.svn.wordpress.org/trunk@32715 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-09 21:59:51 +00:00
Aaron Jorbin 09340de73e Add error if a user attempts to install WordPress with DO_NOT_UPGRADE_GLOBAL_TABLES defined
The install process runs through migrations to global tables, therefore we cannot install WordPress with this constant defined. This error message prevents a false success screen from being seen.

Fixes #32011.
Props Oxymoron.



git-svn-id: https://develop.svn.wordpress.org/trunk@32714 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-09 17:58:18 +00:00
Scott Taylor ec5758225c Add missing doc blocks to `wp-admin/includes/*`.
Fix some egregious uses of tabbing.
Some functions can simply return `apply_filters(...)` instead of setting a variable that is immediately returned.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32654 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 20:16:22 +00:00