Plugin Directory

Changeset 1799765


Ignore:
Timestamp:
01/09/2018 03:04:19 PM (8 years ago)
Author:
poliuk
Message:

v1.0.9 released: Added "dev" query to the injector.

Location:
wp-pwa
Files:
16 added
5 edited

Legend:

Unmodified
Added
Removed
  • wp-pwa/trunk/injector/injector.js

    r1788962 r1799765  
    9292    if (window['wp-pwa'].singleType) query += '&singleType=' + window['wp-pwa'].singleType;
    9393    if (window['wp-pwa'].singleId) query += '&singleId=' + window['wp-pwa'].singleId;
     94    if (window['wp-pwa'].dev === false) query += '&dev=false';
     95    if (window['wp-pwa'].dev === true) query += '&dev=true';
    9496
    9597    var loadWorona = function() {
  • wp-pwa/trunk/injector/injector.min.js

    r1788962 r1799765  
    1 !function(e,t,a){var n=/ip(hone|od).*?OS (?![1-8]_|X)/i,i=/android (?![1-3]\.)(?!4\.[0-3]).* mobile/i;t["wp-pwa"].ssr=t["wp-pwa"].ssr.replace(/\/$/g,"")+"/",t["wp-pwa"].static=t["wp-pwa"].static.replace(/\/$/g,"")+"/";var r=function(t){for(var a=t+"=",n=decodeURIComponent(e.cookie).split(";"),i=0;i<n.length;i++){for(var r=n[i];" "==r.charAt(0);)r=r.substring(1,r.length);if(0==r.indexOf(a))return r.substring(a.length,r.length)}return null};if(r("wppwaClassicVersion")){!function(t){if(!e.getElementById(t.id)){var a=e.getElementsByTagName(t.tag)[0],n=e.createElement(t.tag);n.id=t.id,n.src=t.src,a.parentNode.insertBefore(n,a)}}({tag:"script",id:"wppwaClassic",src:t["wp-pwa"].ssr+"dynamic/wp-org-connection-app-extension-worona/go-back-to-wppwa.js"})}else if(!r("wppwaInjectorFailed")&&a&&function(e){return n.test(e)||i.test(e)}(a.userAgent)){t.stop();e.write(unescape("%3Chead%3E%0A%20%20%20%20%20%20%3Cstyle%3E%0A%20%20%20%20%20%20%20%20@keyframes%20progress%20%7B%0A%20%20%20%20%20%20%20%20%20%20from%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20width%3A%200%25%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20to%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20width%3A%2080%25%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%3C/style%3E%0A%20%20%20%20%3C/head%3E%0A%0A%20%20%20%20%3Cbody%20style%3D%22height%3A100%25%3Bbackground%3A%23FDFDFD%3Bdisplay%3Aflex%3Bjustify-content%3Acenter%3Balign-items%3Acenter%3Bmargin%3A0%3B%22%3E%0A%20%20%20%20%20%20%3Cdiv%20style%3D%22animation%3A6s%20ease-out%201s%201%20forwards%20progress%3Bheight%3A1px%3Bbackground%3A%23000%3B%22%3E%3C/div%3E%0A%20%20%20%20%3C/body%3E"));var s="?siteId="+t["wp-pwa"].siteId+"&static="+t["wp-pwa"].static+"&env="+t["wp-pwa"].env;t["wp-pwa"].listType&&(s+="&listType="+t["wp-pwa"].listType),t["wp-pwa"].listId&&(s+="&listId="+t["wp-pwa"].listId),t["wp-pwa"].page&&(s+="&page="+t["wp-pwa"].page),t["wp-pwa"].singleType&&(s+="&singleType="+t["wp-pwa"].singleType),t["wp-pwa"].singleId&&(s+="&singleId="+t["wp-pwa"].singleId);!function(){var a=new XMLHttpRequest;a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status)!function(t){var a=e.open("text/html","replace");a.write(t),a.close(),e.body.scrollTop=0}(a.responseText);else{var n=new XMLHttpRequest;n.open("POST","https://api.rollbar.com/api/1/item/",!0),n.send(JSON.stringify({access_token:"d64fbebfade643439dad144ccb8c3635",data:{environment:"injector",platform:"browser",body:{message:{body:"Error loading the injector on: "+t.location.href,error:a.statusText}}}})),console.error("Error loading the injector on: "+t.location.href,a.statusText),function(t,a,n){var i="";if(n){var r=new Date;r.setTime(r.getTime()+60*n*1e3),i="expires="+r.toUTCString()+";"}e.cookie=t+"="+a+";"+i+"path=/"}("wppwaInjectorFailed","true",1),t.location.reload(!0)}},a.open("GET",t["wp-pwa"].ssr+s,!0),a.send()}()}}(document,window,navigator);
     1!function(e,t,a){var s=/ip(hone|od).*?OS (?![1-8]_|X)/i,p=/android (?![1-3]\.)(?!4\.[0-3]).* mobile/i;t["wp-pwa"].ssr=t["wp-pwa"].ssr.replace(/\/$/g,"")+"/",t["wp-pwa"].static=t["wp-pwa"].static.replace(/\/$/g,"")+"/";var i,n,r=function(t){for(var a=t+"=",s=decodeURIComponent(e.cookie).split(";"),p=0;p<s.length;p++){for(var i=s[p];" "==i.charAt(0);)i=i.substring(1,i.length);if(0==i.indexOf(a))return i.substring(a.length,i.length)}return null};if(r("wppwaClassicVersion"))!function(t){if(!e.getElementById(t.id)){var a=e.getElementsByTagName(t.tag)[0],s=e.createElement(t.tag);s.id=t.id,s.src=t.src,a.parentNode.insertBefore(s,a)}}({tag:"script",id:"wppwaClassic",src:t["wp-pwa"].ssr+"dynamic/wp-org-connection-app-extension-worona/go-back-to-wppwa.js"});else if(!r("wppwaInjectorFailed")&&a&&(n=a.userAgent,s.test(n)||p.test(n))){t.stop();e.write(unescape("%3Chead%3E%0A%20%20%20%20%20%20%3Cstyle%3E%0A%20%20%20%20%20%20%20%20@keyframes%20progress%20%7B%0A%20%20%20%20%20%20%20%20%20%20from%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20width%3A%200%25%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20to%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20width%3A%2080%25%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%3C/style%3E%0A%20%20%20%20%3C/head%3E%0A%0A%20%20%20%20%3Cbody%20style%3D%22height%3A100%25%3Bbackground%3A%23FDFDFD%3Bdisplay%3Aflex%3Bjustify-content%3Acenter%3Balign-items%3Acenter%3Bmargin%3A0%3B%22%3E%0A%20%20%20%20%20%20%3Cdiv%20style%3D%22animation%3A6s%20ease-out%201s%201%20forwards%20progress%3Bheight%3A1px%3Bbackground%3A%23000%3B%22%3E%3C/div%3E%0A%20%20%20%20%3C/body%3E"));var o="?siteId="+t["wp-pwa"].siteId+"&static="+t["wp-pwa"].static+"&env="+t["wp-pwa"].env;t["wp-pwa"].listType&&(o+="&listType="+t["wp-pwa"].listType),t["wp-pwa"].listId&&(o+="&listId="+t["wp-pwa"].listId),t["wp-pwa"].page&&(o+="&page="+t["wp-pwa"].page),t["wp-pwa"].singleType&&(o+="&singleType="+t["wp-pwa"].singleType),t["wp-pwa"].singleId&&(o+="&singleId="+t["wp-pwa"].singleId),!1===t["wp-pwa"].dev&&(o+="&dev=false"),!0===t["wp-pwa"].dev&&(o+="&dev=true");(i=new XMLHttpRequest).onreadystatechange=function(){if(4===i.readyState)if(200===i.status)s=i.responseText,(p=e.open("text/html","replace")).write(s),p.close(),e.body.scrollTop=0;else{var a=new XMLHttpRequest;a.open("POST","https://api.rollbar.com/api/1/item/",!0),a.send(JSON.stringify({access_token:"d64fbebfade643439dad144ccb8c3635",data:{environment:"injector",platform:"browser",body:{message:{body:"Error loading the injector on: "+t.location.href,error:i.statusText}}}})),console.error("Error loading the injector on: "+t.location.href,i.statusText),function(t,a,s){var p="";if(s){var i=new Date;i.setTime(i.getTime()+60*s*1e3),p="expires="+i.toUTCString()+";"}e.cookie=t+"="+a+";"+p+"path=/"}("wppwaInjectorFailed","true",1),t.location.reload(!0)}var s,p},i.open("GET",t["wp-pwa"].ssr+o,!0),i.send()}}(document,window,navigator);
  • wp-pwa/trunk/injector/wp-pwa-injector.php

    r1795931 r1799765  
    1616$force = false;
    1717$inject = false;
     18$dev = 'false';
    1819
    1920if (is_home()) {
     
    5051  $page = 1;
    5152}
    52 
    53 $site_info = array(
    54   'homepage_title' => get_bloginfo('name'),
    55   'homepage_metadesc' => get_bloginfo('description')
    56 );
    57 
    58 if(has_filter('wp_pwa_get_site_info')) {
    59   $site_info = apply_filters('wp_pwa_get_site_info', $site_info);
    60 }
    61 
    62 $homeTitle = $site_info['homepage_title'];
    63 $homeDescription = $site_info['homepage_metadesc'];
    6453
    6554$settings = get_option('wp_pwa_settings');
     
    9887}
    9988
     89if (isset($_GET['force']) || isset($_GET['server']) || isset($_GET['static']) ||
     90  isset($_GET['ssr']) || isset($_GET['env']) || isset($_GET['siteId'])) {
     91    $dev = 'true';
     92  }
     93
    10094if ($siteId && ($listType || $singleType)) {
    10195  if ($force || $pwa_status === 'mobile') {
     
    108102<?php if ($inject) { ?>
    109103  <script type='text/javascript'>
    110   window['wp-pwa'] = { siteId: '<?php echo $siteId; ?>',<?php if ($listType) echo ' listType: \'' . $listType . '\',' ?><?php if ($listId) echo ' listId: \'' . $listId . '\',' ?><?php if ($singleType) echo ' singleType: \'' . $singleType . '\',' ?><?php if ($singleId) echo ' singleId: \'' . $singleId . '\',' ?><?php if ($page) echo ' page: \'' . $page . '\',' ?> env: '<?php echo $env; ?>', perPage: '<?php echo $perPage; ?>', ssr: '<?php echo $ssr; ?>', static: '<?php echo $static; ?>', home: { title: '<?php echo $homeTitle; ?>', description: '<?php echo $homeDescription; ?>' } };
     104  window['wp-pwa'] = { siteId: '<?php echo $siteId; ?>',<?php if ($listType) echo ' listType: \'' . $listType . '\',' ?><?php if ($listId) echo ' listId: \'' . $listId . '\',' ?><?php if ($singleType) echo ' singleType: \'' . $singleType . '\',' ?><?php if ($singleId) echo ' singleId: \'' . $singleId . '\',' ?><?php if ($page) echo ' page: \'' . $page . '\',' ?> env: '<?php echo $env; ?>', dev: <?php echo $dev; ?>, perPage: '<?php echo $perPage; ?>', ssr: '<?php echo $ssr; ?>', static: '<?php echo $static; ?>' };
    111105  <?php require(WP_PLUGIN_DIR . $GLOBALS['wp_pwa_path'] . '/injector/injector.min.js'); ?>
    112106  </script>
  • wp-pwa/trunk/readme.txt

    r1796988 r1799765  
    55Requires at least: 4.4
    66Tested up to: 4.8.2
    7 Stable tag: 1.0.8
     7Stable tag: 1.0.9
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl.html
     
    2626
    2727== Changelog ==
     28= 1.0.9 =
     29* Add dev (development) variable to query
     30
    2831= 1.0.8 =
    2932* Removed unused code from older versions of the plugin
  • wp-pwa/trunk/wp-pwa.php

    r1796988 r1799765  
    44Plugin URI: https://wordpress.org/plugins/wordpress-pwa/
    55Description: WordPress plugin to turn WordPress blogs into Progressive Web Apps.
    6 Version: 1.0.8
     6Version: 1.0.9
    77Author: WordPress PWA
    88Author URI:
     
    1616{
    1717    // vars
    18     public $plugin_version = '1.0.8';
     18    public $plugin_version = '1.0.9';
    1919    public $rest_api_installed  = false;
    2020    public $rest_api_active     = false;
Note: See TracChangeset for help on using the changeset viewer.