05 Sep

WordPress Transients – Storing False

Storing information in transients is a great way to speed up WordPress, especially if you’re using a memory cache instead of the options table. However, storing false in transients is difficult, because false means there is no transient in the cache. So how do you store false in WordPress transients?

For a great introduction to transients, see https://css-tricks.com/the-deal-with-wordpress-transients/

Why would you want to store false? Generally you would want to store false when it is a legitimate value – for example, when looking for the permalink for a slug, if the slug doesn’t exist then false is a valid return, and you wouldn’t want to query the database every time you looked up the missing slug.… Read the rest

03 Jan

Coolhandle.com Hosting Suck

They just suspended one of our sites without warning. It’s paid until June. It has very little traffic so can’t be overusing resources. Seriously, CoolHandle.com, if there’s something wrong on the site (used as spam gateway), a warning email first would allow the issue to be addressed. As it is if there is something going on then I can’t fix it as the site is down.

Another host on my ‘don’t use’ list.

Read the rest

08 Oct

WordPress Comments Getting 403 Error on /wp-comments-post.php

A user reported they couldn’t leave comments and got this error:

Error 403

We’re sorry, but we could not fulfill your request for /wp-comments-post.php on this server.

You do not have permission to access this server. Before trying again, close your browser, run anti-virus and anti-spyware software and remove any viruses and spyware from your computer.

Your technical support key is: 446e-6a26-b40c-8ddc

You can use this key to fix this problem yourself.

If you are unable to fix the problem yourself, please contact >webmaster at sitename and be sure to provide the technical support key shown above.

This looks related to Bad Behavior plugin as the technical support link goes to ioerror.us.… Read the rest

07 Sep

Google Analytics Experiments Not Collecting Data

Had an issue with one site these past couple of weeks where a Google Analytics experiment was not collecting data even though Google Analytics was saying it was set up correctly.

One of the issues noted elsewhere was that the site set up for cross-domain tracking. For instance if the main site was www.topsemtips.com and the completion (sales) page was on secure.topsemtips.com then you have to set up analytics to know the two sites are interrelated using code similar to:

pageTracker._setDomainName(“topsemtips.com”);

Which some one else mentioned needed the additional code

Added above the experiment code. However this didn’t work.… Read the rest

23 Aug

Network Solutions Hosting Costs

Just had a 3 year renewal invoice for a shared host account from Network Solutions and the cost was $411. We have a number of hosting accounts with many companies and this is one of the most expensive I’ve heard of for shared Linux hosting. I found somewhere to host the site for $22 for two years. This saves $126 per year in hosting – $252 for two years and if extrapolated to 3 years it saves a whooping $378 over three years.

Host Server RackSo I moved the site (took less than one hour) and went to cancel the account with Network Solutions.… Read the rest

03 Aug

Moving your Website to Amazon EC2

We recently transitioned our website from a VPS (virtual private server) to the Amazon AWS cloud environment. Benefits include more control of your server and usually less cost. The major drawback is you need to run the server yourself so some basic Unix knowledge is necessary.

The transition itself was very straight forward consisting of the following steps:

  • Purchase Amazon EC2 large instance, this provides enough CPUs and memory to run a full LAMP environment (Linux, Apache, MySQL and PHP). If you don’t need a database then using a medium will work OK.
  • Ensure you provision enough disk space for your software, database and for backups.
Read the rest
30 Mar

Migrating to Eclipse IDE – Importing Sites into Eclipse

I have been a big fan of the Dreamweaver IDE for many, many years and have still yet to find a better IDE integrated with FTP. I moved to Eclipse a year ago for a PHP project I was working on and found it really easy to use and the intellitype function definition help was so much better than that in Dreamweaver that I decided to  move to Eclipse full time.

I still prefer Dreamweaver for creating HTML (their WYSIWYG is awesome) and the FTP integration is superb but one of the reasons I moved was the version of Dreamweaver I was using didn’t handle SFTP well so I ended up using FileZilla for that anyway so the main reason to keep on Dreamweaver went away.… Read the rest

14 Feb

Simple WordPress Contact Form 7 Phone Validation

I looked around for a simple Contact Form 7 phone validation however all the solutions I found relied on hacking the Contact Form 7 code. By looking through the CF7 code I found a way to attach a simple function to the validation to allow custom validation of any input type you like

To plug into the Contact Form 7 validation there are some filters you can attach to. The built in validation functions do this so we’re copying the standard CF7 way of validation.

All of the code given here can be put into the functions.php file in your wordpress theme.… Read the rest

07 Feb

What to do if WordPress site just shows a blank page

Sometimes a poor setup for wordpress can cause the site to return a blank screen. If you try accessing through /wp-admin/ and it still returns a blank screen then there are generally three causes:

  1. A broken .htaccess file
  2. A broken theme
  3. A plugin causing issues

Go through the following steps to fix this issue:

  1. Try removing the .htaccess in the root directory and see if the site works
  2. Remove the main theme directory (using FTP access) and see if the site works.
  3. If this fails turn off your plugins (by deleting them using FTP if you can’t get in through wp-admin) and again see if the site works.
Read the rest
28 Dec

Unable to post message to http://googleads.g.doubleclick.net. Recipient has origin xxxx

Had this issue on one site when running Chrome and after much hunting did not find a documented solution. However I did manage to find and correct the issue after a little playing with my code.

The issue ended up being a totally unrelated

tag with a float left (it was a div around the breadcrumbs). This tag was used on other pages with ads with no issues, just one page had this problem. Unfortunately it was the template for the main part of the site so the ‘unable to post message’ issue had to be fixed.

To track down if a ‘float left’ is the cause of your problem try removing all CSS style sheets and see if the ads now start working.

Read the rest