WordPress not available to file using wp-env for xdebug requests

What the issue ended up being is embarrassing! I had used the xdebug configuration as the entire launch.json file: { “name”: “Listen for XDebug”, “type”: “php”, “request”: “launch”, “port”: 9003, “pathMappings”: { “/var/www/html/wp-content/plugins/my-plugin”: “${workspaceFolder}/” } } As opposed to the correct: { “version”: “0.2.0”, “configurations”: [ { “name”: “Listen for XDebug”, “type”: “php”, “request”: “launch”, … Read more

How to check whether functions is deprecated or not?

If you want to develop a plugin or theme, you need a set of development toolkit. Use the Developer plugin to install debug bar and debug monitor. Those will tell you which function is deprecated if yes. Moreover, when you develop plugin. You should read the document of WordPress and whatever plugin you are going … Read more

TGM plugin error in Theme Check Plugin

Concerning your question: Can my theme be submitted for approval with these errors? I’m assuming you’re asking whether your plugin, while throwing an error upon activation using TGM library, can still be submitted and accepted to official WordPress repository. My answer would be, no, it cannot. It seems like you made your plugin work once … Read more

debug notice on my WordPress site [closed]

In your config.php check for define( ‘WP_DEBUG’, true ); define( ‘WP_DEBUG’, false ); If its true, you will see notices and warnings on site. This link might be useful http://codex.wordpress.org/WP_DEBUG. Also check this error by logging in and logging out. If you are using any plugin for debugging, you will see that notice message when … Read more

Why debug.log doesn’t work?

Based on this question: You have @ini_set(‘display_errors’, 0); – which will tell PHP (not WordPress) to stop displaying errors. WordPress requires errors to be turned on in order for it to pass them to the appropriate place. define(‘WP_DEBUG_DISPLAY’, false); or define(‘WP_DEBUG’, false); should take care of hiding them on the front end for you.

How do you get the docroot directory?

// server document directory $dir = $_SERVER[‘DOCUMENT_ROOT’]; // wordpress install directory $dir = ABSPATH; to include safely with wordpress add_action(‘plugins_loaded’, ‘load_a_file’); function load_a_file(){ if( is_admin() ){ $dir = $_SERVER[‘DOCUMENT_ROOT’]; include_once( $dir . ‘/file.php’ ); } }