Clean out unused media items from Umbraco media folder
Wednesday, September 03, 2008 4:15:14 PM (GMT Standard Time, UTC+00:00)
When uploading some new media items for a client today we noticed that if you selected "Remove" before saving, it doesn't actually remove the file from the FileSystem. Having a quick look around the forums I saw there are a few posts already pointing this out so I thought I'd fix it.
This is a little application that simply checks the media items in the database and then compares it against a folder you select on your machine. If the file is in use according to the database then it's ignored otherwise it will remove it.
To use:
- Enter your server's login details
- Click "Test Connection"
- Select the relevant database from the drop down
- Check the "Media Folder Name" matches your Umbraco's installation
- Locate your Media Folder on your computer
- Click "Check Media Folder" -this will then list all the orphan files
- If it looks right, click "Delete" -with caution
- Job done
There are a few checks in place to avoid mishap but it's not 100% foolproof as I needed something rough and ready to sort a couple of installations out. If this is something that's seen as useful I'll extend it a touch, some ideas I've got already:
- Check that the selected media folder matches that of the database
- Check that the media id's are the same (to avoid wiping another installation)
- Save config settings for easy re-use
- Use webservices rather than a direct connection to the database
- Enable FTP useage
Please note: I accept no responsibility if anything was to go horribly wrong with this. I would backup your folder first just in case!
You can download the MediaFolderCleaner application here
Do you yell dot com?
Thursday, August 28, 2008 6:53:13 PM (GMT Standard Time, UTC+00:00)
We've recently (and somewhat oddly) had a lot of dealings with Yellow Pages. In the past when asked, I've suggested people shouldn't bother with paying to be listed within the Yellow Pages -especially if you're an IT related company. This was purely based on my experience of stupid numbers of callers wanting an e-commerce site for £50 and the fact that I've believed for a long time that it's quickly losing any useful market share thanks to the likes of Google, Yahoo! and MSN. Now however I've got several reasons not to.
A little history/background for those of you who aren't aware who, or what Yellow Pages is
Yellow Pages has for a long time been the place to find the telephone number of a local company. It neatly organises everything from your local kebab shop to your nearest funeral parlor (not saying the two are linked!).
Yellow Pages ran into a problem a few years ago that I don't think they ever really realised/addressed -this little thing that wouldn't catch on called the Internet. Although they launched a website somewhere around 2001 they were (IIRC) more interested in competing for the 118* directory service (btw how many variations are there? 35ish? -How many do you remember!). Then, by the time they started to realise the potential of the web over the premium rate call lines, they pricked their ears up.
But instead of following suit on the web by opening their service up as widely as possible, they decided to dig their head into the sand and take the same course of action many large corporate do of "We're so big, we don't need you piddly client, you need us", and this leads me to believe Yellow Pages (and to a large extent) yell.com will soon be a thing of the past (thankfully some might say).
So what's my gripe? What've they done to me?
Nothing is the simplest response but that's also what they've done trying to satisfy a couple of our clients. I'll refer to two of these to argue my point, both SMEs, for arguments sake we'll call them Company A and Company B.
Company A
Company A spends approximately £5,000 advertising in Yellow Pages each year. This equates to about 20% of their turnover (a fair chunk of it!). Company A has also had a website for the past few years. Originally developed by Yellow Pages, but updated by us in 2003.
Ever since the website was created, Company A claimed that the majority (est. 80%+) of their custom came from Yellow Pages so each year, when the Yellow Pages rep gave them a call happily invested yet more money.
Recently though, Company A decided to redesign their website as their old one wasn't snazzy enough anymore. Despite fairly heavy traffic and our objections, the decision was made to turn off the existing website (rather than replacing it a temporary holding page) while the new site was being designed and developed. This was only going to take a month (it took a little less than this). But in this time, Company A found that his bookings for the next month or so were massively down on the same period last year. As soon as this was realised, a holding page was put online with a telephone number but it served to prove a point -Yellow Pages' share of the "record search" industry is depleting.
I realise that it's not always as cut-and-dry as I've made it out to be here (mainly for simplicities sake) but the most of the traffic to the site originates from keyword searches on the service rather than the company name or direct traffic (suggesting that they're not looking at Yellow Pages and then coming to the site).
Further to this shock, Yellow Pages originally registered the domain name for this client but despite having fully paid all his accounts, Yellow Pages are yet to release the domain name into our control (we've been chasing them since 2003). This is despite several promises (both verbally and written) that they would release the domain. Needless to say this was unnecessary aggravation over something quite minor.
Thanks to the trouble caused over the domain (and apparent lack of interest from Yellow Pages -despite a huge spend) Company A is now looking at completely stopping their advertising with Yellow Pages.
Company B
Unlike Company A, Company B has historically had a much smaller spend. Usually opting for the smallest advert in a single directory because very little business has come from previous adverts. Company B is in a fairly competitive industry but features prominently.
This year when the Yellow Pages sales rep came calling, they explained to Company B the reason they'd only seen a very small return on their investment was because they were advertising in very few of the Yellow Pages directories. To get more sales Company B should advertise in two other directories and pay for a premium listing which would ensure his company was always on the first page within his area. This sounded reasonable -and logical (advertise in more places, get more enquiries) and as Company B had had a few good months trading decided it was a good investment.
For the first month or so Company B checked on their yell.com listing every few days, sure enough there they were on the first page. A couple of months on and several hundred pounds later however, something wasn't right. Where Company B had previously had 2-3 enquiries in the same period this year they'd had none. Company B asked us to look into their online position as far as Yellow Pages' yell.com was concerned and despite being promised a first page position on certain areas/phrases, they were rarely appearing inside the top 40 enhanced listings (there are currently 47 listings).
Somewhat concerned Company B decided to monitor the situation and started to monitor their position regularly (and we did too). Between all the visits, they were lucky if their result showed up in the results for the areas they serviced -let alone the one they were based in! Having spent over 3 times what they did the previous year, Company B felt somewhat cheated by the sales person so decided to complain.
The customer services rep was somewhat dismissive of Company B's claims and told him that he was appearing in the searches but despite this, they would have their sales team look into what he felt he was sold. The sales team phoned back and informed Company B that they'd only paid for an enhanced listing -which meant the advert wouldn't always be on the first page and there was no way the salesman would have said this as this would cost several thousand pounds. Company B however remembers the salesman stating this so asks us to talk to them about not appearing in the results as when asked, the rep started "talking technical".
When I called to discuss the account I was meet with a very pleasant lady "Sarah" who was the technical sales person who after spouting a little crap about web metrics explained the situation:
After this she hung up (I kid you not). Ok the easiest way out of the conversation by Company B hit the roof when they heard.
We're still awaiting an explanation but have mysteriously started to appear on the first page more often-than-not. Clearly they have some weighting system at play...
So what's my point?
I don't think I really have a point, I just felt like a rant but here are a couple of other reasons why I think Yellow Pages sucks and won't be around for much longer:
Enquiry rates down
I heard another advisor talking about some analysis he had been involved in with a local company. For the past few years they had been recording every enquiry to their firm and aggregating the statistics for comparison at the end of the financial year to decide on whether to advertise next year.
These are the approximate number of enquiries per month:
· 04/05: 110
· 05/06: 80
· 06/07: 40
· 07/08: 32
Their service is not seasonal and the competition has not changed dramatically over the years (certainly not enough to warrant the change seen here). Furthermore their turnover had been increasing. Oh, and the advert for comparisons sake was always the same.
I'd love to get hold of some statistics on Yell.com and Yellow Pages enquiries in general to see if this matches the general trend. Google Trends suggests it's started to drop a little.
Prices staying the same
Despite massive competition online, Yellow Pages are still charging a fair whack for their service and have no intention of changing this. I think as soon as the smaller advertiser cottons on to the fact that they can run a pretty intense pay-per-click campaign for the same amount of cash and reach a larger audience Yellow Pages will be in some serious trouble.
Non-recyclable
Would you believe it? In this day and age, for some reason our recycling people won't take away your Yellow Pages? I tried putting it out a few times but each time they lifted it out and put it back in the box for me.
I expect there's some logical reason for it but I know very few households now that keep the heavy directory so where do they all go? The tips? Disgraceful!
That said, I think I do have a point. I think Yellow Pages is a very good example of a company that has disgraceful customer service. Taking the two (I have more) examples mentioned here I think the issues could have easily been rectified:
Company A: Transfer the domain into the control of the client.
Company B: Simply apologise for the misunderstanding (no-one said they were sorry for the misunderstanding, instead they just made out that Company B was stupid) and if needs be, offer some form of discounted service next year.
I can only hope that Yellow Pages reads this and realises they're going to seriously P off their loyal customers in time to save themselves, but I don't think my blog is important enough for that to happen yet, sadly.
If you're asking me in the future. Steer clear of Yellow Pages and talk to us about some Google AdWords advertising.
The Site Doctor gets a saucy makeover
Friday, August 22, 2008 1:55:26 PM (GMT Standard Time, UTC+00:00)
One of my friends in Denmark has been working on something quite special over the past few days and I thought it was time to share. I'm really blown away by the "quick job" he did with this.

And one for the fellas

Thoughts on my new iPhone 3G
Monday, August 04, 2008 6:40:52 PM (GMT Standard Time, UTC+00:00)
I've had my iPhone for a couple of weeks now so I thought it's about time I posted my thoughts. I'm one of their targeted enterprise users and have come over from a BlackBerry, which although I was worried about always working, actually resulted in me being able to leave the office without worrying there was an all important email awaiting my return.
So how have I found the switch? In a nutshell as I kinda expected -I miss a few of the features on the BlackBerry but on the whole have found it to be Fairly painless. I like aspects of the iPhone such as the application resources but get a little frustrated at silly things like no copy and paste, having to reformat my entire address book or not being able to insert numbers. I suspect somewhat that there are gestures I'm missing so feel free to point me in the right direction (even if it's "wait for the next update")
I've not had a chance to try out the push aspect of the iPhone yet but I'll get around to that shortly, hopefully that'll save some of the battery life! At the moment I think I'm getting about 5 hours talk time out of it but I tend to have it sitting in charge most of the time.
My likes/dislikes of the iPhone so far
So lets start with the positive:
- The App store
- The GPS
- The easy-to-use silent button
- The community (yes I know it's a repeat of the App store, but this is where the iPhone really comes into it's own)
- The ability to easily integrate with other applications i.e. LiveTimer, Flickr and Twitter
- It's easy to use
- The calling plan
And now the negative:
- No copy/paste
- No forwarding your contacts over email/bluetooth/sms etc
- No way of marking all emails as read -this is a serious oversight
- You have to format your telephone numbers in Outlook from: +44(01234)123123 to +44(1234)123123
- When not on 3G it takes an age to download emails
- The phone often crashes when refreshing your email list (or just hangs)
- There's no search facility for your emails
- The contact list isn't as easy to use as the BlackBerry's (you could do everything from one place, with the iPhone I have a tendancy to call people when I want to text them etc)
- Sometimes, it randomly (and secretly) connects to a WiFi signal -usually The Cloud/OpenZone which is a real irritation because if you don't notice you don't get any emails until you turn Wifi off. Really if the connection times out on WiFi it should fall back to 3G.
- .the fact that if you turn off WiFi because of the above, you've got to remember to turn it on again (and I nearly always forget!)
- How some applications drain the battery when you set the phone to sleep
- There's no auto text
- Crappy call history - missing duration for each call time etc
- No scale based email polling option i.e. "If an email exists on the server, check again in 1min, if not, check in 2mins etc)
- The keyboard sometimes freezes when typing fast(ish)
- The lack of backward compatibility with iPod accessories (i.e. car chargers)
- The fact that you can't set it to backup once a week instead of everytime you plug it in -that's a royal PITA as I plug mine into two computers everyday sometimes forget to click the cross to cancel the backup
And for fairness, the in between:
- The keyboard doesn't allow you to select the most suitable one for the task in hand
- The phone doesn't always rotate i.e. in emails -which I find really irritating
- There's no "Trial" option to software, I know it's not much but I don't really want to waste £5.99 if it's a crappy app.
Although the positive are far outweighed by the other aspects of the phone, I'm sticking with it for the moment because unlike all of the phones I've used in the past, it's easy to update and I think Apple are going to fix a lot of the more obvious oversights such as "Mark all emails as read". Then again Apple may not be the saint that everyone makes them out to be. (I'm disappointed I missed out on NetShare for instance).
Long and short of it is I think the iPhone is a nice move away from the BlackBerry but there are still a few areas that they really need to catch up on.
Is buying online better than in the store?
Friday, August 01, 2008 10:00:22 PM (GMT Standard Time, UTC+00:00)
I've been an advocate of buying goods online for quite some time now but have been astounded at the level of service received recently that leads me to believe that buying online is slowly removing the benefits of buying in a store.
A little background: My camera broke (again) the other day. I've returned this model to Amazon before and wasn't aware that if the item has a problem again, they don't replace it, they just refund the cost. An interesting policy -especially as my problems were not related, but a nice surprise.
As I packaged up my old camera to return (a very painless process I might add) I got looking around for a replacement. Checking out the online reviews, I found my 3 favourites to pottered off to Jessops to check them out. The lady at Jessops was very helpful, pretty much confirming everything I had read online. So it came to deal time, I don't mind paying a little extra in store to get the item the same day and to do a little bartering.
Today was not to be my day though, it turns out the only one left in stock was the show model, normally a good way of getting some extra money off but not this time, it wasn't for sale. Bare in mind this was Saturday, the fastest they could get me the model I want (a mainstream camera not overly in demand) was Wednesday! So off I went home and bought it online on the Sunday. It arrived Tuesday at 9:15! What an exceptional service (thanks UK Digital Cameras).
Then, on Monday evening (around 2100) I ordered my new number plates from Demon Plates expecting them to take a few days to be made and posted (so they should have arrived today) but instead, they arrived on Wednesday! Amazing.
Don't get me wrong, I think stores have a place, its's still nice to pop into a shop and pick up the items you're interested in. There's definitely still something in feeling the item before you buy but service wise online stores are really starting to take over.
All I can say is keep it up guys, you're doing the industry a great service! I hope our ecommerce website owners are as efficient.
Is Google using Analytics data to crawl additional pages?
Monday, July 28, 2008 1:19:41 PM (GMT Standard Time, UTC+00:00)
I've been wondering for a while how Google has managed to find a couple of hidden pages. Although they were securely locked down we noticed a few rejected GoogleBot requests in the audit logs. We put this down to the users having a Google toolbar installed but today we got an error from the new Avant Garde hair salons site that's just gone into beta testing which got me thinking.
This particular link is hidden behind a form post and within a jQuery call (to track an action) so not something the GoogleBot has easy access to. I know they're getting more clever but not *that* clever! We started getting the errors shortly after adding the final Google Analytics code so the only conclusion I can come to is that they're not just registering the URLs for reporting purposes but they're also using them to crawl additional pages.
Does anyone know if they use the URLs tracked in Google Analytics to find new pages? All I can say is if this is the case, you better make sure your "secure" pages check the access permissions on a page level!
Identify IIS Sites and Log File locations for WWW and FTP –the source
Friday, July 25, 2008 2:52:37 PM (GMT Standard Time, UTC+00:00)
Exactly a year ago today I posted a little application that output the sites in IIS to a text file and as a few days ago Lars asked for the source, I thought it would be a nice thing to release it exactly a year later.
I didn't plan it that way, it just happened! Cool :)
Identify IIS Sites and Log File locations for WWW and FTP source
using System;
using System
.DirectoryServices;
using System
.IO;
using System
.Collections;
namespace IISSites
{...} 
{
class Program
{...} 
{
static string fileToWrite
= String.Empty;

[STAThread]
static void Main(
string[] args)
{...} 
{

fileToWrite
= String.Format(
"IISExport{0:dd-MM-yyyy}.txt", DateTime
.Today);
if (args
!= null && args
.Length
> 0)
{...} 
{

fileToWrite
= args[
0];

}

SortedList www
= new SortedList();

SortedList ftp
= new SortedList();
try
{...} 
{
const string FtpServerSchema
= "IIsFtpServer";
// Case Sensitive
const string WebServerSchema
= "IIsWebServer";
// Case Sensitive
string ServerName
= "LocalHost";

DirectoryEntry W3SVC
= new DirectoryEntry(
"IIS://" + ServerName
+ "/w3svc",
"Domain/UserCode",
"Password");
foreach (DirectoryEntry Site
in W3SVC
.Children)
{...} 
{
if (Site
.SchemaClassName
== WebServerSchema)
{...} 
{
string LogFilePath
= System
.IO
.Path
.Combine(

Site
.Properties[
"LogFileDirectory"]
.Value
.ToString(),
"W3SVC" + Site
.Name);

www
.Add(Site
.Properties[
"ServerComment"]
.Value
.ToString(), LogFilePath);

}

}

DirectoryEntry MSFTPSVC
= new DirectoryEntry(
"IIS://" + ServerName
+ "/msftpsvc");
foreach (DirectoryEntry Site
in MSFTPSVC
.Children)
{...} 
{
if (Site
.SchemaClassName
== FtpServerSchema)
{...} 
{
string LogFilePath
= System
.IO
.Path
.Combine(

Site
.Properties[
"LogFileDirectory"]
.Value
.ToString(),
"MSFTPSVC" + Site
.Name);

ftp
.Add(Site
.Properties[
"ServerComment"]
.Value
.ToString(), LogFilePath);

}

}
int MaxWidth
= 0;
foreach (
string Site in www
.Keys)
{...} 
{
if (Site
.Length
> MaxWidth)

MaxWidth
= Site
.Length;

}
foreach (
string Site in ftp
.Keys)
{...} 
{
if (Site
.Length
> MaxWidth)

MaxWidth
= Site
.Length;

}

OutputIt(
"Site Description".PadRight(MaxWidth)
+ " Log File Directory");

OutputIt(
"".PadRight(
79,
'='));

OutputIt(
String.Empty); 
OutputIt(
"WWW Sites");

OutputIt(
"=========");
foreach (
string Site in www
.Keys)
{...} 
{
string output
= Site
.PadRight(MaxWidth)
+ " " + www[Site];

Console
.WriteLine(output);

OutputIt(output);

}
if (ftp
.Keys
.Count
> 0)
{...} 
{

OutputIt(
String.Empty); 
OutputIt(
"FTP Sites");

OutputIt(
"=========");
foreach (
string Site in ftp
.Keys)
{...} 
{
string output
= Site
.PadRight(MaxWidth)
+ " " + ftp[Site];

OutputIt(output);

}

}

}
// Catch any errors
catch (Exception e)
{...} 
{

Console
.WriteLine(
"Error: " + e
.ToString());

}
finally
{...} 
{

Console
.WriteLine();

Console
.WriteLine(
"Press enter to close/exit...");
//Console.Read(); 
}

}
static void OutputIt(
string lineToAdd)
{...} 
{

Console
.WriteLine(lineToAdd);
if (
!String.IsNullOrEmpty(fileToWrite))
{...} 
{

StreamWriter SW;

SW
= File
.AppendText(fileToWrite);

SW
.WriteLine(lineToAdd);

SW
.Close();

}
else
{...} 
{

Console
.WriteLine(
"locationToOutput is Null or String.Empty please supply a value and try again.");

}

}

}

}
How to: Convert Hexadecimal Strings
Tuesday, July 15, 2008 9:25:56 AM (GMT Standard Time, UTC+00:00)
As it's my Birthday today I thought I'd post a silly ditty. I'm currently altering Protx's old ASP.Net library to accommodate their changes in regards 3D Secure and while reflecting some of the code came across an enum with their number representations as Hexadecimal strings. I needed to convert these to decimals so thought I'd share a quick and easy way to do it.
Open up Window's Calculator (Windows Key + R then type in calc) under the View menu select "Scientific". Press the F5 key to switch over to Hex entry. Type in the value after the 0x and hit F6
Simple, easy and will help you convert all those Hexadecimal strings (ones that look like this: 0x01 or 0x1a).
Right, time for a coffee :)