Skip to content

Commit

Permalink
Fix multiple empty lines in post content and excerpt (#28)
Browse files Browse the repository at this point in the history
* Deployed from manzoorwanijk/wp-plugins@f3c17b1062c8c1a9d7cfc844762195c12c2e4ae4

* Deployed from manzoorwanijk/wp-plugins@64e35c422027fd4c154a08bd521a532da2c150ee

* Fix admin page not shown just after upgrade

* Update release.yml

* Fix multiple empty lines in post content and excerpt

* Update deps

* Deployed from manzoorwanijk/wp-plugins@f93e2bd8b9c1cc302f9abb394e37dd1418a4e630

* Prepare for v3.1.2

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: manzoorwanijk <[email protected]>
  • Loading branch information
3 people authored Jul 5, 2021
1 parent e41c2b1 commit 8d7b37b
Show file tree
Hide file tree
Showing 38 changed files with 136 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
submodules: recursive

- name: Set up Node
uses: dcodeIO/setup-node-nvm@master
uses: actions/setup-node@v2
with:
node-version: lts/*

Expand Down
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.3
**Requires PHP:** 7.0
**Tested up to:** 5.7.2
**Stable tag:** 3.1.1
**Stable tag:** 3.1.2
**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.1.2 - 2021-07-5](https://github.com/manzoorwanijk/wptelegram/releases/tag/v3.1.2)

### Bug fixes

- Fixed admin page not shown just after upgrade
- Fixed multiple empty lines in post content and excerpt

## [3.1.1 - 2021-06-10](https://github.com/manzoorwanijk/wptelegram/releases/tag/v3.1.1)

### Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wptelegram/core",
"version": "3.1.1",
"version": "3.1.2",
"description": "Integrate your WordPress site perfectly with Telegram with full control.",
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "*",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "wptelegram",
"title": "WP Telegram",
"version": "3.1.1",
"version": "3.1.2",
"description": "Integrate your WordPress site perfectly with Telegram with full control.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -29,7 +29,7 @@
},
"devDependencies": {
"@wordpress/i18n": "^4.1.1",
"eslint": "^7.28.0",
"eslint": "^7.30.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"esm": "^3.2.25",
Expand All @@ -43,7 +43,7 @@
"gulp-uglifycss": "^1.1.0",
"gulp-zip": "^5.1.0",
"node-wp-i18n": "^1.2.5",
"prettier": "^2.3.1",
"prettier": "^2.3.2",
"semver": "7.3.5"
}
}
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.3
Tested up to: 5.7.2
Requires PHP: 7.0
Stable tag: 3.1.1
Stable tag: 3.1.2
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.1.2 =
- Fixed admin page not shown just after upgrade
- Fixed multiple empty lines in post content and excerpt

= 3.1.1 =
- Fixed file upload for CloudFlare proxy

Expand Down
27 changes: 27 additions & 0 deletions src/admin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,33 @@ public function plugin_action_links( $links ) {
return $links;
}

/**
* Fires up plugin version upgrade by sending a non-blocking request to home page
* immediately after the plugin is upgraded to a new version.
*
* @since 3.1.2
*
* @param mixed $upgrader WP Upgrader instance.
* @param array $args Array of bulk item update data.
*/
public function fire_plugin_version_upgrade( $upgrader, $args ) {
if ( 'update' === $args['action'] && 'plugin' === $args['type'] ) {
foreach ( $args['plugins'] as $basename ) {
if ( WPTELEGRAM_BASENAME === $basename ) {
wp_remote_get(
site_url(),
[
'timeout' => 0.01,
'blocking' => false,
'sslverify' => false,
]
);
break;
}
}
}
}

/**
* Initiate logger
*
Expand Down
24 changes: 12 additions & 12 deletions src/assets/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{
"files": {
"wptelegram--main.css": "/static/css/wptelegram--main.760d5b78.css",
"wptelegram--main.js": "/static/js/wptelegram--main.97e5b58d.js",
"wptelegram--main.js.map": "/static/js/wptelegram--main.97e5b58d.js.map",
"wptelegram--main.php": "/static/js/wptelegram--main.18b99ef1.asset.php",
"wptelegram--main.js": "/static/js/wptelegram--main.c10affd4.js",
"wptelegram--main.js.map": "/static/js/wptelegram--main.c10affd4.js.map",
"wptelegram--main.php": "/static/js/wptelegram--main.b4c5521e.asset.php",
"wptelegram--p2tg-classic.js": "/static/js/wptelegram--p2tg-classic.0e808952.js",
"wptelegram--p2tg-classic.js.map": "/static/js/wptelegram--p2tg-classic.0e808952.js.map",
"wptelegram--p2tg-classic.php": "/static/js/wptelegram--p2tg-classic.00dd4837.asset.php",
"wptelegram--p2tg-gb.js": "/static/js/wptelegram--p2tg-gb.9a7929be.js",
"wptelegram--p2tg-gb.js.map": "/static/js/wptelegram--p2tg-gb.9a7929be.js.map",
"wptelegram--p2tg-gb.php": "/static/js/wptelegram--p2tg-gb.b8eb556f.asset.php",
"wptelegram--p2tg-gb.js": "/static/js/wptelegram--p2tg-gb.c4deeb03.js",
"wptelegram--p2tg-gb.js.map": "/static/js/wptelegram--p2tg-gb.c4deeb03.js.map",
"wptelegram--p2tg-gb.php": "/static/js/wptelegram--p2tg-gb.4469c26b.asset.php",
"static/css/wptelegram--main.760d5b78.css.map": "/static/css/wptelegram--main.760d5b78.css.map",
"static/js/wptelegram--main.97e5b58d.js.LICENSE.txt": "/static/js/wptelegram--main.97e5b58d.js.LICENSE.txt",
"static/js/wptelegram--p2tg-gb.9a7929be.js.LICENSE.txt": "/static/js/wptelegram--p2tg-gb.9a7929be.js.LICENSE.txt"
"static/js/wptelegram--main.c10affd4.js.LICENSE.txt": "/static/js/wptelegram--main.c10affd4.js.LICENSE.txt",
"static/js/wptelegram--p2tg-gb.c4deeb03.js.LICENSE.txt": "/static/js/wptelegram--p2tg-gb.c4deeb03.js.LICENSE.txt"
},
"entrypoints": {
"wptelegram--main": [
"static/css/wptelegram--main.760d5b78.css",
"static/js/wptelegram--main.97e5b58d.js",
"static/js/wptelegram--main.18b99ef1.asset.php"
"static/js/wptelegram--main.c10affd4.js",
"static/js/wptelegram--main.b4c5521e.asset.php"
],
"wptelegram--p2tg-classic": [
"static/js/wptelegram--p2tg-classic.0e808952.js",
"static/js/wptelegram--p2tg-classic.00dd4837.asset.php"
],
"wptelegram--p2tg-gb": [
"static/js/wptelegram--p2tg-gb.9a7929be.js",
"static/js/wptelegram--p2tg-gb.b8eb556f.asset.php"
"static/js/wptelegram--p2tg-gb.c4deeb03.js",
"static/js/wptelegram--p2tg-gb.4469c26b.asset.php"
]
}
}
3 changes: 0 additions & 3 deletions src/assets/static/js/wptelegram--main.97e5b58d.js

This file was deleted.

1 change: 0 additions & 1 deletion src/assets/static/js/wptelegram--main.97e5b58d.js.map

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('jquery', 'react', 'react-dom', 'wp-api-fetch', 'wp-i18n', 'wp-polyfill'), 'version' => '7aa1a3e9bff5a6f91ef2ca3ce11d804b');
<?php return array('dependencies' => array('jquery', 'react', 'react-dom', 'wp-api-fetch', 'wp-i18n', 'wp-polyfill'), 'version' => '04759ec7ed760432f8084d61e519ffdc');
3 changes: 3 additions & 0 deletions src/assets/static/js/wptelegram--main.c10affd4.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/assets/static/js/wptelegram--main.c10affd4.js.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-media-utils', 'wp-plugins'), 'version' => '1fe106e406c3c2a0e9fef023f579529b');
<?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-media-utils', 'wp-plugins'), 'version' => 'f3b4152f416a4ce7e1d8c893ad18a06f');
1 change: 0 additions & 1 deletion src/assets/static/js/wptelegram--p2tg-gb.9a7929be.js.map

This file was deleted.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/assets/static/js/wptelegram--p2tg-gb.c4deeb03.js.map

Large diffs are not rendered by default.

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.1.2 - 2021-07-5](https://github.com/manzoorwanijk/wptelegram/releases/tag/v3.1.2)

### Bug fixes

- Fixed admin page not shown just after upgrade
- Fixed multiple empty lines in post content and excerpt

## [3.1.1 - 2021-06-10](https://github.com/manzoorwanijk/wptelegram/releases/tag/v3.1.1)

### Bug fixes
Expand Down
2 changes: 2 additions & 0 deletions src/includes/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ private function define_admin_hooks() {

add_filter( 'plugin_action_links_' . WPTELEGRAM_BASENAME, [ $plugin_admin, 'plugin_action_links' ] );

add_filter( 'upgrader_process_complete', [ $plugin_admin, 'fire_plugin_version_upgrade' ], 10, 2 );

add_action( 'init', [ $plugin_admin, 'initiate_logger' ] );

$asset_manager = AssetManager::instance();
Expand Down
3 changes: 0 additions & 3 deletions src/includes/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,6 @@ public static function trim_words( $text, $num_words = 55, $more = null, $preser
$text = preg_replace( $pattern, '${1}', $text ) . $more;
}

// remove multiple newlines.
$text = preg_replace( '/\n[\n\r\s]*\n[\n\r\s]*\n/u', "\n\n", $text );

return apply_filters( 'wptelegram_utils_trim_words', $text, $num_words, $more, $original_text );
}

Expand Down
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/manzoorwanijk/wptelegram\n"
"POT-Creation-Date: 2021-05-30 06:08:38+00:00\n"
"POT-Creation-Date: 2021-07-05 06:49:43+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:312
#: includes/Main.php:314
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/manzoorwanijk/wptelegram\n"
"POT-Creation-Date: 2021-05-30 06:08:38+00:00\n"
"POT-Creation-Date: 2021-07-05 06:49:43+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:312
#: includes/Main.php:314
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/manzoorwanijk/wptelegram\n"
"POT-Creation-Date: 2021-05-30 06:08:38+00:00\n"
"POT-Creation-Date: 2021-07-05 06:49:43+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:312
#: includes/Main.php:314
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/manzoorwanijk/wptelegram\n"
"POT-Creation-Date: 2021-05-30 06:08:38+00:00\n"
"POT-Creation-Date: 2021-07-05 06:49:43+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:312
#: includes/Main.php:314
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/manzoorwanijk/wptelegram\n"
"POT-Creation-Date: 2021-05-30 06:08:38+00:00\n"
"POT-Creation-Date: 2021-07-05 06:49:43+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:312
#: includes/Main.php:314
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/manzoorwanijk/wptelegram\n"
"POT-Creation-Date: 2021-05-30 06:08:38+00:00\n"
"POT-Creation-Date: 2021-07-05 06:49:43+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:312
#: includes/Main.php:314
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/manzoorwanijk/wptelegram\n"
"POT-Creation-Date: 2021-05-30 06:08:38+00:00\n"
"POT-Creation-Date: 2021-07-05 06:49:43+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:312
#: includes/Main.php:314
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/manzoorwanijk/wptelegram\n"
"POT-Creation-Date: 2021-05-30 06:08:38+00:00\n"
"POT-Creation-Date: 2021-07-05 06:49:43+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:312
#: includes/Main.php:314
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/manzoorwanijk/wptelegram\n"
"POT-Creation-Date: 2021-05-30 06:08:38+00:00\n"
"POT-Creation-Date: 2021-07-05 06:49:43+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:312
#: includes/Main.php:314
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/manzoorwanijk/wptelegram\n"
"POT-Creation-Date: 2021-05-30 06:08:38+00:00\n"
"POT-Creation-Date: 2021-07-05 06:49:43+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:312
#: includes/Main.php:314
msgid "WP Telegram"
msgstr ""

Expand Down
Loading

0 comments on commit 8d7b37b

Please sign in to comment.