virtualmin settins for php

php file upload limit in virtualmin

upload_max_filesize exceeded in php.ini

I can never find this setting. Everytime I create a wordpress development server I end up having trouble finding it.

There use to be a setting in WordPress itself, and if that is there, you’ll have to update that.

I use Apache and PHP on a linux server which I usually administer via virtualmin/webmin (highly recommended). But it can often take me a moment or two to find exactly where I need to be for some features.

Maximum file upload size is one of those and the setting lies as follows:

Go to virtualmin and select the virtual server you wish to edit.

Scroll down to Services and select PHP Configuration and then Resource Limits and change as appropriate.

Save and you’re done! There is no need to reload anything.

You could choose to edit the setting directly in php.ini located in /etc/php/x.x/apache2.

WordPress SSL

This is probably going to have a few additions to it, but let’s just start with making the site admin area force https://.

To do that, open wp-config.php and this towards the end of the file:

define(‘FORCE_SSL_ADMIN’, true);
 No need restart anything, just save and reload your admin page

WordPress 4.4 and Twenty Sixteen

I’ve been waiting for this theme for a while. Installed it moments before WordPress 4.4 moved from RC to final.

1. Borders

The first thing I found I didn’t like was the border around the outside. It had to go.

Pop into your favourite CSS Plugin manager and change/add these two rules:

body {
  background-color: inherit;
} {
  margin: 0px;

Discovering how to remove it was a two step process. Removing the margin from didn’t remove the entire border, it only removed the left and right side. Which surprised me at first and it took some digging but there’s a ::before snuck in there which manages the top and bottom borders.

the sneaky top and bottom margins

the sneaky top and bottom margins

To easily remove it, I just removed the colour of them, hence the inherit.

Digging around trying to find the top and bottom, I was forced to look at them for a few page reviews, and once they were gone I realised that I liked them. So I then removed the background-color style and brought them back. :)

2. Caption alignment

I don’t know why WordPress has a predilection for choosing to align captions to the left, I much prefer them to be centred. To me, it should be about a bit of symmetry.  So, looking at the image above, it first looked like this:

how the wp-caption-text looked BEFORE unaligned/aligned-left

how the caption looked before…

I’m sorry, that just won’t do.

A quick and dirty fix is to include a text-align: center, like this:

