Skip to content

Commit f174c75

Browse files
committed
v 0.120.1
Diagnostic : more checks
1 parent 5ea8e42 commit f174c75

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

tools/diagnostic/inc/10-files.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,7 @@ function glob_recursive($pattern, $flags = 0) {
159159
if ($current_mode != $mode) {
160160
$wputools_errors[] = sprintf('The %s %s should have the %s mode !', $file_type, $item, $mode);
161161
}
162+
if(!is_writable($item)) {
163+
$wputools_errors[] = sprintf('The %s %s should be writable !', $file_type, $item);
164+
}
162165
}

tools/diagnostic/inc/40-wordpress.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@
2929
Initial checks
3030
---------------------------------------------------------- */
3131

32+
/* Loading
33+
-------------------------- */
34+
35+
if (!function_exists('get_option')) {
36+
$wputools_errors[] = 'WordPress is not correctly loaded.';
37+
}
38+
39+
/* Database
40+
-------------------------- */
41+
42+
global $wpdb;
43+
if (!is_object($wpdb) || !$wpdb->check_connection()) {
44+
$wputools_errors[] = 'WordPress : The database is not available.';
45+
}
46+
3247
/* Debug
3348
-------------------------- */
3449

@@ -606,3 +621,17 @@ function wputools_test_rss_feed($rss_url) {
606621

607622
$wputools_notices[] = sprintf('There are %d images sizes, please check if they are useful : %s', $nb_all_image_sizes, $image_sizes_text);
608623
}
624+
625+
/* ----------------------------------------------------------
626+
Check privacy policy
627+
---------------------------------------------------------- */
628+
629+
$privacy_page_id = get_option('wp_page_for_privacy_policy');
630+
if ($privacy_page_id) {
631+
$privacy_page = get_post($privacy_page_id);
632+
if ($privacy_page && $privacy_page->post_status != 'publish') {
633+
$wputools_errors[] = sprintf('The privacy policy page is not published.');
634+
}
635+
} else {
636+
$wputools_errors[] = sprintf('The privacy policy page is not set.');
637+
}

wputools.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
WPUTools(){
44

5-
local _WPUTOOLS_VERSION='0.120.0';
5+
local _WPUTOOLS_VERSION='0.120.1';
66
local _PHP_VERSIONS=(7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5 9.0)
77
local _PHP_VERSIONS_OBSOLETES=(7.0 7.1 7.2 7.3 7.4 8.0)
88
local _PHP_VERSIONS_ADVANCED=(8.3 8.4 8.5 9.0)

0 commit comments

Comments
 (0)