Commit Graph

33 Commits

Author SHA1 Message Date
Sergey Biryukov 0b4e2c4604 Coding Standards: Use strict type check for `in_array()` and `array_search()` where strings are involved.
This reduces the number of `WordPress.PHP.StrictInArray.MissingTrueStrict` issues from 486 to 50.

Includes minor code layout fixes for better readability.

See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47550 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-05 03:00:44 +00:00
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 f243dc38c0 Coding Standards: Use strict comparison and Yoda conditions in the root directory files.
Props pikamander2.
Fixes #48965.

git-svn-id: https://develop.svn.wordpress.org/trunk@47054 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-09 00:53:29 +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
Gary Pendergast 992184cf73 Coding Standards: Upgrade WPCS to 1.2.1.
This upgrade fixes quite a few false positives, as well as auto-fixing some indenting issues.

Fixes #45956.



git-svn-id: https://develop.svn.wordpress.org/trunk@44574 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-12 06:40:16 +00:00
peterwilsoncc cac7b92f77 Multisite: Validate activation links.
git-svn-id: https://develop.svn.wordpress.org/trunk@44048 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 01:25:03 +00:00
Peter Wilson b5bfe2bd82 Multisite: Improve messaging for previously activated users.
Ensure activation of a site is not attempted multiple times and users are shown the correct message if they follow the link a second time.


git-svn-id: https://develop.svn.wordpress.org/trunk@44021 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-13 00:22:03 +00:00
Gary Pendergast cb3d1777b1 Coding Standards: Prepare for upgrading WPCS to 1.0.0.
In order to get the best result when running `phpcbf` across the codebase, there are some manual tweaks we need to make.

These fall into three categories:
- Fixing incorrectly indented code which has flow-on effects when auto-fixing.
- Tweaking the layout of inline PHP inside HTML tags.
- Moving more complex inline PHP inside HTML tags, to execute earlier.

See #44600.



git-svn-id: https://develop.svn.wordpress.org/trunk@43569 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-15 06:22:00 +00:00
Sergey Biryukov a7cdcb9725 Login and Registration: Send `nocache_headers()` on Multisite account activation pages.
Props herregroen.
Fixes #43917.

git-svn-id: https://develop.svn.wordpress.org/trunk@43065 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-01 22:07:21 +00:00
Andrea Fercia 2e08b275a6 Coding standards: Change a few occurrences of font weight 700 to 600 in multisite signup and activate.
Props chetan200891.
Amends [43018].
See #43897.


git-svn-id: https://develop.svn.wordpress.org/trunk@43041 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 07:04:12 +00:00
Dominik Schilling (ocean90) 4b89863ddd Multisite: Use a numbered placeholder in `sprintf()` for the site URL.
Fixes missing site domain in the link and a PHP warning.

Props Thomas Vitale, conner_bw.
See #41645.
Fixes #43568.

git-svn-id: https://develop.svn.wordpress.org/trunk@42844 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-18 14:44:47 +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
Sergey Biryukov 4994c77b28 I18N: Remove HTML tags from translatable strings in `wp-activate.php`.
Props ramiy.
Fixes #41645.

git-svn-id: https://develop.svn.wordpress.org/trunk@41579 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-23 12:20:39 +00:00
Drew Jaynes bce1b14c9a Docs: Reduce confusion in `@since MU` notationss by indicating the WP version (3.0.0) the code was merged into core while retaining the original context.
Props sathyapulse.
Fixes #41509.


git-svn-id: https://develop.svn.wordpress.org/trunk@41200 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-01 20:43:25 +00:00
Jeremy Felt b97b0b4203 Multisite: Use `get_home_url()` instead of `get_blogaddress_by_id()` in `wp-activate.php`.
`get_home_url()` is a better fit for the "View your site" link and can be properly filtered. This is the last remaining use of `get_blogaddress_by_id()` in core.

Props boboudreau, spacedmonkey.
Fixes #26855.


git-svn-id: https://develop.svn.wordpress.org/trunk@38664 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-27 21:35:25 +00:00
Dominik Schilling (ocean90) 0a76772117 I18N: Add translators comments to wp-activate.php.
Props ramiy.
Fixes #35734.

git-svn-id: https://develop.svn.wordpress.org/trunk@37552 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-24 21:01:47 +00:00
Drew Jaynes 3ae9bf6690 Docs: Apply inline `@see` tags to hooks referenced in DocBlocks for root directory files.
Applying these specially-crafted `@see` tags allows the Code Reference parser to recognize and link these elements as hooks.

See #36921.


git-svn-id: https://develop.svn.wordpress.org/trunk@37536 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-23 17:06:40 +00:00
ericlewis 3fde994152 Networks and sites: Replace "blog" usage with "site" in docs.
Multisite functions use the term "blog" to refer to what we now call a "site," e.g. `get_current_blog_id()`. These functions are here to stay because of our commitment to backwards compatibility. What we can do is set the documentation straight.

See #35417.


git-svn-id: https://develop.svn.wordpress.org/trunk@36416 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-28 03:34:02 +00:00
Jeremy Felt 4bec1448f3 Registration: Remove the last remaining `Lucida Grande` from WordPress.
Defer to default styling provided by the theme (and browser) in `wp-activate.php` and remove the `font-family` and `color` from the provided internal stylesheet.

Previously, [17327] and [18406].

Fixes #34145.


