Skip to content

Commit 7b0242a

Browse files
authored
Initial commit
0 parents  commit 7b0242a

Some content is hidden

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

63 files changed

+6264
-0
lines changed

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# See http://editorconfig.org/
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[{*.php,*.html}]
12+
indent_style = space
13+
indent_size = 4
14+
15+
[*.js]
16+
indent_style = space
17+
indent_size = 2
18+
19+
[{*.css,*.scss}]
20+
indent_style = space
21+
indent_size = 4
22+

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
tests:
13+
runs-on: ubuntu-latest
14+
15+
services:
16+
mysql:
17+
image: mysql:5.7
18+
env:
19+
MYSQL_DATABASE: testdb
20+
MYSQL_USER: user
21+
MYSQL_PASSWORD: password
22+
MYSQL_ROOT_PASSWORD: rootpassword
23+
ports:
24+
- 3306:3306
25+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
26+
27+
strategy:
28+
fail-fast: true
29+
matrix:
30+
php: ['7.4', '8.2']
31+
32+
name: PHP ${{ matrix.php }}
33+
steps:
34+
- uses: actions/checkout@v2
35+
36+
- uses: actions/setup-node@v2
37+
with:
38+
node-version: 16.x
39+
40+
- name: Install PHP
41+
uses: shivammathur/setup-php@master
42+
with:
43+
php-version: ${{ matrix.php }}
44+
45+
- name: Report PHP version
46+
run: php -v
47+
48+
- name: Install dependencies
49+
run: composer install --no-interaction
50+
51+
- name: Test Syntax
52+
run: ./test/test_for_syntax_errors.sh
53+
54+
- name: Test Installation
55+
run: ./test/test_installation.sh
56+
57+
- name: Test phpcs
58+
run: ./test/test_phpcs.sh

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*' # Push events to matching v*, i.e. v1.0, v20.15.10
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
17+
# Docs: https://getcomposer.org/doc/articles/scripts.md
18+
19+
# - name: Run test suite
20+
# run: composer run-script test
21+
# cp -r disciple-tools-plugin-starter-template.php includes languages spinner.svg version-control.json LICENSE SECURITY.md disciple-tools-plugin-starter-template/
22+
# Below borrowed from https://github.com/actions/upload-release-asset
23+
- name: Build project
24+
run: |
25+
mkdir disciple-tools-plugin-starter-template
26+
cp -r disciple-tools-plugin-starter-template.php admin charts languages magic-link post-type rest-api site-link tile workflows spinner.svg version-control.json LICENSE SECURITY.md disciple-tools-plugin-starter-template/
27+
zip -r disciple-tools-plugin-starter-template.zip disciple-tools-plugin-starter-template
28+
- name: Create Release
29+
id: create_release
30+
uses: actions/create-release@v1
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
with:
34+
tag_name: ${{ github.ref }}
35+
release_name: Release ${{ github.ref }}
36+
draft: false
37+
prerelease: false
38+
- name: Upload Release Asset
39+
id: upload-release-asset
40+
uses: actions/upload-release-asset@v1
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
with:
44+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
45+
asset_path: ./disciple-tools-plugin-starter-template.zip
46+
asset_name: disciple-tools-plugin-starter-template.zip
47+
asset_content_type: application/zip

