Here are the steps to prevent the registration of blogs from spammer domains or offensive domain names techniques:
[Read more...]
How to Ban Specified Email Domains From Registering?
How to block blog registrations of offensive words?
Here are the steps to prevent the registration of blogs with offensive names or words associated with spamming techniques:
[Read more...]
How to Delete a Blog?
Here are the steps to delete a blog:
Reminder, once you delete a blog it cannot be restored in the admin screens. It can only be restored from a database backup.
[Read more...]
How to Mark Blogs as Spammers?
How to Mark a User as a Spammer?
Marking a user as a spammer in WordPress MU is rather straightfoward. The steps to do this are below.
[Read more...]
How to delete a user?
Deleting a user in WordPress MU is rather straightfoward. The steps to do this are below. Remember, you cannot undelete a user in the admin screen. You can only do that by restoring a database backup which you should not do under most normal circumstance.
[Read more...]
XML Parsing Error: xml declaration not at start of external entity
Have you ever seen this error in your WordPress feed?
XML Parsing Error: xml declaration not at start of external entity
I have now, multiple times. It is something that is so easy to cause without even knowing how it happened or that it happened at all for hours or days.
We use WordPress MU here at Blogivists running on a Linux server. On the main page we have a feed that displays the latest posts from all of the blogivists blogs. Yesterday, we discovered our feed was broken and displaying the error shown above. I had seen this error before when securing the website.
I recognized it immediately as being blank lines in the code outside the php tags of . The problem becomes finding the errant code. If you don’t have shell access you will have to go through each file you have changed to find the error. With shell access the task becomes a little easier. I intend to make it even easier for you.
I started by doing the following in the webroot of the website:
find . -mtime -1 -name \*.php
This gave me a list of all files that had been changed in the past 24 hours. I then stepped through each file looking for the problem. This was a tedious and slow process. I started with files in wp-content/plugins and wp-includes. I had no luck.
Next I wrote a quick script that printed the first 2 and last 2 lines of each php file. I then worked my way through the list and again found nothing.
I assumed at this point that something was getting printed incorrectly. I added print statements throughout the feed building code (FeedWordPress) until it was obvious that my first thought was correct, a file had whitespace before or after the php tags.
I reran the find command from earlier. At this point I started checking the themes themselves. I had skipped those earlier since I did not think theme templates would have an effect on the feed building. I discovered themes do have an effect, particularly since the theme that caused the problem was the main page theme. I finally discovered the functions.php file had been edited and 2 blank lines had been placed at the top of the file before the <?php. I removed those and the feed was working properly again.
Now, to make this easier for everyone and myself when this happens again. I wrote a script that will run through every php file and check the to make sure there is no whitespace before the starting tag. As a side note here, you can remove the ending tag ?> to eliminate that issue, however it won’t prevent the leading whitespace issue. I don’t do that because I think it is bad coding style to not close all tags.
You can download a gzip file that contains the test files and script source by right clicking and choosing Save Link As on the following link (Check Whitespace Download). These are written for Linux, but could be modified for Windows is you wish. Included in the file are my test files. I’ll outline the process below so you can see how it works.
The first script is a bash script that prints a file tree into a text file and starts the perl script that does the actual searching.
find . -name \*.php > checkfiles.lst
perl checkfiles.pl
The perl script loops through the file list and checks the beginning and end of the file. Here is the code segment to check for any whitespace before the <?php tag:
for ( $line=0; $line < $rows; $line++ ) {
#print “line $line: ” . $myfile[$line];
if ( $myfile[$line] =~ /^[ 0 ) { print "$fname - check leading whitespace\n"; }
break;
}
}
For both of those segments the current file has already been read into an array. This makes the searching must easier to accomplish. Basically all I am doing is checking each line to see if it contains <?php. If it is not the first line I print out a message to check the beginning of the file.
Checking the trailing whitespace is just the opposite. I start with the last line and walk backwards looking for ?>. Here is the code segment that checks the end of the file:
for ( $line = ($rows-1); $line >= 0 ; $line-- ) {
#print "line $line: " . $myfile[$line];
if ( $myfile[$line] =~ /[?][>]/ ) {
if ( $line < ($rows-1) ) { print “$fname – check trailing whitespace\n”; }
break;
}
}
Hopefully you will never need to run any of these checks, but if you do this should make your life much easier.
Joomla 1.5 Document Linking in an Article
I was asked today how to insert a PDF or Word Doc into a Joomla article. Here is the process if you need it as well. This is a two step process. I am assuming you are already logged into the administration panel.
[Read more...]
Website Backups
Website backups go hand in had with security. They are security for a disaster or if you website gets hacked. You should make regular backups of your website. This applies not only to websites, but blogs, Joomla and Mediawiki sites.
Most hosting companies do not do backups for you. They backup the server installation, but leave you on your own for your blog. The better hosting companies will do periodic backups of your websites. If anyone know hosting companies that do or don’t provide backups please add them in the comments. I am talking about the basic hosting services that many bloggers and simple websites use. Siteground does weekly backups, while Hostmonster, Dreamhost, and Cyberwurx do not.
To do a backup, you usually have 2 options with most hosting company control panels. These 2 methods are as follows:
- Full backup of your entire site
- Includes your website, database and home directory files
- Options:
- Save this to your local computer
- Backup locally on the hosting server and then download when complete
- Separate backups for your database and your website
- Run this after you add plugins, themes, images, podcasts, videos or other files on your website
- Backup your database on a more regular basis
My recommendations for backups would be to do a full backup after you have your website completely setup and then again once a quarter. I would then recommend doing a website only backup monthly unless you make many changes to your website on a regular basis. This does not count frequent posting updates. I would then do the website backup at least weekly or whenever a large number of changes are made. Lastly, I would recommend backup up the database at least weekly. If you post multiple times a day you may want to make backups daily or find a service that does it for you.
To make these backups faster, more reliable, and quickly accessible, allow the backups to run locally on the hosting server. When it is complete, download them to you local computer.



