{"id":43351,"date":"2016-04-23T05:36:21","date_gmt":"2016-04-23T05:36:21","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wp-user-timezone\/"},"modified":"2016-05-07T07:05:59","modified_gmt":"2016-05-07T07:05:59","slug":"wp-user-timezone","status":"publish","type":"plugin","link":"https:\/\/twd.wordpress.org\/plugins\/wp-user-timezone\/","author":13746176,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.2","stable_tag":"trunk","tested":"4.5.33","requires":"3.0.1","requires_php":"","requires_plugins":"","header_name":"WP User Timezone","header_author":"Ravi Kiran Katha","header_description":"","assets_banners_color":"d8d9d9","last_updated":"2016-05-07 07:05:59","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/donatetounicef.in\/","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/wp-user-timezone\/","header_author_uri":"https:\/\/in.linkedin.com\/in\/ravikatha","rating":3,"author_block_rating":0,"active_installs":10,"downloads":2261,"num_ratings":4,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"1.0.2":"<ul>\n<li>Contains admin settings validation fixes<\/li>\n<\/ul>","1.0.1":"<ul>\n<li>Contains script related bug fixes<\/li>\n<\/ul>","1.0.0":"<ul>\n<li>Initial version<\/li>\n<\/ul>"},"ratings":{"1":"2","2":0,"3":0,"4":0,"5":"2"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"1402931","resolution":"128x128","location":"assets"},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"1402931","resolution":"256x256","location":"assets"}},"assets_banners":{"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":"1402919","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1444711","resolution":"1","location":"plugin"}},"screenshots":{"1":"Plugin configuration"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1358,1356,9698],"plugin_category":[],"plugin_contributors":[],"plugin_business_model":[],"class_list":["post-43351","plugin","type-plugin","status-publish","hentry","plugin_tags-date","plugin_tags-time","plugin_tags-timezone","plugin_committers-ravikatha"],"banners":{"banner":"https:\/\/ps.w.org\/wp-user-timezone\/assets\/banner-772x250.jpg?rev=1402919","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/wp-user-timezone\/assets\/icon-128x128.png?rev=1402931","icon_2x":"https:\/\/ps.w.org\/wp-user-timezone\/assets\/icon-256x256.png?rev=1402931","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/wp-user-timezone\/trunk\/screenshot-1.png?rev=1444711","caption":"Plugin configuration"}],"raw_content":"<!--section=description-->\n<p>Wordpress has a site-level timezone setting configured from the admin back-end. All dates and times displayed on the front-end are typically displayed in this timezone.<\/p>\n <p>This plugin enables the display of dates\/times in the front-end using the browser's timezone. This is done by overriding the Wordpress's <strong>'timezone_string'<\/strong> and <strong>'gmt_offset'<\/strong> options to match the user's timezone <strong>for the duration of a particular request<\/strong>\n<strong>ONLY on the front-end interface<\/strong>.<\/p>\n <h4>Browser Timezone Detection<\/h4>\n <p>The browser's timezone is detected using one of the following two methods<\/p>\n <ol>\n<li><a href=\"http:\/\/pellepim.bitbucket.org\/jstz\/\">jsTimezoneDetect<\/a> (default)<\/li>\n<li><a href=\"http:\/\/caniuse.com\/geolocation\">HTML5 Geolocation API<\/a> and <a href=\"https:\/\/developers.google.com\/maps\/documentation\/timezone\">Google Timezone API<\/a><\/li>\n<\/ol>\n <p><strong>jsTimezoneDetect (default)<\/strong><br \/>\n    This is the default timezone detection mechanism. Please refer to the script <a href=\"http:\/\/pellepim.bitbucket.org\/jstz\/\">home page<\/a>\nfor the compatibility and other notes<\/p>\n <p><strong>HTML5 Geolocation API<\/strong><br \/>\n    Detects the current geo-location using <em><a href=\"http:\/\/caniuse.com\/geolocation\">navigator.geolocation.getCurrentPosition<\/a><\/em>. The location thus detected will be sent to the <a href=\"https:\/\/developers.google.com\/maps\/documentation\/timezone\">Google Timezone API<\/a>\nwhich returns the timezone id - similar to \"Asia\/Kolkata\".<\/p>\n <p>This method requires you to<\/p>\n <ul>\n<li>Enable the \"Google Timezone API\" option on the plugin options page<\/li>\n<li>Specify a valid <a href=\"https:\/\/developers.google.com\/maps\/documentation\/timezone\/get-api-key\">Google API Key<\/a>\n <ul>\n<li>The key should be a browser key<\/li>\n<li>The \"Accepted HTTP Referrers\" should include the domain name used by the hosting wordpress site or left blank to allow all referrers<\/li>\n<\/ul><\/li>\n<\/ul>\n <p>If the required options for the usage of Google Timezone API are not met, the detection mechanism falls back to the default one.<\/p>\n <h4>Post Timezone Detection<\/h4>\n <ul>\n<li>If the browser's timezone id is not detected successfully, everything else behaves as if this plugin is not installed.<\/li>\n<li>If the browser's timezone id is detected, the following actions take place  <ul>\n<li>A cookie will be set in the browser, based on the cookie options specified on the plugin options page<\/li>\n<li>If a cookie already exists previously with the same id, no action is taken<\/li>\n<li>If a cookie doesn't already exist previously or exists with a different timezone id, then a <em>window.reload<\/em> is triggered to refresh the page so that the dates\/times on the page are updated<\/li>\n<\/ul><\/li>\n<\/ul>\n <h4>EventON Hook<\/h4>\n <p>This plugin provides a feature to hook into the EventON plugin. When enabled, all EventON dates\/times are updated to reflect the browser's timezone.<\/p>\n <h4>Shortcodes<\/h4>\n <p>This plugin defines the below shortcodes<\/p>\n <ol>\n<li>[wp_user_timezone_id] =&gt; Returns the timezone id of the browser or <em>null<\/em> if not available.<\/li>\n<li>[wp_user_timezone_offset] =&gt; Returns the timezone's gmt offset in hours of the browser or <em>null<\/em> if not available.<\/li>\n<\/ol>\n <h4>Options<\/h4>\n <p>This plugin defines the below options to retrieve the original timezone_string and gmt_offset defined at the site level<\/p>\n <ol>\n<li>get_option( 'site_timezone_string' ) =&gt; Returns the original timezone_string option for the site<\/li>\n<li>get_option( 'site_gmt_offset' ) =&gt; Returns the original gmt_offset option for the site<\/li>\n<\/ol>\n <h4>Actions\/Hooks<\/h4>\n <p>This plugin defines the below filters\/hooks<\/p>\n <ol>\n<li>apply_filters( 'wp_user_timezone_id', $tz_id ) =&gt; Allows you to override the timezone string determined by the plugin. This filter can be used to apply user's timezone preference. If any plugin or wordpress core implements a feature to accept and store user's preferred timezone, the 'wp_user_timezone_id' can be used to apply that timezone value to the front-end. Reference: <a href=\"https:\/\/core.trac.wordpress.org\/ticket\/18146\">Add user-level timezone setting<\/a>).<\/li>\n<\/ol>\n   <h4>Admin Backend Dates\/Times<\/h4>\n <p><strong>Important: The admin back-end is not modified by this plugin. All dates\/times displayed in the back-end are still in the original timezone specified by the Wordpress General Settings.<\/strong><\/p>\n\n<!--section=installation-->\n<p>This section describes how to install the plugin and get it working.<\/p>\n <ol>\n<li>Upload the plugin zip file using Wordpress -&gt; Plugins -&gt; Add New -&gt; Upload Plugin<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Configure the options by visiting the plugin options page<\/li>\n<\/ol>\n\n<!--section=faq-->\n<h4>What happens when the timezone detection does not work?<\/h4>\n <p>When the timezone detection mechanism is unable to detect a valid timezone, nothing else is changed. The front-end behaves as if this plugin is not installed.<\/p>\n <h4>What if I specify a Google API key which is not valid or is blocked?<\/h4>\n <p>The plugin tries the Google Timezone API when possible. If the API call fails, the plugin falls back to the default mechanism (jsTimezoneDetect).<\/p>\n <h4>What is cookie expiry days option?<\/h4>\n <p>The cookie created by the plugin is by default stored as a session cookie, which is cleared when the browser session is closed. The next time, you open the browser, the cookie does not exist. On the other hand, if the cookie expiry is specified, it will be persisted into the user's computer and is available till it expires.<\/p>\n <h4>What does the plugin do on the browser to enable this functionality?<\/h4>\n <p>When each front-end page is loaded, the plugin script checks if the cookie is present and valid. If it is present, the plugin does nothing. If the cookie is absent or is expired, the timezone detection process takes place as mentioned in the above sections.<\/p>\n <h4>How long should I set the cookie expiry?<\/h4>\n <p>It is typically advised to set the expiry as small as possible. This will ensure that the user's timezone is updated as soon as possible. On the contrary, setting too small expiry period will trigger the timezone detection script too often causing page loads every time the cookie is expired.<\/p>\n <p>A reasonable value would be 7 days.<\/p>\n\n<!--section=changelog-->\n<h4>1.0.2<\/h4>\n <ul>\n<li>Minor validation fixes<\/li>\n<\/ul>\n <h4>1.0.1<\/h4>\n <ul>\n<li>jQuery cookie script inclusion bug fix<\/li>\n<\/ul>\n <h4>1.0.0<\/h4>\n <ul>\n<li>Initial version<\/li>\n<\/ul>","raw_excerpt":"WP User Timezone displays the front-end dates &amp; times in the browser&#039;s local timezone without actually modifying your database.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/43351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=43351"}],"author":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/ravikatha"}],"wp:attachment":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=43351"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=43351"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=43351"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=43351"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=43351"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=43351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}