Skip to content

Commit 1d509ac

Browse files
committed
Merge branch 'main' of https://github.com/trybeans/beans-woocommerce into release
2 parents a67bd41 + 9ef7c79 commit 1d509ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2054
-820
lines changed

.env.testing

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
1-
export WP_ROOT_FOLDER=wp
1+
export WP_ROOT_FOLDER=store
22

33
export TEST_SITE_DB_DSN=mysql:host=127.0.0.1;dbname=beanswoocommercetestcases
44
export TEST_SITE_DB_HOST=127.0.0.1
55
export TEST_SITE_DB_NAME=beanswoocommercetestcases
66
export TEST_SITE_DB_USER=beanswoocommercetestcases
77
export TEST_SITE_DB_PASSWORD=Beans_WooCommerce_Testcases@0
8-
export TEST_SITE_TABLE_PREFIX=wp_51_wc_41_
8+
export TEST_SITE_TABLE_PREFIX=wp_58_wc_60_
99
export TEST_SITE_ADMIN_USERNAME=beans
1010
export TEST_SITE_ADMIN_PASSWORD=beans
1111
export TEST_SITE_WP_ADMIN_PATH=/wp-admin
12-
export TEST_SITE_WP_URL=http://97a40f2a62b2.ngrok.io/wp
12+
export TEST_SITE_WP_URL=http://97a40f2a62b2.ngrok.io/store/
1313
export TEST_SITE_WP_DOMAIN=97a40f2a62b2.ngrok.io
1414
export TEST_SITE_ADMIN_EMAIL=radix+testcases-woocommerce@trybeans.com
1515

16-
export TEST_DB_NAME=beanswoocommercetestcases
17-
export TEST_DB_HOST=127.0.0.1
18-
export TEST_DB_USER=beanswoocommercetestcases
19-
export TEST_DB_PASSWORD=Beans_WooCommerce_Testcases@0
20-
export TEST_TABLE_PREFIX=wp_51_wc_41_
2116
export TEST_STRIPE_SECRET_KEY=sk_test_51JLXBpAsdXfS9W1Ad6yxyTgX0CWFldkwLsxnHWkKzvlKJMr3245bmJV01a8jdSxqPbJp0C6MvFR9Fy0CHDh4cShe00fCBGaUdy
2217
export TEST_STRIPE_PUBLIC_KEY=pk_test_51JLXBpAsdXfS9W1AuwJWt6LOK1JNh4PWkg5WtrzqHuHRKc42dxPBA3yrhU3MwIlFVZEnHlXOJmYDB0b4pKXTibXT00j0JRVkVq
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Deploy to WordPress.org
2+
on:
3+
push:
4+
tags:
5+
- "v*"
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@master
12+
13+
- name: Build
14+
run: |
15+
bash build.sh
16+
17+
- name: WordPress Plugin Deploy
18+
uses: nk-o/action-wordpress-plugin-deploy@master
19+
env:
20+
SVN_PASSWORD: ${{ secrets.WORDPRESS_SVN_PASSWORD }}
21+
SVN_USERNAME: ${{ secrets.WORDPRESS_SVN_USERNAME }}
22+
SOURCE_DIR: dist/
23+
SLUG: beans-woocommerce-loyalty-rewards

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@ vendor
2323
wp
2424
_local
2525
.vscode
26+
dist/
2627

