Skip to content

Commit

Permalink
Add the experimental HTML converter (#47)
Browse files Browse the repository at this point in the history
* Update wptelegram-bot-api

* Update wptelegram-bot-api

* Add format-text library

* Move wptelegram-bot-api to bot-api

* Update format-text

* Fix VS Code config

* Update composer and PHPCS config

* Update format-text

* Add the experimental HTML converter

* Update gulpfile.esm.js

* Prepare for v3.2.0

Co-authored-by: irshadahmad21 <[email protected]>
  • Loading branch information
irshadahmad21 and irshadahmad21 authored Jan 19, 2023
1 parent f5bc9ac commit 9d02cab
Show file tree
Hide file tree
Showing 32 changed files with 194 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Checkout the commit
uses: actions/checkout@v2
with:
# Ensure to checkout wptelegram-bot-api submodule
# Ensure to checkout git submodules
submodules: recursive

# Remove everything except src/, .wordpress-org and .distignore
Expand Down
9 changes: 6 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "src/includes/wptelegram-bot-api"]
path = src/includes/wptelegram-bot-api
url = https://github.com/manzoorwanijk/wptelegram-bot-api.git
[submodule "src/includes/bot-api"]
path = src/includes/bot-api
url = [email protected]:wpsocio/wptelegram-bot-api.git
[submodule "src/includes/format-text"]
path = src/includes/format-text
url = [email protected]:wpsocio/wptelegram-format-text.git
5 changes: 4 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"recommendations": ["emeraldwalk.runonsave", "ikappas.phpcs", "bmewburn.vscode-intelephense-client"]
"recommendations": [
"wongjn.php-sniffer",
"bmewburn.vscode-intelephense-client",
]
}
17 changes: 5 additions & 12 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
{
"phpcs.standard": "${workspaceFolder}/phpcs.xml",
"emeraldwalk.runonsave": {
"commands": [
{
"match": "\\.php$",
"cmd": "\"vendor/bin/phpcbf\" --standard=phpcs.xml \"${file}\""
}
]
},
"[php]": {
"editor.formatOnSave": false
}
"[php]": {
"editor.defaultFormatter": "wongjn.php-sniffer",
"editor.formatOnSave": true
},
"phpSniffer.standard": "phpcs.xml",
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
**Requires at least:** 5.8
**Requires PHP:** 7.0
**Tested up to:** 6.1.1
**Stable tag:** 3.1.15
**Stable tag:** 3.2.0
**License:** GPLv2 or later
**License URI:** [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html)

Expand Down
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project are documented in this file.

## Unreleased

## [3.2.0 - 2023-01-19](https://github.com/wpsocio/wptelegram/releases/tag/v3.2.0)

### Enhancements

- Added the new experimental HTML converter for better formatting of email notifications
- The new can be enabled using `add_filter( 'wptelegram_notify_use_experimental_text', '__return_true' );`

## [3.1.15 - 2023-01-5](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.15)

### Bug fixes
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wptelegram/core",
"version": "3.1.15",
"version": "3.2.0",
"description": "Integrate your WordPress site perfectly with Telegram with full control.",
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "*",
Expand All @@ -17,7 +17,7 @@
"\"vendor/bin/phpcs\" --config-set installed_paths ../../../vendor/wp-coding-standards/wpcs",
"\"vendor/bin/phpcs\" --config-set default_standard WordPress"
],
"lint": "\"vendor/bin/phpcs\" --ignore=src/assets/*,src/languages/*,*/index.php,src/includes/html2text/* src/",
"lint": "\"vendor/bin/phpcs\" --ignore=src/assets/*,src/languages/*,*/index.php,src/includes/html2text/*,src/includes/format-text/* src/",
"lint:skip-warnings": "\"vendor/bin/phpcs\" -n",
"lint:fix": "\"vendor/bin/phpcbf\" --standard=phpcs.xml --ignore=src/assets/*,src/languages/*,*/index.php,src/includes/html2text/* src/"
},
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const createVersionUpdateCB = (forFile, version) => {
patterns = [/Version:\s*(\d+\.\d+\.\d+)/i, new RegExp("'" + versionConst + "',\\s*'(\\d+\\.\\d+\\.\\d+)'")];
break;
case 'since-xyz':
patterns = [/@since[\s\t]*(x\.y\.z)/gi];
patterns = [/@since[\s\t]*(x\.y\.z)/gi, /((?:since:)x\.y\.z)/gi];
break;
}
return through2.obj(function (file, _, cb) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "wptelegram",
"title": "WP Telegram",
"version": "3.1.15",
"version": "3.2.0",
"description": "Integrate your WordPress site perfectly with Telegram with full control.",
"repository": {
"type": "git",
Expand Down
41 changes: 23 additions & 18 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="WPTelegram">

<!-- Enable colors in report -->
<arg name="colors"/>
<!-- Enable colors in report -->
<arg name="colors" />

<!-- Add source codes in the report -->
<arg value="s"/>
<!-- Add source codes in the report -->
<arg value="s" />

<!-- Load WordPress Coding standards -->
<rule ref="WordPress"/>
<exclude-pattern>*/includes/format-text/*</exclude-pattern>
<exclude-pattern>*/includes/html2text/*</exclude-pattern>

<!-- Customize -->
<rule ref="WordPress">
<!-- Disable File Name warning -->
<exclude name="WordPress.Files.FileName" />
<!-- Disable short array syntax warning -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax" />
</rule>
<!-- Disallow Long Array Syntax -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax.Found">
<type>warning</type>
</rule>
<!-- Load WordPress Coding standards -->
<rule ref="WordPress" />

<!-- Customize -->
<rule ref="WordPress">
<!-- Disable File Name warning -->
<exclude name="WordPress.Files.FileName" />

<!-- Disable short array syntax warning -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax" />
</rule>

<!-- Disallow Long Array Syntax -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax.Found">
<type>warning</type>
</rule>
</ruleset>
6 changes: 5 additions & 1 deletion src/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: telegram, notifications, posts, channel, group
Requires at least: 5.8
Tested up to: 6.1.1
Requires PHP: 7.0
Stable tag: 3.1.15
Stable tag: 3.2.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -205,6 +205,10 @@ Yes, all you need to do is to setup **Private Notifications** module and use the

== Changelog ==

= 3.2.0 =
- Added the new experimental HTML converter for better formatting of email notifications
- The new can be enabled using `add_filter( 'wptelegram_notify_use_experimental_text', '__return_true' );`

= 3.1.15 =
- Fixed PHP warning when not using message thread ID

Expand Down
7 changes: 7 additions & 0 deletions src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project are documented in this file.

## Unreleased

## [3.2.0 - 2023-01-19](https://github.com/wpsocio/wptelegram/releases/tag/v3.2.0)

### Enhancements

- Added the new experimental HTML converter for better formatting of email notifications
- The new can be enabled using `add_filter( 'wptelegram_notify_use_experimental_text', '__return_true' );`

## [3.1.15 - 2023-01-5](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.15)

### Bug fixes
Expand Down
7 changes: 6 additions & 1 deletion src/includes/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,12 @@ private function load_dependencies() {
/**
* The class responsible for loading \WPTelegram\BotAPI library
*/
require_once $this->dir( '/includes/wptelegram-bot-api/src/index.php' );
require_once $this->dir( '/includes/bot-api/src/index.php' );

/**
* The class responsible for loading \WPTelegram\FormatText library
*/
require_once $this->dir( '/includes/format-text/autoload-wp.php' );

/**
* The library responsible for converting HTML to plain text
Expand Down
1 change: 1 addition & 0 deletions src/includes/bot-api
Submodule bot-api added at 19f161
1 change: 1 addition & 0 deletions src/includes/format-text
Submodule format-text added at f0623b
1 change: 0 additions & 1 deletion src/includes/wptelegram-bot-api
Submodule wptelegram-bot-api deleted from 4a21b9
4 changes: 2 additions & 2 deletions src/languages/wptelegram-ar.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WP Telegram - Stable\n"
"Report-Msgid-Bugs-To: https://github.com/wpsocio/wptelegram\n"
"POT-Creation-Date: 2022-12-08 11:44:38+00:00\n"
"POT-Creation-Date: 2023-01-19 15:14:07+00:00\n"
"PO-Revision-Date: 2021-03-14 01:37+0530\n"
"Last-Translator: \n"
"Language-Team: WPTelegram\n"
Expand All @@ -29,7 +29,7 @@ msgid ""
"and do lot more :)"
msgstr ""

#: includes/Main.php:314
#: includes/Main.php:319
msgid "WP Telegram"
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions src/languages/wptelegram-ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WP Telegram - Stable\n"
"Report-Msgid-Bugs-To: https://github.com/wpsocio/wptelegram\n"
"POT-Creation-Date: 2022-12-08 11:44:38+00:00\n"
"POT-Creation-Date: 2023-01-19 15:14:07+00:00\n"
"PO-Revision-Date: 2021-03-14 01:37+0530\n"
"Last-Translator: \n"
"Language-Team: WPTelegram\n"
Expand All @@ -29,7 +29,7 @@ msgid ""
"and do lot more :)"
msgstr ""

#: includes/Main.php:314
#: includes/Main.php:319
msgid "WP Telegram"
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions src/languages/wptelegram-de_DE.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WP Telegram - Stable\n"
"Report-Msgid-Bugs-To: https://github.com/wpsocio/wptelegram\n"
"POT-Creation-Date: 2022-12-08 11:44:38+00:00\n"
"POT-Creation-Date: 2023-01-19 15:14:07+00:00\n"
"PO-Revision-Date: 2021-03-14 01:37+0530\n"
"Last-Translator: Robert Skiba <[email protected]>\n"
"Language-Team: Deutsch\n"
Expand All @@ -30,7 +30,7 @@ msgstr ""
"Mit diesem Plugin kann man Posts an Telegram senden, Benachrichtigungen "
"erhalten und vieles mehr :)"

#: includes/Main.php:314
#: includes/Main.php:319
msgid "WP Telegram"
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions src/languages/wptelegram-es_ES.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WP Telegram - Stable\n"
"Report-Msgid-Bugs-To: https://github.com/wpsocio/wptelegram\n"
"POT-Creation-Date: 2022-12-08 11:44:38+00:00\n"
"POT-Creation-Date: 2023-01-19 15:14:07+00:00\n"
"PO-Revision-Date: 2021-03-14 01:37+0530\n"
"Last-Translator: Robert Skiba <[email protected]>\n"
"Language-Team: Deutsch\n"
Expand All @@ -28,7 +28,7 @@ msgid ""
"and do lot more :)"
msgstr ""

#: includes/Main.php:314
#: includes/Main.php:319
msgid "WP Telegram"
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions src/languages/wptelegram-fa_IR.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WP Telegram - Stable\n"
"Report-Msgid-Bugs-To: https://github.com/wpsocio/wptelegram\n"
"POT-Creation-Date: 2022-12-08 11:44:38+00:00\n"
"POT-Creation-Date: 2023-01-19 15:14:07+00:00\n"
"PO-Revision-Date: 2021-03-14 02:02+0530\n"
"Last-Translator: \n"
"Language-Team: Taktaweb Group <[email protected]>\n"
Expand Down Expand Up @@ -31,7 +31,7 @@ msgstr ""
"با این افزونه، شما می توانید نوشته‌ها را به تلگرام بفرستید و اعلان دریافت "
"کنید و کلی کارهای دیگه انجام بدید :)"

#: includes/Main.php:314
#: includes/Main.php:319
msgid "WP Telegram"
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions src/languages/wptelegram-id_ID.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WP Telegram - Stable\n"
"Report-Msgid-Bugs-To: https://github.com/wpsocio/wptelegram\n"
"POT-Creation-Date: 2022-12-08 11:44:38+00:00\n"
"POT-Creation-Date: 2023-01-19 15:14:07+00:00\n"
"PO-Revision-Date: 2021-03-14 01:59+0530\n"
"Last-Translator: \n"
"Language-Team: WPTelegram\n"
Expand All @@ -30,7 +30,7 @@ msgstr ""
"Dengan plugin ini, Anda dapat mengirim posting ke Telegram dan menerima "
"notifikasi dan melakukan lebih banyak lagi :)"

#: includes/Main.php:314
#: includes/Main.php:319
msgid "WP Telegram"
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions src/languages/wptelegram-it_IT.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WP Telegram - Stable\n"
"Report-Msgid-Bugs-To: https://github.com/wpsocio/wptelegram\n"
"POT-Creation-Date: 2022-12-08 11:44:38+00:00\n"
"POT-Creation-Date: 2023-01-19 15:14:07+00:00\n"
"PO-Revision-Date: 2021-03-21 12:14+0530\n"
"Last-Translator: \n"
"Language-Team: WPTelegram\n"
Expand All @@ -30,7 +30,7 @@ msgstr ""
"Con questo plugin puoi spedire i tuoi articoli a Telegram, ricevere "
"notifiche e molto altro :)"

#: includes/Main.php:314
#: includes/Main.php:319
msgid "WP Telegram"
msgstr "WP Telegram"

Expand Down
4 changes: 2 additions & 2 deletions src/languages/wptelegram-pl_PL.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WP Telegram - Stable\n"
"Report-Msgid-Bugs-To: https://github.com/wpsocio/wptelegram\n"
"POT-Creation-Date: 2022-12-08 11:44:38+00:00\n"
"POT-Creation-Date: 2023-01-19 15:14:07+00:00\n"
"PO-Revision-Date: 2021-03-14 02:09+0530\n"
"Last-Translator: \n"
"Language-Team: Polski\n"
Expand Down Expand Up @@ -34,7 +34,7 @@ msgstr ""
"Dzięki tej wtyczce możesz wysyłać posty do Telegrama, otrzymywać "
"powiadomienia i robić wiele więcej :)"

#: includes/Main.php:314
#: includes/Main.php:319
msgid "WP Telegram"
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions src/languages/wptelegram-pt_BR.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WP Telegram - Stable\n"
"Report-Msgid-Bugs-To: https://github.com/wpsocio/wptelegram\n"
"POT-Creation-Date: 2022-12-08 11:44:38+00:00\n"
"POT-Creation-Date: 2023-01-19 15:14:07+00:00\n"
"PO-Revision-Date: 2021-03-14 02:11+0530\n"
"Last-Translator: \n"
"Language-Team: WPTelegram\n"
Expand All @@ -28,7 +28,7 @@ msgid ""
"and do lot more :)"
msgstr ""

#: includes/Main.php:314
#: includes/Main.php:319
msgid "WP Telegram"
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions src/languages/wptelegram-ru_RU.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WP Telegram - Stable\n"
"Report-Msgid-Bugs-To: https://github.com/wpsocio/wptelegram\n"
"POT-Creation-Date: 2022-12-08 11:44:38+00:00\n"
"POT-Creation-Date: 2023-01-19 15:14:07+00:00\n"
"PO-Revision-Date: 2021-03-14 02:21+0530\n"
"Last-Translator: \n"
"Language-Team: WPTelegram\n"
Expand Down Expand Up @@ -31,7 +31,7 @@ msgstr ""
"С помощью этого плагина вы можете отправлять сообщения в Telegram, получать "
"уведомления и делать многое другое :)"

#: includes/Main.php:314
#: includes/Main.php:319
msgid "WP Telegram"
msgstr ""

Expand Down
Loading

0 comments on commit 9d02cab

Please sign in to comment.