diff --git a/lib/reference-db.sh b/lib/reference-db.sh index 5ad35f2..d3e2196 100755 --- a/lib/reference-db.sh +++ b/lib/reference-db.sh @@ -428,9 +428,9 @@ build_wordpress_section() { fi # Try to get actual domain from WP database options (more reliable) - local db_name=$(grep "DB_NAME" "$wp_config" | grep -oP "'[^']+'" | tail -1 | tr -d "'" || true) - local db_user=$(grep "DB_USER" "$wp_config" | grep -oP "'[^']+'" | tail -1 | tr -d "'" || true) - local db_host=$(grep "DB_HOST" "$wp_config" | grep -oP "'[^']+'" | tail -1 | tr -d "'" || true) + local db_name=$(grep "DB_NAME" "$wp_config" | grep -oP "'[^']+'" 2>/dev/null | tail -1 | tr -d "'" || true) + local db_user=$(grep "DB_USER" "$wp_config" | grep -oP "'[^']+'" 2>/dev/null | tail -1 | tr -d "'" || true) + local db_host=$(grep "DB_HOST" "$wp_config" | grep -oP "'[^']+'" 2>/dev/null | tail -1 | tr -d "'" || true) # Try to get site URL from wp-config defines local site_url=$(grep -E "WP_SITEURL|WP_HOME" "$wp_config" | head -1 | grep -oP "https?://\K[^/'\"]+" || true) @@ -441,7 +441,7 @@ build_wordpress_section() { # Get WP version local version="" if [ -f "${wp_dir}/wp-includes/version.php" ]; then - version=$(grep "\$wp_version" "${wp_dir}/wp-includes/version.php" | grep -oP "'\K[^']+" | head -1 || true) + version=$(grep "\$wp_version" "${wp_dir}/wp-includes/version.php" | grep -oP "'\K[^']+" 2>/dev/null | head -1 || true) fi # Count plugins