Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Fix a broken WordPress site

Fix a broken WordPress site

Tools and steps to help you troubleshoot errors and seek help when your WordPress site breaks.

Kristen Symonds

August 11, 2016
Tweet

More Decks by Kristen Symonds

Other Decks in Technology

Transcript

  1. FIX A BROKEN WORDPRESS
    HOW TO

    View Slide

  2. WHY SHOULD YOU KNOW THIS?
    ▸ Fix your mistakes
    ▸ Fix someone else’s mistakes
    ▸ Provide useful information when seeking assistance

    View Slide

  3. CODEX.WORDPRESS.ORG/TROUBLESHOOTING
    THE CODEX
    ▸ The codex has a whole troubleshooting page!
    ▸ installation
    ▸ login problems
    ▸ themes
    ▸ other common issues

    View Slide

  4. FTP & MYSQL
    KNOW YOUR SITE!
    ▸ WordPress is made up of files & database
    ▸ Keep a way to access your files
    ▸ FTP, SFTP, SSH
    ▸ Host file manager
    ▸ Know how to access the database if you have to
    ▸ phpMyAdmin
    ▸ Sequel Pro

    View Slide

  5. FTP CLIENTS
    ▸ Use SFTP when possible
    ▸ Commonly needed for
    ▸ turning on WP_DEBUG
    ▸ disabling plugins
    ▸ disabling theme

    View Slide

  6. SEQUEL PRO OR PHPMYADMIN
    DATABASE CLIENTS
    ▸ Good to:
    ▸ Reset password
    ▸ Repair/optimize database
    ▸ Automatically
    ▸ Remove spam, post revisions
    ▸ Fix encoding
    ▸ Backup database

    View Slide

  7. CODEX.WORDPRESS.ORG/DEBUGGING_IN_WORDPRESS
    WP_DEBUG
    ▸ Turns on display of errors
    ▸ Most useful for:
    ▸ WSOD (white screen of death)
    ▸ truncated page (eg sidebar, or footer
    completely missing)
    ▸ Turn to false when not using
    ▸ Can use with a plugin (eg Debug Bar)
    ▸ define( 'WP_DEBUG_DISPLAY', false );
    /** The name of the database for

    WordPress */

    define( 'DB_NAME',
    'database_name_here' );
    /** MySQL database username */

    define( 'DB_USER', 'username_here'
    );
    /** MySQL database password */

    define( 'DB_PASSWORD',
    'password_here' );
    /** MySQL hostname */

    define( 'DB_HOST', 'localhost' );

    define( 'WP_DEBUG', true );

    View Slide

  8. WORDPRESS.ORG/PLUGINS/DEBUG-BAR/
    DEBUG BAR
    ▸ Shows
    ▸ PHP errors & warnings
    ▸ Queries on current page (what is being requested from the database)

    View Slide

  9. READING ERRORS
    PHP ERROR
    ▸ Fatal
    ‣ Call to undefined function add_acction()
    ▸ in
    ▸ line
    Fatal error: Uncaught Error: Call to undefined function add_acction() in /
    kristarella/wp-content/plugins/my-plugin.php:6

    View Slide

  10. 500 ERROR

    View Slide

  11. GENERIC SERVER ERROR
    500 ERROR
    ▸ If you just did something, undo it!
    ▸ Check host error logs
    ▸ define( 'WP_DEBUG_LOG', true );
    ▸ automatically creates wp-content/debug.log
    ▸ Fix or remove error

    View Slide

  12. BROWSER ISSUES
    INSPECTOR TOOLS & CONSOLE
    ▸ In a browser, right click & ‘Inspect Element’
    ▸ Yellow ⚠ for warnings, red ❌ for errors

    View Slide

  13. EXAMPLES

    View Slide

  14. TROUBLESHOOTING STEPS
    1. Undo what you just did
    2. Upgrade themes & plugins & core
    3. Disable plugins
    ‣ activate 1 by 1
    4. Activate default theme
    5. Check Browser Console
    6. Enable WP_DEBUG
    7. Check error logs
    ‣ Google search for error message
    8. Ask for help
    ‣ wordpress.org/support
    ‣ paid plugin author
    ‣ WP meetup
    ‣ clickwp.com (paid)

    View Slide

  15. IMAGE CREDITS
    ▸ https://www.flickr.com/photos/odisea2008/9159834089/

    View Slide