Never lose your source code, ever!

Twice. In 1 week.

I lost my code and my awesome plugin edits when my hard drive crashed, I started writing it again and I formatted the wrong partition. Seriously gutted! I tried to recover the data with undelete apps but it was gone forever.

No worry no more!

Now, I don’t need to worry because I use Dropbox and have configured my local server to use it as the document_root of my dev site. That way, all the developing work I’m doing gets saved automatically online and is accessible on any of my pc’s.

I don’t even need to worry about being able to access the SAMBA share if I want to edit a file, I just open it from my dropbox on the pc I’m using and save it back there, it’ll get automatically updated on my dev server.

Oops no more!

Another advantage is the revisions feature. You can go online and see the updates that you made to a file and revert it back to an earlier save. This has already saved me from crying, I always forget to rename a file before I start trying to add updates and before I know it, the whole thing is causing an error and I can’t remember how to put it back the way it was! just luvin the revision feature!!

Get 2GB for FREE! (and help me out)

You can apply for a Dropbox for FREE and get a full 2GB to use to store anything from simple documents to executable files to database backups or like me, use it as your code repository and never go through the pain of a lost bit of awesome code again!

You can even install it on Linux which is super helpful when it comes to transferring files between a windows->linux network.

If you click this link and install your dropbox for free, we both get extra bonus space which would help me out a lot :)


yes and more crashes to make the day go poof!

What an interesting week. Not content with crashing hard drives and losing data, I went through a round of Ubuntu weirdness that meant I had to change the monitor to one with a larger default resolution.

Fixed that and just got used to the mammoth monitor that now looms over the counter and Ubuntu decided it wouldn’t play nice with vmware any more. I need that vwmare to run the ancient Win98 system that handles the delivery orders.

All I can say is welcome back XP. Spent bloody ages installing an old OEM version that was lying about and even longer taking it through SP1, SP2 and SP3 updates. At last though, it all plays nice with my virtual image and USB serial adapter (for caller ID). I had to take off the webserver though which I use to serve the new order pages. I need that to work, we have new drivers who need maps!!

Home Pc plays it too

