Skip to content

Commit 60f2ef7

Browse files
authored
Merge branch 'trunk' into test/64895-change-assertions
2 parents f8c0a26 + d6b0c20 commit 60f2ef7

42 files changed

Lines changed: 582 additions & 121 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.eslintrc-jsdoc.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ module.exports = [
5656
'jsdoc/require-returns-type': 'error',
5757
'jsdoc/check-syntax': 'error',
5858
'jsdoc/require-description': 'error',
59+
'jsdoc/require-jsdoc': 'error',
5960
},
6061
},
6162
];

‎.github/workflows/reusable-phpunit-tests-v3.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ jobs:
154154
phpunit-tests:
155155
name: ${{ ( inputs.phpunit-test-groups || inputs.coverage-report ) && format( 'PHP {0} with ', inputs.php ) || '' }} ${{ 'mariadb' == inputs.db-type && 'MariaDB' || 'MySQL' }} ${{ inputs.db-version }}${{ inputs.multisite && ' multisite' || '' }}${{ inputs.db-innovation && ' (innovation release)' || '' }}${{ inputs.memcached && ' with memcached' || '' }}${{ inputs.report && ' (test reporting enabled)' || '' }} ${{ 'example.org' != inputs.tests-domain && inputs.tests-domain || '' }}
156156
runs-on: ${{ vars.RUNNERS_NAME || inputs.os }}
157-
timeout-minutes: ${{ inputs.coverage-report && 120 || inputs.php == '8.4' && 30 || 20 }}
157+
timeout-minutes: ${{ inputs.coverage-report && 120 || 30 }}
158158
permissions:
159159
contents: read
160160

‎.github/workflows/reusable-prepare-gutenberg.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ jobs:
106106
path: gutenberg/
107107
if-no-files-found: error
108108
include-hidden-files: true
109-
retention-days: 1
109+
retention-days: 7

‎Gruntfile.js‎

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ module.exports = function(grunt) {
154154
]
155155
};
156156

157-
// Load grunt-* tasks.
157+
/**
158+
* Loads the Grunt tasks for the given dependency.
159+
*
160+
* @param {string} dependency The name of the Grunt task to load.
161+
*/
158162
function loadGruntTasks( dependency ) {
159163
var contrib = key === 'contrib' ? 'contrib-' : '';
160164
grunt.loadNpmTasks( 'grunt-' + contrib + dependency );
@@ -1797,6 +1801,11 @@ module.exports = function(grunt) {
17971801
path.dirname( __dirname ) + '/.svn'
17981802
] );
17991803

1804+
/**
1805+
* Searches for the first version control directory in the given set.
1806+
*
1807+
* @param {string[]} set Array of directory paths to check.
1808+
*/
18001809
function find( set ) {
18011810
var dir;
18021811

@@ -1809,6 +1818,9 @@ module.exports = function(grunt) {
18091818
}
18101819
}
18111820

