Option to update to WordPress 4.9–en_GB Missing

On one of my websites the option to update to the local language version is missing.

This is what I’m expecting to see

An updated version of WordPress is available.
You can update to WordPress 4.9–en_GB automatically:
This localised version contains both the translation and various other localisation fixes. You can skip upgrading if you want to keep your current translation.
You can update to WordPress 4.9–en_US automatically:

While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.

But for this site I only had the option to do the non-localised language update.

How to install the en-GB version of WordPress?

in the root file wp-config.php I had

//define(‘WPLANG’, ”);
define (‘WPLANG’, ‘en-GB’);

I found that this is now deprecated. As of WordPress version 4.

To set the locale for the WordPress website the variable $locale is set accordingly within the file wp-config.php, found in the root of the website.

I replaced it with

//define(‘WPLANG’, ”);
//define (‘WPLANG’, ‘en-GB’);
$locale=’en_GB’;

and it worked!

Note the change from a hyphen to and underscore.

Further Reading

If you are interested in reading further about wplang and its deprecation these links may interest you.

wplang WordPress forum

wplang in wp-config

wplang deprecation in version 4 notification

Changeset 29630

Disable Login Using Email Address

WordPress allows login by either username or email address.

But, email addresses are more likely to be common knowledge. Or perhaps easier to guess. We tend to keep our email addresses to set patterns.

Its all very well having a fancy obscure username but if the email address associated with the account is easily guessable, all that effort has been wasted.

An email address could be created, just for logging into the website. It could be made obscure and configured to forward emails. But this is looking like a username. Would it not be better to configure WordPress to block logins using email addresses, only allowing logins using a username and password?

A set of random characters, upper case and lower case, together with numbers and symbols can make a good choice for a username, but not a good choice for an email address. Who would be comfortable receiving an email from such an address?

Do you really wish to create a separate obscure email address (a shadow email address) for every registered user – or at least admin user of a WordPress website?

I can explain to my customers the need to have an obscure username to access their website. But to suggest that a second email address should be created for them to use…

So I have another little section of code to be added to the functions.php file included within my theme files.

/*
* Block login by email address
*/
remove_filter( 'authenticate', 'wp_authenticate_email_password', 20 );

There you are the simple solution.

With the above code login to a WordPress website using the account email address is blocked. Access using the likely more easily guessed email address has been stopped.

Now to sell to my customers the idea of using a username as equally obscure as their password!

 

Deleting the WordPress Uncategorized Category

So you have numerous blog posts, on your WordPress website, which are assigned to the uncategorized category.

Maybe you have recently imported lots of posts or perhaps found that you forgot to set the category when creating the posts.

For myself I was transitioning a website and had forgotten to consider this category assignment. Each imported post was assigned to the default uncategorized category.

Considering the situation, I really didn’t want every blog post to have this category assigned. Which led me to ask the questions:

Can I simply delete the uncategorized category?

What about all the posts which have this category assigned?

Let’s begin by reviewing the categories. Navigate to the categories, under the posts at the left menu.

Remove WordPress Uncategorized Category List of Caetgories

As can be seen in the above image because the uncategorized category is set to be the default it’s not possible to delete it.

The next admin page to visit is the Writing Settings.

Start by changing the default category

Remove WordPress Uncategorized Category Writing Settings

Here we’ll change the default category to something else.

Change the category to one you are most likely to use. It’ll save effort in the future and will provide a safety net, in case you forget to set one.

Remove WordPress Uncategorized Category Delete Unwanted Category

Once deleted each post which was assigned to the uncategorized category will be assigned to the new default category.

But STOP think about this next step.

As the situation was I knew which posts had recently been imported – they were all assigned to the uncategorized category.

If I were to now choose to set my most likely used category as the default and delete the uncategorized category all of these per would be mixed up. Not all of the posts world be correctly associated to the category.

For example if I set the new default category as fruit then that would work well for plums, apples and pears. But deleting uncategorized and consequently automatically associating carrots and brand to the category fruit would be wrong. How would I spot these wrongly associated categories?

To finally complete the task would entail reviewing the list and unassigning via Quick Edit as required.

It’s easy to list those entries assigned to uncategorized, a simple filtering by category on all posts is all that’s required.

Each of these entries can be edited as necessary using Quick Edit.

