From the course: Advanced PHP: Debugging Techniques
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
WordPress CLI shell - PHP Tutorial
From the course: Advanced PHP: Debugging Techniques
WordPress CLI shell
- Local debugging can sometimes mean interactively trying out things. We can use WP-CLI Shell and interactively test code, either before adding to the code base, or to confirm a bug. Now you're probably wondering why WP Shell and not PHP-a . WP Shell loads WordPress up to the point that plugins and themes are loaded. Here we can see that the init action has run. We have the entire WP application available to us. This can be a ton of data, but it's also helpful to think about all the things that are specific as to why we are using the shell. Some quick highlights on how we interact with the shell. First, if you type incorrect syntax, it's game over. But when you drop back into the shell, it's like bash. Your commands are still there. We can hit the Up Arrow to scroll back to previously run commands. Once we fix the command, we see the output looks a lot like a var dump. You can do things like access the WPDB global…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
var_dump() debugging: Blue-collar debugging3m 59s
-
(Locked)
What tools are available4m 34s
-
(Locked)
WordPress CLI shell3m 19s
-
(Locked)
Laravel artisan tinker2m 53s
-
(Locked)
Installing and using whoops2m 48s
-
(Locked)
Installing and using PHP DebugBar2m 41s
-
(Locked)
Query Monitor for WordPress2m 49s
-
(Locked)
Ray: Dump debugging4m 23s
-
(Locked)
Xdebug: Step debugging5m 20s
-
-
-