Fatal error: Allowed memory size exhausted in WordPress 3.0 upgrade

24. 08. 2010 at 21:41

Have you upgraded to WordPress 3.0 and got the following message when trying to automatically update to 3.01?

Fatal error: Allowed memory size of xxxxxxxx bytes exhausted (tried to allocate xxxxxxxxx bytes)

I used to get that error on older versions of WordPress from time to time and resolved it by editing the wp-settings.php file. There’s a line that says define(‘WP_MEMORY_LIMIT’, ’32M’); and a quick edit to define(‘WP_MEMORY_LIMIT’, ’64M’); used to sort the problem out.

But on a recent attempt to upgrade from 3.0 to 3.01 I got the error and found the memory allocation in the wp-settings.php file is split out as an include file on line 20

require( ABSPATH . WPINC . ‘/default-constants.php’ );

and the “default-constants.php” file, with its memory settings is in the wp-includes folder and appears to now be correctly specified at 64M. After some research I found a site that suggested increasing this to 128M, or 256M I tried both and neither worked.

Another site suggested changing the PHP.ini file’s memory from 32M to 64M, but I use Namecheap and I don’t have access to that file.

I finally found the answer that worked for me.

Locate the .htaccess file in the WordPress root folder and add this line:

php_value memory_limit 64M

That worked fine. I hope that helps you too.

Building an Igloo

11. 01. 2010 at 22:32

I decided this year I will try to do as many new things as I can. I’ve made a list of places in the UK that I haven’t been as part of that resolution and I will also be on the look out for new activities.

My first challenge, to break me in gradually, was something I’ve never done with snow before..and that’s to build an igloo. I’ve done snow men and snow sculptures before but never attempted an igloo.

I also decided to record the building of the igloo photographically and then shoot the built igloo at night with an inner glow. I’ve uploaded the result in my portfolio and the rating is favourable, so I’m pleased with that.

I’ve also written how to do it on my foliopic site blog Building an Igloo so you can get an idea a) how to build an igloo, b) how to photograph one and c) view one of the strengths of a foliopic site’s article system.

Images don’t right align in WordPress

10. 08. 2009 at 18:16

I recently added a new WordPress template to one of my sites and found that the right align option did not work. The Alignment was set correctly in the upload “Edit Image” settings and appeared correct in the “Advanced settings” but when you preview the image was still at the left hand side. I looked up various WordPress sites for the answer and it appears that the style sheets of many of the themes are old and need updating to work on more modern versions of WordPress. Several sites suggested adding the following code:

img.centered {
display: block;
margin-left: auto;
margin-right: auto;
}

img.alignright {
padding: 4px;
margin: 0 0 2px 7px;
display: inline;
}

img.alignleft {
padding: 4px;
margin: 0 7px 2px 0;
display: inline;
}

.alignright {
float: right;
}

.alignleft {
float: left;
}

The replies from various happy forum readers suggested that the code fixes the problem, but it didn’t do so on my chosen theme GabLog 1.0

After some more research I finally found the answer one line of code

.alignright { float: right !important; margin:0 0 15px 15px !important; }

Simply place this in the css style sheet. You’ll find this in the wp-admin page under “Appearance” and sub menu “Editor” From there look at the Theme files on the right, select Stylesheet (style.css) from Styles and add the above line of code in to the centre edit box. Click on update File and you should then find your image aligns to the right when you refresh.

Open Office Tip – Changing To Title Case

28. 06. 2009 at 15:10

I use Open Office and wanted to change some text to Title Case (Where Each First Letter Is A Capital Letter) In many programs you have a Change Case option in the Format menu. Here you would usually find Title Case, as well as UPPER CASE, lower case and sometimes Sentence case. But in OpenOffice there is no such option.
After a fair bit of trawling I found my answer and thought it would be useful to add them to my blog as a notebook entry for me and as a help for anyone else looking for a quick fix.

So if you use Open Office here are a couple of solutions:

Changing a field to Title Case in Open Office Calc (Excel Equivalent)

Click on the cell in the next empty column across from the field you want to change. key in =PROPER ( ) and insert the cell number that you want to change inside the brackets for example =PROPER(A1) You will now have the A1 cell repeated in B1 cell with the words in title case.

Changing a field to Title Case in Open Office Writer (Word Equivalent)
Select Format>Character and then click on the Font Effects tab and select Title from the Effects drop down list.

I never thought I’d consider my diet!

06. 03. 2009 at 12:01

Following a heart attack you start looking at your life in new light. In my case excessive weight, lack of fitness or smoking could not be attributed to the cause…but one thing that I can change is my diet. Particularly my cholesterol level, which, at 6.6 (post heart attack), is too high for today’s standards. The guideline for UK today is around 3. I was put on statins which reduces this level but it’s time for a diet change as for years I’ve been doing it wrong – very wrong.

Two things I ate almost daily where cheese and chocolate…not together I might add.
I’d have cheese on toast, cheese in sandwiches, cheese on pizza, cheese in dishes.
And, in the evening I’d have a bar of chocolate with a pint. It became regular, and addictive. I’m told cheese can still be eaten, but not the hard variety which tends to have more fat. Basically, if the cheese tastes strong and lovely, like mature cheddar, it’s probably no good. If it tastes bland like Edam it’s better.
And milk chocolate is the one I’d reach for, but plain is the safer choice. I’ve had about two bars of chocolate in three months and miss it badly.

