How To Better Detect Your Mobile Visitors with WordPress’s WP_is_mobile Function

Although WordPress themes typically use Responsive Web Design to tailor websites for mobile devices, sometimes you may need to use PHP (the language WordPress is written in) to detect whether your visitor’s web browser is running on a mobile device. For example, you may want to output certain HTML markup (such as a mobile navigation menu) on mobile devices. Alternatively, you may only want to output a slider containing large images on desktop and not mobile devices. Doing this via PHP (instead of CSS) means that your visitor’s mobile browser won’t have to download all of the slider images even though the slider is never displayed, which also means that your site will load faster for your mobile visitors.

wp_is_mobile() is a function built into WordPress that detects whether the visitor is using a mobile device such as iPhone, iPad, Android, Silk, Kindle, BlackBerry, Opera Mini, and Opera Mobi. This is a conditional function, which means it returns one of two results: true or false. It’s located in wp-includes/vars.php.

The function was introduced in WordPress 3.4, and it can be used in a WordPress plugin or theme.

Here’s a simple example:

<?php
if ( wp_is_mobile() ) { // Visitor is on a mobile device} else { // Visitor is on a desktop (not mobile) device}
?>

WordPress core currently uses this function in a few different places:

  • To completely disable the Visual Editor for Opera Mini.
  • To enable jQuery UI Touch Punch in the WordPress dashboard for mobile devices.
  • To detect whether the current device can upload files.
  • To disable the “shake” effect on the WordPress login page when an incorrect username or password is entered using a mobile device.

You can also use this function to hold mobile-specific content, such as the navigation menu mentioned above. <?php if ( wp_is_mobile() ) {
/* Display and echo mobile specific stuff here */
} ?>

Apache Binary Backdoors on Cpanel-based servers

One thing that can be said about web security is that it is never boring. Sucuri has an alert on a naughty little exploit which, instead of using previously seen methods like adding modules or changing Apache configurations, replaces the Apache binary (httpd) with a rotten one. Definitely eye-opening. See the link for data from Esset as well on this.

Apache Binary Backdoors on Cpanel-based servers

How Tony Perez of Sucuri Sets Up His Own Security

there have been a lot of posts about various wordPress security issues over the last couple of weeks, some of them giving good security advice and a lot of others giving not so hot advice. Here’s a post by Tony Perez (who is probably the greatest master of WordPress security) where he talks about what he does when setting up his own wordPress sites. I’m not affiliated with Tony at all, but I’ve heard him talk a couple of times, and he’s extremely knowledgeable when it comes to security. Tony links to a lot of other good posts, so be sure to read those as well.

How To Add a Simple User Password Generator in WordPress

WPBeginner has this article on adding a simple password generator to your self-hosted WordPress site. This is especially useful when you’re creating new users, and definitely a must for multi-author blogs. Given the problems with brute force attacks on WordPress sites that have occurred within the last few weeks, this is especially relevant.

The Status of Women In WordPress

Shannon Smith has an interview over at Chroni on the status of women in the WordPress community, which along with detailing some of the problems, addresses how women can get more involved.

Wordsesh Starts Tomorrow: Will You Be there?

Tomorrow marks a first in the WordPress community. there are WordCamps and meetups for WordPress all over the world, and at various times of the year. But tomorrow, (or Saturday according to UTC), we’re going to see what I hope will become a continuing trend: A virtual WordCamp called wordSesh. It’s being sponsored by WooThemes, and will be twenty-four hours of completely awesome WordPress content. The schedule of speakers is at the official WordSesh site, and you’ll be able to stream the content from there as well. Recordings of all the sessions will be available as well after the conference is over. I’d like to see if I could attend for the whole twenty-four hours, but I doubt that will happen, no matter how cool it would be. But I’ll definitely be listening to everything and blogging on it as well.

So the only question left is will you be there? I know there are a lot of bloggers using WordPress, and there will be content for everyone from end users to developers. I highly recommend attending. Hope to see you this weekend.

Could You See Cloud-based Computing Replacing Your Traditional Desktop Experience?

I was going through my RSS feeds, and found a good way to further expand on the topic of cloud-based computing persuant to my earlier post on Chrome os and Chromevox. Lennard, (who doesn’t have a website, or else I’d link to him), left a comment in which he brought up some issues with cloud-based operating systems like Google’s Chrome os. I’m interested in taking that discussion a little further. So I’m turning it over to the readers. What do you think about using computers which are cloud-based, meaning that they are basically like dumb terminals with a net connection? If you spend a lot of time online already, could you see yourself going whole hog and switching to an operating system (like Windows, for example), that didn’t run on your computer, but ran on a server somewhere that you connected to in order to get your workdone, or just to play? What are your thoughts?

The Electronic chuppah

by Rabbi Stephen Baars 

New doesn’t always come with improved.

There are some things in life you never thought you would see. I’m not talking about peace in the Middle East, or the fall of the Berlin Wall, or bubble gum ice cream. I mean something that I was witness to today; actually I was an active participant.

It all started innocently enough, the wedding was called for noon, and wanting to be early we showed up at 12:20 for what we thought would be a good hour till anything started.

It was lucky that we decided to be “early” because we got there just in time to walk the bride down the aisle. Since when did weddings start on time? Anyway, we embarrassingly found a seat and sat back to enjoy the show.

Almost immediately everyone could see something was amiss. The Rabbi who was marrying the couple looked nervous and soon a huddle formed under the chuppah. I am sure you’ve seen the scene before — everyone who thinks they know anything joins in. It looked ominous.

What could it be? Did the bride change her mind? Did the Rabbi find a stain in his tie?

Then, someone seemed to have a solution and one of the men turned and looked directly at me!

You know those moments that all Jews fear, you are sitting in synagogue minding your own business when the president of the congregation comes over and asks you to make the blessing over the new Shlamboodle.

You would normally ask what on earth is a Shlamboodle? But he asks in a way that implies every idiot knows what it is, not only that, but, as the president explains, it’s an honor.

Well, I was sure he was looking at the guy behind me, because I had no idea, “Why me?”

But it was me. He rushed over and said, “Do you have the blessing for the wedding?”

“All I have is a handkerchief. Will that do?”

I decided to join the huddle and figure out what was going on.

The Rabbi came in from New York to do the wedding, and somehow the hotel had lost his Prayer Book with the blessings in it, and it seemed that I was the most likely person to have one on me.

“Sorry,” I explained. But, now it was my problem too. Unfortunately, he nor I had a clue what to do. Then it came to me. I have one of those Smartphones, the kind that does email, notes, schedule, and makes it really difficult to make a call.

 
When would anyone want to use a phone to conduct a wedding? This was that time.   
 

I had bought some software from Pilot-Yid for the phone that has all the regular prayers on it, and when I went through the program I noticed it had the Wedding Service. At the time I thought to myself, when would anyone want to use a phone to conduct a wedding?

This was that time. Now I have to explain, this Rabbi looked like he could have just walked off the scene of Fiddler on the Roof, so I thought I had to explain what a Smartphone was. But it was a day for surprises

Originally published at Customerservant.com. You can comment here or there.

All Wrapped Up Into One Installer

Wp seems to have eaten the last incarnation of this post, so we’ll try this again.

There’s an app I use called Online Bible, which, as the title suggests, allows one to study/read the Bible, (and whatever other books one decides to import into the thing), on one’s PC.
It’s a very powerful app, allowing, among other things, the creation of one’s own modules by simply marking up a text file.
Someone’s even created three different translations of the Qur’an for the thing, and after eight years of use, I still haven’t figured out how they did it.
The only drawback I’ve found with the program is that if you’ve acquired a ton of modules like I have, a complete install can take at least three hours, and that’s if you work at it non-stop.
What I’m trying to find out is if there is a way to create a single install for everything, so that I can avoid this if I ever have to reinstall.
You can back up all the modules, and when you’re creating modules for distribution, there’s a setup utility that can be included so that a user can run a self-extracting archive and have the module automatically install.
I’m thinking that this method may be used to create a single install, if I include all the backups in the same directory, and also include the setup utility.
I’ll post more if I get more information.

Originally published at Customerservant.com. You can comment here or there.

Microsoft forced to offer XP for ULCPCs, Vista shafted again

By Emil Protalinski | Published: June 03, 2008 – 10:21AM CT

Following the Intel unveiling of Atom-based products at Computex yesterday, Microsoft’s own Computex announcement for netbooks, also called ultralow-cost PCs (ULCPCs), has arrived: Windows XP is coming to these devices. After extending the life of XP Home for 2 years for budget laptops back in April, Microsoft’s partners have reported strong enough demand for the software giant to do the same for ULCPCs.

(More here).

 

Originally published at Customerservant.com. You can comment here or there.