Commit Graph

2800 Commits

Author SHA1 Message Date
Sergey Biryukov 7c2f97597d Docs: Correct method reference in a comment for `Bulk_Plugin_Upgrader_Skin::$plugin_info`.
See [42677] for `Bulk_Theme_Upgrader_Skin::$theme_info`.

See #42505.

git-svn-id: https://develop.svn.wordpress.org/trunk@42873 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-23 00:33:53 +00:00
John Blackbourn 58dd2c9559 Docs: Revert some sneaky debugging code.
See #41756


git-svn-id: https://develop.svn.wordpress.org/trunk@42872 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-22 20:28:42 +00:00
John Blackbourn f12dec95fe Docs: Document many more parameters and properties using typed array notation.
See #41756


git-svn-id: https://develop.svn.wordpress.org/trunk@42871 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-22 20:26:06 +00:00
Dominik Schilling (ocean90) 877a59a843 Users: Use `promote_users` for role updates in `edit_user()`.
`edit_user()` can also update user roles but was still using the `edit_users` capability instead of the newer `promote_users` capability introduced in [14176].
This makes the role handling consistent with the bulk dropdown menu for role changes.

Props flixos90, johnjamesjacoby, ocean90.
Fixes #42564.

git-svn-id: https://develop.svn.wordpress.org/trunk@42855 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-19 20:28:28 +00:00
Dominik Schilling (ocean90) 8df8cf2df1 Pinking shears.
See #41057.

git-svn-id: https://develop.svn.wordpress.org/trunk@42843 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-18 14:22:09 +00:00
Felix Arntz 8e4bd924d2 Multisite: Introduce metadata for sites.
A new global multisite table `wp_blogmeta` is added to the database schema, and a set of `*_site_meta()` API functions are introduced.

The implementation fails gracefully when the new table is not yet available, which may happen especially shortly after the core update, before the network has been upgraded to the new database schema. The presence of the table is detected once and stored as a global setting on the main network.

Core does not yet use site metadata, but there are several use-cases to be implemented or explored in the near future, and it allows plugins to extend sites with arbitrary data, which will come in particularly handy with the upcoming REST API endpoint for sites.

Props spacedmonkey, johnjamesjacoby, jeremyfelt, flixos90.
Fixes #37923.


git-svn-id: https://develop.svn.wordpress.org/trunk@42836 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-16 02:14:04 +00:00
Felix Arntz 5f56921131 General: Introduce dashboard widget to inform administrators about outdated PHP versions.
This new dashboard widget is shown on WordPress sites which are powered by a PHP version which WordPress considers outdated, in order to inform site owners about the resulting problems and to explain how to upgrade to a supported version. An education page for that purpose has been previously created that the widget links to. The link is translatable so that localized versions of the page can be referred to as they become available.

The nag follows the example of the Browse Happy dashboard widget and is only visible for administrators, or network administrators when using multisite. To determine whether it needs to be displayed, a new wordpress.org API introduced prior is called that handles the version logic in a centralized location.

Props flixos90, hedgefield, schlessera.
Fixes #41191.


git-svn-id: https://develop.svn.wordpress.org/trunk@42832 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-12 16:42:11 +00:00
John Blackbourn a4f6e8dadb Security: Loosen the admin referrer policy header value to allow the referring host to be sent from the admin area in all cases.
This allows referrer-restricted content from third parties (such as images and fonts) to continue working in the admin area.

Props aranwer104, qcmiao

Fixes #43285


git-svn-id: https://develop.svn.wordpress.org/trunk@42830 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-12 10:56:53 +00:00
Dion Hulse 36d237cc13 Plugins: Add support for plugins having an `active_installs` value larger than 1 million.
WordPress.org currently supports up to 5 million, and with the growth of WordPress, it's expected that that upper bound will increase in the future.

Fixes #43193.


git-svn-id: https://develop.svn.wordpress.org/trunk@42829 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-12 01:56:20 +00:00
Sergey Biryukov 1fddd69163 I18N: Use the actual placeholder instead of a number in translator comments if the corresponding string does not use numbered placeholders.
Add missing translator comments in `WP_Theme_Install_List_Table` and `wp_notify_postauthor()`.
Add missing commas in some translator comments.

Fixes #43523.

git-svn-id: https://develop.svn.wordpress.org/trunk@42827 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-11 16:43:59 +00:00
Sergey Biryukov baf669ffea Docs: Fix typo in a comment in `WP_Community_Events::trim_events()`.
See #42505.

git-svn-id: https://develop.svn.wordpress.org/trunk@42826 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-11 10:34:10 +00:00
Sergey Biryukov 637b4d8f80 Docs: Add missing brace in `auto_update_{$type}` filter DocBlock.
See #42505.

git-svn-id: https://develop.svn.wordpress.org/trunk@42825 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-11 10:29:47 +00:00
Andrea Fercia 9054719d29 Accessibility: Widgets: Make the "Available Widgets" section operable with a keyboard.
For a number of years, the "Available Widgets" section has been off-limits for
keyboard users. Now it can be used also with the keyboard. This change introduces
also some improvements for assistive technologies.

- makes the widget toggles focusable and adds an `aria-expanded` attribute to indicate their state
- improves the toggles labelling to clarify context (add/edit)
- changes the controls to choose a sidebar from list items to buttons
- adds an `aria-label` attribute to the buttons to clarify their purpose
- adds an `aria-pressed` attribute to the buttons to indicate which one is selected
- improves color contrast of the selected button
- uses a `wp.a11y.speak()` message to announce to screen reader users when a widget has been added to a sidebar
- moves focus back to the toggle button when closing a widget

See #40677.


git-svn-id: https://develop.svn.wordpress.org/trunk@42794 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-07 22:26:39 +00:00
Mike Schroder 3a46cba430 Media: Correctly allow changing PDF thumbnail crop value.
Corrects logic that keeping plugins from setting crop value of intermediate image sizes for rendered PDFs.

Adds test.

Props leemon, SergeyBiryukov, chetan200891, birgire.
Fixes #43226.

git-svn-id: https://develop.svn.wordpress.org/trunk@42792 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-07 01:18:08 +00:00
Andrea Fercia 1a03159d26 Accessibility: Make the Widgets screen "Enable accessibility mode" link more discoverable.
For a number of years, the link to the Widgets screen "Accessibility mode" lived
in the Screen Options panel, hidden by default. Many users, including assistive
technologies users, weren't able to find it or even aware it existed. By bringing
the link in the main screen, visible by default, this change makes the
"Accessibility mode" easily discoverable for everyone.

Props chetan200891, antonioeatgoat.
Fixes #42778.


git-svn-id: https://develop.svn.wordpress.org/trunk@42790 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-06 17:20:07 +00:00
John Blackbourn b20dc7aaaf Docs: Standardise and correct documentation relating to parameters which accept plugin names.
See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@42787 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-05 21:49:53 +00:00
John Blackbourn 3e182c7f71 Upgrade/Install: Fix the format of the `upgrader_process_complete` actions after [42343].
More info: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1323

See #41057, #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@42786 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-05 21:43:25 +00:00
Sergey Biryukov 366e736785 Help/About: Update "WordPress News" widget references in help text and inline documentation.
Props monikarao, denisco.
Fixes #43400, #43472.

git-svn-id: https://develop.svn.wordpress.org/trunk@42781 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-05 03:03:05 +00:00
Sergey Biryukov 007a7caad4 Media: Recognize `.ico` files as displayable images on PHP 5.3+ and allow attachment meta data to be generated for them.
Props remyvv, Guido07111975.
Fixes #43458.

git-svn-id: https://develop.svn.wordpress.org/trunk@42780 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-05 01:02:20 +00:00
Sergey Biryukov 2d37bd46ec Docs: Expand `delete_theme()` return value, fix typo in `delete_plugins()` return value.
See #42505.

git-svn-id: https://develop.svn.wordpress.org/trunk@42778 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-04 22:06:46 +00:00
Sergey Biryukov e0b16ef59c Docs: Use consistent description for `$wp_filesystem` global.
See #42505.

git-svn-id: https://develop.svn.wordpress.org/trunk@42777 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-04 21:57:10 +00:00
Sergey Biryukov fa1ce009b5 Docs: Clarify return values and improve DocBlock formatting for `verify_file_md5()`, `unzip_file()`, `_unzip_file_ziparchive()`, `_unzip_file_pclzip()`, `copy_dir()`, `WP_Filesystem()`.
See #42505.

git-svn-id: https://develop.svn.wordpress.org/trunk@42776 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-04 21:42:12 +00:00
Sergey Biryukov aae94227c6 Docs: Clarify `download_url()` return value, improve DocBlock formatting.
See #42505.

git-svn-id: https://develop.svn.wordpress.org/trunk@42775 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-04 19:49:54 +00:00
Sergey Biryukov 4edda96383 Filesystem API: Allow `download_url()` to return the response code and body on error as an additional `WP_Error` object data.
The error response body size is limited to 1 KB by default to avoid taking up too much memory. The size can be increased using `download_url_error_max_body_size` filter.

Props soulseekah, campusboy1987, mihdan, SergeyBiryukov.
Fixes #43329.

git-svn-id: https://develop.svn.wordpress.org/trunk@42773 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-04 17:13:35 +00:00
Dominik Schilling (ocean90) 37acff86ca Import: Avoid counting an uncountable type when reading arguments passed to a script.
Props josephscott.
Fixes #42898.

git-svn-id: https://develop.svn.wordpress.org/trunk@42771 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-02 17:16:37 +00:00
Andrea Fercia 6e5a560be0 Accessibility: Change the comments "Quick Edit" and "Reply" links to buttons.
For better accessibility and semantics, user interface controls that perform an
action should be buttons. Links should exclusively be used for navigation.

