0

I added code php to "My custom function" plugin and Then he got a with me problem white screen can you help me for delete this code from My custom function?

  • If you are unable to log in to the dashboard, you'll need to utilize the services provided by your host in order to edit out the bad code - very likely connecting to the server via FTP, downloading the file, making your modifications, and uploading it once more. Alternately, you may be able to log in once more by disabling the plugin via the database. – bosco Sep 24 '18 at 19:47
0

You will have to go access your site from an FTP account, if you don't have one, go to your server and create one (or request one), then since you know what file was the one in which you were working on, download that file, edit it on your machine deleting the code that is causing the problem, and finally upload it again. Done.

0
  1. If you know the file the error is coming from, you can paste the contents of your plugin file into an online PHP syntax tester such as this. This can help you pinpoint and eliminate common syntax errors that are not obvious to the untrained (or tired or overworked) eye. Note there are many other types of errors of course that this will not help with, but it's a good first step and possible easy solve. WordPress-specific code can be added to your question (or preferably a new, more specific question than this very general one) if you need help with that.

  2. If you are getting a "white screen of death", it usually means you are getting an error - but no error output. But since errors are logged on most hosts by default, you can check for php_errors.log or error_log files in your root folder depending on your PHP config (unless the error is happening in /wp-admin/ only in which case you need to check for those in that folder instead!) To get the error output to display on screen, you can add ini_set('display_errors', 1); to your /wp-config.php file. A fatal error will likely indicate the problematic code lines.

  3. Activate debug mode by adding define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); to your /wp-config.php file... Load the page again and check for errors logged in the file /wp-content/debug.log. Or if you want the errors output on screen (similar to step above) then add define('WP_DEBUG_DISPLAY', true); Note sometimes you will get warnings and deprecation notices this way (especially if you have any older plugins) and other errors that don't mean so much - the last (fatal) error is usually the breaking one. Just remember to turn off WP_DEBUG mde when you are done otherwise your server might fill up with a massive log of useless warnings and crash due to running out of disk space.

  4. If you still don't get an error on screen, can't find it in your logs (or are getting a 500 internal server error) you will need to check your server logs instead of just your PHP logs. Sometimes these logs are available via your hosting control panel, but other times they are not (or just blank there.) Unfortunately the actual server error log path is different places depending on your server operating system, so you'll need to search online for that location to be able to find the relevant server log for your site.

  5. Disable the plugin by renaming it's file or folder via FTP (or if you have to, by file explorer in your control panel.) At least now you will (usually) have access to your site. (If you do not regain access to your site this way, you will have to look elsewhere for the cause.) If you want to actually disable the plugin, you can now visit /wp-admin/plugins.php and it will be disabled because the file/folder will not be found as it has been renamed. You can now rename the actual file back and the plugin will remain inactive until you activate it again.

0

You could try to display errors by adding this code to the top of your functions.php file to display errors and then debug from there?

ini_set( 'display_errors', 1 );
  • when i active this plugin ''my custom function '' The problem is coming back – Golden Investor Sep 25 '18 at 0:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.