.wp-caption-text {
  text-align: center;

3. Green & Amber Screens for <pre>

I’ve been using computers for so long that my first computers used green and amber screens. I remember the old green and amber CRTs we use to have. I actually had an amber one, I liked it, but most people didn’t.

So in doing this post and doing the borders section, I did one of my first usual edits, and that was to turn the <pre> style into something that resembled a green screen. But then as a joke, I made it amber, and find that with this colour scheme, I am preferring it. SO I think it’s here to stay. Regarding the <pre> style, This is what I came up with:

pre {
  background-color: #010;
  color: #3c3;
  font-family: "Courier New", monospace; 
  overflow: auto;
  word-wrap: normal;
  white-space: pre;

Changing WordPress username

wordpress profile capture showing the message "can't change username"Have you ever checked your WordPress profile and noticed you can’t change your username?

Did you ever realise that most people choose the same display name as the username, which then gives hackers a legitimate username to try and hack into your site?

Do you use the same username and display name and now want to change your username (because you don’t want to change your display name)?

Then you should change your username.

There are two ways you could do this:-

  1. through WordPress itself:
    • Create a new user with the username (backend name) that you want
    • Login as that user and verify your account
    • Make sure permissions are right between the users (you’ll want the new user to be (super/) admin)
    • Delete the old user and assign all old posts to the new user
  2. through the database:-
    • edit the username for the user in the user table
    • edit the username in the site meta table for super admin (only applicable in a multi site install)

I didn’t do it through WordPress itself, since I do like to play with the database :) But in theory it should work and is the suggested theory on multiple sites.

Let’s break down the second option:

  1. Make a backup of the database
  2. Open the database using your chosen method
    • for me this is to log into my providers cPanel, and select myPHPAdmin
    • go to the users table (not the usermeta table). The table will be called something {DB_Prefix}_users (usually wp_users or wp_x_users in a multisite install where x is the identifier for the site).
    • change the username field to the new desired name
    • when you save the entry you will most likely be kicked out of the backend immediately, simply login with your new username and all is good to go
    • if you do NOT have a MultiSite install, your job is done. If you DO have a multisite install, read on:
  3. still in the database, navigate to the wp_sitemeta table and look for the meta_key: site_admins.
    • There will be an entry like: <pre>a:1:{i:0;s:4:”john”;}</pre> and change it to the username you created in step 2. You will also need to change the “S:n” (in this case “s:4”) to a new value depending on the length of your username. So you’ll note for “john” it’s 4. For “john-you-won’t-guess-this-827646″ you would make the entry:<pre>a:1:{i:0;s:31:”john-you-wont-guess-this-827646”;}</pre>. For reference, the “i:0” is Index 0. If you have multiple users here, this line will have multiple indexes with each one serialised onto the line and having their own section. Make sure you change the correct one(s).

Not doing this final step will not kick you from the individual site admins, but it will prevent you from getting to the Network Settings area to add plugins, themes and do other “network” maintenance things (like adding or removing sites amongst others).

I’ll let you know now, I learned about step 3 the hard way after being locked out from the Network Settings area after changing my main username.

I could do everything an admin could do for their site, I just could no longer administer the network.

Searching the net found this entry on and solved my problem.

Youtube embedded videos in WordPress not working

You’ll notice above that there is a youtube URL on the first line… it hasn’t embedded within the post.

UPDATE 2015-12-10: it’s working now, is it a WordPress 4.4 thing? I have disabled a LOT of plugins for the moment, I’ll come back and revisit this in the next couple of days. I have spent many hours working on this problem over the last few months and having just found I’ve had other issues, I’ll revisit this again

Embed the URL without embed tags

Embed the URL without embed tags

Also, I have just learned today that the youtube style of embedding without embed tags have been extended in WordPress 4.4 to include URLs to your own WordPress site (and possibly others).

Are you finding your{videocode} youtube links not embedding correctly or working in WordPress?

The correct format for the link is any one of the following:{videocode}{videocode}
[ embed]{videocode}[/embed ]

(there is a space before the embed in the above one to have it display correctly)

There are three things to watch out for to ensure this works. And if you do each of these, then you don’t need to use the [ embed ] code you see in the third example above. They are:

  1. Ensure the URL is on it’s own line
  2. Ensure you use HTTP in lieu of HTTPS (*1)
  3. Ensure the link does NOT appear on the first DISPLAYED line of the content

*1 : this is not a big one, since it seems most of the time it works, but for some reason it didn’t when I used it on this particular occasion.

I say DISPLAYED because in an effort to fix this, I tried putting a blank line for the first line. The problem persisted. It also didn’t help to include just a full-stop (period) there either.

I do believe it could also be theme related as this theme does not use the different post type options that is present in the newer themes. And from what I did find elsewhere, selecting different options in that meta-box can alter this behaviour. I will probably be changing themes in the coming months as I work further on my own custom theme, but for the time being if I want it to appear on the first line, I will use the appropriate [ embed ] code above (with the space removed!). This was not a problem I found documented anywhere else, so hopefully you have found this useful!

WordPress media library limited to 10MB

Screenshot 2015-09-14 11.23.102

I think I’m a little over my quota!

Have you ever noticed this in your blog? It’s never been there before, but it appeared in the last day or two. At the time I wasn’t sure how or why. It’s my blog hosted on one of my web hosting accounts, and I have no shortage of space. So why was I getting this warning?

Screenshot 2015-09-14 11.35.24Worse yet, I went to add a photo, and this happened. That’s when I realised the quota was real!

My first question is, what dickhead gave me such a quota!

My first action was to work out where it was imposed.

Then I found who the right royal dick was. It was yours truly!

I’ve been doing too much playing in the back end and I at some point, and for some unknown reason, have turned it on.

I’m running WordPress Multisite and it’s a setting hidden in the Network Settings.

To navigate to it, click on My Sites in the top left corner, and select Network Admin. Then from the next menu select Settings.

secret hiding place for the 10MB upload quota

this little setting on the right… Make sure you turn it off! :)

