Commit Graph

41 Commits

Author SHA1 Message Date
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 cde71eed52 Docs: In various `@return` tags, list the expected type first, instead of `WP_Error`.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@46696 602fd350-edb4-49c9-b593-d223f7449a82
2019-11-11 02:41:15 +00:00
John Blackbourn a2e08032dc Docs: Miscellaneous docblock fixes and improvements.
See #48303


git-svn-id: https://develop.svn.wordpress.org/trunk@46594 602fd350-edb4-49c9-b593-d223f7449a82
2019-10-26 20:42:00 +00:00
Andrew Ozz 152083be8f Docs: Improve and update the description of `multi_resize()` to explain changes and expected use.
See #40439.

git-svn-id: https://develop.svn.wordpress.org/trunk@45892 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-25 22:20:57 +00:00
Gary Pendergast d36eda33f7 Coding Standards: Fix instances of `WordPress.PHP.NoSilencedErrors.Discouraged`.
Noteable changes:
- The `magic_quotes_runtime` and `magic_quotes_sybase` settings were removed in PHP 5.4, so no longer need to be set.
- Some functions that use external libraries can generate errors that can't be tested for, so are globally allowed to silence errors.
- Quite a few functions would cause errors if `safe_mode` was set. This setting was removed in PHP 5.4.
- Only a handful of `header()` calls needed corresponding `headers_sent()` checks for unit tests to pass, but more may need to be added as the nightlies builds are tested.

See #46732.


git-svn-id: https://develop.svn.wordpress.org/trunk@45611 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-09 05:44:42 +00:00
Andrew Ozz ca84ae5030 Save progress of intermediate image creation after upload. First run.
- Introduces `wp_get_missing_image_subsizes()` and `wp_update_image_subsizes()` to generate image sub-sizes that are missing or were not created after the upload.
- Adds a way to display errors that happened while creating sub-sizes.
- Introduces `wp_create_image_subsizes()` intended for use after an image was uploaded. It saves/updates the image metadata immediately after each sub-size is created. This fixes the (long standing) problem when some of the sub-size image files were created but there was a timeout or an error and the metadata was not saved. Until now such uploads were considered "failed" which usually resulted in the user trying to upload the same image again, creating even more "orphan" image files.

Note that the patch also includes some unrelated WPCS fixes.

Props mikeschroder, azaozz.
See #40439.

git-svn-id: https://develop.svn.wordpress.org/trunk@45538 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-15 01:01:48 +00:00
Jonathan Desrosiers 2e8b87cd83 Docs: Add missing periods to `param` annotations for `flip()` in `WP_Image_Editor_GD`.
Props hitendra-chopda.
Fixes #45208.

git-svn-id: https://develop.svn.wordpress.org/trunk@44550 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 22:09:26 +00:00
Sergey Biryukov c6c4edb47a Docs: Remove `@static` notations from method DocBlocks in `wp-includes/*` classes.
This tag has been used in the past, but should no longer be used. Just using the `static` keyword in code is enough for PhpDocumentor on PHP5+ to recognize static variables and methods, and PhpDocumentor will mark them as static.

Props birgire.
See #42803.

git-svn-id: https://develop.svn.wordpress.org/trunk@42746 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-25 20:21:37 +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
John Blackbourn 0613540ea2 Media: Rename several attachment related parameters from `$post_id` to `$attachment_id` for clarity, and improve related
documentation.

