Skip to content

Commit e515fd1

Browse files
committed
Updates to suit plugin submission process.
1 parent 52aa6c6 commit e515fd1

File tree

3 files changed

+62
-27
lines changed

3 files changed

+62
-27
lines changed

Readme.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
=== Connector for WooToApp Mobile ===
2+
Contributors: rrrhys
3+
Tags: native app, mobile app, woocommerce native app, iphone app, android app
4+
Requires at least: 4.8
5+
Tested up to: 4.9.2
6+
Requires PHP: 5.6
7+
Stable tag: trunk
8+
License: GPLV2
9+
License URI: https://www.gnu.org/licenses/gpl-2.0.html
10+
11+
Enables various functionality required by WooToApp Mobile.
12+
13+
== Description ==
14+
WooToApp Mobile allows you to quickly and painlessly create a native mobile experience for your WooCommerce Store. Simply install and configure the plugin and we\'ll do the rest. WooToApp Mobile is free to use (branded) and offers paid subscriptions to release a standalone native mobile app.
15+
16+
Use the plugin to configure home screen categories and banners, create push notification campaigns, and skin your native app.
17+
18+
Before using the plugin fully, you need to run the \"Build My App\" process at https://www.wootoapp.com/ (totally free!)
19+
20+
== Installation ==
21+
1. Complete the \"Build My App\" process at https://www.wootoapp.com (completely free)
22+
2. Find the WooToApp configuration page: Wordpress Admin > WooCommerce > Settings > WooToApp.
23+
3. Enter your WooToApp Site ID & Secret Key and press \'Save Changes\'
24+
4. Proceed to further configure your app on the additional tabs (Checkout, Welcome Screen, Styling and Branding, Push Notifications)
25+
5. At any time, pull to refresh on your mobile app to see your changes updated in real time.

settings-page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
$force_use_local = true;
88
$force_use_local_db = false;
99
$force_use_prod_db = true;
10-
$force_use_prod = false;
10+
$force_use_prod = true;
1111
$dev_url = "www.wooc.local";
1212
$use_local_react = $_SERVER['HTTP_HOST'] === $dev_url || $force_use_local;//true;
1313
$use_prod_db = ($force_use_local_db || ( $_SERVER['HTTP_HOST'] === $dev_url)) ? false : true;

woo-to-app.php

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
11
<?php
2+
23
/*
3-
Plugin Name: Woo To App Store Plugin
4-
Plugin URI: https://www.wootoapp.com
5-
Description: Enables various functionality required by Woo To App
6-
Version: 0.0.1
7-
Author: WooToApp
8-
Author URI: https://www.wootoapp.com
9-
10-
Copyright: © 2017 WooToApp
4+
Plugin Name: Connector for WooToApp Mobile
5+
Plugin URI: https://www.wootoapp.com
6+
Description: Enables various functionality required by WooToApp Mobile. WooToApp Mobile allows you to quickly and painlessly create a native mobile experience for your WooCommerce Store. Simply install and configure the plugin and we'll do the rest. WooToApp Mobile is free to use (branded) and offers paid subscriptions to release a standalone native mobile app.
7+
Version: 0.0.1
8+
Author: WooToApp - Rhys Williams
9+
Author URI: https://www.wootoapp.com
10+
License: GPL2
11+
License URI: https://www.gnu.org/licenses/gpl-2.0.html
12+
13+
14+
Connector for WooToApp Mobile is free software: you can redistribute it and/or modify
15+
it under the terms of the GNU General Public License as published by
16+
the Free Software Foundation, either version 2 of the License, or
17+
any later version.
18+
19+
Connector for WooToApp Mobile is distributed in the hope that it will be useful,
20+
but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
GNU General Public License for more details.
23+
24+
You should have received a copy of the GNU General Public License
25+
along with Connector for WooToApp Mobile. If not, see https://www.gnu.org/licenses/gpl-2.0.html.
1126
*/
1227

1328
add_action( 'plugins_loaded', 'wta_init', 0 );
@@ -40,18 +55,21 @@ public function __construct() {
4055
add_action( 'woocommerce_update_options_settings_wootoapp', array( $this, 'update_settings' ) );
4156

4257

43-
header( 'Access-Control-Allow-Credentials:true' );
44-
header( 'Access-Control-Allow-Headers:Authorization, Content-Type' );
45-
header( 'Access-Control-Allow-Methods:OPTIONS, GET, POST, PUT, PATCH, DELETE' );
46-
header( 'Access-Control-Allow-Origin: *' );
47-
header( 'Allow: GET' );
48-
49-
if ( $_SERVER['REQUEST_METHOD'] == 'OPTIONS' ) {
58+
if(isset( $_REQUEST['action']) && $_REQUEST['action'] === "wootoapp_execute"){
59+
header( 'Access-Control-Allow-Credentials:true' );
60+
header( 'Access-Control-Allow-Headers:Authorization, Content-Type' );
61+
header( 'Access-Control-Allow-Methods:OPTIONS, GET, POST, PUT, PATCH, DELETE' );
5062
header( 'Access-Control-Allow-Origin: *' );
51-
header( 'Access-Control-Allow-Headers: X-Requested-With, Authorization, Content-Type' );
52-
header( "HTTP/1.1 200 OK" );
53-
die();
63+
header( 'Allow: GET' );
64+
65+
if ( $_SERVER['REQUEST_METHOD'] == 'OPTIONS' ) {
66+
header( 'Access-Control-Allow-Origin: *' );
67+
header( 'Access-Control-Allow-Headers: X-Requested-With, Authorization, Content-Type' );
68+
header( "HTTP/1.1 200 OK" );
69+
die();
70+
}
5471
}
72+
5573
/* END endpoints */
5674

5775
}
@@ -64,15 +82,7 @@ public function add_settings_tab( $settings_tabs ) {
6482
}
6583

6684
public function settings_tab() {
67-
// woocommerce_admin_fields( self::get_settings() );
68-
69-
7085
include_once("settings-page.php");
71-
?>
72-
73-
74-
<?php
75-
7686
}
7787

7888
public static function update_settings() {

0 commit comments

Comments
 (0)