diff --git a/.github/ISSUE_TEMPLATE/release-free-plugin.md b/.github/ISSUE_TEMPLATE/release-free-plugin.md index 741f5fdf..8ce54cbf 100644 --- a/.github/ISSUE_TEMPLATE/release-free-plugin.md +++ b/.github/ISSUE_TEMPLATE/release-free-plugin.md @@ -26,12 +26,13 @@ To release the Free plugin please make sure to check all the checkboxes below. - [ ] Merge the `master` branch into the `development` branch - [ ] Create the Github release (make sure it is based on the `master` branch and correct tag) -#### SVN Repo +#### SVN Repo\ +- [ ] Update your working copy using `$ svn update` - [ ] Cleanup the `trunk` directory. - [ ] Unzip the built package and move files to the `trunk` - [ ] Remove any eventual file that shouldn't be released in the package (if you find anything, make sure to create an issue to fix the build script) - [ ] Look for new files `$ svn status | grep \?` and add them using `$ svn add ` - [ ] Look for removed files `$ svn status | grep !` and remove them `$ svn rm ` - [ ] Create the new tag `$ svn cp trunk tags/` -- [ ] Commit the changes `$ svn ci 'Releasing '` +- [ ] Commit the changes `$ svn ci -m 'Releasing '` - [ ] Wait until WordPress updates the version number and make the final test updating the plugin in a staging site diff --git a/.gitignore b/.gitignore index 144398dd..d1d99cc8 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ node_modules /dist .env.testing builder.yml +*.code-workspace diff --git a/composer.json b/composer.json index 3fba9507..433d3b2c 100644 --- a/composer.json +++ b/composer.json @@ -42,6 +42,10 @@ { "type": "git", "url": "https://github.com/publishpress/wp-browser" + }, + { + "type": "git", + "url": "https://github.com/publishpress/publishpress-instance-protection" } ], "require": { @@ -52,7 +56,8 @@ "psr/container": "1.0.0", "publishpress/wordpress-version-notices": "^1", "publishpress/wordpress-reviews": "^1.1", - "publishpress/wordpress-banners": "^1.2" + "publishpress/wordpress-banners": "^1.2", + "publishpress/publishpress-instance-protection": "^1.0" }, "require-dev": { "lucatume/wp-browser": "^3", diff --git a/composer.lock b/composer.lock index be27f19f..d3ffc731 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c114e06bf94e0fea7c9d2e05a117cdc0", + "content-hash": "794581bf285193ac4751bcaf17f8c7a1", "packages": [ { "name": "pimple/pimple", @@ -113,6 +113,34 @@ }, "time": "2017-02-14T16:28:37+00:00" }, + { + "name": "publishpress/publishpress-instance-protection", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/publishpress/publishpress-instance-protection", + "reference": "ddfa4b1e07f77b41b26e46223626584a85800073" + }, + "require": { + "php": ">=5.6.20" + }, + "type": "library", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "PublishPress", + "email": "help@publishpress.com" + } + ], + "description": "Library for protecting WordPress plugins to run twice.", + "homepage": "http://publishpress.com/", + "keywords": [ + "wordpress plugin" + ], + "time": "2022-05-03T13:25:31+00:00" + }, { "name": "publishpress/wordpress-banners", "version": "v1.2.8", @@ -1614,16 +1642,16 @@ }, { "name": "consolidation/annotated-command", - "version": "4.5.4", + "version": "4.5.5", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "93398c3166d9026ab93219ce23b2092b4d7b7904" + "reference": "67cea8e8e7656b74da651ea6f49321853996c0fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/93398c3166d9026ab93219ce23b2092b4d7b7904", - "reference": "93398c3166d9026ab93219ce23b2092b4d7b7904", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/67cea8e8e7656b74da651ea6f49321853996c0fd", + "reference": "67cea8e8e7656b74da651ea6f49321853996c0fd", "shasum": "" }, "require": { @@ -1664,9 +1692,9 @@ "description": "Initialize Symfony Console commands from annotated command class methods.", "support": { "issues": "https://github.com/consolidation/annotated-command/issues", - "source": "https://github.com/consolidation/annotated-command/tree/4.5.4" + "source": "https://github.com/consolidation/annotated-command/tree/4.5.5" }, - "time": "2022-04-05T17:58:10+00:00" + "time": "2022-04-26T16:18:25+00:00" }, { "name": "consolidation/config", @@ -2562,26 +2590,25 @@ }, { "name": "grasmash/expander", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/grasmash/expander.git", - "reference": "f4df21d01d1fbda38269cca89e3dbb6ba223da7f" + "reference": "b7cbc1f2fdf9a9c0e253a424c2a4058316b7cb6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/grasmash/expander/zipball/f4df21d01d1fbda38269cca89e3dbb6ba223da7f", - "reference": "f4df21d01d1fbda38269cca89e3dbb6ba223da7f", + "url": "https://api.github.com/repos/grasmash/expander/zipball/b7cbc1f2fdf9a9c0e253a424c2a4058316b7cb6e", + "reference": "b7cbc1f2fdf9a9c0e253a424c2a4058316b7cb6e", "shasum": "" }, "require": { "dflydev/dot-access-data": "^3.0.0", - "php": ">=5.6", - "psr/log": "^1 | ^2" + "php": ">=7.1", + "psr/log": "^1 | ^2 | ^3" }, "require-dev": { "greg-1-anderson/composer-test-scenarios": "^1", - "php-coveralls/php-coveralls": "^2.0", "phpunit/phpunit": "^6.0 || ^8.0 || ^9", "squizlabs/php_codesniffer": "^2.7 || ^3.3" }, @@ -2608,9 +2635,9 @@ "description": "Expands internal property references in PHP arrays file.", "support": { "issues": "https://github.com/grasmash/expander/issues", - "source": "https://github.com/grasmash/expander/tree/2.0.2" + "source": "https://github.com/grasmash/expander/tree/2.0.3" }, - "time": "2022-02-24T03:58:20+00:00" + "time": "2022-04-25T22:17:46+00:00" }, { "name": "guzzlehttp/guzzle", @@ -3567,7 +3594,7 @@ }, { "name": "illuminate/collections", - "version": "v8.83.8", + "version": "v8.83.11", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", @@ -3621,7 +3648,7 @@ }, { "name": "illuminate/contracts", - "version": "v8.83.8", + "version": "v8.83.11", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", @@ -3669,7 +3696,7 @@ }, { "name": "illuminate/macroable", - "version": "v8.83.8", + "version": "v8.83.11", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -3715,7 +3742,7 @@ }, { "name": "illuminate/support", - "version": "v8.83.8", + "version": "v8.83.11", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", @@ -3932,16 +3959,16 @@ }, { "name": "lucatume/wp-browser", - "version": "3.1.5", + "version": "3.1.6", "source": { "type": "git", "url": "https://github.com/lucatume/wp-browser.git", - "reference": "d797924151167eac745ea57768df0da4f9ed2502" + "reference": "5cefdab50d16f69447c48e5a8668d67d4892d6ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lucatume/wp-browser/zipball/d797924151167eac745ea57768df0da4f9ed2502", - "reference": "d797924151167eac745ea57768df0da4f9ed2502", + "url": "https://api.github.com/repos/lucatume/wp-browser/zipball/5cefdab50d16f69447c48e5a8668d67d4892d6ef", + "reference": "5cefdab50d16f69447c48e5a8668d67d4892d6ef", "shasum": "" }, "require": { @@ -4025,7 +4052,7 @@ ], "support": { "issues": "https://github.com/lucatume/wp-browser/issues", - "source": "https://github.com/lucatume/wp-browser/tree/3.1.5" + "source": "https://github.com/lucatume/wp-browser/tree/3.1.6" }, "funding": [ { @@ -4033,20 +4060,20 @@ "type": "github" } ], - "time": "2022-03-16T08:39:22+00:00" + "time": "2022-04-28T06:45:08+00:00" }, { "name": "mck89/peast", - "version": "v1.13.11", + "version": "v1.14.0", "source": { "type": "git", "url": "https://github.com/mck89/peast.git", - "reference": "78c57966f3da5f223636ea0417d71ac6ff61e47f" + "reference": "70a728d598017e237118652b2fa30fbaa9d4ef6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mck89/peast/zipball/78c57966f3da5f223636ea0417d71ac6ff61e47f", - "reference": "78c57966f3da5f223636ea0417d71ac6ff61e47f", + "url": "https://api.github.com/repos/mck89/peast/zipball/70a728d598017e237118652b2fa30fbaa9d4ef6d", + "reference": "70a728d598017e237118652b2fa30fbaa9d4ef6d", "shasum": "" }, "require": { @@ -4059,7 +4086,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13.11-dev" + "dev-master": "1.14.0-dev" } }, "autoload": { @@ -4081,9 +4108,9 @@ "description": "Peast is PHP library that generates AST for JavaScript code", "support": { "issues": "https://github.com/mck89/peast/issues", - "source": "https://github.com/mck89/peast/tree/v1.13.11" + "source": "https://github.com/mck89/peast/tree/v1.14.0" }, - "time": "2022-01-11T17:58:18+00:00" + "time": "2022-05-01T15:09:54+00:00" }, { "name": "mikehaertl/php-shellcommand", @@ -4347,38 +4374,42 @@ }, { "name": "nelexa/zip", - "version": "3.3.3", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/Ne-Lexa/php-zip.git", - "reference": "501b52f6fc393a599b44ff348a42740e1eaac7c6" + "reference": "a18f80db509b1b6e9798e2745dc100759107f50c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Ne-Lexa/php-zip/zipball/501b52f6fc393a599b44ff348a42740e1eaac7c6", - "reference": "501b52f6fc393a599b44ff348a42740e1eaac7c6", + "url": "https://api.github.com/repos/Ne-Lexa/php-zip/zipball/a18f80db509b1b6e9798e2745dc100759107f50c", + "reference": "a18f80db509b1b6e9798e2745dc100759107f50c", "shasum": "" }, "require": { "ext-zlib": "*", - "paragonie/random_compat": "*", - "php": "^5.5.9 || ^7.0", - "psr/http-message": "^1.0", - "symfony/finder": "^3.0|^4.0|^5.0" + "php": "^7.4 || ^8.0", + "psr/http-message": "*", + "symfony/finder": "*" }, "require-dev": { "ext-bz2": "*", + "ext-dom": "*", "ext-fileinfo": "*", + "ext-iconv": "*", "ext-openssl": "*", "ext-xml": "*", + "friendsofphp/php-cs-fixer": "^3.4.0", "guzzlehttp/psr7": "^1.6", - "phpunit/phpunit": "^4.8|^5.7", - "symfony/var-dumper": "^3.0|^4.0|^5.0" + "phpunit/phpunit": "^9", + "symfony/http-foundation": "*", + "symfony/var-dumper": "*", + "vimeo/psalm": "^4.6" }, "suggest": { "ext-bz2": "Needed to support BZIP2 compression", "ext-fileinfo": "Needed to get mime-type file", - "ext-mcrypt": "Needed to support encrypt zip entries or use ext-openssl", + "ext-iconv": "Needed to support convert zip entry name to requested character encoding", "ext-openssl": "Needed to support encrypt zip entries or use ext-mcrypt" }, "type": "library", @@ -4398,7 +4429,7 @@ "role": "Developer" } ], - "description": "PhpZip is a php-library for extended work with ZIP-archives. Open, create, update, delete, extract and get info tool. Supports appending to existing ZIP files, WinZip AES encryption, Traditional PKWARE Encryption, ZipAlign tool, BZIP2 compression, external file attributes and ZIP64 extensions. Alternative ZipArchive. It does not require php-zip extension.", + "description": "PhpZip is a php-library for extended work with ZIP-archives. Open, create, update, delete, extract and get info tool. Supports appending to existing ZIP files, WinZip AES encryption, Traditional PKWARE Encryption, BZIP2 compression, external file attributes and ZIP64 extensions. Alternative ZipArchive. It does not require php-zip extension.", "homepage": "https://github.com/Ne-Lexa/php-zip", "keywords": [ "archive", @@ -4406,27 +4437,26 @@ "unzip", "winzip", "zip", - "zipalign", "ziparchive" ], "support": { "issues": "https://github.com/Ne-Lexa/php-zip/issues", - "source": "https://github.com/Ne-Lexa/php-zip/tree/3.3.3" + "source": "https://github.com/Ne-Lexa/php-zip/tree/4.0.1" }, - "time": "2020-07-11T21:01:42+00:00" + "time": "2021-12-12T09:50:45+00:00" }, { "name": "nesbot/carbon", - "version": "2.57.0", + "version": "2.58.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "4a54375c21eea4811dbd1149fe6b246517554e78" + "reference": "97a34af22bde8d0ac20ab34b29d7bfe360902055" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4a54375c21eea4811dbd1149fe6b246517554e78", - "reference": "4a54375c21eea4811dbd1149fe6b246517554e78", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/97a34af22bde8d0ac20ab34b29d7bfe360902055", + "reference": "97a34af22bde8d0ac20ab34b29d7bfe360902055", "shasum": "" }, "require": { @@ -4444,7 +4474,8 @@ "phpmd/phpmd": "^2.9", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^0.12.54 || ^1.0", - "phpunit/phpunit": "^7.5.20 || ^8.5.14", + "phpunit/php-file-iterator": "^2.0.5", + "phpunit/phpunit": "^7.5.20 || ^8.5.23", "squizlabs/php_codesniffer": "^3.4" }, "bin": [ @@ -4509,7 +4540,7 @@ "type": "tidelift" } ], - "time": "2022-02-13T18:13:33+00:00" + "time": "2022-04-25T19:31:17+00:00" }, { "name": "overtrue/phplint", @@ -4581,56 +4612,6 @@ }, "time": "2021-06-02T16:18:33+00:00" }, - { - "name": "paragonie/random_compat", - "version": "v9.99.100", - "source": { - "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", - "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", - "shasum": "" - }, - "require": { - "php": ">= 7" - }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*", - "vimeo/psalm": "^1" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." - }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "polyfill", - "pseudorandom", - "random" - ], - "support": { - "email": "info@paragonie.com", - "issues": "https://github.com/paragonie/random_compat/issues", - "source": "https://github.com/paragonie/random_compat" - }, - "time": "2020-10-15T08:29:30+00:00" - }, { "name": "pdepend/pdepend", "version": "2.10.3", @@ -4800,16 +4781,16 @@ }, { "name": "php-webdriver/webdriver", - "version": "1.12.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/php-webdriver/php-webdriver.git", - "reference": "99d4856ed7dffcdf6a52eccd6551e83d8d557ceb" + "reference": "b27ddf458d273c7d4602106fcaf978aa0b7fe15a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/99d4856ed7dffcdf6a52eccd6551e83d8d557ceb", - "reference": "99d4856ed7dffcdf6a52eccd6551e83d8d557ceb", + "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/b27ddf458d273c7d4602106fcaf978aa0b7fe15a", + "reference": "b27ddf458d273c7d4602106fcaf978aa0b7fe15a", "shasum": "" }, "require": { @@ -4859,9 +4840,9 @@ ], "support": { "issues": "https://github.com/php-webdriver/php-webdriver/issues", - "source": "https://github.com/php-webdriver/php-webdriver/tree/1.12.0" + "source": "https://github.com/php-webdriver/php-webdriver/tree/1.12.1" }, - "time": "2021-10-14T09:30:02+00:00" + "time": "2022-05-03T12:16:34+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -5963,16 +5944,16 @@ }, { "name": "publishpress/publishpress-plugin-builder", - "version": "v1.3.5", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/publishpress/PublishPress-Plugin-Builder", - "reference": "843c2bd811e2307fbca99dfa193b6922a97b5e61" + "reference": "75708e8b1b093988dfd160f50b95803bbff725f1" }, "require": { "consolidation/robo": "^3.0", - "nelexa/zip": "^3.3", - "php": "~7.3", + "nelexa/zip": "^3.3|^4.0", + "php": "^7.3|^8.0", "symfony/yaml": "^5" }, "require-dev": { @@ -6001,7 +5982,7 @@ } ], "description": "Robo tasks for building WordPress plugins", - "time": "2022-01-19T22:09:53+00:00" + "time": "2022-04-14T15:14:49+00:00" }, { "name": "ralouphie/getallheaders", @@ -7249,16 +7230,16 @@ }, { "name": "symfony/config", - "version": "v5.4.7", + "version": "v5.4.8", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "05624c386afa1b4ccc1357463d830fade8d9d404" + "reference": "9f8964f56f7234f8ace16f66cb3fbae950c04e68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/05624c386afa1b4ccc1357463d830fade8d9d404", - "reference": "05624c386afa1b4ccc1357463d830fade8d9d404", + "url": "https://api.github.com/repos/symfony/config/zipball/9f8964f56f7234f8ace16f66cb3fbae950c04e68", + "reference": "9f8964f56f7234f8ace16f66cb3fbae950c04e68", "shasum": "" }, "require": { @@ -7308,7 +7289,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v5.4.7" + "source": "https://github.com/symfony/config/tree/v5.4.8" }, "funding": [ { @@ -7324,20 +7305,20 @@ "type": "tidelift" } ], - "time": "2022-03-21T13:42:03+00:00" + "time": "2022-04-12T16:02:29+00:00" }, { "name": "symfony/console", - "version": "v5.4.7", + "version": "v5.4.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "900275254f0a1a2afff1ab0e11abd5587a10e1d6" + "reference": "ffe3aed36c4d60da2cf1b0a1cee6b8f2e5fa881b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/900275254f0a1a2afff1ab0e11abd5587a10e1d6", - "reference": "900275254f0a1a2afff1ab0e11abd5587a10e1d6", + "url": "https://api.github.com/repos/symfony/console/zipball/ffe3aed36c4d60da2cf1b0a1cee6b8f2e5fa881b", + "reference": "ffe3aed36c4d60da2cf1b0a1cee6b8f2e5fa881b", "shasum": "" }, "require": { @@ -7407,7 +7388,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.7" + "source": "https://github.com/symfony/console/tree/v5.4.8" }, "funding": [ { @@ -7423,7 +7404,7 @@ "type": "tidelift" } ], - "time": "2022-03-31T17:09:19+00:00" + "time": "2022-04-12T16:02:29+00:00" }, { "name": "symfony/css-selector", @@ -7950,16 +7931,16 @@ }, { "name": "symfony/finder", - "version": "v5.4.3", + "version": "v5.4.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d" + "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/231313534dded84c7ecaa79d14bc5da4ccb69b7d", - "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d", + "url": "https://api.github.com/repos/symfony/finder/zipball/9b630f3427f3ebe7cd346c277a1408b00249dad9", + "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9", "shasum": "" }, "require": { @@ -7993,7 +7974,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.3" + "source": "https://github.com/symfony/finder/tree/v5.4.8" }, "funding": [ { @@ -8009,7 +7990,7 @@ "type": "tidelift" } ], - "time": "2022-01-26T16:34:36+00:00" + "time": "2022-04-15T08:07:45+00:00" }, { "name": "symfony/polyfill-intl-grapheme", @@ -8502,16 +8483,16 @@ }, { "name": "symfony/process", - "version": "v5.4.7", + "version": "v5.4.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "38a44b2517b470a436e1c944bf9b9ba3961137fb" + "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/38a44b2517b470a436e1c944bf9b9ba3961137fb", - "reference": "38a44b2517b470a436e1c944bf9b9ba3961137fb", + "url": "https://api.github.com/repos/symfony/process/zipball/597f3fff8e3e91836bb0bd38f5718b56ddbde2f3", + "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3", "shasum": "" }, "require": { @@ -8544,7 +8525,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.7" + "source": "https://github.com/symfony/process/tree/v5.4.8" }, "funding": [ { @@ -8560,7 +8541,7 @@ "type": "tidelift" } ], - "time": "2022-03-18T16:18:52+00:00" + "time": "2022-04-08T05:07:18+00:00" }, { "name": "symfony/service-contracts", @@ -8643,16 +8624,16 @@ }, { "name": "symfony/string", - "version": "v5.4.3", + "version": "v5.4.8", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10" + "reference": "3c061a76bff6d6ea427d85e12ad1bb8ed8cd43e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/92043b7d8383e48104e411bc9434b260dbeb5a10", - "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10", + "url": "https://api.github.com/repos/symfony/string/zipball/3c061a76bff6d6ea427d85e12ad1bb8ed8cd43e8", + "reference": "3c061a76bff6d6ea427d85e12ad1bb8ed8cd43e8", "shasum": "" }, "require": { @@ -8709,7 +8690,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.3" + "source": "https://github.com/symfony/string/tree/v5.4.8" }, "funding": [ { @@ -8725,20 +8706,20 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-04-19T10:40:37+00:00" }, { "name": "symfony/translation", - "version": "v5.4.7", + "version": "v5.4.8", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "e1eb790575202ee3ac2659f55b93b05853726f8e" + "reference": "f5c0f6d1f20993b2606f3a5f36b1dc8c1899170b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/e1eb790575202ee3ac2659f55b93b05853726f8e", - "reference": "e1eb790575202ee3ac2659f55b93b05853726f8e", + "url": "https://api.github.com/repos/symfony/translation/zipball/f5c0f6d1f20993b2606f3a5f36b1dc8c1899170b", + "reference": "f5c0f6d1f20993b2606f3a5f36b1dc8c1899170b", "shasum": "" }, "require": { @@ -8806,7 +8787,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.4.7" + "source": "https://github.com/symfony/translation/tree/v5.4.8" }, "funding": [ { @@ -8822,7 +8803,7 @@ "type": "tidelift" } ], - "time": "2022-03-24T17:09:09+00:00" + "time": "2022-04-22T08:14:12+00:00" }, { "name": "symfony/translation-contracts", diff --git a/defines.php b/defines.php index 5f824d82..f736c1c3 100644 --- a/defines.php +++ b/defines.php @@ -11,8 +11,8 @@ defined('ABSPATH') or die('No direct script access allowed.'); -if (!defined('PP_AUTHORS_VERSION')) { - define('PP_AUTHORS_VERSION', '3.16.1'); +if (!defined('PP_AUTHORS_LOADED')) { + define('PP_AUTHORS_VERSION', '3.16.2'); 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 34c2fcbc..aa02ae34 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.16.1 + * Version: 3.16.2 * Text Domain: publishpress-authors * * ------------------------------------------------------------------------------ @@ -40,9 +40,39 @@ use MultipleAuthors\Factory; use MultipleAuthors\Plugin; -if (!defined('PP_AUTHORS_LOADED')) { - require_once __DIR__ . '/includes.php'; +$includeFilebRelativePath = '/publishpress/publishpress-instance-protection/include.php'; +if (file_exists(__DIR__ . '/vendor' . $includeFilebRelativePath)) { + require_once __DIR__ . '/vendor' . $includeFilebRelativePath; +} else if (defined('PP_AUTHORS_VENDOR_PATH') && file_exists(PP_AUTHORS_VENDOR_PATH . $includeFilebRelativePath)) { + require_once PP_AUTHORS_VENDOR_PATH . $includeFilebRelativePath; +} + +if (class_exists('PublishPressInstanceProtection\\Config')) { + $pluginCheckerConfig = new PublishPressInstanceProtection\Config(); + $pluginCheckerConfig->pluginSlug = 'publishpress-authors'; + $pluginCheckerConfig->pluginName = 'PublishPress Authors'; + + $pluginChecker = new PublishPressInstanceProtection\InstanceChecker($pluginCheckerConfig); +} + +if (defined('PP_AUTHORS_PRO_LOADED')) { + add_filter( + 'plugin_row_meta', + function ($links, $file) { + if ($file == plugin_basename(__FILE__)) { + $links[]= '' . esc_html__('This plugin can be deleted.', 'publishpress-authors') . ''; + } + return $links; + }, + 10, + 2 + ); +} + +if (! defined('PP_AUTHORS_LOADED')) { + + require_once __DIR__ . '/includes.php'; global $multiple_authors_addon; @@ -62,157 +92,7 @@ function () { } ); - if (!function_exists('wp_notify_postauthor')) { - /** - * Notify a co-author of a comment/trackback/pingback to one of their posts. - * This is a modified version of the core function in wp-includes/pluggable.php that - * supports notifs to multiple co-authors. Unfortunately, this is the best way to do it :( - * - * @param int $comment_id Comment ID - * @param string $comment_type Optional. The comment type either 'comment' (default), 'trackback', or 'pingback' - * - * @return bool False if user email does not exist. True on completion. - * @since 2.6.2 - * - */ - function wp_notify_postauthor($comment_id, $comment_type = '') - { - $comment = get_comment($comment_id); - $post = get_post($comment->comment_post_ID); - $coauthors = get_post_authors($post->ID); - foreach ($coauthors as $author) { - // The comment was left by the co-author - if ($comment->user_id == $author->ID) { - return false; - } - - // The co-author moderated a comment on his own post - if ($author->ID == get_current_user_id()) { - return false; - } - - // If there's no email to send the comment to - if ('' == $author->user_email) { - return false; - } + include_once __DIR__ . '/src/functions/notify.php'; - $comment_author_domain = ''; - if (function_exists('gethostbyaddr')) { - $comment_author_domain = gethostbyaddr($comment->comment_author_IP); - } - - // The blogname option is escaped with esc_html on the way into the database in sanitize_option - // we want to reverse this for the plain text arena of emails. - $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); - - if (empty($comment_type)) { - $comment_type = 'comment'; - } - - if ('comment' == $comment_type) { - $notify_message = sprintf(__('New comment on your post "%s"'), $post->post_title) . "\r\n"; - /* translators: 1: comment author, 2: author IP, 3: author domain */ - $notify_message .= sprintf( - __('Author : %1$s (IP: %2$s , %3$s)'), - $comment->comment_author, - $comment->comment_author_IP, - $comment_author_domain - ) . "\r\n"; - $notify_message .= sprintf(__('E-mail : %s'), $comment->comment_author_email) . "\r\n"; - $notify_message .= sprintf(__('URL : %s'), $comment->comment_author_url) . "\r\n"; - $notify_message .= sprintf( - __('Whois : http://whois.arin.net/rest/ip/%s'), - $comment->comment_author_IP - ) . "\r\n"; - $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; - $notify_message .= __('You can see all comments on this post here: ') . "\r\n"; - /* translators: 1: blog name, 2: post title */ - $subject = sprintf(__('[%1$s] Comment: "%2$s"'), $blogname, $post->post_title); - } elseif ('trackback' == $comment_type) { - $notify_message = sprintf(__('New trackback on your post "%s"'), $post->post_title) . "\r\n"; - /* translators: 1: website name, 2: author IP, 3: author domain */ - $notify_message .= sprintf( - __('Website: %1$s (IP: %2$s , %3$s)'), - $comment->comment_author, - $comment->comment_author_IP, - $comment_author_domain - ) . "\r\n"; - $notify_message .= sprintf(__('URL : %s'), $comment->comment_author_url) . "\r\n"; - $notify_message .= __('Excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; - $notify_message .= __('You can see all trackbacks on this post here: ') . "\r\n"; - /* translators: 1: blog name, 2: post title */ - $subject = sprintf(__('[%1$s] Trackback: "%2$s"'), $blogname, $post->post_title); - } elseif ('pingback' == $comment_type) { - $notify_message = sprintf(__('New pingback on your post "%s"'), $post->post_title) . "\r\n"; - /* translators: 1: comment author, 2: author IP, 3: author domain */ - $notify_message .= sprintf( - __('Website: %1$s (IP: %2$s , %3$s)'), - $comment->comment_author, - $comment->comment_author_IP, - $comment_author_domain - ) . "\r\n"; - $notify_message .= sprintf(__('URL : %s'), $comment->comment_author_url) . "\r\n"; - $notify_message .= __('Excerpt: ') . "\r\n" . sprintf( - '[...] %s [...]', - $comment->comment_content - ) . "\r\n\r\n"; - $notify_message .= __('You can see all pingbacks on this post here: ') . "\r\n"; - /* translators: 1: blog name, 2: post title */ - $subject = sprintf(__('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title); - } - $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n"; - $notify_message .= sprintf( - __('Permalink: %s'), - get_permalink($comment->comment_post_ID) . '#comment-' . $comment_id - ) . "\r\n"; - if (EMPTY_TRASH_DAYS) { - $notify_message .= sprintf( - __('Trash it: %s'), - admin_url("comment.php?action=trash&c=$comment_id") - ) . "\r\n"; - } else { - $notify_message .= sprintf( - __('Delete it: %s'), - admin_url("comment.php?action=delete&c=$comment_id") - ) . "\r\n"; - } - $notify_message .= sprintf( - __('Spam it: %s'), - admin_url("comment.php?action=spam&c=$comment_id") - ) . "\r\n"; - - $wp_email = 'wordpress@example.com'; - if (isset($_SERVER['SERVER_NAME'])) { - $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower(sanitize_text_field($_SERVER['SERVER_NAME']))); - } - - if ('' == $comment->comment_author) { - $from = "From: \"$blogname\" <$wp_email>"; - if ('' != $comment->comment_author_email) { - $reply_to = "Reply-To: $comment->comment_author_email"; - } - } else { - $from = "From: \"$comment->comment_author\" <$wp_email>"; - if ('' != $comment->comment_author_email) { - $reply_to = "Reply-To: \"$comment->comment_author_email\" <$comment->comment_author_email>"; - } - } - - $message_headers = "$from\n" - . 'Content-Type: text/plain; charset="' . get_option('blog_charset') . "\"\n"; - - if (isset($reply_to)) { - $message_headers .= $reply_to . "\n"; - } - - $notify_message = apply_filters('comment_notification_text', $notify_message, $comment_id); - $subject = apply_filters('comment_notification_subject', $subject, $comment_id); - $message_headers = apply_filters('comment_notification_headers', $message_headers, $comment_id); - - wp_mail($author->user_email, $subject, $notify_message, $message_headers); - } - - return true; - } - } + define('PP_AUTHORS_LOADED', true); } diff --git a/readme.txt b/readme.txt index 8807cf31..90afd754 100644 --- a/readme.txt +++ b/readme.txt @@ -1,13 +1,13 @@ === Co-Authors, Multiple Authors and Guest Authors in an Author Box with PublishPress Authors === -Contributors: publishpress, kevinB, stevejburge, andergmartins +Contributors: publishpress, kevinB, stevejburge, andergmartins, ojopaul Author: PublishPress Author URI: https://publishpress.com Tags: multiple authors, authors, guest authors, author fields, author layouts Requires at least: 4.7 Requires PHP: 5.6 Tested up to: 5.9 -Stable tag: 3.16.1 +Stable tag: 3.16.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -224,6 +224,13 @@ There are two ways to install the PublishPress Authors plugin: == Changelog == +* Fixed: Fix incorrect "Mine" counter in admin posts list, #591 +* Fixed: Fix error with subscribers/non admin inability to see see Author page posts, #584 +* Added: Add metabox to control author display on pages #60 +* Added: Added Author Profile URL #616 +* Update: Use built-in capability check when searching users via ajax, #645 +* Added: Disable Free version with Pro is active #615 + = [3.16.1] - 13 Apr 2022 = * Fixed: Fix author mapped to user error when adding new author, #626; diff --git a/src/assets/css/multiple-authors.css b/src/assets/css/multiple-authors.css index bae513b8..8216689c 100644 --- a/src/assets/css/multiple-authors.css +++ b/src/assets/css/multiple-authors.css @@ -208,6 +208,14 @@ body.taxonomy-author .form-field.term-description-wrap { margin-left: 5px; } +.ppma-authors-display-option-wrapper { + margin-top: 10px; +} + +.ppma-authors-display-option-wrapper input[type="checkbox"] { + vertical-align: bottom; +} + /* Fix the width of the Mapped user field in the New Author form */ .edit-tags-php.taxonomy-author .authors-select2-user-select, .term-php.taxonomy-author .authors-select2-user-select { @@ -331,4 +339,9 @@ body.own-profile-edit li[class*=' toplevel_page_term?taxonomy=author&tag_ID'] a. body.own-profile-edit .term-authors-user_id-wrap, body.own-profile-edit .edit-tag-actions span#delete-link { display: none !important; +} + +form#edittag tr.form-field #slug { + width: 85%; + margin-right: 5px; } \ No newline at end of file diff --git a/src/assets/js/multiple-authors.js b/src/assets/js/multiple-authors.js index fe2b4da0..6c15ed24 100644 --- a/src/assets/js/multiple-authors.js +++ b/src/assets/js/multiple-authors.js @@ -486,17 +486,22 @@ jQuery(document).ready(function ($) { }); }); - /** - * Add tab class to author editor's tr without tab - * - * This will add general tab class to 'Name' and Author URL - * or any tab that's rendered by default or third party - * without tab attribute - */ if ($('body').hasClass('taxonomy-author')) { + /** + * Add tab class to author editor's tr without tab + * + * This will add general tab class to 'Name' and Author URL + * or any tab that's rendered by default or third party + * without tab attribute + */ $('form#edittag tr.form-field:not(.ppma-tab-content)') .addClass('ppma-tab-content ppma-general-tab') .attr('data-tab', 'general'); + + /** + * Add view link to author url field + */ + $('form#edittag tr.form-field #slug').after('' + MultipleAuthorsStrings.view_text + ''); } /** diff --git a/src/core/Classes/Admin_Ajax.php b/src/core/Classes/Admin_Ajax.php index fa2eefc2..07b50fed 100644 --- a/src/core/Classes/Admin_Ajax.php +++ b/src/core/Classes/Admin_Ajax.php @@ -138,7 +138,8 @@ public static function handle_users_search() // We load 100, but only display 20. We load more, because we are filtering users with "edit_posts" capability. // TODO: Add settings field for selecting what user role could be used to map users to authors, so we can filter the user role instead. $user_args = [ - 'number' => 100, + 'number' => 20, + 'capability' => 'edit_posts', ]; if (!empty($_GET['q'])) { $user_args['search'] = sanitize_text_field('*' . $_GET['q'] . '*'); @@ -146,21 +147,11 @@ public static function handle_users_search() $users = get_users($user_args); $results = []; - $count = 0; foreach ($users as $user) { - if ($count >= 20) { - break; - } - - if (!user_can($user, 'edit_posts')) { - continue; - } - $results[] = [ 'id' => $user->ID, 'text' => $user->display_name, ]; - $count++; } $response = [ 'results' => $results, diff --git a/src/core/Classes/Objects/Author.php b/src/core/Classes/Objects/Author.php index 7e3c1770..bddddf57 100644 --- a/src/core/Classes/Objects/Author.php +++ b/src/core/Classes/Objects/Author.php @@ -812,4 +812,118 @@ public static function get_by_id($id) return self::get_by_term_id($id); } + /** + * Get author posts count with support for post_type. + * + * @param integer $term_id for the author. + * @param string $post_type. + * + * @return integer $counts + */ + public static function get_author_posts_count($term_id, $post_type = 'post') + { + global $wpdb; + + $cache_key = $post_type . '_' . $term_id; + + $counts = wp_cache_get($cache_key, 'counts'); + + if (!$counts) { + $expire_days = 7; + $distinct = ''; + $join = ''; + $where = ''; + $query = ''; + + $distinct .= "COUNT(DISTINCT {$wpdb->posts}.ID)"; + + $join .= " LEFT JOIN {$wpdb->term_relationships} ON ({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id)"; + $join .= " LEFT JOIN {$wpdb->term_taxonomy} ON ({$wpdb->term_relationships}.term_taxonomy_id = {$wpdb->term_taxonomy}.term_taxonomy_id)"; + + $where .= $wpdb->prepare(" AND {$wpdb->term_taxonomy}.taxonomy = %s", "author"); + $where .= $wpdb->prepare(" AND {$wpdb->term_taxonomy}.term_id = %d", $term_id); + $where .= $wpdb->prepare(" AND {$wpdb->posts}.post_type = %s", $post_type); + $where .= " AND {$wpdb->posts}.post_status NOT IN ('trash', 'auto-draft')"; + + /** + * Filters the DISTINCT clause of the query. + * + * @param string $distinct The DISTINCT clause of the query. + * @param integer $term_id Author term id. + * @param string $post_type Post type. + * + * @since 3.16.2 + */ + $distinct = apply_filters('ppma_author_posts_count_distinct', $distinct, $term_id, $post_type); + + /** + * Filters the JOIN clause of the query. + * + * @param string $join The JOIN clause of the query. + * @param integer $term_id Author term id. + * @param string $post_type Post type. + * + * @since 3.16.2 + */ + $join = apply_filters('ppma_author_posts_count_join', $join, $term_id, $post_type); + + /** + * Filters the WHERE clause of the query. + * + * @param string $where The WHERE clause of the query. + * @param integer $term_id Author term id. + * @param string $post_type Post type. + * + * @since 3.16.2 + */ + $where = apply_filters('ppma_author_posts_count_where', $where, $term_id, $post_type); + + $query = "SELECT $distinct FROM {$wpdb->posts} $join WHERE 1=1 $where"; + + /** + * Filters the whole count query. + * + * @param string $query The count query. + * @param integer $term_id Author term id. + * @param string $post_type Post type. + * + * @since 3.16.2 + */ + $query = apply_filters('ppma_author_posts_count_query', $query, $term_id, $post_type); + + $counts = (int)$wpdb->get_var($query); + + /** + * Filters author posts count expire days. + * + * @param integer $expire_days current expire days. + * @param integer $term_id Author term id. + * @param string $post_type Post type. + * + * @since 3.16.2 + */ + $expire_days = apply_filters( + 'ppma_author_posts_count_cache_expire_days', + $expire_days, + $term_id, + $post_type + ); + + $expire = (int)$expire_days * DAY_IN_SECONDS; + + wp_cache_set($cache_key, $counts, 'counts', $expire); + } + + /** + * Filter author posts count. + * + * @param integer $counts + * @param string $term_id Author term id. + * @param string $post_type Post type. + * + * @since 3.16.2 + */ + return apply_filters('ppma_author_posts_count', $counts, $term_id, $post_type); + } + } diff --git a/src/core/Classes/Post_Editor.php b/src/core/Classes/Post_Editor.php index f96f1bd3..3ae001a9 100644 --- a/src/core/Classes/Post_Editor.php +++ b/src/core/Classes/Post_Editor.php @@ -60,7 +60,7 @@ public static function add_author_bulk_quick_edit_custom_box($column_name, $post Authors @@ -215,7 +215,7 @@ public static function render_authors_metabox() /** * Get rendered authors selection. */ - public static function get_rendered_authors_selection($authors, $showAvatars = true) + public static function get_rendered_authors_selection($authors, $showAvatars = true, $bulkEdit = false) { $classes = [ 'authors-list', @@ -283,6 +283,20 @@ class="authors-select2 authors-search" $post = get_post(); $userAuthor = get_user_by('ID', $post->post_author); ?> + +
+ + ID, 'ppma_disable_author_box', true), 1); ?> + /> + +
+