Things I ate weekly: curries, fish and chips, ready meals. I’ve had fish and chips once since and ready meals have been stopped completely.
I love curries…the ones I like are cooked in Ghee (Indian butter). It’s about as fatty as you can get. I enjoy a peshwari naan alongside and pilau rice. In curry terms these are three big bad items. We should be eating dry meals such as Tandori or Shashlik, but I like those runny dishes that soak into the fried rice and go well with the coconut naan.
The naan should be plain and the rice should be boiled. I’ve had two “proper” curries since, and the temptation to go back to what I really enjoy was too great, I can live without the peshwari naan and the pilau rice, but not the flavour rich jalfrezis or dopiazas. Once now and again won’t hurt, he mutters with fingers crossed.

Five a day!
If there’s one thing that’s been well and truly drilled into us it’s the message – five a day. We’ve all heard it, but do we take notice? I didn’t, I do now! So what is five a day? We know it’s fruit and veg but how much? Here are the requirements for an adult:

Something the size of an apple is classed as one portion
A plum or kiwi is half a portion so two would be needed to make a portion
A larger item such as a pineapple would require a thick slice
And a small item such as a grape would need a handful
Dried fruit counts (you need a tablespoon’s worth)
A 150ml glass of fruit juice
A dessert bowl of salad
2 tablespoons of any veg, raw or cooked

Have fruit with breakfast, as a snack and after a meal, include veg with a meal and a glass of juice at some point in the day and you’re sorted.

Something fishy
I regularly ate tinned tuna in sandwiches, and was eating it because I thought I was being healthy. I had no idea why, but thought, it was fish, so it was good. The reason you need fish is for the Omega 3 oils. In tuna it’s unfortunately removed in the canning process, so you need to switch to mackerel or pilchards if canned fish is your thing. Fresh Tuna’s fine.

Milk round
I’ve had semi skimmed milk for years and at least that’s one thing I don’t need to change. I’m told there are some new skimmed milks doing the rounds that have flavour, but that remains to be tested by the Bargh palate.

I also cook using Olive oil which is the best route but reduce the amount of oil you use.

I’ve used spreads as a butter replacement for years too, but there are some that are better than others. Make sure you choose a spread with less than 15g of saturated fat per 100g, and spread thinly.

Are you nuts about nuts?
Research suggests that nuts can reduce your chances of heart attack by up to 35%. This is because they are shown to reduce low-density lipoprotein cholesterol (the bad cholesterol)
My favourite nuts are cashews, but the best appear to be Walnuts (they contain Omega 3 fatty acids) and Almonds that are rich in protein, vitamin E, manganese, magnesium, copper, vitamin B2 (riboflavin), and phosphorus. Other healthy options include peanuts (not Bombay spiced!), pumpkin seeds and cashews.

As a disclaimer I must state that I’m not a dietician just following advice I’ve been given or read. It’s not conclusive; I’ve just scratched the surface, but it may give you a lead to research further. But be warned you will find lots of conflicting info.

btw my cholesterol level is now 3.5. So something’s worked.

Malware and 7speed.info

28. 12. 2008 at 18:23

You have found this post because you’re trying to find out about an attack from 7speed.info a malware site that has somehow infected your web site causing virus alert warnings from programs such as Avast. I struggled to find out information searching Google for an answer when it happened to me yesterday. I fumbled around and eventually found the way to resolve it thanks to Scott of MTMinds.

The site has managed to get to your directory (web folders) and added some javascript to certain pages so that the malware (combination of malicious and software) is activated.  You need to do two things.

First make your site secure using new stronger passwords on your server access point and when using ftp. Change these passwords immediately. Use passwords with 8 to 12 character length that are not meaningful words just a string of letters (upper & lower), punctuation and numbers. I now use this site to generate ones automatically  for me: PC Tools Secure Password Generator.

Second find any files that have been “infected” and remove the offending javascript.

The javascript from 7speed.info was placed in the first line of the body on most of my sites, and finding it on ones I’d created using html and basic structures was easy…once I knew what I was looking for! But on sites built using templates such as WordPress and Drupal it was a more challenging discovery. So I’ve written this blog to help speed up your investigation and repair.