Props Cheffeid, audrasjb, afercia.
See #43382, #38677.
Fixes #43376.


git-svn-id: https://develop.svn.wordpress.org/trunk@42767 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-28 22:36:00 +00:00
Sergey Biryukov 1cc516f2e8 General: Introduce `WP_Error::has_errors()` method and use it where appropriate.
Props robdxw, DrewAPicture, SergeyBiryukov.
Fixes #42742.

git-svn-id: https://develop.svn.wordpress.org/trunk@42761 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-27 02:30:46 +00:00
Sergey Biryukov c625e2e7d9 Media: Remove unnecessary `aria-required` attribute from legacy (pre-3.5.0) media functions, added in [7888].
At the time, having both `required` and `aria-required` meant a wider range of support for browsers and assistive technology. Today, it's safe to use just `required`.

Props shital-patel, afercia, audrasjb.
Fixes #43415.

git-svn-id: https://develop.svn.wordpress.org/trunk@42759 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-26 23:09:57 +00:00
Dominik Schilling (ocean90) cb78bce02f Administration: Remove unnecessary capitalization when referencing to plugin/theme editors.
Fixes #43072.

git-svn-id: https://develop.svn.wordpress.org/trunk@42757 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-26 19:34:56 +00:00
SergeyBiryukov 74afab6950 Docs: Add missing `@since` entries for functions in `wp-admin/image-edit.php`.
See #42505.

