Showing posts with label wordpress. Show all posts
Showing posts with label wordpress. Show all posts

Saturday, February 18, 2023

WordPress on Submit / Submissions goes to blank screen

 









Recently, witnessed an odd behavior on a WordPress site I maintain.

  1. As logged in Administrator, and submit button would lead to blank screen, execute but not forward to next page.
  2. As logged in Administrator, deleting a user, when selecting delete all contents, this would lead to a blank screen, execute but not forward. Refreshing screen, says user does not exist. 
  3. As a user, of site any submission would lead to a blank screen. 
It was annoying and took me some time to find the issue, checked the error_log indicated the problem. 

1
[18-Feb-2023 07:14:33 UTC] PHP Warning:  Cannot modify header information - 
headers already sent by (output started at /home/bond007/public_html/wp-content/themes/James/
functions.php:1) in 


But after I restored a previous version of functions.php I could not find any differences, using WinMerge

I opened the file in VSCode, could not find anything on line 1 wrong. 








I opened the file in Notepad++, could not find anything on line 1 wrong. 









Then I opened the file in Fred an open-source hex editor. 





So then I remember, allong time ago, in far off land, I got BOMed. 

Issue: 

You should ensure that the included files do not start with a BOM.

You may also find that the BOM causes problems for an ordinary PHP page. When sending custom HTTP headers the code to set the header must be called before output begins. A BOM at the start of the file causes the page to begin output before the header command is interpreted, and may lead to error messages and other problems in the displayed page.

Src: https://www.w3.org/International/questions/qa-byte-order-mark

Solution:

Change Encoding type in Notepad++ to UTF-8. Then save.


Tips:

Pay attention to the bottom of your editor for the file type. 



















Tuesday, July 27, 2010

Removing the Wordpress.org link in the Meta Sidebar Widget

By default a Wordpress blog comes with the Meta Widget located in the sidebar and provides some useful functionality, including log-in/out, site admin links. Optional links for many include, Enteries RSS, Comments RSS and most Wordpress.org, see image below.


You can edit these, add links or remove by editing {blog name}\wp-includes\default-widgets.php file.



To remove the Wordpress.org link comment line 300 out using or remove it entirely. This is located below the Meta widget class comment section. See image below.