The javascript looks like this at the beginning <script language=JavaScript> then the functiion follows with function hilbnb25(z) the hilbnb bit might be a different set of charachters on your page but it always seems to follow with (z) Next is  {var c=z.length,m=1024 and then a huge string of letters and numbers ending with </script><!– your domain host –>
If you take all this out the problem is resolved.  Back up just in case you make a mistake.

To find the javascript
I have several sites and found the easiest way to see if my site was infected was to use the information menu on FireFox Web Developer extension. And then searched for 7speed.info. It highlighted any code on the site. I could then locate the page via ftp and delete the code.

Pages affected
In my experience it was Index.html and index.php pages infected on basic sites
Header.php and Footer.php on basic sites with include files.

On Drupal templates you need to go into the directory of the theme you are using and locate the page.tpl.php file

On PHP Fusion edit the subheader.php and footer.php files

On WordPress go into the theme directory and edit the header.php and footer.php files.

Hope that helps.

New Google Adwords spammer

24. 11. 2008 at 11:31

Just a word of warning for Google Adword users. There’s a new email going around trying to catch you out.

The mail will look something like this

Dear Advertiser,
———————–
We were unable to process your payment.
Your ads will be suspended soon unless we can process your payment.
To prevent your ads from being suspended, please update your payment information.
—————————
Please sign in
to your account at http://adwords.google.com/select/login,
and update your payment information.
—————————–
No matter what size business you run
Advertise your business with Google Adwords

Before going to any site from an email link hover over the link to see where it’s directing you, because even though the landing page will look “real” the actual site may be a hoax (like this one is), and looking to get your username and password.

Before–

Google take searches to the next level

21. 11. 2008 at 13:26

The Google search has become so widely used that the phrase used “Just Google it” has become the common way to suggesting an internet web page search, so Google joins the like of Hoover and Sellotape. Yesterday Google took the search to the next level. They have added a feature that allows logged in Google users to move useful searched items to the top of the search results. So, for example, If I am always looking at black & white photography. When I search I may get two pages of spammy sites who’ve mastered their SEO. I then find the interesting stuff half way down page three. Now I can click an arrow to the right and it promotes that site to the top of page one, and remembers my preference. It’s like having a Digg system (see there I go) social bookmarking system for Searches.
The more you use it the better the results will be for you. And unlike other SEO techniques the affect of people upgrading sites to top wont affect others. You only see what you’ve done, and only when you’re logged in.  You can view how the community has collectively edited the search results but this does not affect your usual Google search.
As well as promoting sites you can also remove sites from the search too so you can get rid of spammy ones you can also make notes. This is a great move forward and it will be interesting to see if at any point Google starts to take not of quality filtered results and applies that data to their system so everyone benefits.

Images not right aligning in WordPress

13. 10. 2008 at 23:21

If you’re like me and have a wordpress blog that you’ve updated to 2.6 you may have found that you cannot right align photos in your blog posts.
This is because many of the site templates are not totally up to date.

The solution is to edit your CSS style sheet
1 Go to your Site’s admin panel
2 Click on the Design tab and then Theme editor below the tab. It should bring up the style sheet (style.css) If not look at the Theme Files list on the right.
3 Click the Ctl+F to bring up a search window and key in img right or even just img r and click next.
4 Find the line

img align left{ float:left; margin:0 12px 5px 0; }

and change it to

.alignright { float:right; margin:0 0 5px 12px; }

This will then ensure that images are right aligned.

Image resolution and Pixel dimensions explained

14. 08. 2008 at 18:11

Someone asked a question today that got me to think that pixel settings is still not really understood. So I thought I’d explain what the Image Size resize/resample option does.

When you open an Image Size dialgue box you usually have three methods of adjustment. One to scale styles one to constrain proportions and one to resample.

Constrain proportions and scale styles are checked (ticked) by default. If you want to stretch the image so it looks squashed then you’d uncheck constrain proportions and adjust either the Width or Height dimensions depending whether you wanted it stretched across or up. This can be used subtly to make a landscape look more like a panoramic shot, but should be used with care.  If you want to keep the image the same proportions you keep these ticked and the aspect ratio remains the same.

Resample Image is the one that gets most people in a pickle. By default this will be set as default. If you leave it at default you will notice that the resolution setting is unconnected from the width and height in the Document size settings. Resolution is usually set at default at 72ppi (pixels per inch) If you change the resolution to, say 300ppi you will notice that the Top value Pixel Dimensions will increase dramatically. This is because you are about to resample the image. Doing this instructs Photoshop or similar image-editing program to add pixels (interpolate).

If the box is unchecked you will see it connects the Resolution settings with the Width and Height. If you now change the default 72ppi to 300ppi you will see that the Pixel dimensions stay the same, but the width and height decrease.

You are basically taking the 72 pixels in each inch and squashing them into 300 per inch. Computer screens are set at 72ppi so you do not need an image to be set to a resolution of 300ppi, although it doesn’t matter if the file is, because the computer will display at 72ppi anyway.

Now the person who asked the question had been told he needed the image to be 300ppi for a magazine submission. While it’s true that magazines and book publishers need 300ppi files the only important figure is the pixel dimensions, because this determine how big an image can be at 72ppi, 240ppi or 300ppi.

So what do you need to know? Any good magazine editor/picture buyer will know how many pixels he/seh needs for the image and will request the necessary…ie he/shh will request a 2400pixel image. As they are printing at 300ppi it means they have asked to use the image at 8in (2400pixels / 300), yet the same image on your computer may appear to be 33in (2400pixels / 72) if you change from 72ppi to 300ppi with the resample image unchecked the 2400 pixels will stay the same. If you check resample image when changing from 72 to 300ppi your 2400pixel image will increase to 10000pixels and will be a huge unecessary file.

Hope that’s clear…if not ask questions here