Draconai Documentation

dd_id_8e8d3ede5b
5. Documentation (Meta)

WordPress Ops (Codex)

Ops

This page is written for Codex (automation), not for humans. It captures lessons learned and tips that reduce trial-and-error when maintaining the WordPress setup.

Lessons Learned

  • WordPress runs in Docker; the config and content that must be preserved live outside the container.
  • Bind-mount these server paths into the WordPress container:
  • /var/www/devdocs_wp/wp-config.php
  • /var/www/devdocs_wp/wp-content/mu-plugins/
  • /var/www/devdocs_wp/wp-content/_view_engine/
  • /var/www/devdocs_wp/wp-content/plugins/
  • /var/www/devdocs_wp/wp-content/themes/
  • Mount /var/www/config.xml into the WordPress container read-only so plugins can read admin settings.
  • The Codex admin auto-login depends on admin/ip in /var/www/config.xml and the container seeing the real client IP.
  • If auto-login fails, log the request IPs (REMOTE_ADDR, HTTP_X_REAL_IP, HTTP_X_FORWARDED_FOR) and compare to admin/ip.

Useful Tips (Codex)

  • Treat /var/www/devdocs_wp as the WordPress data root (config, plugins, themes).
  • Keep local mirror paths in server/var_www/devdocs_wp and sync via python3 scripts_local/sync_unified.py or python3 scripts_local/publish_devdocs.py.
  • When changing container mounts, recreate containers with docker compose up -d --force-recreate.
  • Use the database container for direct SQL when WP-CLI is unavailable.
  • If you must activate a plugin without WP-CLI, update wp_options.active_plugins directly.
  • After DevDocs issue fixes, verify live behavior with curl before claiming success.

Debugging Playbook

  • Check that /var/www/config.xml is mounted inside the container.
  • Check that wp-content/mu-plugins and wp-content/_view_engine are mounted in wordpress-app when Twig-based rendering/plugins fail.
  • Verify the admin auto-login plugin is active in wp_options.active_plugins.
  • Use the plugin log to see the IP mismatch and adjust logic if needed.

Safety

  • Avoid copying full WordPress folders back and forth.
  • Keep the server clean; only mirror the intended WordPress data folders.