diff --git a/composer.lock b/composer.lock index 567cc1bb..b881b59e 100644 --- a/composer.lock +++ b/composer.lock @@ -115,11 +115,11 @@ }, { "name": "publishpress/publishpress-instance-protection", - "version": "v1.0.1", + "version": "v1.0.2", "source": { "type": "git", "url": "https://github.com/publishpress/publishpress-instance-protection", - "reference": "ddfa4b1e07f77b41b26e46223626584a85800073" + "reference": "ef1a631a41b723ce2e856f534ff4befbe914e964" }, "require": { "php": ">=5.6.20" @@ -139,20 +139,20 @@ "keywords": [ "wordpress plugin" ], - "time": "2022-05-03T13:25:31+00:00" + "time": "2022-06-03T17:41:36+00:00" }, { "name": "publishpress/wordpress-banners", - "version": "v1.2.8", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/publishpress/wordpress-banners.git", - "reference": "79a02716f89b93daec5b2dc0e8c1bc4d1cf9967c" + "reference": "08e20b98320367bdbc59105095c72e7ccbf968f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/publishpress/wordpress-banners/zipball/79a02716f89b93daec5b2dc0e8c1bc4d1cf9967c", - "reference": "79a02716f89b93daec5b2dc0e8c1bc4d1cf9967c", + "url": "https://api.github.com/repos/publishpress/wordpress-banners/zipball/08e20b98320367bdbc59105095c72e7ccbf968f1", + "reference": "08e20b98320367bdbc59105095c72e7ccbf968f1", "shasum": "" }, "require": { @@ -178,22 +178,22 @@ "homepage": "http://publishpress.com/", "support": { "issues": "https://github.com/publishpress/wordpress-banners/issues", - "source": "https://github.com/publishpress/wordpress-banners/tree/v1.2.8" + "source": "https://github.com/publishpress/wordpress-banners/tree/v1.3.0" }, - "time": "2022-03-18T14:49:29+00:00" + "time": "2022-06-03T15:45:27+00:00" }, { "name": "publishpress/wordpress-reviews", - "version": "v1.1.18", + "version": "v1.1.19", "source": { "type": "git", "url": "https://github.com/publishpress/wordpress-reviews.git", - "reference": "0020705b8f6a7177fc393c6c42c82171bf9e2fbd" + "reference": "028e573eb7c5da2455a7a823cabbbe5e3f89ca9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/publishpress/wordpress-reviews/zipball/0020705b8f6a7177fc393c6c42c82171bf9e2fbd", - "reference": "0020705b8f6a7177fc393c6c42c82171bf9e2fbd", + "url": "https://api.github.com/repos/publishpress/wordpress-reviews/zipball/028e573eb7c5da2455a7a823cabbbe5e3f89ca9c", + "reference": "028e573eb7c5da2455a7a823cabbbe5e3f89ca9c", "shasum": "" }, "require": { @@ -246,30 +246,41 @@ ], "support": { "issues": "https://github.com/publishpress/wordpress-reviews/issues", - "source": "https://github.com/publishpress/wordpress-reviews/tree/v1.1.18" + "source": "https://github.com/publishpress/wordpress-reviews/tree/v1.1.19" }, - "time": "2021-12-15T00:03:53+00:00" + "time": "2022-06-03T13:38:53+00:00" }, { "name": "publishpress/wordpress-version-notices", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/publishpress/WordPress-Version-Notices.git", - "reference": "57e7cbb3e9b9ac366ddd3fd0a80c2e2eabf75ea3" + "reference": "a46b552ac4cbec26d743307611e5dd8d56f80a57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/publishpress/WordPress-Version-Notices/zipball/57e7cbb3e9b9ac366ddd3fd0a80c2e2eabf75ea3", - "reference": "57e7cbb3e9b9ac366ddd3fd0a80c2e2eabf75ea3", + "url": "https://api.github.com/repos/publishpress/WordPress-Version-Notices/zipball/a46b552ac4cbec26d743307611e5dd8d56f80a57", + "reference": "a46b552ac4cbec26d743307611e5dd8d56f80a57", "shasum": "" }, "require": { "php": ">=5.6.20", - "pimple/pimple": "^3" + "pimple/pimple": "~3.2.0", + "psr/container": "~1.0.0" }, "require-dev": { - "lucatume/wp-browser": "^2.4" + "codeception/module-asserts": "^1.0", + "codeception/module-cli": "^1.0", + "codeception/module-db": "^1.0", + "codeception/module-filesystem": "^1.0", + "codeception/module-phpbrowser": "^1.0", + "codeception/module-rest": "^1.3", + "codeception/module-webdriver": "^1.0", + "codeception/util-universalframework": "^1.0", + "composer/composer": "2.2.12", + "lucatume/wp-browser": "^3", + "overtrue/phplint": "^2.1" }, "type": "library", "autoload": { @@ -292,9 +303,9 @@ "description": "Library for displaying version notices for Pro plugins in WordPress.", "support": { "issues": "https://github.com/publishpress/WordPress-Version-Notices/issues", - "source": "https://github.com/publishpress/WordPress-Version-Notices/tree/1.1.3" + "source": "https://github.com/publishpress/WordPress-Version-Notices/tree/1.1.4" }, - "time": "2021-07-14T16:15:47+00:00" + "time": "2022-06-06T15:45:54+00:00" }, { "name": "symfony/polyfill-ctype", @@ -610,16 +621,16 @@ }, { "name": "bordoni/phpass", - "version": "0.3.5", + "version": "0.3.6", "source": { "type": "git", "url": "https://github.com/bordoni/phpass.git", - "reference": "fd57c109213e95150b7de1dc8908c55605cd8e55" + "reference": "12f8f5cc03ebb7efd69554f104afe9aa1aa46e1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bordoni/phpass/zipball/fd57c109213e95150b7de1dc8908c55605cd8e55", - "reference": "fd57c109213e95150b7de1dc8908c55605cd8e55", + "url": "https://api.github.com/repos/bordoni/phpass/zipball/12f8f5cc03ebb7efd69554f104afe9aa1aa46e1a", + "reference": "12f8f5cc03ebb7efd69554f104afe9aa1aa46e1a", "shasum": "" }, "require": { @@ -651,7 +662,7 @@ } ], "description": "Portable PHP password hashing framework", - "homepage": "http://github.com/hautelook/phpass/", + "homepage": "http://github.com/bordoni/phpass/", "keywords": [ "blowfish", "crypt", @@ -660,7 +671,7 @@ ], "support": { "issues": "https://github.com/bordoni/phpass/issues", - "source": "https://github.com/bordoni/phpass/tree/0.3.5" + "source": "https://github.com/bordoni/phpass/tree/0.3.6" }, "time": "2012-08-31T00:00:00+00:00" }, @@ -2641,16 +2652,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.4.3", + "version": "7.4.4", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab" + "reference": "e3ff079b22820c2029d4c2a87796b6a0b8716ad8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/74a8602c6faec9ef74b7a9391ac82c5e65b1cdab", - "reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/e3ff079b22820c2029d4c2a87796b6a0b8716ad8", + "reference": "e3ff079b22820c2029d4c2a87796b6a0b8716ad8", "shasum": "" }, "require": { @@ -2745,7 +2756,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.3" + "source": "https://github.com/guzzle/guzzle/tree/7.4.4" }, "funding": [ { @@ -2761,7 +2772,7 @@ "type": "tidelift" } ], - "time": "2022-05-25T13:24:33+00:00" + "time": "2022-06-09T21:39:15+00:00" }, { "name": "guzzlehttp/promises", @@ -2849,16 +2860,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.2.1", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2" + "reference": "83260bb50b8fc753c72d14dc1621a2dac31877ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/c94a94f120803a18554c1805ef2e539f8285f9a2", - "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/83260bb50b8fc753c72d14dc1621a2dac31877ee", + "reference": "83260bb50b8fc753c72d14dc1621a2dac31877ee", "shasum": "" }, "require": { @@ -2882,7 +2893,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.3-dev" } }, "autoload": { @@ -2944,7 +2955,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.2.1" + "source": "https://github.com/guzzle/psr7/tree/2.3.0" }, "funding": [ { @@ -2960,7 +2971,7 @@ "type": "tidelift" } ], - "time": "2022-03-20T21:55:58+00:00" + "time": "2022-06-09T08:26:02+00:00" }, { "name": "hoa/consistency", @@ -3594,7 +3605,7 @@ }, { "name": "illuminate/collections", - "version": "v8.83.14", + "version": "v8.83.16", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", @@ -3648,7 +3659,7 @@ }, { "name": "illuminate/contracts", - "version": "v8.83.14", + "version": "v8.83.16", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", @@ -3696,7 +3707,7 @@ }, { "name": "illuminate/macroable", - "version": "v8.83.14", + "version": "v8.83.16", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -3742,16 +3753,16 @@ }, { "name": "illuminate/support", - "version": "v8.83.14", + "version": "v8.83.16", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "89245b6e19017f627a35af3874ad9251b76b02cc" + "reference": "be43102d3491e8335812aa5441a1552108ddd7b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/89245b6e19017f627a35af3874ad9251b76b02cc", - "reference": "89245b6e19017f627a35af3874ad9251b76b02cc", + "url": "https://api.github.com/repos/illuminate/support/zipball/be43102d3491e8335812aa5441a1552108ddd7b5", + "reference": "be43102d3491e8335812aa5441a1552108ddd7b5", "shasum": "" }, "require": { @@ -3806,7 +3817,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-05-09T16:28:53+00:00" + "time": "2022-06-07T14:46:48+00:00" }, { "name": "justinrainbow/json-schema", @@ -7994,16 +8005,16 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" + "reference": "433d05519ce6990bf3530fba6957499d327395c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", + "reference": "433d05519ce6990bf3530fba6957499d327395c2", "shasum": "" }, "require": { @@ -8015,7 +8026,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8055,7 +8066,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" }, "funding": [ { @@ -8071,20 +8082,20 @@ "type": "tidelift" } ], - "time": "2021-11-23T21:10:46+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + "reference": "219aa369ceff116e673852dce47c3a41794c14bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", + "reference": "219aa369ceff116e673852dce47c3a41794c14bd", "shasum": "" }, "require": { @@ -8096,7 +8107,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8139,7 +8150,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" }, "funding": [ { @@ -8155,20 +8166,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", "shasum": "" }, "require": { @@ -8183,7 +8194,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8222,7 +8233,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" }, "funding": [ { @@ -8238,20 +8249,20 @@ "type": "tidelift" } ], - "time": "2021-11-30T18:21:41+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" + "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85", + "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85", "shasum": "" }, "require": { @@ -8260,7 +8271,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8301,7 +8312,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0" }, "funding": [ { @@ -8317,20 +8328,20 @@ "type": "tidelift" } ], - "time": "2021-06-05T21:20:04+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", "shasum": "" }, "require": { @@ -8339,7 +8350,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8384,7 +8395,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" }, "funding": [ { @@ -8400,20 +8411,20 @@ "type": "tidelift" } ], - "time": "2022-03-04T08:16:47+00:00" + "time": "2022-05-10T07:21:04+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" + "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", - "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1", + "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1", "shasum": "" }, "require": { @@ -8422,7 +8433,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8463,7 +8474,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0" }, "funding": [ { @@ -8479,7 +8490,7 @@ "type": "tidelift" } ], - "time": "2021-09-13T13:58:11+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/process", @@ -9185,21 +9196,21 @@ }, { "name": "webmozart/assert", - "version": "1.10.0", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" + "ext-ctype": "*", + "php": "^7.2 || ^8.0" }, "conflict": { "phpstan/phpstan": "<0.12.20", @@ -9237,9 +9248,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.10.0" + "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, - "time": "2021-03-09T10:59:23+00:00" + "time": "2022-06-03T18:03:27+00:00" }, { "name": "wp-cli/i18n-command", diff --git a/defines.php b/defines.php index 1fc1bde4..8e0bbdad 100644 --- a/defines.php +++ b/defines.php @@ -12,7 +12,7 @@ defined('ABSPATH') or die('No direct script access allowed.'); if (!defined('PP_AUTHORS_LOADED')) { - define('PP_AUTHORS_VERSION', '3.17.0'); + define('PP_AUTHORS_VERSION', '3.18.0'); define('PP_AUTHORS_FILE', 'publishpress-authors/publishpress-authors.php'); define('PP_AUTHORS_BASE_PATH', plugin_dir_path(__DIR__ . '/publishpress-authors.php')); define('PP_AUTHORS_MODULES_PATH', PP_AUTHORS_BASE_PATH . 'src/modules/'); diff --git a/publishpress-authors.php b/publishpress-authors.php index 15874290..d4d8d8dc 100644 --- a/publishpress-authors.php +++ b/publishpress-authors.php @@ -5,7 +5,7 @@ * Description: PublishPress Authors allows you to add multiple authors and guest authors to WordPress posts * Author: PublishPress * Author URI: https://publishpress.com - * Version: 3.17.0 + * Version: 3.18.0 * Text Domain: publishpress-authors * * ------------------------------------------------------------------------------ diff --git a/readme.txt b/readme.txt index c83018ed..827415ed 100644 --- a/readme.txt +++ b/readme.txt @@ -7,7 +7,7 @@ Tags: multiple authors, authors, guest authors, author fields, author layouts Requires at least: 4.7 Requires PHP: 5.6 Tested up to: 6.0 -Stable tag: 3.17.0 +Stable tag: 3.18.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -224,6 +224,19 @@ There are two ways to install the PublishPress Authors plugin: == Changelog == += [3.18.0] - 13 Jun 2022 = + +* Fixed: Allow authors to have the same name, #682 +* Added: Extend [publishpress_authors_data] shortcode to return authors user object, #697 +* Fixed: Search box doesn't accept ' characters in username, #699 +* Added: Add Authors important menu link to plugin row, #714 +* Fixed: Author menu missing in admin menus, #715 +* Fixed: PHP 7.2 compability, #711 +* Added: Add [publishpress_authors_list] shortcode to the Free version, #706 +* Fixed: Most important buttons should be yellow only, #704 +* Fixed: Author Box shortcode is in the wrong place, #695 +* Fixed: Small typo in shortcode, #693 + = [3.17.0] - 30 May 2022 = * Added: Option to enable/disable loading font awesome assets in frontend, #625 diff --git a/src/assets/css/pressshack-admin.css b/src/assets/css/pressshack-admin.css index f941bd86..bf9e051f 100644 --- a/src/assets/css/pressshack-admin.css +++ b/src/assets/css/pressshack-admin.css @@ -151,25 +151,6 @@ border-style: solid; } -.pressshack-admin-wrapper .button-primary { - background-color: #FFB300; - border-color: #C58C07; - color: #754D26; -} - -.pressshack-admin-wrapper .button-primary:hover, -.pressshack-admin-wrapper .button-primary:active, -.pressshack-admin-wrapper .button-primary:focus { - background-color: #F3AC04; - border-color: #C58C07; - color: #333; - outline: none; - box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); - -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); - -o-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); -} - .pressshack-admin-wrapper .button:not(.notice-dismiss):hover, .pressshack-admin-wrapper .button:not(.notice-dismiss):active, .pressshack-admin-wrapper .button:not(.notice-dismiss):focus { diff --git a/src/assets/js/multiple-authors.js b/src/assets/js/multiple-authors.js index 9232e08a..8f31db75 100644 --- a/src/assets/js/multiple-authors.js +++ b/src/assets/js/multiple-authors.js @@ -618,6 +618,41 @@ jQuery(document).ready(function ($) { }); + //change submit button to enable slug generation on custom button click + if ($('body.taxonomy-author form#addtag #submit').length > 0) { + $('body.taxonomy-author form#addtag #submit').hide(); + $('body.taxonomy-author form#addtag #submit').after(''); + } + + //generate author slug when adding author. + $(document).on('click', 'body.taxonomy-author form#addtag #author-submit', function (event) { + + var $authorName = $('input[name="tag-name"]').val(); + var $form = $(this).closest('form#addtag'); + + event.preventDefault(); + + //prepare ajax data + var data = { + action: "handle_author_slug_generation", + author_name: $authorName, + nonce: MultipleAuthorsStrings.generate_author_slug_nonce, + }; + + $form.find('.spinner').addClass('is-active'); + + $.post(ajaxurl, data, function (response) { + $form.find('.spinner').removeClass('is-active'); + if (response.author_slug) { + $('input[name="slug"]').val(response.author_slug); + $('body.taxonomy-author form#addtag #submit').trigger('click'); + } else { + $('body.taxonomy-author form#addtag #submit').trigger('click'); + } + }); + + }); + /** * Settings shortcode copy to clipboard */ diff --git a/src/core/Classes/Admin_Ajax.php b/src/core/Classes/Admin_Ajax.php index ee8c943a..585254f8 100644 --- a/src/core/Classes/Admin_Ajax.php +++ b/src/core/Classes/Admin_Ajax.php @@ -107,6 +107,7 @@ public static function get_possible_authors_for_search($search, $ignored = [], $ ]; if (!empty($search)) { + $search = str_replace(['\"', "\'"], '', $search); $term_args['search'] = $search; } @@ -315,4 +316,46 @@ public static function handle_mapped_author_validation() wp_send_json($response); exit; } + + /** + * Handle a request to generate author slug. + */ + public static function handle_author_slug_generation() + { + + $response['status'] = 'success'; + $response['content'] = esc_html__('Request status.', 'publishpress-authors'); + + //do not process request if nonce validation failed + if (empty($_POST['nonce']) + || !wp_verify_nonce(sanitize_key($_POST['nonce']), 'generate_author_slug_nonce') + ) { + $response['status'] = 'error'; + $response['content'] = esc_html__( + 'Security error. Kindly reload this page and try again', + 'publishpress-authors' + ); + } elseif (empty($_POST['author_name'])) { + $response['status'] = 'error'; + $response['content'] = esc_html__('Author name is required', 'publishpress-authors'); + } else { + $author_slug = !empty($_POST['author_name']) ? sanitize_title($_POST['author_name']) : ''; + $generated_slug = $author_slug; + $generated_slug_n = ''; + + $new_slug = $generated_slug; + while (get_term_by('slug', $new_slug, 'author')) { + if ($generated_slug_n == '') { + $generated_slug_n = 1; + } else { + $generated_slug_n++; + } + $new_slug = $generated_slug .'-' . $generated_slug_n; + } + $response['author_slug'] = $new_slug; + } + + wp_send_json($response); + exit; + } } diff --git a/src/core/Plugin.php b/src/core/Plugin.php index 96b004b1..d9b06983 100644 --- a/src/core/Plugin.php +++ b/src/core/Plugin.php @@ -110,6 +110,7 @@ public function __construct() add_shortcode('publishpress_authors_box', [$this, 'shortcodeAuthorsBox']); add_shortcode('publishpress_authors_data', [$this, 'shortcodeAuthorsData']); + add_shortcode('publishpress_authors_list', [$this, 'shortcodeAuthorsList']); // Action to display the author box add_action('pp_multiple_authors_show_author_box', [$this, 'action_echo_author_box'], 10, 5); @@ -270,6 +271,10 @@ public function __construct() 'wp_ajax_mapped_author_validation', ['MultipleAuthors\\Classes\\Admin_Ajax', 'handle_mapped_author_validation'] ); + add_action( + 'wp_ajax_handle_author_slug_generation', + ['MultipleAuthors\\Classes\\Admin_Ajax', 'handle_author_slug_generation'] + ); add_filter('admin_footer_text', [$this, 'update_footer_admin']); } @@ -1456,6 +1461,7 @@ public function enqueue_scripts($hook_suffix) 'publishpress-authors' ), 'mapped_author_nonce' => wp_create_nonce("mapped_author_nonce"), + 'generate_author_slug_nonce' => wp_create_nonce("generate_author_slug_nonce"), 'term_author_link' => esc_url_raw($term_author_link), 'view_text' => esc_html__('View', 'publishpress-authors'), ]; @@ -1744,6 +1750,21 @@ public function shortcodeAuthorsBox($attributes) return $this->get_author_box_markup('shortcode', $show_title, $layout, $archive, $post_id); } + public function shortcodeAuthorsList($attributes) + { + $widget = new Authors_Widget('authors_list_shortcode', 'authors_list_shortcode'); + + $defaults = [ + 'show_title' => true + ]; + + $attributes = wp_parse_args($attributes, $defaults); + + ob_start(); + $widget->widget([], $attributes); + return ob_get_clean(); + } + /** * Shortcode to get the authors data * @@ -1753,24 +1774,31 @@ public function shortcodeAuthorsBox($attributes) */ public function shortcodeAuthorsData($attributes) { - $field = 'display_name'; - $post_id = false; - $seperator = ','; + $field = 'display_name'; + $post_id = false; + $separator = ','; + $user_objects = false; if (isset($attributes['post_id'])) { $post_id = $attributes['post_id']; } - if (isset($attributes['seperator'])) { - $seperator = $attributes['seperator']; + if (isset($attributes['separator'])) { + $separator = $attributes['separator']; + } elseif (isset($attributes['seperator'])) { + $separator = $attributes['seperator']; } if (isset($attributes['field'])) { $field = $attributes['field']; } - return $this->get_authors_data($post_id, $field, $seperator); + if (isset($attributes['user_objects'])) { + $user_objects = $attributes['user_objects'] === 'true' || (int)$attributes['user_objects'] === 1; + } + + return $this->get_authors_data($post_id, $field, $separator, $user_objects); } /** diff --git a/src/core/Traits/Author_box.php b/src/core/Traits/Author_box.php index b815852b..80485e9a 100644 --- a/src/core/Traits/Author_box.php +++ b/src/core/Traits/Author_box.php @@ -269,14 +269,16 @@ protected function get_author_box_markup( * * @param int $post_id * @param string $field - * @param mixed $seperator + * @param mixed $separator + * @param mixed $user_objects * * @return string */ protected function get_authors_data( $post_id = false, $field = 'display_name', - $seperator = ',' + $separator = ',', + $user_objects = false ) { global $post; @@ -294,13 +296,16 @@ protected function get_authors_data( $authors = get_post_authors($post_id, true, false); - if (!empty($authors)) { - foreach ($authors as $author) { - $author = Author::get_by_term_id($author->term_id); - $output[] = isset($author->$field) ? $author->$field : $author->display_name; + if (!$user_objects) { + if (!empty($authors)) { + foreach ($authors as $author) { + $output[] = isset($author->$field) ? $author->$field : $author->display_name; + } } + $output = array_filter($output); + $authors = join($separator, $output); } - return join($seperator, $output); + return $authors; } } diff --git a/src/modules/multiple-authors/multiple-authors.php b/src/modules/multiple-authors/multiple-authors.php index b5a316ae..d32916b1 100644 --- a/src/modules/multiple-authors/multiple-authors.php +++ b/src/modules/multiple-authors/multiple-authors.php @@ -157,6 +157,8 @@ public function init() add_action('multiple_authors_admin_menu_page', [$this, 'action_admin_menu_page']); add_action('multiple_authors_admin_submenu', [$this, 'action_admin_submenu'], 50); add_filter('custom_menu_order', [$this, 'filter_custom_menu_order']); + //add plugin row meta + add_filter('plugin_row_meta', [$this, 'add_plugin_meta'], 10, 2); add_action('admin_enqueue_scripts', [$this, 'admin_enqueue_scripts']); } @@ -272,14 +274,13 @@ public function action_admin_menu_page() self::MENU_SLUG, '', 'dashicons-groups', - 26.7 + '26.7' ); $current_author = Author::get_by_user_id(get_current_user_id()); - if ( - $current_author && - is_object($current_author) && - isset($current_author->term_id) + if ($current_author + && is_object($current_author) + && isset($current_author->term_id) ) { add_menu_page( esc_html__('Author Profile', 'publishpress-authors'), @@ -288,7 +289,7 @@ public function action_admin_menu_page() 'term.php?taxonomy=author&tag_ID='.$current_author->term_id, __return_empty_string(), 'dashicons-groups', - 26.8 + '26.8' ); } @@ -325,6 +326,24 @@ public function action_admin_submenu() ); } + /** + * Add Authors and Settings to plugin row meta + * + * @param array $links + * @param string $file + * + * @return array + */ + public function add_plugin_meta($links, $file) + { + if ($file == plugin_basename(PP_AUTHORS_FILE)) { + $links[] = '' . esc_html__('Authors', 'publishpress-authors') . ''; + $links[] = '' . esc_html__('Settings', 'publishpress-authors') . ''; + } + + return $links; + } + public function redirect_to_edit_terms_page() { echo 'Redirecting...'; @@ -839,7 +858,7 @@ private function settings_ppma_shortcodes($shortcodes = []) { 'publishpress-authors' ), 'show_title="true"', - 'show_title="false"', + 'show_title="false"' ), ], 'option_4' => [ @@ -850,13 +869,23 @@ private function settings_ppma_shortcodes($shortcodes = []) { ), ], 'option_5' => [ + 'shortcode' => '[publishpress_authors_box layout="author_box" archive="1"]', + 'description' => sprintf( + esc_html__( + 'If you are having problems showing PublishPress Authors on author profile pages, you can use this shortcode below. The argument %s forces the plugin to retrieve the Author from the profile page and not any other posts on the same screen.', + 'publishpress-authors-pro' + ), + 'archive="1"' + ), + ], + 'option_6' => [ 'shortcode' => '[publishpress_authors_box layout="boxed" archive="true"]', 'description' => sprintf( esc_html__( 'There is one final option to mention. This is mostly useful if you\'re using a theme or page builder to customize the Author profile pages you find at URLs such as /author/username/. You can use the following shortcode on the authors page to display the profile of the current author. You just need to add the parameter %s.', 'publishpress-authors' ), - 'archive="true"', + 'archive="true"' ), ], ], @@ -888,9 +917,9 @@ private function settings_ppma_shortcodes($shortcodes = []) { ), ], 'option_3' => [ - 'shortcode' => '[publishpress_authors_data seperator=","]', + 'shortcode' => '[publishpress_authors_data separator=","]', 'description' => esc_html__( - 'You can also specify the seperator to be used for mulitple authors data.', + 'You can also specify the separator to be used for mulitple authors data.', 'publishpress-authors' ), ], @@ -901,6 +930,45 @@ private function settings_ppma_shortcodes($shortcodes = []) { 'publishpress-authors' ), ], + 'option_5' => [ + 'shortcode' => '[publishpress_authors_data user_objects="true"]', + 'description' => sprintf( + esc_html__( + 'You can also decide to return array lists of authors for custom use or formatting by using %1s which will return all authors object data as array. You can check full details and sample usage %2s in this guide %3s', + 'publishpress-authors' + ), + 'user_objects="true"', + '', + '' + ), + ], + ], + ]; + + //add authors list shortcode + $shortcodes['publishpress_authors_list'] = [ + 'label' => esc_html__('Authors List', 'publishpress-authors-pro'), + 'description' => esc_html__('Shortcode to show all the authors on your site. It accept all parameters as in Author box shortcode.', 'publishpress-authors-pro'), + 'options' => [ + 'option_1' => [ + 'shortcode' => '[publishpress_authors_list]' + ], + 'option_2' => [ + 'shortcode' => '[publishpress_authors_list layout="boxed"]', + 'description' => sprintf( + esc_html__( + 'You can choose from the following layouts: %1s %2s %3s %4s %5s. You can see full details of each layout option %6s in this guide %7s.', + 'publishpress-authors-pro' + ), + 'simple_list', + 'centered', + 'boxed', + 'inline', + 'inline_avatar', + '', + '' + ), + ], ], ];