git-svn-id: https://develop.svn.wordpress.org/trunk@42756 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-26 18:37:02 +00:00
Sergey Biryukov c89d25560b Docs: Remove `@static` notations from property DocBlocks in `wp-admin/*` and `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@42747 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-25 20:31:33 +00:00
Sergey Biryukov b8d62558a9 Docs: Remove `@static` notations from method DocBlocks in `wp-admin/*` 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@42745 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-25 20:05:09 +00:00
Adam Silverstein 74ccb68c56 Taxonomy: restore TagSearch unit tests and correct deprecated version string.
Reverts unit test removal, instead changing them to expect the function to be deprecated.
Correct the version the ajax callback was deprecated.

Amends [42614].

Props dlh, ocean90.
Fixes #38922.



git-svn-id: https://develop.svn.wordpress.org/trunk@42737 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-25 16:27:57 +00:00
Sergey Biryukov ba351c550f Administration: Use HTTPS for `dashboard_primary_feed` URL.
`dashboard_secondary_feed` is already using HTTPS since [29787].

Props iandunn.
Fixes #40416.

git-svn-id: https://develop.svn.wordpress.org/trunk@42731 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-24 09:29:17 +00:00
Aaron Jorbin 9377c9a873 Community Events Dashboard: Use wp_list_pluck rather than array_columns
array_columns is only available in PHP 5.5+

Introduced in [42726]

See: #41112.



git-svn-id: https://develop.svn.wordpress.org/trunk@42728 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-21 23:27:00 +00:00
Andrea Fercia 827b9056c9 Accessibility: Change the terms "Quick Edit" link to a button.
For better accessibility and semantics, user interface controls that perform an
action should be buttons. Links should exclusively be used for navigation.
See #38677 / [42725].

Fixes #43382.


git-svn-id: https://develop.svn.wordpress.org/trunk@42727 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-21 23:03:57 +00:00
Aaron Jorbin 53a61339e4 Community Events Dashboard: Always show a WordCamp if one is coming up
WordCamps are celebrations of the local WordPress Community and once a local one is scheduled, people in that community should know it is coming. This adjusts the WordPress Events in the dashboard widgets to always display a WordCamp, even if there are multiple Meetups happening first.

Props iandunn, metalandcoffee, warmlaundry, alejandroxlopez, jorbin.
Fixes #41112.



git-svn-id: https://develop.svn.wordpress.org/trunk@42726 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-21 23:00:50 +00:00
Andrea Fercia c729ca4171 Accessibility: Change the posts "Quick Edit" link to a button.
For better accessibility and semantics, user interface controls that perform an
action should be buttons. Links should exclusively be used for navigation. Also,
adds an `aria-expanded` attribute to the button to communicate to assistive
technologies the expanded / collapsed status of the Quick Edit form.

Props Cheffheid, audrasjb, afercia.
Fixes #38677.


git-svn-id: https://develop.svn.wordpress.org/trunk@42725 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-21 22:30:34 +00:00
Sergey Biryukov 21c6dabbc3 Docs: Correct documentation for Heartbeat filters.
`$response` parameter is documented as an array or object, but only array is actually supported.

See #42777, #42505.

git-svn-id: https://develop.svn.wordpress.org/trunk@42720 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-19 21:45:03 +00:00
Peter Wilson d002fde80e General: Further improve error messages following [42648].
Props kristastevens, melchoyce.
Fixes #38332 for trunk.



git-svn-id: https://develop.svn.wordpress.org/trunk@42719 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-19 02:12:41 +00:00
Kónståntîn Obénland b99139814d Docs: Add filter docs for wp_refresh_nonces
Props chetan200891, slushman, dlh, netweb.
Fixes #42777.



git-svn-id: https://develop.svn.wordpress.org/trunk@42717 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-17 04:41:58 +00:00
Sergey Biryukov b252154091 Customize: Correct closing tags in `customize_themes_print_templates()`.
Props johnpgreen, nandorsky.
Fixes #43307.

git-svn-id: https://develop.svn.wordpress.org/trunk@42711 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-13 22:14:36 +00:00
Drew Jaynes 1b46470b75 Docs: Link to the "Conditional Tags" article in the Theme Developer Handbook from the descriptions for a variety of core conditional tag functions.
These notations largely serve to direct consumers (of both the source and the parsed code reference) to extended information on individual and related conditional tags throughout WordPress. The changeset also standardizes corresponding DocBlock summaries to use third-person singular verbs.

Notations been added for the following functions:

* comments_open()
* email exists()
* has_excerpt()
* has_post_thumbnail()
* has_tag()
* in_category()
* in_the_loop()
* is_404()
* is_active_sidebar()
* is_active_widget()
* is_admin()
* is_admin_bar_showing()
* is_archive()
* is_attachment()
* is_author()
* is_blog_installed()
* is_category()
* is_comments_popup()
* is_date()
* is_day()
* is_dynamic_sidebar()
* is_feed()
* is_front_page()
* is_home()
* is_local_attachment()
* is_main_query
* is_month()
* is_multi_author
* is_new_day()
* is_page()
* is_page_template()
* is_paged()
* is_plugin_active()
* is_plugin_active_for_network()
* is_plugin_inactive()
* is_plugin_page()
* is_post_type_archive()
* is_preview()
* is_rtl()
* is_search()
* is_single()
* is_singular()
* is_sticky()
* is_tag()
* is_tax()
* is_taxonomy_hierarchical()
* is_time()
* is_trackback()
* is_user_logged_in()
* is_year()
* pings_open()
* post_type_exists()
* taxonomy_exists()
* term_exists()
* username exists()
* wp_attachment_is_image()
* wp_script_is()

Props janalwin.
Fixes #43254.


git-svn-id: https://develop.svn.wordpress.org/trunk@42710 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-13 16:53:44 +00:00
Sergey Biryukov 88d00c0fac Plugins: Use correct variable name in `install_plugin_information()`.
Props afragen.
Fixes #43282. See #43192, #29274.

git-svn-id: https://develop.svn.wordpress.org/trunk@42686 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-10 22:07:40 +00:00
John Blackbourn 84b08f302e Comments: Add a "Mine" link to the list of filters on the comment listing screen.
This filter shows comments made by the current user, and copies the same filter functionality that's available on the post listing screens.

Props Iceable

Fixes #42379


git-svn-id: https://develop.svn.wordpress.org/trunk@42684 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-09 18:45:30 +00:00
John Blackbourn 47abf85ab8 Docs: First pass at switching some array parameter documentation to typed notation.
Props janak007

See #41756


git-svn-id: https://develop.svn.wordpress.org/trunk@42679 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-09 17:25:22 +00:00
John Blackbourn 4836686b6f Docs: Add missing code formatting to various `@since` entries.
See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@42678 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-09 16:54:58 +00:00
John Blackbourn dc28b0d31d Docs: Update the hook docs for `update_bulk_theme_complete_actions`.
See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@42677 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-09 16:21:04 +00:00
John Blackbourn 209baca2ca Posts, Post Types: Add a new `add_inline_data` action which allows extra fields to be added to the inline editing fields.
Props mensmaximus, NathanAtmoz

Fixes #36085


git-svn-id: https://develop.svn.wordpress.org/trunk@42676 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-09 15:54:56 +00:00
Sergey Biryukov 31816ccec2 Posts, Post Types: Remove extra tabs around `page_attributes_meta_box_template` action in `page_attributes_meta_box()`.
Props chetan200891.
See #43252.

git-svn-id: https://develop.svn.wordpress.org/trunk@42674 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-08 11:23:43 +00:00
Sergey Biryukov d6bfc44a16 Comments: Avoid extra tabs in a textarea in `WP_Comments_List_Table::column_comment()`.
Props chetan200891, jrf.
Fixes #43252.

git-svn-id: https://develop.svn.wordpress.org/trunk@42670 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-08 10:56:55 +00:00
Peter Wilson f317869c7f General: Replace `Cheatin’ uh?` with friendlier error messages.
While intended as a playful error message, `Cheatin’ uh?` can be interpreted as insulting or accusatory in an already stressful situation. This replaces Cheatin’ with more meaningful error messages, depending on the error that occurs.

Props ElectricFeet, EricMeyer, karmatosed, dd32, BandonRandon, melchoyce for language; dmsnell for original patch; peterwilsoncc.
Fixes #38332.



git-svn-id: https://develop.svn.wordpress.org/trunk@42648 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-05 02:29:53 +00:00
Sergey Biryukov 6d379c6f0f Posts, Post Types: Don't count pending comments in `WP_Posts_List_Table::_display_rows()` if the post type does not support comments.
Props seanchayes.
Fixes #43212.

git-svn-id: https://develop.svn.wordpress.org/trunk@42638 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-02 07:37:10 +00:00
Dion Hulse 212c880d71 Themes: Use `api.wordpress.org/themes/info/1.2/` to query theme information.
See #43192.


git-svn-id: https://develop.svn.wordpress.org/trunk@42632 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-01 05:18:54 +00:00
Dion Hulse e0d5a8ac54 Plugins: Use `api.wordpress.org/plugins/info/1.2/` for querying plugins & plugin information.
See #43192.
Fixes #29274.


git-svn-id: https://develop.svn.wordpress.org/trunk@42631 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-01 05:16:15 +00:00
Adam Silverstein 04b0a0f77c Taxonomy: Use REST API for ajax tag search.
Deprecate wp_ajax_ajax_tag_search and switch to using the REST API when searching tags in the tags meta box.

Props nacin, chriscct7, afercia, swissspidy, jnylen0, rmccue, ryelle.
Fixes #38922.



git-svn-id: https://develop.svn.wordpress.org/trunk@42614 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-30 00:16:37 +00:00
SergeyBiryukov 10ad912128 Taxonomy: Don't display an empty edit link in taxonomy list table if the user doesn't have permissions to edit the term.
Props grapplerulrich.
Fixes #43146.

git-svn-id: https://develop.svn.wordpress.org/trunk@42565 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-23 11:33:26 +00:00
Aaron Jorbin 5bb7fc10c5 Remove JSHint due to license compatibility
JSHint inherits a license from JSLint that includes the clause  "The Software shall be used for Good, not Evil." WordPress's license specifically allows grants the freedom to run the program, for any purpose. Please note, this is not an encouragement of evil. Rather than doing something evil, how about learning to love those around you. Instead of tweeting lies and saying people are "Not Good!", help your neighbor. In the words of Lin Manual Miranda, "Love is love is love is love is love is love is love is love, cannot be killed or swept aside." 

This replaces JSHint with esprima, a part of the larger jQuery project, and a custom wrapper for some basic error checking within codemirror.

The existing JSHint configuration is kept in place in case someone wants to use that, but they can only do so for Good.

Fixes #42850
Props netweb for a spelling fix on a comment.



git-svn-id: https://develop.svn.wordpress.org/trunk@42547 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-23 01:28:26 +00:00
Sergey Biryukov 0baa8ae85c Media: In `_wp_handle_upload()`, check if the file was properly uploaded before checking its size.
Props achbed, dglingren.
Fixes #39522.

git-svn-id: https://develop.svn.wordpress.org/trunk@42525 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-17 07:15:57 +00:00
Dion Hulse 4dbc0b3987 External Libraries: Remove unnecessary / obsoleted MediaElement.js files.
Props joemcgill.
Fixes #42720 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42462 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-16 06:27:48 +00:00
Sergey Biryukov 842b3a2378 Plugins: Update review filter links in Details modal.
Props darko-a7, afercia.
Fixes #43016. See #meta3379.

git-svn-id: https://develop.svn.wordpress.org/trunk@42459 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-16 00:14:48 +00:00
Sergey Biryukov fb5b617056 Media: Bring consistency to `getimagesize()` error suppression.
Props chasewg, joemcgill, jeremyfelt.
Fixes #42480.

git-svn-id: https://develop.svn.wordpress.org/trunk@42449 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-15 19:43:30 +00:00
Dion Hulse 91b3164ee5 Upgrade: When deleting old files, if deletion fails attempt to empty the file instead.
Props joemcgill, dd32.
Fixes #42963 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42433 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-10 06:09:51 +00:00
Rachel Baker 7567f588b3 Comments: Introduce filter for the arguments for the comment query in the comments list table.
Add `comments_list_table_query_args` filter to the Comments List Table.

Props soulseekah, birgire.
Fixes #42997.

git-svn-id: https://develop.svn.wordpress.org/trunk@42420 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-29 18:20:13 +00:00
Dion Hulse 64e3dc5bc8 i18n: Don't use `esc_attr_e()` on a variable.
Props yoavf.
Fuxes #42935.


git-svn-id: https://develop.svn.wordpress.org/trunk@42413 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-20 05:34:05 +00:00
John Blackbourn 2a9f696710 Docs: Improve the function and parameter descriptions for `do_meta_boxes()`.
See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@42412 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-19 15:02:36 +00:00
John Blackbourn 186f963c34 Media: Pass the attachment ID to the `intermediate_image_sizes_advanced` filter.
Props drywallbmb, robbie505
Fixes 42745


git-svn-id: https://develop.svn.wordpress.org/trunk@42407 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-16 13:46:28 +00:00
Adam Silverstein 33514867dd Media: improve flows for cropping on attachment details screen.
On the "Attachment Details" screen:
* The crop button is always 'enabled'.
* Clicking the crop button with no selection selects the entire image.
* Clicking the crop button with the entire image selected doesn't do anything.
* Clicking the crop button with a selection crops as expected.

Props sonjanyc, afercia, mikeschroder.
Fixes #30155.


git-svn-id: https://develop.svn.wordpress.org/trunk@42404 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 22:02:02 +00:00
Sergey Biryukov e47feac514 Docs: Add missing `@since` tags for add menu page functions.
Props keesiemeijer.
Fixes #42882.

git-svn-id: https://develop.svn.wordpress.org/trunk@42394 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 00:14:09 +00:00
Dion Hulse 35c13730dd Docs: Correct some typos in the docs for `wp_ajax_get_community_events()`.
Props Presskopp.
Fixes #42861.


git-svn-id: https://develop.svn.wordpress.org/trunk@42384 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-11 08:48:07 +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 63f8e4d122 Users: After [42256], remove unnecessary double quotes around `first_name` and `last_name` properties.
See #42713.

git-svn-id: https://develop.svn.wordpress.org/trunk@42257 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-29 15:27:55 +00:00
Dion Hulse c52f6ba995 Users: Display partial names in the user listing tables.
This allows showing a name when only the first or last name is provided.

Props shital-patel, antipole.
Fixes #42713.


git-svn-id: https://develop.svn.wordpress.org/trunk@42256 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-29 03:40:31 +00:00
Gary Pendergast 209ede72de General: Add inline PHPCS options to leave regex indentation.
We have a handful of super long regexen that are written over multiple lines, as a collection of strings concatenated together. Each string is indented appropriately for the regex, but PHPCS doesn't recognised this, so defaults to removing the extra whitespace.

Disabling the `Squiz.Strings.ConcatenationSpacing.PaddingFound` rule for these blocks stops the extra whitespace from being removed.

See #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42249 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-28 04:23:11 +00:00
Dion Hulse 44c75415b3 Theme Editior: Base the nonce on a simpler combination of fields, for easier debugging & reading.
See #42609.
Fixes #42705.


git-svn-id: https://develop.svn.wordpress.org/trunk@42246 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-27 03:43:11 +00:00
Dion Hulse 6e0ba7864f Theme Editor: Validate files are editable based on their relative filenames, rather than full file path.
This fixes theme editing on Windows platforms where `validate_file()` will return `2` on a full file path.

Fixes #42609.


git-svn-id: https://develop.svn.wordpress.org/trunk@42244 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-27 03:27:19 +00:00
dd32 76f77416d6 Theme/Plugin Editor: Remove the caching added in [41806] as it causes more problems than it fixes.
While caching here seemed like a good idea in theory, in practice the cache would be often stale causing development issues.
We exclude common folders (such as `node_modules`) from the scanning to avoid directories which are not useful to the end-user, so as long as those exclusion lists are held up this shouldn't cause too much of a degredation in the future.
We may consider adding caching here again in the future if it's determined that it is really needed.

Props precies, ibenic, mariovalney, schlessera, and all the others who commented on the ticket(s).
This partually reverts [41806].
See #6531.
Fixes #42573.


git-svn-id: https://develop.svn.wordpress.org/trunk@42242 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-27 02:58:02 +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
Dion Hulse 26fb077862 Filesystem: Use a more unique filename in `wp_tempnam()` and `get_filesystem_method()`.
Using a filename which was generated from `time()` could cause two processes to try to use the same filename, causing unexpected behaviour.

Props jrchamp, bikecrazyy.
Fixes #42265.


git-svn-id: https://develop.svn.wordpress.org/trunk@42224 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-24 03:04:35 +00:00
Gary Pendergast f797c252d9 General: Reformat inline `if ()` statements inside HTML tags.
This pattern occurs a handful of times across the codebase:

`<div class="foo<?php if ( $bar ) { echo ' baz'; } ?>">`

Unfortunately, it doesn't really play nicely with `phpcbf`, so all instances need to be removed in preperation for auto code formatting.

See #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42217 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-23 04:08:42 +00:00
Dion Hulse 2c1858a8c3 Upgrade: Fix updating plugins which include a numeric file/folder names.
The fix in [41821] caused numeric folder names to be reindexed to 0..n when in the root directory (for example, `my-plugin/24/`).

Props edo888.
See #41524.
Fixes #42628 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42214 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-21 04:14:33 +00:00
Boone Gorges 4ec5d65dcc Introduce `meta_box_sanitize_cb` taxonomy argument.
The `meta_box_cb` argument was introduced in [25572] to allow plugin
authors to provide a custom callback for rendering their taxonomy's meta
box on the post edit screen. However, the routine used to handle the saving
of these custom taxonomy meta boxes was not customizable, but was instead
based simply on whether the taxonomy was hierarchicaly. See [13535].

The new `meta_box_sanitize_cb` argument defaults to the "tag" routine for
non-hierarchical taxonomies and the "category" routine for hierarchical ones,
thereby maintaining the current default behavior. Developers can override this
when the data passed from their `meta_box_cb` differs.

Props boonebgorges, ZaneMatthew, stephenharris.
Fixes #36514.

git-svn-id: https://develop.svn.wordpress.org/trunk@42211 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-21 03:14:52 +00:00
Felix Arntz 887214f7ce Multisite: Fix broken update `blog_versions` query after [41661].
Props Mista-Flo, lenasterg.
Fixes #42641.


git-svn-id: https://develop.svn.wordpress.org/trunk@42210 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-20 23:45:09 +00:00
johnbillion 4af1237176 Docs: Correct the `@since` property for the `page_attributes_misc_attributes` action.
Props jeremyescott, jfarthing84

Fixes #42607


git-svn-id: https://develop.svn.wordpress.org/trunk@42203 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-19 11:51:01 +00:00
Felix Arntz b424eecd0b Multisite: Do not show edit links in network users table for users that cannot be edited.
Props ocean90.
Fixes #42552.


git-svn-id: https://develop.svn.wordpress.org/trunk@42202 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-17 21:34:01 +00:00
Sergey Biryukov 603e195f10 Rewrite Rules: Correct the logic in `extract_from_markers()` after [41928].
Props stodorovic.
Fixes #42579. See #39920.

git-svn-id: https://develop.svn.wordpress.org/trunk@42199 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-16 13:24:57 +00:00
Weston Ruter 33f7cfd2b9 Customize: Prevent PHP notice on theme-switch dashboard welcome link (and link to themes admin screen) when user cannot `customize`.
Props skostadinov, ocean90.
Amends [41699].
See #42050.
Fixes #42525.


git-svn-id: https://develop.svn.wordpress.org/trunk@42169 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-13 19:24:49 +00:00
John Blackbourn fc40dea2fd Docs: Correct parameter type documentation for various `__call()` methods.
See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@42151 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-10 22:56:01 +00:00
Weston Ruter 08a3691775 Settings: Replace `count()` call with `empty()` in `get_settings_errors()` to prevent PHP 7.2 warnings when `$wp_settings_errors` is `null`.
Props pross, dd32, westonruter.
See #40109.
Fixes #42498 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42146 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-10 22:29:45 +00:00
Weston Ruter ac5a3fc7a8 Settings: Fix date/time format previewing.
Props afercia.
Amends [41857].
Fixes #41603.


git-svn-id: https://develop.svn.wordpress.org/trunk@42134 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-09 03:54:13 +00:00
Konstantin Obenland a4f27c25bc File Editors: Account for network admin use
Fixes a bug where files couldn't be accessed in multisite installs.

Props flixos90, westonruter.
Fixes #42420.



git-svn-id: https://develop.svn.wordpress.org/trunk@42115 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-03 18:50:43 +00:00
Weston Ruter 3fab757196 Theme Editor: Ensure files listed recursively can be both viewed and edited.
Prevent edits to 2-level deep theme files from returning a `disallowed_theme_file` error when attempting to save an edit. Aligns logic for gathering `$allowed_files` in `theme-editor.php` for listing files with the validation logic in `wp_edit_theme_plugin_file()`.

Amends [41806].
See #6531.
Fixes #42425.


git-svn-id: https://develop.svn.wordpress.org/trunk@42112 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-02 23:04:54 +00:00
Ian Dunn cac531f50b Dashboard: Strip ports from IPs to avoid PHP warnings.
Fixes #41083.
Props pento, iandunn, EatonZ, birgire, dd32.


git-svn-id: https://develop.svn.wordpress.org/trunk@42016 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-25 00:06:06 +00:00
Weston Ruter 88497dc5d5 Update `$_old_files` to add the deleted MediaElement.js files when it was upgraded from 2.22.0 to 4.2.3.
Amends [41198].
See #39686.
Fixes #42097.


git-svn-id: https://develop.svn.wordpress.org/trunk@42015 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-25 00:01:29 +00:00
John Blackbourn 3e9a42ed27 Filesystem API: Add more specificity to the rules for valid files in `validate_file()`.
This now treats files containing `./` as valid, and also treats files containing a trailing `../` as valid due to widespread use of this pattern in theme and plugin zip files.

Adds tests.

Props Ipstenu, borgesbruno, DavidAnderson, philipjohn, birgire
Fixes #42016, #36170


git-svn-id: https://develop.svn.wordpress.org/trunk@42011 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 23:14:33 +00:00
John Blackbourn 49b7cb458f Filesystem API: Don't immediately return an error for invalid file names contained within a Zip while it's being extracted.
This allows the extraction of the rest of the valid files within the archive to continue.

See #42016


git-svn-id: https://develop.svn.wordpress.org/trunk@42010 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 23:10:37 +00:00
Weston Ruter 18a231bad6 Embeds: Improve consistency of update and refresh logic for oEmbed caching between `oembed_cache` and post meta.
* Allow updating oEmbed cache during `parse-embed` requests for non-post editors (such as widgets).
* Update any existing `oembed_cache` post when `usecache` and TTL has passed.
* Do not overwrite a previously valid cache with `{{unknown}}`.

Props dlh.
See #34115.
Fixes #42310.


git-svn-id: https://develop.svn.wordpress.org/trunk@42009 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 23:09:43 +00:00
John Blackbourn 7329816301 Docs: Improve the docs for `validate_file()` and `validate_file_to_edit()`.
See #42016, #36170, #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@42007 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 22:49:13 +00:00
Sergey Biryukov 80fd300ebf I18N: Use a consistent pattern for translator comments for placeholders in some more Customizer strings.
See #41974.

git-svn-id: https://develop.svn.wordpress.org/trunk@42006 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 22:46:27 +00:00
Sergey Biryukov 6768a2cd2a I18N: Add a context for remaining "Schedule" strings.
Props Mirucon.
Fixes #42165.

git-svn-id: https://develop.svn.wordpress.org/trunk@42005 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 22:34:05 +00:00
Sergey Biryukov eac206b375 Taxonomy: After [40984], add the `most_used` label for non-hierarchical taxonomies too, and use it on the Menus screen.
Props johnbillion.
Fixes #41150.

git-svn-id: https://develop.svn.wordpress.org/trunk@41987 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 11:21:47 +00:00
Weston Ruter ac68181c94 Editor: Specify `maxwidth` in `parse-embed` requests based on width of editor iframe so that TinyMCE view embeds fit, particularly in Text widgets.
See #40854, #34115.


git-svn-id: https://develop.svn.wordpress.org/trunk@41985 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 04:06:23 +00:00
Peter Wilson 733a81d74d Comments: Check if `wp_new_comment()` returns an error.
Adds checks throughout to allow for `wp_new_comment()` returning a `WP_Error` instance.

Updates the docs for the `pre_comment_approved` filter to include that it can be passed an error.

Props enrico.sorcinelli, ryotsun.
Fixes #39730.



git-svn-id: https://develop.svn.wordpress.org/trunk@41980 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 22:11:11 +00:00
Aaron Jorbin 074009ecdb Dashboard: Remove "Try Gutenberg" callout.
Reverting this for 4.9. It will be added back in a future version of WordPress. This doesn't mean that you shouldn't be trying Gutenberg, just that it isn't ready for a call out to a larger audience. But if you are the type to read commit messages, https://github.com/WordPress/gutenberg could use your pull requests and comments on issues.

Reverts [41931] [41900] [41896] [41895]
See #41316



git-svn-id: https://develop.svn.wordpress.org/trunk@41978 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 20:47:27 +00:00
Gary Pendergast 4670c8f3af Media: Don't backdate media uploaded to pages.
When media is uploaded to a post, the upload directory is set according to the date of the post, so that the media URLs in the post match when the post was published.

A page is a slightly different beast, pages often live for years, and are regularly updated to stay relevant. This change causes media uploaded to pages to use the upload date to determine the upload directory.

Fixes #10752.



git-svn-id: https://develop.svn.wordpress.org/trunk@41964 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-21 13:26:24 +00:00
Dion Hulse 899fb2f7f6 Transients: Clear expired transients from the database in a daily cron task.
Fixes #41699


git-svn-id: https://develop.svn.wordpress.org/trunk@41963 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-21 13:21:24 +00:00
Sergey Biryukov e18b4c894b Menus: Pass `$recent_args` parameter to `nav_menu_items_{$post_type_name}_recent` filter.
Props welcher, eclev91.
Fixes #39849.

git-svn-id: https://develop.svn.wordpress.org/trunk@41941 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-19 13:04:28 +00:00
Sergey Biryukov 3ce1938687 Dashboard: Add missing URL to "Help with testing" link in Gutenberg callout.
See #41316.

git-svn-id: https://develop.svn.wordpress.org/trunk@41931 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 22:40:42 +00:00
Sergey Biryukov 40706838a1 Rewrite Rules: Remove redundant `if` condition in `extract_from_markers()`.
Props Dency, yahil, appchecker.
Fixes #39920.

git-svn-id: https://develop.svn.wordpress.org/trunk@41928 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 21:27:22 +00:00
Sergey Biryukov a8518be72b Network Admin: After [41923], move the second `<p>` tag to a new line for better readability.
See #41652.

git-svn-id: https://develop.svn.wordpress.org/trunk@41924 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 20:50:58 +00:00
Sergey Biryukov 76c2aa8c85 I18N: Remove hardcoded constant from a translatable string in `network_step1()`.
Props ramiy.
Fixes #41652.

git-svn-id: https://develop.svn.wordpress.org/trunk@41923 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 20:01:36 +00:00
Sergey Biryukov beeb0acd94 I18N: Combine two "Warning" strings in `network_step1()` and `network_step2()`.
Props ramiy.
Fixes #38570.

git-svn-id: https://develop.svn.wordpress.org/trunk@41921 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 19:49:17 +00:00
Sergey Biryukov 88a6ebaa75 Plugins: Revert unintended change from [41915].
See #37430.

git-svn-id: https://develop.svn.wordpress.org/trunk@41916 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 18:00:54 +00:00
Sergey Biryukov 93a3fa4506 Plugins: After [41608], make the markup in `WP_Plugin_Install_List_Table::no_items()` a bit more readable.
See #37430.

git-svn-id: https://develop.svn.wordpress.org/trunk@41915 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 17:58:00 +00:00
Sergey Biryukov dca34e10d5 Docs: Add `@since` entry for `WP_Automatic_Updater::after_core_update()`, introduced in [25841].
See #41017, #29086.

git-svn-id: https://develop.svn.wordpress.org/trunk@41914 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 17:47:34 +00:00
Weston Ruter a7c6a25eba Widgets: Fix previewing embeds in Text widget by allowing `parse-embed` admin ajax requests with an empty `post_ID` just as `WP_oEmbed_Controller::get_proxy_item_permissions_check()` allows.
As of #34115 if there is no post context the oEmbed will be cached in an `oembed_cache` custom post type, so having a post as context is no longer a requirement for caching.

Props biskobe, westonruter.
See #34115, #40450.
Fixes #40854.


git-svn-id: https://develop.svn.wordpress.org/trunk@41913 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 17:39:46 +00:00
Sergey Biryukov aa3e40c32c I18N: Remove `<b>` tag from a translatable string in `post_submit_meta_box()`.
Props ramiy.
Fixes #41681.

git-svn-id: https://develop.svn.wordpress.org/trunk@41910 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 17:30:35 +00:00
Sergey Biryukov c7e02480bb I18N: Remove `<strong>` tag from a translatable string in `Theme_Upgrader::install_strings()`.
Props ramiy.
Fixes #41695.

git-svn-id: https://develop.svn.wordpress.org/trunk@41909 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 17:19:21 +00:00
Sergey Biryukov 8aaf0aa4bc I18N: Remove `<code>` tags from translatable strings in `Core_Upgrader`, `Language_Pack_Upgrader`, `Plugin_Upgrader`, `Theme_Upgrader`.
Props ramiy.
Fixes #41705.

git-svn-id: https://develop.svn.wordpress.org/trunk@41908 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 17:14:58 +00:00
Sergey Biryukov 129c9f42da I18N: Replace hardcoded file name in a translatable string in `convert_to_screen()` with a placeholder.
Props ramiy.
Fixes #41668.

git-svn-id: https://develop.svn.wordpress.org/trunk@41906 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 15:45:48 +00:00
Gary Pendergast 5fa59cf197 Dashboard: Introduce a "Try Gutenberg" callout.
To encourage more people to try Gutenberg, this new Dashboard box allows site users to easily install and try out Gutenberg.

Props pento, melchoyce, joen, karmatosed.
Fixes #41316.



git-svn-id: https://develop.svn.wordpress.org/trunk@41895 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 10:03:39 +00:00
Weston Ruter ce7a93c235 Customize: Allow post/page stubs to be edited in WP Admin as "customization drafts" when changeset is saved as draft or scheduled.
* Update stubs to have draft status when changeset is saved as draft, instead of preventing auto-draft garbage collection by giving them a far-future `post_date`.
* Show notice in publish metabox when editing a customization draft indicating that it will be published automatically with its changeset; a link to Customizer is included.
* Include a new "Customization Draft" display post state in the post list table.
* Disconnect stubs from their changesets when they are updated with a status other than "Draft".
* Trash customization drafts when their related changeset is trashed or deleted.
* Add a `_customize_changeset_uuid` postmeta to stubs to link them with their associated changeset.
* Include `customize_changeset_uuid` as context when requesting to insert a new auto-draft.

Props westonruter, melchoyce.
See #39896, #39752, #34923.
Fixes #42220.


git-svn-id: https://develop.svn.wordpress.org/trunk@41887 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-17 20:14:56 +00:00
Andrea Fercia d273fd8da1 Administration: Improve consistency of the "not found" strings.
Partially reverts [41608] restoring the original strings without the word `query`.

See #37430.
Fixes #42231.


git-svn-id: https://develop.svn.wordpress.org/trunk@41878 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-16 18:13:50 +00:00
Weston Ruter 8bf9afb4f4 File Editors: Display list of theme/plugin files in scrollable directory tree.
Props WraithKenny, afercia, melchoyce, westonruter.
Amends [41721].
Fixes #24048.


git-svn-id: https://develop.svn.wordpress.org/trunk@41851 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-13 02:38:19 +00:00
Dion Hulse 4b2b97a3b3 Upgrades: Remove the usage of `each()` from `WP_Upgrader` for PHP 7.2 compatibility.
Props chrisvendiadvertisingcom, dd32.
Fixes #41524


git-svn-id: https://develop.svn.wordpress.org/trunk@41821 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-11 04:23:49 +00:00
Weston Ruter 32e7a51a01 Plugin Editor: Revert superseded changes to `activate_plugin()` and `plugin_sandbox_scrape()`.
Partially revert [41671], [41561], [41560].
See #21622.
Fixes #39766.


git-svn-id: https://develop.svn.wordpress.org/trunk@41819 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-11 00:02:30 +00:00
Gary Pendergast 33a0ff50b7 File Editor: Add support for more than one sub-directory level.
The theme and plugin editors now list all files in the selected theme or plugin, recursing through subdirectories as necessary.

Props WraithKenny, schlessera, chsxf, MikeHansenMe, Daedalon, valendesigns, westonruter, pento.
Fixes #6531.



git-svn-id: https://develop.svn.wordpress.org/trunk@41806 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-10 05:33:57 +00:00
Weston Ruter 5deddd9c62 File Editor: Increase robustness of fatal error checking when saving PHP file edits.
* Increase PHP execution time limit prior to issuing loopback requests where are themselves given timeouts to ensure PHP file can be reverted.
* Output scrape messages on success and failure so that absence of either can also be flagged as an error condition.
* Forward browser's HTTP Basic Auth credentials in loopback requests to admin and home URL.
* Display more helpful message when loopback request fails.

Amends [41721].
See #21622.
Fixes #42102.


git-svn-id: https://develop.svn.wordpress.org/trunk@41805 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-10 05:26:53 +00:00
Weston Ruter 153dd26c1f Customize: Eliminate use of customize-loader in core so Customizer is opened consistently in `top` window.
* Open the door for future browser history feature in #28536, which is currently not feasible when customize-loader is used.
* Remove customizer-loader from being used on admin screens for Dashboard, Themes, non-shiny theme install/update.
* Keep the customize-loader functionality available for plugins, for the time being. It may become deprecated.
* Ensure `return` param in customizer links in Themes screen update to reflect `search` updated by `pushState`.
* Persist `return` when reloading Customizer due to theme switch, autosave restoration, or changeset trashing.
* Use `location.replace()` instead of changing `location.href` when trashing.
* Hide theme browser while Themes screen is loading when there is a `search` to prevent flash of unfiltered themes.
* Use throttling instead of debouncing when searching themes to ensure that screen is updated immediately on page load.
* Fix encoding and decoding of `search` param between URL and search field.
* Add support for dismissing autosaves when closing customize-loader, when it is used by plugins.
* Skip sending changeset UUID to customize-loader for population in browser location if changeset branching is not enabled.

See #28536.
Fixes #40254.


git-svn-id: https://develop.svn.wordpress.org/trunk@41797 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-09 16:03:35 +00:00
Sergey Biryukov eb4f4bc87e Administration: Add `.protected-post-excerpt` class to password-protected post excerpts in the posts list.
Props Soean, mp518, slaFFik, SergeyBiryukov.
Fixes #41426.

git-svn-id: https://develop.svn.wordpress.org/trunk@41770 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-05 02:49:15 +00:00
Sergey Biryukov c5d9fa67a2 Posts, Post Types: Introduce `page_attributes_misc_attributes` action that fires before the help hint text in the 'Page Attributes' meta box.
Props markcallen, MikeHansenMe.
Fixes #34034.

git-svn-id: https://develop.svn.wordpress.org/trunk@41763 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-05 00:54:22 +00:00
Gary Pendergast 5c2609bbdb Plugins: Tweak the plugin icons added in [41695].
- Remove plugins icons from the plugin list table, as there were performance issues loading the icons when the site had lots of plugins.
- Depending on which icons the plugin has uploaded, prefer them in this order: `svg`, `128x128`, `256x256`.
- Improve the style of the fallback icon for plugins that don't have an icon defined.

Props Travel_girl, danieltj, afercia, karmatosed,hugobaeta, empireoflight, brentjett, melchoyce, pento.
Fixes #30186.



git-svn-id: https://develop.svn.wordpress.org/trunk@41755 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-04 23:42:55 +00:00
John Blackbourn 645a550129 Users: Revert [41613], [41614], and [41623] as this feature needs some more work.
See #38741


git-svn-id: https://develop.svn.wordpress.org/trunk@41753 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-04 22:16:21 +00:00
Mike Schroder 0cf7fbf654 Media: Store video creation date in meta.
When able to be parsed, store the created date for a video file from meta,
since this is useful separately from the dates on the file itself.

Introduces `wp_get_media_creation_timestamp()` to read the timestamp from
getID3 and a `wp_read_video_metadata` filter analogous to
`wp_read_image_metadata`.

Fixes #35218.
Props stevegrunwell, joemcgill, desrosj, blobfolio, mikeschroder.

git-svn-id: https://develop.svn.wordpress.org/trunk@41746 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-04 19:31:51 +00:00
John Blackbourn bd6ee706d0 Security: Add a referrer policy header to the admin and login screens.
This sets a referrer policy of `same-origin` which adds hardening by preventing a referrer being sent from the admin area or login screens to other origins. This helps prevent unwanted exposure of potentially sensitive information that may be contained within URLs.

This change introduces a new filter, `admin_referrer_policy`, for filtering the referrer policy header value. The header can be disabled if necessary by removing the `wp_admin_headers` action from the `admin_init` and `login_init` hooks.

Props joostdevalk
Fixes #42036


git-svn-id: https://develop.svn.wordpress.org/trunk@41741 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-04 18:24:17 +00:00
Weston Ruter 3fcfefd05c File Editors: Introduce sandboxed live editing of PHP files with rollbacks for both themes and plugins.
* Edits to active plugins which cause PHP fatal errors will no longer auto-deactivate the plugin. Supersedes #39766.
* Introduce sandboxed PHP file edits for active themes, preventing accidental whitescreening of a user's site when introducing a fatal error.
* After writing a change to a PHP file for an active theme or plugin, perform loopback requests on the file editor admin screens and the homepage to check for fatal errors. If a fatal error is encountered, roll back the edited file and display the error to the user to fix and try again.
* Introduce a secure way to scrape PHP fatal errors from a site via `wp_start_scraping_edited_file_errors()` and `wp_finalize_scraping_edited_file_errors()`.
* Moves file modifications from `theme-editor.php` and `plugin-editor.php` to common `wp_edit_theme_plugin_file()` function.
* Refactor themes and plugin editors to submit file changes via Ajax instead of doing full page refreshes when JS is available.
* Use `get` method for theme/plugin dropdowns.
* Improve styling of plugin editors, including width of plugin/theme dropdowns.
* Improve notices API for theme/plugin editor JS component.
* Strip common base directory from plugin file list. See #24048.
* Factor out functions to list editable file types in `wp_get_theme_file_editable_extensions()` and `wp_get_plugin_file_editable_extensions()`.
* Scroll to line in editor that has linting error when attempting to save. See #41886.
* Add checkbox to dismiss lint errors to proceed with saving. See #41887.
* Only style the Update File button as disabled instead of actually disabling it for accessibility reasons.
* Ensure that value from CodeMirror is used instead of `textarea` when CodeMirror is present.
* Add "Are you sure?" check when leaving editor when there are unsaved changes.

Supersedes [41560].
See #39766, #24048, #41886.
Props westonruter, Clorith, melchoyce, johnbillion, jjj, jdgrimes, azaozz.
Fixes #21622, #41887.


git-svn-id: https://develop.svn.wordpress.org/trunk@41721 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-04 00:19:16 +00:00
Felix Arntz d54e80111a Multisite: Replace calls to `refresh_blog_details()` with `clean_blog_cache()`.
Fixes #42077. See #40201.


git-svn-id: https://develop.svn.wordpress.org/trunk@41717 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 19:04:57 +00:00
John Blackbourn d72e4fd9aa Plugins: Introduce a singular and plural form for the plugin deletion error message.
Props eddhurst, SergeyBiryukov

Fixes #38918


git-svn-id: https://develop.svn.wordpress.org/trunk@41713 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 17:12:41 +00:00
Sergey Biryukov fb06fab2e8 Posts, Post Types: Simplify the wording in post locking notice.
Props munyagu.
Fixes #42023.

git-svn-id: https://develop.svn.wordpress.org/trunk@41706 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 15:10:38 +00:00
Weston Ruter bebc4cde6f Customize: Update dashboard welcome link to point to themes panel in the customizer instead of themes admin screen.
Props celloexpressions.
Fixes #42050.


git-svn-id: https://develop.svn.wordpress.org/trunk@41699 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 04:12:51 +00:00
Gary Pendergast 942482993d Plugins: Add plugin icons to the plugin list tables.
To mirror theme list table behaviour, the plugin icon now appears next to plugins in the plugin list tables. For plugins that don't have an icon, or non-W.org plugins, a fallback dashicon is shown.

Props melchoyce, afercia, paulwilde, pento, obenland.
Fixes #30186.



git-svn-id: https://develop.svn.wordpress.org/trunk@41695 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 00:24:31 +00:00
John Blackbourn 19c0a55711 Docs: Standardise the format used for documenting parameters passed by reference.
See #35974, #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41688 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 22:13:04 +00:00
John Blackbourn dd33fc9301 Docs: Remove `&` prefixes from parameter documentation to avoid doc parsing errors.
Props sudar for the original patch.

See #35974


git-svn-id: https://develop.svn.wordpress.org/trunk@41686 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 22:01:23 +00:00
Andrea Fercia e2c4ae805f Quick/Bulk Edit: Improve the inline error messages styling.
- uses the core `notice` styles for the Quick Edit form inline error messages
- adds missing periods at the end of a few error messages

Props ocean90, karmatosed, melchoyce, afercia.
Fixes #35496.


git-svn-id: https://develop.svn.wordpress.org/trunk@41684 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 21:51:09 +00:00
Andrea Fercia 02588452f7 Accessibility: List Tables: use `aria-current` for the views current link.
The `aria-current` attribute is a simple, effective way to help assistive
technologies users orientate themselves within a list of items. Continues the 
introduction in core of the `aria-current` attribute after [41359] and [41371].

Props joedolson, flixos90, afercia.
Fixes #32399.


git-svn-id: https://develop.svn.wordpress.org/trunk@41683 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 19:43:02 +00:00
Weston Ruter e8e027e7a6 Plugin Editor: Remove `plugins_loaded` from being re-triggered in `plugin_sandbox_scrape()`.
Props jdgrimes.
Amends [41560].
Fixes #39766.


git-svn-id: https://develop.svn.wordpress.org/trunk@41671 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 17:06:46 +00:00
Jeremy Felt e02c481487 Multisite: Use `get_current_blog_id()` instead of `$wpdb->blogid`.
`get_current_blog_id()` is more appropriate for determining the ID of the current site in most cases. This eliminates the need for the global `$wpdb` in several functions and is better than the implicit global used in admin pages.

Props bnap00, spacedmonkey.
Fixes #41684.


git-svn-id: https://develop.svn.wordpress.org/trunk@41661 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 01:43:48 +00:00
Andrea Fercia 7a414342df Accessibility: Improve the Theme Details modal accessibility.
- sets the modal content to `role="document"` to make screen readers switch back to browse mode
- standardizes the Themes screen and Customizer modals interaction
- Themes screen modal: sets initial focus on the modal overlay instead of the primary button, avoiding to "skip" content for keyboard and screen reader users

Fixes #42055.


git-svn-id: https://develop.svn.wordpress.org/trunk@41658 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-01 13:47:29 +00:00
Weston Ruter c35fe07703 Customize: Introduce a new experience for discovering, installing, and previewing themes within the customizer.
Unify the theme-browsing and theme-customization experiences by introducing a comprehensive theme browser and installer directly accessible in the customizer. Replaces the customizer theme switcher with a full-screen panel for discovering/browsing and installing themes available on WordPress.org. Themes can now be installed and previewed directly in the customizer without entering the wp-admin context. Also includes an extensible framework for browsing and installing themes from other sources.

Also includes CSS auto-prefixing added via `grunt precommit:css`.

For details, see: https://make.wordpress.org/core/2016/10/03/feature-proposal-a-new-experience-for-discovering-installing-and-previewing-themes-in-the-customizer/

Previously [38813] but reverted in [39140].
Fixes #37661, #34843, #38666.
Props celloexpressions, folletto, westonruter, karmatosed, melchoyce, afercia.


git-svn-id: https://develop.svn.wordpress.org/trunk@41648 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 20:12:19 +00:00
Sergey Biryukov 3edd5dac38 I18N: Use a consistent pattern for translator comments for placeholders in `wp-admin/includes/dashboard.php`.
See #41974.

git-svn-id: https://develop.svn.wordpress.org/trunk@41641 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-29 11:43:27 +00:00
Gary Pendergast f5c4c69bf1 Database: Don't quote placeholders in queries going through `$wpdb->prepare()`
To bring Core into line with the changes to `$wpdb->prepare()` in WordPress 4.8.2, query placeholders shouldn't be quoted.

Props jrf, johnjamesjacoby.
Fixes #41983.



git-svn-id: https://develop.svn.wordpress.org/trunk@41628 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-28 04:31:05 +00:00
Andrea Fercia 3e27644b97 Accessibility: Improve the sidebar toggles in the Widgets screen.
- uses button elements for the toggles
- uses `aria-expanded` on the toggles to communicate to assistive technologies the panels expanded/collapsed state
- adds the "circular focus" style to the toggles to give users a clear indication of the currently focused element
- standardizes CSS class names to `.toggle-indicator` and `.handlediv` as these names are already used across the admin for similar controls

Props monikarao, xavortm, mihai2u, Kopepasah.
Fixes #37013.


git-svn-id: https://develop.svn.wordpress.org/trunk@41621 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 16:28:59 +00:00
John Blackbourn 301ecdabe4 Options, Meta APIs: Require a confirmation link in an email to be clicked when a user attempts to change the network
admin email address on Multisite.

This mirrors the same functionality for the site admin email address and user profile email address.

Fixes #41254


git-svn-id: https://develop.svn.wordpress.org/trunk@41617 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 14:16:21 +00:00
John Blackbourn 1507df9d59 Users: Introduce the concept of a large site in order to speed up the Users screen when there are many users.
Calling the `count_users()` function is expensive, regardless of the counting strategy that's used, and it gets
slower the more users there are on a site. In order to speed up the Users screen in the admin area, calling
`count_users()` can be avoided entirely while still displaying the total count for users.

This introduces some new functions:

* `wp_is_large_user_count()`
* `wp_get_active_user_count()`
* `wp_update_active_user_count()`

A corresponding `wp_is_large_user_count` filter is also introduced.

Props tharsheblows, johnbillion

Fixes #38741


git-svn-id: https://develop.svn.wordpress.org/trunk@41613 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 13:03:03 +00:00
Pascal Birchler 0c1d3f62f3 Upgrade/Install: Fix updating plugins on the Add Plugins screen.
Props imath.
Fixes #41407.


git-svn-id: https://develop.svn.wordpress.org/trunk@41612 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 11:59:01 +00:00
Pascal Birchler 135ca36a69 Upgrade/Install: Show new version number when updating a theme on Multisite.
Props afragen.
Fixes #40764.


git-svn-id: https://develop.svn.wordpress.org/trunk@41611 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 09:43:07 +00:00
Pascal Birchler dfaa7de8fb Plugins: Improve error messages on plugins screen.
This unifies the layout and wording of error messages on both the plugins screen and the themes screen.

Props tinkerbelly, juhise, Ankit K Gupta, m1tk00, swissspidy, mrahmadawais, danieltj.
Fixes #37430.


git-svn-id: https://develop.svn.wordpress.org/trunk@41608 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 08:45:46 +00:00
Dion Hulse 2ff224a044 Standardise on performing api.WordPress.org requests over SSL when possible, falling back to non-SSL when appropriate.
This also standardises the `User-Agent` used when communicating with WordPress.org, allowing for more consistent version detection.

Fixes #42004.


git-svn-id: https://develop.svn.wordpress.org/trunk@41605 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 07:59:14 +00:00
Pascal Birchler f8f263cdb9 Permalinks: Change structure tag button state more reliably.
Changes the highlighted tag buttons accordingly when selecting one of the commong permalink settings.

Deprecates `options_permalink_add_js()` as that JavaScript isn't added inline anymore.

Fixes #29872.


git-svn-id: https://develop.svn.wordpress.org/trunk@41598 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-26 08:23:07 +00:00
Andrew Ozz 27f3b55999 Retire Press This and extract it to a plugin. First run.
Props kraftbj, azaozz.
See #41689.

git-svn-id: https://develop.svn.wordpress.org/trunk@41584 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-24 14:21:42 +00:00
Sergey Biryukov 81551b9e36 Posts, Post Types: Pass `$post` parameter to `post_submitbox_start`, `attachment_submitbox_misc_actions`, `media_submitbox_misc_sections`, `audio_submitbox_misc_sections` filters.
Props sebastian.pisula, SergeyBiryukov.
Fixes #36206.

git-svn-id: https://develop.svn.wordpress.org/trunk@41581 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-23 17:06:40 +00:00
Sergey Biryukov bc23b8840d Quick/Bulk Edit: Remove duplicate `inline-edit-{$screen->post_type}` CSS class from Quick Edit table rows.
Props ibachal.
Fixes #41906.

git-svn-id: https://develop.svn.wordpress.org/trunk@41576 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-23 11:01:45 +00:00
Andrew Ozz 5c14c97f9d Plupload: also delete `plupload.full.min.js` when updating.
See #41755.

git-svn-id: https://develop.svn.wordpress.org/trunk@41571 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 20:47:58 +00:00
Sergey Biryukov 0c66c82b7c Taxonomy: Convert tag cloud in Tags meta box to a list (`<ul>`) for better semantics and accessibility.
An unordered list allows screen reader users to know in advance how many tags are within the list.

Props audrasjb, afercia.
Fixes #40187.

git-svn-id: https://develop.svn.wordpress.org/trunk@41563 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 11:27:44 +00:00
Weston Ruter 8412ff1f44 Plugin Editor: Use `include_once` instead of `include` in `plugin_sandbox_scrape()` to fix unit tests broken with [41560].
See #39766.


git-svn-id: https://develop.svn.wordpress.org/trunk@41561 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 02:00:33 +00:00
Weston Ruter f07591d1fd Plugin Editor: Improve reliability of detecting PHP fatal errors when editing an active plugin.
* Invalidate PHP opcache after file is updated to ensure `include` will ''include'' the written changes.
* Define `WP_ADMIN` when activating plugin in sandbox so plugin code targeting admin will be loaded.
* Do actions that get triggered when loading the admin to ensure plugin code runs that could cause errors on plugin editor screen (and lock out access).
* Fix ability to re-activate a plugin after editing a PHP file other than the main plugin file, and ensure PHP fatal error will be displayed in such cases.
* Consolidate duplicated code into `plugin_sandbox_scrape()` and re-use in `activate_plugin()`.
* Show an error notice instead of a success notice when a file is updated but a plugin was deactivated due to a fatal error.
* Update style of warning when editing an active plugin to be styled as an actual warning notice.

See #12423, #21622.
Fixes #39766.


git-svn-id: https://develop.svn.wordpress.org/trunk@41560 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-22 01:35:09 +00:00
Adam Silverstein e92db998d2 Revisions: correct a timezone display issue.
When preparing the data for the revisions screen, add ' +0000' to the gmt date string before passing it thru `strtotime`.

Props biranit, nacin, buley.
Fixes #25365.


git-svn-id: https://develop.svn.wordpress.org/trunk@41559 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-21 23:32:25 +00:00
Andrew Ozz 8436a4f117 Remove SWFUpload,
- Refactor swfupload.js to output a simple upload form, and handlers.js.
- Delete the SWFUpload plugins directory and swfupload.swf.
- Remove flash cookies "hack" from async-upload.php.

See #41752.

git-svn-id: https://develop.svn.wordpress.org/trunk@41554 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-21 16:34:31 +00:00
John Blackbourn 64e8c4952a Filesystem API: Ensure filenames are valid before attempting to unzip them to ensure malformed file paths don't cause issues.
git-svn-id: https://develop.svn.wordpress.org/trunk@41457 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-19 14:35:09 +00:00
John Blackbourn fa4713e898 General: Add missing URL-encoding and add extra hardening to plugin and template names when they're displayed in the admin area.
Props kawauso, Mte90 for initial patches

Fixes #13377


git-svn-id: https://develop.svn.wordpress.org/trunk@41399 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-19 10:10:35 +00:00
Weston Ruter dbace684e2 Editor: Add CodeMirror-powered code editor with syntax highlighting, linting, and auto-completion.
* Code editor is integrated into the Theme/Plugin Editor, Additional CSS in Customizer, and Custom HTML widget. Code editor is not yet integrated into the post editor, and it may not be until accessibility concerns are addressed.
* The CodeMirror component in the Custom HTML widget is integrated in a similar way to TinyMCE being integrated into the Text widget, adopting the same approach for integrating dynamic JavaScript-initialized fields.
* Linting is performed for JS, CSS, HTML, and JSON via JSHint, CSSLint, HTMLHint, and JSONLint respectively. Linting is not yet supported for PHP.
* When user lacks `unfiltered_html` the capability, the Custom HTML widget will report any Kses-invalid elements and attributes as errors via a custom Kses rule for HTMLHint.
* When linting errors are detected, the user will be prevented from saving the code until the errors are fixed, reducing instances of broken websites.
* The placeholder value is removed from Custom CSS in favor of a fleshed-out section description which now auto-expands when the CSS field is empty. See #39892.
* The CodeMirror library is included as `wp.CodeMirror` to prevent conflicts with any existing `CodeMirror` global.
* An `wp.codeEditor.initialize()` API in JS is provided to convert a `textarea` into CodeMirror, with a `wp_enqueue_code_editor()` function in PHP to manage enqueueing the assets and settings needed to edit a given type of code.
* A user preference is added to manage whether or not "syntax highlighting" is enabled. The feature is opt-out, being enabled by default.
* Allowed file extensions in the theme and plugin editors have been updated to include formats which CodeMirror has modes for: `conf`, `css`, `diff`, `patch`, `html`, `htm`, `http`, `js`, `json`, `jsx`, `less`, `md`, `php`, `phtml`, `php3`, `php4`, `php5`, `php7`, `phps`, `scss`, `sass`, `sh`, `bash`, `sql`, `svg`, `xml`, `yml`, `yaml`, `txt`.

Props westonruter, georgestephanis, obenland, melchoyce, pixolin, mizejewski, michelleweber, afercia, grahamarmfield, samikeijonen, rianrietveld, iseulde.
See #38707.
Fixes #12423, #39892.


git-svn-id: https://develop.svn.wordpress.org/trunk@41376 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-13 06:07:48 +00:00
Weston Ruter 7aa34b77e9 Customize: Re-use homepage settings help tab text from Reading Options admin screen in description for corresponding Customizer section.
Also remove "Static" reference in template name, missed in [41363].

See #41829.


git-svn-id: https://develop.svn.wordpress.org/trunk@41364 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-10 17:07:50 +00:00
Weston Ruter d0dbcf5913 Customize: Rename "Static front page" to just "Homepage".
Props danieltj, melchoyce.
Fixes #41828.


git-svn-id: https://develop.svn.wordpress.org/trunk@41363 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-10 16:19:53 +00:00
Weston Ruter f5c342ce76 Widgets: Add dirty state tracking for widgets on admin screen.
* Mark a widget as dirty when a field input triggers a `change` or `input` event; clear dirty state when widget is successfully saved.
* Disable Save button and re-label "Saved" when widget not dirty.
* Show AYS dialog when leaving widgets admin screen with unsaved changes.
* When widgets are dirty, expand all unsaved widgets at AYS check and focus on first one.
* Change "Close" link to "Done"; hide link when widget is dirty and reveal when saved.
* The "Done" link persistently appears in the Customizer even after making a change (when the widget is dirty) because changes are autosaved into the changeset.
* Prevent saving widget when form fails `checkValidity`.
* Fix frequency of triggering of `change` event on the rich Text widget's `textarea` limited now to when there are actual changes.
* Add a class of `widget-dirty` to widget containers when the widget has unsaved changes.

Props westonruter, timmydcrawford, melchoyce.
Fixes #41610, #23120.


git-svn-id: https://develop.svn.wordpress.org/trunk@41352 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-08 19:10:59 +00:00
Felix Arntz 4705b3f27e Multisite: Use `get_network()` in `populate_network()` to check whether a network with the given ID already exists.
When multisite is setup already, e.g. in a multi network environment, this change gives a performance benefit over the direct SQL query that was previously used. The SQL query remains in place for when setting up multisite initially as the network API is not available at that point.

Props spacedmonkey.
Fixes #41805.


git-svn-id: https://develop.svn.wordpress.org/trunk@41348 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-08 16:32:39 +00:00
John Blackbourn 7f3deb9988 Embeds: Remove support for oEmbedded videos from Vine.
* Vine effectively shut down in December 2016.
* The oEmbed endpoint no longer works and returns a 404.
* Developer documentation for Vine has been removed.

Fixes #41817


git-svn-id: https://develop.svn.wordpress.org/trunk@41347 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-08 15:00:33 +00:00
Andrew Ozz b1d9cac1fc Plupload: remove the reinstated `plupload.js` from the list of old files.
Props afercia.
See #41755.

git-svn-id: https://develop.svn.wordpress.org/trunk@41332 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-04 10:21:33 +00:00
Andrew Ozz 55938f0664 Plupload:
- Update to 2.1.9.
- Include the non-minified plupload.js and moxie.js.
- Remove support for Flash and Silverlight, the available runtime options are `html5` and `html4`.
- Delete plupload.flash.swf and plupload.silverlight.xap.

Fixes #41755.

git-svn-id: https://develop.svn.wordpress.org/trunk@41328 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-01 12:27:49 +00:00
Joe McGill 06329dc35e Media: Ensure 'media_handle_upload()' returns 'WP_Error' on failure.
This fixes an issue where failures when inserting the attachment post via
`wp_insert_attachment()` would result in a return value of `0` instead of a
`WP_Error` object, as documented. This is addressed by passing `true` as the 
fourth param (added in WP 4.7.0) when calling `wp_insert_attachment()`.

Props mrasharirfan, flixos90.
Fixes #41726.


git-svn-id: https://develop.svn.wordpress.org/trunk@41323 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-30 15:03:08 +00:00
Sergey Biryukov 481e055db2 Docs: Correct description for `view_mode_post_types` filter added in [35357].
Props birgire.
Fixes #41730.

git-svn-id: https://develop.svn.wordpress.org/trunk@41317 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-25 19:26:03 +00:00
Ian Dunn a794678af4 Dashboard: Discontinue nonessential logging of Events API requests.
These log entries are only useful when troubleshooting unexpected results from the API, which is not common. The vast majority of users are better served by not having their logs cluttered with noise.

For the rare situations where troubleshooting is necessary, it can be achieved by a plugin (see #41217 for an example).

Props Howdy_McGee, dd32.
Fixes #41217.


git-svn-id: https://develop.svn.wordpress.org/trunk@41316 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-25 18:11:04 +00:00
John Blackbourn 3eff05cb88 Widgets: Correctly strip slashes from widget and sidebar names to allow namespaced widgets to function correctly.
Fixes #27770

Props jdgrimes


git-svn-id: https://develop.svn.wordpress.org/trunk@41292 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 14:51:47 +00:00
John Blackbourn 9990abec14 Plugins: Introduce singular capabilities for activating and deactivating individual plugins.
This introduces the following meta capabilities:

* `activate_plugin`
* `deactivate_plugin`
* `deactivate_plugins`

The singular `activate_plugin` and `deactivate_plugin` capabilities are used along with the corresponding plugin name when
determining whether or not a user can activate or deactivate an individual plugin.

The plural `deactivate_plugins` capability is used in place of the existing `activate_plugins` capability when determining
whether a user can deactivate plugins.

Each of these new meta capabilities map to the existing `activate_plugins` primitive capability, which means there is no
change in existing behaviour, but plugins can now filter the capabilities required to activate and deactivate individual
plugins.

Fixes #38652 


git-svn-id: https://develop.svn.wordpress.org/trunk@41290 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 14:01:36 +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
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 8ceaf1e3a4 Docs: Add a missing return description for the deprecated `get_screen_icon()` function.
See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@41275 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 04:03:55 +00:00
Drew Jaynes 9bf29bd7a0 Administration: Explicitly deprecate `screen_icon()` and `get_screen_icon()`, which were soft-deprecated in [26537] for 3.8.0.
Props ippei-sumida for the initial patch.
Fixes #41153.


git-svn-id: https://develop.svn.wordpress.org/trunk@41274 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 04:02:16 +00:00
John Blackbourn 60a3676581 Media: bring the capability check in `wp_ajax_crop_image()` inline with those in `wp_ajax_imgedit_preview()` and `wp_ajax_image_editor()`.
This change means that a user can crop an image if they have the ability to edit its attachment post, without requiring the ability to access the Customizer.

Fixes #40193


git-svn-id: https://develop.svn.wordpress.org/trunk@41270 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-19 13:29:03 +00:00
Drew Jaynes 0fb490ee1a Filesystem: Introduce the `pre_move_uploaded_file` filter.
Passing a non-null value to the filter will prevent the uploaded file from being moved to the uploads directory for any of the functions leveraging `_wp_handle_upload()`, such as `wp_handle_upload()` or `wp_handle_sideload()`.

Error reporting related to the file being moved will also be skipped.

Props ryan, Mte90.
Fixes #24603.


git-svn-id: https://develop.svn.wordpress.org/trunk@41258 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-16 21:58:12 +00:00
John Blackbourn dad257233c Options, Meta APIs: Require a confirmation link in an email to be clicked when an admin attempts to change the site admin email address.
This adds this previously Multisite-only functionality to single site installations too. This change prevents accidental or erroneous email address changes from potentially locking users out of their site.

Props MatheusGimenez, johnbillion

Fixes #39118


git-svn-id: https://develop.svn.wordpress.org/trunk@41254 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-14 20:12:23 +00:00
John Blackbourn f585095db4 Users: Display the "Your email address has not been updated yet" message when a user changes their profile email address from within network admin.
This ensures continuity with the regular profile editing screen and the user admin profile editing screen.

Fixes #41635


git-svn-id: https://develop.svn.wordpress.org/trunk@41253 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-14 19:41:35 +00:00
Felix Arntz 440c8692e3 Multisite: Remove references to `$wpdb->siteid` and use `get_current_network_id()` instead.
Props sathyapulse, spacedmonkey.
Fixes #41507.


git-svn-id: https://develop.svn.wordpress.org/trunk@41242 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-12 13:10:24 +00:00
Felix Arntz 9595e6c38b Multisite: Rename internal `$site_id` variables referencing networks to `$network_id`.
This change improves code clarity by using the current naming conventions for networks.

Props lemacarl.
Fixes #41510.


git-svn-id: https://develop.svn.wordpress.org/trunk@41241 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-12 12:47:38 +00:00
John Blackbourn db49a16f00 Plugins: Correct and improve docblocks for the various `plugin_action_links` filters on the Plugins screen.
This also adds a changelog for the removal of the Edit links in [41160].

See #41017
Fixes #38169


git-svn-id: https://develop.svn.wordpress.org/trunk@41231 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-04 22:14:37 +00:00
Andrea Fercia babec6d399 Menus: Visually hide the menu item edit link text in a consistent way.
Fixes a visual glitch visible on Ubuntu. WordPress uses system fonts and they have
different metrics across operating systems. Uses screen-reader-text as a more
solid way to visually hide text.

Props punit5658, afercia.
Fixes #41497.


git-svn-id: https://develop.svn.wordpress.org/trunk@41227 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 22:12:01 +00:00
John Blackbourn 17fe24286d General: Fix more instances of inconsistent parameters passed to various filters, plus fix some filter docs.
See #38462, #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41221 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 16:12:25 +00:00
John Blackbourn a3dec5dd51 General: Fix a typo introduced in [41219].
See #38462


git-svn-id: https://develop.svn.wordpress.org/trunk@41220 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 15:45:14 +00:00
John Blackbourn 3aadc71579 General: Fix various instances of incorrect filter docs and incorrect filter and action parameters.
Props keesiemeijer for identifying the issues

See #38462


git-svn-id: https://develop.svn.wordpress.org/trunk@41219 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 15:42:45 +00:00
John Blackbourn 9f180065d6 Docs: Fix various filter documentation.
See #38462, #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41215 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 14:33:19 +00:00
John Blackbourn 9296c9025a Networks and Sites: Display an indicator for the active theme or child theme when viewing a site's themes within Network Admin.
Props palmiak, euthelup

Fixes #41168


git-svn-id: https://develop.svn.wordpress.org/trunk@41214 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 13:49:01 +00:00