Commit Graph

41 Commits

Author SHA1 Message Date
Sergey Biryukov be88348a16 Coding Standards: Use strict comparison in `wp-includes/class-wp-oembed.php`.
Follow-up to [13996].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55914


git-svn-id: http://core.svn.wordpress.org/trunk@55426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-14 10:35:18 +00:00
Pascal Birchler 3077d883cf Embeds: Add support for TikTok creator profiles.
Follow-up to initial support in [47216] / #49083.

Props mukesh27, anveshika, Ankit K Gupta.
Fixes #55784.
Built from https://develop.svn.wordpress.org/trunk@55897


git-svn-id: http://core.svn.wordpress.org/trunk@55409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-08 13:28:20 +00:00
Sergey Biryukov 046b9afcb7 Docs: Fix a few more typos in DocBlocks and inline comments.
Follow-up to [6779], [10565], [12023], [25224], [27533], [32806], [34777], [45262], [46594], [55823], [55824].

Props Presskopp.
See #57840.
Built from https://develop.svn.wordpress.org/trunk@55827


git-svn-id: http://core.svn.wordpress.org/trunk@55339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-19 13:27:20 +00:00
audrasjb 418a21fdbc Help/About: Use the new `/documentation/` URLs for HelpHub links in WordPress Admin.
As `https://wordpress.org/support/` was redirected to `https://wordpress.org/documentation/`, this changeset replaces various `/support/article/*` links with `/documentation/article/*` to avoid an extra redirect.

This also updates links to Support Forums by replacing `https://wordpress.org/support/` URLs with `https://wordpress.org/support/forums/`.

Props SergeyBiryukov, audrasjb, dhrupo, hasanmisbah, sakibmd, sabernhardt.
See #57726.

Built from https://develop.svn.wordpress.org/trunk@55412


git-svn-id: http://core.svn.wordpress.org/trunk@54945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-23 10:38:21 +00:00
Peter Wilson 485d9da6ff Embeds: Use documented mixcloud.com oembed endpoint.
Adds a trailing slash to the mixcloud.com oembed endpoint to match the documented version.

Follow up to [55068].

Props jeherve, matclayton.
Fixes #57376.


Built from https://develop.svn.wordpress.org/trunk@55243


git-svn-id: http://core.svn.wordpress.org/trunk@54776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 03:10:18 +00:00
Peter Wilson dcf1b4c873 Embeds: Update YouTube provider for live URLs.
YouTube Live stream URLs can take the form of `youtube.com/live/videocode`. This registers the URL format for the oembed provider.

Props slieschke, costdev.
Fixes #57632.


Built from https://develop.svn.wordpress.org/trunk@55242


git-svn-id: http://core.svn.wordpress.org/trunk@54775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 02:56:19 +00:00
audrasjb e8bd962c4e Embeds: Add oEmbed support for crowdsignal.net surveys.
Crowdsignal has a block-editor powered survey/project editor. Surveys created using this editor appear on `*.crowdsignal.net` when published. This changeset adds oEmbed support for these URLs to embed Crowdsignal surveys.

Props donncha, audrasjb, Mamaduka, ntsekouras.
Fixes #57543.

Built from https://develop.svn.wordpress.org/trunk@55182


git-svn-id: http://core.svn.wordpress.org/trunk@54715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-01 21:45:16 +00:00
audrasjb d5f95382f0 Embeds: Update Mixcloud oEmbed URL to the new domain.
Replaces `https://www.mixcloud.com/oembed` with `https://app.mixcloud.com/oembed`.
Mixcloud plan to redirect old URLs to the new endpoint.

Props matclayton, peterwilsoncc, audrasjb, ayeshrajans.
Fixes #57376.

Built from https://develop.svn.wordpress.org/trunk@55068


git-svn-id: http://core.svn.wordpress.org/trunk@54601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-14 10:49:12 +00:00
Sergey Biryukov 3ba44120d0 Coding Standards: Always use parentheses when instantiating an object.
Note: This will be enforced by WPCS 3.0.0.