But it’s time consuming. Against this – there is less chance of making and maintaining a wrong association.

Once your list of filtered entries is down to 0 the uncategorized category can be removed and a new default set.

From this exercise in importing posts I concluded that whilst the uncategorized category can be deleted before starting, its better to leave it in place. Or create/rename the category as Imported. The posts should then be reviewed unassigning them from the imported/uncategorized category until the list of assigned entires is zero. Only then can the uncategorized category be deleted.

Which is Correct <b> or <strong> ?

Using the WordPress editor. When I bold a piece of text the HTML added to wrap it is <strong> … </strong>

When I use the WordPress Android app the HTML used is <b> … </b>

Which is correct to use <strong> or <b>? Does it matter which I use? And in this age of HTML correctness for better SEO ranking is there a difference?

The original interview with Matt Cutts is from 2006. Subsequently some changes in SEO may have occurred.

The gist is that using one or the other shouldn’t make any difference.

But SEO is a moving target and things do change.

There was a time when the new line tag <br> and image <img src=”..”> were accepted. Now single tags must be closed, giving:

<br /> and <img src=”..” />

So do keep aware of the situation.

<b>

The w3 Schools HTML <b> Tag reference simply states that the <b> HTML tag specifies bold text.

The page suggests that this is a tag of last resort. Preference should be given to the <em> tag, the <mark> tag or even the <strong> tag.

Browsers will render the tag as font-weight:bold; Which is different to the implied higher priority <em> tag which is rendered as font-style:italic;

<strong>

w3 Schools has a different emphasis for the HTML <strong> tag. It calls it a phrase tag.

Is there a hint that the tag may become deprecated? Its suggested that better effects can be used with CSS.

It is rendered as font-weight:bold; by browsers.

It also details that back in HTML 4 the tag was used for emphasised text. Now it is important text.

Conclusions

Currently there is no advantage given to the use of either tag <b> or <strong> by Google.

Taking the use of HTML tags in the correct order, as taken from the w3 Schools website <strong> has the greater priority over the use of <b>.

Browsers reference the two tags the same.

References

https://www.searchenginejournal.com/matt-cutts-strong-bold-tags-seo/74073/

http://searchengineland.com/googles-matt-cutts-no-reason-to-fret-over-174713

https://www.youtube.com/watch?v=awto_wCeOJ4

HTML Phrase Tags

Many of the HTML tags are there to provide structure. The purpose is to create the columns and rows of content.

The HTML phrase tags provide enhancement to the content, affecting the rendering.

For a paragraph of text emphasis can be given to particular words, by the use of phrase tags.

Whilst most of the phrase tags present their wrapped content as bold or italics, as per the tags <b>, <i>, <pre>, and <tt>, their use is more than a duplication of other tags. They provide more detail and indication about their wrapped content. Take for example the address tag. This informs the search engine robot about the type of wrapped content.

In HTML, there are tags which are used to perform specific operation. It is somewhat similar to text formatting tags. There are some situation where you would like to highlight some word, add quotation, display code in different form etc. to highlight the text in web page.

A phrase tag is used to indicate that a block of text has structural meaning. For example, using the <abbr> tag indicates that the word or phrase contained within is an abbreviation or acronym.

Below is a table of the HTML phrase tags:

Tag Name HTML Tag Tag Description
Acronym <abbr>..</abbr> Used to show the acronym within the body of text, without disturbing the flow. A popup showing the full text will appear when hovering over the acronym .

For example:

<abbr title=”Do It Yourself”>DIY</abbr> home projects

DIY home projects

Acronym <acronym>..</acronym> Deprecated, see <abbr>
Address Text <address>..</address> Indicates an address within the page. This is an indication to the search engine indexing robots more than to the website visitor.
Computer Code <code>..</code> The text is shown with an old style computer programming effect. It also adds a reassurance that the code is meant to be shown this way and not just genuine page structural code which has escaped to public view.

It is generally rendered by browsers using the monospace font family.

Emphasis <em>..</em> Indicates emphasis, not simply the highlighting of a word or phrase within a sentence. Words which convey a strength of action such as must and will are candidates for wrapping within this tag.
Keyboard Text <kbd>..</kbd> Another of those tags which reflects computer/keyboard entry.
Mark <mark>..</mark> This is used to highlight sections of text. CSS styling will override the default yellow background.

