I want to debug a WordPress plugin using xdebug + XAMPP + VSCode. But VSCode is not hitting the breakpoint in the plugin main PHP file. If I run the website as localhost in the browser, the plugin executes fine. But I want to pause the execution of WordPress in the plugin file, so that I can trace the code and variables in the plugin file. How can I do that?
When I try to debug the WordPress plugin, I open the main plugin PHP file in VSCode and click on debug. But PHP intellisense shows error of unrecognized WordPress functions. As if, VSCode doesn't understand that it is a plugin of WordPress and treats the plugin PHP as a regular PHP file, and shows error on WordPress functions. So, I assume it is not the correct way of debugging WordPress plugin: by opening the plugin PHP file directly in VSCode.
What is the proper way to debugging WordPress plugin? So that whole WordPress runs from VSCode, and then the breakpoint is hit in the plugin PHP file.
Please see the screenshot:
I have also attached php.ini, httpd.conf, httpd-ssl.conf, phpinfo() and launch.json here: https://softsolutionslimited.com/config.zip
I want to debug my WordPress plugin, so that I can hit the breakpoints in my plugin php file and debug the plugin code.