1821+
/**
1822+
* Runs all tasks.
1823+
*/
18121824
function runAllTasks() {
18131825
grunt.log.writeln( 'Cannot determine which files are modified as SVN and GIT are not available.' );
18141826
grunt.log.writeln( 'Running all tasks and all tests.' );
@@ -1824,6 +1836,11 @@ module.exports = function(grunt) {
18241836
done();
18251837
}
18261838

1839+
/**
1840+
* Determines which precommit tasks to run based on modified files detected by version control.
1841+
*
1842+
* @param {string} type The version control type: 'git' or 'svn'.
1843+
*/
18271844
function run( type ) {
18281845
var command = map[ type ].split( ' ' );
18291846

@@ -1833,13 +1850,23 @@ module.exports = function(grunt) {
18331850
}, function( error, result, code ) {
18341851
var taskList = [];
18351852

1836-
// Callback for finding modified paths.
1853+
/**
1854+
* Checks if the given path appears in the version control status output.
1855+
*
1856+
* @param {string} path The path to check.
1857+
* @return {boolean} True if the path is found, false otherwise.
1858+
*/
18371859
function testPath( path ) {
18381860
var regex = new RegExp( ' ' + path + '$', 'm' );
18391861
return regex.test( result.stdout );
18401862
}
18411863

1842-
// Callback for finding modified files by extension.
1864+
/**
1865+
* Checks if files with the given extension appear in the version control status output.
1866+
*
1867+
* @param {string} extension The file extension to check for.
1868+
* @return {boolean} True if the file with the given extension is found, false otherwise.
1869+
*/
18431870
function testExtension( extension ) {
18441871
var regex = new RegExp( '\.' + extension + '$', 'm' );
18451872
return regex.test( result.stdout );

‎src/js/_enqueues/admin/password-toggle.js‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
/**
2+
* @output wp-admin/js/password-toggle.js
3+
*/
4+
15
/**
26
* Adds functionality for password visibility buttons to toggle between text and password input types.
37
*
48
* @since 6.3.0
5-
* @output wp-admin/js/password-toggle.js
69
*/
7-
810
( function () {
911
var toggleElements, status, input, icon, label, __ = wp.i18n.__;
1012

@@ -15,6 +17,9 @@
1517
toggle.addEventListener( 'click', togglePassword );
1618
} );
1719

20+
/**
21+
* Toggles the password input field visibility.
22+
*/
1823
function togglePassword() {
1924
status = this.getAttribute( 'data-toggle' );
2025
input = this.parentElement.children.namedItem( 'pwd' );

‎src/js/_enqueues/admin/plugin-install.js‎

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
/* global tb_click, tb_remove, tb_position */
88

9+
/**
10+
* Initializes the plugin install screens.
11+
*
12+
* @param {JQueryStatic} $ The jQuery object.
13+
*/
914
jQuery( function( $ ) {
1015

1116
var tbWindow,
@@ -78,6 +83,9 @@ jQuery( function( $ ) {
7883
$focusedBefore.trigger( 'focus' );
7984
});
8085

86+
/**
87+
* Initializes the plugin details modal dialog after the iframe has fully loaded.
88+
*/
8189
function iframeLoaded() {
8290
var $iframe = tbWindow.find( '#TB_iframeContent' );
8391

@@ -109,8 +117,9 @@ jQuery( function( $ ) {
109117
});
110118
}
111119

112-
/*
113-
* Get the tabbable elements and detach/attach the keydown event.
120+
/**
121+
* Gets the tabbable elements and detaches/attaches the keydown event.
122+
*
114123
* Called after the iframe has fully loaded so we have all the elements we need.
115124
* Called again each time a Tab gets clicked.
116125
* @todo Consider to implement a WordPress general utility for this and don't use jQuery UI.
@@ -133,7 +142,11 @@ jQuery( function( $ ) {
133142
});
134143
}
135144

136-
// Constrain tabbing within the plugin modal dialog.
145+
/**
146+
* Constrains tabbing within the plugin modal dialog.
147+
*
148+
* @param {JQuery.Event} event The keydown event.
149+
*/
137150
function constrainTabbing( event ) {
138151
if ( 9 !== event.which ) {
139152
return;
@@ -148,11 +161,13 @@ jQuery( function( $ ) {
148161
}
149162
}
150163

151-
/*
152-
* Open the Plugin details modal. The event is delegated to get also the links
153-
* in the plugins search tab, after the Ajax search rebuilds the HTML. It's
154-
* delegated on the closest ancestor and not on the body to avoid conflicts
155-
* with other handlers, see Trac ticket #43082.
164+
/**
165+
* Opens the Plugin details modal.
166+
*
167+
* The event is delegated to get also the links in the plugins search tab,
168+
* after the Ajax search rebuilds the HTML. It's delegated on the closest
169+
* ancestor and not on the body to avoid conflicts with other handlers, see
170+
* Trac ticket #43082.
156171
*/
157172
$( '.wrap' ).on( 'click', '.thickbox.open-plugin-details-modal', function( e ) {
158173
// The `data-title` attribute is used only in the Plugin screens.

‎src/js/_enqueues/admin/privacy-tools.js‎

Lines changed: 73 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,34 @@
11
/**
2-
* Interactions used by the User Privacy tools in WordPress.
3-
*
42
* @output wp-admin/js/privacy-tools.js
53
*/
64

7-
// Privacy request action handling.
5+
/**
6+
* Sets the interactions used by the User Privacy tools in WordPress.
7+
*
8+
* @param {jQueryStatic} $ The jQuery object.
9+
*/
810
jQuery( function( $ ) {
911
var __ = wp.i18n.__,
1012
copiedNoticeTimeout;
1113

14+
/**
15+
* Sets the state of the action.
16+
*
17+
* @param {jQuery} $action The action to set the state for.
18+
* @param {string} state The state to set the action to.
19+
* @return {void}
20+
*/
1221
function setActionState( $action, state ) {
1322
$action.children().addClass( 'hidden' );
1423
$action.children( '.' + state ).removeClass( 'hidden' );
1524
}
1625

26+
/**
27+
* Clears any results row after the request row.
28+
*
29+
* @param {jQuery} $requestRow The request row to clear results for.
30+
* @return {void}
31+
*/
1732
function clearResultsAfterRow( $requestRow ) {
1833
$requestRow.removeClass( 'has-request-results' );
1934

@@ -22,6 +37,15 @@ jQuery( function( $ ) {
2237
}
2338
}
2439

40+
/**
41+
* Appends a results row after the request row.
42+
*
43+
* @param {jQuery} $requestRow The request row to append the results after.
44+
* @param {string} classes The classes to add to the results row.
45+
* @param {string} summaryMessage The summary message to display in the results row.
46+
* @param {string[]} additionalMessages Additional messages to display in the results row.
47+
* @return {void}
48+
*/
2549
function appendResultsAfterRow( $requestRow, classes, summaryMessage, additionalMessages ) {
2650
var itemList = '',
2751
resultRowClasses = 'request-results';
@@ -76,6 +100,12 @@ jQuery( function( $ ) {
76100
clearResultsAfterRow( $requestRow );
77101
setExportProgress( 0 );
78102

103+
/**
104+
* Handles a successful export.
105+
*
106+
* @param {string} zipUrl The URL of the generated ZIP file, if available.
107+
* @return {void}
108+
*/
79109
function onExportDoneSuccess( zipUrl ) {
80110
var summaryMessage = __( 'This user’s personal data export link was sent.' );
81111

@@ -96,6 +126,12 @@ jQuery( function( $ ) {
96126
setTimeout( function() { $rowActions.removeClass( 'processing' ); }, 500 );
97127
}
98128

129+
/**
130+
* Handles an export failure.
131+
*
132+
* @param {string} errorMessage The error message to display.
133+
* @return {void}
134+
*/
99135
function onExportFailure( errorMessage ) {
100136
var summaryMessage = __( 'An error occurred while attempting to export personal data.' );
101137

@@ -108,13 +144,26 @@ jQuery( function( $ ) {
108144
setTimeout( function() { $rowActions.removeClass( 'processing' ); }, 500 );
109145
}
110146

147+
/**
148+
* Updates the progress of the export process.
149+
*
150+
* @param {number} exporterIndex The index of the exporter to process.
151+
* @return {void}
152+
*/
111153
function setExportProgress( exporterIndex ) {
112154
var progress = ( exportersCount > 0 ? exporterIndex / exportersCount : 0 ),
113155
progressString = Math.round( progress * 100 ).toString() + '%';
114156

115157
$progress.html( progressString );
116158
}
117159

160+
/**
161+
* Performs the next export request.
162+
*
163+
* @param {number} exporterIndex The index of the exporter to process.
164+
* @param {number} pageIndex The index of the page to process for the current exporter.
165+
* @return {void}
166+
*/
118167
function doNextExport( exporterIndex, pageIndex ) {
119168
$.ajax(
120169
{
@@ -181,6 +230,11 @@ jQuery( function( $ ) {
181230
clearResultsAfterRow( $requestRow );
182231
setErasureProgress( 0 );
183232

233+
/**
234+
* Handles a successful erasure.
235+
*
236+
* @return {void}
237+
*/
184238
function onErasureDoneSuccess() {
185239
var summaryMessage = __( 'No personal data was found for this user.' ),
186240
classes = 'notice-success';
@@ -207,6 +261,9 @@ jQuery( function( $ ) {
207261
setTimeout( function() { $rowActions.removeClass( 'processing' ); }, 500 );
208262
}
209263

264+
/**
265+
* Handles an erasure failure.
266+
*/
210267
function onErasureFailure() {
211268
var summaryMessage = __( 'An error occurred while attempting to find and erase personal data.' );
212269

@@ -217,13 +274,26 @@ jQuery( function( $ ) {
217274
setTimeout( function() { $rowActions.removeClass( 'processing' ); }, 500 );
218275
}
219276

277+
/**
278+
* Updates the progress of the erasure process.
279+
*
280+
* @param {number} eraserIndex The index of the eraser to process.
281+
* @return {void}
282+
*/
220283
function setErasureProgress( eraserIndex ) {
221284
var progress = ( erasersCount > 0 ? eraserIndex / erasersCount : 0 ),
222285
progressString = Math.round( progress * 100 ).toString() + '%';
223286

224287
$progress.html( progressString );
225288
}
226289

290+
/**
291+
* Performs the next erasure request.
292+
*
293+
* @param {number} eraserIndex The index of the eraser to process.
294+
* @param {number} pageIndex The index of the page to process for the current eraser.
295+
* @return {void}
296+
*/
227297
function doNextErasure( eraserIndex, pageIndex ) {
228298
$.ajax({
229299
url: window.ajaxurl,

‎src/js/_enqueues/admin/site-health.js‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
/**
2-
* Interactions used by the Site Health modules in WordPress.
3-
*
42
* @output wp-admin/js/site-health.js
53
*/
64

75
/* global ajaxurl, ClipboardJS, SiteHealth, wp */
86

7+
/**
8+
* Handles the interactions used by the Site Health modules in WordPress.
9+
*
10+
* @param {JQueryStatic} $ The jQuery object.
11+
*/
912
jQuery( function( $ ) {
1013

1114
var __ = wp.i18n.__,
@@ -393,6 +396,9 @@ jQuery( function( $ ) {
393396
}
394397
}
395398

399+
/**
400+
* Get the sizes of the directories in the Site Health Info section.
401+
*/
396402
function getDirectorySizes() {
397403
var timestamp = ( new Date().getTime() );
398404

@@ -434,6 +440,11 @@ jQuery( function( $ ) {
434440
} );
435441
}
436442

443+
/**
444+
* Updates the directory sizes in the Site Health Info section.
445+
*
446+
* @param {Object} data The directory sizes data.
447+
*/
437448
function updateDirSizes( data ) {
438449
var copyButton = $( 'button.button.copy-button' );
439450
var clipboardText = copyButton.attr( 'data-clipboard-text' );

0 commit comments

Comments
 (0)