Skip to content

Commit

Permalink
Merge pull request #8 from hametuha/bugfix/issue-7
Browse files Browse the repository at this point in the history
Bugfix/issue 7
  • Loading branch information
fumikito committed Apr 5, 2024
2 parents 21ae612 + d257332 commit d21ae8f
Show file tree
Hide file tree
Showing 41 changed files with 20,842 additions and 656 deletions.
5 changes: 5 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# https://github.com/browserslist/browserslist#readme

>= 1%
last 2 major version
not dead
24 changes: 24 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.browserslistrc
.editorconfig
.eslintrc
.distignore
.git
.github
.gitignore
.node-version
.stylelintrc.json
.wordpress-org
.wp-env.json
node_modules
composer.lock
gulpfile.js
package-lock.json
phpcs.ruleset.xml
phpunit.xml.dist
README.md
webpack.config.js
wordpress
bin
tests
hameslack.php.bak
readme.txt.bak
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
tab_width = 4

[*.yml]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[{*.txt,wp-config-sample.php}]
end_of_line = crlf
38 changes: 38 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"parser": "@babel/eslint-parser",
"env": {
"browser": true,
"jquery": true
},
"globals": {
"wp": false,
"jQuery": false,
"ga": false
},
"extends": [
"plugin:@wordpress/eslint-plugin/recommended-with-formatting"
],
"rules": {
"no-alert": "off",
"prettier/prettier": "off",
"object-shorthand": "off",
"jsdoc/require-jsdoc": "off",
"jsdoc/no-undefined-types": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-sort-props": "off",
"jsdoc/check-tag-names": "off",
"import/order": "off",
"no-prototype-builtins": "off",
"object-curly-newline": "off",
"object-property-newline": "off",
"yoda": "off",
"strict": "off",
"@wordpress/valid-sprintf": "off",
"camelcase": "off"
},
"settings": {
"react": {
"version": "16.9.0"
}
}
}
114 changes: 114 additions & 0 deletions .github/workflows/wordpress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Deploy Plugin

on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master

jobs:
test:
strategy:
matrix:
php: [ '7.2', '8.0', '8.2' ] # PHP versions to check.
wp: [ 'latest', '5.9' ] # WordPress version to check.
uses: tarosky/workflows/.github/workflows/wp-unit-test.yml@main
with:
php_version: ${{ matrix.php }}
wp_version: ${{ matrix.wp }}

phpcs:
uses: tarosky/workflows/.github/workflows/phpcs.yml@main
with:
version: 8.0

phplint:
uses: tarosky/workflows/.github/workflows/phplint.yml@main

assets:
name: Assets Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install NPM Packages
run: npm install

- name: Check JS & CSS syntax
run: npm run lint

release:
name: Deploy WordPress.org
needs: [ test, phpcs, phplint, assets ]
if: contains(github.ref, 'tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.2
tools: composer
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Build Plugin
run: |
composer install --prefer-dist --no-dev
npm install
npm run package
- name: Generate readme.txt
uses: tarosky/workflows/actions/wp-readme@main

- name: Versioning
uses: tarosky/workflows/actions/versioning@main
with:
version: ${{ github.ref }}
files: readme.txt,hameslack.php

- name: Deploy to WordPress Directory
id: deploy
uses: 10up/action-wordpress-plugin-deploy@stable
with:
generate-zip: true
env:
SVN_USERNAME: ${{ secrets.WP_ORG_USERNAME }}
SVN_PASSWORD: ${{ secrets.WP_ORG_PASSWORD }}

- name: Create Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload release asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ github.event.repository.name }}.zip
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.svn
node_modules/
vendor/
readme.txt
.svn/
/node_modules/
/vendor/
/readme.txt
/dist/
composer.lock
17 changes: 17 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": [
"stylelint-config-wordpress/scss"
],
"rules": {
"value-keyword-case": [ "lower", {
"ignoreProperties": [ "font-family" ]
} ],
"color-named": null,
"number-leading-zero": null,
"rule-empty-line-before": null,
"declaration-property-unit-whitelist": null,
"selector-class-pattern": null,
"at-rule-empty-line-before": null,
"no-descending-specificity": null
}
}
11 changes: 0 additions & 11 deletions .svnignore

This file was deleted.

34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

Binary file added .wordpress-org/banner-1544x500.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/banner-772x250.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": [ "." ],
"themes": [
"https://downloads.wordpress.org/theme/twentytwenty.latest-stable.zip"
]
}
26 changes: 14 additions & 12 deletions readme.md → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

Tags: slack
Contributors: Takahashi_Fumiki
Tested up to: 4.9.6
Requires at least: 4.7.0
Requires PHP: 5.4
Stable Tag: 1.2.0
Tested up to: 6.4
Requires at least: 5.9
Requires PHP: 7.2
Stable Tag: nightly
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.txt

Expand All @@ -15,20 +15,13 @@ A Slack utility for WordPress.

This plugin integrates [Slack](https://slack.com) and WordPress.

![Travis](https://travis-ci.org/hametuha/hameslack.svg)
![Donwloads](https://img.shields.io/wordpress/plugin/dt/hameslack.svg)
![Version](https://img.shields.io/wordpress/plugin/v/hameslack.svg)
![Rating](https://img.shields.io/wordpress/plugin/r/hameslack.svg)

### Core Conception

By default, this plugin does nothing. It's true.
Slack has many API intergrations, but **hameslack** uses 3 of them.
Slack has many API intergrations, but **hameslack** uses 2 of them.

- [Incoming Webhook](https://api.slack.com/incoming-webhooks) to post to slack.
- [Outgoing Webhook](https://api.slack.com/outgoing-webhooks) to get request from slack.
- [Custom Bot](https://api.slack.com/bot-users) to interact with slack.
- [Sending Invitation](https://github.com/ErikKalkoken/slackApiDoc/blob/master/users.admin.invite.md) to existing user(CAUTION: this is unofficial API usage).

Upper is easier. This plugin helps the connection between Slack and WordPress and you can concentrate on what you should do with slack.

Expand All @@ -54,6 +47,10 @@ Function is also available, but I prefer to use `do_action` to avoid annoying `i

Everything works fine if you set properly.

### Deprecated API

- **Sending Invitation** <code>deprecated at 2.0</code>: this endpoint was unofficial and official one is only for Enterprise grid. Users now can send invitation reqeust from their profile page.
- **Outgoind Webhook** <code>deprecated at 2.0</code>: Slack recommends Events API instead.

## Install

Expand Down Expand Up @@ -83,6 +80,11 @@ If you have any request, please make issue on [github](https://github.com/hametu

## Changelog

### 2.0.0

- Remove invitation feature and users now can simple send message to specific channel to request invitation.
- Bot is required.

### 1.2.0

- If [gianism](https://wordpress.org/plugins/gianism) is enabled, you can log in with Slack account.
Expand Down
Loading

0 comments on commit d21ae8f

Please sign in to comment.