Re-enable autoindent and smartindent for PHP files to ensure proper indentation according to WordPress coding standards.
Save cursor position and folds before formatting, restoring them afterwards to improve user experience during format-on-save.