Plugin Directory

Changeset 2332656


Ignore:
Timestamp:
06/30/2020 01:40:42 AM (6 years ago)
Author:
rnlab
Message:

feat: add more analytic check

Location:
mobile-builder/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • mobile-builder/trunk/api/class-mobile-builder-cart.php

    r2332301 r2332656  
    131131        ) );
    132132
    133         register_rest_route( $this->namespace, 'check-auth-header', array(
     133        register_rest_route( $this->namespace, 'analytic', array(
    134134            'methods'             => WP_REST_Server::CREATABLE,
    135             'callback'            => array( $this, 'check_auth_header' ),
    136         ) );
    137 
    138     }
    139 
    140     public function check_auth_header( $request ) {
     135            'callback'            => array( $this, 'analytic' ),
     136        ) );
     137
     138    }
     139
     140    public function analytic( $request ) {
    141141        $headers = mobile_builder_headers();
    142142
     143        $data = array(
     144            "authStatus" => false,
     145            "WooCommerce" => false,
     146            "wcfm" => class_exists( 'WCFM' ),
     147            "jwtAuthKey" => defined('MOBILE_BUILDER_JWT_SECRET_KEY'),
     148            "googleMapApiKey" => defined('MOBILE_BUILDER_GOOGLE_API_KEY'),
     149            "facebookAppId" => defined('MOBILE_BUILDER_FB_APP_ID'),
     150            "facebookAppSecret" => defined('MOBILE_BUILDER_FB_APP_SECRET'),
     151            "oneSignalId" => defined('MOBILE_BUILDER_ONESIGNAL_APP_ID'),
     152            "oneSignalApiKey" => defined('MOBILE_BUILDER_ONESIGNAL_API_KEY'),
     153        );
     154
    143155        if ( isset( $headers['Authorization'] ) && $headers['Authorization'] == "Bearer test" ) {
    144             return array("check" => true);
    145         }
    146 
    147         return array("check" => false);
     156            $data['authStatus'] = true;
     157        }
     158
     159        if ( class_exists( 'WooCommerce' ) ) {
     160            $data['WooCommerce'] = true;
     161        }
     162
     163        return $data;
    148164    }
    149165
  • mobile-builder/trunk/mobile-builder.php

    r2332301 r2332656  
    1111 * Plugin URI:        https://doc-oreo.rnlab.io
    1212 * Description:       The most advanced drag & drop app builder. Create multi templates and app controls.
    13  * Version:           1.0.3
     13 * Version:           1.0.4
    1414 * Author:            Rnlab.io
    1515 * Author URI:        https://rnlab.io
     
    3131 * Rename this for your plugin and update it as you release new versions.
    3232 */
    33 define( 'MOBILE_BUILDER_CONTROL_VERSION', '1.4.5' );
     33define( 'MOBILE_BUILDER_CONTROL_VERSION', '1.4.6' );
    3434
    3535define( 'MOBILE_BUILDER_PLUGIN_NAME', 'mobile-builder' );
Note: See TracChangeset for help on using the changeset viewer.