Commit Graph

21 Commits

Author SHA1 Message Date
Jonathan Desrosiers f40f5885e5 General: Remove or add inline comments to `$HTTP_RAW_POST_DATA` occurrences.
The `$HTTP_RAW_POST_DATA` global was deprecated in PHP 5.6 and removed completely in PHP 7.0. In general, `php://input` should be used instead of `$HTTP_RAW_POST_DATA`.

Because WordPress Core still supports PHP 5.6, some plugins or sites may still rely on this variable being present and populated with the expected data. For that reason, occurrences of the variable will remain with updated inline documentation until support for PHP 5.6 is officially dropped in WordPress.

Props skoskie, jrf, desrosj, TimothyBlynJacobs.
See #49922.
Fixes #49810.

git-svn-id: https://develop.svn.wordpress.org/trunk@47926 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-08 19:53:19 +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
Gary Pendergast ef5a9dfda6 Coding Standards: Fix/ignore the `WordPress.NamingConventions.ValidFunctionName` violations.
See #47632



git-svn-id: https://develop.svn.wordpress.org/trunk@45580 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 08:00:12 +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 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
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
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 920f29616a Docs: Use 3-digit, x.x.x-style semantic versioning for `_doing_it_wrong()`, `_deprecated_function()`, `_deprecated_argument()`, and `_deprecated_file()` throughout core.
Props metodiew.
Fixes #36495.

git-svn-id: https://develop.svn.wordpress.org/trunk@37985 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-06 12:39:01 +00:00
Drew Jaynes a1ee08a6db Docs: Standardize filter docs in root folder files to use third-person singular verbs per the inline documentation standards for PHP.
Fixes #36913.


git-svn-id: https://develop.svn.wordpress.org/trunk@37535 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-23 16:43:20 +00:00
John Blackbourn 3fee278cf4 Switch the remaining user-facing links to wordpress.org over to HTTPS.
Fixes #27115


git-svn-id: https://develop.svn.wordpress.org/trunk@34783 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 22:45:53 +00:00
Drew Jaynes f35fde4e35 Docs: Standardize `@deprecated` tag formatting in the DocBlock for the `logIO()` function.
Props Alphawolf.
Fixes #28806.


git-svn-id: https://develop.svn.wordpress.org/trunk@33680 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-20 22:43:02 +00:00
Gary Pendergast 74c061a480 XML-RPC: Don't rely on `include_path` to include files, use `dirname()` instead.
See #17092.



git-svn-id: https://develop.svn.wordpress.org/trunk@33459 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-28 12:16:44 +00:00
Drew Jaynes 6229ba0bb3 Fixes for hooks documentation on xmlrpc.php.
Adds spacing, changes an `@see` to `@link`, adds a docs-specific variable for a parameter.

See #26869, #25229 and [25281].


git-svn-id: https://develop.svn.wordpress.org/trunk@27146 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-09 20:38:39 +00:00
Ryan Boren 30f822b8ee Pinking shears
git-svn-id: https://develop.svn.wordpress.org/trunk@25880 602fd350-edb4-49c9-b593-d223f7449a82
2013-10-23 14:37:54 +00:00
Andrew Nacin 6045b39f5a Inline documentation for hooks in xmlrpc.php.
The old link for RSD is dead; update to the new one.

props bftrick.
see #25229.


git-svn-id: https://develop.svn.wordpress.org/trunk@25281 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-06 16:55:41 +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