Plugin Directory

Changeset 1796346


Ignore:
Timestamp:
01/03/2018 11:42:37 AM (8 years ago)
Author:
poliuk
Message:

v1.0.7 released: Improved plugin compatibility with older PHP versions

Location:
wp-pwa
Files:
16 added
3 edited

Legend:

Unmodified
Added
Removed
  • wp-pwa/trunk/admin/wp-pwa-admin-page.php

    r1795931 r1796346  
    216216                     <p class="title is-5">
    217217                            Progressive Web App
    218                             <span id="wp-pwa-status-enabled" class="icon is" <? echo (($wp_pwa_status!='disabled')?'style="color:#97cd76;"':'style="display:none;color:#97cd76"');?>>
     218                            <span id="wp-pwa-status-enabled" class="icon is" <?php echo (($wp_pwa_status!='disabled')?'style="color:#97cd76;"':'style="display:none;color:#97cd76"');?>>
    219219                                <i class="fa fa-check-circle" aria-hidden="true"></i>
    220220                            </span>
    221                             <span id="wp-pwa-status-disabled" class="icon" <? echo (($wp_pwa_status=='disabled')?'style="color:#ed6c63;"':'style="display:none;color:#ed6c63"');?>>
     221                            <span id="wp-pwa-status-disabled" class="icon" <?php echo (($wp_pwa_status=='disabled')?'style="color:#ed6c63;"':'style="display:none;color:#ed6c63"');?>>
    222222                                <i class="fa fa-times-circle" aria-hidden="true"></i>
    223223                            </span>
     
    229229                                <select id="wp-pwa-status">
    230230                                    <?php
    231                                         $options = array( ['mobile', 'Enabled'], ['disabled', 'Disabled']); // [value, Label]
     231                                        $options = array(array('mobile','Enabled'), array('disabled','Disabled')); // [value, Label]
    232232                                        $status = $settings['wp_pwa_status'];
    233233                                        $output = '';
  • wp-pwa/trunk/readme.txt

    r1795931 r1796346  
    55Requires at least: 4.4
    66Tested up to: 4.8.2
    7 Stable tag: 1.0.6
     7Stable tag: 1.0.7
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl.html
     
    2626
    2727== Changelog ==
     28
     29= 1.0.7 =
     30* Improved plugin compatibility with old PHP versions
    2831
    2932= 1.0.6 =
  • wp-pwa/trunk/wp-pwa.php

    r1795931 r1796346  
    44Plugin URI: https://wordpress.org/plugins/wordpress-pwa/
    55Description: WordPress plugin to turn WordPress blogs into Progressive Web Apps.
    6 Version: 1.0.6
     6Version: 1.0.7
    77Author: WordPress PWA
    88Author URI:
     
    1616{
    1717    // vars
    18     public $plugin_version = '1.0.6';
     18    public $plugin_version = '1.0.7';
    1919    public $rest_api_installed  = false;
    2020    public $rest_api_active     = false;
     
    5656        add_action( 'admin_enqueue_scripts', array( $this, 'register_wp_pwa_styles' ) );
    5757
    58         add_action( 'rest_api_init', function () {
    59             register_rest_route( 'wp-pwa/v1', '/siteid/', array(
    60                 'methods' => 'GET',
    61                 'callback' => array( $this,'get_wp_pwa_site_id'))
    62             );
    63             register_rest_route( 'wp-pwa/v1', '/discover/', array(
    64                 'methods' => 'GET',
    65                 'callback' => array( $this,'discover_url'))
    66             );
    67             register_rest_route( 'wp-pwa/v1', '/plugin-version/', array(
    68                 'methods' => 'GET',
    69                 'callback' => array( $this,'get_wp_pwa_plugin_version'))
    70             );
    71             register_rest_route( 'wp-pwa/v1', '/site-info/', array(
    72                 'methods' => 'GET',
    73                 'callback' => array( $this,'get_site_info'))
    74             );
    75         });
     58
     59
     60        add_action( 'rest_api_init', array($this,'rest_routes'));
     61
    7662        // filters
    7763    }
    7864
     65    function rest_routes() {
     66        register_rest_route( 'wp-pwa/v1', '/siteid/', array(
     67            'methods' => 'GET',
     68            'callback' => array( $this,'get_wp_pwa_site_id'))
     69        );
     70        register_rest_route( 'wp-pwa/v1', '/discover/', array(
     71            'methods' => 'GET',
     72            'callback' => array( $this,'discover_url'))
     73        );
     74        register_rest_route( 'wp-pwa/v1', '/plugin-version/', array(
     75            'methods' => 'GET',
     76            'callback' => array( $this,'get_wp_pwa_plugin_version'))
     77        );
     78        register_rest_route( 'wp-pwa/v1', '/site-info/', array(
     79            'methods' => 'GET',
     80            'callback' => array( $this,'get_site_info'))
     81        );
     82    }
    7983    /*
    8084    *  init
     
    449453    //Adds Cross origin * to the header
    450454    function allow_origin() {
    451     header("Access-Control-Allow-Origin: *");
     455        if (!headers_sent()) {
     456            header("Access-Control-Allow-Origin: *");
     457        }
    452458    }
    453459
Note: See TracChangeset for help on using the changeset viewer.