Skip to content

Commit c2c0169

Browse files
docs: normalize phpdoc since tags across admin and health modules (#228)
## Summary - convert remaining @Version annotations to @SInCE across general, process, multisite admin, and Site Health helpers - add missing @SInCE tags to the sanitization helpers and Site Health software checks so every function documents its introduction ## Testing - vendor/bin/phpcs *(fails: Referenced sniff "PHPCompatibilityWP" does not exist.)* - vendor/bin/phpstan analyse --memory-limit=1G *(fails: At least one path must be specified to analyse.)* - vendor/bin/phpunit *(fails: Missing /tmp/wordpress-tests-lib setup)* ------ https://chatgpt.com/codex/tasks/task_b_6904628a05848321994e7e8b82310c1a
2 parents b021796 + 4183d66 commit c2c0169

File tree

5 files changed

+94
-31
lines changed

5 files changed

+94
-31
lines changed

wpvulnerability-admin.php

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,16 @@ function wpvulnerability_render_admin_tab_logs() {
422422
<?php endif; ?>
423423
</div>
424424
</section>
425-
<?php
425+
<?php
426426
}
427+
428+
/**
429+
* Outputs the Tools tab contents.
430+
*
431+
* @since 4.1.2
432+
*
433+
* @return void
434+
*/
427435
function wpvulnerability_render_admin_tab_tools() {
428436
$tools_action = add_query_arg(
429437
array(
@@ -813,10 +821,17 @@ function wpvulnerability_render_admin_tab_about() {
813821
?>
814822
</div>
815823
</section>
816-
<?php
817-
}
818-
819-
function wpvulnerability_create_admin_page() {
824+
<?php
825+
}
826+
827+
/**
828+
* Renders the plugin settings page in the WordPress admin area.
829+
*
830+
* @since 2.0.0
831+
*
832+
* @return void
833+
*/
834+
function wpvulnerability_create_admin_page() {
820835

821836
$wpvulnerability_settings = get_option( 'wpvulnerability-config' );
822837
?>
@@ -905,10 +920,17 @@ class="wpvulnerability-tab-panel is-active"
905920
</div>
906921
</div>
907922
</div>
908-
<?php
909-
}
910-
911-
function wpvulnerability_admin_menu() {
923+
<?php
924+
}
925+
926+
/**
927+
* Registers the WPVulnerability settings page within the Settings menu.
928+
*
929+
* @since 2.0.0
930+
*
931+
* @return void
932+
*/
933+
function wpvulnerability_admin_menu() {
912934

913935
// Adds a submenu page under the Settings menu.
914936
add_submenu_page(

wpvulnerability-adminms.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
*
55
* @package WPVulnerability
66
*
7-
* @version 2.0.0
7+
* @since 2.0.0
88
*/
99

1010
defined( 'ABSPATH' ) || die( 'No script kiddies please!' );
1111

1212
/**
1313
* Load the settings to be available always.
1414
*
15-
* @version 2.0.0
15+
* @since 2.0.0
1616
*
1717
* @return array|false An array containing the WPVulnerability settings if they exist, or false if they don't.
1818
*/
@@ -22,7 +22,7 @@
2222
/**
2323
* Enqueues the WPVulnerability admin CSS file on WPVulnerability admin pages.
2424
*
25-
* @version 2.0.0
25+
* @since 2.0.0
2626
*
2727
* @return void
2828
*/
@@ -803,8 +803,16 @@ function wpvulnerability_render_network_admin_tab_logs() {
803803
<?php endif; ?>
804804
</div>
805805
</section>
806-
<?php
806+
<?php
807807
}
808+
809+
/**
810+
* Outputs the Tools tab contents for the multisite settings screen.
811+
*
812+
* @since 4.1.2
813+
*
814+
* @return void
815+
*/
808816
function wpvulnerability_render_network_admin_tab_tools() {
809817
$tools_action = add_query_arg(
810818
array(
@@ -1894,6 +1902,8 @@ function wpvulnerability_admin_dashboard() {
18941902
/**
18951903
* Strictly sanitizes the main configuration (emails and periods).
18961904
*
1905+
* @since 2.0.0
1906+
*
18971907
* @param array $input Input values.
18981908
* @return array Sanitized values.
18991909
*/
@@ -1985,6 +1995,8 @@ function wpvulnerability_sanitize_config( $input ) {
19851995
/**
19861996
* Sanitizes the messages generated by the plugin (simple messages).
19871997
*
1998+
* @since 2.0.0
1999+
*
19882000
* @param array $input Input values.
19892001
* @return array Sanitized values.
19902002
*/
@@ -2001,6 +2013,8 @@ function wpvulnerability_sanitize_messages( $input ) {
20012013
/**
20022014
* Strictly sanitizes the analysis options (booleans).
20032015
*
2016+
* @since 3.3.0
2017+
*
20042018
* @param array $input Input values.
20052019
* @return array Sanitized values.
20062020
*/

wpvulnerability-general.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* @package WPVulnerability
66
*
7-
* @version 2.0.0
7+
* @since 2.0.0
88
*/
99

1010
defined( 'ABSPATH' ) || die( 'No script kiddies please!' );
@@ -613,7 +613,7 @@ function wpvulnerability_normalize_notify_settings( $notify ) {
613613
* This function removes any leading or trailing whitespace from the version string
614614
* and strips out any non-alphanumeric characters except for hyphens, underscores, and dots.
615615
*
616-
* @version 2.0.0
616+
* @since 2.0.0
617617
*
618618
* @param string $version The version string to sanitize.
619619
*
@@ -1022,6 +1022,13 @@ function wpvulnerability_detect_memcached() {
10221022
return wpvulnerability_sanitize_and_validate_version( $version );
10231023
}
10241024

1025+
/**
1026+
* Detects the installed PHP version using available runtime information.
1027+
*
1028+
* @since 2.0.0
1029+
*
1030+
* @return string|null The detected PHP version in N.n or N.n.n format, or null if unavailable.
1031+
*/
10251032
function wpvulnerability_detect_php() {
10261033
// Initialize the version variable.
10271034
$version = null;
@@ -1460,7 +1467,7 @@ function wpvulnerability_detect_sqlserver() {
14601467
* This function takes a comparison operator in string format and returns
14611468
* its corresponding HTML entity for better readability in web contexts.
14621469
*
1463-
* @version 2.0.0
1470+
* @since 2.0.0
14641471
*
14651472
* @param string $op The operator string to prettify.
14661473
*
@@ -1490,7 +1497,7 @@ function wpvulnerability_pretty_operator( $op ) {
14901497
* This function takes a severity string and returns a human-readable
14911498
* severity level, localized for translation.
14921499
*
1493-
* @version 2.0.0
1500+
* @since 2.0.0
14941501
*
14951502
* @param string $severity The severity string to prettify.
14961503
*
@@ -1519,7 +1526,7 @@ function wpvulnerability_severity( $severity ) {
15191526
* This function fetches vulnerability information based on the provided type and slug.
15201527
* It supports caching to minimize API requests and improve performance.
15211528
*
1522-
* @version 2.0.0
1529+
* @since 2.0.0
15231530
*
15241531
* @param string $type The type of vulnerability. Can be 'core', 'plugin', or 'theme'.
15251532
* @param string $slug The slug of the plugin or theme. For core vulnerabilities, it is the version string.

wpvulnerability-process.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
*
55
* @package WPVulnerability
66
*
7-
* @version 2.0.0
7+
* @since 2.0.0
88
*/
99

1010
defined( 'ABSPATH' ) || die( 'No script kiddies please!' );
1111

1212
/**
1313
* Convert vulnerabilities into pretty HTML
1414
*
15-
* @version 2.0.0
15+
* @since 2.0.0
1616
*
1717
* @param string $type Type: core, plugin, theme, php, apache, nginx, mariadb, mysql, imagemagick, curl.
1818
* @param array $vulnerabilities Vulnerability data.
@@ -126,7 +126,7 @@ function wpvulnerability_html( $type, $vulnerabilities ) {
126126
/**
127127
* Convert vulnerabilities into HTML format.
128128
*
129-
* @version 3.5.0
129+
* @since 3.5.0
130130
*
131131
* @param string $type Type of software (php, apache, nginx, mariadb, mysql, imagemagick, curl).
132132
* @return string|false The HTML output if vulnerabilities were found, false otherwise.
@@ -179,7 +179,7 @@ function wpvulnerability_html_software( $type ) {
179179
/**
180180
* Convert plugin vulnerabilities into HTML format.
181181
*
182-
* @version 2.0.0
182+
* @since 2.0.0
183183
*
184184
* @return string|false The HTML output if plugin vulnerabilities were found, false otherwise.
185185
*/
@@ -207,7 +207,7 @@ function wpvulnerability_html_plugins() {
207207
/**
208208
* Convert plugin vulnerabilities into list format.
209209
*
210-
* @version 2.2.0
210+
* @since 2.2.0
211211
*
212212
* @return string|false The HTML output if plugin vulnerabilities were found, false otherwise.
213213
*/
@@ -238,7 +238,7 @@ function wpvulnerability_list_plugins() {
238238
/**
239239
* Convert theme vulnerabilities into HTML format.
240240
*
241-
* @version 2.0.0
241+
* @since 2.0.0
242242
*
243243
* @return string|false The HTML output if theme vulnerabilities were found, false otherwise.
244244
*/
@@ -268,7 +268,7 @@ function wpvulnerability_html_themes() {
268268
/**
269269
* Convert theme vulnerabilities into list format.
270270
*
271-
* @version 2.2.0
271+
* @since 2.2.0
272272
*
273273
* @return string|false The HTML output if theme vulnerabilities were found, false otherwise.
274274
*/
@@ -299,7 +299,7 @@ function wpvulnerability_list_themes() {
299299
/**
300300
* Convert core vulnerabilities into HTML format.
301301
*
302-
* @version 2.0.0
302+
* @since 2.0.0
303303
*
304304
* @return string|false The HTML output if core vulnerabilities were found, false otherwise.
305305
*/

wpvulnerability-sitehealth.php

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
*
55
* @package WPVulnerability
66
*
7-
* @version 2.0.0
7+
* @since 2.0.0
88
*/
99

1010
defined( 'ABSPATH' ) || die( 'No script kiddies please!' );
1111

1212
/**
1313
* Tests for vulnerabilities in installed plugins.
1414
*
15-
* @version 2.0.0
15+
* @since 2.0.0
1616
*
1717
* @return array Returns an array with the results of the vulnerability test.
1818
*/
@@ -64,7 +64,7 @@ function wpvulnerability_test_plugins() {
6464
/**
6565
* Tests for vulnerabilities in installed themes.
6666
*
67-
* @version 2.0.0
67+
* @since 2.0.0
6868
*
6969
* @return array Returns an array with the results of the vulnerability test.
7070
*/
@@ -116,7 +116,7 @@ function wpvulnerability_test_themes() {
116116
/**
117117
* Tests for vulnerabilities in core.
118118
*
119-
* @version 2.0.0
119+
* @since 2.0.0
120120
*
121121
* @return array Returns an array with the results of the vulnerability test.
122122
*/
@@ -168,7 +168,7 @@ function wpvulnerability_test_core() {
168168
/**
169169
* Tests for vulnerabilities in a specified software component.
170170
*
171-
* @version 3.5.0
171+
* @since 3.5.0
172172
*
173173
* @param string $software The type of software to test (php, apache, nginx, mariadb, mysql).
174174
* @return array Returns an array with the results of the vulnerability test.
@@ -254,6 +254,8 @@ function wpvulnerability_test_software( $software ) {
254254
/**
255255
* Tests for vulnerabilities in MySQL.
256256
*
257+
* @since 3.5.0
258+
*
257259
* @return array Returns an array with the results of the vulnerability test.
258260
*/
259261
function wpvulnerability_test_mysql() {
@@ -263,6 +265,8 @@ function wpvulnerability_test_mysql() {
263265
/**
264266
* Tests for vulnerabilities in MariaDB.
265267
*
268+
* @since 3.5.0
269+
*
266270
* @return array Returns an array with the results of the vulnerability test.
267271
*/
268272
function wpvulnerability_test_mariadb() {
@@ -272,6 +276,8 @@ function wpvulnerability_test_mariadb() {
272276
/**
273277
* Tests for vulnerabilities in Apache.
274278
*
279+
* @since 3.5.0
280+
*
275281
* @return array Returns an array with the results of the vulnerability test.
276282
*/
277283
function wpvulnerability_test_apache() {
@@ -281,6 +287,8 @@ function wpvulnerability_test_apache() {
281287
/**
282288
* Tests for vulnerabilities in Nginx.
283289
*
290+
* @since 3.5.0
291+
*
284292
* @return array Returns an array with the results of the vulnerability test.
285293
*/
286294
function wpvulnerability_test_nginx() {
@@ -290,6 +298,8 @@ function wpvulnerability_test_nginx() {
290298
/**
291299
* Tests for vulnerabilities in PHP.
292300
*
301+
* @since 3.5.0
302+
*
293303
* @return array Returns an array with the results of the vulnerability test.
294304
*/
295305
function wpvulnerability_test_php() {
@@ -299,6 +309,8 @@ function wpvulnerability_test_php() {
299309
/**
300310
* Tests for vulnerabilities in ImageMagick.
301311
*
312+
* @since 3.5.0
313+
*
302314
* @return array Returns an array with the results of the vulnerability test.
303315
*/
304316
function wpvulnerability_test_imagemagick() {
@@ -308,6 +320,8 @@ function wpvulnerability_test_imagemagick() {
308320
/**
309321
* Tests for vulnerabilities in curl.
310322
*
323+
* @since 3.5.0
324+
*
311325
* @return array Returns an array with the results of the vulnerability test.
312326
*/
313327
function wpvulnerability_test_curl() {
@@ -317,6 +331,8 @@ function wpvulnerability_test_curl() {
317331
/**
318332
* Tests for vulnerabilities in memcached.
319333
*
334+
* @since 3.5.0
335+
*
320336
* @return array Returns an array with the results of the vulnerability test.
321337
*/
322338
function wpvulnerability_test_memcached() {
@@ -326,6 +342,8 @@ function wpvulnerability_test_memcached() {
326342
/**
327343
* Tests for vulnerabilities in Redis.
328344
*
345+
* @since 3.5.0
346+
*
329347
* @return array Returns an array with the results of the vulnerability test.
330348
*/
331349
function wpvulnerability_test_redis() {
@@ -335,6 +353,8 @@ function wpvulnerability_test_redis() {
335353
/**
336354
* Tests for vulnerabilities in SQLite.
337355
*
356+
* @since 3.5.0
357+
*
338358
* @return array Returns an array with the results of the vulnerability test.
339359
*/
340360
function wpvulnerability_test_sqlite() {

0 commit comments

Comments
 (0)