Annoyingly the current version of the google-news-sitemap plugin for WordPress (v1.4) doesn’t work with some silly XML namespace error reported by google.
See http://wordpress.org/support/topic/364929 and effectively the ‘patch’ on the Google Support forum thing which works fine (there are two bits of the plugin which need updating – whcih correlate to the two parts mentioned in the posting etc)
Bit annoyed that the fix is so easy – yet the plugin hasn’t been updated yet. Grr.
Sam made some changes to a SOAP service one customer has – and suddenly our automated tests kept failing. “WTF?” we thought.
We persistently got the same error (e.g. Fatal error: SOAP-ERROR: Encoding: object hasn’t ‘SortResults’ property in ….) yet the generated WSDL file (when viewed through a web browser etc) no longer has SortResults in it.
We checked :
- Proxy settings,
- Apache configuration (and restarted Apache)
- svn reverted files
- DNS and more.
Then it turned out the SoapClient PHP object caches the WSDL file by default in e.g. /tmp/wsdl-blahblahblah. (Where blahblahblah looks very much like an md5). And it doesn’t make much of an effort to check it’s validity. Obviously the documentation does state this, but it does seem like the wrong default behaviour to me.
Solution: Add something to the automated tests to delete /tmp/wsdl-*. OR pass into the SoapClient constructor an array of options like :
$client = new SoapClient('http://somewhere/blah.php?wsdl", array(cache_wsdl => WSDL_CACHE_NONE)
Time wasted: Too much.
I don’t normally do anything with WordPress from a work point of view – I’ve always left such work to ‘designer’ types…
Anyway, yesterday I had a referral for someone who has two fairly busy websites (anorak.co.uk / whoateallthepies.tv) sat on a fairly beefy server (8 core, 16g of ram… oh in a few years that’ll be entry level… but I digress)… anyway, they were having performance difficulties with one site – a bit of investigation found the problem to be related to their migration from one server to another – rinetd was directing traffic from the old server, but had filled the filesystem up and was consuming all cpu time …… Easy enough to fix. Job done. Everything started working again.
After a bit more investigation I found that the two sites needed updates applying and plugins upgraded, and they had no backup job in place *doh* …. Clone the site, whizz through the wordpress upgrade routine on the clone, get the customer to OK it (he did) and then we did it on the live server…. and it looked like a success. Until an hour after I’d done the update and the customer realised part of his front page was missing….
Great. Just what I’d hoped to avoid – delving into wordpress’s code.
On opening up the theme’s index.php file it was easy to see where the content should be – add in some debugging on the clone – and “Oh look – that ‘thing’ is empty.. it should contain ‘stuff’….”
Turns out there’s a WP_Query class; and it seems WordPress 2.9.x treats it’s query slightly differently to previous versions – ‘they’ used category_name=blah as a parameter – this no longer works, instead it needed changing to cat=1234 .. bingo, data returned; site fixed; customer happy.
I breathed a big sigh of relief. I was worried that they previous developers had made some weird customisation to wordpress core which I’d have to forward port and debug/fix.
Being the nice chap I am, I also installed xcache onto the server to help PHP out – I suspect they could cut their hardware ‘allocation’ by half and still have ample capacity to serve the sites. A few days with munin running and I’ll know for certain. Perhaps they’ll appreciate the cost saving?
Server: Debian Lenny
Installed .deb from here
# wget http://sourceforge.net/projects/postfixadmin/files/postfixadmin/postfixadmin_2.3_all.deb/download
# dpkg -i postfixadmin_2.3_all.deb
... dpkg moans about missing dependencies
Selecting previously deselected package postfixadmin.(Reading database ... 38632 files and directories currently installed.)Unpacking postfixadmin (from postfixadmin_2.3_all.deb) ...dpkg: dependency problems prevent configuration of postfixadmin: postfixadmin depends on dbconfig-common; however: Package dbconfig-common is not installed. postfixadmin depends on wwwconfig-common; however: Package wwwconfig-common is not installed. postfixadmin depends on php5-imap; however: Package php5-imap is not installed.dpkg: error processing postfixadmin (--install): dependency problems - leaving unconfiguredErrors were encountered while processing: postfixadmin
# apt-get -f install
(dependencies now get installed...)
…. Goes into the Postfixadmin .deb installer thing.
- Tell it to use Apache2 (in my case) as the webserver,
- Give it the ‘root’ user’s database password (if MySQL).
- Tell it to generate a password for the postfixadmin user…
- Tell it to use the package maintainers version of /etc/postfixadmin/config.inc.php (well I did).
I think something went wrong for me – as I needed to do this afterwards; perhaps you’ll have better luck.
# mv /etc/postfixadmin/config.inc.php.ucf-dist /etc/postfixadmin/config.inc.php
Next, goto http://yourserver/postfixadmin/setup.php – you should see lots of text saying how it’s updating the database to version xyz, xyz+1 etc.
Choose a password to protect the setup.php page; press submit, and you’ll be presented with a ‘hash’ – copy and paste this into the config.inc.php file – so you get something like this on line 32 :
$CONF[‘setup_password’] = ‘my long hash thingy goes in here’;
Next, create a super admin account, using the setup.php page – remembering to type in the setup password you used to create the hash above.
(Well, now you need to configure Postfix and/or courier and/or dovecot etc etc)
You might want to read my other article which covers this…
Today, I went to London to visit a prospect customer – who we’ve done work for before – oddly the people I spoke to had no knowledge of the work we did (they paid for it all about 18-24 months ago… but nevermind), and it doesn’t appear to have been deployed either (“We heard someone talking about this X months ago; but thought it was just a suggestion / didn’t think work had been done”) … so I’ve probably thrown a spanner into their idea of migrating from ExponentCMS to something else (E.g. Drupal).
Anyway, I got back to Birmingham at about 17:00ish, at which point there wasn’t a lot of point in me sitting on the bus for an hour or more, only to arrive in Bromsgrove, and then drive back to Birmingham to do the phpwm meeting tonight…
So, while walking up New Street, I spot Starbucks with it’s “Free WIFI” advert in the window. Cool. Drink + Wifi = Win. Or not. I had to spend £5 to buy a ‘starbucks reward card’ – then use my iPhone to find out how to register (which wifi ssid etc) – and the starbucks.co.uk site didn’t make it obvious to find either.
So, suffice to say, now I am connected – and all traffic is being tunnelled out via
ssh -D 9999 firstname.lastname@example.org
<expletive begins-with=’f’ ends-with=’wits’/>
At work I’m still looking for a short term PHP contractor. Perhaps I’m being unrealistic in my expectations/requirements (rate/location/duration/skills etc), but nevertheless…. As I’ve not found anyone via normal channels (twitter/phpwm user group etc) I thought I’d turn to a random recruitment agency (who I’d spoken to a week or so ago).
Yesterday I interviewed one guy – who’d been a programmer for a number of years (10+) – using Visual Foxpro (whatever that is) – presumably it’s a dead language, as he wants to move across into PHP. He has very basic PHP experience (yet claims 2 years on his CV), figured out how to do FizzBuzz and Recursion without too much help – but didn’t know anything about object orientation, separation of concerns (specifically MVC), security (obvious SQL injection) or unit testing and failed to make any comment on what is almost the worst code I could find to present to him. This isn’t necessarily a problem – I would normally be happy to train someone – however, not when I’m paying him £25/hour and I’d be lucky if he was productive within a week. (Hint: students are better than this when they’ve only been in University for two years).
Today, I therefore continued hunting, with mixed success. I had three more CVs – all asking for more money, and one looked quite good – but had a requirement he worked remotely after the first few days (well he does live in Telford). Another, who is local, I’m interviewing tomorrow. Wanting to do some homework on him, I had a look at a couple of websites mentioned in his doctored CV – the first is clearly .Net from the error message it throws when you pass a > into it’s search box – so either they replaced his PHP site quickly or his CV is misleading. The second has a PHP error on it – and is only (effectively) a themed wordpress site which looks like it’s slowly rotting. From these I found out his address (hint: whois $flamingodomain) and an invalid email address/domain (which archive.org seems to not do much with). Typing in his name into Google / LinkedIn, Facebook etc produces no obvious matches. So I know hardly anything about him, and for all intent he may as well not exist. Great sales job there.
From talking to the recruiters it seems it’s difficult to find decent PHP programmers – and anyone who may be decent will almost certainly not be programming PHP as their primary language (i.e. they’ll be doing web development in Java/.Net, and know PHP quite well). This seems a shame, but really only confirms what I already knew from interacting with others in the community. I’ve known for ages that I’ve effectively taken a large pay cut by running my own company, and doing PHP. It sucks that this continues to be the case. Clearly I’m a martyr or something.
So, if you happen to be a contractor looking for work, please make an effort. I’m not overly impressed so far, and may just end up stalling customers for another week/month instead.
(Oddly I wrote this post, posted it, and it vanished. What are you up to wordpress? Why do you want me to retype things in twice?)