WordPress plugin intelligence profile

Nginx Mobile Theme

This plugin allows you to switch theme according to the User Agent on the Nginx reverse proxy.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 4.9
Current version1.8.2
WordPress coverageTested up to WordPress 4.9
Minimum stackWP 3.7.1 · PHP —
Directory statusactive
Last directory update17 Oct 20188y ago
Active installations200Adoption metric — not a quality score
WordPress.org rating5.0 / 5 from 2 ratings
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Nginx Mobile Theme version 1.8.2 as active, updated 8y ago and tested up to WordPress 4.9.

Overview

About this plugin

This plugin allows you to switch theme according to the User Agent on the Nginx reverse proxy.

Nginx Mobile Theme’s requirements are as follows.

  • PHP 5.3 or later
  • WordPress 3.7 or later
  • Nginx Cache Controller 2.0.0 or later

Some Features

  • You can flush mobile’s and pc’s each caches automatically via Nginx Cache Controller.
  • Allow you to switch theme according to the user-agent.
  • Allow you to customize multiple mobile device support via filter-hook.

Nginx Configuration

conf.

set $mobile ''; if ($http_user_agent ~* '(iPhone|iPod|incognito|webmate|Android|dream|CUPCAKE|froyo|BlackBerry|webOS|s8000|bada|IEMobile|Googlebot\-Mobile|AdsBot\-Google)') { set $mobile "@smartphone"; }

Set proxy_cache_key.

proxy_cache_key "$mobile$scheme://$host$request_uri";

Send custom request header to the backend.

proxy_set_header X-UA-Detect $mobile;

Nginx Mobile Theme will switch theme when ‘@smartphone’ is received in the $_SERVER['HTTP_X_UA_DETECT'].

How to use

  • Please access to the theme-customizer in the WordPress admin area.
  • Please select Mobile Theme in the drop-down.
  • Click “Save & Publish” button to save.

Multiple mobile device support

  • Add custom mobile detection to the nginx.conf.
  • Add custom mobile detection to the WordPress via nginxmobile_mobile_detects filter-hook.

conf:

set $mobile ”;

if ($http_user_agent ~* ‘(iPhone|iPod)’) {

set $mobile “@smartphone”;

}

if ($http_user_agent ~* ‘iPad’) {

set $mobile “@tablet”;

}

In your custom plugin:

add_filter(‘nginxmobile_mobile_detects’, function(){

return array(‘@smartphone’, ‘@tablet’);

});

  • As a result, allow you to select theme for @smartphone and @tablet individually in the theme-customizer.

Amimoto Support

The Amimoto is a full-tuned WordPress AMI on the AWS EC2.

  • Uncomment /etc/nginx/conf.d/default.conf in line 17

before:

#include /etc/nginx/mobile-detect;

after:

include /etc/nginx/mobile-detect;

  • Add line to /etc/nginx/nginx.conf like following.

before:

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header Accept-Encoding “”;

after:

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header Accept-Encoding “”;

proxy_set_header X-UA-Detect $mobile; # add new line

-

php

define(‘IS_AMIMOTO’, true);

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • mobile
  • nginx
  • smartphone
  • tablet
  • theme
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 4.9

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 4.9.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to4.9
Minimum requirementsWordPress 3.7.1 · PHP not listed
Update activity17 Oct 20188y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.