-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: README.md class-tgm-plugin-activation.php example.php
- Loading branch information
Showing
13 changed files
with
5,227 additions
and
2,425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This file is for unifying the coding style for different editors and IDEs | ||
# editorconfig.org | ||
|
||
# WordPress Coding Standards | ||
# http://make.wordpress.org/core/handbook/coding-standards/ | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
tab_width = 4 | ||
indent_style = tab | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.{md,json,yml}] | ||
trim_trailing_whitespace = false | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
checks: | ||
php: | ||
use_self_instead_of_fqcn: true | ||
uppercase_constants: true | ||
simplify_boolean_return: true | ||
return_doc_comment_if_not_inferrable: true | ||
remove_extra_empty_lines: true | ||
prefer_while_loop_over_for_loop: true | ||
parameter_doc_comments: true | ||
param_doc_comment_if_not_inferrable: true | ||
optional_parameters_at_the_end: true | ||
no_short_method_names: | ||
minimum: '3' | ||
no_long_variable_names: | ||
maximum: '25' | ||
no_goto: true | ||
newline_at_end_of_file: true | ||
naming_conventions: | ||
local_variable: '^[a-z][a-z_0-9]*$' | ||
abstract_class_name: ^Abstract|Factory$ | ||
utility_class_name: 'Utils?$' | ||
constant_name: '^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*$' | ||
property_name: '^[a-z][a-z_0-9]*$' | ||
method_name: '^(?:[a-z]|__)[a-z_0-9]*$' | ||
parameter_name: '^[a-z][a-z_0-9]*$' | ||
interface_name: '^[A-Z][a-zA-Z0-9_]*Interface$' | ||
type_name: '^[A-Z][a-zA-Z0-9_]*$' | ||
exception_name: '^[A-Z][a-zA-Z0-9_]*Exception$' | ||
isser_method_name: '^(?:is|has|should|may|supports)' | ||
more_specific_types_in_doc_comments: true | ||
fix_line_ending: true | ||
fix_use_statements: | ||
remove_unused: true | ||
preserve_multiple: false | ||
preserve_blanklines: false | ||
order_alphabetically: true | ||
encourage_single_quotes: true | ||
encourage_postdec_operator: true | ||
avoid_todo_comments: true | ||
avoid_perl_style_comments: true | ||
avoid_multiple_statements_on_same_line: true | ||
avoid_fixme_comments: true | ||
align_assignments: true | ||
no_global_keyword: false | ||
one_class_per_file: false | ||
side_effects_or_types: false | ||
avoid_superglobals: false | ||
|
||
tools: | ||
sensiolabs_security_checker: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Travis CI (MIT License) configuration file | ||
# @link https://travis-ci.org/ | ||
|
||
# Use new container based environment | ||
sudo: false | ||
|
||
# Declare project language. | ||
# @link http://about.travis-ci.org/docs/user/languages/php/ | ||
language: php | ||
|
||
# Declare versions of PHP to use. Use one decimal max. | ||
php: | ||
- 5.2 | ||
- 5.6 | ||
- hhvm | ||
|
||
matrix: | ||
allow_failures: | ||
- php: hhvm | ||
|
||
before_script: | ||
- export PHPCS_DIR=/tmp/phpcs | ||
- export WPCS_DIR=/tmp/wpcs | ||
# Install CodeSniffer for WordPress Coding Standards checks. | ||
# 2.3.1 breaks PHP 5.2 on Travis due to use of Phar class. | ||
- git clone -b 2.3.0 --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR | ||
# Install WordPress Coding Standards. | ||
- git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $WPCS_DIR | ||
# Set install path for WordPress Coding Standards. | ||
# @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941 | ||
- $PHPCS_DIR/scripts/phpcs --config-set installed_paths $WPCS_DIR | ||
# After CodeSniffer install you should refresh your path. | ||
- phpenv rehash | ||
|
||
# Run test script commands. | ||
# All commands must exit with code 0 on success. Anything else is considered failure. | ||
script: | ||
# Search for PHP syntax errors. | ||
- find . \( -name '*.php' \) -exec php -lf {} \; | ||
# WordPress Coding Standards | ||
# @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards | ||
# @link https://github.com/squizlabs/PHP_CodeSniffer | ||
# All of the usual config flags are held in phpcs.xml | ||
- $PHPCS_DIR/scripts/phpcs | ||
|
||
notifications: | ||
email: false |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# How To Contribute | ||
|
||
Thanks for reading our contribution guidelines. | ||
|
||
The following guidelines for contribution should be followed if you want to submit a pull request. | ||
|
||
## How To Prepare | ||
|
||
* You need a [GitHub account](https://github.com/signup/free). | ||
* Before reporting a bug or suggesting an improvement, please check the `develop` branch to see if it has already been addressed. | ||
* Duplicate tickets will be closed without hesitation, so please check through existing tickets first to see if someone else has already discussed it. | ||
* Submit an [issue ticket] for your issue if there is not one yet. | ||
* Describe the issue and include steps to reproduce if it's a bug. | ||
* If the issue is a bug, add any relevant JavaScript or PHP error messages. For PHP error messages, a backtrace is preferred. If you don't know how to get one, please [follow these instructions](https://gist.github.com/jrfnl/5925642). | ||
* Include relevant version numbers. | ||
* Additional screenshots or videos are often helpful. | ||
* If you are able and want to fix this, fork the repository on GitHub. | ||
|
||
## Make Changes | ||
|
||
We use the [git-flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model. Before reporting a bug or new feature, please check the `develop` branch to see if it's already been addressed. | ||
|
||
* In your forked repository, create a topic branch for your upcoming patch. Usually this is based on the `develop` branch. | ||
* For enhancements, name the branch according to the feature e.g. `feature/auto-activate`. | ||
* For un-reported bug fixes, add a `fix-` prefix e.g. `feature/fix-admin-notices`. | ||
* For code that addresses an existing Issue, add the Issue number as a prefix e.g. `feature/123-auto-activate` or `feature/321-fix-admin-notices`. | ||
* Please avoid working directly on the `develop` branch. | ||
* Code should follow the [WordPress Coding Standards for PHP](https://make.wordpress.org/core/handbook/coding-standards/php/). | ||
* Use [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) with the [WordPress Coding Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards) sniffs to check. Since we use `phpcs.xml`, you should be able to navigate on command line to the root of the repo and just run `phpcs` without any arguments. | ||
* Make commits of logical units and describe them properly. | ||
* Check for unnecessary whitespace with `git diff --check` before committing. | ||
|
||
## Commit Messages | ||
We suggest you follow best practices for commit messages: | ||
|
||
* Separate subject (first line) from body with a blank line. | ||
* Limit the subject line to 50 characters. | ||
* Capitalize the subject line. | ||
* Do not end the subject line with a period. | ||
* Use the imperative mood in the subject line. | ||
* Wrap the body at 72 characters. | ||
* Use the body to explain _what_ and _why_ versus _how_. | ||
* Please [reference any existing issue](https://help.github.com/articles/closing-issues-via-commit-messages/) in the commit message. | ||
|
||
Read [this post](http://chris.beams.io/posts/git-commit/) for more detail. | ||
|
||
## Submit Changes | ||
|
||
* Push your changes to a topic branch in your fork of the repository. | ||
* Open a pull request to the original repository and choose the correct original branch (probably `develop`) you want to patch. | ||
* Do not close any issue you referenced in your commit message. | ||
* If you have write access to the repository, do not directly push or merge your own pull-requests. Add the `[reviewmerge]` label when your branch is considered complete and let another team member review your pull request and approve. | ||
|
||
## License | ||
|
||
All submissions are agreed to be licensed under the same license as present in the repository. | ||
|
||
## Security | ||
|
||
There is no need to sign-off or GPG sign your commits. Tags (from 2.4.1 onwards) will be GPG signed. | ||
|
||
# Additional Resources | ||
|
||
* [General GitHub documentation](http://help.github.com/) | ||
* [GitHub pull request documentation](http://help.github.com/send-pull-requests/). | ||
* [Read the Issue Guidelines by @necolas](https://github.com/necolas/issue-guidelines/blob/master/CONTRIBUTING.md) for more details, | ||
|
||
[issue ticket]: https://github.com/TGMPA/TGM-Plugin-Activation/issues | ||
[reviewmerge]: https://github.com/TGMPA/TGM-Plugin-Activation/labels/reviewmerge |
Oops, something went wrong.