For example:

Tomorrow’s <mark>finance</mark> meeting is at 3pm.

Tomorrow’s finance meeting is at 3pm.

Programming Variables <var>..</var> This is used to highlight variable text in web page.
Sample <samp>..</samp> Another computer code tag. Used to define a section of sample code.
Quoting <blockquote>..</blockquote> This is used to show that the wrapped text has been derived from another website.
There’s a default associated rendering which is often overridden in the style of the website.
Short Quotations <q>..</q> This is used to add double quotes within a paragraph or sentence.
Strong <strong>..</strong> This is used to give importance to the text in web page.
Text Citations <cite>..</cite> Used to show that the reference is a citation. For example
<p>Examples taken from the VNTweb articles<cite>Which is Correct <strong> or <b>?</cite>
Text Direction <bdo>..</bdo> This is used to override text direction in web page.
For example: <bdo dir=”rtl”>Converting the flow to backwards</bdo>Converting the flow to backwards

Use of the different types of phrase tags allows for their styling to be tailored within the website’s CSS files adding the website’s own presentation for each and able to exploit the different types to best effect. For example some websites will pull the block quote out with either one or two large quotation marks.

Turn off Identity Whilst Inserting SQL Table Row

Inserting table rows including the index idents will give an error similar to:

Cannot insert explicit value for identity 
column in table TableName when IDENTITY_INSERT is 
set to OFF.

I was copying the contents of a database table from one installation of DotNetNuke to another.

Wishing to maintain the table structure, parent and child references meant that to best recreate and copy the table I should maintain the existing index identify values.

The table used the table unique identity index to create a parent and child relationship between some of the rows.

To export the table I was able to select all of the table content and display it as a table.

The table of data could then be copied into an editor (Geany) to add the necessary insert SQL.

To properly maintain the table data and allow a true reproduction the interlinking between the rows must be maintained. To adhesive this the index ident must be imported.

A table will automatically assign the route ident when the route is inserted. If the field is included as part of the insert statement the insert will fail with an error.

To overcome the block on the insert into the ident field i turned off the restriction at the start of my SQL insert and restore it again afterwards.

For a table with an orienting set on one of the fields performing a simple insert will fail beaches the identity field doesn’t permit is valid to be set.

To overcome this I top and tailed the insert statements with identity on and off

SET IDENTITY_INSERT GalleryAlbum ON

Insert of table rows SQL

SET IDENTITY_INSERT GalleryAlbum OFF

WordPress Missing Text Underline in Editor

I can’t find an underline option in the WordPress editor.

How to underline text?

I’ve used the WordPress plugin TinyMCE Advanced before to allow a client to set the font size.

I added it to the website, this time to be able to select words in the post to be underlined.

WordPress missing text underline

The TinyMCE Advanced plugin adds an additional line of editing options to the editor, above the existing set of icons.

Highlight the words to be underlined. From the new editing options click on Format and select underline.

Looking at the drop down menu of options I was reminded of the <CTRL> key combination for underlining: <CTRL> + u.

I disabled the plugin and tried underlining some text within the editor using <CRTL> + u. As expected it worked!

If you are missing the underline icon within the WordPress editor you can still underline text using a key combination or by adding a plugin.

The Remote Certificate is Invalid

Configuring the SMTP settings on a DotNetNuke website gave the error, remote certificate is invalid, from the mail server:

There has been an error trying to send the test email. The error is:
The remote certificate is invalid according to the validation procedure

I often find that errors on a DotNetNuke website are logged with further information in the Event Log. To view this navigate to Admin/Event Viewer, from the top navigation bar.

Dependant upon how many messages are created on your website, for example users logging in, the error message which you are looking for may be on the second or third page. If necessary take a note of the time and force the error again, to get it on the first page.

In the Event Viewer log the gist of the error message was:

There has been an error trying to send the test email. The error is:
The message was not delivered to the following address(es) –

I found error relay not permitted.

Where the SMTP host settings for the DotNetNuke installation is configured to use a defined mailbox if choosing to use a secure connection the domain name of the certificate and mail account needs to be the same domain as that configured in the settings.

The error may be resolved by either using a mailbox with the correct domain certificate. or by using an unsecured mailbox and unticking the SSL option.

