'
45 | . sprintf(
46 | /* translators: 1: link to backing up database, 2: link to make.wp.org/core, 3: link to beta support forum */
47 | __( 'By their nature, these releases are unstable and should not be used any place where your data is important. So please back up your database before upgrading to a test release. In order to hear about the latest beta releases, your best bet is to watch the development blog and the beta forum.', 'wordpress-beta-tester' ),
48 | _x( 'https://wordpress.org/support/article/wordpress-backups/', 'URL to database backup instructions on HelpHub', 'wordpress-beta-tester' ),
49 | 'https://make.wordpress.org/core/',
50 | _x( 'https://wordpress.org/support/forum/alphabeta', 'URL to beta support forum', 'wordpress-beta-tester' )
51 | ) . '
'
60 | . __( 'You must select either the Point release or Bleeding edge channel. Then select the Beta/RC Only or Release Candidates Only stream. Once saved you will only see an update notice when the next release, RC, or beta is available.', 'wordpress-beta-tester' ) . '
'
61 | . __( 'Point release channel only has the Nightlies stream available at this time.', 'wordpress-beta-tester' ) . '
' . __( 'A dashboard widget is displayed when the plugin is active. It will contain links to milestone commits and filing a bug report. It may contain links to Dev Notes, the Field Guide, and beta/RC release posts.', 'wordpress-beta-tester' ) . '
Please note: Once you have switched your website to one of these beta versions of software, it will not always be possible to downgrade as the database structure may be updated during the development of a major release.', 'wordpress-beta-tester' ) ); ?>
289 |
290 | ';
303 | }
304 |
305 | /**
306 | * Sanitize each setting field as needed.
307 | *
308 | * @param array $input Contains all settings fields as array keys.
309 | *
310 | * @return array
311 | */
312 | public static function sanitize( $input ) {
313 | $new_input = array();
314 | if ( ! is_array( $input ) ) {
315 | $new_input = sanitize_text_field( $input );
316 | } else {
317 | foreach ( array_keys( (array) $input ) as $id ) {
318 | $new_input[ sanitize_text_field( $id ) ] = sanitize_text_field( $input[ $id ] );
319 | }
320 | }
321 |
322 | return $new_input;
323 | }
324 |
325 | /**
326 | * Get the settings option array and print one of its values.
327 | *
328 | * @param array $args 'id' and 'title'.
329 | */
330 | public static function checkbox_setting( $args ) {
331 | $checked = isset( self::$options[ $args['id'] ] ) ? self::$options[ $args['id'] ] : null;
332 | ?>
333 |
334 |
343 | 5.6
205 | * allows for overrides when using the `WP_AUTO_UPDATE_CORE` constant
206 | * update on-screen help
207 |
208 | #### 2.2.13 / 2020-09-05
209 | * enclose `WPConfigTransformer` in try/catch
210 |
211 | #### 2.2.12 / 2020-08-10
212 | * fix intermittent PHP warning [#21](https://github.com/afragen/wordpress-beta-tester/issues/21)
213 | * deactivate and die if user attempting to run with `wordpress-develop`
214 |
215 | #### 2.2.11 / 2020-08-01
216 | * minor cleanup
217 |
218 | #### 2.2.10 / 2020-05-01
219 | * sanitize, escape & ignore
220 | * move multiline boolean operator to front of line, new guidelines in WPCS
221 | * fix `correct_versions_for_downgrade()` for being on current release version
222 |
223 | #### 2.2.9 / 2020-03-24
224 | * delete development RSS feed transient after core upgrade
225 |
226 | #### 2.2.8 / 2020-03-17 🍀
227 | * add Dev Notes and Field Guide links to dashboard
228 | * add text/link for bug reporting to trac
229 | * add help tabs to screen
230 | * arbitrarily changed settings page id from `wp_beta_tester` to `wp-beta-tester` 😏
231 |
232 | #### 2.2.7 / 2020-03-02
233 | * update trac link in callout for _closed_ or _reopened_ tickets on the milestone
234 | * only show Beta Tester Settings page link in callout with appropriate privileges, using `manage_network_options` and `manage_options`
235 | * menu to Settings page also checks privileges as above
236 |
237 | #### 2.2.6 / 2020-02-25
238 | * removed extra `` in dashboard callout, 4th time's the charm 😭
239 |
240 | #### 2.2.5 / 2020-02-25
241 | * less greedy regex for matching release posts in RSS for dashboard callout
242 |
243 | #### 2.2.4 / 2020-02-25 🤦♂️
244 | * added dashboard widget for network dashboard
245 |
246 | #### 2.2.3 / 2020-02-25
247 | * add dashboard widget callout for testing
248 |
249 | #### 2.2.2 / 2020-02-22
250 | * fix for strange Core API response where preferred version response contained the word 'version'. We now grab the last word of that response
251 |
252 | #### 2.2.1 / 2020-02-20
253 | * fix some i18n strings, thanks @pedro-mendonca
254 |
255 | #### 2.2.0 / 2020-02-19
256 | * added support for updating to the _beta/RC offer_. Based on and with tons of help from @pbrion, thanks Paul 👏🏻
257 | * fixed so a downgrade from 'unstable' to 'point' serves the correct download
258 | * test and exit from **Extra Settings** if `wp-config.php` is not writeable
259 |
260 | #### 2.1.0 / 2019-09-17
261 | * add extra setting to skip successful autoupdate emails
262 | * add description to checkbox settings
263 | * composer update
264 |
265 | #### 2.0.4
266 | * add update version information to settings page text
267 |
268 | #### 2.0.3
269 | * a11y fixes for settings tabs
270 | * update `wp-cli/wp-config-transformer`
271 |
272 | #### 2.0.2
273 | * a11y fixes for checkbox, thanks @audrasjb
274 |
275 | #### 2.0.1
276 | * fix for incorrect last updated message
277 |
278 | #### 2.0.0
279 | * near complete re-write to use more OOPy practices
280 | * put distinct process into separate classes
281 | * allows for multiple settings tabs for addtional settings
282 |
283 | #### 1.2.6
284 | * remove extraneous code
285 | * add GitHub Plugin URI header
286 |
287 | #### 1.2.5
288 | * fixed error message for downgrading version, thanks @andreas-andersson
289 |
290 | #### 1.2.4
291 | * don't use $GLOBALS
292 |
293 | #### 1.2.3
294 | * updated a few strings and correct typos
295 | * run through WPCS linter
296 | * fixed translation strings to include HTML in context and properly escape with `wp_kses_post()`
297 | * fixed link to settings page under Multisite
298 |
299 | #### 1.2.2
300 | * change wording from blog to website
301 |
302 | #### 1.2.0
303 | * Escape output
304 | * Indicate that _Bleeding edge nightlies_ are _trunk_
305 | * new screenshot
306 | * code improvements from linter
307 |
308 | #### 1.1.2
309 | * Remove anonymous function for PHP 5.2 compatibility.
310 |
311 | #### 1.1.1
312 | * fixed PHP notice for PHP 7.1
313 | * made URL scheme agnostic
314 |
315 | #### 1.1.0
316 | * Fixed to work properly under Multisite.
317 |
318 | #### 1.0.2
319 | * Update tested up to version to 4.7.
320 | * Fix the location of the settings screen in Multisite (moved under Settings in Network Admin).
321 | * Minor text fixes.
322 |
323 | #### 1.0.1
324 | * Update tested up to version to 4.5.
325 | * Fix PHP7 deprecated constructor notice.
326 | * Change text domain to match the plugin slug.
327 | * Update WordPress.org links to use HTTPS.
328 | * Remove outdated bundled translations in favor of language packs.
329 |
330 | #### 1.0
331 | * Update tested up to version to 4.2.
332 | * Update screenshot.
333 | * Fix a couple typos.
334 |
--------------------------------------------------------------------------------
/readme.txt:
--------------------------------------------------------------------------------
1 | # WordPress Beta Tester
2 |
3 | Tags: beta, advanced, testing
4 | Contributors: afragen, costdev, pbiron, mlteal, westi
5 | License: GPLv2
6 | License URI: https://www.opensource.org/licenses/GPL-2.0
7 | Requires at least: 4.9
8 | Requires PHP: 5.6
9 | Tested up to: 6.9
10 | Stable Tag: 4.0.0
11 |
12 | Allows you to easily upgrade for testing the next versions of WordPress.
13 |
14 | ## Description
15 | This plugin provides an easy way to get involved with beta testing WordPress.
16 |
17 | Once installed it will enable you to upgrade your website to the latest Nightly, Beta, or Release Candidate at the click of a button using the built in upgrader.
18 |
19 | By default once enabled it switches your website onto the point release update channel.
20 |
21 | For the more adventurous there is the option to switch to the bleeding edge (trunk) of development.
22 |
23 | Don't forget to backup before you start!
24 |
25 | Please enable auto-updates for this plugin to ensure future changes are properly handled with core updates.
26 |
27 | ### Extra Settings
28 |
29 | There is a setting to **Skip successful autoupdate emails**. It functions to disable sending emails to the admin user for successful autoupdates. Only emails indicating failures of the autoupdate process are sent.
30 |
31 | There is a setting to **Skip bundled plugins and themes**. It functions to disable the installation of any plugins or themes that are bundled with the Core update.
32 |
33 |
34 | PRs are welcome on [GitHub](https://github.com/afragen/wordpress-beta-tester).
35 |
36 | ## Changelog
37 |
38 | #### 4.0.0 / 2025-11-07
39 | * refactor to use `core_version_check_query_args` filter for simplicity and compatibility
40 | * remove checks on `WP_AUTO_UPDATE_CORE`
41 | * update to require WordPress 4.9
42 |
43 | #### 3.6.4 / 2025-07-10
44 | * update readme
45 | * fixed incorrect path to `delete_plugins()`
46 | * check for `require_filesystem_credentials()` as missing during update.
47 |
48 | #### 3.6.3 / 2025-03-25
49 | * update workflow
50 | * add extra setting to remove auto-installed plugin(s)
51 |
52 | #### 3.6.2 / 2024-12-02
53 | * Plugin Check and i18n updates
54 |
55 | #### 3.6.1 / 2024-10-23
56 | * fix if `get_preferred_from_update_core()` continues to return less than a complete response
57 |
58 | #### 3.6.0 / 2024-10-09
59 | * remove Report a Bug in favor of using the standalone Test Reports plugin
60 |
61 | #### 3.5.6 / 2024-07-06
62 | * string update
63 | * no need to skip debug email
64 |
65 | #### 3.5.5 / 2023-10-19
66 | * add `Settings` to action links, thanks @0aveRyan
67 |
68 | #### 3.5.4 / 2023-09-09
69 | * use `automatic_updates_send_debug_email` filter to turn off sending debug email
70 | * `mysql_get_client_info()` no longer in PHP 7.0, switch to `mysqli_get_client_info()`
71 | * make anonymous functions static
72 |
73 | #### 3.5.3 / 2023-08-10
74 | * update for changed standalone afragen/test-reports plugin
75 | * set actual next beta/RC in messaging
76 |
77 | #### 3.5.2 / 2023-07-12
78 | * fix dev-notes URL
79 |
80 | #### 3.5.1 / 2023-07-06
81 | * add setting in `Extra Settings` to hide `Report a Bug`
82 | * add filter `wpbt_hide_report_a_bug`
83 | * update if `Report a Bug` plugin active
84 | * link to settings if `Report a Bug` is hidden
85 | * update for latest WP API responses, thanks @dd32
86 |
87 | #### 3.5.0 / 2023-06-30
88 | * update dashboard widget for MarComm publishing of posts
89 | * update to correctly identify Opera browser in `Report a Bug`
90 | * update API query when channel set to beta or RC and version is non-current
91 | * fix `WP_Beta_Tester::switch_update_offer()` to correctly display 'Update' or 'Re-install' buttons on update-core.php
92 | * remove unused item from **Extra Settings** tab
93 |
94 | #### 3.4.1 / 2023-05-26
95 | * **Report a Bug** only for logged in users
96 |
97 | #### 3.4.0 / 2023-05-21
98 | * update to point release if set for development beta/rc and new point release occurs
99 |
100 | #### 3.3.8 / 2023-05-18
101 | * update composer.json
102 | * update GitHub Actions
103 | * update to correctly return 'upgrade' or 'latest' offer when set to 'beta' or 'rc' stream
104 |
105 | #### 3.3.7 / 2023-03-28
106 | * better fix for spacing of bug report copy
107 | * `Report a Bug`: update database data for SQLite
108 |
109 | #### 3.3.6 / 2023-02-25
110 | * fix spacing of bug report copy
111 |
112 | #### 3.3.5 / 2023-02-22
113 | * updated dashboard widget with some better dynamic information
114 | * `Report a Bug`: introduce search button
115 | * updated strings
116 | * `Report a Bug`: Truncate the value of mysqli::$client_info
117 |
118 | #### 3.3.4 / 2023-03-20
119 | * PHP 5.6 and `EOD`, why we can't have nice looking code in the editor
120 |
121 | #### 3.3.3 / 2023-03-20
122 | * add an icon 🐞
123 | * improved environment data and display
124 | * improve clipboard text for insertion
125 | * lots of other stuff for Colin to do
126 |
127 | #### 3.3.2 / 2023-03-17 🇮🇪☘️
128 | * more fixes for 'Report a Bug'
129 | * updated/added strings
130 | * some developery stuff
131 |
132 | #### 3.3.1 / 2023-03-17 ☘️
133 | * update readme
134 | * sort listed plugins in 'Report a Bug'
135 | * add mu-plugins in 'Report a Bug'
136 | * fix for multisite
137 | * initiate plugin in `plugins_loaded`
138 |
139 | #### 3.3.0 / 2023-03-16
140 | * added `Report a Bug` feature, thanks @costdev, @ironprogrammer
141 |
142 | #### 3.2.9 / 2023-02-27
143 | * mitigate some issues/possible issues with PHP 8.1/8.2
144 |
145 | #### 3.2.8 / 2023-02-07
146 | * Composer 2.5.2 is fixed.
147 |
148 | #### 3.2.7 / 2023-02-07
149 | * revert to Composer v2.2.x locally for autoloader compatibility
150 |
151 | #### 3.2.6 / 2023-01-30
152 | * revert to Composer v2.5.0 as v2.5.1 has bug causing fatal, fixed in next version of Composer
153 |
154 | #### 3.2.5 / 2023-01-29
155 | * added auto display relative fields immediately bleeding edge option is selected, thanks @Preciousomonze
156 | * fixes for PHP8.1
157 |
158 | #### 3.2.4 / 2022-11-07
159 | * return empty array for 8.1 compatibility
160 |
161 | #### 3.2.3 / 2022-09-29
162 | * update for PHP 8.1 compatibility
163 |
164 | #### 3.2.2 / 2022-06-23
165 | * correctly use `sanitize_url()` and `esc_url()`
166 | * fix `WP_Config_Transformer` to get anchor if wp-config.php has been modified
167 |
168 | #### 3.2.1 / 2022-04-13
169 | * update composer to work with PHP 5.6
170 |
171 | #### 3.2.0 / 2022-04-12
172 | * use `sanitize_key()` for nonces
173 | * fix for transition from WP x.9 to WP x.0 to display correct next versions
174 |
175 | #### 3.1.5 / 2022-01-28
176 | * use `sanitize_title_with_dashes()` as `sanitize_file_name()` maybe have attached filter that changes output
177 | * fix variable docblocks
178 | * update nonce checks
179 |
180 | #### 3.1.4 / 2021-09-24 **Hotfix**
181 | * don't load `pluggable.php` for `wp_create_nonce()`, load in `plugins_loaded` hook
182 |
183 | #### 3.1.3 / 2021-09-23
184 | * nonce, escape, and sanitize all the things
185 |
186 | #### 3.1.2 / 2021-09-04
187 | * only use `esc_attr_e` for translating strings
188 |
189 | #### 3.1.1 / 2021-07-11
190 | * add @10up GitHub Actions WordPress SVN integration
191 | * update Codex links for HelpHub links @audrasjb
192 |
193 | #### 3.1.0 / 2021-02-08
194 | * update for working correctly if new `WP_AUTO_UPDATE_CORE` constant is used.
195 | * update `WP_Beta_Tester::channel_switching_modification()` to update past current release if appropriate
196 | * tweak next versions when coming from point release to bleeding edge
197 |
198 | #### 3.0.10 / 2021-01-11
199 | * re-write `WP_Beta_Tester::get_current_wp_release()` to check https://api.wordpress.org/core/stable-check/1.0/
200 | * fix `WPBT_Core::get_next_versions()` if user on current release
201 | * tweak `WP_Beta_Tester::channel_switching_modification()` to work correctly with $wp_version <= $current_release and if on current release
202 |
203 | #### 3.0.9 / 2020-12-01
204 | * add conditional for filter to fix `core_update_footer()`, fixed in [r49708](https://core.trac.wordpress.org/changeset/49708)
205 | * simplify some `preg_match()` calls
206 | * fix PHP warning
207 |
208 | #### 3.0.8 / 2020-11-28
209 | * fix some PHP errors when using older versions of WP, for testing updates directly from these older versions like when using Core Rollback plugin
210 |
211 | #### 3.0.7 / 2020-11-24
212 | * tweak to `channel_switching_modification()`
213 |
214 | #### 3.0.6 / 2020-11-21
215 | * improved flow between _Bleeding edge_ and _Point release_
216 |
217 | #### 3.0.5 / 2020-11-18
218 | * don't show beta as a next version when on RC
219 |
220 | #### 3.0.4 / 2020-11-17
221 | * fix to correctly downgrade from _Bleeding edge_ to _Point release nightlies_.
222 | * hide stream options other than _Nightlies_ for _Point release_ channel until [new Updates API changes](https://meta.trac.wordpress.org/ticket/5511)
223 | * add settings for future Updates API above
224 | * added `channel_settings_migrator()` for switching between `Bleeding edge` and `Point release` channels
225 |
226 | #### 3.0.1 - 3.0.3 / 2020-10-27
227 | * fixed regex to get next versions
228 | * really didn't need to use `ReflectionClass` 🤦♂️, thanks @pbiron
229 | * use `ReflectionClass` to get static variable `$core_update_constant` from `class WP_Beta_Tester` into `class WPBT_Core`
230 |
231 | #### 3.0.0 / 2020-10-23
232 | * major refactor for new core update API, thanks @dd32!
233 | * now requires PHP >5.6
234 | * allows for overrides when using the `WP_AUTO_UPDATE_CORE` constant
235 | * update on-screen help
236 |
237 | #### 2.2.13 / 2020-09-05
238 | * enclose `WPConfigTransformer` in try/catch
239 |
240 | #### 2.2.12 / 2020-08-10
241 | * fix intermittent PHP warning [#21](https://github.com/afragen/wordpress-beta-tester/issues/21)
242 | * deactivate and die if user attempting to run with `wordpress-develop`
243 |
244 | #### 2.2.11 / 2020-08-01
245 | * minor cleanup
246 |
247 | #### 2.2.10 / 2020-05-01
248 | * sanitize, escape & ignore
249 | * move multiline boolean operator to front of line, new guidelines in WPCS
250 | * fix `correct_versions_for_downgrade()` for being on current release version
251 |
252 | #### 2.2.9 / 2020-03-24
253 | * delete development RSS feed transient after core upgrade
254 |
255 | #### 2.2.8 / 2020-03-17 🍀
256 | * add Dev Notes and Field Guide links to dashboard
257 | * add text/link for bug reporting to trac
258 | * add help tabs to screen
259 | * arbitrarily changed settings page id from `wp_beta_tester` to `wp-beta-tester` 😏
260 |
261 | #### 2.2.7 / 2020-03-02
262 | * update trac link in callout for _closed_ or _reopened_ tickets on the milestone
263 | * only show Beta Tester Settings page link in callout with appropriate privileges, using `manage_network_options` and `manage_options`
264 | * menu to Settings page also checks privileges as above
265 |
266 | #### 2.2.6 / 2020-02-25
267 | * removed extra `` in dashboard callout, 4th time's the charm 😭
268 |
269 | #### 2.2.5 / 2020-02-25
270 | * less greedy regex for matching release posts in RSS for dashboard callout
271 |
272 | #### 2.2.4 / 2020-02-25 🤦♂️
273 | * added dashboard widget for network dashboard
274 |
275 | #### 2.2.3 / 2020-02-25
276 | * add dashboard widget callout for testing
277 |
278 | #### 2.2.2 / 2020-02-22
279 | * fix for strange Core API response where preferred version response contained the word 'version'. We now grab the last word of that response
280 |
281 | #### 2.2.1 / 2020-02-20
282 | * fix some i18n strings, thanks @pedro-mendonca
283 |
284 | #### 2.2.0 / 2020-02-19
285 | * added support for updating to the _beta/RC offer_. Based on and with tons of help from @pbrion, thanks Paul 👏🏻
286 | * fixed so a downgrade from 'unstable' to 'point' serves the correct download
287 | * test and exit from **Extra Settings** if `wp-config.php` is not writeable
288 |
289 | #### 2.1.0 / 2019-09-17
290 | * add extra setting to skip successful autoupdate emails
291 | * add description to checkbox settings
292 | * composer update
293 |
294 | #### 2.0.4
295 | * add update version information to settings page text
296 |
297 | #### 2.0.3
298 | * a11y fixes for settings tabs
299 | * update `wp-cli/wp-config-transformer`
300 |
301 | #### 2.0.2
302 | * a11y fixes for checkbox, thanks @audrasjb
303 |
304 | #### 2.0.1
305 | * fix for incorrect last updated message
306 |
307 | #### 2.0.0
308 | * near complete re-write to use more OOPy practices
309 | * put distinct process into separate classes
310 | * allows for multiple settings tabs for addtional settings
311 |
312 | #### 1.2.6
313 | * remove extraneous code
314 | * add GitHub Plugin URI header
315 |
316 | #### 1.2.5
317 | * fixed error message for downgrading version, thanks @andreas-andersson
318 |
319 | #### 1.2.4
320 | * don't use $GLOBALS
321 |
322 | #### 1.2.3
323 | * updated a few strings and correct typos
324 | * run through WPCS linter
325 | * fixed translation strings to include HTML in context and properly escape with `wp_kses_post()`
326 | * fixed link to settings page under Multisite
327 |
328 | #### 1.2.2
329 | * change wording from blog to website
330 |
331 | #### 1.2.0
332 | * Escape output
333 | * Indicate that _Bleeding edge nightlies_ are _trunk_
334 | * new screenshot
335 | * code improvements from linter
336 |
337 | #### 1.1.2
338 | * Remove anonymous function for PHP 5.2 compatibility.
339 |
340 | #### 1.1.1
341 | * fixed PHP notice for PHP 7.1
342 | * made URL scheme agnostic
343 |
344 | #### 1.1.0
345 | * Fixed to work properly under Multisite.
346 |
347 | #### 1.0.2
348 | * Update tested up to version to 4.7.
349 | * Fix the location of the settings screen in Multisite (moved under Settings in Network Admin).
350 | * Minor text fixes.
351 |
352 | #### 1.0.1
353 | * Update tested up to version to 4.5.
354 | * Fix PHP7 deprecated constructor notice.
355 | * Change text domain to match the plugin slug.
356 | * Update WordPress.org links to use HTTPS.
357 | * Remove outdated bundled translations in favor of language packs.
358 |
359 | #### 1.0
360 | * Update tested up to version to 4.2.
361 | * Update screenshot.
362 | * Fix a couple typos.
363 |
364 | #### See old-changelog.txt for previous changelog items
365 |
366 | ## Installation
367 |
368 | 1. Upload to your plugins folder, usually `wp-content/plugins/`
369 | 2. Activate the plugin on the plugin screen.
370 | 3. Navigate to Tools ... Beta Testing to configure the plugin.
371 | 4. Under Mulitsite, navigate to Settings ... Beta Testing to configure the plugin.
372 | 5. Visit Dashboard ... Upgrade (Or Tools ... Upgrade in versions before 3.0) and update to the latest Beta Release.
373 |
374 | ## Screenshots
375 |
376 | 1. Main Settings page
377 | 2. Extra Settings page
378 | 3. Dashboard widget
379 |
--------------------------------------------------------------------------------
/src/WPBT/WP_Beta_Tester.php:
--------------------------------------------------------------------------------
1 | file = $file;
38 | self::$options = $options;
39 | }
40 |
41 | /**
42 | * Rev up the engines.
43 | *
44 | * @return void
45 | */
46 | public function run() {
47 | $this->load_hooks();
48 | ( new WPBT_Settings( $this, self::$options ) )->run();
49 | }
50 |
51 | /**
52 | * Load hooks.
53 | *
54 | * @return void
55 | */
56 | protected function load_hooks() {
57 | add_action(
58 | 'update_option_wp_beta_tester_stream',
59 | array(
60 | $this,
61 | 'action_update_option_wp_beta_tester_stream',
62 | )
63 | );
64 |
65 | // Set channel query arg for core version check.
66 | add_filter( 'core_version_check_query_args', array( $this, 'set_core_update_channel_constant' ), 10, 1 );
67 |
68 | /* // phpcs:ignore Squiz.PHP.CommentedOutCode.Found
69 | * For testing pretend we're on another release.
70 | * $url = add_query_arg( 'pretend_releases', array( '5.6-beta2' ), $url );
71 | add_filter(
72 | 'core_version_check_query_args',
73 | function ( $query_args ) {
74 | return array_merge( $query_args, array( 'pretend_releases' => array( '5.6-beta2' ) ) );
75 | },
76 | 10,
77 | 1
78 | );
79 | */
80 |
81 | // Fixed in https://core.trac.wordpress.org/changeset/49708.
82 | if ( version_compare( get_bloginfo( 'version' ), '5.6-RC1-49708', '<=' )
83 | && preg_match( '/alpha|beta|RC/', get_bloginfo( 'version' ) )
84 | ) {
85 | // set priority to 11 so that we fire after the function core hooks into this filter.
86 | add_filter( 'update_footer', array( $this, 'update_footer' ), 11 );
87 | }
88 |
89 | // Add dashboard widget.
90 | add_action( 'wp_dashboard_setup', array( $this, 'add_dashboard_widget' ) );
91 | add_action( 'wp_network_dashboard_setup', array( $this, 'add_dashboard_widget' ) );
92 |
93 | // Delete development RSS feed transient for dashboard widget on core upgrade.
94 | add_action( 'upgrader_process_complete', array( $this, 'delete_feed_transient_on_upgrade' ), 10, 2 );
95 | }
96 |
97 | /**
98 | * Check and display notice if 'update' really downgrade.
99 | *
100 | * @return void
101 | */
102 | public function action_admin_head_plugins_php() {
103 | // Workaround the check throttling in wp_version_check().
104 | $st = get_site_transient( 'update_core' );
105 | if ( is_object( $st ) ) {
106 | $st->last_checked = 0;
107 | set_site_transient( 'update_core', $st );
108 | }
109 | wp_version_check();
110 |
111 | // Can output an error here if current config drives version backwards.
112 | if ( $this->check_if_settings_downgrade() ) {
113 | echo '
';
157 | printf(
158 | /* translators: 1: link to backing up database, 2: link to make.wp.org/core, 3: link to beta support forum */
159 | wp_kses_post( __( 'By their nature, these releases are unstable and should not be used anyplace where your data is important. So please back up your database before upgrading to a test release. In order to hear about the latest beta releases, your best bet is to watch the development blog and the beta forum.', 'wordpress-beta-tester' ) ),
160 | esc_url( _x( 'https://wordpress.org/support/article/wordpress-backups/', 'URL to database backup instructions on HelpHub', 'wordpress-beta-tester' ) ),
161 | 'https://make.wordpress.org/core/',
162 | esc_url( _x( 'https://wordpress.org/support/forum/alphabeta', 'URL to beta support forum', 'wordpress-beta-tester' ) )
163 | );
164 | echo '
';
165 | printf(
166 | /* translators: %s: link to new trac ticket */
167 | wp_kses_post( __( 'Thank you for helping test WordPress. Please report any bugs you find.', 'wordpress-beta-tester' ) ),
168 | 'https://core.trac.wordpress.org/newticket'
169 | );
170 | echo '
';
171 | echo wp_kses_post( __( 'By default, your WordPress installation uses the stable update channel. To return to this, please deactivate this plugin and re-install from the WordPress Updates page.', 'wordpress-beta-tester' ) );
172 | echo '
';
173 | printf(
174 | /* translators: %s: update version */
175 | wp_kses_post( __( 'Currently your site is set to update to %s.', 'wordpress-beta-tester' ) ),
176 | '' . esc_attr( $version ) . ''
177 | );
178 | echo '