2728
tests/_output/
2829
tests/_support/_generated/
2930
src/src
3031
src/log.txt
32+
.env
3133
.env.local
3234
beans-woo-env/*
33-
.history
35+
.history
36+
store
37+
phpinfo.txt

README.md

Lines changed: 77 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,52 @@
11
# Beans for WooCommerce
22

3-
### Prerequisite
3+
## 🔨 Prerequisite
44

5-
- You need to make sure that you have mysql installed and that `mysql` is available in your path
5+
- You need to make sure that you have mysql installed and that `mysql` is available in your path.
66
To check that you can run `which mysql`
77

8-
9-
### 1. Install Composer
10-
8+
- If you don't have [composer](https://getcomposer.org/doc/00-intro.md), you will need to install it:
9+
1110
```shell script
1211
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
1312
php composer-setup.php --filename=composer
1413
php -r "unlink('composer-setup.php');"
1514
```
16-
If you are having trouble to find out more about it here: https://getcomposer.org/doc/00-intro.md
1715

18-
### 2. Install dependencies
16+
- Install all dependencies using composer:
1917

2018
```shell script
2119
./composer install
2220
```
2321

24-
### 3. Running Linters
22+
## ⏯ Develop
23+
24+
1. Create a local tunnel for localhost on port 8800 using ngrok.io
25+
```shell script
26+
ngrok http 8800
27+
```
28+
29+
2. Copy `.env.testing` to .`env.local` and update env vars.
30+
31+
32+
3. If needed reset any existing testing configuration
33+
```shell script
34+
./composer test-reset
35+
```
36+
37+
4. Launch the web server
38+
```shell script
39+
./composer run-script start
40+
```
41+
42+
Visit the address given by the localtunnel
43+
Wordpress admin username and password are `beans`
44+
45+
## 🧽 Linting
46+
2547
To run all linters:
2648
```shell script
27-
./composer run-script lint
49+
./composer run-script lint
2850
```
2951

3052
To only run phpcs,
@@ -36,24 +58,62 @@ To only run phpcs,
3658
To only run phpstan,
3759

3860
```shell script
39-
./vendor/bin/phpstan analyze --memory-limit=100
61+
./vendor/bin/phpstan analyze --memory-limit=200M
4062
```
4163

4264
To reformat the code:
4365
```shell script
4466
./vendor/bin/phpcbf
4567
```
4668

69+
Ensure that your code is well documented:
4770

48-
### 4. Develop
71+
https://stackoverflow.com/questions/1310050/php-function-comments
72+
https://www.phpdoc.org/
73+
https://phpdocu.sourceforge.net/howto.php
74+
https://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.param.pkg.html
75+
https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/
4976

50-
```shell script
51-
./composer run-script start
77+
## 🧪 Testing
78+
79+
to be completed...
80+
81+
## 🐞 Debugging
82+
83+
Install [Xdebug](https://xdebug.org/) to debug your php code.
84+
Follow the wizard step here: https://xdebug.org/wizard
85+
86+
To get PHPInfo:
87+
88+
```bash
89+
php -f scripts/phpinfo.php > phpinfo.txt
5290
```
53-
54-
Wordpress admin username and password are `beans`
5591

56-
57-
### 5. Testing
92+
Open `phpinfo.txt` to read the output.
93+
94+
95+
To create pot file:
96+
```bash
97+
./vendor/bin/wp i18n make-pot src src/i18n/beans-woocommerce.pot --exclude=src
98+
```
99+
100+
To create mo file:
101+
```bash
102+
./vendor/bin/wp i18n make-mo src/i18n
103+
```
104+
105+
Translated strings can be downloaded from [WordPress Translation platform](https://translate.wordpress.org/projects/wp-plugins/beans-woocommerce-loyalty-rewards/)
106+
107+
108+
## 📕 Documentation
109+
110+
- [WooCommerce minimum requirements by version](https://woocommerce.com/document/update-php-wordpress/)
111+
- [WooCommerce versions](https://developer.woocommerce.com/releases/)
112+
- [WooCommerce REST API](https://woocommerce.com/document/woocommerce-rest-api/)
113+
- [WordPress minimum requirements by version](https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/)
114+
- [PHP supported versions](https://www.php.net/supported-versions.php)
115+
58116

117+
Useful links
118+
- Debugging WP 404: https://gist.github.com/yunusga/33cf0ba9e311e12df4046722e93d4123
59119

assets/banner-1544x500.png

73.1 KB
Loading

assets/banner-772x250.png

30.8 KB
Loading

assets/banner.png

30.8 KB
Loading

assets/icon-128x128.png

1.93 KB
Loading

assets/icon-256x256.png

4.02 KB
Loading

assets/icon.svg

Lines changed: 6 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)