And that’s it! Once, you clear that little baby, you’ll be able to upload to your little hearts content.

UPDATE: It looks like I wasn’t the only one who’s ever done this! 

WordPress MultiSite & sunrise.php

Are you getting the above error message as well?

After doing a fresh install and enabling multi-sites I couldn’t see the Domain Mapping and Domains sub-menu options under Network Admin / Settings.

I loaded up my trusty editor and confirmed

define('SUNRISE', 'on' );

was in fact in the file. It was slightly higher than where it said, it’s not important, but I moved it anyway, and I still got the error.

I checked and sunrise.php was in fact in the correct location under /home/public_html/wp-content/sunrise.php

So how did I fix it?

The problem was, it was the incorrect (read:old??) sunrise.php file!

Copy the correct one from:


and replace the previous one, and reload your admin page. You will now see the welcoming domains page :D

If you want to find out more as to why it happened, and how it is that my sunrise.php got “moved” or “re-moved”, it was due to a conflict by domain mapping plugins. I’ll be blogged about it in the near future and it will appear here (currently in draft and not published).

Chrome 45 attacks WordPress admin menu

wordpress-chrome-broken-mergedChrome has taken a turn towards the dark side and has attacked the WordPress admin menu. Luckily there’s a simple workaround and a bug report has been filed which will hopefully lead to a fix soon!

The bug is specifically Chrome related (you can read more here) and they are currently working on a fix that should see it’s way into version 46 stable.

There are several fixes for this bug, rated in (my) order of best solutions:

  1. visit: chrome://flags/#disable-slimming-paint (<< unclickable, you’ll have to enter it yourself :) ) in your browser and select ENABLE (from comment #42). The quickest and easiest solution.
    Screenshot 2015-09-10 08.09.28
  2. Add the following action to the WordPress’ functions.php file (from comment #37):
    function admin_menu_fix() {
      echo '<style>
        #adminmenu { transform: translateZ(0); }
    add_action('admin_head', 'admin_menu_fix');
  3. Collapse and re-Expand the Admin menu is a temporary fix, as is refreshing the screen, but that’s a PITA.
  4. There is also a chrome extension that also deals with this issue: more can be found out here
  5. There is also WordPress plugin, and it will ALSO do the trick. I don’t mean to detract from the developer, but I am very anti installing unnecessary plugins if you really don’t need to. But the fact I haven’t provided you a link only means you’ll spend longer looking for it than you would have spent if you just go and change the option in Chrome settings.
  6. Wait for a fix, which SHOULD be in appearing in an update near you soon :)

#3, and #6 really aren’t options. #4 and #5 are workarounds that will only help users who experience the problem with WordPress and no other sites that are also affected (although this does appear to be somewhat limited), leaving #2 (which is also only a WordPress fix) and is way too much overkill.

And the winner is?

The best solution is #1 and this will take you all of about 5 seconds. It is the BEST solution because this fixes other areas the bug affects (which for me) is my gMail menu where things haven’t been right for a while but a refresh fixed it. In fact, refreshing the page in WordPress also fixes it, as does collapsing and expanding the admin menu.

Anyway, you AND I have spent far too long on this post! So go ahead, open the above in your browser and fix the menu :)


WordPress MU Domain Mapping missing

Screenshot 2014-12-02 05.39.14

Screenshot 2014-12-02 05.55.36

Domain Mapping and Domain options returned

When upgrading from version to and returning to the network admin site, I had lost all access to the domain management tools. The options normally reside under Settings (right) were no longer there. A quick check of some domains I have setup through domain mapping confirmed that it was still working, ie things were being redirected, however I couldn’t check, change, add or remove any mappings. I couldn’t see them at all.

I went into the Network Admin plugins page to find the plugin hadn’t re-enabled itself after the update. As far as I know, this is the first time any plugin has failed to reactivate. If this was by design, a few moments of stress would have been alleviated if some user warning could have been provided.

After re-enabling the plugin, all domain maps were right where they should have been.