Props jrf.
See #56791.
Built from https://develop.svn.wordpress.org/trunk@54891


git-svn-id: http://core.svn.wordpress.org/trunk@54443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-29 15:51:14 +00:00
Sergey Biryukov f0af926dd6 Coding Standards: Correct alignment in various files.
This fixes `Equals sign not aligned with surrounding statements` WPCS warnings, so that the output of `composer format` is clean.

Follow-up to [54445], [54476], [54494], [54522], [54652], [54687].

See #56791.
Built from https://develop.svn.wordpress.org/trunk@54754


git-svn-id: http://core.svn.wordpress.org/trunk@54306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-05 22:03:16 +00:00
Gary Pendergast 12d9878827 Embeds: Broaden the Tumblr oEmbed matcher to include all Tumblr URL structures.
Tumblr's oEmbed API correctly rejects invalid URLs, we can rely on that for the handful of cases that aren't embeddable URLs.

Props cbravobernal, bernhard-reiter.
Fixes #56733.


Built from https://develop.svn.wordpress.org/trunk@54652


git-svn-id: http://core.svn.wordpress.org/trunk@54204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-20 00:00:16 +00:00
Peter Wilson a04ba2a0b4 Embeds: Revert Google Data Studio as trusted provider.
Remove Google Data Studio's status as a trusted oEmbed provider pending upstream implementation of the oEmbed specification.

See #55771.


Built from https://develop.svn.wordpress.org/trunk@54465


git-svn-id: http://core.svn.wordpress.org/trunk@54024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-10 23:11:12 +00:00
Gary Pendergast 32a7a3b5cd Embeds: Add support for Tumblr Dashboard URLs.
WordPress has supported embedding Tumblr blog network posts since 4.2.0. This commit adds support for embedding posts using Tumblr Dashboard URLs.

Fixes #56733.


Built from https://develop.svn.wordpress.org/trunk@54393


git-svn-id: http://core.svn.wordpress.org/trunk@53952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-10-05 00:15:11 +00:00
Sergey Biryukov c03305852e Code Modernization: Add `AllowDynamicProperties` attribute to all (parent) classes.
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.

There are a number of ways to mitigate this:
* If it is an accidental typo for a declared property: fix the typo.
* For known properties: declare them on the class.
* For unknown properties: add the magic `__get()`, `__set()`, et al. methods to the class or let the class extend `stdClass` which has highly optimized versions of these magic methods built in.
* For unknown ''use'' of dynamic properties, the `#[AllowDynamicProperties]` attribute can be added to the class. The attribute will automatically be inherited by child classes.

Trac ticket #56034 is open to investigate and handle the third and fourth type of situations, however it has become clear this will need more time and will not be ready in time for WP 6.1.

To reduce “noise” in the meantime, both in the error logs of WP users moving onto PHP 8.2, in the test run logs of WP itself, in test runs of plugins and themes, as well as to prevent duplicate tickets from being opened for the same issue, this commit adds the `#[AllowDynamicProperties]` attribute to all “parent” classes in WP.

The logic used for this commit is as follows:
* If a class already has the attribute: no action needed.
* If a class does not `extend`: add the attribute.
* If a class does `extend`:
 - If it extends `stdClass`: no action needed (as `stdClass` supports dynamic properties).
 - If it extends a PHP native class: add the attribute.
 - If it extends a class from one of WP's external dependencies: add the attribute.
* In all other cases: no action — the attribute should not be needed as child classes inherit from the parent.