Windows 7. RC1. Finished. :-(

New Windows 7 Ulitmate installed and functioning with a VMware image of Ubuntu which is now serving the pages to all the PC’s on the shop and home network…. just in time for my Sky router to start playing up. Now a direct cable connection spazzes it out and the wireless keeps dropping off . bwahhhh!

Work..WORK

I had lots of fun things planned for ComLuv and other pet projects these past two weeks but it’s all been put aside so I can fix these real life, gotta work or we dont get paid, things. I think I am on top of most of it (except the sky router) but I’m so knackered from doing all the fire fighting that all I wanna do now is watch some movies and pretend I don’t have a PC (for a little while).


oh batshit, it’s happened again. thrice

What a load of bollox! This seems to be the week I experience maximum crashage.

Hard times/drive

First, my shop pc had a hard drive crash. A massive one. The drive wouldn’t even spin! I tried the usual methods found on a Google like putting it in a plastic bag and putting it the freezer which is supposed to fix a jammed disc.

nope.

Then I tried what this page tried. Basically, swapping the logic board from an identical drive to the faulty one. That actually got the drive spinning and recognized in windows but unfortunately, it was completely trashed. Every sector screwed and no matter what software apps I threw at it, it wouldn’t play. (so I took it apart to see how it works)

Lost code

All my backups of my server where on that disc. All.of.them!

In a great wave of relief, I found that 99% of it had been updated to the live server only the day before. The 1% that didn’t just so happened to be my awesome edit of the pay-to-blog plugin which I was about to put on ComLuv. dammit, that was some good coding I added to the plugin.

It would have allowed me to set a free time limit on new blogs of say 30 days and when that runs out, the next time the blog owner tried to log on, they would be presented with a page where they can pay a piddly 5 USD to have the blog enabled for a year. If they didn’t want to or couldn’t pay then they could request a free blog and that would notify me by email and list the request on my admin page.

I’ll have to rewrite the code and I bet I can’t remember how I did it!

New install, new problems

I managed to grab another hard drive and put it in the box to replace the poop one. Installed Ubuntu 9.10 and vwmare and got all the shop POS software working with the ancient equipment we have. Sweet! until… only 24 hours of nice working, it went pooooop. Something to do with i810 video drivers missing. Cue 5 hours pissing about with sudo apt-get and other linux bollox until at last, it is working again.

And then Vmware decided to stop working with the serial port via USB. Pleh!

More sudo apt-get and 2 hours later, I found an old vwmare image for the win98 system and copied over the contents of the .vmx file and ta-da! it worked again.

No more please!

No more. thanks. done it now.

New Wheels

At least the new wheels look good on Twitpic

Even these got delayed by 3 days. Next day delivery bleeeeuuurrgh!


Taming the Upgrades plugin from http://premium.wpmudev.org

If you’re lucky enough to have a subscription to Premium WPMU Dev account then you’ll have access to great monetization plugins like the Upgrades or Supporter which take all the pain out of providing a ‘pay for’ service that can handle payments through Paypal, Google or even Amazon gateways.

I downloaded and installed the upgrades plugin a while ago and I’ve used it to monetize certain parts of my ComLuv site. There’s the usual way of adding plugins to the Upgrades directory and configuring them to be used which I’ll go into in a future post but I wanted to use the system slightly differently, and that was to charge users for adding new URLs to an account or to add default links to their returned list of posts.

The advantage of premium

Some of the advantages to using wpmupremium plugins is the support you receive, knowledge that the plugin will be updated to keep it compatible with new changes and my favourite is, the quality of the code.

When you’re getting premium, you’re getting premium code which for me personally, has taught me a LOT about how wordpress works. Particularly custom hooks and actions and filters. That was always a mystery to me until I dissected the plugins I downloaded from their site so it was a breeze to modify the upgrades plugin to work for users who don’t have blogs and start using the internal functions in a daughter template to do what I wanted.

Modifying the upgrades plugin


I needed to allow the upgrades menu to show for regular users because not everyone who joins the Comluv site starts a blog. This was just a simple case of changing the user level so that everyone, not just blog owners can see the menu and buy credits.

There are two places to modify:

/mu-plugins/upgrades-framework.php
line ~ 197-200 (upgrades plug pages framework function)
change add menu and submenu calls to

add_menu_page($upgrades_branding_plural, $upgrades_branding_plural, 0, 'upgrades.php');
add_submenu_page('upgrades.php', __('Credits'), __('Credits'), 0, 'credits', 'upgrades_credits_output' );
add_submenu_page('upgrades.php', __('History'), __('History'), 0, 'history', 'upgrades_log_output' );

line ~ 1919 (upgrades_credits_output function)
change user check to

if(!current_user_can('level_0')) {

Creating the daughter template

Adding another page you can use as a template is pretty easy, you just need to create a new php file in your theme directory and make sure it has the correct remarks at the top to identify it as a template page.


/*
Template Name: ComLuv purchase url
*/

Next just copy and paste the main calls from another template, you’ll be deleting most of it like the loop to display posts and replacing it with your own hard coded form and text. Be sure to keep the divs that surround the content intact.

I wrote a description of the item being sold and added a form.
(DON’T copy and paste from this page, I had to remove the beginning < characters from the code so it displays properly)

form action='/member/additional-urls/' method="POST">
input name="addurl" type="text" size="30"/>
input type="submit" name="submit1" value="Submit"/>

/form>

I also added a finish_page() function which just closes the /div tags so I could easily break out of what I was displaying without rendering the rest of the custom code below it.

You set the action to the page slug you’re publishing the page as and put a nonce field in there so you can check it with the next bit of code to prevent a naughty user from trying to call the purchase directly.

Handling the purchase

Next, you need to handle the data that gets submitted by your form and do the magic with the users credits.

if(isset($_POST['submit1'])){
$nonce=$_REQUEST['_wpnonce'];
if(!wp_verify_nonce($nonce,'addurl1')){
echo 'Page request deformed, please go back and try again. (b1s1)';
finish_page();
}
if(!$_POST['addurl']){
echo 'Please go back and enter a value';
finish_page();
}
// check if user has enough credits
global $user_ID;
$credits = upgrades_user_credits_available($user_ID);
if($credits < 3){
echo 'h2>Error - Insufficient Credits/h2>';
echo 'p>You will need to purchase some credits to register another URL, you currently have strong>'.$credits.'/strong>';
echo 'p>a href="/wp-admin/upgrades.php?page=credits">Click here to visit the purchase page/a>';
finish_page();
}
// if we're here then everything is ok to provide service and deduct credits
$credits = upgrades_user_credits_available($user_ID);
$credits -= 3;
upgrades_user_credits_update($credits);
upgrades_log_add_msg($user_ID,'You paid 3 credits for an additional URl - '.$url);
do_add_url($url,$user_ID);
echo 'h2>Site added, 3 credits used on your account/h2>';
echo 'p>You have '.$credits.' credits remaining';
echo 'p>a href="/member/additional-urls/">Click here to refresh the page/a>';

The first bit gets the nonce you created and checks it and displays an error message if it doesn’t match
Next, check the field you’re expecting and spit out an error if it is empty.
Next, check the user has enough credits and spit out an error if they don’t.
If everything is fine, continue.

use $credits = upgrades_user_credits_available($user_ID); to get the users current credits total
use upgrades_user_credits_update($credits); to set the users credits total to $credits (after you deduct what your item/upgrade costs)
use upgrades_log_add_msg($user_ID,’You paid 3 credits for an additional URl – ‘.$url); to add a message to the users Credits history page so they know they used some.

That’s it, easy peasy! Here’s an idea, use credits to sell digital downloads on another page, just check and deduct the users credits before allowing a dowload.

I’ll post a follow up to this soon on how to use the upgrades plugin to add a new package that enables the RSS widget for a blog (I’ll show you how to disable the rss widget too)

You can get over 100 plugins and themes of premium quality at http://premium.wpmudev.org and they all help to make your wpmu site better than the jones’s :)


Text links work to make Fired Wok number 1 Oriental Food Delivery

A customer came in to the takeaway we run and mentioned that he got to our website (Fired Wok Chinese Takeaway) only after he added the word ‘takeaway’ to his search term.

Confusing because, I was quite pleased with how the SERPS are for Firedwok and ‘chinese takeaway lancaster‘ which results (at time of writing) to this..

Straight on the map and number 1 on results (with added tags)

It turns out that he was searching for ‘oriental food delivery lancaster’ which made the site past page 5 on the results!

Bring on the featured links!

A few days or weeks ago, ComLuv got put up to PR6 on the homepage from Google. How nice! I mentioned this in the email newsletter and within a few hours, two links were sold on the sidebar for 30 days each. One with a subscription! woot!, might this be the first month Comluv pays for itself? lol

I thought I’d take advantage of this PR increase and put a text link for ‘oriental food delivery lancaster’ on with the paid ones and left it a while. In the meantime, I put some more posts on the blog portion of the takeaway website and put in some ‘oriental food’ references on the homepage.

Got me some SERPs

And now, a search for ‘oriental food delivery lancaster’ results in a number 1 position (and number 2)

1 portion of SERPS please

Very happy with my text link purchase, and because I own the site it means it was free! haha :-)

I guess I can take it down now, it’s done it’s job and it can make some space for another paid ad.

It’s not just me

A paid customer bought a link for UK payday loans back when that search term had them after page 10 (I tested it when they first bought the link) and now that term results in them being on page 1 of google.

They even asked why I had no subscription option for the ads! I switched it on and straight away, I had 50$ per month subscriptions coming in. Very nice!

Get YOU some links

If I can sell a few more links on subscription, I’ll have enough to upgrade the server to more memory and a faster processor. It’s typical that the first time the site has made enough money to pay for it’s own server and bandwidth, it reaches capacity again and needs upgrading! lol. what a fun ride!

You can buy featured homepage links and network wide footer links on the ComLuv page here


Brrr! Amazing recent picture of the UK from space

This picture taken yesterday by NASA

Click the image to download a high-res version.


Snow day! Schoolboy = YES, Business Owner = NOOoo

I used to love winter, I used to love it even more if it snowed. Snowy roads, especially in the UK, means massive disruption to public services and roads. It used to mean no school, later it meant no need to trudge to work. Now, as a business owner with a large percentage of business relying on deliveries, it means glum faces all around!

Ice skating anyone?

It’s not too bad, we still get the usual suspects who battle through any kind of weather to get the chips, fried rice and curry sauce in a box. Somehow, the grocery deliveries happened and only the carrotts were missing! They’ll battle through the narrow streets to us again just deliver a bag of carrotts. Try that in London..

Tomorrows forcast is for bright skies, I hope it clears the snow off the roads long enough to get some sweet & sour chicken out to the masses! :-) The weather doesn’t look too good for the South of the country though, there’s a 18 inch snowfall predicted down there. oo-er!

How has the weather been affecting your area? do you love the snow or hate it?


Sick, lazy, no wait, definitely sick

My first day off in 9 months and it turns into a sick day! OMG I am super flu’d up and my plans for sketching out the new CommentLuv have been skuppered :(

That's not a moon! thats the flu virus

I think I’ll have to try and do some stuff on my laptop that needs doing to the ComLuv site. Things like, a daily visit list of CommentLuv enabled sites based on the most comments received. There are other maintenance tasks I have to do but that’ll take my main pc and it’s bloody cold in my computer room!

Not quite like this but nearly!

Seriously! it’s right cold oop North. Couple that with the fact that the flat above the takeaway has single pane glass in the windows and the one in my computer room has a broken latch which prevents it from closing and you’ve got a perfect recipe for bloody freezing!

All my development work has grinded to a halt because of this cold weather and with it being Christmas and we’re one less chef in the kitchen, there is a huge amount of work to be done in the offline world of a Chinese takeaway. I felt quite stressed in the beginning of this period where I couldn’t get any coding done but rather than get emotionally damaged by the pressure of all this code and web stuff, I decided to just concentrate on what is paying the bills and supporting the family for a bit.

There’s no real problems with CommentLuv at the moment, it’s working on WP2.9 and the ComLuv site is surviving and only just now starting to make some pennies with adsense and kontera so hopefully, nothing major will happen between now and spring so I can start some serious coding again. Pah, who am I kidding? I wont be able to last until spring! lol, guess I’ll have to take another unpaid day away when I’m better just so I can exercise my brain.

Now back to my snot filled hankies. where the hell does all this snot come from? something must be losing out on liquids in my body so all this snot can be produced. bleurgh


WordPress MU 2.8 Beginners Guide Book Review

PacktPublishing sent me a shiny new publication called WordPress MU 2.8. It’s one of their “beginners guide” series which means it takes you step by step from noob to hero on the subject. I’ve read a few of their other books and they’ve always been a good read and source of new information.

WordPress Mu or WPMu is already familiar to me after creating ComLuv.com to run using it so I was looking forward to receiving this book to see if there were some things I had missed. Oh yeah, I missed a lot!

If you’re looking to build a WordPress based site that also has the option of allowing your own readers to create their own blogs then you need to look at WPMu. Not only is it the same platform that wordpress.com uses for their millions of blogs, it’s also expandable to be a social network in it’s own right. It does this with the buddypress and bbpress plugins. This book shows you how to use them all.

In the beginning

Like all beginner books, the first part deals with the introduction and installation chapters. In other books, this is just a page or two but with PacktPub books, you get the full deal. Step by step with pictures and alternative methods. Even right down to setting up Apache to work with subdomains which is going to save you a lot of trouble hunting around forums for answers.

Expansion

After you learn how to set up your site and modify it’s appearance, you’ll want to know what plugins and features can be added. The middle section of the book takes you through different options like buddypress, bbpress (forums) and other useful additions that will make your site stand out from the rest.

As with other beginners guide books, the author works with a case study site and as you progress through the chapters adding more things, you will be able to follow on with your own local install and compare results. This makes it a lot more interactive to learn and with the pop quizzes and “what just happened” reviews, you’ll really prepare yourself for your project.

More than words..

As well as covering the technical details for installing, maintaining and optimizing your site, the author also goes into the real life way of creating and running a blog/social network hub. Things like monetizing your site or ways to increase traffic are given a whole chapter and will really help the new webmaster get to grips with their site.

thinking Mu?

If you’re just considering looking into WPMu or you run more than one wordpress blog and want to consolidate them all to one site then you should buy yourself this book. It’ll give you enough information so that you can try it out without worrying about having to bring in outside help. You can view the books contents page and read more about it here :

WordPress MU 2.8 Beginners Guide


They go in 3′s too

You know how the expression says that problems come in 3′s ? I get 3 lots of 3′s most of time but this week I think I have managed to get rid of 3 problems.

I was posting about my woes at Comluv and just a few days later I finally managed to track down the random freezes on my AsRock M3A790GXH – 128M motherboard and OCZ DDR3 Gold Series RAM

Random crashes on Vista/7 – AsRock M3A790GXH/128M with OCZ DDR3 Gold RAM – Solved

Shiny, SHINY! RAM!

Shiny, SHINY! RAM!


The crashes were driving me crazy, I could never repeat the action that caused the crash and there was never any entry in the event log except for after the reboot. I tried removing one stick and running it with that one to see if it was a faulty stick, it crashed on the first try so I thought that was it but after swapping it with the other stick, the pc crashed within a day. :(

It turns out that OCZ DDR3 RAM needs 1.9v instead of the regular 1.5v that it would get from the motherboard. A quick visit to the bios and I switched the DRAM voltage to 2.0v and the pc has been up and running for days without a problem. yey!

Dedicated server non responsive after high traffic – solved

They put the fast in, um, ukfast :)

They put the fast in, um, ukfast :)


Another problem was my server, it is fast and a nice bit of kit but it was getting overloaded at times with so many requests to the CommentLuv API. I had a word with UKFast explaining to them that I expected my server to be able to stay up if a lot of traffic came in. They did their utmost to help and sent me a very nicely priced invoice to beef up my server with an extra 1 GB of RAM.

It’s been up for 7 days and the CTM graphs are showing me that my CPU usage and system load are down a lot from what they’ve been.

Monthly view upgrade shows better performance

Monthly view upgrade shows better performance

Looks more dramatic on the 1 year chart

Looks more dramatic on the 1 year chart

My last issue was my laptop charger, it went poof! I did a search online for a universal charger and the best price I could see was over 60 quid! luckily, I was able to buy a Toshiba charger from ebay for 9.99 for next day delivery.

sorted! (for now)



  • 279
    Unique
    Today
    Powered By Google Analytics
  • Copyright © 1996-2010 FiddyP. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress