Added wp cache flush and transient flush
parent
c2f5c80260
commit
f82d941dcc
|
|
@ -524,8 +524,6 @@ actions:
|
|||
commands:
|
||||
- cd /var/www/webroot/ROOT/
|
||||
- bash /home/litespeed/mbmanager/scripts/wp-search-replace.sh '${settings.old_url}' '${settings.new_url}' --all-tables
|
||||
- /home/litespeed/bin/wp transient delete --all
|
||||
- /home/litespeed/bin/wp cache flush
|
||||
- return:
|
||||
type: info
|
||||
message: "Search and Replace completed successfully for '${settings.old_url}' with '${settings.new_url}' in all tables. Deleted Transients and Flushed WP Cache"
|
||||
|
|
|
|||
|
|
@ -173,7 +173,18 @@ STATUS=$?
|
|||
|
||||
if [[ $STATUS -eq 0 ]]; then
|
||||
success "'wp search-replace' command completed successfully."
|
||||
# Optional: flush caches to ensure changes propagate
|
||||
|
||||
# Delete all transients – recommended after domain/URL migration
|
||||
info "Deleting all transients (wp transient delete --all)..."
|
||||
TRANS_CMD=()
|
||||
if [[ -n "$SUDO_CMD" ]]; then
|
||||
# shellcheck disable=SC2206
|
||||
TRANS_CMD=($SUDO_CMD)
|
||||
fi
|
||||
TRANS_CMD+=("$WP_EXECUTABLE" "transient" "delete" "--all" "${WP_RUN_ARGS[@]}")
|
||||
"${TRANS_CMD[@]}" || warning "Transient delete command returned non-zero exit status."
|
||||
|
||||
# Flush object/cache to ensure changes propagate immediately
|
||||
info "Flushing WordPress caches (wp cache flush)..."
|
||||
FLUSH_CMD=()
|
||||
if [[ -n "$SUDO_CMD" ]]; then
|
||||
|
|
|
|||
Loading…
Reference in New Issue