Whether or not a class contains magic methods has not been taken into account, as a review of the currently existing magic methods has shown that those are generally not sturdy enough and often even set dynamic properties (which they should not). See the [https://www.youtube.com/watch?v=vDZWepDQQVE live stream from August 16, 2022] for more details.

This commit only affects classes in the `src` directory of WordPress core.
* Tests should not get this attribute, but should be fixed to not use dynamic properties instead. Patches for this are already being committed under ticket #56033.
* While a number bundled themes (2014, 2019, 2020, 2021) contain classes, they are not a part of this commit and may be updated separately.

Reference: [https://wiki.php.net/rfc/deprecate_dynamic_properties PHP RFC: Deprecate dynamic properties].

Follow-up to [53922].

Props jrf, hellofromTonya, markjaquith, peterwilsoncc, costdev, knutsp, aristath.
See #56513, #56034.
Built from https://develop.svn.wordpress.org/trunk@54133


git-svn-id: http://core.svn.wordpress.org/trunk@53692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-12 15:47:14 +00:00
Helen Hou-Sandí 3ca1825716 Embeds: Add Google Data Studio as a trusted oEmbed provider
Props swissspidy
Fixes #55771

Built from https://develop.svn.wordpress.org/trunk@54129


git-svn-id: http://core.svn.wordpress.org/trunk@53688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-11 22:25:10 +00:00
Peter Wilson 02f3628e20 Embeds: Add Pocket Casts as a trusted oEmbed provider.
Props mattwondra, peterwilsoncc, pento, audrasjb.
Fixes #55860.


Built from https://develop.svn.wordpress.org/trunk@53744


git-svn-id: http://core.svn.wordpress.org/trunk@53303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-21 04:25:13 +00:00
Sergey Biryukov 8f37ef9daa Docs: Update the version in which Meetup.com was removed as an oEmbed source.
Meetup.com was previously removed as an oEmbed source, since they have deprecated their endpoint. The block has also been removed from the editor, see #GB35085.

This commit updates the associated changelog entry for the `oembed_providers` filter to version 6.0.1, as the change is being backported to the 6.0 branch.

Follow-up to [53540].

See #55997.
Built from https://develop.svn.wordpress.org/trunk@53646


git-svn-id: http://core.svn.wordpress.org/trunk@53205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-04 18:15:15 +00:00
audrasjb 78bc43e7f8 Embeds: Remove Meetup as an oEmbed source since the related endpoint has been deprecated.
This changeset removes Meetup as an oEmbed source, since Meetup.com have deprecated their oEmbed endpoint. The block has already been removed from the editor, see GB#35085.

Props peterwilsoncc, audrasjb, swissspidy.
Fixes #55997.

Built from https://develop.svn.wordpress.org/trunk@53540


git-svn-id: http://core.svn.wordpress.org/trunk@53129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-06-20 21:48:15 +00:00
Peter Wilson 67e97dc748 Embeds: Add YouTube shorts to the allow list.
YouTube shorts URLs have a different structure to other YouTube videos. This adds support for the structure for YouTube embeds.

Props danielbachhuber, johnbillion, mukesh27.
Fixes #55528.


Built from https://develop.svn.wordpress.org/trunk@53106


git-svn-id: http://core.svn.wordpress.org/trunk@52695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 06:31:02 +00:00
Gary Pendergast 44caec31bd Embeds: Add Wolfram Notebook as a trusted oEmbed provider.
Fixes #53326.


Built from https://develop.svn.wordpress.org/trunk@51909


git-svn-id: http://core.svn.wordpress.org/trunk@51502 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-15 05:04:56 +00:00
Gary Pendergast 8a5e9b79ed Embeds: Add Pinterest as a trusted oEmbed provider.
Props ayeshrajans, pento.

Fixes #53448.

Built from https://develop.svn.wordpress.org/trunk@51821


git-svn-id: http://core.svn.wordpress.org/trunk@51428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-17 03:13:56 +00:00
John Blackbourn dfe1f9b322 Docs: Promote many `bool` types to `true` or `false` where only that value is used.
See #51800

Built from https://develop.svn.wordpress.org/trunk@49927


git-svn-id: http://core.svn.wordpress.org/trunk@49626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-03 22:04:04 +00:00
Sergey Biryukov 1642f9bb1d Docs: Document the `$args` parameter of `wp_oembed_get()`.
Link to `wp_oembed_get()` as the canonical source when documenting additional arguments in various `WP_oEmbed` methods.

Follow-up to [49620].

See #51269.
Built from https://develop.svn.wordpress.org/trunk@49626


git-svn-id: http://core.svn.wordpress.org/trunk@49364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 10:11:11 +00:00
Helen Hou-Sandí 85b28a939f Embeds: Document $args in wp_oembed_get().
Props hellofromTonya, audrasjb, SergeyBiryukov.
Fixes #51269.

Built from https://develop.svn.wordpress.org/trunk@49620


git-svn-id: http://core.svn.wordpress.org/trunk@49358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-16 23:13:08 +00:00
whyisjake dbae445997 Embeds: Remove Facebook and Instagram as an oEmbed Source
Facebook has depracated all non-authenticated endpoints for Facebook and Instagram. 

See: https://developers.facebook.com/docs/plugins/oembed-legacy
See also: https://make.wordpress.org/core/2020/09/22/facebook-and-instagram-embeds-to-be-deprecated-october-24th/

With this change, endpoints are being removed. If a site is dependent on this feature, they need to pass either an app or client token. There are a few plugins that add this functionality.

Fixes #50861.
Props johnbillion, joyously, mkaz, dimadin, ayeshrajans, davisshaver, paaljoachim, Clorith, bridgetwillard, jb510, sippis, Clorith, TimothyBlynJacobs, desrosj, smub, audrasjb, whyisjake.

Built from https://develop.svn.wordpress.org/trunk@49359


git-svn-id: http://core.svn.wordpress.org/trunk@49119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-28 19:11:06 +00:00
Sergey Biryukov 07ec574a54 Code Modernization: Only call `libxml_disable_entity_loader()` in PHP < 8.
This function has been deprecated in PHP 8.0 because in libxml 2.9.0, external entity loading is disabled by default, so this function is no longer needed to protect against XXE attacks.

Props jrf.
Fixes #50898.
Built from https://develop.svn.wordpress.org/trunk@48789


git-svn-id: http://core.svn.wordpress.org/trunk@48551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-12 15:25:03 +00:00
John Blackbourn 57a3f803ae Docs: First pass at some inline docs fixes mostly made by PHPCBF.
See #49572, #50744
Built from https://develop.svn.wordpress.org/trunk@48586


git-svn-id: http://core.svn.wordpress.org/trunk@48348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-23 20:01:04 +00:00
desrosj cd6e936103 Embeds: Correct the version number when Hulu was deprecated.
Follow up of [48512]
See #50676.
Built from https://develop.svn.wordpress.org/trunk@48513


git-svn-id: http://core.svn.wordpress.org/trunk@48275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-20 13:14:04 +00:00
desrosj 511e9cfade Embeds: Remove Hulu from the list of supported oEmbed providers.
The oEmbed service for Hulu no longer works and appears to have been silently disabled.

Props tacitonic, talldanwp, youknowriad, bph.
Fixes #50676.
Built from https://develop.svn.wordpress.org/trunk@48512


git-svn-id: http://core.svn.wordpress.org/trunk@48274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-20 13:12:01 +00:00
Sergey Biryukov 40c389c95e Docs: Standardize on "Returning a value from the filter" vs. "Passing a value to the filter".
The filter is the callback function added with `add_filter()`, therefore the hook passes a value to the filter, and the filter returns a value to change its behaviour.

The documentation is referring to the latter.

Props johnbillion.
See #49572, #16557.
Built from https://develop.svn.wordpress.org/trunk@48185


git-svn-id: http://core.svn.wordpress.org/trunk@47954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-26 18:49:09 +00:00
desrosj 4b60af1a6a General: Remove “whitelist” and “blacklist” in favor of more clear and inclusive language.
“The WordPress open source community cares about diversity. We strive to maintain a welcoming environment where everyone can feel included.”

With this commit, all occurrences of “whitelist” and “blacklist” (with the single exception of the `$new_whitelist_options` global variable) are removed. A new ticket has been opened to explore renaming the `$new_whitelist_options` variable (#50434).

Changing to more specific names or rewording sentences containing these terms not only makes the code more inclusive, but also helps provide clarity. These terms are often ambiguous. What is being blocked or allowed is not always immediately clear. This can make it more difficult for non-native English speakers to read through the codebase.

Words matter. If one contributor feels more welcome because these terms are removed, this was worth the effort.

Props strangerstudios, jorbin, desrosj, joemcgill, timothyblynjacobs, ocean90, ayeshrajans, davidbaumwald, earnjam.
See #48900, #50434.
Fixes #50413.
Built from https://develop.svn.wordpress.org/trunk@48121


git-svn-id: http://core.svn.wordpress.org/trunk@47890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-22 17:26:13 +00:00
Sergey Biryukov 7932193708 Coding Standards: Use strict comparison where static strings are involved.
This reduces the number of `WordPress.PHP.StrictComparisons.LooseComparison` issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.
Built from https://develop.svn.wordpress.org/trunk@47808


git-svn-id: http://core.svn.wordpress.org/trunk@47584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-05-16 18:42:12 +00:00
Sergey Biryukov 38676936ba 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.
Built from https://develop.svn.wordpress.org/trunk@47550


git-svn-id: http://core.svn.wordpress.org/trunk@47325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-05 03:02:11 +00:00
Sergey Biryukov f454fc8165 Embeds: Add support for TikTok.
Props audrasjb, jblz, peterwilsoncc, felipeloureirosantos.
Fixes #49083.
Built from https://develop.svn.wordpress.org/trunk@47216


git-svn-id: http://core.svn.wordpress.org/trunk@47016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-09 04:55:06 +00:00
Sergey Biryukov 001ffe81fb Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.
Built from https://develop.svn.wordpress.org/trunk@47122


git-svn-id: http://core.svn.wordpress.org/trunk@46922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 00:45:18 +00:00
Sergey Biryukov c3f9af4f00 Docs: Adjust documentation for some `pre_*` filters for consistency.
See #48303.
Built from https://develop.svn.wordpress.org/trunk@47101


git-svn-id: http://core.svn.wordpress.org/trunk@46901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-22 00:25:04 +00:00
Sergey Biryukov dd4d98a368 Docs: In various `@return` tags, list the expected type first, instead of `false`.
Follow-up to [46696].

See #48303.
Built from https://develop.svn.wordpress.org/trunk@47060


git-svn-id: http://core.svn.wordpress.org/trunk@46860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-11 18:32:05 +00:00
Sergey Biryukov 8e9c4a116a Embeds: Remove CollegeHumor oEmbed provider, as the service does not exist anymore.
Props audrasjb, youknowriad.
Fixes #48696.
Built from https://develop.svn.wordpress.org/trunk@46761


git-svn-id: http://core.svn.wordpress.org/trunk@46561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-11-23 10:15:03 +00:00
Sergey Biryukov e6bbff13c5 Code Modernisation: Replace `call_user_func_array()` in various `__call()` methods with dynamic function calls.
The callback in these functions is always checked against a limited list of valid callbacks that can be safely changed to dynamic function calls.

Props jrf.
See #47678.
Built from https://develop.svn.wordpress.org/trunk@46144


git-svn-id: http://core.svn.wordpress.org/trunk@45956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:53:56 +00:00
Sergey Biryukov 8e85299a00 General: First pass at replacing Codex URLs with a corresponding HelpHub or DevHub article.
Props ianbelanger, tobifjellner, SergeyBiryukov.
See #47771.
Built from https://develop.svn.wordpress.org/trunk@45674


git-svn-id: http://core.svn.wordpress.org/trunk@45485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-25 22:45:57 +00:00
Gary Pendergast af0a914d14 Coding Standards: Move `wp-includes/class-oembed.php` to `wp-includes/class-wp-oembed.php`.
This renames the file containing the `WP_oEmbed` class to conform to the coding standards.

This commit also includes:

- A new `class-oembed.php` that includes the new file, for anyone that may've been including the file directly.
- Replaces references to the old filename with the new filename.

See #47632.


Built from https://develop.svn.wordpress.org/trunk@45663


git-svn-id: http://core.svn.wordpress.org/trunk@45474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-19 04:32:57 +00:00