See #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41288 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 11:11:23 +00:00
Drew Jaynes b4d81bd654 Docs: Remove `@access` notations from method DocBlocks in wp-includes/* classes.
Prior to about 2013, many class methods lacked even access modifiers which made the `@access` notations that much more useful. Now that we've gotten to a point where the codebase is more mature from a maintenance perspective and we can finally remove these notations. Notable exceptions to this change include standalone functions notated as private as well as some classes still considered to represent "private" APIs.

See #41452.


git-svn-id: https://develop.svn.wordpress.org/trunk@41162 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-27 00:40:27 +00:00
Sergey Biryukov a661557bce Docs: Correct `@access` entry for `::load()` in `WP_Image_Editor`, `WP_Image_Editor_GD`, and `WP_Image_Editor_Imagick`.
Props upadalavipul.
Fixes #41423.

git-svn-id: https://develop.svn.wordpress.org/trunk@41125 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-24 14:10:45 +00:00
Drew Jaynes de87b6d828 Docs: Remove superfluous `@package WordPress` and `@subpackage` notations used outside of file headers in a variety of core files.
Per the inline documentation standards for PHP, there should only be one `@package` and/or `@subpackage` notation per file, and only in the file header.

See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@40988 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 16:57:13 +00:00
Dominik Schilling c68f1ec772 Bootstrap: Enhance core's memory limit handling.
* Don't lower memory limit if the current limit is greater than `WP_MAX_MEMORY_LIMIT`.
* Set `WP_MEMORY_LIMIT` and `WP_MAX_MEMORY_LIMIT` to current limit if the `memory_limit` setting can't be changed at runtime.
* Use `wp_convert_hr_to_bytes()` when parsing the value of the `memory_limit` setting because it can be a shorthand or an integer value.
* Introduce `wp_raise_memory_limit( $context )` to raise the PHP memory limit for memory intensive processes. This DRYs up some logic and includes the existing `admin_memory_limit` and `image_memory_limit` filters. The function can also be used for custom contexts, the `{$context}_memory_limit` filter allows to customize the limit.
* Introduce `wp_is_ini_value_changeable( $setting )` to determine whether a PHP ini value is changeable at runtime.
* Remove a `function_exists( 'memory_get_usage' )` check. Since PHP 5.2.1 support for memory limit is always enabled.

Related commits: [38011-38013]

Props jrf, A5hleyRich, swissspidy, ocean90.
Fixes #32075.

git-svn-id: https://develop.svn.wordpress.org/trunk@38015 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-08 14:36:37 +00:00
Drew Jaynes 8e79f0fb3d Docs: Ensure hook and duplicate hook docs directly precede all instances of the `image_memory_limit` filter.
Hook docs must directly precede hooks in order for the Code Reference parser to correctly identify them as such.

Fixes #36968. 


git-svn-id: https://develop.svn.wordpress.org/trunk@37592 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-30 02:13:57 +00:00
Drew Jaynes c49afe285c Docs: Standardize filter docs in core classes in wp-includes/* to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.


git-svn-id: https://develop.svn.wordpress.org/trunk@37492 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-22 18:14:19 +00:00
Scott Taylor bd7bf83886 Media: add a new image size, `medium_large`. Bumps db version to add new options.
Adds unit tests.

Props DH-Shredder, joemcgill, azaozz.
Fixes #34196.


git-svn-id: https://develop.svn.wordpress.org/trunk@35479 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-31 20:49:26 +00:00
Drew Jaynes 6cfda71af7 Docs: Re-clarify the `$sizes[ $size ]` section of the hash notations for `WP_Image_Editor_GD::multi_resize()` and `WP_Image_Editor_Imagick::multi_resize()` as not fully-optional.
The `$width` value is optional if `$height` is specified, and vice versa. The `$crop` value is always optional and defaults to false.

Props dh-shredder.
See #32246. See [35061] and [35062].


git-svn-id: https://develop.svn.wordpress.org/trunk@35063 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-12 16:33:30 +00:00
Drew Jaynes 9575f53d50 Docs: Fix hash notation syntax for the `$sizes[ $size ]` section in the DocBlock for `WP_Image_Editor_GD::multi_resize()`.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@35061 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-12 16:25:24 +00:00
Sergey Biryukov 07ee7f1ef7 Replace `@returns` with `@return` in PHP docblocks.
props kraftbj.
fixes #32865.

git-svn-id: https://develop.svn.wordpress.org/trunk@33052 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-02 21:04:57 +00:00
Scott Taylor f162be6046 For doc block types, favor `bool` over the few remaining `boolean`s
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32964 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-27 01:02:12 +00:00
Scott Taylor c8a44d437a Add `@static*` annotations where they are missing.
Initialize all static vars that are not, most to `null`.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32650 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 15:42:40 +00:00
Drew Jaynes 3bf89080cf Add a proper description comment for the `WP_Image_Editor_GD->$image` property.
See [30180]. See #30224.


git-svn-id: https://develop.svn.wordpress.org/trunk@32554 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-23 19:09:58 +00:00
Scott Taylor f67ecbdadc Add missing doc blocks to `wp-image-editor*.php`.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32546 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-22 06:17:16 +00:00
Scott Taylor fed3b8fd1f In the `->multi_resize()` method of the `WP_Image_Editor` subclasses, when looping through potential crops, we need to make sure the crop isn't the exact same dimensions as the original image before copying it as a new crop.
This ensures that we don't save multiple copies of the same image.

Supposedly broke in [30639], but this logic was always missing. When I tested reverting [30639], there were still 2 files being created.

Fixes #31296.


git-svn-id: https://develop.svn.wordpress.org/trunk@31576 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-27 19:37:47 +00:00
Scott Taylor 3d3e1fb72a Preserve alpha transparency when rotating a PNG while GD is the active image editor.
Adds unit tests.

Props frankpw, voldemortensen.
Fixes #30596.


git-svn-id: https://develop.svn.wordpress.org/trunk@31040 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-03 22:01:54 +00:00
Scott Taylor 4d46475b3d Improve various `@param` docs for `src/wp-includes/*`.
See #30224.


git-svn-id: https://develop.svn.wordpress.org/trunk@30681 602fd350-edb4-49c9-b593-d223f7449a82
2014-12-01 01:33:34 +00:00
Scott Taylor 345a63f498 `WP_Image_Editor_GD` and `WP_Image_Editor_Imagick` should specify type in a doc block for the `$image` property, instead of inferring `bool` and `null`.
See #30224.


git-svn-id: https://develop.svn.wordpress.org/trunk@30180 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-03 02:37:55 +00:00
Sergey Biryukov 1a7c4efa13 Fix setting default quality in WP_Image_Editor.
props markoheijnen.
fixes #29856 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@29834 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-04 13:11:38 +00:00
Scott Taylor 4465f7922a Revert [28640] as per @DH-Shredder.
See #24380.


git-svn-id: https://develop.svn.wordpress.org/trunk@29345 602fd350-edb4-49c9-b593-d223f7449a82
2014-08-01 18:42:46 +00:00
Scott Taylor c2b7f8022c Add `->get_quality()` method to `WP_Image_Editor` class.
Adds unit tests.

Props markoheijnen.
Fixes #28154.


git-svn-id: https://develop.svn.wordpress.org/trunk@28879 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-28 03:49:55 +00:00
wonderboymusic 2d0be44d85 In `WP_Image_Editor_GD::_save()`, pass `$compression_level` into the args array for `->make_image()`.
Props MuViMoTV, markoheijnen, SergeyBiryukov, mikemanger, ericlewis.
Fixes #24380.



git-svn-id: https://develop.svn.wordpress.org/trunk@28640 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-30 20:05:02 +00:00
Scott Taylor f297dcba9a Add missing access modifiers to methods/members in `WP_Image_Editor_*` classes.
See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28513 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 05:52:24 +00:00
Scott Taylor 7b7e5305c7 In `multi_resize()` image editor methods, assert that `null` can only be passed for one of the arguments, not both. Add a lot more unit test assertions to ensure this.
Props pbearne, DH-Shredder.
Fixes #26823.



git-svn-id: https://develop.svn.wordpress.org/trunk@27794 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-27 20:39:08 +00:00
Ryan Boren cfd5c395bb The Pinking Shears stir from their slumber, awakened by what may seem, to those
innocent in the ways of The Shears, a triviality, a nothing-of-consequence. But there are consequences indeed for recklessly trailing your whitespace. Naturally, they a dire!

One, two! One, two! And through and through
The Pinking Shears went snicker-snack!
They plucked your tail and with your space
They went sniksnuking back.

Let me tell you, that can be uncomfortable, so always pre-sniksnuk your trailing whites. May The Shears be with you.


git-svn-id: https://develop.svn.wordpress.org/trunk@26851 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-11 19:48:29 +00:00
Drew Jaynes fa376b16cd Two more hook docs fixes.
`image_memory_limit` filter:
* Go with int|string on the limit, and simply notate '256M' as an acceptable string value.

`wp_editor_set_quality` filter:
* Add a missing parameter description for the mime type.

See #25721.


git-svn-id: https://develop.svn.wordpress.org/trunk@26650 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-04 23:50:33 +00:00
Drew Jaynes ba4187de33 Hook docs fixes following [26645].
See #25721.


git-svn-id: https://develop.svn.wordpress.org/trunk@26648 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-04 23:31:21 +00:00
Andrew Nacin 8a3c33c861 Improvements to image quality handling in the image editor classes.
props markoheijnen, DH-Shredder.
fixes #25721.


git-svn-id: https://develop.svn.wordpress.org/trunk@26645 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-04 22:48:45 +00:00
Drew Jaynes e7ee404ec9 Improve inline documentation for the `multi_resize()` method in `WP_Image_Editor`, `WP_Image_Editor_GD`, and `WP_Image_Editor_Imagick`.
Props paolal for the initial patch.
Fixes #25530.


git-svn-id: https://develop.svn.wordpress.org/trunk@25728 602fd350-edb4-49c9-b593-d223f7449a82
2013-10-08 17:19:00 +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