Get log of function/method calls made by do_action() on WordPress initialization

I don’t believe there is a way to do this via a plugin (at least in a way that will get around 500 type errors, which is why I originally looked into this), but the section of code where the hook callback gets called is in wp-includes/plugin.php in the do_action function: https://github.com/WordPress/WordPress/blob/master/wp-includes/plugin.php#L453 This got updated … Read more

Using debug log in production, is that a security concern?

I would consider it a security concern if everyone is able to view the debug.log file from the browser. It could reveal e.g. paths, plugins and their problems. There are though ways to restrict access to it via Nginx or Apache. Another problem I’ve seen with logging to debug.log on production sites is that it’s … Read more

xdebug connects but won’t break in WordPress with vvv

In my case it turned out to be a path mapping issue. Adding… “pathMappings” : { “/srv/www” : “C:\\Users\\tmorgan\\websites\\local\\www” } …fixed it for me. In other words, explicitly specifying how the server path related to my local file path was necessary. I did not think this was the case because xdebug was connecting to my … Read more

How to debug a unit test for a WordPress plugin, which uses wordpress-test?

Now I’ve found a solution [to issue 2 above]: I prefixed the external PHP command with: XDEBUG_CONFIG=”remote_enable=Off” and then it didn’t attempt to connect to the debugger. So, in wordpress-tests/init.php I changed from: system( WP_PHP_BINARY . ‘ ‘ . escapeshellarg( dirname( __FILE__ ) . ‘/bin/install.php’ ) . ‘ ‘ . escapeshellarg( $config_file_path ) ); to: … Read more

WordPress Ajax Problems

You have nothing specific to do to “load” modified php code in WordPress. All files are just loaded as is at execution time (ie when the HTTP request is processed by the server). You just have to verify that your plugin is active. Your curl command is malformed. Use this instead : curl -X POST … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)