- PHP 8.2+ installed and added to PATH:
E:\_PHP\php-8.2.2 - WP-CLI installed:
wp --version - MariaDB/MySQL running on
127.0.0.1:3306 - Root user has database access
- Repository cloned
-
wwwdirectory exists - Project files in place
cd www
bash ../docs/quick-setup.shExpected Result:
- WordPress installed
wordpress_headlessdatabase created- GraphQL plugin activated
- Headless theme activated
wp core version # Should show WP version
wp db check # Should be OK
wp plugin list --status=active # Show active plugins- MariaDB connection works
-
wordpress_headlessdatabase created - WordPress tables created
- WP_ADMIN_PROTECTION = true
- CUSTOM_LOGIN_PATH = 'console'
- DISALLOW_FILE_EDIT = true
- XML-RPC disabled
- Blog public disabled
- Comments closed by default
- Permalink structure configured
- Homepage:
http://localhost/wp-headless - Console login:
http://localhost/wp-headless/console/ - Admin login works
# Test query
curl -X POST http://localhost/wp-headless/graphql \
-H "Content-Type: application/json" \
-d '{"query":"{posts{nodes{id,title}}}"}'Expected Response:
{
"data": {
"posts": {
"nodes": [...]
}
}
}-
wp post list- shows posts -
wp user list- shows users -
wp plugin list- shows plugins
wp post create --post_type=page --post_title="Home" --post_name="home" --post_status=publish
wp post create --post_type=page --post_title="API" --post_name="api" --post_status=publishwp term create category "News"
wp term create category "Articles"
wp term create post_tag "featured"wp menu create "Main Menu"
wp menu item add-post "main-menu" 1 --title="Home"
wp menu item add-post "main-menu" 2 --title="API"wp post generate --count=10 --post_type=post --post_status=publish
wp user generate --count=3-
/graphql- main endpoint - Introspection works
- Posts, pages queries work
- Plugin activated
- Allowed fields configured
- Caching works
- CORS headers configured (if needed)
- API protected from public access
- Authentication configured
wp db optimize # Database optimization
wp transient delete --expired # Transients cleanup
wp cache flush # Cache clearingwp core verify-checksums # File verification
wp user list --role=administrator # Admin check
wp config set WP_DEBUG false # Disable debuggingwp db export backup.sql # Database backup
tar -czf wp-content-backup.tar.gz wp-content/ # Files backup- PHP errors logged
- Console access logged
- GraphQL requests monitored
# Add to cron for daily maintenance
0 2 * * * cd /path/to/www && wp transient delete --expired && wp db optimize-
docs/wp-cli-guide.mdread -
docs/wp-cli-examples.mdstudied - Useful commands noted
Solution:
# Check MariaDB
mysql -h 127.0.0.1 -P 3306 -u root -p
# Create database manually
CREATE DATABASE wordpress_headless;Solution:
# Download WP-CLI
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
# Create wp.bat
echo '@ECHO OFF' > E:\_PHP\wp.bat
echo 'php "E:\_PHP\wp-cli.phar" %*' >> E:\_PHP\wp.batSolution:
wp plugin activate wp-graphql
wp graphql clear-cache
wp rewrite flushSolution:
- Use:
http://localhost/wp-headless/console/ - Check credentials: admin / secure_password_2024
Solution: MariaDB is using GSSAPI authentication which PHP doesn't support. Fix it by:
- Connect to MariaDB as admin:
mysql -u root -p- Change authentication method:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
FLUSH PRIVILEGES;
EXIT;- Or create a new user:
CREATE USER 'wpuser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT ALL PRIVILEGES ON wordpress_headless.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;- Update
wp-config.phpwith new credentials if needed.
After completing the checklist:
- Configure frontend application to work with GraphQL API
- Create custom post types through ACF
- Set up CI/CD for automated deployment
- Add performance monitoring
- Regularly update WordPress and plugins
# Quick health check
wp core version && wp db check && echo "✅ OK"
# Create new post
wp post create --post_title="New Post" --post_content="Content" --post_status=publish
# Update plugins
wp plugin update --all
# Clear cache
wp cache flushIf you encounter problems:
- Check logs in
wp-content/debug.log - Use diagnostic commands from
docs/wp-cli-examples.md - Refer to
docs/wp-cli-guide.md - Check system requirements
Happy coding! 🎉