.github/workflows/translations.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: translation-workflow
2+
run-name: Regenerating pot file
3+
4+
on:
5+
workflow_run:
6+
workflows: ["Release"]
7+
types: [requested]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
update-pot-file:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout master branch
19+
uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Install PHP
24+
uses: shivammathur/setup-php@master
25+
with:
26+
php-version: "7.4"
27+
28+
- name: Setup WP-CLI
29+
uses: godaddy-wordpress/setup-wp-cli@1
30+
31+
#######################
32+
### MAKE EDITS HERE ###
33+
#######################
34+
# edit .pot location
35+
# remove/edit --subtract option
36+
# add any files or folders for excluding if necessary with --exclude options
37+
#######################
38+
- name: Generate new pot file
39+
run: >
40+
wp i18n make-pot . languages/default.pot --skip-audit --subtract="languages/terms_to_exclude.pot"
41+
--exclude="admin"
42+
#######################
43+
44+
- name: Check diff output
45+
run: git diff | wc -l
46+
47+
- name: Add changes
48+
run: git add -A
49+
50+
- name: Check status
51+
run: git status
52+
53+
- name: push changes
54+
uses: github-actions-x/commit@master
55+
with:
56+
github-token: ${{ secrets.GITHUB_TOKEN }}
57+
push-branch: master
58+
commit-message: 'Update .pot translation file'
59+
name: ${{ github.actor }}
60+
email: ${{github.actor}}@users.noreply.github.com
61+
62+
- name: Check git config
63+
run: git config --list --show-origin

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
vendor/*
2+
composer.lock
3+
.idea
4+
.phpunit.result.cache

.rename.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
find ./ -type f -print0 | xargs -0 perl -pi -e 's/Disciple_Tools_Plugin_Starter_Template/Disciple_Tools_Plugin_Starter_Template/g';
2+
find ./ -type f -print0 | xargs -0 perl -pi -e 's/disciple_tools_plugin_starter_template/disciple_tools_plugin_starter_template/g';
3+
find ./ -type f -print0 | xargs -0 perl -pi -e 's/disciple-tools-plugin-starter-template/disciple-tools-plugin-starter-template/g';
4+
find ./ -type f -print0 | xargs -0 perl -pi -e 's/starter_post_type/starter_post_type/g';
5+
find ./ -type f -print0 | xargs -0 perl -pi -e 's/Plugin Starter Template/Plugin Starter Template/g';
6+
mv disciple-tools-plugin-starter-template.php disciple-tools-plugin-starter-template.php
7+
rm .rename.sh

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at info@disciple.tools. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Thank you for joining us in contributing to Disciple.Tools! These are the guidelines we expect you to follow in writing code that will be used in or with D.T.
2+
3+
### Translations
4+
D.T is already being used in multiple languages. Please help us make D.T translable by taking full advantage of Wordpress’ translatable strings. Any string that will be read by the user must be marked as translatable. Ex:
5+
`<label class="section-header"><?php esc_html_e( 'Other', 'disciple-tools-plugin-starter-template' )?></label>`
6+
7+
Make sure you look for these in PHP, HTML and JavaScript code.
8+
9+
### PHPCS
10+
We use [PHPCS](https://github.com/squizlabs/PHP_CodeSniffer) and [PHPCS WordPress Coding Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards) to test for syntax errors, security vulnerabilities and some styling rules. We expect your commits to pass these tests.
11+
12+
In the theme you can run `./tests/test_phpcs.sh` or create a pull request to our repo and Github Actions CI will run the tests for you.
13+
14+
If you are working on a plugin based off our starter plugin run `./includes/admin/test/test_phpcs.sh`
15+
16+
You might need to run `composer install` first.
17+
18+
Note: rules for PHPCS are located in the `phpcs.xml` file. We sometimes update the rule list as PHPCS updates. We’ll update the [starter plugin](https://github.com/DiscipleTools/disciple-tools-plugin-starter-template) `phpcs.xml`, you might want to look there to get the latest version.
19+
20+
### GitHub and Commits
21+
For new plugins copy our [starter plugin](https://github.com/DiscipleTools/disciple-tools-plugin-starter-template).
22+
23+
To commit to the theme or an existing plugin start by creating a fork of the repository. When you are ready, create a pull request into our repo.
24+
25+
Note: Depending on your context you may wish to use an anonymous GitHub account.
26+
27+
### `WP_DEBUG`
28+
Enable `WP_DEBUG` in your `wp-config.php`: `define('WP_DEBUG', true);`
29+
Checking out a PR and seeing the orange debug table is disappointing.
30+
31+
We look forward to hearing from you!

0 commit comments

Comments
 (0)