git-svn-id: https://develop.svn.wordpress.org/trunk@34882 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-06 21:55:39 +00:00
Jeremy Felt 87232d4f61 MS: Pass context to `get_header()` and `get_footer()` in activation/signup.
Fixes #21712.


git-svn-id: https://develop.svn.wordpress.org/trunk@34840 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-05 22:35:20 +00:00
Jeremy Felt f7647bac89 MS: Align HTML structure in `wp-signup.php` and `wp-activate.php`.
Assigns the `wp-activate-container` and `wp-signup-container` to the container inside `#signup-container` on each. This container already existed in `wp-signup.php` and is new in `wp-activate.php`.

Props ocean90.
Fixes #25478.


git-svn-id: https://develop.svn.wordpress.org/trunk@34814 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 21:50:24 +00:00
John Blackbourn 2212c0f858 Use `wp_login_url()` for login links when signing up for a new blog or activating a new blog on Multisite.
Fixes #31495
Props GregLone for the intial patch


git-svn-id: https://develop.svn.wordpress.org/trunk@34790 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 00:33:47 +00:00
John Blackbourn 1a352d56f9 Implement `wp_login_url()` and `wp_registration_url()` in places where `wp-login.php` is currently hard-coded.
See #31495
Props GregLone


git-svn-id: https://develop.svn.wordpress.org/trunk@34213 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-15 17:10:24 +00:00
Scott Taylor 337451b099 TwentyFifteen|Sixteen themes have a `<div id="content">` in the header. Change the `<div>` IDs in `wp-activate.php` and `wp-signup.php` to be unique to each page.
Props jfarthing84.
Fixes #33843.


git-svn-id: https://develop.svn.wordpress.org/trunk@34162 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-15 02:08:07 +00:00
Scott Taylor 21a7e91fbd `wpmu_activate_signup()` returns an `array` or `WP_Error`. The array keys it returns can be different based on context of `$signup`. The return value was previously `extract()`'d, so the value of `$blog_id` was secretly undefined when being passed to `get_blogaddress_by_id()` in some cases.
If `$result['blog_id']` is not set, make sure `$url` is set to an empty string so that the proper "activated" message is shown to the user.

Props imath.
See [28373].
Fixes #29191.


git-svn-id: https://develop.svn.wordpress.org/trunk@29554 602fd350-edb4-49c9-b593-d223f7449a82
2014-08-20 17:29:36 +00:00
Scott Taylor e43d2a73d8 Fix some `hackificator` odds and ends in `wp-admin`:
* `wp-activate.php` and `wp-admin/themes.php` don't need the closing PHP tag
* Switch single quotes for HTML attribute values to double in a few places
* Convert `include_once file.php` syntax to `include_once( 'file.php' )`
* Add access modifiers to methods/members in: `_WP_List_Table_Compat`, `Walker_Nav_Menu_Edit`, `Walker_Nav_Menu_Checklist`, `WP_Screen`, `Walker_Category_Checklist`
* `edit_user()` doesn't need to import the `$wpdb` global
* `wp_list_widgets()` doesn't need to import the `$sidebars_widgets` global
* switch/endswitch syntax is not supported in Hack
* A `<ul>` in `wp-admin/users.php` is unclosed

See #27881.


git-svn-id: https://develop.svn.wordpress.org/trunk@28500 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 05:03:44 +00:00
Scott Taylor b3ff5285f8 Eliminate use of `extract()` in `wp-activate.php`.
Props jeremyfelt, MikeHansenMe.
See #22400.


git-svn-id: https://develop.svn.wordpress.org/trunk@28373 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-13 03:13:21 +00:00
Drew Jaynes bd39e26032 First there were two, and now there are three -- in the @since versions that came before and that shall be. And so it will be, says nacin.
Props JustinSainton, SergeyBiryukov, DrewAPicture.
Fixes #26713.


git-svn-id: https://develop.svn.wordpress.org/trunk@26868 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-24 18:56:05 +00:00
Andrew Nacin cee5480513 Avoid 404 for wp-activate.php.
props nullvariable.
fixes #24960.


git-svn-id: https://develop.svn.wordpress.org/trunk@25690 602fd350-edb4-49c9-b593-d223f7449a82
2013-10-04 14:11:49 +00:00
Andrew Nacin 8d72ad52ff Don't rely on include_path to include files.
Always use dirname() or, once available, ABSPATH.

props ketwaroo, hakre.
fixes #17092.


git-svn-id: https://develop.svn.wordpress.org/trunk@25616 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-25 00:17:40 +00:00
Drew Jaynes 3ffcfbf26b Inline documentation for hooks in wp-activate.php.
Props nullvariable for the initial patch.
See #25229.


git-svn-id: https://develop.svn.wordpress.org/trunk@25537 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-21 05:20:42 +00:00
Andrew Nacin b43712e0f7 New develop.svn.wordpress.org repository based on the old core.svn repository.
* All WordPress files move to a src/ directory.
 * New task runner (Grunt), configured to copy a built WordPress to build/.
 * svn:ignore and .gitignore for Gruntfile.js, wp-config.php, and node.js.
 * Remove Akismet external from develop.svn. Still exists in core.svn.
 * Drop minified files from src/. The build process will now generate these.

props koop.
see #24976.

and see http://wp.me/p2AvED-1AI.



git-svn-id: https://develop.svn.wordpress.org/trunk@25001 602fd350-edb4-49c9-b593-d223f7449a82
2013-08-07 05:25:25 +00:00