web.config Redirect non-www to www

That often looked for website redirect from the non-www version of the website URL, address, to the www version.

In this case the redirect is for a Windows hosted website, using the web.config file to set the redirect rules.

I wish to avoid adding the redirect within the website coding. By taking advantage of the redirect rules within the web.config file. This will make them readily available and can be edited without recompiling the website code.

Access your website either using FTP or the editor/manager within the housing website control panel.

The file to be edited is located at the root of the website. This may be a directory down. Check if you have a directory such as public_html.

It’s easier to edit the content of the web.config file of is laid out correctly and colour coded. An HTML editor will make your life easier when editing.

Shown below is the code to add the redirect of the non-www address to www to be added to the web.config asp.net website configuration file:

<rewrite>    
    <rules> 
        <rule name="Canonical" stopProcessing="true"> <match url=".*" /> 
            <conditions> 
                <add input="{HTTP_HOST}" negate="true" pattern="^www\.([.a-zA-Z0-9]+)$" /> 
            </conditions> 
            <action type="Redirect" url="http://www.{HTTP_HOST}/{R:0}" redirectType="Permanent" /> 
        </rule> 
</rewrite>

The above is to be added within the section <system.webserver>

As as a bonus below is the HTTPS version too!

<rewrite>    
    <rules> 
        <rule name="Redirect to HTTPS" stopProcessing="true"> 
            <match url="(.*)" /> 
            <conditions> 
                <add input="{HTTPS}" pattern="^OFF$" /> 
            </conditions> 
            <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" /> 
        </rule> 
    </rules> 
</rewrite>

Putting this all together gives:

<rewrite>    
    <rules> 
        <rule name="Canonical" stopProcessing="true"> <match url=".*" /> 
            <conditions> 
                <add input="{HTTP_HOST}" negate="true" pattern="^www\.([.a-zA-Z0-9]+)$" /> 
            </conditions> 
            <action type="Redirect" url="http://www.{HTTP_HOST}/{R:0}" redirectType="Permanent" /> 
        </rule> 
        <rule name="Redirect to HTTPS" stopProcessing="true"> 
            <match url="(.*)" /> 
            <conditions> 
                <add input="{HTTPS}" pattern="^OFF$" /> 
            </conditions> 
            <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" /> 
        </rule> 
    </rules> 
</rewrite>    

Technically it’s a 301 or 302 redirect. Looking at the code above it can be seen that I’ve used the redirectType parameter value of permanent showing the redirect to be of type 301. web.config rewrite rules to permanently redirect non-www to www.

Blend two Images with the GIMP

I use the Gimp to edit and produce artwork. For a project I wished to blend the edge between two images.

Whilst working on a recent slider for a website. The images I had to work with were either the wrong orientation or just not quite long enough to be used as single images.

I wanted to join a couple of images together to create a composite image, the full width of the slider. This would also allow me to convey more information on a single slider image view.

Blending two images together to get a smooth transition rather than a hard edge makes it more appealing. Even if the edge is only a few pixels it will be easier on the eye.

Using the Gimp I took two images for a slider and blended the join between the two to create a fade between them.

Here I am using two pictures from Bergen. To begin with in a new image I added the two images, one per layer, leaving the background untouched. To make this work best an overlap of the two images is required.

Blend images with the Gimp: initial layers

The layers are shown in the Layers Window: the image of the troll, the view of Bergen from Mount Fløyen and the generic background layer.

Blend images with the Gimp: layers window

In the layers window, for each of the layers, right click and select to Add Layer Mask.

Blend images with the Gimp add layer mask to layer

Ensure that the option White (full opacity) is selected

Blend images with the Gimp add layer mask

With the layer masks added again right click to view the properties, check to ensure that the check box for Edit Later Mask is ticked.
image here

Blend images with the Gimp confirm edit layer mask set

From the tools window select the blend tool. The foreground and background colours should be black and white respectively.

Blend images with the Gimp select blend tool

Between the transition of the two images drag the blend tool line, if horizontal of vertical holding down the ctrl key helps to keep it at 0, 90, 180 or 270 degrees.

Drag as far as you need to create the blended transition. The longer the line the great the overlapping transition.

Blend images with the Gimp layers blended