{"id":26121,"date":"2013-11-08T05:20:19","date_gmt":"2013-11-08T05:20:19","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/nginx-mobile-theme\/"},"modified":"2018-10-17T09:01:52","modified_gmt":"2018-10-17T09:01:52","slug":"nginx-mobile-theme","status":"publish","type":"plugin","link":"https:\/\/it.wordpress.org\/plugins\/nginx-mobile-theme\/","author":175046,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.8.2","stable_tag":"1.8.2","tested":"4.9.29","requires":"3.7.1","requires_php":"","requires_plugins":"","header_name":"Nginx Mobile Theme","header_author":"miyauchi, megumithemes","header_description":"","assets_banners_color":"f2e0c8","last_updated":"2018-10-17 09:01:52","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/amimooto-ami.com\/","header_author_uri":"https:\/\/amimooto-ami.com\/","rating":5,"author_block_rating":0,"active_installs":200,"downloads":225542,"num_ratings":2,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"2"},"assets_icons":[],"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":"802244","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.1.0","1.2.0","1.3.0","1.4.0","1.5.0","1.6.0","1.7.0","1.8.0","1.8.1","1.8.2"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"802002","resolution":"1","location":"assets"}},"screenshots":{"1":"theme-customizer"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[841,2437,4895,2645,1141],"plugin_category":[],"plugin_contributors":[78380],"plugin_business_model":[],"class_list":["post-26121","plugin","type-plugin","status-publish","hentry","plugin_tags-mobile","plugin_tags-nginx","plugin_tags-smartphone","plugin_tags-tablet","plugin_tags-theme","plugin_contributors-miyauchi","plugin_committers-miyauchi"],"banners":{"banner":"https:\/\/ps.w.org\/nginx-mobile-theme\/assets\/banner-772x250.png?rev=802244","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/nginx-mobile-theme_f2e0c8.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/nginx-mobile-theme\/assets\/screenshot-1.png?rev=802002","caption":"theme-customizer"}],"raw_content":"<!--section=description-->\n<p>This plugin allows you to switch theme according to the User Agent on the Nginx reverse proxy.<\/p>\n\n<p>Nginx Mobile Theme's requirements are as follows.<\/p>\n\n<ul>\n<li>PHP 5.3 or later<\/li>\n<li>WordPress 3.7 or later<\/li>\n<li><a href=\"http:\/\/wordpress.org\/plugins\/nginx-champuru\/\">Nginx Cache Controller<\/a> 2.0.0 or later<\/li>\n<\/ul>\n\n<h4>Some Features<\/h4>\n\n<ul>\n<li>You can flush mobile's and pc's each caches automatically via <a href=\"http:\/\/wordpress.org\/plugins\/nginx-champuru\/\">Nginx Cache Controller<\/a>.<\/li>\n<li>Allow you to switch theme according to the user-agent.<\/li>\n<li>Allow you to customize multiple mobile device support via filter-hook.<\/li>\n<\/ul>\n\n<h4>Nginx Configuration<\/h4>\n\n<p>Add mobile device detection to the nginx.conf.<\/p>\n\n<pre><code>set $mobile '';\nif ($http_user_agent ~* '(iPhone|iPod|incognito|webmate|Android|dream|CUPCAKE|froyo|BlackBerry|webOS|s8000|bada|IEMobile|Googlebot\\-Mobile|AdsBot\\-Google)') {\n    set $mobile \"@smartphone\";\n}\n<\/code><\/pre>\n\n<p>Set proxy_cache_key.<\/p>\n\n<pre><code>proxy_cache_key \"$mobile$scheme:\/\/$host$request_uri\";\n<\/code><\/pre>\n\n<p>Send custom request header to the backend.<\/p>\n\n<pre><code>proxy_set_header X-UA-Detect $mobile;\n<\/code><\/pre>\n\n<p>Nginx Mobile Theme will switch theme when '@smartphone' is received in the <code>$_SERVER['HTTP_X_UA_DETECT']<\/code>.<\/p>\n\n<h4>How to use<\/h4>\n\n<ol>\n<li>Please access to the theme-customizer in the WordPress admin area.<\/li>\n<li>Please select Mobile Theme in the drop-down.<\/li>\n<li>Click \"Save &amp; Publish\" button to save.<\/li>\n<\/ol>\n\n<h4>Multiple mobile device support<\/h4>\n\n<ol>\n<li>Add custom mobile detection to the nginx.conf.<\/li>\n<li>Add custom mobile detection to the WordPress via <code>nginxmobile_mobile_detects<\/code> filter-hook.<\/li>\n<\/ol>\n\n<p>nginx.conf:\n    set $mobile '';\n    if ($http_user_agent ~* '(iPhone|iPod)') {\n        set $mobile \"@smartphone\";\n    }\n    if ($http_user_agent ~* 'iPad') {\n        set $mobile \"@tablet\";\n    }<\/p>\n\n<p>In your custom plugin:\n    add_filter('nginxmobile_mobile_detects', function(){\n        return array('@smartphone', '@tablet');\n    });<\/p>\n\n<ul>\n<li>As a result, allow you to select theme for @smartphone and @tablet individually in the theme-customizer.<\/li>\n<\/ul>\n\n<h4>Amimoto Support<\/h4>\n\n<p>The <a href=\"http:\/\/megumi-cloud.com\/\">Amimoto<\/a> is a full-tuned WordPress AMI on the AWS EC2.<\/p>\n\n<ul>\n<li>Uncomment \/etc\/nginx\/conf.d\/default.conf in line 17<\/li>\n<\/ul>\n\n<p>before:\n    #include \/etc\/nginx\/mobile-detect;<\/p>\n\n<p>after:\n    include \/etc\/nginx\/mobile-detect;<\/p>\n\n<ul>\n<li>Add line to \/etc\/nginx\/nginx.conf like following.<\/li>\n<\/ul>\n\n<p>before:\n    proxy_set_header  X-Forwarded-For    $proxy_add_x_forwarded_for;\n    proxy_set_header  Accept-Encoding    \"\";<\/p>\n\n<p>after:\n    proxy_set_header  X-Forwarded-For    $proxy_add_x_forwarded_for;\n    proxy_set_header  Accept-Encoding    \"\";\n    proxy_set_header  X-UA-Detect        $mobile; # add new line<\/p>\n\n<ul>\n<li><p>Define constant in the wp-config.php<\/p>\n\n<p>define('IS_AMIMOTO', true);<\/p><\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Upload <code>nginx-mobile-theme<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory.<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress.<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>1.8.1<\/h4>\n\n<ul>\n<li>Add query strings mobile=on and mobile=off<\/li>\n<\/ul>\n\n<h4>1.5.0<\/h4>\n\n<ul>\n<li><a href=\"https:\/\/github.com\/megumiteam\/nginx-mobile-theme\/compare\/1.4.0...1.5.0\">Bug fix.<\/a><\/li>\n<\/ul>\n\n<h4>1.4.0<\/h4>\n\n<ul>\n<li><a href=\"https:\/\/github.com\/megumiteam\/nginx-mobile-theme\/compare\/1.3.0...1.4.0\">Bug fix.<\/a><\/li>\n<\/ul>\n\n<h4>1.3.0<\/h4>\n\n<ul>\n<li><a href=\"https:\/\/github.com\/megumiteam\/nginx-mobile-theme\/compare\/1.2.0...1.3.0\">Bug fix.<\/a><\/li>\n<\/ul>\n\n<h4>1.2.0<\/h4>\n\n<ul>\n<li><a href=\"https:\/\/github.com\/megumiteam\/nginx-mobile-theme\/compare\/1.1.0...1.2.0\">Add mobile theme preview.<\/a><\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Add support child theme.<\/li>\n<li>Add notice when Nginx Cache Controller is not activated.<\/li>\n<\/ul>\n\n<p>https:\/\/github.com\/megumiteam\/nginx-mobile-theme\/compare\/1.0.0...1.1.0<\/p>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>first release.<\/li>\n<\/ul>","raw_excerpt":"This plugin allows you to switch theme according to the User Agent on the Nginx reverse proxy.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/it.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/26121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/it.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/it.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=26121"}],"author":[{"embeddable":true,"href":"https:\/\/it.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/miyauchi"}],"wp:attachment":[{"href":"https:\/\/it.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=26121"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/it.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=26121"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/it.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=26121"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/it.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=26121"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/it.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=26121"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/it.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=26121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}