diff --git a/.builder-post-rsync-filters-post b/.builder-post-rsync-filters-post deleted file mode 100644 index 7a52dfac..00000000 --- a/.builder-post-rsync-filters-post +++ /dev/null @@ -1,21 +0,0 @@ -- composer.json -- composer.lock -- vendor/publishpress/wordpress-banners/.gitattributes -- vendor/woocommerce/action-scheduler/README.md -- vendor/woocommerce/action-scheduler/changelog.txt -- vendor/publishpress/wordpress-version-notices/.gitignore -- vendor/publishpress/wordpress-version-notices/README.md -- vendor/publishpress/wordpress-version-notices/bin -- vendor/publishpress/wordpress-version-notices/codeception.dist.yml -- vendor/publishpress/wordpress-version-notices/codeception.yml -- vendor/publishpress/wordpress-version-notices/tests -- vendor/bin -- vendor/publishpress/vendor-locator-series/composer.json -- vendor/sabre/vobject/.gitignore -- vendor/sabre/vobject/bin -- vendor/sabre/vobject/composer.json -- vendor/sabre/vobject/README.md -- vendor/sabre/vobject/tests -- vendor/symfony/polyfill-ctype/README.md -- vendor/composer/installers/.gitignore -- vendor/publishpress/vendor-locator-series-pro/composer.json diff --git a/.distignore b/.distignore new file mode 100644 index 00000000..4df30c78 --- /dev/null +++ b/.distignore @@ -0,0 +1,108 @@ +# A set of files you probably don't want in your WordPress.org distribution +*.code-workspace +*.sql +*.tar.gz +*.zip +.DS_Store +.babelrc +.distignore +.editorconfig +.env.testing +.env.testing.dist +.env.testing.linux.dist +.env.testing.mac.dist +.eslintrc.js +.git +.git +.gitattributes +.github +.gitignore +.idea +.php-cs-fixer.cache +.phpcs.xml +.phplint-cache +.phplint.yml +.rsync-filters-post-build +.rsync-filters-pro-build +.travis.yml +.vscode +.wordpress-org +/assets_wp +/dev-workspace +/dist +/version.txt +/webpack.config.js +/yarn.lock +CONTRIBUTING.md +Gruntfile.js +README-build.md +README.md +RoboFile.php +Thumbs.db +/assets/jsx +/assets_wp +bin +bin +build.xml +builder +builder.yml +builder.yml.dist +codeception.dist.yml +composer.json +composer.lock +cs +cypress +cypress.json +/dist +jest.config.js +jest.config.ts +jsconfig.json +mix-manifest.json +node_modules +package-lock.json +package.json +phpcs.xml +phpunit.xml +psalm.xml +ray-dist.php +ray.php +screenshot-*.png +/scripts +tailwind.config.js +tests +vendor +vendor/bin +vendor/pimple/pimple/.gitignore +vendor/pimple/pimple/.php_cs.dist +vendor/pimple/pimple/CHANGELOG +vendor/pimple/pimple/README.rst +vendor/pimple/pimple/composer.json +vendor/pimple/pimple/ext +vendor/pimple/pimple/ext/pimple/.gitignore +vendor/pimple/pimple/phpunit.xml.dist +vendor/pimple/pimple/src/Pimple/Tests +vendor/psr/container/.gitignore +vendor/psr/container/composer.json +vendor/publishpress/publishpress-instance-protection/.git +vendor/publishpress/publishpress-instance-protection/.gitattributes +vendor/publishpress/publishpress-instance-protection/.gitignore +vendor/publishpress/vendor-locator-series/composer.json +vendor/publishpress/wordpress-banners/.gitattributes +vendor/publishpress/wordpress-reviews/phpcs.xml.dist +vendor/publishpress/wordpress-version-notices/.gitignore +vendor/publishpress/wordpress-version-notices/README.md +vendor/publishpress/wordpress-version-notices/bin +vendor/publishpress/wordpress-version-notices/codeception.dist.yml +vendor/publishpress/wordpress-version-notices/codeception.yml +vendor/publishpress/wordpress-version-notices/tests +vendor/sabre/vobject/.gitignore +vendor/sabre/vobject/README.md +vendor/sabre/vobject/bin +vendor/sabre/vobject/composer.json +vendor/sabre/vobject/tests +vendor/symfony/polyfill-ctype/README.md +vendor/symfony/polyfill-ctype/composer.json +vendor/woocommerce/action-scheduler/README.md +vendor/woocommerce/action-scheduler/changelog.txt +webpack.config.js +webpack.mix.js diff --git a/.gitattributes b/.gitattributes index 4181640a..bbd1f0ef 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,16 +1,62 @@ -.github export-ignore -assets_wp export-ignore -tests export-ignore +*.bash export-ignore +*.cache export-ignore +*.code-workspace export-ignore +*.dist export-ignore +*.dist.yml export-ignore +*.exe export-ignore +*.sh export-ignore +*.sql export-ignore +*.tar.gz export-ignore +*.testing export-ignore +*.zip export-ignore +.DS_Store export-ignore .babelrc export-ignore -.env.testing.dist export-ignore +.distignore export-ignore +.editorconfig export-ignore +.git export-ignore +.gitattributes export-ignore +.github export-ignore .gitignore export-ignore +.gitlab-ci.yml export-ignore +.phpcs.xml export-ignore .phplint.yml export-ignore -codeception.dist.yml export-ignore -composer.json export-ignore -composer.lock export-ignore -package.json export-ignore -package-lock.json export-ignore +.rsync-filters-post-build export-ignore +.rsync-filters-pre-build export-ignore +.travis.yml export-ignore +.vscode export-ignore +/assets_wp export-ignore +/dev-workspace export-ignore +/dist export-ignore +/screenshot-*.png export-ignore +/tests export-ignore +Gruntfile.js export-ignore +Gruntfile.js export-ignore +README.md export-ignore RoboFile.php export-ignore +Thumbs.db export-ignore +behat.yml export-ignore +bin export-ignore +builder.yml export-ignore +circle.yml export-ignore +codeception.yml export-ignore +docker-compose.yml export-ignore +jest.config.js export-ignore +jest.config.ts export-ignore +jsconfig.json export-ignore +multisite.xml export-ignore +multisite.xml.dist export-ignore +node_modules export-ignore +package-lock.json export-ignore +package.json export-ignore +phpcs.ruleset.xml export-ignore +phpcs.xml export-ignore +phpcs.xml.dist export-ignore +phpmd.xml export-ignore +phpunit.xml export-ignore +phpunit.xml.dist export-ignore +psalm.xml export-ignore webpack.config.js export-ignore -.gitattributes export-ignore -.git export-ignore +wp-cli.local.yml export-ignore +webpack.common.js export-ignore +webpack.dev.js export-ignore +webpack.prod.js export-ignore diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug-report.md similarity index 90% rename from .github/ISSUE_TEMPLATE/bug_report.md rename to .github/ISSUE_TEMPLATE/bug-report.md index d5b94718..7a8eef5e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -2,13 +2,13 @@ name: Bug report about: Create a report to help us improve title: '' -labels: 'bug' +labels: 'unconfirmed bug' assignees: '' --- -Your issue may already be reported! -Please search on the [issue track](../) before creating one. + ## Expected Behavior diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 36014cde..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: 'enhancement' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/release-free-plugin.md b/.github/ISSUE_TEMPLATE/release-free-plugin.md index ee0ba7f1..947e6b06 100644 --- a/.github/ISSUE_TEMPLATE/release-free-plugin.md +++ b/.github/ISSUE_TEMPLATE/release-free-plugin.md @@ -1,34 +1,43 @@ --- -name: Release the Free version (team only) -about: Describes default checklist for the plugin's release process. -title: Release v[VERSION] +name: Release the Free Version (Team Only) +about: Default checklist for the plugin's release process. +title: Release PublishPress Series v[VERSION] labels: release assignees: '' --- -To release the Free plugin please make sure to check all the checkboxes below. +To release the Free plugin, ensure you complete all the tasks below. ### Pre-release Checklist -- [ ] Create the release branch as `release-` based on the development branch. -- [ ] Make sure to directly merge or use Pull Requests to merge hotfixes or features branches into the release branch. -- [ ] Run `composer update --no-dev --dry-run` and check if there is any relevant update on any requirement. This won't change the code, just show a simulation of running the update command. Evaluate the need of releasing with this library updated, or if we can add that for a next release. -- [ ] If any update should be included on this release (from previous step) make sure to run the update command only for the specific dependeny: `composer update the/lib:version-constraint`. Make sure to check compatibility with the plugin and what version we should be using. Check if you need to lock the current version for any dependency using exact version numbers instead of relative version constraints. Make sure to add any change of dependencies to the changelog. -- [ ] Check Github's Dependabot warnings or pull requests, looking for any relevant report. Remove any false-positive first. Fix and commit the fix for the issues you find. -- [ ] Build JS files to production running `composer build:js` and commit (if your plugin uses any compiled JS file). -- [ ] Run WP VIP scan to make sure no warnings or errors > 5 exists: `composer phpcs`. -- [ ] Update the changelog - make sure all the changes are there with a user-friendly description and that the release date is correct. -- [ ] Update the version number to the next stable version in the main plugin file and `readme.txt`. Commit the changes to the release branch. -- [ ] Commit the changes to the release branch. -- [ ] Build the zip package, running `composer build`. It should create a package in the `./dist` dir. -- [ ] Send the new package to the team for testing. +- [ ] Create a release branch named `release-` from the development branch. +- [ ] Review and merge all relevant Pull Requests into the release branch. +- [ ] Start a dev-workspace session. +- [ ] Execute `composer update` to update the root and lib vendors. +- [ ] Review the updated packages. Mention any production library updates in the changelog. +- [ ] Inspect GitHub's Dependabot warnings or Pull Requests for relevant issues. Resolve any false positives first, then fix and commit the remaining issues. +- [ ] If necessary, build JS files for production using `composer build:js` and commit the changes. +- [ ] Run a WP VIP scan with `composer check:phpcs` to ensure no warnings or errors greater than 5 exist. +- [ ] Update the `.pot` file executing `composer gen:pot` and include a note in the changelog. +- [ ] Especially for minor and patch releases, maintain backward compatibility for changes like renamed or moved classes, namespaces, functions, etc. Include deprecation comments and mention this in the changelog. Major releases may remove deprecated code, but always note this in the changelog. +- [ ] Revise the changelog to include all changes with user-friendly descriptions and ensure the release date is accurate. +- [ ] Update the version number in the main plugin file and `readme.txt`, adhering to specifications from our [tech documentation](https://rambleventures.slab.com/posts/version-numbers-58nmrk4b), and commit to the release branch. +- [ ] Confirm there are no uncommitted changes. +- [ ] Build the zip package with `composer build`, creating a new package in the `./dist` directory. +- [ ] Distribute the new package to the team for testing. ### Release Checklist -- [ ] Create a Pull Request and merge the release branch it into the `master` branch. -- [ ] Merge the `master` branch into the `development` branch. -- [ ] Create the GitHub release (make sure it is based on the `master` branch and correct tag). This will trigger a Github action for automatic deployment on the WordPress SVN repo. +- [ ] Create and merge a Pull Request for the release branch into the `main` branch. +- [ ] Merge the `main` branch into the `development` branch. +- [ ] Establish the GitHub release on the `main` branch with the correct tag. -### Post-release Checklist - -- [ ] Follow the action's result on the [repository actions page](https://github.com/publishpress/publishpress-series/actions). -- [ ] Go to the [WordPress.org plugin page](https://wordpress.org/plugins/organize-series/) double check the information confirming the release finished successfully. -- [ ] Make a final test updating the plugin in a staging site. +#### WP SVN Deployment +- [ ] Navigate to the local copy of the SVN repo for the plugin. +- [ ] Update your working copy using `svn update`. +- [ ] Clear the `trunk` directory with `rm -rf trunk/*`. +- [ ] Unzip the built package and transfer files to the `trunk` folder. +- [ ] Remove any extraneous files (if found, create an issue to amend the `.rsync-filter-post-build` file). Keep only files really used on production. +- [ ] Find new files with `svn status | grep \?` and add them using `svn add `. +- [ ] Identify removed files with `svn status | grep !` and delete them using `svn rm `. +- [ ] Create the new tag using `svn cp trunk tags/`. +- [ ] Commit the changes with `svn ci -m 'Releasing '`. +- [ ] Await WordPress's version number update and perform a final test by updating the plugin on a staging site. diff --git a/.github/ISSUE_TEMPLATE/release-pro-plugin.md b/.github/ISSUE_TEMPLATE/release-pro-plugin.md index 673410da..27f0a6fd 100644 --- a/.github/ISSUE_TEMPLATE/release-pro-plugin.md +++ b/.github/ISSUE_TEMPLATE/release-pro-plugin.md @@ -1,39 +1,38 @@ --- -name: Release the Pro version (team only) -about: Describes default checklist for releasing the Pro plugin; -title: Release Pro v[VERSION] +name: Release the Pro Version (Team Only) +about: Default checklist for the plugin's release process. +title: Release PublishPress Series Pro v[VERSION] labels: release assignees: '' --- -To release the Pro plugin please make sure to check all the checkboxes below. +To release the Pro plugin, ensure you complete all the tasks below. ### Pre-release Checklist - -- [ ] Create the release branch as `release-` based on the development branch. -- [ ] Make sure to directly merge or use Pull Requests to merge hotfixes or features branches into the release branch. -- [ ] Run `composer update --no-dev --dry-run` and check if there is any relevant update on any requirement. This won't change the code, just show a simulation of running the update command. Evaluate the need of releasing with this library updated, or if we can add that for a next release. -- [ ] If any update should be included on this release (from previous step) make sure to run the update command only for the specific dependeny: `composer update the/lib:version-constraint`. Make sure to check compatibility with the plugin and what version we should be using. Check if you need to lock the current version for any dependency using exact version numbers instead of relative version constraints. Make sure to add any change of dependencies to the changelog. -- [ ] Check Github's Dependabot warnings or pull requests, looking for any relevant report. Remove any false-positive first. Fix and commit the fix for the issues you find. -- [ ] Build JS files to production running `composer build:js` and commit (if your plugin uses any compiled JS file). -- [ ] Run WP VIP scan to make sure no warnings or errors > 5 exists: `composer phpcs`. -- [ ] Update the changelog - make sure all the changes are there with a user-friendly description and that the release date is correct. -- [ ] Update the version number to the next stable version in the main plugin file and `readme.txt`. Commit the changes to the release branch. -- [ ] Commit the changes to the release branch. -- [ ] Build the zip package, running `composer build`. It should create a package in the `./dist` dir. -- [ ] Send the new package to the team for testing. +- [ ] Create a release branch named `release-` from the development branch. +- [ ] Review and merge all relevant Pull Requests into the release branch. +- [ ] Start a dev-workspace session. +- [ ] Verify the correct version of the free plugin is referenced in the `lib/composer.json` file. Prefer stable versions. +- [ ] Execute `composer update` to update the root and lib vendors. +- [ ] Review the updated packages and mention any production library updates in the changelog. +- [ ] Check if all dependencies are synced from Free into the Pro plugin with `composer check:deps`. If required, merge dependencies using `composer fix:deps` and run `composer update` again. +- [ ] Check if the free plugin uses Composer's autoload and copy the autoload definition from the free plugin to the pro plugin refactoring the relative paths, on `/lib/composer.json`. Execute `composer dumpautoload` to update the autoload files. Commit the changes. +- [ ] Inspect GitHub's Dependabot warnings or Pull Requests for relevant issues. Resolve any false positives first, then fix and commit the remaining issues. +- [ ] If necessary, build JS files for production using `composer build:js` and commit the changes. +- [ ] Run a WP VIP scan with `composer check:phpcs` to ensure no warnings or errors greater than 5 exist. +- [ ] Update the `.pot` file executing `composer gen:pot` and include a note in the changelog. +- [ ] Especially for minor and patch releases, maintain backward compatibility for changes like renamed or moved classes, namespaces, functions, etc. Include deprecation comments and mention this in the changelog. Major releases may remove deprecated code, but always note this in the changelog. +- [ ] Revise the changelog to include all changes with user-friendly descriptions and ensure the release date is accurate. + -- [ ] Update the version number in the main plugin file and `readme.txt`, adhering to specifications from our [tech documentation](https://rambleventures.slab.com/posts/version-numbers-58nmrk4b), and commit to the release branch. +- [ ] Confirm there are no uncommitted changes. +- [ ] Build the zip package with `composer build`, creating a new package in the `./dist` directory. +- [ ] Distribute the new package to the team for testing. ### Release Checklist +- [ ] Create and merge a Pull Request for the release branch into the `main` branch. +- [ ] Merge the `main` branch into the `development` branch. +- [ ] Establish the GitHub release on the `main` branch with the correct tag. -- [ ] Create a Pull Request and merge the release branch it into the `master` branch. -- [ ] Merge the `master` branch into the `development` branch. -- [ ] Create the Github release (make sure it is based on the `master` branch and correct tag). -- [ ] Follow the action's result on the [repository actions page](https://github.com/publishpress/publishpress-series-pro/actions). -- [ ] Go to [PublishPress site admin panel](https://publishpress.com/wp-admin) > Downloads, locate "Series Pro", and edit: - - [ ] File URL on Download Files, uploading the new package to the media library. - - [ ] On Licensing, update the version number. - - [ ] On Licensing, update the changelog. - -### Post-release Checklist - -- [ ] Make the final test updating the plugin in a staging site. +#### PublishPress.com Deployment +- [ ] Update the EDD registry on the Downloads menu, uploading the new package. +- [ ] Perform a final test by updating the plugin on a staging site. diff --git a/.gitignore b/.gitignore index e6ea87ca..56f1334c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,6 @@ -.DS_Store -.DS_Store? -._* -.Spotlight-V100 -.Trashes -ehthumbs.db -Thumbs.db -.idea - -*.sublime-project -*.sublime-workspace - -# Ignores the "dev" composer file -/vendor -/packages -/downloads_cache - - .svn .git +.DS_Store wpcom-helper.php /local.sh @@ -25,7 +8,21 @@ node_modules /.properties.ini +/packages +/vendor +/lib/**/.git +/builder +.idea /dist -.env.testing builder.yml -phpcs.xml +builder.yml.dist +.editorconfig + +!tests/_support/.gitkeep +tests/_support/* +.php_cs.cache +.sass-cache/* +/codeception.yml + +.vscode/* +*.code-workspace diff --git a/.rsync-filters-post-build b/.rsync-filters-post-build new file mode 100644 index 00000000..c1269a97 --- /dev/null +++ b/.rsync-filters-post-build @@ -0,0 +1,27 @@ +- composer.json +- composer.lock +- /vendor/bin +- /vendor/publishpress/vendor-locator-series/composer.json +- /vendor/publishpress/wordpress-banners/.gitattributes +- /vendor/publishpress/wordpress-version-notices/.gitignore +- /vendor/publishpress/wordpress-version-notices/README.md +- /vendor/publishpress/wordpress-version-notices/bin +- /vendor/publishpress/wordpress-version-notices/codeception.dist.yml +- /vendor/publishpress/wordpress-version-notices/codeception.yml +- /vendor/publishpress/wordpress-version-notices/tests +- /vendor/publishpress/publishpress-instance-protection/.gitignore +- /vendor/publishpress/publishpress-instance-protection/.gitattributes +- /vendor/publishpress/publishpress-instance-protection/.git +- /vendor/sabre/vobject/.gitignore +- /vendor/sabre/vobject/README.md +- /vendor/sabre/vobject/bin +- /vendor/sabre/vobject/composer.json +- /vendor/sabre/vobject/tests +- /vendor/symfony/polyfill-ctype/README.md +- /vendor/woocommerce/action-scheduler/README.md +- /vendor/woocommerce/action-scheduler/changelog.txt +- /vendor/pimple/pimple/ext/pimple/.gitignore +- /vendor/pimple/pimple/.gitignore +- /vendor/psr/container/.gitignore +- .rsync-filters-pre-build +- .rsync-filters-pro-build diff --git a/.builder-rsync-filters b/.rsync-filters-pre-build similarity index 57% rename from .builder-rsync-filters rename to .rsync-filters-pre-build index 4e428624..9e2b913b 100644 --- a/.builder-rsync-filters +++ b/.rsync-filters-pre-build @@ -3,6 +3,11 @@ - .builder-post-rsync-filters-post - .builder-rsync-filters - .distignore +- .env.testing +- .env.testing.dist +- .env.testing.linux.dist +- .env.testing.mac.dist +- .eslintrc.js - .git - .gitattributes - .github @@ -12,30 +17,48 @@ - .phpcs.xml - .phplint-cache - .phplint.yml +- .rsync-filters-post-build +- .rsync-filters-pre-build - .vscode - .wordpress-org +- /assets_wp +- /dev-workspace +- /dist +- /version.txt +- /webpack.config.js +- /yarn.lock +- CONTRIBUTING.md - Gruntfile.js - README-build.md - README.md - RoboFile.php -- assets/jsx +- /assets/jsx +- /assets_wp - bin - builder - builder.yml +- builder.yml.dist - codeception.dist.yml - cs -- /dev-workspace -- /dist +- cypress +- cypress.json +- jest.config.js +- jest.config.ts - jsconfig.json +- mix-manifest.json - node_modules - package-lock.json - package.json +- phpcs.xml +- phpunit.xml - psalm.xml - ray-dist.php - ray.php - screenshot-*.png +- /scripts +- tailwind.config.js - tests -- vendor -- /version.txt -- /webpack.config.js -- /yarn.lock +- /vendor +- /vendor/bin +- webpack.config.js +- webpack.mix.js diff --git a/composer.json b/composer.json index c1f5c266..5e97d1f5 100644 --- a/composer.json +++ b/composer.json @@ -19,27 +19,24 @@ "homepage": "https://publishpress.com/" } ], + "minimum-stability": "stable", + "prefer-stable": true, "require": { - "publishpress/pimple-pimple": "3.5.0.*", - "publishpress/psr-container": "2.0.1.*", - "publishpress/vendor-locator-series": "^1.0", - "publishpress/wordpress-reviews": "^1.1", - "publishpress/instance-protection": "^2.0", - "publishpress/wordpress-version-notices": "^2.1", - "publishpress/wordpress-banners": "^1.3", - "symfony/polyfill-ctype": "1.19.*", - "sabre/vobject": "^3.4", - "composer/installers": "v1.0.6" + "php": ">=7.2.5" }, "require-dev": { "automattic/vipwpcs": "^2.3", "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1" }, "scripts": { - "build": "/project/dev-workspace/docker/scripts/ppbuild build", - "build:dir": "/project/dev-workspace/docker/scripts/ppbuild build-dir", - "build:clean": "/project/dev-workspace/docker/scripts/ppbuild clean", - "get-version": "/project/dev-workspace/docker/scripts/ppbuild version" + "build": "ppbuild build", + "build:dir": "ppbuild build-dir", + "build:clean": "ppbuild clean", + "get-version": "ppbuild version", + "check:longpath": "longpath .", + "pre-autoload-dump": "composer dumpautoload --working-dir=./lib", + "pre-update-cmd": "composer update --working-dir=./lib", + "pre-install-cmd": "composer install --working-dir=./lib" }, "extra": { "plugin-name": "publishpress-series", @@ -48,8 +45,10 @@ }, "config": { "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true, - "composer/installers": true + "dealerdirect/phpcodesniffer-composer-installer": true + }, + "preferred-install": { + "*": "dist" } } } diff --git a/composer.lock b/composer.lock index 5fc9b531..e67a7590 100644 --- a/composer.lock +++ b/composer.lock @@ -4,684 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2681a3d4d1ca4ecb429ad58d8a8287a9", - "packages": [ - { - "name": "composer/installers", - "version": "v1.0.6", - "source": { - "type": "git", - "url": "https://github.com/composer/installers.git", - "reference": "b3bd071ea114a57212c75aa6a2eef5cfe0cc798f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/b3bd071ea114a57212c75aa6a2eef5cfe0cc798f", - "reference": "b3bd071ea114a57212c75aa6a2eef5cfe0cc798f", - "shasum": "" - }, - "replace": { - "shama/baton": "*" - }, - "require-dev": { - "composer/composer": "1.0.*@dev", - "phpunit/phpunit": "3.7.*" - }, - "type": "composer-installer", - "extra": { - "class": "Composer\\Installers\\Installer", - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-0": { - "Composer\\Installers\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kyle Robinson Young", - "email": "kyle@dontkry.com", - "homepage": "https://github.com/shama", - "role": "Developer" - } - ], - "description": "A multi-framework Composer library installer", - "homepage": "http://composer.github.com/installers/", - "keywords": [ - "TYPO3 CMS", - "TYPO3 Flow", - "TYPO3 Neos", - "agl", - "cakephp", - "codeigniter", - "drupal", - "fuelphp", - "installer", - "joomla", - "kohana", - "laravel", - "li3", - "lithium", - "mako", - "modulework", - "phpbb", - "ppi", - "silverstripe", - "symfony", - "wordpress", - "zend" - ], - "support": { - "issues": "https://github.com/composer/installers/issues", - "source": "https://github.com/composer/installers/tree/master" - }, - "time": "2013-08-20T04:37:09+00:00" - }, - { - "name": "publishpress/instance-protection", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/publishpress/library-instance-protection.git", - "reference": "4193f84a8a680bf4c0d40cc64976ddcadd92158a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/publishpress/library-instance-protection/zipball/4193f84a8a680bf4c0d40cc64976ddcadd92158a", - "reference": "4193f84a8a680bf4c0d40cc64976ddcadd92158a", - "shasum": "" - }, - "require": { - "php": ">=7.2.5" - }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "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" - ], - "support": { - "issues": "https://github.com/publishpress/library-instance-protection/issues", - "source": "https://github.com/publishpress/library-instance-protection/tree/2.0.1" - }, - "time": "2023-04-18T17:50:38+00:00" - }, - { - "name": "publishpress/pimple-pimple", - "version": "3.5.0.10", - "source": { - "type": "git", - "url": "https://github.com/publishpress/library-pimple-pimple.git", - "reference": "f2784f4b1ccaf195b373a46a74cf3742e7c9f826" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/publishpress/library-pimple-pimple/zipball/f2784f4b1ccaf195b373a46a74cf3742e7c9f826", - "reference": "f2784f4b1ccaf195b373a46a74cf3742e7c9f826", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "publishpress/psr-container": "^2.0.1.10" - }, - "require-dev": { - "brianhenryie/strauss": "^0.14.0", - "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-webdriver": "^1.0", - "codeception/util-universalframework": "^1.0", - "lucatume/wp-browser": "^3.1", - "pimple/pimple": "3.5.0", - "publishpress/codeception-extension-extended-copier": "^1.0", - "publishpress/version-loader-generator": "^1.0" - }, - "type": "library", - "extra": { - "generator": { - "lib-class-test": "class_exists('PublishPress\\Pimple\\Container')", - "action-initialize-priority": "-185", - "action-register-priority": "-200" - }, - "strauss": { - "target_directory": "lib", - "namespace_prefix": "PublishPress\\", - "classmap_prefix": "PublishPress_", - "constant_prefix": "PUBLISHPRESS_", - "include_author": "true", - "classmap_output": "true", - "packages": [ - "pimple/pimple", - "psr/container" - ], - "override_autoload": [], - "exclude_from_copy": { - "packages": [], - "namespaces": [], - "file_patterns": [] - }, - "exclude_from_prefix": { - "packages": [], - "namespaces": [], - "file_patterns": [] - }, - "namespace_replacement_patterns": [], - "delete_vendor_packages": true, - "delete_vendor_files": true - } - }, - "autoload": { - "files": [ - "lib/include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "PublishPress", - "email": "help@publishpress.com" - } - ], - "description": "Pimple, a simple Dependency Injection Container, prefixed for PublishPress", - "homepage": "https://github.com/silexphp/Pimple/", - "keywords": [ - "container", - "dependency injection", - "publishpress" - ], - "support": { - "issues": "https://github.com/publishpress/library-pimple-pimple/issues", - "source": "https://github.com/publishpress/library-pimple-pimple/tree/3.5.0.10" - }, - "time": "2023-05-30T18:41:10+00:00" - }, - { - "name": "publishpress/psr-container", - "version": "2.0.1.10", - "source": { - "type": "git", - "url": "https://github.com/publishpress/library-psr-container.git", - "reference": "4ccd2cb058e7b93e96186791ca25870a02e35c5d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/publishpress/library-psr-container/zipball/4ccd2cb058e7b93e96186791ca25870a02e35c5d", - "reference": "4ccd2cb058e7b93e96186791ca25870a02e35c5d", - "shasum": "" - }, - "require": { - "php": ">=7.2.5" - }, - "require-dev": { - "brianhenryie/strauss": "^0.14.0", - "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-webdriver": "^1.0", - "codeception/util-universalframework": "^1.0", - "lucatume/wp-browser": "^3.1", - "psr/container": "2.0.1", - "publishpress/codeception-extension-extended-copier": "^1.0", - "publishpress/version-loader-generator": "^1.0" - }, - "type": "library", - "extra": { - "generator": { - "lib-class-test": "interface_exists('PublishPress\\Psr\\Container\\ContainerInterface')", - "action-initialize-priority": "-190", - "action-register-priority": "-200" - }, - "strauss": { - "target_directory": "lib", - "namespace_prefix": "PublishPress\\", - "classmap_prefix": "PublishPress_", - "constant_prefix": "PUBLISHPRESS_", - "include_author": "true", - "classmap_output": "true", - "packages": [ - "psr/container" - ], - "override_autoload": [], - "exclude_from_copy": { - "packages": [], - "namespaces": [], - "file_patterns": [] - }, - "exclude_from_prefix": { - "packages": [], - "namespaces": [], - "file_patterns": [] - }, - "namespace_replacement_patterns": [], - "delete_vendor_packages": true, - "delete_vendor_files": true - } - }, - "autoload": { - "files": [ - "lib/include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - }, - { - "name": "PublishPress", - "email": "help@publishpress.com" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11), prefixed for PublishPress plugins", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr", - "publishpress" - ], - "support": { - "issues": "https://github.com/publishpress/library-psr-container/issues", - "source": "https://github.com/publishpress/library-psr-container/tree/2.0.1.10" - }, - "time": "2023-05-30T18:17:45+00:00" - }, - { - "name": "publishpress/vendor-locator-series", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/publishpress/vendor-locator-series.git", - "reference": "a1c41fa91fb365978c8d3d3eea6a572d4446d157" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/publishpress/vendor-locator-series/zipball/a1c41fa91fb365978c8d3d3eea6a572d4446d157", - "reference": "a1c41fa91fb365978c8d3d3eea6a572d4446d157", - "shasum": "" - }, - "type": "library", - "autoload": { - "files": [ - "./includes.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "PublishPress", - "email": "help@publishpress.com", - "homepage": "https://publishpress.com", - "role": "Developer" - } - ], - "support": { - "source": "https://github.com/publishpress/vendor-locator-series/tree/1.0.0" - }, - "time": "2023-05-04T02:30:11+00:00" - }, - { - "name": "publishpress/wordpress-banners", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/publishpress/library-wordpress-banners.git", - "reference": "bcb5f9f00973d53e2db027f9a05c059f18743fae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/publishpress/library-wordpress-banners/zipball/bcb5f9f00973d53e2db027f9a05c059f18743fae", - "reference": "bcb5f9f00973d53e2db027f9a05c059f18743fae", - "shasum": "" - }, - "require": { - "php": ">=5.6.20" - }, - "type": "library", - "autoload": { - "files": [ - "BannersMain.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0-or-later" - ], - "authors": [ - { - "name": "PublishPress", - "email": "help@publishpress.com" - } - ], - "description": "Display banners in admin pages of PublishPress Plugins.", - "homepage": "http://publishpress.com/", - "support": { - "issues": "https://github.com/publishpress/library-wordpress-banners/issues", - "source": "https://github.com/publishpress/library-wordpress-banners/tree/v1.3.1" - }, - "time": "2022-08-15T18:07:23+00:00" - }, - { - "name": "publishpress/wordpress-reviews", - "version": "v1.1.19", - "source": { - "type": "git", - "url": "https://github.com/publishpress/library-wordpress-reviews.git", - "reference": "028e573eb7c5da2455a7a823cabbbe5e3f89ca9c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/publishpress/library-wordpress-reviews/zipball/028e573eb7c5da2455a7a823cabbbe5e3f89ca9c", - "reference": "028e573eb7c5da2455a7a823cabbbe5e3f89ca9c", - "shasum": "" - }, - "require": { - "php": ">=5.6.20" - }, - "require-dev": { - "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", - "lucatume/wp-browser": "^3", - "overtrue/phplint": "^2.1", - "phpmd/phpmd": "^2.8", - "publishpress/publishpress-plugin-builder": "^1.2", - "sebastian/phpcpd": "^5.0", - "squizlabs/php_codesniffer": "^3.5", - "wp-cli/i18n-command": "^2.2", - "wp-cli/wp-cli": "^2.5" - }, - "type": "library", - "autoload": { - "files": [ - "ReviewsController.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0-or-later" - ], - "authors": [ - { - "name": "PublishPress", - "email": "help@publishpress.com" - }, - { - "name": "Daniel Iser", - "homepage": "https://github.com/danieliser/WP-Product-In-Dash-Review-Requests" - } - ], - "description": "Library for showing a five-star review banner.", - "homepage": "http://publishpress.com/", - "keywords": [ - "review", - "reviews", - "wordpress plugin" - ], - "support": { - "issues": "https://github.com/publishpress/library-wordpress-reviews/issues", - "source": "https://github.com/publishpress/library-wordpress-reviews/tree/v1.1.19" - }, - "time": "2022-06-03T13:38:53+00:00" - }, - { - "name": "publishpress/wordpress-version-notices", - "version": "2.1.2", - "source": { - "type": "git", - "url": "https://github.com/publishpress/library-wordpress-version-notices.git", - "reference": "b0efcf04ab9d37304e38673bee471116e44cdb0e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/publishpress/library-wordpress-version-notices/zipball/b0efcf04ab9d37304e38673bee471116e44cdb0e", - "reference": "b0efcf04ab9d37304e38673bee471116e44cdb0e", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "publishpress/pimple-pimple": "^3.5.0.0", - "publishpress/psr-container": "^2.0.1.0" - }, - "require-dev": { - "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", - "publishpress/version-loader-generator": "^1.0" - }, - "type": "library", - "extra": { - "generator": { - "lib-class-test": "class_exists('PublishPress\\WordpressVersionNotices\\ServicesProvider')", - "src-dir": "src", - "action-initialize-priority": "-150", - "action-register-priority": "-190" - } - }, - "autoload": { - "files": [ - "src/include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0-or-later" - ], - "authors": [ - { - "name": "PublishPress", - "email": "help@publishpress.com", - "homepage": "https://publishpress.com", - "role": "Developer" - } - ], - "description": "Library for displaying version notices for Pro plugins in WordPress.", - "support": { - "issues": "https://github.com/publishpress/library-wordpress-version-notices/issues", - "source": "https://github.com/publishpress/library-wordpress-version-notices/tree/2.1.2" - }, - "time": "2023-05-30T19:00:42+00:00" - }, - { - "name": "sabre/vobject", - "version": "3.5.3", - "source": { - "type": "git", - "url": "https://github.com/sabre-io/vobject.git", - "reference": "129d80533a9ec0d9cacfb50b51180c34edb6874c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sabre-io/vobject/zipball/129d80533a9ec0d9cacfb50b51180c34edb6874c", - "reference": "129d80533a9ec0d9cacfb50b51180c34edb6874c", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": ">=5.3.1" - }, - "require-dev": { - "phpunit/phpunit": "*", - "squizlabs/php_codesniffer": "*" - }, - "bin": [ - "bin/vobject", - "bin/generate_vcards" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Sabre\\VObject\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Evert Pot", - "email": "me@evertpot.com", - "homepage": "http://evertpot.com/", - "role": "Developer" - }, - { - "name": "Dominik Tobschall", - "email": "dominik@fruux.com", - "homepage": "http://tobschall.de/", - "role": "Developer" - } - ], - "description": "The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects", - "homepage": "http://sabre.io/vobject/", - "keywords": [ - "VObject", - "iCalendar", - "jCal", - "jCard", - "vCard" - ], - "support": { - "forum": "https://groups.google.com/group/sabredav-discuss", - "issues": "https://github.com/sabre-io/vobject/issues", - "source": "https://github.com/fruux/sabre-vobject" - }, - "time": "2016-10-07T03:20:40+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.19.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/aed596913b70fae57be53d86faa2e9ef85a2297b", - "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.19-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.19.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T09:01:57+00:00" - } - ], + "content-hash": "48475d1f796ec958b336997de0f7f988", + "packages": [], "packages-dev": [ { "name": "automattic/vipwpcs", @@ -812,16 +136,16 @@ }, { "name": "sirbrillig/phpcs-variable-analysis", - "version": "v2.11.16", + "version": "v2.11.17", "source": { "type": "git", "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", - "reference": "dc5582dc5a93a235557af73e523c389aac9a8e88" + "reference": "3b71162a6bf0cde2bff1752e40a1788d8273d049" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/dc5582dc5a93a235557af73e523c389aac9a8e88", - "reference": "dc5582dc5a93a235557af73e523c389aac9a8e88", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/3b71162a6bf0cde2bff1752e40a1788d8273d049", + "reference": "3b71162a6bf0cde2bff1752e40a1788d8273d049", "shasum": "" }, "require": { @@ -866,7 +190,7 @@ "source": "https://github.com/sirbrillig/phpcs-variable-analysis", "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" }, - "time": "2023-03-31T16:46:32+00:00" + "time": "2023-08-05T23:46:11+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -980,9 +304,11 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": [], - "prefer-stable": false, + "prefer-stable": true, "prefer-lowest": false, - "platform": [], + "platform": { + "php": ">=7.2.5" + }, "platform-dev": [], "plugin-api-version": "2.3.0" } diff --git a/dev-workspace/build b/dev-workspace/build index f938e856..54684e85 100755 --- a/dev-workspace/build +++ b/dev-workspace/build @@ -1,3 +1,3 @@ #!/usr/bin/env bash -docker compose -f docker/compose.yaml build +DOCKER_HOST_IP=$(php ./scripts/getip) docker compose -f docker/compose.yaml build diff --git a/dev-workspace/build-push b/dev-workspace/build-push index 4bca1630..7f0e700e 100755 --- a/dev-workspace/build-push +++ b/dev-workspace/build-push @@ -2,4 +2,4 @@ # This command requires to be logged in on Docker Hub. Check `docker login --help` for more information. -docker buildx build --platform linux/amd64,linux/arm64 --push -t publishpress/dev-workspace-terminal:series-free ./docker +DOCKER_HOST_IP=$(php ./scripts/getip) docker buildx build --platform linux/amd64,linux/arm64 --push -t publishpress/dev-workspace-terminal:series-free-2 ./docker diff --git a/dev-workspace/docker/Dockerfile b/dev-workspace/docker/Dockerfile index ff93dc9f..19c0ce27 100644 --- a/dev-workspace/docker/Dockerfile +++ b/dev-workspace/docker/Dockerfile @@ -1,218 +1,4 @@ -FROM php:8.0-cli +FROM publishpress/dev-workspace-terminal:generic-2 -#################################################################################################### -# Install base dependencies -#################################################################################################### - -RUN set -ex; \ - \ - # Prepare for installing docker-cli - apt-get update && \ - apt-get install -y \ - apt-transport-https \ - ca-certificates \ - curl \ - gnupg-agent \ - software-properties-common && \ - curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && \ - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" && \ - \ - # Prepare for installing yarn - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ - \ - # Install base dependencies - apt-get update; \ - apt-get install -y \ - build-essential \ - libyaml-dev \ - g++ \ - make \ - autoconf \ - libzip-dev \ - curl \ - libcurl4-openssl-dev \ - wget \ - bash \ - coreutils \ - git \ - openssh-client \ - patch \ - subversion \ - tini \ - unzip \ - zip \ - rsync \ - python3.5 \ - python3-pip \ - nano \ - vim \ - zsh \ - iputils-ping \ - net-tools \ - default-mysql-client \ - bsdmainutils \ - docker.io \ - docker-compose \ - yarn \ - ; \ - mkdir -p /usr/src/php/ext/yaml; \ - curl -fsSL https://pecl.php.net/get/yaml | tar xvz -C "/usr/src/php/ext/yaml" --strip 1; \ - \ - docker-php-ext-configure zip; \ - docker-php-ext-install zip gettext yaml mysqli pdo_mysql; \ - \ - apt-get purge -y --auto-remove; \ - rm -rf /var/lib/apt/lists/* - -#################################################################################################### -# Install ZSH -#################################################################################################### - -# More info: https://github.com/deluan/zsh-in-docker - -RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.1.3/zsh-in-docker.sh)" -- \ - -t ys \ - -p git \ - -p asdf \ - -p ag \ - -p wp-cli - -COPY root/.zshrc /root/.zshrc - -#################################################################################################### -# Configure PHP ini -#################################################################################################### - -RUN { \ -# https://www.php.net/manual/en/errorfunc.constants.php -# https://github.com/docker-library/wordpress/issues/420#issuecomment-517839670 - echo 'error_reporting = E_ERROR | E_WARNING | E_PARSE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_RECOVERABLE_ERROR'; \ - echo 'display_errors = Off'; \ - echo 'display_startup_errors = Off'; \ - echo 'log_errors = On'; \ - echo 'error_log = /dev/stderr'; \ - echo 'log_errors_max_len = 1024'; \ - echo 'ignore_repeated_errors = On'; \ - echo 'ignore_repeated_source = Off'; \ - echo 'html_errors = Off'; \ - } > /usr/local/etc/php/conf.d/error-logging.ini - -#################################################################################################### -# Install Composer -#################################################################################################### - -RUN printf "# composer php cli ini settings\n\ -date.timezone=UTC\n\ -memory_limit=-1\n\ -" > $PHP_INI_DIR/php-cli.ini - -RUN mkdir /root/.composer - -ENV COMPOSER_ALLOW_SUPERUSER 1 -ENV COMPOSER_HOME /root/.composer -ENV COMPOSER_VERSION 2.3.9 - -RUN set -eux ; \ - # install https://github.com/mlocati/docker-php-extension-installer - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /usr/local/bin/install-php-extensions \ - --url https://github.com/mlocati/docker-php-extension-installer/releases/download/1.5.47/install-php-extensions \ - ; \ - echo a4703daabe294839f00d995675cdad02a19a5b585d9e96bf2a9ddda2306afa8de472473c83a02f70b86af88226f493a181b24cb602bfd32404f22ce2cb889349 /usr/local/bin/install-php-extensions | sha512sum --strict --check ; \ - chmod +x /usr/local/bin/install-php-extensions ; \ - # install public keys for snapshot and tag validation, see https://composer.github.io/pubkeys.html - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /tmp/keys.dev.pub \ - --url https://raw.githubusercontent.com/composer/composer.github.io/e7f28b7200249f8e5bc912b42837d4598c74153a/snapshots.pub \ - ; \ - echo 572b963c4b7512a7de3c71a788772440b1996d918b1d2b5354bf8ba2bb057fadec6f7ac4852f2f8a8c01ab94c18141ce0422aec3619354b057216e0597db5ac2 /tmp/keys.dev.pub | sha512sum --strict --check ; \ - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /tmp/keys.tags.pub \ - --url https://raw.githubusercontent.com/composer/composer.github.io/e7f28b7200249f8e5bc912b42837d4598c74153a/releases.pub \ - ; \ - echo 47f374b8840dcb0aa7b2327f13d24ab5f6ae9e58aa630af0d62b3d0ea114f4a315c5d97b21dcad3c7ffe2f0a95db2edec267adaba3f4f5a262abebe39aed3a28 /tmp/keys.tags.pub | sha512sum --strict --check ; \ - # download installer.php, see https://getcomposer.org/download/ - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /tmp/installer.php \ - --url https://raw.githubusercontent.com/composer/getcomposer.org/0a51b6fe383f7f61cf1d250c742ec655aa044c94/web/installer \ - ; \ - echo ba79d97d127330ad12538395723d3c6bdabacd010bb8b845b900f2e5e3de0ad199b41d21e9fbe7a9c01f5a88a827c9da2dac3ba09da64648e63ad4eef069e48e /tmp/installer.php | sha512sum --strict --check ; \ - # install composer phar binary - php /tmp/installer.php \ - --no-ansi \ - --install-dir=/usr/bin \ - --filename=composer \ - --version=${COMPOSER_VERSION} \ - ; \ - composer --ansi --version --no-interaction ; \ - composer diagnose ; \ - rm -f /tmp/installer.php ; \ - find /tmp -type d -exec chmod -v 1777 {} + - -#################################################################################################### -# Install node.js LTS version -#################################################################################################### - -ENV NODE_VERSION=14.19.3 -ENV NPM_VERSION=6.14.17 -ENV NVM_DIR=/root/.nvm -ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}" -RUN curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /tmp/nvm-install.sh \ - --url https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh \ - ; \ - echo c6e6e30aa7fdba27a5e9b3d5b47cf5d93043b775f316e6aa2ee6981bcd3e074e88d35ed136bc050deb73e4db8047b4be86fb02a5b6bd83b8726fb068622072d9 /tmp/nvm-install.sh | sha512sum --strict --check ; \ - bash /tmp/nvm-install.sh - -RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION} -RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION} -RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION} -RUN node --version - -RUN npm install -g npm@${NPM_VERSION} - -RUN npm --version -RUN yarn --version - -#################################################################################################### -# Install Python libs -#################################################################################################### - -# RUN pip3 install med2image - -#################################################################################################### -# Configure the image -#################################################################################################### - -RUN mkdir /project - -VOLUME /project - -WORKDIR /project - -COPY scripts/ppbuild /usr/local/bin/ppbuild - -ENV PATH="/project/node_modules/.bin:/project/vendor/bin:$PATH" - -RUN chmod +x /usr/local/bin/ppbuild +ENV PLUGIN_NAME="PublishPress Series" +ENV PLUGIN_TYPE="FREE" diff --git a/dev-workspace/docker/compose.yaml b/dev-workspace/docker/compose.yaml index ddd42447..489cff03 100644 --- a/dev-workspace/docker/compose.yaml +++ b/dev-workspace/docker/compose.yaml @@ -1,8 +1,8 @@ -name: devworkspace_future_free +name: devworkspace_series_free services: terminal: build: ./docker - image: publishpress/dev-workspace-terminal:series-free + image: publishpress/dev-workspace-terminal:series-free-2 command: ["zsh"] stdin_open: true tty: true diff --git a/dev-workspace/docker/root/.zshrc b/dev-workspace/docker/root/.zshrc deleted file mode 100644 index 2e328d07..00000000 --- a/dev-workspace/docker/root/.zshrc +++ /dev/null @@ -1,119 +0,0 @@ -# If you come from bash you might have to change your $PATH. -export PATH=/project/node_modules/.bin:/project/vendor/bin:$PATH - -# Path to your oh-my-zsh installation. -export ZSH="$HOME/.oh-my-zsh" - -# Set name of the theme to load --- if set to "random", it will -# load a random theme each time oh-my-zsh is loaded, in which case, -# to know which specific one was loaded, run: echo $RANDOM_THEME -# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes -ZSH_THEME="ys" - -# Set list of themes to pick from when loading at random -# Setting this variable when ZSH_THEME=random will cause zsh to load -# a theme from this variable instead of looking in $ZSH/themes/ -# If set to an empty array, this variable will have no effect. -# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) - -# Uncomment the following line to use case-sensitive completion. -# CASE_SENSITIVE="true" - -# Uncomment the following line to use hyphen-insensitive completion. -# Case-sensitive completion must be off. _ and - will be interchangeable. -# HYPHEN_INSENSITIVE="true" - -# Uncomment one of the following lines to change the auto-update behavior -# zstyle ':omz:update' mode disabled # disable automatic updates -# zstyle ':omz:update' mode auto # update automatically without asking -# zstyle ':omz:update' mode reminder # just remind me to update when it's time - -# Uncomment the following line to change how often to auto-update (in days). -# zstyle ':omz:update' frequency 13 - -# Uncomment the following line if pasting URLs and other text is messed up. -# DISABLE_MAGIC_FUNCTIONS="true" - -# Uncomment the following line to disable colors in ls. -# DISABLE_LS_COLORS="true" - -# Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" - -# Uncomment the following line to enable command auto-correction. -# ENABLE_CORRECTION="true" - -# Uncomment the following line to display red dots whilst waiting for completion. -# You can also set it to another string to have that shown instead of the default red dots. -# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" -# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765) -# COMPLETION_WAITING_DOTS="true" - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -# DISABLE_UNTRACKED_FILES_DIRTY="true" - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. -# You can set one of the optional three formats: -# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" -# or set a custom format using the strftime function format specifications, -# see 'man strftime' for details. -# HIST_STAMPS="mm/dd/yyyy" - -# Would you like to use another custom folder than $ZSH/custom? -# ZSH_CUSTOM=/path/to/new-custom-folder - -# Which plugins would you like to load? -# Standard plugins can be found in $ZSH/plugins/ -# Custom plugins may be added to $ZSH_CUSTOM/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. -plugins=(git asdf ag wp-cli docker) - -source $ZSH/oh-my-zsh.sh - -# User configuration - -# export MANPATH="/usr/local/man:$MANPATH" - -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -# Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -# export EDITOR='vim' -# else -# export EDITOR='mvim' -# fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# Set personal aliases, overriding those provided by oh-my-zsh libs, -# plugins, and themes. Aliases can be placed here, though oh-my-zsh -# users are encouraged to define aliases within the ZSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. -# -# Example aliases -# alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" - -export PROJECT_PATH="/project" - -export PROMPT=" -%{$bg[magenta]%}%{$fg[white]%} 🐧 PublishPress Series - Dev-Workspace %{$reset_color%} %{$bg[cyan]%}%{$fg[black]%} FREE %{$reset_color%} -%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \ -%(#,%{$bg[yellow]%}%{$fg[black]%}%n%{$reset_color%},%{$fg[cyan]%}%n) \ -%{$reset_color%}@ \ -%{$fg[green]%}%m \ -%{$reset_color%}in \ -%{$terminfo[bold]$fg[yellow]%}%~%{$reset_color%}\ -${hg_info}\ -${git_info}\ -${svn_info}\ -${venv_info}\ - \ -[%*] $exit_code -%{$terminfo[bold]$fg[magenta]%}➜ %{$reset_color%}" diff --git a/dev-workspace/docker/scripts/host-ip b/dev-workspace/docker/scripts/host-ip deleted file mode 100755 index 074cccbf..00000000 --- a/dev-workspace/docker/scripts/host-ip +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -if [[ $(uname) == "Linux" ]]; then - export DOCKER_HOST_IP=$(ip addr show | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d'/') -elif [[ $(uname) == "Darwin" ]]; then - export DOCKER_HOST_IP=$(ifconfig | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}') -else - echo "Unsupported operating system" - exit 1 -fi - -echo "$DOCKER_HOST_IP" diff --git a/dev-workspace/docker/scripts/modules/prompt-user.mjs b/dev-workspace/docker/scripts/modules/prompt-user.mjs deleted file mode 100644 index 8e53dc2e..00000000 --- a/dev-workspace/docker/scripts/modules/prompt-user.mjs +++ /dev/null @@ -1,22 +0,0 @@ -import { execSync } from 'child_process'; -import inquirer from 'inquirer'; - -const exec = commands => { - execSync(commands, {stdio: 'inherit', shell: true}); -}; - -export const promptUser = () => { - return inquirer.prompt([ - { - type: "list", - name: "version", - message: "Select a PHP version", - choices: ["7.2", "7.4", "8.0", "8.1", "8.2"] - }, - ]); -}; - -export const executeCommand = (command, version) => { - const commandWithVersion = command.replace('{{VERSION}}', version); - exec(commandWithVersion); -}; diff --git a/dev-workspace/docker/scripts/parse-json.php b/dev-workspace/docker/scripts/parse-json.php deleted file mode 100644 index 2ca82d75..00000000 --- a/dev-workspace/docker/scripts/parse-json.php +++ /dev/null @@ -1,48 +0,0 @@ -/dev/null 2>&1 - echo_step "Creating the zip file on dist/${zip_filename}" - zip -qr "${zip_path}" ./${plugin_folder} - popd >/dev/null 2>&1 -} - -####################################### -# Show the elapsed time since the script started. -# Globals: -# start_time -# Outputs: -# The runtime in seconds. -####################################### -show_time() { - if [ "${HIDE_HEADER}" != "1" ]; then - end_time=$(date +%s) - runtime=$((end_time - start_time)) - echo "" - echo "Runtime $runtime sec" - fi -} - -####################################### -# Repeats a string "n" times. -# Arguments: -# The string to be repeated. -# The number of times to repeat. -# Outputs: -# The repeated string. -####################################### -repeat() { - for ((c = 1; c <= "${2}"; c++)); do - echo -n "${1}" - done -} - -####################################### -# Show the header for the script, showing -# a few details of the plugin. -# Globals: -# script_version -# plugin_name -# plugin_version -# plugin_slug -# Outputs: -# The formatted header. -####################################### -echo_header() { - repeat "=" $cols - line=$(repeat "-" $(($cols - 16))) - echo " __ PUBLISHPRESS PLUGIN BUILDER - v${script_version}" - echo " -=(o '. ${line}" - echo " '.-.\ Name: ${plugin_name}" - echo " /| \\\ Slug: ${plugin_slug}" - echo " '| || Folder: ${plugin_folder}" - echo " _\_):,_ Version: ${plugin_version}" - echo "" - repeat "=" $cols - echo "" -} - -####################################### -if [ "${HIDE_HEADER}" != "1" ]; then - echo_header -fi - -case "${command}" in -"build-dir") - echo "Building to dist dir:" - echo "" - build_to_dir - echo "" - echo "Plugin successfully built to the dist dir!" - show_time - ;; -"build") - echo "Building to zip file:" - echo "" - build_to_dir - pack_built_dir - clean_dist - echo "" - echo "Plugin successfully built to a zip file!" - show_time - ;; -"clean") - echo "Cleaning directory on dist dir:" - echo "" - clean_dist - ;; -"version") - echo "${plugin_version}" > version.txt - ;; -*) - echo "invalid option ${command}" - ;; -esac diff --git a/dev-workspace/docker/scripts/pptests b/dev-workspace/docker/scripts/pptests deleted file mode 100755 index 6e6599cc..00000000 --- a/dev-workspace/docker/scripts/pptests +++ /dev/null @@ -1,552 +0,0 @@ -#!/usr/bin/env bash -start_time=$(date +%s) - -script_version="2.0.0" - -scripts_path="${PROJECT_PATH}/dev-workspace/docker/scripts" -dev_workspace_path="${PROJECT_PATH}/dev-workspace" - -####################################### -# Get the plugin name from composer.json file. -# Globals: -# scripts_path -# PROJECT_PATH -# Returns: -# The plugin name. -####################################### -get_plugin_name() { - php "${scripts_path}/parse-json.php" "${PROJECT_PATH}/composer.json" name | awk -F/ '{print $NF}' -} -plugin_name=$(get_plugin_name) - -php_version="${1}" -command="${2}" -flat_php_version="${php_version//./}" -container_name="${plugin_name}-tests-${flat_php_version}" -wordpress_container_name="${container_name}_wordpress_1" -db_container_name="${container_name}_db_1" -codeception_envs_path="${PROJECT_PATH}/tests/codeception/_envs" -dir_in_test_container="/var/www/html" -cols=$(tput cols) - -####################################### -# Echo the string as an step in the output. -# Arguments: -# The message to display. -# Outputs: -# The passed string after an arrow. -####################################### -echo_step() { - echo "▶ ${1}" -} - -####################################### -# Start the docker services calling docker-compose -# for the compose file related to the selected -# PHP version. -# Globals: -# php_version -# container_name -# Outputs: -# Docker-compose output -####################################### -start_services() { - docker-compose -f $PROJECT_PATH/tests/docker/docker-compose-tests-$php_version.yml -p "${container_name}" up -d -} - -####################################### -# Stop the docker services calling docker-compose -# for the compose file related to the selected -# PHP version. -# Globals: -# php_version -# container_name -# Outputs: -# Docker-compose output -####################################### -stop_services() { - docker-compose -f "${PROJECT_PATH}/tests/docker/docker-compose-tests-${php_version}.yml" -p "${container_name}" down -} - -####################################### -# Get the service IP address. -# Globals: -# container_name -# Outputs: -# The IP address -####################################### -get_service_ip() { - container_name="${1}" - - docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "${container_name}" -} - -####################################### -# Get the service port. -# Arguments: -# container_name -# port -# Outputs: -# The port number -####################################### -get_service_port() { - container_name="${1}" - port="${2}" - - docker inspect -f "{{(index (index .NetworkSettings.Ports \"${port}/tcp\") 0).HostPort}}" "${container_name}" -} - -####################################### -# Show the IP addresses for all the services. -# Outputs: -# The IP address -####################################### -get_ip_addresses() { - wordpress_container_ip=$(get_service_ip "${wordpress_container_name}") - db_container_ip=$(get_service_ip "${db_container_name}") - - port_80=$(get_service_port "${wordpress_container_name}" 80) - port_443=$(get_service_port "${wordpress_container_name}" 443) - port_3306=$(get_service_port "${db_container_name}" 3306) - - output=$( - cat < "$file_path" -} - -####################################### -# Create the ray config file -####################################### - -create_ray_config() { - wordpress_container_ip=$(get_service_ip "${wordpress_container_name}") - mount_path=$(get_mount_path) - - config_content=$( - cat < true, - - /* - * The host used to communicate with the Ray app. - */ - 'host' => '${wordpress_container_ip}', - - /* - * The port number used to communicate with the Ray app. - */ - 'port' => 23517, - - /* - * Absolute base path for your sites or projects in Homestead, Vagrant, Docker, or another remote development server. - */ - 'remote_path' => '/var/www/html/', - - /* - * Absolute base path for your sites or projects on your local computer where your IDE or code editor is running on. - */ - 'local_path' => '${mount_path}', - - /* - * When this setting is enabled, the package will not try to format values sent to Ray. - */ - 'always_send_raw_values' => false, -]; - -EOF - ) - - echo "${config_content}" >"$mount_path"/ray.php -} - -####################################### -# Delete all the volumes containing the -# WordPress installation for tests. -# Globals: -# PROJECT_PATH -####################################### -clean_volumes() { - rm -rf "${PROJECT_PATH}/tests/docker/volumes/php*" -} - -####################################### -# Delete all the env files. -# Globals: -# codeception_envs_path -####################################### -clean_envs() { - rm -f "${codeception_envs_path}/php*" -} - -####################################### -# Add the current user to the www-data group, -# so it can read and write docker volume files. -####################################### -add_user_group() { - sudo usermod -a -G www-data "$(whoami)" -} - -####################################### -# Bootstrap the plugin into the container -# for being installed in the WordPress -# and tested. -####################################### -run_bootstrap() { - mount_path=$(get_mount_path) - $dev_workspace_path/docker/scripts/tests-bootstrap "${mount_path}" -} - -####################################### -# Run the builder command without showing -# the header. -# Outputs: The output of the builder command. -####################################### -run_builder() { - HIDE_HEADER=1 yarn run build:dir -} - -####################################### -# Show a list of available envs for different -# PHP versions for testing. -# Outputs: -# A list of codeception envs -####################################### -get_php_versions() { - find $PROJECT_PATH/tests/docker/ -type f -name 'docker-compose-tests-php*\.yml' | sed 's/tests\/docker\/docker-compose-tests-//g' | sed 's/\.yml//g' | sed 's/\/\//\//g' -} - -####################################### -# Start ChromeDriver -####################################### - -start_chromedriver() { - # Local chromedriver - # chromedriver --url-base=/wd/hub & - - # Docker based chromedriver - # Check: https://github.com/SeleniumHQ/docker-selenium - docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-chrome:4.8.3-20230404 -} - -####################################### -# Stop ChromeDriver -####################################### -stop_chromedriver() { - # Only needed for local chromedriver - # ps aux | pgrep chromedriver | awk ' { print $2 } ' | xargs kill -9 - echo 'ok' -} - -####################################### -# Show the elapsed time since the script started. -# Globals: -# start_time -# Outputs: -# The runtime in seconds. -####################################### -show_runtime() { - end_time=$(date +%s) - runtime=$((end_time - start_time)) - echo "" - echo "Runtime: $runtime sec" -} - -####################################### -# Show the elapsed time since the script started. -# Globals: -# start_time -# Outputs: -# The runtime in seconds. -####################################### -show_elapsed_time() { - end_time=$(date +%s) - runtime=$((end_time - start_time)) - echo "" - echo "Elapsed time: $runtime sec" -} - -####################################### -# Repeats a string "n" times. -# Arguments: -# The string to be repeated. -# The number of times to repeat. -# Outputs: -# The repeated string. -####################################### -repeat() { - for ((c = 1; c <= "${2}"; c++)); do - echo -n "${1}" - done -} - -####################################### -# Show the header for the script, showing -# a few details of the plugin. -# Globals: -# script_version -# plugin_name -# php_version -# Outputs: -# The formatted header. -####################################### -echo_header() { - repeat "=" "$cols" - line=$(repeat "-" "$cols"-16) - echo " __" - echo " -=(o '. PUBLISHPRESS TESTS ASSISTANT - v${script_version}" - echo " '.-.\ ${line}" - echo " /| \\ Name: ${plugin_name}" - echo " '| || " - echo " _\_):,_ PHP Version: ${php_version}" - echo "" - repeat "=" "$cols" - echo "" -} - -####################################### -echo_header -case "${command}" in -"setup") - add_user_group - ;; -"start") - echo "Start services:" - echo "" - echo_step "Starting the docker services" - echo "" - start_services - echo "" - - echo_step "Fixing volume permissions" - fix_volume_permissions - - echo_step "Creating Ray config file" - create_ray_config - - echo_step "Bootstrapping" - run_bootstrap - - echo_step "Creating the codeception env file" - create_env_file - - echo_step "IP and Ports" - echo "" - get_ip_addresses - echo "" - - echo_step "Starting ChromeDriver in the background" - echo "" - start_chromedriver - - echo "" - echo "Start process finished!" - show_runtime - ;; -"bootstrap") - echo "Bootstrapping the plugin for testing:" - echo "" - run_bootstrap - - echo "" - echo "Plugin bootstrapped successfully!" - show_runtime - ;; -"stop") - echo "Stop services:" - echo "" - - echo_step "Stopping docker services" - echo "" - stop_services - echo "" - - echo_step "Stopping ChromeDriver" - echo "" - stop_chromedriver - echo "" - - echo "" - echo "Stop process finished!" - show_runtime - ;; -"ip") - get_ip_addresses - ;; -"php-versions") - get_php_versions - ;; -"path") - mount_path=$(get_mount_path) - echo "WordPress path: ${mount_path}" - ;; -"clean") - echo "Cleaning:" - echo "" - - echo_step "Cleaning the volumes" - clean_volumes - - echo_step "Cleaning the codeception env files" - - echo "" - echo "Files cleaned successfully!" - clean_envs - ;; -"brun") - # Arguments passed to this command, after the third one, will all be passed to - # codeception run command - - echo_step "IP and Ports" - echo "" - get_ip_addresses - echo "" - - run_builder - echo "" - - echo_step "Bootstrapping the plugin" - run_bootstrap - - echo "" - show_elapsed_time - echo "" - - echo_step "Cleaning up codeception output" - "$PROJECT_PATH"/vendor/bin/codecept clean - - echo_step "Running codeception tests: ${*:3}, env: ${php_version}" - - echo "" - "$PROJECT_PATH"/vendor/bin/codecept run "${*:3}" --env "${php_version}" - - echo "" - echo "Finish running tests!" - show_runtime - ;; -"run") - echo_step "IP and Ports" - echo "" - get_ip_addresses - echo "" - - echo_step "Cleaning up codeception output" - "$PROJECT_PATH"/vendor/bin/codecept clean - - # Arguments passed to this command, after the third one, will all be passed to - # codeception run command - echo_step "Running codeception tests: ${*:3}, env: ${php_version}" - - echo "" - "$PROJECT_PATH"/vendor/bin/codecept run "${*:3}" --env "${php_version}" - - echo "" - echo "Finish running tests!" - show_runtime - ;; -*) echo "invalid option ${command}" ;; -esac diff --git a/dev-workspace/docker/scripts/prompt-tests-php-version.js b/dev-workspace/docker/scripts/prompt-tests-php-version.js deleted file mode 100755 index c121d647..00000000 --- a/dev-workspace/docker/scripts/prompt-tests-php-version.js +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env node --experimental-modules - -/* - * Copyright (c) 2022. PublishPress, All rights reserved. - */ - -import { promptUser, executeCommand } from './modules/prompt-user.mjs'; - -const additionalArgs = process.argv.slice(2); - -promptUser() - .then((answers) => { - const command = additionalArgs.join(' '); - executeCommand(command, answers.version); - }) - .catch((error) => { - console.error(error); - }); diff --git a/dev-workspace/docker/scripts/tests-bootstrap b/dev-workspace/docker/scripts/tests-bootstrap deleted file mode 100755 index 1380e292..00000000 --- a/dev-workspace/docker/scripts/tests-bootstrap +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env php - $destination) { - $destination = str_replace('%WP_ROOT_FOLDER%', $wpRootPath, $destination); - $sourcePath = "$basePath/$source"; - - // Using rsync because it is faster - if (file_exists($sourcePath)) { - if (is_dir($sourcePath)) { - echo 'Copying dir ' . $source . "\n"; - - shell_exec("[ -e $destination ] && chmod -R 777 $destination && rm -rf $destination"); - shell_exec("mkdir -p $destination"); - shell_exec("rsync -r $sourcePath/* $destination"); - shell_exec("[ -e $destination ] && chmod -R 777 $destination"); - } else { - echo 'Copying file ' . $source . "\n"; - - shell_exec("[ -e $destination ] && chmod -R 666 $destination && rm -rf $destination"); - shell_exec("rsync -r $sourcePath $destination"); - shell_exec("[ -e $destination ] && chmod -R 666 $destination"); - } - } else { - throw new Exception('Source path not found: ' . $source); - } - } - - echo "\n"; -} diff --git a/dev-workspace/run b/dev-workspace/run index 6bbf55e3..b3cf172d 100755 --- a/dev-workspace/run +++ b/dev-workspace/run @@ -9,7 +9,38 @@ [[ -f cache/.bash_history ]] || touch cache/.bash_history [[ -f cache/.composer/auth.json ]] || echo '{}' > cache/.composer/auth.json -DOCKER_HOST_IP=$(./docker/scripts/host-ip) +export DOCKER_HOST_IP=$(php ./scripts/getip) -# Run the terminal service. -DOCKER_HOST_IP=$DOCKER_HOST_IP docker compose -f docker/compose.yaml run --rm terminal "$@" +is_online() { + echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1 + + if [ $? -eq 0 ]; then + echo 1 + else + echo 0 + fi +} + +pull_image() { + docker compose -f docker/compose.yaml pull +} + +run_terminal_service() { + docker compose -f docker/compose.yaml run --rm terminal "$@" +} + +if [ "$(is_online)" -eq 1 ]; then + # Check and update the image if needed, but do not display anything if there is any argument passed. + if [[ $# -eq 0 ]]; then + echo "Checking if the image is up to date..." + pull_image + else + pull_image > /dev/null 2>&1 + fi +else + if [[ $# -eq 0 ]]; then + echo "Offline mode detected, ignoring image update." + fi +fi + +run_terminal_service "$@" diff --git a/dev-workspace/scripts/getip b/dev-workspace/scripts/getip new file mode 100755 index 00000000..52ac1728 --- /dev/null +++ b/dev-workspace/scripts/getip @@ -0,0 +1,69 @@ +#!/usr/bin/env php +%3$s (No Part Number)" -msgstr "" +msgstr "%3$s (Sin número de parte)" #: orgSeries-admin.php:487 #, php-format msgid "%3$s (No part number)" -msgstr "" +msgstr "%3$s (Sin número de parte)" #: orgSeries-admin.php:489 #, php-format msgid "%5$s (Part %1$s of %2$s)" -msgstr "" +msgstr "%5$s (Parte %1$s de %2$s)" #: orgSeries-template-tags.php:220 orgSeries-template-tags.php:229 msgid "Series" @@ -125,11 +125,11 @@ msgstr "HTML permitido" #: orgSeries-options.php:886 msgid "Alphabetical A-Z" -msgstr "" +msgstr "Alfabético a-z" #: orgSeries-options.php:887 msgid "Alphabetical Z-A" -msgstr "" +msgstr "Alfabético z-a" #: orgSeries-admin.php:67 msgid "An error occured" @@ -267,7 +267,7 @@ msgstr "Por defecto" #: orgSeries-options.php:885 msgid "Default Series Order" -msgstr "" +msgstr "Orden de serie por defecto" #: addons/grouping/legacy-includes.php:353 msgid "" @@ -443,9 +443,13 @@ msgstr "" #: orgSeries-options.php:960 msgid "" -"In version 2.11.4, PublishPress Series made changes to how series are stored." -" You can run the upgrade task here if you're having issues with series parts." +"In version 2.11.4, PublishPress Series made changes to how series are " +"stored. You can run the upgrade task here if you're having issues with " +"series parts." msgstr "" +"En la versión 2.11.4, PublishPress Series realizó cambios en la forma en que " +"se almacenan las series. Puedes ejecutar la tarea de actualización aquí si " +"tienes problemas con las partes de las series." #: orgSeries-widgets.php:348 msgid "Include series:" @@ -555,7 +559,7 @@ msgstr "Caja meta" #: orgSeries-options.php:901 msgid "Metabox Series Order" -msgstr "" +msgstr "Caja meta de orden de serie" #: orgSeries-options.php:862 msgid "Migrate" @@ -613,7 +617,7 @@ msgstr "Actualmente sin icono" #: addons/publisher/series-pending-post-table.php:303 msgid "No Part Number" -msgstr "" +msgstr "Sin número de parte" #: orgSeries-admin.php:499 orgSeries-setup.php:254 msgid "No Series" @@ -701,7 +705,7 @@ msgstr "" #: orgSeries-options.php:991 orgSeries-options.php:1013 msgid "Please update your PublishPress Series data" -msgstr "" +msgstr "Por favor, actualiza tus datos de PublishPress Series" #: orgSeries-options.php:868 msgid "" @@ -757,7 +761,7 @@ msgstr "Publicar la serie" #: addons/publisher/series_issue_manager.php:915 msgid "Publish Unpublished Posts" -msgstr "" +msgstr "Publica entradas no publicadas" #: addons/publisher/series_issue_manager.php:643 msgid "Publishing Series:" @@ -827,10 +831,8 @@ msgid "Reset settings" msgstr "Restablecer los ajustes" #: orgSeries-options.php:956 -#, fuzzy -#| msgid "Run upgrade task" msgid "Run Upgrade Task" -msgstr "Ejecutar tarea de actualización" +msgstr "Ejecuta tarea de actualización" #: orgSeries-options.php:308 msgid "" @@ -938,8 +940,8 @@ msgstr "Navegación de la serie" msgid "Series Navigation Box" msgstr "Caja navegación de la serie" -#: orgSeries-manage.php:183 orgSeries-manage.php:192 orgSeries-manage.php:192 -#: orgSeries-admin.php:354 addons/publisher/series_im_admin_main.php:8 +#: orgSeries-manage.php:183 orgSeries-manage.php:192 orgSeries-admin.php:354 +#: addons/publisher/series_im_admin_main.php:8 #: addons/publisher/series_issue_manager.php:751 #: addons/publisher/series_issue_manager.php:826 msgid "Series Order" @@ -1029,7 +1031,7 @@ msgstr "Taxonomía de la serie:" #: orgSeries-options.php:951 msgid "Series Upgrade" -msgstr "" +msgstr "Actualización de serie" #: orgSeries-options.php:1061 msgid "Series upgrade completed." @@ -1189,8 +1191,8 @@ msgstr "Se espera que el valor entrante para %1$s sea un cierre. No lo era." #: orgSeries-widgets.php:79 msgid "" -"The layout and content of this widget can be adjusted via the " -"Latest Series area." +"The layout and content of this widget can be adjusted via the Latest Series area." msgstr "" "El diseño y el contenido de este widget se pueden ajustar a través del área " "de la última serie." @@ -1235,8 +1237,8 @@ msgid "" "The value for %1$s already exists in the %2$s property. Overrides are not " "allowed. Consider attaching your value to a different key" msgstr "" -"El valor de %1$s ya existe en la propiedad %2$s. No se permiten anulaciones. " -" Considera adjuntar tu valor a una clave diferente" +"El valor de %1$s ya existe en la propiedad %2$s. No se permiten " +"anulaciones. Considera adjuntar tu valor a una clave diferente" #: src/domain/services/AssetRegistry.php:271 msgid "" @@ -1259,7 +1261,7 @@ msgstr "" #: addons/publisher/series-part-post-table.php:185 msgid "There are no published posts in this series." -msgstr "" +msgstr "No hay entradas publicadas en esta serie." #: addons/publisher/series-publish-post-table.php:46 #: addons/publisher/series-pending-post-table.php:188 @@ -1417,15 +1419,15 @@ msgstr "No se ha podido recuperar una instancia de %1$s. No se ha encontrado." #: addons/publisher/series_issue_manager.php:901 msgid "Unpublished Posts" -msgstr "" +msgstr "Entradas no publicadas" #: addons/publisher/series_issue_manager.php:867 msgid "Unpublished posts in series:" -msgstr "" +msgstr "Entradas no publicadas en la serie:" #: addons/publisher/series_issue_manager.php:925 msgid "Unpublished Series Order" -msgstr "" +msgstr "Orden de serie no publicado" #: orgSeries-options.php:379 msgid "Update Options" @@ -1447,7 +1449,7 @@ msgstr "Actualizar la categoría de la serie" #: orgSeries-options.php:994 orgSeries-options.php:1015 msgid "Update Series data" -msgstr "" +msgstr "Actualiza datos de la serie" #: orgSeries-manage.php:320 msgid "Updated successfully" @@ -1523,6 +1525,10 @@ msgid "" "update. This improves support for the Multiple Series feature, and resolves " "some issues with the order of posts. Please click this button to upgrade." msgstr "" +"Hemos realizado cambios en la forma en que se almacenan las series y esto " +"requiere una pequeña actualización. Esto mejora la compatibilidad con la " +"característica de series múltiples y resuelve algunos problemas con el orden " +"de las entradas. Por favor, haz clic en este botón para actualizar." #: addons/publisher/series_issue_manager.php:212 msgid "" @@ -1541,6 +1547,8 @@ msgid "" "When these posts are published, they will be added after the last current " "post in the series." msgstr "" +"Al publicarse estas entradas, se añadirán después de la última entrada " +"actual de la serie." #: orgSeries-options.php:697 msgid "" @@ -1658,7 +1666,7 @@ msgstr "" #: addons/publisher/series_im_admin_main.php:34 msgid "You have no series available." -msgstr "" +msgstr "No tienes series disponibles." #: orgSeries-options.php:563 msgid "" diff --git a/languages/organize-series-fr_FR.mo b/languages/organize-series-fr_FR.mo index 89f5ac1c..7d9458ef 100644 Binary files a/languages/organize-series-fr_FR.mo and b/languages/organize-series-fr_FR.mo differ diff --git a/languages/organize-series-fr_FR.po b/languages/organize-series-fr_FR.po index 6ef7a797..fd2536da 100644 --- a/languages/organize-series-fr_FR.po +++ b/languages/organize-series-fr_FR.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: Plugins - PublishPress Series: Issues for Newspapers, " "Magazines, Publishers, Writers - Stable (latest release)\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-07-20 06:20+0000\n" +"PO-Revision-Date: 2023-07-21 13:39+0200\n" "Last-Translator: \n" "Language-Team: French (France)\n" "Language: fr_FR\n" @@ -13,7 +13,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Loco https://localise.biz/" +"X-Generator: Poedit 3.3\n" #: src/domain/exceptions/InvalidEntityException.php:29 msgid "%1$s is not a valid entity (expected: %2$s)." @@ -38,17 +38,17 @@ msgstr "(Il n’y a aucun numéro de pièce actuellement)" #: orgSeries-admin.php:493 #, php-format msgid "%3$s (No Part Number)" -msgstr "" +msgstr "%3$s (Aucun numéro de partie)" #: orgSeries-admin.php:487 #, php-format msgid "%3$s (No part number)" -msgstr "" +msgstr "%3$s (Aucun numéro de partie)" #: orgSeries-admin.php:489 #, php-format msgid "%5$s (Part %1$s of %2$s)" -msgstr "" +msgstr "%5$s (Partie %1$s de %2$s)" #: orgSeries-template-tags.php:220 orgSeries-template-tags.php:229 msgid "Series" @@ -125,11 +125,11 @@ msgstr "HTML autorisé" #: orgSeries-options.php:886 msgid "Alphabetical A-Z" -msgstr "" +msgstr "Alphabétique a-z" #: orgSeries-options.php:887 msgid "Alphabetical Z-A" -msgstr "" +msgstr "Alphabétique z-a" #: orgSeries-admin.php:67 msgid "An error occured" @@ -193,8 +193,9 @@ msgid "" "details on how to customize these designs." msgstr "" "Si vous choisissez une disposition différente de « Par défaut », le modèle " -"de taxonomie de votre thème sera remplacé." -"Cliquez ici pour savoir comment personnaliser ces designs." +"de taxonomie de votre thème sera remplacé.Cliquez ici pour savoir comment personnaliser ces designs." #: orgSeries-options.php:383 msgid "" @@ -267,7 +268,7 @@ msgstr "Par défaut" #: orgSeries-options.php:885 msgid "Default Series Order" -msgstr "" +msgstr "Tri de la série par défaut" #: addons/grouping/legacy-includes.php:353 msgid "" @@ -445,9 +446,13 @@ msgstr "" #: orgSeries-options.php:960 msgid "" -"In version 2.11.4, PublishPress Series made changes to how series are stored." -" You can run the upgrade task here if you're having issues with series parts." +"In version 2.11.4, PublishPress Series made changes to how series are " +"stored. You can run the upgrade task here if you're having issues with " +"series parts." msgstr "" +"Dans la version 2.11.4, PublishPress Series a modifié la façon dont les " +"séries sont stockées. Vous pouvez lancer la tâche de mise à jour ici si vous " +"avez des problèmes avec les parties de séries." #: orgSeries-widgets.php:348 msgid "Include series:" @@ -557,7 +562,7 @@ msgstr "Boîte méta" #: orgSeries-options.php:901 msgid "Metabox Series Order" -msgstr "" +msgstr "Boîte méta de tri de la série" #: orgSeries-options.php:862 msgid "Migrate" @@ -615,7 +620,7 @@ msgstr "Aucune icône actuellement" #: addons/publisher/series-pending-post-table.php:303 msgid "No Part Number" -msgstr "" +msgstr "Aucun numéro de partie" #: orgSeries-admin.php:499 orgSeries-setup.php:254 msgid "No Series" @@ -703,7 +708,7 @@ msgstr "" #: orgSeries-options.php:991 orgSeries-options.php:1013 msgid "Please update your PublishPress Series data" -msgstr "" +msgstr "Veuillez mettre à jour vos données PublishPress Series" #: orgSeries-options.php:868 msgid "" @@ -759,7 +764,7 @@ msgstr "Publier la série" #: addons/publisher/series_issue_manager.php:915 msgid "Publish Unpublished Posts" -msgstr "" +msgstr "Publier les publications non publiées" #: addons/publisher/series_issue_manager.php:643 msgid "Publishing Series:" @@ -829,8 +834,6 @@ msgid "Reset settings" msgstr "Réinitialiser les réglages" #: orgSeries-options.php:956 -#, fuzzy -#| msgid "Run upgrade task" msgid "Run Upgrade Task" msgstr "Exécuter la tâche de mise à niveau" @@ -940,8 +943,8 @@ msgstr "Navigation dans la série" msgid "Series Navigation Box" msgstr "Boîte de navigation de la série" -#: orgSeries-manage.php:183 orgSeries-manage.php:192 orgSeries-manage.php:192 -#: orgSeries-admin.php:354 addons/publisher/series_im_admin_main.php:8 +#: orgSeries-manage.php:183 orgSeries-manage.php:192 orgSeries-admin.php:354 +#: addons/publisher/series_im_admin_main.php:8 #: addons/publisher/series_issue_manager.php:751 #: addons/publisher/series_issue_manager.php:826 msgid "Series Order" @@ -1033,7 +1036,7 @@ msgstr "Taxonomie des séries :" #: orgSeries-options.php:951 msgid "Series Upgrade" -msgstr "" +msgstr "Mise à niveau de la série" #: orgSeries-options.php:1061 msgid "Series upgrade completed." @@ -1197,8 +1200,8 @@ msgstr "" #: orgSeries-widgets.php:79 msgid "" -"The layout and content of this widget can be adjusted via the " -"Latest Series area." +"The layout and content of this widget can be adjusted via the Latest Series area." msgstr "" "La mise en page et le contenu de ce widget peuvent être réglés via la zone " "Dernière série." @@ -1267,7 +1270,7 @@ msgstr "" #: addons/publisher/series-part-post-table.php:185 msgid "There are no published posts in this series." -msgstr "" +msgstr "Il n’y a pas de publication publiée dans cette série." #: addons/publisher/series-publish-post-table.php:46 #: addons/publisher/series-pending-post-table.php:188 @@ -1421,15 +1424,15 @@ msgstr "Impossible de récupérer une instance de %1$s. Non trouvée." #: addons/publisher/series_issue_manager.php:901 msgid "Unpublished Posts" -msgstr "" +msgstr "Publications non publiées" #: addons/publisher/series_issue_manager.php:867 msgid "Unpublished posts in series:" -msgstr "" +msgstr "Publications non publiées dans la série :" #: addons/publisher/series_issue_manager.php:925 msgid "Unpublished Series Order" -msgstr "" +msgstr "Tri de la série non publiée" #: orgSeries-options.php:379 msgid "Update Options" @@ -1451,7 +1454,7 @@ msgstr "Mettre à jour la catégorie de la série" #: orgSeries-options.php:994 orgSeries-options.php:1015 msgid "Update Series data" -msgstr "" +msgstr "Mettre à jour les données de la série" #: orgSeries-manage.php:320 msgid "Updated successfully" @@ -1527,6 +1530,11 @@ msgid "" "update. This improves support for the Multiple Series feature, and resolves " "some issues with the order of posts. Please click this button to upgrade." msgstr "" +"Nous avons modifié la façon dont les séries sont stockées, ce qui nécessite " +"une petite mise à jour. Cette mise à jour améliore la prise en charge de la " +"fonctionnalité des séries multiples et résout certains problèmes liés au tri " +"des publications. Veuillez cliquer sur ce bouton pour effectuer la mise à " +"jour." #: addons/publisher/series_issue_manager.php:212 msgid "" @@ -1545,6 +1553,8 @@ msgid "" "When these posts are published, they will be added after the last current " "post in the series." msgstr "" +"Lorsque ces publications seront publiées, elles seront ajoutées à la suite " +"de la dernière publication actuelle de la série." #: orgSeries-options.php:697 msgid "" @@ -1663,7 +1673,7 @@ msgstr "" #: addons/publisher/series_im_admin_main.php:34 msgid "You have no series available." -msgstr "" +msgstr "Vous n’avez aucune série disponible." #: orgSeries-options.php:563 msgid "" diff --git a/languages/organize-series-it_IT.mo b/languages/organize-series-it_IT.mo index 158af816..59768593 100644 Binary files a/languages/organize-series-it_IT.mo and b/languages/organize-series-it_IT.mo differ diff --git a/languages/organize-series-it_IT.po b/languages/organize-series-it_IT.po index 8ab448c0..ebfe2594 100644 --- a/languages/organize-series-it_IT.po +++ b/languages/organize-series-it_IT.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: Plugins - PublishPress Series: Issues for Newspapers, " "Magazines, Publishers, Writers - Stable (latest release)\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-07-20 06:20+0000\n" +"PO-Revision-Date: 2023-07-21 13:02+0200\n" "Last-Translator: \n" "Language-Team: Italian\n" "Language: it_IT\n" @@ -13,7 +13,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Loco https://localise.biz/" +"X-Generator: Poedit 3.3\n" #: src/domain/exceptions/InvalidEntityException.php:29 msgid "%1$s is not a valid entity (expected: %2$s)." @@ -38,17 +38,17 @@ msgstr "(Attualmente non ha un numero di parti)" #: orgSeries-admin.php:493 #, php-format msgid "%3$s (No Part Number)" -msgstr "" +msgstr "%3$s (Senza numero di parte)" #: orgSeries-admin.php:487 #, php-format msgid "%3$s (No part number)" -msgstr "" +msgstr "%3$s (Senza numero di parte)" #: orgSeries-admin.php:489 #, php-format msgid "%5$s (Part %1$s of %2$s)" -msgstr "" +msgstr "%5$s (Parte %1$s di %2$s)" #: orgSeries-template-tags.php:220 orgSeries-template-tags.php:229 msgid "Series" @@ -125,11 +125,11 @@ msgstr "Html consentito" #: orgSeries-options.php:886 msgid "Alphabetical A-Z" -msgstr "" +msgstr "Alfabetico a-z" #: orgSeries-options.php:887 msgid "Alphabetical Z-A" -msgstr "" +msgstr "Alfabetico z-a" #: orgSeries-admin.php:67 msgid "An error occured" @@ -270,7 +270,7 @@ msgstr "Predefinito" #: orgSeries-options.php:885 msgid "Default Series Order" -msgstr "" +msgstr "Ordine serie predefinito" #: addons/grouping/legacy-includes.php:353 msgid "" @@ -446,9 +446,13 @@ msgstr "" #: orgSeries-options.php:960 msgid "" -"In version 2.11.4, PublishPress Series made changes to how series are stored." -" You can run the upgrade task here if you're having issues with series parts." +"In version 2.11.4, PublishPress Series made changes to how series are " +"stored. You can run the upgrade task here if you're having issues with " +"series parts." msgstr "" +"Nella versione 2.11.4, PublishPress Series ha apportato delle modifiche al " +"metodo di memorizzazione delle serie. Puoi avviare qui l'aggiornamento se " +"stai avendo dei problemi con le parti delle serie." #: orgSeries-widgets.php:348 msgid "Include series:" @@ -557,7 +561,7 @@ msgstr "Metabox" #: orgSeries-options.php:901 msgid "Metabox Series Order" -msgstr "" +msgstr "Metabox dell'ordine serie" #: orgSeries-options.php:862 msgid "Migrate" @@ -615,7 +619,7 @@ msgstr "Nessuna icona attualmente" #: addons/publisher/series-pending-post-table.php:303 msgid "No Part Number" -msgstr "" +msgstr "Senza numero di parti" #: orgSeries-admin.php:499 orgSeries-setup.php:254 msgid "No Series" @@ -703,7 +707,7 @@ msgstr "" #: orgSeries-options.php:991 orgSeries-options.php:1013 msgid "Please update your PublishPress Series data" -msgstr "" +msgstr "Aggiorna i tuoi dati di PublishPress Series" #: orgSeries-options.php:868 msgid "" @@ -758,7 +762,7 @@ msgstr "Pubblica la serie" #: addons/publisher/series_issue_manager.php:915 msgid "Publish Unpublished Posts" -msgstr "" +msgstr "Pubblica gli aticoli non pubblicati" #: addons/publisher/series_issue_manager.php:643 msgid "Publishing Series:" @@ -827,8 +831,6 @@ msgid "Reset settings" msgstr "Reimposta le impostazioni" #: orgSeries-options.php:956 -#, fuzzy -#| msgid "Run upgrade task" msgid "Run Upgrade Task" msgstr "Avvia l'aggiornamento" @@ -938,8 +940,8 @@ msgstr "Navigazione serie" msgid "Series Navigation Box" msgstr "Box di navigazione della serie" -#: orgSeries-manage.php:183 orgSeries-manage.php:192 orgSeries-manage.php:192 -#: orgSeries-admin.php:354 addons/publisher/series_im_admin_main.php:8 +#: orgSeries-manage.php:183 orgSeries-manage.php:192 orgSeries-admin.php:354 +#: addons/publisher/series_im_admin_main.php:8 #: addons/publisher/series_issue_manager.php:751 #: addons/publisher/series_issue_manager.php:826 msgid "Series Order" @@ -1030,7 +1032,7 @@ msgstr "Tassonomia serie:" #: orgSeries-options.php:951 msgid "Series Upgrade" -msgstr "" +msgstr "Aggiornamento serie" #: orgSeries-options.php:1061 msgid "Series upgrade completed." @@ -1150,8 +1152,8 @@ msgid "" "by entering a number (1 for first, etc.) in this field." msgstr "" "I termini sono solitamente ordinati in ordine alfabetico, ma è possibile " -"scegliere un ordine personalizzato inserendo un numero (1 per il primo, ecc.)" -" in questo campo." +"scegliere un ordine personalizzato inserendo un numero (1 per il primo, " +"ecc.) in questo campo." #: src/domain/exceptions/InvalidFilePathException.php:27 msgid "" @@ -1194,8 +1196,8 @@ msgstr "" #: orgSeries-widgets.php:79 msgid "" -"The layout and content of this widget can be adjusted via the " -"Latest Series area." +"The layout and content of this widget can be adjusted via the Latest Series area." msgstr "" "Il layout e il contenuto di questo widget possono essere regolati tramite " "l'area Serie più recente." @@ -1263,7 +1265,7 @@ msgstr "" #: addons/publisher/series-part-post-table.php:185 msgid "There are no published posts in this series." -msgstr "" +msgstr "Non ci sono articoli pubblicati in questa serie." #: addons/publisher/series-publish-post-table.php:46 #: addons/publisher/series-pending-post-table.php:188 @@ -1419,15 +1421,15 @@ msgstr "Impossibile recuperare un'istanza di %1$s. Non è stata trovata." #: addons/publisher/series_issue_manager.php:901 msgid "Unpublished Posts" -msgstr "" +msgstr "Articoli non pubblicati" #: addons/publisher/series_issue_manager.php:867 msgid "Unpublished posts in series:" -msgstr "" +msgstr "Articoli non pubblicati nella serie:" #: addons/publisher/series_issue_manager.php:925 msgid "Unpublished Series Order" -msgstr "" +msgstr "Ordine serie non pubblicate" #: orgSeries-options.php:379 msgid "Update Options" @@ -1449,7 +1451,7 @@ msgstr "Aggiorna le categorie della serie" #: orgSeries-options.php:994 orgSeries-options.php:1015 msgid "Update Series data" -msgstr "" +msgstr "Aggiorna dati serie" #: orgSeries-manage.php:320 msgid "Updated successfully" @@ -1525,6 +1527,11 @@ msgid "" "update. This improves support for the Multiple Series feature, and resolves " "some issues with the order of posts. Please click this button to upgrade." msgstr "" +"Abbiamo apportato dei cambiamenti alla modalità con cui le serie vengono " +"memorizzate perciò è necessario fare un piccolo aggiornamento. Questo " +"migliora la compatibilità con la caratteristica delle serie multiple e " +"risolve delle problematiche con l'ordine degli articoli. Fai clic su questo " +"pulsante per aggiornare." #: addons/publisher/series_issue_manager.php:212 msgid "" @@ -1543,6 +1550,8 @@ msgid "" "When these posts are published, they will be added after the last current " "post in the series." msgstr "" +"Quando questi articoli saranno pubblicati verranno aggiunti di seguito " +"all'ultimo articolo attuale della serie." #: orgSeries-options.php:697 msgid "" @@ -1654,12 +1663,12 @@ msgid "" "You can select the offset for the number of series (useful for paging). No " "offset if left blank" msgstr "" -"Puoi selezionare l'offset per il numero di serie (utile per l'impaginazione)." -" Nessun offset impostato se lasciato vuoto" +"Puoi selezionare l'offset per il numero di serie (utile per " +"l'impaginazione). Nessun offset impostato se lasciato vuoto" #: addons/publisher/series_im_admin_main.php:34 msgid "You have no series available." -msgstr "" +msgstr "Non hai serie disponibili." #: orgSeries-options.php:563 msgid "" diff --git a/lib/composer.json b/lib/composer.json new file mode 100644 index 00000000..1dc0f15f --- /dev/null +++ b/lib/composer.json @@ -0,0 +1,22 @@ +{ + "minimum-stability": "dev", + "prefer-stable": true, + "config": { + "vendor-dir": "vendor", + "preferred-install": { + "*": "dist" + }, + "platform-check": false, + "autoloader-suffix": "PublishPressSeries" + }, + "require": { + "php": ">=7.2.5", + "publishpress/pimple-pimple": "^3.5", + "publishpress/psr-container": "^2.0", + "publishpress/wordpress-reviews": "^1.1", + "publishpress/instance-protection": "^2.0", + "publishpress/wordpress-version-notices": "^2.1", + "publishpress/wordpress-banners": "^1.3", + "publishpress/wordpress-edd-license": "^3.0" + } +} diff --git a/lib/composer.lock b/lib/composer.lock new file mode 100644 index 00000000..55cb5e47 --- /dev/null +++ b/lib/composer.lock @@ -0,0 +1,566 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "76a7e559c6feb010ce434799638d7f79", + "packages": [ + { + "name": "alledia/edd-sl-plugin-updater", + "version": "v1.6.22", + "source": { + "type": "git", + "url": "https://github.com/publishpress/EDD-SL-Plugin-Updater.git", + "reference": "56525f1acd28e340f7a7e523638c1424ca7f0e0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/publishpress/EDD-SL-Plugin-Updater/zipball/56525f1acd28e340f7a7e523638c1424ca7f0e0a", + "reference": "56525f1acd28e340f7a7e523638c1424ca7f0e0a", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.6.20" + }, + "type": "library", + "autoload": { + "files": [ + "EDD_SL_Plugin_Updater.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "EasyDigitalDownloads", + "email": "contact@easydigitaldownloads.com" + }, + { + "name": "PublishPress", + "email": "help@publishpress.com" + }, + { + "name": "Alledia", + "email": "help@alledia.com" + } + ], + "description": "EDD Updates Handler for WordPress Plugins", + "keywords": [ + "edd", + "updates", + "wordpress" + ], + "support": { + "issues": "https://github.com/publishpress/EDD-SL-Plugin-Updater/issues", + "source": "https://github.com/publishpress/EDD-SL-Plugin-Updater/tree/v1.6.22" + }, + "time": "2022-09-23T19:16:06+00:00" + }, + { + "name": "publishpress/instance-protection", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/publishpress/library-instance-protection.git", + "reference": "4193f84a8a680bf4c0d40cc64976ddcadd92158a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/publishpress/library-instance-protection/zipball/4193f84a8a680bf4c0d40cc64976ddcadd92158a", + "reference": "4193f84a8a680bf4c0d40cc64976ddcadd92158a", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "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" + ], + "support": { + "issues": "https://github.com/publishpress/library-instance-protection/issues", + "source": "https://github.com/publishpress/library-instance-protection/tree/2.0.1" + }, + "time": "2023-04-18T17:50:38+00:00" + }, + { + "name": "publishpress/pimple-pimple", + "version": "3.5.0.10", + "source": { + "type": "git", + "url": "https://github.com/publishpress/library-pimple-pimple.git", + "reference": "f2784f4b1ccaf195b373a46a74cf3742e7c9f826" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/publishpress/library-pimple-pimple/zipball/f2784f4b1ccaf195b373a46a74cf3742e7c9f826", + "reference": "f2784f4b1ccaf195b373a46a74cf3742e7c9f826", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "publishpress/psr-container": "^2.0.1.10" + }, + "require-dev": { + "brianhenryie/strauss": "^0.14.0", + "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-webdriver": "^1.0", + "codeception/util-universalframework": "^1.0", + "lucatume/wp-browser": "^3.1", + "pimple/pimple": "3.5.0", + "publishpress/codeception-extension-extended-copier": "^1.0", + "publishpress/version-loader-generator": "^1.0" + }, + "type": "library", + "extra": { + "generator": { + "lib-class-test": "class_exists('PublishPress\\Pimple\\Container')", + "action-initialize-priority": "-185", + "action-register-priority": "-200" + }, + "strauss": { + "target_directory": "lib", + "namespace_prefix": "PublishPress\\", + "classmap_prefix": "PublishPress_", + "constant_prefix": "PUBLISHPRESS_", + "include_author": "true", + "classmap_output": "true", + "packages": [ + "pimple/pimple", + "psr/container" + ], + "override_autoload": [], + "exclude_from_copy": { + "packages": [], + "namespaces": [], + "file_patterns": [] + }, + "exclude_from_prefix": { + "packages": [], + "namespaces": [], + "file_patterns": [] + }, + "namespace_replacement_patterns": [], + "delete_vendor_packages": true, + "delete_vendor_files": true + } + }, + "autoload": { + "files": [ + "lib/include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "PublishPress", + "email": "help@publishpress.com" + } + ], + "description": "Pimple, a simple Dependency Injection Container, prefixed for PublishPress", + "homepage": "https://github.com/silexphp/Pimple/", + "keywords": [ + "container", + "dependency injection", + "publishpress" + ], + "support": { + "issues": "https://github.com/publishpress/library-pimple-pimple/issues", + "source": "https://github.com/publishpress/library-pimple-pimple/tree/3.5.0.10" + }, + "time": "2023-05-30T18:41:10+00:00" + }, + { + "name": "publishpress/psr-container", + "version": "2.0.1.10", + "source": { + "type": "git", + "url": "https://github.com/publishpress/library-psr-container.git", + "reference": "4ccd2cb058e7b93e96186791ca25870a02e35c5d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/publishpress/library-psr-container/zipball/4ccd2cb058e7b93e96186791ca25870a02e35c5d", + "reference": "4ccd2cb058e7b93e96186791ca25870a02e35c5d", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "require-dev": { + "brianhenryie/strauss": "^0.14.0", + "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-webdriver": "^1.0", + "codeception/util-universalframework": "^1.0", + "lucatume/wp-browser": "^3.1", + "psr/container": "2.0.1", + "publishpress/codeception-extension-extended-copier": "^1.0", + "publishpress/version-loader-generator": "^1.0" + }, + "type": "library", + "extra": { + "generator": { + "lib-class-test": "interface_exists('PublishPress\\Psr\\Container\\ContainerInterface')", + "action-initialize-priority": "-190", + "action-register-priority": "-200" + }, + "strauss": { + "target_directory": "lib", + "namespace_prefix": "PublishPress\\", + "classmap_prefix": "PublishPress_", + "constant_prefix": "PUBLISHPRESS_", + "include_author": "true", + "classmap_output": "true", + "packages": [ + "psr/container" + ], + "override_autoload": [], + "exclude_from_copy": { + "packages": [], + "namespaces": [], + "file_patterns": [] + }, + "exclude_from_prefix": { + "packages": [], + "namespaces": [], + "file_patterns": [] + }, + "namespace_replacement_patterns": [], + "delete_vendor_packages": true, + "delete_vendor_files": true + } + }, + "autoload": { + "files": [ + "lib/include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + }, + { + "name": "PublishPress", + "email": "help@publishpress.com" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11), prefixed for PublishPress plugins", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr", + "publishpress" + ], + "support": { + "issues": "https://github.com/publishpress/library-psr-container/issues", + "source": "https://github.com/publishpress/library-psr-container/tree/2.0.1.10" + }, + "time": "2023-05-30T18:17:45+00:00" + }, + { + "name": "publishpress/wordpress-banners", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/publishpress/library-wordpress-banners.git", + "reference": "bcb5f9f00973d53e2db027f9a05c059f18743fae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/publishpress/library-wordpress-banners/zipball/bcb5f9f00973d53e2db027f9a05c059f18743fae", + "reference": "bcb5f9f00973d53e2db027f9a05c059f18743fae", + "shasum": "" + }, + "require": { + "php": ">=5.6.20" + }, + "type": "library", + "autoload": { + "files": [ + "BannersMain.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "PublishPress", + "email": "help@publishpress.com" + } + ], + "description": "Display banners in admin pages of PublishPress Plugins.", + "homepage": "http://publishpress.com/", + "support": { + "issues": "https://github.com/publishpress/library-wordpress-banners/issues", + "source": "https://github.com/publishpress/library-wordpress-banners/tree/v1.3.1" + }, + "time": "2022-08-15T18:07:23+00:00" + }, + { + "name": "publishpress/wordpress-edd-license", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/publishpress/library-wordpress-edd-license.git", + "reference": "ea53f02c0537bf4054bf3fcb183f93a08c0b2ed3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/publishpress/library-wordpress-edd-license/zipball/ea53f02c0537bf4054bf3fcb183f93a08c0b2ed3", + "reference": "ea53f02c0537bf4054bf3fcb183f93a08c0b2ed3", + "shasum": "" + }, + "require": { + "alledia/edd-sl-plugin-updater": "^1.6", + "ext-json": "*", + "php": ">=5.6.20", + "publishpress/pimple-pimple": "~3.2" + }, + "require-dev": { + "codeception/domain-assert": "^1.0", + "codeception/module-asserts": "^1.2", + "codeception/module-cli": "^1.0", + "codeception/module-db": "^1.0", + "codeception/module-filesystem": "^1.0", + "codeception/module-phpbrowser": "^1.0", + "codeception/module-webdriver": "^1.0", + "codeception/util-universalframework": "^1.0", + "lucatume/wp-browser": "^2.4", + "publishpress/version-loader-generator": "^1.0" + }, + "type": "library", + "extra": { + "generator": { + "lib-class-test": "class_exists('PublishPress\\WordPressEDDLicense\\License')", + "src-dir": "src", + "action-initialize-priority": "-150", + "action-register-priority": "-190" + } + }, + "autoload": { + "files": [ + "src/include.php" + ], + "psr-4": { + "PublishPress\\WordPressEDDLicense\\": "src/classes/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "PublishPress", + "email": "help@publishpress.com" + }, + { + "name": "Alledia", + "email": "help@alledia.com" + }, + { + "name": "Anderson Grudtner Martins", + "email": "anderson@grudtner.me", + "homepage": "http://anderson.grudtner.me", + "role": "Lead Developer" + } + ], + "description": "EDD license integration library for WordPress plugins", + "keywords": [ + "edd", + "license", + "wordpress" + ], + "support": { + "source": "https://github.com/publishpress/library-wordpress-edd-license/tree/3.0.1" + }, + "time": "2023-05-30T19:13:23+00:00" + }, + { + "name": "publishpress/wordpress-reviews", + "version": "v1.1.19", + "source": { + "type": "git", + "url": "https://github.com/publishpress/library-wordpress-reviews.git", + "reference": "028e573eb7c5da2455a7a823cabbbe5e3f89ca9c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/publishpress/library-wordpress-reviews/zipball/028e573eb7c5da2455a7a823cabbbe5e3f89ca9c", + "reference": "028e573eb7c5da2455a7a823cabbbe5e3f89ca9c", + "shasum": "" + }, + "require": { + "php": ">=5.6.20" + }, + "require-dev": { + "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", + "lucatume/wp-browser": "^3", + "overtrue/phplint": "^2.1", + "phpmd/phpmd": "^2.8", + "publishpress/publishpress-plugin-builder": "^1.2", + "sebastian/phpcpd": "^5.0", + "squizlabs/php_codesniffer": "^3.5", + "wp-cli/i18n-command": "^2.2", + "wp-cli/wp-cli": "^2.5" + }, + "type": "library", + "autoload": { + "files": [ + "ReviewsController.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "PublishPress", + "email": "help@publishpress.com" + }, + { + "name": "Daniel Iser", + "homepage": "https://github.com/danieliser/WP-Product-In-Dash-Review-Requests" + } + ], + "description": "Library for showing a five-star review banner.", + "homepage": "http://publishpress.com/", + "keywords": [ + "review", + "reviews", + "wordpress plugin" + ], + "support": { + "issues": "https://github.com/publishpress/library-wordpress-reviews/issues", + "source": "https://github.com/publishpress/library-wordpress-reviews/tree/v1.1.19" + }, + "time": "2022-06-03T13:38:53+00:00" + }, + { + "name": "publishpress/wordpress-version-notices", + "version": "2.1.2", + "source": { + "type": "git", + "url": "https://github.com/publishpress/library-wordpress-version-notices.git", + "reference": "b0efcf04ab9d37304e38673bee471116e44cdb0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/publishpress/library-wordpress-version-notices/zipball/b0efcf04ab9d37304e38673bee471116e44cdb0e", + "reference": "b0efcf04ab9d37304e38673bee471116e44cdb0e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "publishpress/pimple-pimple": "^3.5.0.0", + "publishpress/psr-container": "^2.0.1.0" + }, + "require-dev": { + "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", + "publishpress/version-loader-generator": "^1.0" + }, + "type": "library", + "extra": { + "generator": { + "lib-class-test": "class_exists('PublishPress\\WordpressVersionNotices\\ServicesProvider')", + "src-dir": "src", + "action-initialize-priority": "-150", + "action-register-priority": "-190" + } + }, + "autoload": { + "files": [ + "src/include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "PublishPress", + "email": "help@publishpress.com", + "homepage": "https://publishpress.com", + "role": "Developer" + } + ], + "description": "Library for displaying version notices for Pro plugins in WordPress.", + "support": { + "issues": "https://github.com/publishpress/library-wordpress-version-notices/issues", + "source": "https://github.com/publishpress/library-wordpress-version-notices/tree/2.1.2" + }, + "time": "2023-05-30T19:00:42+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": [], + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": ">=7.2.5" + }, + "platform-dev": [], + "plugin-api-version": "2.3.0" +} diff --git a/lib/vendor/alledia/edd-sl-plugin-updater/EDD_SL_Plugin_Updater.php b/lib/vendor/alledia/edd-sl-plugin-updater/EDD_SL_Plugin_Updater.php new file mode 100644 index 00000000..c60d7891 --- /dev/null +++ b/lib/vendor/alledia/edd-sl-plugin-updater/EDD_SL_Plugin_Updater.php @@ -0,0 +1,600 @@ +api_url = trailingslashit( $_api_url ); + $this->api_data = $_api_data; + $this->name = plugin_basename( $_plugin_file ); + $this->slug = basename( $_plugin_file, '.php' ); + $this->version = $_api_data['version']; + $this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false; + $this->beta = ! empty( $this->api_data['beta'] ) ? true : false; + $this->cache_key = 'edd_sl_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) ); + + $edd_plugin_data[ $this->slug ] = $this->api_data; + + /** + * Fires after the $edd_plugin_data is setup. + * + * @since x.x.x + * + * @param array $edd_plugin_data Array of EDD SL plugin data. + */ + do_action( 'post_edd_sl_plugin_updater_setup', $edd_plugin_data ); + + // Set up hooks. + $this->init(); + + } + + /** + * Set up WordPress filters to hook into WP's update process. + * + * @uses add_filter() + * + * @return void + */ + public function init() { + + add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) ); + add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 ); + remove_action( 'after_plugin_row_' . $this->name, 'wp_plugin_update_row', 10 ); + add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 ); + add_action( 'admin_init', array( $this, 'show_changelog' ) ); + + } + + /** + * Check for Updates at the defined API endpoint and modify the update array. + * + * This function dives into the update API just when WordPress creates its update array, + * then adds a custom API call and injects the custom plugin data retrieved from the API. + * It is reassembled from parts of the native WordPress plugin update code. + * See wp-includes/update.php line 121 for the original wp_update_plugins() function. + * + * @uses api_request() + * + * @param array $_transient_data Update array build by WordPress. + * @return array Modified update array with custom plugin data. + */ + public function check_update( $_transient_data ) { + + global $pagenow; + + if ( ! is_object( $_transient_data ) ) { + $_transient_data = new stdClass; + } + + if ( 'plugins.php' == $pagenow && is_multisite() ) { + return $_transient_data; + } + + if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) { + return $_transient_data; + } + + $version_info = $this->get_cached_version_info(); + + if ( false === $version_info ) { + $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug, 'beta' => $this->beta ) ); + + $this->set_version_info_cache( $version_info ); + + } + + if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) { + + if ( version_compare( $this->version, $version_info->new_version, '<' ) ) { + + $_transient_data->response[ $this->name ] = $version_info; + + // Make sure the plugin property is set to the plugin's name/location. See issue 1463 on Software Licensing's GitHub repo. + $_transient_data->response[ $this->name ]->plugin = $this->name; + + } + + $_transient_data->last_checked = time(); + $_transient_data->checked[ $this->name ] = $this->version; + + } + + return $_transient_data; + } + + /** + * show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise! + * + * @param string $file + * @param array $plugin + */ + public function show_update_notification( $file, $plugin ) { + + if ( is_network_admin() ) { + return; + } + + if( ! current_user_can( 'update_plugins' ) ) { + return; + } + + if( ! is_multisite() ) { + return; + } + + if ( $this->name != $file ) { + return; + } + + // Remove our filter on the site transient + remove_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ), 10 ); + + $update_cache = get_site_transient( 'update_plugins' ); + + $update_cache = is_object( $update_cache ) ? $update_cache : new stdClass(); + + if ( empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) { + + $version_info = $this->get_cached_version_info(); + + if ( false === $version_info ) { + $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug, 'beta' => $this->beta ) ); + + // Since we disabled our filter for the transient, we aren't running our object conversion on banners, sections, or icons. Do this now: + if ( isset( $version_info->banners ) && ! is_array( $version_info->banners ) ) { + $version_info->banners = $this->convert_object_to_array( $version_info->banners ); + } + + if ( isset( $version_info->sections ) && ! is_array( $version_info->sections ) ) { + $version_info->sections = $this->convert_object_to_array( $version_info->sections ); + } + + if ( isset( $version_info->icons ) && ! is_array( $version_info->icons ) ) { + $version_info->icons = $this->convert_object_to_array( $version_info->icons ); + } + + if ( isset( $version_info->icons ) && ! is_array( $version_info->icons ) ) { + $version_info->icons = $this->convert_object_to_array( $version_info->icons ); + } + + if ( isset( $version_info->contributors ) && ! is_array( $version_info->contributors ) ) { + $version_info->contributors = $this->convert_object_to_array( $version_info->contributors ); + } + + $this->set_version_info_cache( $version_info ); + } + + if ( ! is_object( $version_info ) ) { + return; + } + + if ( version_compare( $this->version, $version_info->new_version, '<' ) ) { + + $update_cache->response[ $this->name ] = $version_info; + + } + + $update_cache->last_checked = time(); + $update_cache->checked[ $this->name ] = $this->version; + + set_site_transient( 'update_plugins', $update_cache ); + + } else { + + $version_info = $update_cache->response[ $this->name ]; + + } + + // Restore our filter + add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) ); + + if ( ! empty( $update_cache->response[ $this->name ] ) && version_compare( $this->version, $version_info->new_version, '<' ) ) { + + // build a plugin list row, with update notification + $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' ); + # + echo ''; + echo ''; + echo '
'; + + $changelog_link = self_admin_url( 'index.php?edd_sl_action=view_plugin_changelog&plugin=' . $this->name . '&slug=' . $this->slug . '&TB_iframe=true&width=772&height=911' ); + + if ( empty( $version_info->download_link ) ) { + printf( + __( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s.', 'easy-digital-downloads' ), + esc_html( $version_info->name ), + '', + esc_html( $version_info->new_version ), + '' + ); + } else { + printf( + __( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s or %5$supdate now%6$s.', 'easy-digital-downloads' ), + esc_html( $version_info->name ), + '', + esc_html( $version_info->new_version ), + '', + '', + '' + ); + } + + do_action( "in_plugin_update_message-{$file}", $plugin, $version_info ); + + echo '
'; + } + } + + /** + * Updates information on the "View version x.x details" page with custom data. + * + * @uses api_request() + * + * @param mixed $_data + * @param string $_action + * @param object $_args + * @return object $_data + */ + public function plugins_api_filter( $_data, $_action = '', $_args = null ) { + + if ( $_action != 'plugin_information' ) { + + return $_data; + + } + + if ( ! isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) { + + return $_data; + + } + + $to_send = array( + 'slug' => $this->slug, + 'is_ssl' => is_ssl(), + 'fields' => array( + 'banners' => array(), + 'reviews' => false, + 'icons' => array(), + ) + ); + + $cache_key = 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) ); + + // Get the transient where we store the api request for this plugin for 24 hours + $edd_api_request_transient = $this->get_cached_version_info( $cache_key ); + + //If we have no transient-saved value, run the API, set a fresh transient with the API value, and return that value too right now. + if ( empty( $edd_api_request_transient ) ) { + + $api_response = $this->api_request( 'plugin_information', $to_send ); + + // Expires in 3 hours + $this->set_version_info_cache( $api_response, $cache_key ); + + if ( false !== $api_response ) { + $_data = $api_response; + } + + } else { + $_data = $edd_api_request_transient; + } + + if (is_bool($_data)) { + return $_data; + } + + // Convert sections into an associative array, since we're getting an object, but Core expects an array. + if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) { + $_data->sections = $this->convert_object_to_array( $_data->sections ); + } + + // Convert banners into an associative array, since we're getting an object, but Core expects an array. + if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) { + $_data->banners = $this->convert_object_to_array( $_data->banners ); + } + + // Convert icons into an associative array, since we're getting an object, but Core expects an array. + if ( isset( $_data->icons ) && ! is_array( $_data->icons ) ) { + $_data->icons = $this->convert_object_to_array( $_data->icons ); + } + + // Convert contributors into an associative array, since we're getting an object, but Core expects an array. + if ( isset( $_data->contributors ) && ! is_array( $_data->contributors ) ) { + $_data->contributors = $this->convert_object_to_array( $_data->contributors ); + } + + if( ! isset( $_data->plugin ) ) { + $_data->plugin = $this->name; + } + + return $_data; + } + + /** + * Convert some objects to arrays when injecting data into the update API + * + * Some data like sections, banners, and icons are expected to be an associative array, however due to the JSON + * decoding, they are objects. This method allows us to pass in the object and return an associative array. + * + * @since 3.6.5 + * + * @param stdClass $data + * + * @return array + */ + private function convert_object_to_array( $data ) { + $new_data = array(); + + if (is_object($data) || is_array($data)) { + foreach ($data as $key => $value) { + $new_data[ $key ] = is_object($value) ? $this->convert_object_to_array($value) : $value; + } + } + + return $new_data; + } + + /** + * Disable SSL verification in order to prevent download update failures + * + * @param array $args + * @param string $url + * @return object $array + */ + public function http_request_args( $args, $url ) { + + $verify_ssl = $this->verify_ssl(); + if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) { + $args['sslverify'] = $verify_ssl; + } + return $args; + + } + + /** + * Calls the API and, if successful, returns the object delivered by the API. + * + * @uses get_bloginfo() + * @uses wp_remote_post() + * @uses is_wp_error() + * + * @param string $_action The requested action. + * @param array $_data Parameters for the API action. + * @return false|object + */ + private function api_request( $_action, $_data ) { + + global $wp_version, $edd_plugin_url_available; + + $verify_ssl = $this->verify_ssl(); + + // Do a quick status check on this domain if we haven't already checked it. + $store_hash = md5( $this->api_url ); + if ( ! is_array( $edd_plugin_url_available ) || ! isset( $edd_plugin_url_available[ $store_hash ] ) ) { + $test_url_parts = parse_url( $this->api_url ); + + $scheme = ! empty( $test_url_parts['scheme'] ) ? $test_url_parts['scheme'] : 'http'; + $host = ! empty( $test_url_parts['host'] ) ? $test_url_parts['host'] : ''; + $port = ! empty( $test_url_parts['port'] ) ? ':' . $test_url_parts['port'] : ''; + + if ( empty( $host ) ) { + $edd_plugin_url_available[ $store_hash ] = false; + } else { + $test_url = $scheme . '://' . $host . $port; + $response = wp_remote_get( $test_url, array( 'timeout' => $this->health_check_timeout, 'sslverify' => $verify_ssl ) ); + $edd_plugin_url_available[ $store_hash ] = ! is_wp_error($response); + } + } + + if ( false === $edd_plugin_url_available[ $store_hash ] ) { + return false; + } + + $data = array_merge( $this->api_data, $_data ); + + if ( $data['slug'] != $this->slug ) { + return false; + } + + if( $this->api_url == trailingslashit ( home_url() ) ) { + return false; // Don't allow a plugin to ping itself + } + + $api_params = array( + 'edd_action' => 'get_version', + 'license' => ! empty( $data['license'] ) ? $data['license'] : '', + 'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false, + 'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false, + 'version' => isset( $data['version'] ) ? $data['version'] : false, + 'slug' => $data['slug'], + 'author' => $data['author'], + 'url' => home_url(), + 'beta' => ! empty( $data['beta'] ), + ); + + $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) ); + + if ( ! is_wp_error( $request ) ) { + $request = json_decode( wp_remote_retrieve_body( $request ) ); + } + + if ( $request && isset( $request->sections ) ) { + $request->sections = maybe_unserialize( $request->sections ); + } else { + $request = false; + } + + if ( $request && isset( $request->banners ) ) { + $request->banners = maybe_unserialize( $request->banners ); + } + + if ( $request && isset( $request->icons ) ) { + $request->icons = maybe_unserialize( $request->icons ); + } + + if( ! empty( $request->sections ) ) { + foreach( $request->sections as $key => $section ) { + $request->$key = (array) $section; + } + } + + return $request; + } + + public function show_changelog() { + + global $edd_plugin_data; + + if( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) { + return; + } + + if( empty( $_REQUEST['plugin'] ) ) { + return; + } + + if( empty( $_REQUEST['slug'] ) ) { + return; + } + + if( ! current_user_can( 'update_plugins' ) ) { + wp_die( __( 'You do not have permission to install plugin updates', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); + } + + $data = $edd_plugin_data[ $_REQUEST['slug'] ]; + $beta = ! empty( $data['beta'] ) ? true : false; + $cache_key = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $beta . '_version_info' ); + $version_info = $this->get_cached_version_info( $cache_key ); + + if( false === $version_info ) { + + $api_params = array( + 'edd_action' => 'get_version', + 'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false, + 'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false, + 'slug' => $_REQUEST['slug'], + 'author' => $data['author'], + 'url' => home_url(), + 'beta' => ! empty( $data['beta'] ) + ); + + $verify_ssl = $this->verify_ssl(); + $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) ); + + if ( ! is_wp_error( $request ) ) { + $version_info = json_decode( wp_remote_retrieve_body( $request ) ); + } + + + if ( ! empty( $version_info ) && isset( $version_info->sections ) ) { + $version_info->sections = maybe_unserialize( $version_info->sections ); + } else { + $version_info = false; + } + + if( ! empty( $version_info ) ) { + foreach( $version_info->sections as $key => $section ) { + $version_info->$key = (array) $section; + } + } + + $this->set_version_info_cache( $version_info, $cache_key ); + + } + + if( ! empty( $version_info ) && isset( $version_info->sections['changelog'] ) ) { + echo '
' . $version_info->sections['changelog'] . '
'; + } + + exit; + } + + public function get_cached_version_info( $cache_key = '' ) { + + if( empty( $cache_key ) ) { + $cache_key = $this->cache_key; + } + + $cache = get_option( $cache_key ); + + if( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) { + return false; // Cache is expired + } + + // We need to turn the icons into an array, thanks to WP Core forcing these into an object at some point. + $cache['value'] = json_decode( $cache['value'] ); + if ( ! empty( $cache['value']->icons ) ) { + $cache['value']->icons = (array) $cache['value']->icons; + } + + return $cache['value']; + + } + + public function set_version_info_cache( $value = '', $cache_key = '' ) { + + if( empty( $cache_key ) ) { + $cache_key = $this->cache_key; + } + + $data = array( + 'timeout' => strtotime( '+3 hours', time() ), + 'value' => json_encode( $value ) + ); + + update_option( $cache_key, $data, 'no' ); + + } + + /** + * Returns if the SSL of the store should be verified. + * + * @since 1.6.13 + * @return bool + */ + private function verify_ssl() { + return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this ); + } + +} diff --git a/lib/vendor/autoload.php b/lib/vendor/autoload.php new file mode 100644 index 00000000..bc88510c --- /dev/null +++ b/lib/vendor/autoload.php @@ -0,0 +1,25 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ + private $vendorDir; + + // PSR-4 + /** + * @var array> + */ + private $prefixLengthsPsr4 = array(); + /** + * @var array> + */ + private $prefixDirsPsr4 = array(); + /** + * @var list + */ + private $fallbackDirsPsr4 = array(); + + // PSR-0 + /** + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> + */ + private $prefixesPsr0 = array(); + /** + * @var list + */ + private $fallbackDirsPsr0 = array(); + + /** @var bool */ + private $useIncludePath = false; + + /** + * @var array + */ + private $classMap = array(); + + /** @var bool */ + private $classMapAuthoritative = false; + + /** + * @var array + */ + private $missingClasses = array(); + + /** @var string|null */ + private $apcuPrefix; + + /** + * @var array + */ + private static $registeredLoaders = array(); + + /** + * @param string|null $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); + } + + /** + * @return array> + */ + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); + } + + return array(); + } + + /** + * @return array> + */ + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + /** + * @return list + */ + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + /** + * @return list + */ + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + /** + * @return array Array of classname => path + */ + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + * + * @return void + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void + */ + public function add($prefix, $paths, $prepend = false) + { + $paths = (array) $paths; + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + $paths = (array) $paths; + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories + * + * @return void + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + * + * @return void + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + * + * @return void + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + * + * @return void + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } + } + + /** + * Unregisters this instance as an autoloader. + * + * @return void + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return true|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + $includeFile = self::$includeFile; + $includeFile($file); + + return true; + } + + return null; + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + /** + * Returns the currently registered loaders keyed by their corresponding vendor directories. + * + * @return array + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } + + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } +} diff --git a/lib/vendor/composer/InstalledVersions.php b/lib/vendor/composer/InstalledVersions.php new file mode 100644 index 00000000..51e734a7 --- /dev/null +++ b/lib/vendor/composer/InstalledVersions.php @@ -0,0 +1,359 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final + */ +class InstalledVersions +{ + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints((string) $constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; + } else { + self::$installed = array(); + } + } + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } + + return $installed; + } +} diff --git a/lib/vendor/composer/LICENSE b/lib/vendor/composer/LICENSE new file mode 100644 index 00000000..f27399a0 --- /dev/null +++ b/lib/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/lib/vendor/composer/autoload_classmap.php b/lib/vendor/composer/autoload_classmap.php new file mode 100644 index 00000000..0fb0a2c1 --- /dev/null +++ b/lib/vendor/composer/autoload_classmap.php @@ -0,0 +1,10 @@ + $vendorDir . '/composer/InstalledVersions.php', +); diff --git a/lib/vendor/composer/autoload_files.php b/lib/vendor/composer/autoload_files.php new file mode 100644 index 00000000..a0622f71 --- /dev/null +++ b/lib/vendor/composer/autoload_files.php @@ -0,0 +1,16 @@ + $vendorDir . '/publishpress/psr-container/lib/include.php', + '24b27b1b9a32bf58eda571c3e5ae3480' => $vendorDir . '/publishpress/pimple-pimple/lib/include.php', + 'c92bf23a32412037ecdc51806b458c36' => $vendorDir . '/alledia/edd-sl-plugin-updater/EDD_SL_Plugin_Updater.php', + '0078757fbd019a5f202f2be6585c3626' => $vendorDir . '/publishpress/wordpress-banners/BannersMain.php', + '9c8ea886233d3b80c33afe505e877a57' => $vendorDir . '/publishpress/wordpress-edd-license/src/include.php', + '41c664bd04a95c2d6a2f2a3e00f06593' => $vendorDir . '/publishpress/wordpress-reviews/ReviewsController.php', + 'a61bc28a742b9f9f2fd5ef4d2d1e2037' => $vendorDir . '/publishpress/wordpress-version-notices/src/include.php', +); diff --git a/lib/vendor/composer/autoload_namespaces.php b/lib/vendor/composer/autoload_namespaces.php new file mode 100644 index 00000000..15a2ff3a --- /dev/null +++ b/lib/vendor/composer/autoload_namespaces.php @@ -0,0 +1,9 @@ + array($vendorDir . '/publishpress/wordpress-edd-license/src/classes'), +); diff --git a/lib/vendor/composer/autoload_real.php b/lib/vendor/composer/autoload_real.php new file mode 100644 index 00000000..cccbef0d --- /dev/null +++ b/lib/vendor/composer/autoload_real.php @@ -0,0 +1,48 @@ +register(true); + + $filesToLoad = \Composer\Autoload\ComposerStaticInitPublishPressSeries::$files; + $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } + }, null, null); + foreach ($filesToLoad as $fileIdentifier => $file) { + $requireFile($fileIdentifier, $file); + } + + return $loader; + } +} diff --git a/lib/vendor/composer/autoload_static.php b/lib/vendor/composer/autoload_static.php new file mode 100644 index 00000000..f30d3638 --- /dev/null +++ b/lib/vendor/composer/autoload_static.php @@ -0,0 +1,46 @@ + __DIR__ . '/..' . '/publishpress/psr-container/lib/include.php', + '24b27b1b9a32bf58eda571c3e5ae3480' => __DIR__ . '/..' . '/publishpress/pimple-pimple/lib/include.php', + 'c92bf23a32412037ecdc51806b458c36' => __DIR__ . '/..' . '/alledia/edd-sl-plugin-updater/EDD_SL_Plugin_Updater.php', + '0078757fbd019a5f202f2be6585c3626' => __DIR__ . '/..' . '/publishpress/wordpress-banners/BannersMain.php', + '9c8ea886233d3b80c33afe505e877a57' => __DIR__ . '/..' . '/publishpress/wordpress-edd-license/src/include.php', + '41c664bd04a95c2d6a2f2a3e00f06593' => __DIR__ . '/..' . '/publishpress/wordpress-reviews/ReviewsController.php', + 'a61bc28a742b9f9f2fd5ef4d2d1e2037' => __DIR__ . '/..' . '/publishpress/wordpress-version-notices/src/include.php', + ); + + public static $prefixLengthsPsr4 = array ( + 'P' => + array ( + 'PublishPress\\WordPressEDDLicense\\' => 33, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'PublishPress\\WordPressEDDLicense\\' => + array ( + 0 => __DIR__ . '/..' . '/publishpress/wordpress-edd-license/src/classes', + ), + ); + + public static $classMap = array ( + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInitPublishPressSeries::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitPublishPressSeries::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitPublishPressSeries::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/lib/vendor/composer/installed.json b/lib/vendor/composer/installed.json new file mode 100644 index 00000000..4c17d460 --- /dev/null +++ b/lib/vendor/composer/installed.json @@ -0,0 +1,575 @@ +{ + "packages": [ + { + "name": "alledia/edd-sl-plugin-updater", + "version": "v1.6.22", + "version_normalized": "1.6.22.0", + "source": { + "type": "git", + "url": "https://github.com/publishpress/EDD-SL-Plugin-Updater.git", + "reference": "56525f1acd28e340f7a7e523638c1424ca7f0e0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/publishpress/EDD-SL-Plugin-Updater/zipball/56525f1acd28e340f7a7e523638c1424ca7f0e0a", + "reference": "56525f1acd28e340f7a7e523638c1424ca7f0e0a", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.6.20" + }, + "time": "2022-09-23T19:16:06+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "EDD_SL_Plugin_Updater.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "EasyDigitalDownloads", + "email": "contact@easydigitaldownloads.com" + }, + { + "name": "PublishPress", + "email": "help@publishpress.com" + }, + { + "name": "Alledia", + "email": "help@alledia.com" + } + ], + "description": "EDD Updates Handler for WordPress Plugins", + "keywords": [ + "edd", + "updates", + "wordpress" + ], + "support": { + "issues": "https://github.com/publishpress/EDD-SL-Plugin-Updater/issues", + "source": "https://github.com/publishpress/EDD-SL-Plugin-Updater/tree/v1.6.22" + }, + "install-path": "../alledia/edd-sl-plugin-updater" + }, + { + "name": "publishpress/instance-protection", + "version": "2.0.1", + "version_normalized": "2.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/publishpress/library-instance-protection.git", + "reference": "4193f84a8a680bf4c0d40cc64976ddcadd92158a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/publishpress/library-instance-protection/zipball/4193f84a8a680bf4c0d40cc64976ddcadd92158a", + "reference": "4193f84a8a680bf4c0d40cc64976ddcadd92158a", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "time": "2023-04-18T17:50:38+00:00", + "type": "library", + "installation-source": "dist", + "notification-url": "https://packagist.org/downloads/", + "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" + ], + "support": { + "issues": "https://github.com/publishpress/library-instance-protection/issues", + "source": "https://github.com/publishpress/library-instance-protection/tree/2.0.1" + }, + "install-path": "../publishpress/instance-protection" + }, + { + "name": "publishpress/pimple-pimple", + "version": "3.5.0.10", + "version_normalized": "3.5.0.10", + "source": { + "type": "git", + "url": "https://github.com/publishpress/library-pimple-pimple.git", + "reference": "f2784f4b1ccaf195b373a46a74cf3742e7c9f826" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/publishpress/library-pimple-pimple/zipball/f2784f4b1ccaf195b373a46a74cf3742e7c9f826", + "reference": "f2784f4b1ccaf195b373a46a74cf3742e7c9f826", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "publishpress/psr-container": "^2.0.1.10" + }, + "require-dev": { + "brianhenryie/strauss": "^0.14.0", + "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-webdriver": "^1.0", + "codeception/util-universalframework": "^1.0", + "lucatume/wp-browser": "^3.1", + "pimple/pimple": "3.5.0", + "publishpress/codeception-extension-extended-copier": "^1.0", + "publishpress/version-loader-generator": "^1.0" + }, + "time": "2023-05-30T18:41:10+00:00", + "type": "library", + "extra": { + "generator": { + "lib-class-test": "class_exists('PublishPress\\Pimple\\Container')", + "action-initialize-priority": "-185", + "action-register-priority": "-200" + }, + "strauss": { + "target_directory": "lib", + "namespace_prefix": "PublishPress\\", + "classmap_prefix": "PublishPress_", + "constant_prefix": "PUBLISHPRESS_", + "include_author": "true", + "classmap_output": "true", + "packages": [ + "pimple/pimple", + "psr/container" + ], + "override_autoload": [], + "exclude_from_copy": { + "packages": [], + "namespaces": [], + "file_patterns": [] + }, + "exclude_from_prefix": { + "packages": [], + "namespaces": [], + "file_patterns": [] + }, + "namespace_replacement_patterns": [], + "delete_vendor_packages": true, + "delete_vendor_files": true + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "lib/include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "PublishPress", + "email": "help@publishpress.com" + } + ], + "description": "Pimple, a simple Dependency Injection Container, prefixed for PublishPress", + "homepage": "https://github.com/silexphp/Pimple/", + "keywords": [ + "container", + "dependency injection", + "publishpress" + ], + "support": { + "issues": "https://github.com/publishpress/library-pimple-pimple/issues", + "source": "https://github.com/publishpress/library-pimple-pimple/tree/3.5.0.10" + }, + "install-path": "../publishpress/pimple-pimple" + }, + { + "name": "publishpress/psr-container", + "version": "2.0.1.10", + "version_normalized": "2.0.1.10", + "source": { + "type": "git", + "url": "https://github.com/publishpress/library-psr-container.git", + "reference": "4ccd2cb058e7b93e96186791ca25870a02e35c5d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/publishpress/library-psr-container/zipball/4ccd2cb058e7b93e96186791ca25870a02e35c5d", + "reference": "4ccd2cb058e7b93e96186791ca25870a02e35c5d", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "require-dev": { + "brianhenryie/strauss": "^0.14.0", + "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-webdriver": "^1.0", + "codeception/util-universalframework": "^1.0", + "lucatume/wp-browser": "^3.1", + "psr/container": "2.0.1", + "publishpress/codeception-extension-extended-copier": "^1.0", + "publishpress/version-loader-generator": "^1.0" + }, + "time": "2023-05-30T18:17:45+00:00", + "type": "library", + "extra": { + "generator": { + "lib-class-test": "interface_exists('PublishPress\\Psr\\Container\\ContainerInterface')", + "action-initialize-priority": "-190", + "action-register-priority": "-200" + }, + "strauss": { + "target_directory": "lib", + "namespace_prefix": "PublishPress\\", + "classmap_prefix": "PublishPress_", + "constant_prefix": "PUBLISHPRESS_", + "include_author": "true", + "classmap_output": "true", + "packages": [ + "psr/container" + ], + "override_autoload": [], + "exclude_from_copy": { + "packages": [], + "namespaces": [], + "file_patterns": [] + }, + "exclude_from_prefix": { + "packages": [], + "namespaces": [], + "file_patterns": [] + }, + "namespace_replacement_patterns": [], + "delete_vendor_packages": true, + "delete_vendor_files": true + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "lib/include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + }, + { + "name": "PublishPress", + "email": "help@publishpress.com" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11), prefixed for PublishPress plugins", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr", + "publishpress" + ], + "support": { + "issues": "https://github.com/publishpress/library-psr-container/issues", + "source": "https://github.com/publishpress/library-psr-container/tree/2.0.1.10" + }, + "install-path": "../publishpress/psr-container" + }, + { + "name": "publishpress/wordpress-banners", + "version": "v1.3.1", + "version_normalized": "1.3.1.0", + "source": { + "type": "git", + "url": "https://github.com/publishpress/library-wordpress-banners.git", + "reference": "bcb5f9f00973d53e2db027f9a05c059f18743fae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/publishpress/library-wordpress-banners/zipball/bcb5f9f00973d53e2db027f9a05c059f18743fae", + "reference": "bcb5f9f00973d53e2db027f9a05c059f18743fae", + "shasum": "" + }, + "require": { + "php": ">=5.6.20" + }, + "time": "2022-08-15T18:07:23+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "BannersMain.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "PublishPress", + "email": "help@publishpress.com" + } + ], + "description": "Display banners in admin pages of PublishPress Plugins.", + "homepage": "http://publishpress.com/", + "support": { + "issues": "https://github.com/publishpress/library-wordpress-banners/issues", + "source": "https://github.com/publishpress/library-wordpress-banners/tree/v1.3.1" + }, + "install-path": "../publishpress/wordpress-banners" + }, + { + "name": "publishpress/wordpress-edd-license", + "version": "3.0.1", + "version_normalized": "3.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/publishpress/library-wordpress-edd-license.git", + "reference": "ea53f02c0537bf4054bf3fcb183f93a08c0b2ed3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/publishpress/library-wordpress-edd-license/zipball/ea53f02c0537bf4054bf3fcb183f93a08c0b2ed3", + "reference": "ea53f02c0537bf4054bf3fcb183f93a08c0b2ed3", + "shasum": "" + }, + "require": { + "alledia/edd-sl-plugin-updater": "^1.6", + "ext-json": "*", + "php": ">=5.6.20", + "publishpress/pimple-pimple": "~3.2" + }, + "require-dev": { + "codeception/domain-assert": "^1.0", + "codeception/module-asserts": "^1.2", + "codeception/module-cli": "^1.0", + "codeception/module-db": "^1.0", + "codeception/module-filesystem": "^1.0", + "codeception/module-phpbrowser": "^1.0", + "codeception/module-webdriver": "^1.0", + "codeception/util-universalframework": "^1.0", + "lucatume/wp-browser": "^2.4", + "publishpress/version-loader-generator": "^1.0" + }, + "time": "2023-05-30T19:13:23+00:00", + "type": "library", + "extra": { + "generator": { + "lib-class-test": "class_exists('PublishPress\\WordPressEDDLicense\\License')", + "src-dir": "src", + "action-initialize-priority": "-150", + "action-register-priority": "-190" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "src/include.php" + ], + "psr-4": { + "PublishPress\\WordPressEDDLicense\\": "src/classes/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "PublishPress", + "email": "help@publishpress.com" + }, + { + "name": "Alledia", + "email": "help@alledia.com" + }, + { + "name": "Anderson Grudtner Martins", + "email": "anderson@grudtner.me", + "homepage": "http://anderson.grudtner.me", + "role": "Lead Developer" + } + ], + "description": "EDD license integration library for WordPress plugins", + "keywords": [ + "edd", + "license", + "wordpress" + ], + "support": { + "source": "https://github.com/publishpress/library-wordpress-edd-license/tree/3.0.1" + }, + "install-path": "../publishpress/wordpress-edd-license" + }, + { + "name": "publishpress/wordpress-reviews", + "version": "v1.1.19", + "version_normalized": "1.1.19.0", + "source": { + "type": "git", + "url": "https://github.com/publishpress/library-wordpress-reviews.git", + "reference": "028e573eb7c5da2455a7a823cabbbe5e3f89ca9c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/publishpress/library-wordpress-reviews/zipball/028e573eb7c5da2455a7a823cabbbe5e3f89ca9c", + "reference": "028e573eb7c5da2455a7a823cabbbe5e3f89ca9c", + "shasum": "" + }, + "require": { + "php": ">=5.6.20" + }, + "require-dev": { + "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", + "lucatume/wp-browser": "^3", + "overtrue/phplint": "^2.1", + "phpmd/phpmd": "^2.8", + "publishpress/publishpress-plugin-builder": "^1.2", + "sebastian/phpcpd": "^5.0", + "squizlabs/php_codesniffer": "^3.5", + "wp-cli/i18n-command": "^2.2", + "wp-cli/wp-cli": "^2.5" + }, + "time": "2022-06-03T13:38:53+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "ReviewsController.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "PublishPress", + "email": "help@publishpress.com" + }, + { + "name": "Daniel Iser", + "homepage": "https://github.com/danieliser/WP-Product-In-Dash-Review-Requests" + } + ], + "description": "Library for showing a five-star review banner.", + "homepage": "http://publishpress.com/", + "keywords": [ + "review", + "reviews", + "wordpress plugin" + ], + "support": { + "issues": "https://github.com/publishpress/library-wordpress-reviews/issues", + "source": "https://github.com/publishpress/library-wordpress-reviews/tree/v1.1.19" + }, + "install-path": "../publishpress/wordpress-reviews" + }, + { + "name": "publishpress/wordpress-version-notices", + "version": "2.1.2", + "version_normalized": "2.1.2.0", + "source": { + "type": "git", + "url": "https://github.com/publishpress/library-wordpress-version-notices.git", + "reference": "b0efcf04ab9d37304e38673bee471116e44cdb0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/publishpress/library-wordpress-version-notices/zipball/b0efcf04ab9d37304e38673bee471116e44cdb0e", + "reference": "b0efcf04ab9d37304e38673bee471116e44cdb0e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "publishpress/pimple-pimple": "^3.5.0.0", + "publishpress/psr-container": "^2.0.1.0" + }, + "require-dev": { + "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", + "publishpress/version-loader-generator": "^1.0" + }, + "time": "2023-05-30T19:00:42+00:00", + "type": "library", + "extra": { + "generator": { + "lib-class-test": "class_exists('PublishPress\\WordpressVersionNotices\\ServicesProvider')", + "src-dir": "src", + "action-initialize-priority": "-150", + "action-register-priority": "-190" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "src/include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "PublishPress", + "email": "help@publishpress.com", + "homepage": "https://publishpress.com", + "role": "Developer" + } + ], + "description": "Library for displaying version notices for Pro plugins in WordPress.", + "support": { + "issues": "https://github.com/publishpress/library-wordpress-version-notices/issues", + "source": "https://github.com/publishpress/library-wordpress-version-notices/tree/2.1.2" + }, + "install-path": "../publishpress/wordpress-version-notices" + } + ], + "dev": true, + "dev-package-names": [] +} diff --git a/lib/vendor/composer/installed.php b/lib/vendor/composer/installed.php new file mode 100644 index 00000000..e8f7b7fe --- /dev/null +++ b/lib/vendor/composer/installed.php @@ -0,0 +1,95 @@ + array( + 'name' => '__root__', + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => '7a587ed9c7dd03ee2bd9db2457f4d4428565c956', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev' => true, + ), + 'versions' => array( + '__root__' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => '7a587ed9c7dd03ee2bd9db2457f4d4428565c956', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'alledia/edd-sl-plugin-updater' => array( + 'pretty_version' => 'v1.6.22', + 'version' => '1.6.22.0', + 'reference' => '56525f1acd28e340f7a7e523638c1424ca7f0e0a', + 'type' => 'library', + 'install_path' => __DIR__ . '/../alledia/edd-sl-plugin-updater', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'publishpress/instance-protection' => array( + 'pretty_version' => '2.0.1', + 'version' => '2.0.1.0', + 'reference' => '4193f84a8a680bf4c0d40cc64976ddcadd92158a', + 'type' => 'library', + 'install_path' => __DIR__ . '/../publishpress/instance-protection', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'publishpress/pimple-pimple' => array( + 'pretty_version' => '3.5.0.10', + 'version' => '3.5.0.10', + 'reference' => 'f2784f4b1ccaf195b373a46a74cf3742e7c9f826', + 'type' => 'library', + 'install_path' => __DIR__ . '/../publishpress/pimple-pimple', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'publishpress/psr-container' => array( + 'pretty_version' => '2.0.1.10', + 'version' => '2.0.1.10', + 'reference' => '4ccd2cb058e7b93e96186791ca25870a02e35c5d', + 'type' => 'library', + 'install_path' => __DIR__ . '/../publishpress/psr-container', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'publishpress/wordpress-banners' => array( + 'pretty_version' => 'v1.3.1', + 'version' => '1.3.1.0', + 'reference' => 'bcb5f9f00973d53e2db027f9a05c059f18743fae', + 'type' => 'library', + 'install_path' => __DIR__ . '/../publishpress/wordpress-banners', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'publishpress/wordpress-edd-license' => array( + 'pretty_version' => '3.0.1', + 'version' => '3.0.1.0', + 'reference' => 'ea53f02c0537bf4054bf3fcb183f93a08c0b2ed3', + 'type' => 'library', + 'install_path' => __DIR__ . '/../publishpress/wordpress-edd-license', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'publishpress/wordpress-reviews' => array( + 'pretty_version' => 'v1.1.19', + 'version' => '1.1.19.0', + 'reference' => '028e573eb7c5da2455a7a823cabbbe5e3f89ca9c', + 'type' => 'library', + 'install_path' => __DIR__ . '/../publishpress/wordpress-reviews', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'publishpress/wordpress-version-notices' => array( + 'pretty_version' => '2.1.2', + 'version' => '2.1.2.0', + 'reference' => 'b0efcf04ab9d37304e38673bee471116e44cdb0e', + 'type' => 'library', + 'install_path' => __DIR__ . '/../publishpress/wordpress-version-notices', + 'aliases' => array(), + 'dev_requirement' => false, + ), + ), +); diff --git a/lib/vendor/publishpress/instance-protection/LICENSE b/lib/vendor/publishpress/instance-protection/LICENSE new file mode 100644 index 00000000..f288702d --- /dev/null +++ b/lib/vendor/publishpress/instance-protection/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/lib/vendor/publishpress/instance-protection/core/Autoloader.php b/lib/vendor/publishpress/instance-protection/core/Autoloader.php new file mode 100644 index 00000000..d4c6d144 --- /dev/null +++ b/lib/vendor/publishpress/instance-protection/core/Autoloader.php @@ -0,0 +1,189 @@ +register(); + * + * // register the base directories for the namespace prefix + * $loader->addNamespace('Foo\Bar', '/path/to/packages/foo-bar/src'); + * $loader->addNamespace('Foo\Bar', '/path/to/packages/foo-bar/tests'); + * + * The following line would cause the autoloader to attempt to load the + * \Foo\Bar\Qux\Quux class from /path/to/packages/foo-bar/src/Qux/Quux.php: + * + * prefixes[$prefix]) === false) { + $this->prefixes[$prefix] = array(); + } + + // retain the base directory for the namespace prefix + if ($prepend) { + array_unshift($this->prefixes[$prefix], $base_dir); + } else { + array_push($this->prefixes[$prefix], $base_dir); + } + } + + /** + * Loads the class file for a given class name. + * + * @param string $class The fully-qualified class name. + * @return mixed The mapped file name on success, or boolean false on + * failure. + */ + public function loadClass($class) + { + // the current namespace prefix + $prefix = $class; + + // work backwards through the namespace names of the fully-qualified + // class name to find a mapped file name + while (false !== $pos = strrpos($prefix, '\\')) { + + // retain the trailing namespace separator in the prefix + $prefix = substr($class, 0, $pos + 1); + + // the rest is the relative class name + $relative_class = substr($class, $pos + 1); + + // try to load a mapped file for the prefix and relative class + $mapped_file = $this->loadMappedFile($prefix, $relative_class); + if ($mapped_file) { + return $mapped_file; + } + + // remove the trailing namespace separator for the next iteration + // of strrpos() + $prefix = rtrim($prefix, '\\'); + } + + // never found a mapped file + return false; + } + + /** + * Load the mapped file for a namespace prefix and relative class. + * + * @param string $prefix The namespace prefix. + * @param string $relative_class The relative class name. + * @return mixed Boolean false if no mapped file can be loaded, or the + * name of the mapped file that was loaded. + */ + protected function loadMappedFile($prefix, $relative_class) + { + // are there any base directories for this namespace prefix? + if (isset($this->prefixes[$prefix]) === false) { + return false; + } + + // look through base directories for this namespace prefix + foreach ($this->prefixes[$prefix] as $base_dir) { + + // replace the namespace prefix with the base directory, + // replace namespace separators with directory separators + // in the relative class name, append with .php + $file = $base_dir + . str_replace('\\', '/', $relative_class) + . '.php'; + + // if the mapped file exists, require it + if ($this->requireFile($file)) { + // yes, we're done + return $file; + } + } + + // never found it + return false; + } + + /** + * If a file exists, require it from the file system. + * + * @param string $file The file to require. + * @return bool True if the file exists, false if not. + */ + protected function requireFile($file) + { + if (file_exists($file)) { + require $file; + return true; + } + return false; + } +} diff --git a/lib/vendor/publishpress/instance-protection/core/Config.php b/lib/vendor/publishpress/instance-protection/core/Config.php new file mode 100644 index 00000000..d92b56c0 --- /dev/null +++ b/lib/vendor/publishpress/instance-protection/core/Config.php @@ -0,0 +1,44 @@ +pluginSlug = $config->pluginSlug; + $this->pluginName = $config->pluginName; + $this->pluginFolder = $config->pluginFolder; + $this->isProPlugin = $config->isProPlugin; + $this->freePluginName = $config->freePluginName; + + if (! $this->isProPlugin) { + $this->freePluginName = $this->pluginName; + } + + if (empty($this->pluginFolder)) { + $this->pluginFolder = $this->pluginSlug; + } + + if ( + is_admin() + && ! wp_doing_ajax() + && ! wp_doing_cron() + ) { + add_action('admin_init', [$this, 'init'], $this->isProPlugin ? 7 : 5); + } + } + + public function getVersion() + { + return '2.0.0'; + } + + public function init() + { + global $pagenow; + + if ($pagenow !== 'plugins.php') { + return; + } + + if (! $this->getStateDuplicatedPluginCheck()) { + $this->checkDuplicatedPluginsAndLatestVersions(); + + $this->setFlagDuplicatedPluginCheck(); + } + + if ($this->getStateHasMultiplePluginsActivated()) { + $this->addMultipleInstancesNotice(); + } + + if ($this->isProPlugin && $this->getStateFreePluginLoadedByItself()) { + $this->addFreePluginNotice(); + } + + // This should run once per request. + if (! $this->getStateStyleEnqueued()) { + $this->addPluginsPageStyle(); + $this->setFlagStyleEnqueued(); + } + + if ($this->getStateHasMultiplePaths()) { + // This should run for every instance + add_action('after_plugin_row', [$this, 'addLatestVersionCheck'], 10, 2); + add_action('after_plugin_row', [$this, 'addNonStandardPathCheck'], 10, 2); + } + } + + private function checkDuplicatedPluginsAndLatestVersions() + { + if (! function_exists('get_plugins')) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + + $plugins = get_plugins(); + + $pluginFiles = []; + $pluginInstances = []; + $latestVersions = []; + + foreach ($plugins as $pluginFile => $pluginData) { + if ($this->pluginName === $pluginData['Name']) { + $pluginFiles[] = $pluginFile; + + if (is_plugin_active($pluginFile)) { + $pluginInstances[] = $pluginFile; + + if ($pluginData['Name'] === $this->freePluginName) { + $this->setStateFreePluginLoadedByItself(); + } + } + + if (! isset($latestVersions[$this->pluginSlug])) { + $latestVersions[$this->pluginSlug] = $pluginData['Version']; + continue; + } + + if (version_compare($pluginData['Version'], $latestVersions[$this->pluginSlug], '>')) { + $latestVersions[$this->pluginSlug] = $pluginData['Version']; + } + } + } + + if (count($pluginFiles) > 1) { + $this->setStateHasMultiplePaths(); + } + + if (count($pluginInstances) > 1) { + $this->setStateHasMultiplePluginsActivated(); + } + + $this->setStateLatestVersions($latestVersions); + } + + public function addPluginsPageStyle() + { + add_action('admin_enqueue_scripts', function() { + wp_add_inline_style( + 'wp-admin', + ' + tr.ppa-plugin-warning { + background: #fff; + } + + tr.ppa-plugin-warning td { + box-shadow: inset 0 -1px 0 rgb(0 0 0 / 10%); + overflow: hidden; + padding: 0; + } + + tr.ppa-plugin-warning td > div { + margin: 5px 20px 15px 44px; + } + + tr.ppa-plugin-warning td > div.multiple-instances-warning { + background-color: #ffc6c6; + border: 1px solid #edb977; + border-left: 4px solid #e1a04e; + padding-left: 6px; + } + + tr.ppa-plugin-warning td > div.multiple-instances-warning .dashicons { + margin-right: 6px; + vertical-align: bottom; + color: #c18d17; + } + + tr.ppa-plugin-warning td > div.multiple-instances-warning p { + margin: 0.5em 0; + } + + tr.active + tr.ppa-plugin-warning td { + background-color: #f0f6fc; + } + ' + ); + }); + } + + public function addLatestVersionCheck($pluginFile, $pluginData) + { + if ($pluginData['Name'] !== $this->pluginName) { + return; + } + + if ($this->getStateVersionChecked($pluginFile)) { + return; + } + + $latestVersions = $this->getStateLatestVersions(); + + if (! isset($latestVersions[$this->pluginSlug])) { + return; + } + + if (version_compare($pluginData['Version'], $latestVersions[$this->pluginSlug], '<')) { + ?> + + +
+

+ + +

+
+ + + setStateVersionChecked($pluginFile); + } + + public function addNonStandardPathCheck($pluginFile, $pluginData) + { + if ($pluginData['Name'] !== $this->pluginName) { + return; + } + + if ($this->getStatePathHasBeenCheckedForPluginFile($pluginFile)) { + return; + } + + $expectedPath = $this->pluginFolder . '/' . $this->pluginSlug . '.php'; + + if ($pluginFile !== $expectedPath) { + ?> + + +
+

+ + ' . esc_html($pluginFile) . '', + '' . esc_html($expectedPath) . '' + ); + ?> +

+
+ + + setStatePathHasBeenCheckedForPluginFile($pluginFile); + } + + public function addMultipleInstancesNotice() + { + if ($this->getStateMultipleInstancesNoticeAdded()) { + return; + } + + $pluginName = $this->pluginName; + + add_action('admin_notices', function() use ($pluginName) { + ?> +
+

+
+ setStateMultipleInstancesNoticeAdded(); + } + + public function addFreePluginNotice() + { + if (LibState::getPluginState($this->pluginSlug, 'freePluginNoticeAdded')) { + return; + } + + $pluginName = $this->pluginName; + $freePluginName = $this->freePluginName; + + add_action('admin_notices', function() use ($pluginName, $freePluginName) { + ?> +
+

+
+ pluginSlug, 'freePluginNoticeAdded'); + } + + private function getStateHasMultiplePaths() + { + return (bool) LibState::getPluginState($this->pluginSlug, 'hasMultiplePaths'); + } + + private function setStateHasMultiplePaths() + { + LibState::setPluginState($this->pluginSlug, 'hasMultiplePaths'); + } + + private function getStateHasMultiplePluginsActivated() + { + return (bool) LibState::getPluginState($this->pluginSlug, 'hasMultipleInstances'); + } + + private function setStateHasMultiplePluginsActivated() + { + LibState::setPluginState($this->pluginSlug, 'hasMultipleInstances'); + } + + private function getStateFreePluginLoadedByItself() + { + return (bool) LibState::getState('freePluginIsLoaded' . $this->freePluginName); + } + + private function setStateFreePluginLoadedByItself() + { + LibState::setState('freePluginIsLoaded' . $this->freePluginName); + } + + private function setStatePathHasBeenCheckedForPluginFile($pluginFile) + { + LibState::setPluginState($this->pluginSlug, 'pathCheck' . $pluginFile); + } + + private function getStatePathHasBeenCheckedForPluginFile($pluginFile) + { + return (bool) LibState::getPluginState($this->pluginSlug, 'pathCheck' . $pluginFile); + } + + private function setStateVersionChecked($pluginFile) + { + LibState::setPluginState($this->pluginSlug, 'versionCheck' . $pluginFile); + } + + private function getStateVersionChecked($pluginFile) + { + return (bool) LibState::getPluginState($this->pluginSlug, 'versionCheck' . $pluginFile); + } + + private function getStateDuplicatedPluginCheck() + { + return (bool) LibState::getPluginState($this->pluginSlug, 'duplicatedPluginsCheck'); + } + + private function setFlagDuplicatedPluginCheck() + { + LibState::setPluginState($this->pluginSlug, 'duplicatedPluginsCheck'); + } + + private function getStateStyleEnqueued() + { + return (bool) LibState::getState(self::STATE_STYLE_ENQUEUED); + } + + private function setFlagStyleEnqueued() + { + LibState::setState(self::STATE_STYLE_ENQUEUED); + } + + private function setStateLatestVersions($latestVersions) + { + LibState::setPluginState($this->pluginSlug, 'latestVersions', $latestVersions); + } + + private function getStateLatestVersions() + { + return (array) LibState::getPluginState($this->pluginSlug, 'latestVersions'); + } + + private function setStateMultipleInstancesNoticeAdded() + { + LibState::setPluginState($this->pluginSlug, 'multipleInstancesNoticeAdded'); + } + + private function getStateMultipleInstancesNoticeAdded() + { + return (bool) LibState::getPluginState($this->pluginSlug, 'multipleInstancesNoticeAdded'); + } +} diff --git a/lib/vendor/publishpress/instance-protection/core/LibState.php b/lib/vendor/publishpress/instance-protection/core/LibState.php new file mode 100644 index 00000000..36d91d45 --- /dev/null +++ b/lib/vendor/publishpress/instance-protection/core/LibState.php @@ -0,0 +1,28 @@ +register(); + $autoloader->addNamespace('PublishPressInstanceProtection', __DIR__ . '/core'); +} diff --git a/lib/vendor/publishpress/pimple-pimple/LICENSE b/lib/vendor/publishpress/pimple-pimple/LICENSE new file mode 100644 index 00000000..3e2a9e1e --- /dev/null +++ b/lib/vendor/publishpress/pimple-pimple/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2009-2020 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/lib/vendor/publishpress/pimple-pimple/lib/Versions.php b/lib/vendor/publishpress/pimple-pimple/lib/Versions.php new file mode 100644 index 00000000..4757a35b --- /dev/null +++ b/lib/vendor/publishpress/pimple-pimple/lib/Versions.php @@ -0,0 +1,85 @@ +versions[$versionString])) { + return false; + } + + $this->versions[$versionString] = $initializationCallback; + + return true; + } + + public function getVersions(): array + { + return $this->versions; + } + + public function latestVersion() + { + $keys = array_keys($this->versions); + if (empty($keys)) { + return false; + } + uasort($keys, 'version_compare'); + return end($keys); + } + + public function latestVersionCallback() + { + $latest = $this->latestVersion(); + if (empty($latest) || ! isset($this->versions[$latest])) { + return '__return_null'; + } + + return $this->versions[$latest]; + } + + /** + * @return Versions + * @codeCoverageIgnore + */ + public static function getInstance(): ?Versions + { + if (empty(self::$instance)) { + self::$instance = new self(); + } + + return self::$instance; + } + + /** + * @codeCoverageIgnore + */ + public static function initializeLatestVersion(): void + { + $self = self::getInstance(); + + call_user_func($self->latestVersionCallback()); + } + } +} diff --git a/lib/vendor/publishpress/pimple-pimple/lib/autoload-classmap.php b/lib/vendor/publishpress/pimple-pimple/lib/autoload-classmap.php new file mode 100644 index 00000000..5ac5740b --- /dev/null +++ b/lib/vendor/publishpress/pimple-pimple/lib/autoload-classmap.php @@ -0,0 +1,27 @@ + $strauss_src . '/Versions.php', + 'PublishPress\Pimple\Container' => $strauss_src . '/pimple/pimple/src/Pimple/Container.php', + 'PublishPress\Pimple\Tests\ServiceIteratorTest' => $strauss_src . '/pimple/pimple/src/Pimple/Tests/ServiceIteratorTest.php', + 'PublishPress\Pimple\Tests\PimpleTest' => $strauss_src . '/pimple/pimple/src/Pimple/Tests/PimpleTest.php', + 'PublishPress\Pimple\Tests\Psr11\ContainerTest' => $strauss_src . '/pimple/pimple/src/Pimple/Tests/Psr11/ContainerTest.php', + 'PublishPress\Pimple\Tests\Psr11\ServiceLocatorTest' => $strauss_src . '/pimple/pimple/src/Pimple/Tests/Psr11/ServiceLocatorTest.php', + 'PublishPress\Pimple\Tests\PimpleServiceProviderInterfaceTest' => $strauss_src . '/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php', + 'PublishPress\Pimple\Tests\Fixtures\NonInvokable' => $strauss_src . '/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php', + 'PublishPress\Pimple\Tests\Fixtures\Service' => $strauss_src . '/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php', + 'PublishPress\Pimple\Tests\Fixtures\Invokable' => $strauss_src . '/pimple/pimple/src/Pimple/Tests/Fixtures/Invokable.php', + 'PublishPress\Pimple\Tests\Fixtures\PimpleServiceProvider' => $strauss_src . '/pimple/pimple/src/Pimple/Tests/Fixtures/PimpleServiceProvider.php', + 'PublishPress\Pimple\Psr11\Container' => $strauss_src . '/pimple/pimple/src/Pimple/Psr11/Container.php', + 'PublishPress\Pimple\Psr11\ServiceLocator' => $strauss_src . '/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php', + 'PublishPress\Pimple\ServiceProviderInterface' => $strauss_src . '/pimple/pimple/src/Pimple/ServiceProviderInterface.php', + 'PublishPress\Pimple\Exception\FrozenServiceException' => $strauss_src . '/pimple/pimple/src/Pimple/Exception/FrozenServiceException.php', + 'PublishPress\Pimple\Exception\UnknownIdentifierException' => $strauss_src . '/pimple/pimple/src/Pimple/Exception/UnknownIdentifierException.php', + 'PublishPress\Pimple\Exception\InvalidServiceIdentifierException' => $strauss_src . '/pimple/pimple/src/Pimple/Exception/InvalidServiceIdentifierException.php', + 'PublishPress\Pimple\Exception\ExpectedInvokableException' => $strauss_src . '/pimple/pimple/src/Pimple/Exception/ExpectedInvokableException.php', + 'PublishPress\Pimple\ServiceIterator' => $strauss_src . '/pimple/pimple/src/Pimple/ServiceIterator.php', +); \ No newline at end of file diff --git a/lib/vendor/publishpress/pimple-pimple/lib/autoload.php b/lib/vendor/publishpress/pimple-pimple/lib/autoload.php new file mode 100644 index 00000000..35b2b2fc --- /dev/null +++ b/lib/vendor/publishpress/pimple-pimple/lib/autoload.php @@ -0,0 +1,20 @@ +register('3.5.0.10', __NAMESPACE__ . '\initialize3Dot5Dot0Dot10'); + } + } + + function initialize3Dot5Dot0Dot10() + { + require_once __DIR__ . '/autoload.php'; + + if (! defined('PUBLISHPRESS_PIMPLE_PIMPLE_VERSION')) { + define('PUBLISHPRESS_PIMPLE_PIMPLE_VERSION', '3.5.0.10'); + } + + do_action('publishpress_pimple_pimple_3Dot5Dot0Dot10_initialized'); + } +} diff --git a/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Container.php b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Container.php new file mode 100644 index 00000000..c7cb0a97 --- /dev/null +++ b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Container.php @@ -0,0 +1,308 @@ +factories = new \SplObjectStorage(); + $this->protected = new \SplObjectStorage(); + + foreach ($values as $key => $value) { + $this->offsetSet($key, $value); + } + } + + /** + * Sets a parameter or an object. + * + * Objects must be defined as Closures. + * + * Allowing any PHP callable leads to difficult to debug problems + * as function names (strings) are callable (creating a function with + * the same name as an existing parameter would break your container). + * + * @param string $id The unique identifier for the parameter or object + * @param mixed $value The value of the parameter or a closure to define an object + * + * @return void + * + * @throws FrozenServiceException Prevent override of a frozen service + */ + #[\ReturnTypeWillChange] + public function offsetSet($id, $value) + { + if (isset($this->frozen[$id])) { + throw new FrozenServiceException($id); + } + + $this->values[$id] = $value; + $this->keys[$id] = true; + } + + /** + * Gets a parameter or an object. + * + * @param string $id The unique identifier for the parameter or object + * + * @return mixed The value of the parameter or an object + * + * @throws UnknownIdentifierException If the identifier is not defined + */ + #[\ReturnTypeWillChange] + public function offsetGet($id) + { + if (!isset($this->keys[$id])) { + throw new UnknownIdentifierException($id); + } + + if ( + isset($this->raw[$id]) + || !\is_object($this->values[$id]) + || isset($this->protected[$this->values[$id]]) + || !\method_exists($this->values[$id], '__invoke') + ) { + return $this->values[$id]; + } + + if (isset($this->factories[$this->values[$id]])) { + return $this->values[$id]($this); + } + + $raw = $this->values[$id]; + $val = $this->values[$id] = $raw($this); + $this->raw[$id] = $raw; + + $this->frozen[$id] = true; + + return $val; + } + + /** + * Checks if a parameter or an object is set. + * + * @param string $id The unique identifier for the parameter or object + * + * @return bool + */ + #[\ReturnTypeWillChange] + public function offsetExists($id) + { + return isset($this->keys[$id]); + } + + /** + * Unsets a parameter or an object. + * + * @param string $id The unique identifier for the parameter or object + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($id) + { + if (isset($this->keys[$id])) { + if (\is_object($this->values[$id])) { + unset($this->factories[$this->values[$id]], $this->protected[$this->values[$id]]); + } + + unset($this->values[$id], $this->frozen[$id], $this->raw[$id], $this->keys[$id]); + } + } + + /** + * Marks a callable as being a factory service. + * + * @param callable $callable A service definition to be used as a factory + * + * @return callable The passed callable + * + * @throws ExpectedInvokableException Service definition has to be a closure or an invokable object + */ + public function factory($callable) + { + if (!\is_object($callable) || !\method_exists($callable, '__invoke')) { + throw new ExpectedInvokableException('Service definition is not a Closure or invokable object.'); + } + + $this->factories->attach($callable); + + return $callable; + } + + /** + * Protects a callable from being interpreted as a service. + * + * This is useful when you want to store a callable as a parameter. + * + * @param callable $callable A callable to protect from being evaluated + * + * @return callable The passed callable + * + * @throws ExpectedInvokableException Service definition has to be a closure or an invokable object + */ + public function protect($callable) + { + if (!\is_object($callable) || !\method_exists($callable, '__invoke')) { + throw new ExpectedInvokableException('Callable is not a Closure or invokable object.'); + } + + $this->protected->attach($callable); + + return $callable; + } + + /** + * Gets a parameter or the closure defining an object. + * + * @param string $id The unique identifier for the parameter or object + * + * @return mixed The value of the parameter or the closure defining an object + * + * @throws UnknownIdentifierException If the identifier is not defined + */ + public function raw($id) + { + if (!isset($this->keys[$id])) { + throw new UnknownIdentifierException($id); + } + + if (isset($this->raw[$id])) { + return $this->raw[$id]; + } + + return $this->values[$id]; + } + + /** + * Extends an object definition. + * + * Useful when you want to extend an existing object definition, + * without necessarily loading that object. + * + * @param string $id The unique identifier for the object + * @param callable $callable A service definition to extend the original + * + * @return callable The wrapped callable + * + * @throws UnknownIdentifierException If the identifier is not defined + * @throws FrozenServiceException If the service is frozen + * @throws InvalidServiceIdentifierException If the identifier belongs to a parameter + * @throws ExpectedInvokableException If the extension callable is not a closure or an invokable object + */ + public function extend($id, $callable) + { + if (!isset($this->keys[$id])) { + throw new UnknownIdentifierException($id); + } + + if (isset($this->frozen[$id])) { + throw new FrozenServiceException($id); + } + + if (!\is_object($this->values[$id]) || !\method_exists($this->values[$id], '__invoke')) { + throw new InvalidServiceIdentifierException($id); + } + + if (isset($this->protected[$this->values[$id]])) { + @\trigger_error(\sprintf('How Pimple behaves when extending protected closures will be fixed in Pimple 4. Are you sure "%s" should be protected?', $id), E_USER_DEPRECATED); + } + + if (!\is_object($callable) || !\method_exists($callable, '__invoke')) { + throw new ExpectedInvokableException('Extension service definition is not a Closure or invokable object.'); + } + + $factory = $this->values[$id]; + + $extended = function ($c) use ($callable, $factory) { + return $callable($factory($c), $c); + }; + + if (isset($this->factories[$factory])) { + $this->factories->detach($factory); + $this->factories->attach($extended); + } + + return $this[$id] = $extended; + } + + /** + * Returns all defined value names. + * + * @return array An array of value names + */ + public function keys() + { + return \array_keys($this->values); + } + + /** + * Registers a service provider. + * + * @param array $values An array of values that customizes the provider + * + * @return static + */ + public function register(ServiceProviderInterface $provider, array $values = []) + { + $provider->register($this); + + foreach ($values as $key => $value) { + $this[$key] = $value; + } + + return $this; + } +} diff --git a/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Exception/ExpectedInvokableException.php b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Exception/ExpectedInvokableException.php new file mode 100644 index 00000000..ea750766 --- /dev/null +++ b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Exception/ExpectedInvokableException.php @@ -0,0 +1,41 @@ + + */ +class ExpectedInvokableException extends \InvalidArgumentException implements ContainerExceptionInterface +{ +} diff --git a/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Exception/FrozenServiceException.php b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Exception/FrozenServiceException.php new file mode 100644 index 00000000..637165ce --- /dev/null +++ b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Exception/FrozenServiceException.php @@ -0,0 +1,48 @@ + + */ +class FrozenServiceException extends \RuntimeException implements ContainerExceptionInterface +{ + /** + * @param string $id Identifier of the frozen service + */ + public function __construct($id) + { + parent::__construct(\sprintf('Cannot override frozen service "%s".', $id)); + } +} diff --git a/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Exception/InvalidServiceIdentifierException.php b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Exception/InvalidServiceIdentifierException.php new file mode 100644 index 00000000..e5bdf1a3 --- /dev/null +++ b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Exception/InvalidServiceIdentifierException.php @@ -0,0 +1,48 @@ + + */ +class InvalidServiceIdentifierException extends \InvalidArgumentException implements NotFoundExceptionInterface +{ + /** + * @param string $id The invalid identifier + */ + public function __construct($id) + { + parent::__construct(\sprintf('Identifier "%s" does not contain an object definition.', $id)); + } +} diff --git a/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Exception/UnknownIdentifierException.php b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Exception/UnknownIdentifierException.php new file mode 100644 index 00000000..57413548 --- /dev/null +++ b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Exception/UnknownIdentifierException.php @@ -0,0 +1,48 @@ + + */ +class UnknownIdentifierException extends \InvalidArgumentException implements NotFoundExceptionInterface +{ + /** + * @param string $id The unknown identifier + */ + public function __construct($id) + { + parent::__construct(\sprintf('Identifier "%s" is not defined.', $id)); + } +} diff --git a/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Psr11/Container.php b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Psr11/Container.php new file mode 100644 index 00000000..54b924f1 --- /dev/null +++ b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Psr11/Container.php @@ -0,0 +1,58 @@ + + */ +final class Container implements ContainerInterface +{ + private $pimple; + + public function __construct(PimpleContainer $pimple) + { + $this->pimple = $pimple; + } + + public function get(string $id) + { + return $this->pimple[$id]; + } + + public function has(string $id): bool + { + return isset($this->pimple[$id]); + } +} diff --git a/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php new file mode 100644 index 00000000..a553955b --- /dev/null +++ b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php @@ -0,0 +1,78 @@ + + */ +class ServiceLocator implements ContainerInterface +{ + private $container; + private $aliases = []; + + /** + * @param PimpleContainer $container The Container instance used to locate services + * @param array $ids Array of service ids that can be located. String keys can be used to define aliases + */ + public function __construct(PimpleContainer $container, array $ids) + { + $this->container = $container; + + foreach ($ids as $key => $id) { + $this->aliases[\is_int($key) ? $id : $key] = $id; + } + } + + /** + * {@inheritdoc} + */ + public function get(string $id) + { + if (!isset($this->aliases[$id])) { + throw new UnknownIdentifierException($id); + } + + return $this->container[$this->aliases[$id]]; + } + + /** + * {@inheritdoc} + */ + public function has(string $id): bool + { + return isset($this->aliases[$id]) && isset($this->container[$this->aliases[$id]]); + } +} diff --git a/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/ServiceIterator.php b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/ServiceIterator.php new file mode 100644 index 00000000..f665483b --- /dev/null +++ b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/ServiceIterator.php @@ -0,0 +1,92 @@ + + */ +final class ServiceIterator implements \Iterator +{ + private $container; + private $ids; + + public function __construct(Container $container, array $ids) + { + $this->container = $container; + $this->ids = $ids; + } + + /** + * @return void + */ + #[\ReturnTypeWillChange] + public function rewind() + { + \reset($this->ids); + } + + /** + * @return mixed + */ + #[\ReturnTypeWillChange] + public function current() + { + return $this->container[\current($this->ids)]; + } + + /** + * @return mixed + */ + #[\ReturnTypeWillChange] + public function key() + { + return \current($this->ids); + } + + /** + * @return void + */ + #[\ReturnTypeWillChange] + public function next() + { + \next($this->ids); + } + + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function valid() + { + return null !== \key($this->ids); + } +} diff --git a/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/ServiceProviderInterface.php b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/ServiceProviderInterface.php new file mode 100644 index 00000000..4b255754 --- /dev/null +++ b/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/ServiceProviderInterface.php @@ -0,0 +1,47 @@ +versions[$versionString])) { + return false; + } + + $this->versions[$versionString] = $initializationCallback; + + return true; + } + + public function getVersions(): array + { + return $this->versions; + } + + public function latestVersion() + { + $keys = array_keys($this->versions); + if (empty($keys)) { + return false; + } + uasort($keys, 'version_compare'); + return end($keys); + } + + public function latestVersionCallback() + { + $latest = $this->latestVersion(); + if (empty($latest) || ! isset($this->versions[$latest])) { + return '__return_null'; + } + + return $this->versions[$latest]; + } + + /** + * @return Versions + * @codeCoverageIgnore + */ + public static function getInstance(): ?Versions + { + if (empty(self::$instance)) { + self::$instance = new self(); + } + + return self::$instance; + } + + /** + * @codeCoverageIgnore + */ + public static function initializeLatestVersion(): void + { + $self = self::getInstance(); + + call_user_func($self->latestVersionCallback()); + } + } +} diff --git a/lib/vendor/publishpress/psr-container/lib/autoload-classmap.php b/lib/vendor/publishpress/psr-container/lib/autoload-classmap.php new file mode 100644 index 00000000..a83ec252 --- /dev/null +++ b/lib/vendor/publishpress/psr-container/lib/autoload-classmap.php @@ -0,0 +1,12 @@ + $strauss_src . '/Versions.php', + 'PublishPress\Psr\Container\NotFoundExceptionInterface' => $strauss_src . '/psr/container/src/NotFoundExceptionInterface.php', + 'PublishPress\Psr\Container\ContainerInterface' => $strauss_src . '/psr/container/src/ContainerInterface.php', + 'PublishPress\Psr\Container\ContainerExceptionInterface' => $strauss_src . '/psr/container/src/ContainerExceptionInterface.php', +); \ No newline at end of file diff --git a/lib/vendor/publishpress/psr-container/lib/autoload.php b/lib/vendor/publishpress/psr-container/lib/autoload.php new file mode 100644 index 00000000..35b2b2fc --- /dev/null +++ b/lib/vendor/publishpress/psr-container/lib/autoload.php @@ -0,0 +1,20 @@ +register('2.0.1.10', __NAMESPACE__ . '\initialize2Dot0Dot1Dot10'); + } + } + + function initialize2Dot0Dot1Dot10() + { + require_once __DIR__ . '/autoload.php'; + + if (! defined('PUBLISHPRESS_PSR_CONTAINER_VERSION')) { + define('PUBLISHPRESS_PSR_CONTAINER_VERSION', '2.0.1.10'); + } + + do_action('publishpress_psr_container_2Dot0Dot1Dot10_initialized'); + } +} diff --git a/lib/vendor/publishpress/psr-container/lib/psr/container/src/ContainerExceptionInterface.php b/lib/vendor/publishpress/psr-container/lib/psr/container/src/ContainerExceptionInterface.php new file mode 100644 index 00000000..a171a3d7 --- /dev/null +++ b/lib/vendor/publishpress/psr-container/lib/psr/container/src/ContainerExceptionInterface.php @@ -0,0 +1,16 @@ +. + * + */ + +namespace PublishPress\WordPressBanners; + +use Exception; + +if (! defined('PP_WP_BANNERS_VERSION')) { + define('PP_WP_BANNERS_VERSION', '1.3.1'); +} + +if (! class_exists('\\PublishPress\\WordPressBanners\\BannersMain')) { + class BannersMain + { + + /** + * HTML output banner inviting to install another PublishPress plugin or advertise a feature + * + * @param string $heading Custom heading; disabled if blank + * @param string $title Custom title; disabled if blank + * @param array $content Content to display. e.g. Feature list or a single paragraph + * @param string $link Link to apply to button and image + * @param string $link_title Link title + * @param string $image A filename from assets/images/ folder; disabled if blank + * @param string $link_class Link class. e.g. 'button button-secondary' + * + * @return void + */ + public function pp_display_banner( + $heading = '', + $title = '', + $contents = array(), + $link = '', + $link_title = '', + $image = '', + $link_class = 'button pp-button-yellow' + ) { + if (! empty($heading)) { + ?> + + + +
+ + +

+ +

+ 1) { + ?> +
    + +
  • + +
  • + +
+ +

+ + +

+ + + +

+ + +
+ + + +
+ + +
+ + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The GNU General Public License is a free, copyleft license for +software and other kinds of works. + +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + +Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + +Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + +Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + +0. Definitions. + +"This License" refers to version 3 of the GNU General Public License. + +"Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + +"The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + +To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + +A "covered work" means either the unmodified Program or a work based +on the Program. + +To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + +To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + +1. Source Code. + +The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + +A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + +The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + +The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + +The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + +The Corresponding Source for a work in source code form is that +same work. + +2. Basic Permissions. + +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + +3. Protecting Users' Legal Rights From Anti-Circumvention Law. + +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + +4. Conveying Verbatim Copies. + +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + +5. Conveying Modified Source Versions. + +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + +a) The work must carry prominent notices stating that you modified +it, and giving a relevant date. + +b) The work must carry prominent notices stating that it is +released under this License and any conditions added under section +7. This requirement modifies the requirement in section 4 to +"keep intact all notices". + +c) You must license the entire work, as a whole, under this +License to anyone who comes into possession of a copy. This +License will therefore apply, along with any applicable section 7 +additional terms, to the whole of the work, and all its parts, +regardless of how they are packaged. This License gives no +permission to license the work in any other way, but it does not +invalidate such permission if you have separately received it. + +d) If the work has interactive user interfaces, each must display +Appropriate Legal Notices; however, if the Program has interactive +interfaces that do not display Appropriate Legal Notices, your +work need not make them do so. + +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + +6. Conveying Non-Source Forms. + +You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + +a) Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by the +Corresponding Source fixed on a durable physical medium +customarily used for software interchange. + +b) Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by a +written offer, valid for at least three years and valid for as +long as you offer spare parts or customer support for that product +model, to give anyone who possesses the object code either (1) a +copy of the Corresponding Source for all the software in the +product that is covered by this License, on a durable physical +medium customarily used for software interchange, for a price no +more than your reasonable cost of physically performing this +conveying of source, or (2) access to copy the +Corresponding Source from a network server at no charge. + +c) Convey individual copies of the object code with a copy of the +written offer to provide the Corresponding Source. This +alternative is allowed only occasionally and noncommercially, and +only if you received the object code with such an offer, in accord +with subsection 6b. + +d) Convey the object code by offering access from a designated +place (gratis or for a charge), and offer equivalent access to the +Corresponding Source in the same way through the same place at no +further charge. You need not require recipients to copy the +Corresponding Source along with the object code. If the place to +copy the object code is a network server, the Corresponding Source +may be on a different server (operated by you or a third party) +that supports equivalent copying facilities, provided you maintain +clear directions next to the object code saying where to find the +Corresponding Source. Regardless of what server hosts the +Corresponding Source, you remain obligated to ensure that it is +available for as long as needed to satisfy these requirements. + +e) Convey the object code using peer-to-peer transmission, provided +you inform other peers where the object code and Corresponding +Source of the work are being offered to the general public at no +charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + +A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + +"Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + +7. Additional Terms. + +"Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + +a) Disclaiming warranty or limiting liability differently from the +terms of sections 15 and 16 of this License; or + +b) Requiring preservation of specified reasonable legal notices or +author attributions in that material or in the Appropriate Legal +Notices displayed by works containing it; or + +c) Prohibiting misrepresentation of the origin of that material, or +requiring that modified versions of such material be marked in +reasonable ways as different from the original version; or + +d) Limiting the use for publicity purposes of names of licensors or +authors of the material; or + +e) Declining to grant rights under trademark law for use of some +trade names, trademarks, or service marks; or + +f) Requiring indemnification of licensors and authors of that +material by anyone who conveys the material (or modified versions of +it) with contractual assumptions of liability to the recipient, for +any liability that these contractual assumptions directly impose on +those licensors and authors. + +All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + +8. Termination. + +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + +However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + +9. Acceptance Not Required for Having Copies. + +You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + +10. Automatic Licensing of Downstream Recipients. + +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + +An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + +11. Patents. + +A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + +A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + +In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + +A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + +12. No Surrender of Others' Freedom. + +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + +13. Use with the GNU Affero General Public License. + +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + +14. Revised Versions of this License. + +The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + +15. Disclaimer of Warranty. + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. Limitation of Liability. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + +17. Interpretation of Sections 15 and 16. + +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + +If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) +This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +This is free software, and you are welcome to redistribute it +under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + +You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + +The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/lib/vendor/publishpress/wordpress-banners/assets/css/style.css b/lib/vendor/publishpress/wordpress-banners/assets/css/style.css new file mode 100644 index 00000000..754d8b28 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-banners/assets/css/style.css @@ -0,0 +1,99 @@ +/* Banner on the right inviting to install Permissions */ + +.pp-columns-wrapper.pp-enable-sidebar { + display: table; + width: 100%; +} + +.pp-columns-wrapper.pp-enable-sidebar .pp-column-left { + width: 75%; +} + +.pp-columns-wrapper.pp-enable-sidebar .pp-column-right { + width: calc( 25% - 20px ); + margin-left: 20px; +} + +.pp-columns-wrapper.pp-enable-sidebar .pp-column-left, +.pp-columns-wrapper.pp-enable-sidebar .pp-column-right { + float: left; +} + +.nav-tab-wrapper.pp-recommendations-heading { + padding-bottom: 16px; + opacity: 0.8; + margin-bottom: 25px; +} + +.pp-sidebar-box { + padding: 20px; + background: #fff; + box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.1); + border: 1px solid #dcdcdc; + font-size: 1.1em; + margin-bottom: 20px; +} + +.pp-sidebar-box h3 { + line-height: 1.2em; + margin: 0; + padding: 0; +} + +.pp-sidebar-box ul { + list-style: disc; + margin: 20px 15px 20px; + padding: 0; +} + +.pp-sidebar-box img { + max-width: 100%; +} + +.pp-sidebar-box .button { + text-align: center; + display: block; + white-space: normal; + line-height: 20px !important; + padding: 4px 10px !important; +} + +.pp-sidebar-box .button.pp-button-yellow { + background-color: #FFB300; + border-color: #C58C07; + color: #754D26; + + text-shadow: none; +} + +.pp-sidebar-box .button.pp-button-yellow:hover, +.pp-sidebar-box .button.pp-button-yellow:active, +.pp-sidebar-box .button.pp-button-yellow: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); +} + +.pp-sidebar-box .pp-box-banner-image { + background: #655997; + text-align: center; +} + +@media (max-width: 1199px) { + + .pp-columns-wrapper.pp-enable-sidebar .pp-column-left, + .pp-columns-wrapper.pp-enable-sidebar .pp-column-right { + float: none; + width: 100%; + } + + .pp-columns-wrapper.pp-enable-sidebar .pp-column-right { + margin-left: 0; + margin-bottom: 20px; + } +} diff --git a/lib/vendor/publishpress/wordpress-banners/assets/images/install-blocks.jpg b/lib/vendor/publishpress/wordpress-banners/assets/images/install-blocks.jpg new file mode 100644 index 00000000..2a90956a Binary files /dev/null and b/lib/vendor/publishpress/wordpress-banners/assets/images/install-blocks.jpg differ diff --git a/lib/vendor/publishpress/wordpress-banners/assets/images/install-capabilities.jpg b/lib/vendor/publishpress/wordpress-banners/assets/images/install-capabilities.jpg new file mode 100644 index 00000000..2dd0d628 Binary files /dev/null and b/lib/vendor/publishpress/wordpress-banners/assets/images/install-capabilities.jpg differ diff --git a/lib/vendor/publishpress/wordpress-banners/assets/images/install-permissions.jpg b/lib/vendor/publishpress/wordpress-banners/assets/images/install-permissions.jpg new file mode 100644 index 00000000..d39b4968 Binary files /dev/null and b/lib/vendor/publishpress/wordpress-banners/assets/images/install-permissions.jpg differ diff --git a/lib/vendor/publishpress/wordpress-edd-license/license.txt b/lib/vendor/publishpress/wordpress-edd-license/license.txt new file mode 100644 index 00000000..6927bfd4 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-edd-license/license.txt @@ -0,0 +1,377 @@ +WordPress Version Notices + +Copyright 2020 by the contributors + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +This program incorporates work covered by the following copyright and +permission notices: + + Edit Flow is Copyright 2009-2016 Mohammad Jangda, Daniel Bachhuber, et al. + http://editflow.org/ + Edit Flow was produced by Daniel Bachhuber, Mo Jangda, and Scott Bressler, + with special help from Andrew Spittle and Andrew Witherspoon + + Edit Flow is released under the GPL + +and + + WordPress Version Notices + + WordPress Version Notices is Copyright (c) 2020 PublishPress + + WordPress Version Notices is released under the GPL + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/lib/vendor/publishpress/wordpress-edd-license/src/Versions.php b/lib/vendor/publishpress/wordpress-edd-license/src/Versions.php new file mode 100644 index 00000000..e7e3d9c8 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-edd-license/src/Versions.php @@ -0,0 +1,85 @@ +versions[$versionString])) { + return false; + } + + $this->versions[$versionString] = $initializationCallback; + + return true; + } + + public function getVersions(): array + { + return $this->versions; + } + + public function latestVersion() + { + $keys = array_keys($this->versions); + if (empty($keys)) { + return false; + } + uasort($keys, 'version_compare'); + return end($keys); + } + + public function latestVersionCallback() + { + $latest = $this->latestVersion(); + if (empty($latest) || ! isset($this->versions[$latest])) { + return '__return_null'; + } + + return $this->versions[$latest]; + } + + /** + * @return Versions + * @codeCoverageIgnore + */ + public static function getInstance(): ?Versions + { + if (empty(self::$instance)) { + self::$instance = new self(); + } + + return self::$instance; + } + + /** + * @codeCoverageIgnore + */ + public static function initializeLatestVersion(): void + { + $self = self::getInstance(); + + call_user_func($self->latestVersionCallback()); + } + } +} diff --git a/lib/vendor/publishpress/wordpress-edd-license/src/autoload.php b/lib/vendor/publishpress/wordpress-edd-license/src/autoload.php new file mode 100644 index 00000000..802dc559 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-edd-license/src/autoload.php @@ -0,0 +1,15 @@ +. + */ + +namespace PublishPress\WordPressEDDLicense; + +// Exit if accessed directly +if (!defined('ABSPATH')) { + die('No direct script access allowed.'); +} + + +/** + * The container for dependency injection. + * + * @since 1.2.0 + * @package WordPress-EDD-License-Integration + */ +class Container extends \PublishPress\Pimple\Container +{ + +} diff --git a/lib/vendor/publishpress/wordpress-edd-license/src/classes/Exception/Generic.php b/lib/vendor/publishpress/wordpress-edd-license/src/classes/Exception/Generic.php new file mode 100644 index 00000000..e127fd31 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-edd-license/src/classes/Exception/Generic.php @@ -0,0 +1,43 @@ +. + */ +namespace PublishPress\WordPressEDDLicense\Exception; + +use Exception; + +// Exit if accessed directly +if (!defined('ABSPATH')) { + die('No direct script access allowed.'); +} + + +/** + * Generic exception. + * + * @since 1.0.0 + * @package WordPress-EDD-License-Integration + * @author PublishPress + */ +class Generic extends Exception +{ + +} diff --git a/lib/vendor/publishpress/wordpress-edd-license/src/classes/Exception/InvalidParams.php b/lib/vendor/publishpress/wordpress-edd-license/src/classes/Exception/InvalidParams.php new file mode 100644 index 00000000..55fcfecf --- /dev/null +++ b/lib/vendor/publishpress/wordpress-edd-license/src/classes/Exception/InvalidParams.php @@ -0,0 +1,44 @@ +. + */ + +namespace PublishPress\WordPressEDDLicense\Exception; + +use Exception; + +// Exit if accessed directly +if (!defined('ABSPATH')) { + die('No direct script access allowed.'); +} + + +/** + * InvalidParams exception. + * + * @since 1.0.0 + * @package WordPress-EDD-License-Integration + * @author PublishPress + */ +class InvalidParams extends Exception +{ + +} diff --git a/lib/vendor/publishpress/wordpress-edd-license/src/classes/Exception/InvalidRequest.php b/lib/vendor/publishpress/wordpress-edd-license/src/classes/Exception/InvalidRequest.php new file mode 100644 index 00000000..d3362e84 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-edd-license/src/classes/Exception/InvalidRequest.php @@ -0,0 +1,44 @@ +. + */ + +namespace PublishPress\WordPressEDDLicense\Exception; + +use Exception; + +// Exit if accessed directly +if (!defined('ABSPATH')) { + die('No direct script access allowed.'); +} + + +/** + * InvalidParams exception. + * + * @since 1.0.0 + * @package WordPress-EDD-License-Integration + * @author PublishPress + */ +class InvalidRequest extends Exception +{ + +} diff --git a/lib/vendor/publishpress/wordpress-edd-license/src/classes/Language.php b/lib/vendor/publishpress/wordpress-edd-license/src/classes/Language.php new file mode 100644 index 00000000..cf2c4ebd --- /dev/null +++ b/lib/vendor/publishpress/wordpress-edd-license/src/classes/Language.php @@ -0,0 +1,57 @@ +. + */ + +namespace PublishPress\WordPressEDDLicense; + +// Exit if accessed directly +if (!defined('ABSPATH')) { + die('No direct script access allowed.'); +} + +/** + * Class for language + */ +class Language +{ + /** + * Language constructor. + * + * @param Container $container + */ + public function __construct(Container $container) + { + $this->container = $container; + } + + /** + * Loads the textdomain for the library + */ + public function load_textdomain() + { + load_plugin_textdomain( + 'wp-edd-license-integration', + false, + basename(__DIR__) . '/languages/' + ); + } +} diff --git a/lib/vendor/publishpress/wordpress-edd-license/src/classes/License.php b/lib/vendor/publishpress/wordpress-edd-license/src/classes/License.php new file mode 100644 index 00000000..c90e7abb --- /dev/null +++ b/lib/vendor/publishpress/wordpress-edd-license/src/classes/License.php @@ -0,0 +1,365 @@ +. + */ + +namespace PublishPress\WordPressEDDLicense; + +// Exit if accessed directly +use PublishPress\WordPressEDDLicense\Exception\InvalidRequest; +use WP_Error; + +if (!defined('ABSPATH')) { + die('No direct script access allowed.'); +} + +/** + * Class for license + */ +class License +{ + /** + * Constant for missing license status + */ + const STATUS_EMPTY_LICENSE = ''; + + /** + * Constant for valid status + */ + const STATUS_VALID = 'valid'; + + /** + * Constant for expired status + */ + const STATUS_EXPIRED = 'expired'; + + /** + * Constant for revoked status + */ + const STATUS_REVOKED = 'revoked'; + + /** + * Constant for missing status + */ + const STATUS_MISSING = 'missing'; + + /** + * Constant for invalid status + */ + const STATUS_INVALID = 'invalid'; + + /** + * Constant for failed status + */ + const STATUS_FAILED = 'failed'; + + /** + * Constant for inactive status + */ + const STATUS_SITE_INACTIVE = 'site_inactive'; + + /** + * Constant for mismatch status + */ + const STATUS_ITEM_NAME_MISMATCH = 'item_name_mismatch'; + + /** + * Constant for no activations left status + */ + const STATUS_NO_ACTIVATIONS_LEFT = 'no_activations_left'; + + /** + * @var Container + */ + protected $container; + + /** + * @var string + */ + protected $eddApiUrl; + + /** + * @var array + */ + protected $messages; + + /** + * The constructor + * + * @param Container $container + */ + public function __construct(Container $container) + { + add_action('admin_head', [$this, 'adminHeadAddStyle']); + + $this->container = $container; + + $this->eddApiUrl = $this->container['API_URL']; + + $this->messages = [ + 'error-exception' => __( + 'Sorry, an error occurred. Please check the error log and contact the PublishPress support team.', + 'wp-edd-license-integration' + ), + ]; + } + + /** + * @param string $url + * @param array $body + * + * @return array|WP_Error + */ + protected function makeRequest($url, $body) + { + return wp_remote_post( + $url, + [ + 'timeout' => 30, + 'sslverify' => true, + 'body' => $body + ] + ); + } + + /** + * @return string|void + */ + protected function getHomeUrl() + { + return home_url(); + } + + /** + * @param mixed $response + * @return bool + */ + protected function isWpError($response) + { + return is_wp_error($response); + } + + /** + * @param mixed $response + * @return int|string + */ + protected function getResponseCode($response) + { + return wp_remote_retrieve_response_code($response); + } + + /** + * @param string $message + */ + protected function logError($message) + { + error_log($message); + } + + protected function getResponseDecodedJsonBody($response) + { + return json_decode(wp_remote_retrieve_body($response)); + } + + /** + * Method that validates a license key. + * + * @param string $license_key + * @param string $item_id + * + * @return mixed + */ + public function validate_license_key($license_key, $item_id) + { + $result = false; + + try { + $response = $this->makeRequest( + $this->eddApiUrl, + [ + 'edd_action' => "activate_license", + 'license' => $license_key, + 'item_id' => $item_id, + 'url' => $this->getHomeUrl(), + ] + ); + + if ($this->isWpError($response)) { + throw new InvalidRequest($response->get_error_message()); + } + + $responseCode = $this->getResponseCode($response); + if (200 !== (int)$responseCode) { + throw new InvalidRequest( + sprintf( + 'Request returned response code %d', + $responseCode + ) + ); + } + + $license_data = $this->getResponseDecodedJsonBody($response); + + if (empty($license_data) || !is_object($license_data)) { + $license_new_status = static::STATUS_INVALID; + } else { + if (isset($license_data->success) && true === $license_data->success) { + $license_new_status = static::STATUS_VALID; + } else { + if (isset($license_data->license) && static::STATUS_INVALID === $license_data->license) { + $license_new_status = static::STATUS_INVALID; + } else { + $license_new_status = isset($license_data->error) && !empty($license_data->error) ? $license_data->error : static::STATUS_INVALID; + } + } + } + + if ($license_new_status !== static::STATUS_VALID) { + $error_message = 'No message'; + + if (isset($license_data->error)) { + $error_message = $license_data->error; + } + + $this->logError( + sprintf( + '[PublishPress WordPressEDDLicense] License is set as %s. Error message: %s', + $license_new_status, + $error_message + ) + ); + } + + $result = $license_new_status; + } catch (\Exception $e) { + $this->logError( + sprintf( + '[PublishPress WordPressEDDLicense] (%d) %s at %s:%d [API_URL="%s", $item_id="%s", url="%s"]', + $e->getCode(), + $e->getMessage(), + $e->getFile(), + $e->getLine(), + $this->container['API_URL'], + $item_id, + $this->getHomeUrl() + ) + ); + + $result = $this->messages['error-exception']; + } + + return $result; + } + + public function deactivate_license_key($license_key, $item_id) + { + try { + $response = $this->makeRequest( + $this->eddApiUrl, + [ + 'edd_action' => "deactivate_license", + 'license' => $license_key, + 'item_id' => $item_id, + 'url' => $this->getHomeUrl(), + ] + ); + + if ($this->isWpError($response)) { + throw new InvalidRequest($response->get_error_message()); + } + + $responseCode = $this->getResponseCode($response); + if (200 !== (int)$responseCode) { + throw new InvalidRequest( + sprintf( + 'Request returned response code %d', + $responseCode + ) + ); + } + + $license_data = $this->getResponseDecodedJsonBody($response); + + if (empty($license_data) || !is_object($license_data)) { + $license_new_status = static::STATUS_INVALID; + + $this->logError('[PublishPress WordPressEDDLicense] Invalid response from licence server'); + } else { + if (isset($license_data->success) && true === $license_data->success) { + $license_new_status = static::STATUS_VALID; + } else { + if (isset($license_data->license) && static::STATUS_FAILED === $license_data->license) { + $license_new_status = static::STATUS_INVALID; + } else { + $license_new_status = isset($license_data->error) && !empty($license_data->error) ? $license_data->error : static::STATUS_INVALID; + } + } + } + + $result = $license_new_status; + } catch (\Exception $e) { + $this->logError( + sprintf( + '[PublishPress WordPressEDDLicense] (%d) %s at %s:%d [API_URL="%s", $item_id="%s", url="%s"]', + $e->getCode(), + $e->getMessage(), + $e->getFile(), + $e->getLine(), + $this->container['API_URL'], + $item_id, + $this->getHomeUrl() + ) + ); + + $result = $this->messages['error-exception']; + } + + return $result; + } + + /** + * Sanitize the license key, returning the clean key. + * + * @param string $license_key + * @return string + */ + public function sanitize_license_key($license_key) + { + return preg_replace('/[^a-z0-9\-_]/i', '', $license_key); + } + + public function adminHeadAddStyle() + { + ?> + + . + */ + +namespace PublishPress\WordPressEDDLicense; + +use Alledia\EDD_SL_Plugin_Updater; +use PublishPress\Pimple\ServiceProviderInterface; + +// Exit if accessed directly +if (!defined('ABSPATH')) { + die('No direct script access allowed.'); +} + +/** + * The services for the dependency injection container. + * + * @since 1.2.0 + * @package WordPress-EDD-License-Integration + * @author PublishPress + */ +class Services implements ServiceProviderInterface +{ + /** + * An instance of the ServicesConfig class. + * + * @since 1.2.0 + * @var ServicesConfig + */ + protected $config; + + /** + * The constructor. + * + * @param ServicesConfig $config + * @throws Exception\InvalidParams + * @since 1.2.0 + */ + public function __construct(ServicesConfig $config) + { + $config->validate(); + + $this->config = $config; + } + + /** + * Registers services on the given container. + * + * This method should only be used to configure services and parameters. + * It should not get services. + * + * @param \Pimple\Container $container An Container instance + */ + public function register(\PublishPress\Pimple\Container $pimple) + { + /* + * The config + */ + $pimple['config'] = function (Container $c) { + return $this->config; + }; + + /* + * + * Define the constants. + */ + $pimple['LIBRARY_VERSION'] = function (Container $c) { + return '2.3.2'; + }; + + $pimple['API_URL'] = function (Container $c) { + return $c['config']->getApiUrl(); + }; + + $pimple['LICENSE_KEY'] = function (Container $c) { + return $c['config']->getLicenseKey(); + }; + + $pimple['LICENSE_STATUS'] = function (Container $c) { + return $c['config']->getLicenseStatus(); + }; + + $pimple['PLUGIN_VERSION'] = function (Container $c) { + return $c['config']->getPluginVersion(); + }; + + $pimple['EDD_ITEM_ID'] = function (Container $c) { + return $c['config']->getEddItemId(); + }; + + $pimple['PLUGIN_AUTHOR'] = function (Container $c) { + return $c['config']->getPluginAuthor(); + }; + + $pimple['PLUGIN_FILE'] = function (Container $c) { + return $c['config']->getPluginFile(); + }; + + /* + * Define the update manager. + */ + $pimple['update_manager'] = function (Container $c) { + return new EDD_SL_Plugin_Updater( + $c['API_URL'], + $c['PLUGIN_FILE'], + [ + 'version' => $c['PLUGIN_VERSION'], + 'license' => $c['LICENSE_KEY'], + 'license_status' => $c['LICENSE_STATUS'], + 'item_id' => $c['EDD_ITEM_ID'], + 'author' => $c['PLUGIN_AUTHOR'], + ] + ); + }; + + /* + * Define the license manager. + */ + $pimple['license_manager'] = function (Container $c) { + return new License($c); + }; + + /* + * Define the language service. + */ + $pimple['language'] = function (Container $c) { + return new Language($c); + }; + } +} diff --git a/lib/vendor/publishpress/wordpress-edd-license/src/classes/ServicesConfig.php b/lib/vendor/publishpress/wordpress-edd-license/src/classes/ServicesConfig.php new file mode 100644 index 00000000..ed7faf50 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-edd-license/src/classes/ServicesConfig.php @@ -0,0 +1,253 @@ +. + */ + +namespace PublishPress\WordPressEDDLicense; + +// Exit if accessed directly +if (!defined('ABSPATH')) { + die('No direct script access allowed.'); +} + +/** + * The config data for the services. + * + * @since 1.0.0 + * @package WordPress-EDD-License-Integration + * @author PublishPress + */ +class ServicesConfig +{ + /** + * The URL for the API. + * + * @var string + */ + protected $apiUrl; + + /** + * The license key for the EDD item. + * + * @var string + */ + protected $licenseKey = ''; + + /** + * The status of the license. + * + * @var string + */ + protected $licenseStatus = ''; + + /** + * The version of the plugin integrating with this library. + * + * @var string + */ + protected $pluginVersion; + + /** + * The item id on EDD for the current plugin integrating with this library. + * + * @var string + */ + protected $eddItemId; + + /** + * The plugin's author in EDD. + * + * @var string + */ + protected $pluginAuthor; + + /** + * The plugin's file in WordPress. + * + * @var string + */ + protected $pluginFile; + + /** + * Returns true if the current attributes are valid. + * + * @return bool + * @throws Exception\InvalidParams + * @since 1.2.0 + */ + public function validate() + { + if (!isset($this->apiUrl) || empty($this->apiUrl)) { + throw new Exception\InvalidParams('Services require a non empty apiUrl attribute.'); + } + + if (!isset($this->pluginVersion) || empty($this->pluginVersion)) { + throw new Exception\InvalidParams('Services require a non empty pluginVersion attribute.'); + } + + if (!isset($this->eddItemId) || empty($this->eddItemId)) { + throw new Exception\InvalidParams('Services require a non empty eddItemId attribute.'); + } + + if (!isset($this->pluginAuthor) || empty($this->pluginAuthor)) { + throw new Exception\InvalidParams('Services require a non empty pluginAuthor attribute.'); + } + + if (!isset($this->pluginFile) || empty($this->pluginFile)) { + throw new Exception\InvalidParams('Services require a non empty pluginFile attribute.'); + } + + return true; + } + + /** + * @return string + */ + public function getApiUrl() + { + return $this->apiUrl; + } + + /** + * @param string $apiUrl + * @return ServicesConfig + */ + public function setApiUrl($apiUrl) + { + $this->apiUrl = trailingslashit($apiUrl); + + return $this; + } + + /** + * @return string + */ + public function getLicenseKey() + { + return $this->licenseKey; + } + + /** + * @param string $licenseKey + * @return ServicesConfig + */ + public function setLicenseKey($licenseKey) + { + $this->licenseKey = $licenseKey; + + return $this; + } + + /** + * @return string + */ + public function getLicenseStatus() + { + return $this->licenseStatus; + } + + /** + * @param string $licenseStatus + * @return ServicesConfig + */ + public function setLicenseStatus($licenseStatus) + { + $this->licenseStatus = $licenseStatus; + + return $this; + } + + /** + * @return string + */ + public function getPluginVersion() + { + return $this->pluginVersion; + } + + /** + * @param string $pluginVersion + * @return ServicesConfig + */ + public function setPluginVersion($pluginVersion) + { + $this->pluginVersion = $pluginVersion; + + return $this; + } + + /** + * @return string + */ + public function getEddItemId() + { + return $this->eddItemId; + } + + /** + * @param string $eddItemId + * @return ServicesConfig + */ + public function setEddItemId($eddItemId) + { + $this->eddItemId = $eddItemId; + + return $this; + } + + /** + * @return string + */ + public function getPluginAuthor() + { + return $this->pluginAuthor; + } + + /** + * @param string $pluginAuthor + * @return ServicesConfig + */ + public function setPluginAuthor($pluginAuthor) + { + $this->pluginAuthor = $pluginAuthor; + + return $this; + } + + /** + * @return string + */ + public function getPluginFile() + { + return $this->pluginFile; + } + + /** + * @param string $pluginFile + * @return ServicesConfig + */ + public function setPluginFile($pluginFile) + { + $this->pluginFile = $pluginFile; + + return $this; + } +} diff --git a/lib/vendor/publishpress/wordpress-edd-license/src/classes/Setting/Field/Base.php b/lib/vendor/publishpress/wordpress-edd-license/src/classes/Setting/Field/Base.php new file mode 100644 index 00000000..2448ba74 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-edd-license/src/classes/Setting/Field/Base.php @@ -0,0 +1,76 @@ +. + */ + +namespace PublishPress\WordPressEDDLicense\Setting\Field; + +// Exit if accessed directly +if (!defined('ABSPATH')) { + die('No direct script access allowed.'); +} + + +class Base +{ + /** + * The value for this field + * + * @var string + */ + protected $value = ''; + + /** + * The constructor + * + * @param array $args { + * @type string $options_group_name The name for the field + * @type string $name The name for the field + * @type string $id The name for the field + * @type string $value The value for the field + * @type string $class The CSS class for the field + * @type string $placeholder The CSS class for the field + * } + */ + public function __construct($args) + { + $defaults = [ + 'options_group_name' => 'myplugin', + 'name' => 'myfield', + 'id' => null, + 'value' => '', + 'class' => '', + 'placeholder' => '', + ]; + $args = wp_parse_args($args, $defaults); + + if (!isset($args['id']) || is_null($args['id']) || false === $args['id']) { + $args['id'] = $args['name']; + } + + $this->options_group_name = $args['options_group_name']; + $this->name = $args['name']; + $this->id = $args['id']; + $this->value = $args['value']; + $this->class = $args['class']; + $this->placeholder = $args['placeholder']; + } +} diff --git a/lib/vendor/publishpress/wordpress-edd-license/src/classes/Setting/Field/License_key.php b/lib/vendor/publishpress/wordpress-edd-license/src/classes/Setting/Field/License_key.php new file mode 100644 index 00000000..7d38a8ef --- /dev/null +++ b/lib/vendor/publishpress/wordpress-edd-license/src/classes/Setting/Field/License_key.php @@ -0,0 +1,208 @@ +. + */ + +namespace PublishPress\WordPressEDDLicense\Setting\Field; + +use PublishPress\WordPressEDDLicense\License; + +// Exit if accessed directly +if (!defined('ABSPATH')) { + die('No direct script access allowed.'); +} + + +class License_key extends Base +{ + /** + * @var string + */ + protected $options_group_name; + + /** + * @var string + */ + protected $name; + + /** + * @var string + */ + protected $id; + + /** + * @var string + */ + protected $class; + + /** + * @var string + */ + protected $value; + + /** + * @var string + */ + protected $license_status = ''; + + /** + * @var string + */ + protected $link_more_info = ''; + + /** + * The constructor + * + * @param array $args { + * @type string $options_group_name The options group name for the field + * @type string $name The name for the field + * @type string $id The id for the field + * @type string $value The value for the field + * @type string $class The CSS class for the field + * @type string $license_status The value for the field + * @type string $link_more_info The link for more info + * } + */ + public function __construct($args) + { + parent::__construct($args); + + $defaults = [ + 'options_group_name' => '', + 'name' => '', + 'id' => '', + 'value' => '', + 'class' => '', + 'license_status' => License::STATUS_EMPTY_LICENSE, + 'link_more_info' => '', + ]; + + $args = wp_parse_args($args, $defaults); + + $this->options_group_name = $args['options_group_name']; + $this->name = $args['name']; + $this->id = $args['id']; + $this->value = $args['value']; + $this->class = $args['class']; + $this->license_status = $args['license_status']; + $this->link_more_info = $args['link_more_info']; + } + + /** + * Returns a string version of this class, with the HTML code for the + * field. + * + * @return string + */ + public function __toString() + { + $license_status_class = "pp-wp-edd-license-label-danger"; + $license_status_icon_class = "dashicons-warning"; + + switch ($this->license_status) { + case License::STATUS_EMPTY_LICENSE: + $license_status_message = __("Missing license", 'wp-edd-license-integration'); + break; + case License::STATUS_EXPIRED: + $license_status_message = __("Your license key is expired", 'wp-edd-license-integration'); + break; + case License::STATUS_REVOKED: + $license_status_message = __("Your license key has been disabled", 'wp-edd-license-integration'); + break; + case License::STATUS_MISSING: + case License::STATUS_INVALID: + $license_status_message = __("Invalid license", 'wp-edd-license-integration'); + break; + case License::STATUS_SITE_INACTIVE: + $license_status_message = __("Your license is not active for this URL", 'wp-edd-license-integration'); + break; + case License::STATUS_ITEM_NAME_MISMATCH: + $license_status_message = __( + "This appears to be an invalid license key for this product", + 'wp-edd-license-integration' + ); + break; + case License::STATUS_NO_ACTIVATIONS_LEFT: + $license_status_message = __( + "Your license key has reached its activation limit", + 'wp-edd-license-integration' + ); + break; + case License::STATUS_VALID: + $license_status_class = "pp-wp-edd-license-label-success"; + $license_status_icon_class = "dashicons-yes"; + $license_status_message = __("Activated", 'wp-edd-license-integration'); + break; + default: + $license_status_message = $this->license_status; + break; + } + + $replaces = [ + '{{ name }}' => $this->name, + '{{ id }}' => $this->id, + '{{ value }}' => $this->value, + '{{ class }}' => $this->class, + '{{ status_icon_class }}' => $license_status_icon_class, + '{{ status_class }}' => $license_status_class, + '{{ options_group_name }}' => $this->options_group_name, + '{{ link_more_info }}' => $this->link_more_info, + '{{ lang_status }}' => __('Status', 'wp-edd-license-integration'), + '{{ lang_status_message }}' => $license_status_message, + '{{ lang_click_here_read_more }}' => __( + 'Click here to read more about licenses.', + 'wp-edd-license-integration' + ), + '{{ lang_more_info }}' => __('More information', 'wp-edd-license-integration'), + ]; + + return str_replace( + array_keys($replaces), + array_values($replaces), + $this->get_template() + ); + } + + /** + * Returns the field HTML template. + * + * @return string + */ + protected function get_template() + { + $html = '
'; + $html .= ''; + $html .= '
' . esc_html__('Enter the license key for being able to update the plugin.', + 'publishpress-pro') . '
'; + $html .= '

'; + $html .= '{{ lang_status }}: {{ lang_status_message }}'; + $html .= '

'; + + if (!License::STATUS_VALID === $this->license_status) { + $html .= '{{ lang_more_info }}'; + $html .= '

'; + } + + $html .= '
'; + + return $html; + } +} diff --git a/lib/vendor/publishpress/wordpress-edd-license/src/classes/Setting/Field/Text.php b/lib/vendor/publishpress/wordpress-edd-license/src/classes/Setting/Field/Text.php new file mode 100644 index 00000000..edf7587f --- /dev/null +++ b/lib/vendor/publishpress/wordpress-edd-license/src/classes/Setting/Field/Text.php @@ -0,0 +1,62 @@ +. + */ + +namespace PublishPress\WordPressEDDLicense\Setting\Field; + +// Exit if accessed directly +if (!defined('ABSPATH')) { + die('No direct script access allowed.'); +} + + +class Text extends Base +{ + /** + * Returns a string version of this class, with the HTML code for the + * field. + * + * @return string + */ + public function __toString() + { + return vsprintf( + $this->get_template(), + [ + sprintf('[%s][%s]', $this->options_group_name, $this->name), + sprintf('%s-%s', $this->options_group_name, $this->id), + $this->value, + $this->placeholder, + ] + ); + } + + /** + * Returns the field HTML template. + * + * @return string + */ + protected function get_template() + { + return ''; + } +} diff --git a/lib/vendor/publishpress/wordpress-edd-license/src/include.php b/lib/vendor/publishpress/wordpress-edd-license/src/include.php new file mode 100644 index 00000000..331175a2 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-edd-license/src/include.php @@ -0,0 +1,50 @@ +register('3.0.1', __NAMESPACE__ . '\initialize3Dot0Dot1'); + } + } + + function initialize3Dot0Dot1() + { + require_once __DIR__ . '/autoload.php'; + + if (! defined('PUBLISHPRESS_WORDPRESS_EDD_LICENSE_VERSION')) { + define('PUBLISHPRESS_WORDPRESS_EDD_LICENSE_VERSION', '3.0.1'); + } + + do_action('publishpress_wordpress_edd_license_3Dot0Dot1_initialized'); + } +} diff --git a/lib/vendor/publishpress/wordpress-edd-license/src/languages/wp-edd-license-integration.mo b/lib/vendor/publishpress/wordpress-edd-license/src/languages/wp-edd-license-integration.mo new file mode 100644 index 00000000..385172ed Binary files /dev/null and b/lib/vendor/publishpress/wordpress-edd-license/src/languages/wp-edd-license-integration.mo differ diff --git a/lib/vendor/publishpress/wordpress-edd-license/src/languages/wp-edd-license-integration.po b/lib/vendor/publishpress/wordpress-edd-license/src/languages/wp-edd-license-integration.po new file mode 100644 index 00000000..906baff6 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-edd-license/src/languages/wp-edd-license-integration.po @@ -0,0 +1,14 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2017-04-30 15:20-0300\n" +"PO-Revision-Date: 2017-04-30 15:22-0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.1\n" +"X-Poedit-Basepath: .\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: en_GB\n" diff --git a/lib/vendor/publishpress/wordpress-reviews/LICENSE b/lib/vendor/publishpress/wordpress-reviews/LICENSE new file mode 100644 index 00000000..f288702d --- /dev/null +++ b/lib/vendor/publishpress/wordpress-reviews/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/lib/vendor/publishpress/wordpress-reviews/ReviewsController.php b/lib/vendor/publishpress/wordpress-reviews/ReviewsController.php new file mode 100644 index 00000000..1d4445a3 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-reviews/ReviewsController.php @@ -0,0 +1,706 @@ +. + * + * --------------------------------------------------------------------- + * It includes: + * - Multiple trigger groups which can be ordered by priority. + * - Multiple triggers per group. + * - Customizable messaging per trigger. + * - Link to review page. + * - Request reviews on a per-user basis rather than per site. + * - Allows each user to dismiss it until later or permanently seamlessly via AJAX. + * - Integrates with attached tracking server to keep anonymous records of each trigger's effectiveness. + * - Tracking Server API: https://gist.github.com/danieliser/0d997532e023c46d38e1bdfd50f38801 + * + * Original Author: danieliser + * Original Author URL: https://danieliser.com + * URL: https://github.com/danieliser/WP-Product-In-Dash-Review-Requests + */ + +namespace PublishPress\WordPressReviews; + +use Exception; + +/** + * Class ReviewsController + * + * @package PublishPress\WordPressReviews + */ +class ReviewsController +{ + /** + * @var string + */ + private $pluginSlug; + + /** + * @var string + */ + private $pluginName; + + /** + * @var array + */ + private $metaMap; + + /** + * @var string + */ + private $iconUrl; + + /** + * @param string $pluginSlug + * @param string $pluginName + * @param string $iconUrl + */ + public function __construct($pluginSlug, $pluginName, $iconUrl = '') + { + $this->pluginSlug = $pluginSlug; + $this->pluginName = $pluginName; + $this->iconUrl = esc_url_raw($iconUrl); + + /** + * Filter to replace the meta map with options, filters and actions names. + * + * @param array + * + * @return array + */ + $this->metaMap = apply_filters( + "{$pluginSlug}_wp_reviews_meta_map", + [ + 'action_ajax_handler' => "{$this->pluginSlug}_action", + 'option_installed_on' => "{$this->pluginSlug}_wp_reviews_installed_on", + 'nonce_action' => "{$this->pluginSlug}_wp_reviews_action", + 'user_meta_dismissed_triggers' => "_{$this->pluginSlug}_wp_reviews_dismissed_triggers", + 'user_meta_last_dismissed' => "_{$this->pluginSlug}_wp_reviews_last_dismissed", + 'user_meta_already_did' => "_{$this->pluginSlug}_wp_reviews_already_did", + 'filter_triggers' => "{$this->pluginSlug}_wp_reviews_triggers", + ] + ); + + /** + * Legacy filter to replace the meta map with options, filters and actions names. + * + * @param array + * @return array + * @deprecated 1.1.9 + * + */ + $this->metaMap = apply_filters( + "publishpress_wp_reviews_meta_map_{$this->pluginSlug}", + $this->metaMap + ); + + add_action('admin_enqueue_scripts', [$this, 'enqueueStyle']); + } + + /** + * Initialize the library. + */ + public function init() + { + $this->addHooks(); + } + + /** + * Hook into relevant WP actions. + */ + private function addHooks() + { + if (defined('DOING_AJAX') && DOING_AJAX) { + add_action("wp_ajax_{$this->metaMap['action_ajax_handler']}", [$this, 'ajaxHandler']); + } + + if ($this->screenIsAllowedToDisplayNotice()) { + $this->installationPath(); + add_action('admin_notices', [$this, 'renderAdminNotices']); + add_action('network_admin_notices', [$this, 'renderAdminNotices']); + add_action('user_admin_notices', [$this, 'renderAdminNotices']); + } + } + + /** + * @return bool + */ + private function screenIsAllowedToDisplayNotice() + { + $displayNotice = is_admin(); + + /** + * Deprecated filter to specify a custom conditional to display or not the notice. + * + * @param bool + * @return bool + * @deprecated 1.1.9 + * + */ + $displayNotice = apply_filters( + "publishpress_wp_reviews_display_banner_{$this->pluginSlug}", + $displayNotice + ); + + /** + * Filter to specify a custom conditional to display or not the notice. + * + * @param bool + * + * @return bool + */ + $displayNotice = apply_filters("{$this->pluginSlug}_wp_reviews_allow_display_notice", $displayNotice); + + if (! $this->currentUserIsAdministrator()) { + $displayNotice = false; + } + + return $displayNotice; + } + + private function currentUserIsAdministrator() + { + $currentUser = get_current_user_id(); + $currentUser = get_user_by('ID', $currentUser); + + if (empty($currentUser) || ! is_object($currentUser) && is_wp_error($currentUser)) { + return false; + } + + return in_array('administrator', $currentUser->roles); + } + + /** + * Get the installation date for comparisons. Sets the date to now if none is found. + * + * @return false|string + */ + public function installationPath() + { + $installationPath = get_option($this->metaMap['option_installed_on'], false); + + if (! $installationPath) { + $installationPath = current_time('mysql'); + update_option($this->metaMap['option_installed_on'], $installationPath); + } + + return $installationPath; + } + + /** + * The function called by the ajax request. + */ + public function ajaxHandler() + { + $args = wp_parse_args( + $_REQUEST, + [ + 'group' => $this->getTriggerGroup(), + 'code' => $this->getTriggerCode(), + 'priority' => $this->getCurrentTrigger('priority'), + 'reason' => 'maybe_later', + ] + ); + + if (! wp_verify_nonce($_REQUEST['nonce'], $this->metaMap['nonce_action'])) { + wp_send_json_error(); + } + + try { + $userId = get_current_user_id(); + + $dismissedTriggers = $this->getDismissedTriggerGroups(); + $dismissedTriggers[$args['group']] = (int)$args['priority']; + + update_user_meta($userId, $this->metaMap['user_meta_dismissed_triggers'], $dismissedTriggers); + update_user_meta($userId, $this->metaMap['user_meta_last_dismissed'], current_time('mysql')); + + switch ($args['reason']) { + case 'maybe_later': + update_user_meta($userId, $this->metaMap['user_meta_last_dismissed'], current_time('mysql')); + break; + case 'am_now': + case 'already_did': + $this->setUserAlreadyDid($userId); + break; + } + + wp_send_json_success(); + } catch (Exception $e) { + wp_send_json_error($e); + } + } + + /** + * Get the trigger group. + * + * @return int|string + */ + private function getTriggerGroup() + { + static $selected; + + if (! isset($selected)) { + $selected = []; + } + + if (! array_key_exists($this->pluginSlug, $selected)) { + $dismissedTriggers = $this->getDismissedTriggerGroups(); + + $triggers = $this->getTriggers(); + + foreach ($triggers as $g => $group) { + foreach ($group['triggers'] as $trigger) { + if ( + ! in_array( + false, + $trigger['conditions'] + ) && (empty($dismissedTriggers[$g]) || $dismissedTriggers[$g] < $trigger['priority']) + ) { + $selected[$this->pluginSlug] = $g; + break; + } + } + + if (array_key_exists($this->pluginSlug, $selected)) { + break; + } + } + } + + return $selected[$this->pluginSlug]; + } + + /** + * Returns an array of dismissed trigger groups. + * + * Array contains the group key and highest priority trigger that has been shown previously for each group. + * + * $return = array( + * 'group1' => 20 + * ); + * + * @return array|mixed + */ + private function getDismissedTriggerGroups() + { + $userId = get_current_user_id(); + + $dismissedTriggers = get_user_meta($userId, $this->metaMap['user_meta_dismissed_triggers'], true); + + if (! $dismissedTriggers) { + $dismissedTriggers = []; + } + + return $dismissedTriggers; + } + + /** + * Gets a list of triggers. + * + * @param null $group + * @param null $code + * + * @return bool|mixed|void + */ + private function getTriggers($group = null, $code = null) + { + static $triggers; + + if (! isset($triggers)) { + $triggers = []; + } + + if (! array_key_exists($this->pluginSlug, $triggers)) { + $timeMessage = __( + 'Hey, you\'ve been using %1$s for %2$s on your site. We hope the plugin has been useful. Please could you quickly leave a 5-star rating on WordPress.org? It really does help to keep %1$s growing.', + $this->pluginSlug + ); + + $triggers[$this->pluginSlug] = apply_filters( + $this->metaMap['filter_triggers'], + [ + 'time_installed' => [ + 'triggers' => [ + 'one_week' => [ + 'message' => sprintf($timeMessage, $this->pluginName, __('1 week', $this->pluginSlug)), + 'conditions' => [ + strtotime($this->installationPath() . ' +1 week') < time(), + ], + 'link' => "https://wordpress.org/support/plugin/{$this->pluginSlug}/reviews/?rate=5#rate-response", + 'priority' => 10, + ], + 'one_month' => [ + 'message' => sprintf($timeMessage, $this->pluginName, __('1 month', $this->pluginSlug)), + 'conditions' => [ + strtotime($this->installationPath() . ' +1 month') < time(), + ], + 'link' => "https://wordpress.org/support/plugin/{$this->pluginSlug}/reviews/?rate=5#rate-response", + 'priority' => 20, + ], + 'three_months' => [ + 'message' => sprintf( + $timeMessage, + $this->pluginName, + __('3 months', $this->pluginSlug) + ), + 'conditions' => [ + strtotime($this->installationPath() . ' +3 months') < time(), + ], + 'link' => "https://wordpress.org/support/plugin/{$this->pluginSlug}/reviews/?rate=5#rate-response", + 'priority' => 30, + ], + ], + 'priority' => 10, + ], + ] + ); + + // Sort Groups + uasort($triggers[$this->pluginSlug], [$this, 'rsortByPriority']); + + // Sort each groups triggers. + foreach ($triggers[$this->pluginSlug] as $v) { + uasort($v['triggers'], [$this, 'rsortByPriority']); + } + } + + if (isset($group)) { + if (! array_key_exists($this->pluginSlug, $triggers) + || ! array_key_exists($group, $triggers[$this->pluginSlug])) { + return false; + } + + if (! isset($code)) { + $return = $triggers[$this->pluginSlug][$group]; + } elseif (array_key_exists($code, $triggers[$this->pluginSlug][$group]['triggers'])) { + $return = $triggers[$this->pluginSlug][$group]['triggers'][$code]; + } else { + $return = false; + } + + return $return; + } + + return $triggers[$this->pluginSlug]; + } + + /** + * @return int|string + */ + private function getTriggerCode() + { + static $selected; + + if (! isset($selected)) { + $selected = []; + } + + if (! array_key_exists($this->pluginSlug, $selected)) { + $dismissedTriggers = $this->getDismissedTriggerGroups(); + + foreach ($this->getTriggers() as $g => $group) { + foreach ($group['triggers'] as $t => $trigger) { + if ( + ! in_array( + false, + $trigger['conditions'] + ) && (empty($dismissedTriggers[$g]) || $dismissedTriggers[$g] < $trigger['priority']) + ) { + $selected[$this->pluginSlug] = $t; + break; + } + } + + if (array_key_exists($this->pluginSlug, $selected)) { + break; + } + } + } + + if (! array_key_exists($this->pluginSlug, $selected)) { + return false; + } + + return $selected[$this->pluginSlug]; + } + + /** + * @param null $key + * + * @return bool|mixed|void + */ + private function getCurrentTrigger($key = null) + { + $group = $this->getTriggerGroup(); + $code = $this->getTriggerCode(); + + if (! $group || ! $code) { + return false; + } + + $trigger = $this->getTriggers($group, $code); + + if (empty($key)) { + $return = $trigger; + } elseif (array_key_exists($key, $trigger)) { + $return = $trigger[$key]; + } else { + $return = false; + } + + return $return; + } + + /** + * @param $userId + */ + private function setUserAlreadyDid($userId) + { + update_user_meta($userId, $this->metaMap['user_meta_already_did'], true); + } + + public function enqueueStyle() + { + if (! $this->screenIsAllowedToDisplayNotice()) { + return; + } + + wp_register_style('publishpress_wordpress_reviews_style', false); + wp_enqueue_style('publishpress_wordpress_reviews_style'); + wp_add_inline_style( + 'publishpress_wordpress_reviews_style', + " + .{$this->pluginSlug}-wp-reviews-notice .button, + .{$this->pluginSlug}-wp-reviews-notice p { + font-size: 15px; + } + + .{$this->pluginSlug}-wp-reviews-notice .button:not(.notice-dismiss) { + border-width: 1px; + } + + .{$this->pluginSlug}-wp-reviews-notice .button.button-primary { + background-color: #655897; + border-color: #3d355c; + color: #fff; + } + + .{$this->pluginSlug}-wp-reviews-notice .notice-icon { + float: right; + height: 110px; + margin-top: 10px; + margin-left: 10px; + } + + @media (min-width:1000px) { + .{$this->pluginSlug}-wp-reviews-notice .notice-icon { + height: 90px; + } + } + + @media (min-width:1700px) { + .{$this->pluginSlug}-wp-reviews-notice .notice-icon { + height: 70px; + } + } + " + ); + } + + /** + * Render admin notices if available. + */ + public function renderAdminNotices() + { + if ($this->hideNotices()) { + return; + } + + $group = $this->getTriggerGroup(); + $code = $this->getTriggerCode(); + $priority = $this->getCurrentTrigger('priority'); + $trigger = $this->getCurrentTrigger(); + + // Used to anonymously distinguish unique site+user combinations in terms of effectiveness of each trigger. + $uuid = wp_hash(home_url() . '-' . get_current_user_id()); + + ?> + + + + + userSelectedAlreadyDid(), + $this->lastDismissedDate() && strtotime($this->lastDismissedDate() . ' +2 weeks') > time(), + empty($this->getTriggerCode()), + ]; + + return in_array(true, $conditions); + } + + /** + * Returns true if the user has opted to never see this again. + * + * @return bool + */ + private function userSelectedAlreadyDid() + { + $userId = get_current_user_id(); + + return (bool)get_user_meta($userId, $this->metaMap['user_meta_already_did'], true); + } + + /** + * Gets the last dismissed date. + * + * @return false|string + */ + private function lastDismissedDate() + { + $userId = get_current_user_id(); + + return get_user_meta($userId, $this->metaMap['user_meta_last_dismissed'], true); + } + + /** + * Sort array by priority value + * + * @param $a + * @param $b + * + * @return int + */ + public function sortByPriority($a, $b) + { + if (! isset($a['priority']) || ! isset($b['priority']) || $a['priority'] === $b['priority']) { + return 0; + } + + return ($a['priority'] < $b['priority']) ? -1 : 1; + } + + /** + * Sort array in reverse by priority value + * + * @param $a + * @param $b + * + * @return int + */ + public function rsortByPriority($a, $b) + { + if (! isset($a['priority']) || ! isset($b['priority']) || $a['priority'] === $b['priority']) { + return 0; + } + + return ($a['priority'] < $b['priority']) ? 1 : -1; + } +} diff --git a/lib/vendor/publishpress/wordpress-version-notices/includes.php b/lib/vendor/publishpress/wordpress-version-notices/includes.php new file mode 100644 index 00000000..5c8b9f4a --- /dev/null +++ b/lib/vendor/publishpress/wordpress-version-notices/includes.php @@ -0,0 +1,25 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @package PublishPress\WordpressVersionNotices + * @category Core + * @author PublishPress + * @copyright Copyright (c) 2020 PublishPress. All rights reserved. + * @deprecated 2.0.2 Use src/include.php instead + **/ diff --git a/lib/vendor/publishpress/wordpress-version-notices/license.txt b/lib/vendor/publishpress/wordpress-version-notices/license.txt new file mode 100644 index 00000000..6927bfd4 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-version-notices/license.txt @@ -0,0 +1,377 @@ +WordPress Version Notices + +Copyright 2020 by the contributors + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +This program incorporates work covered by the following copyright and +permission notices: + + Edit Flow is Copyright 2009-2016 Mohammad Jangda, Daniel Bachhuber, et al. + http://editflow.org/ + Edit Flow was produced by Daniel Bachhuber, Mo Jangda, and Scott Bressler, + with special help from Andrew Spittle and Andrew Witherspoon + + Edit Flow is released under the GPL + +and + + WordPress Version Notices + + WordPress Version Notices is Copyright (c) 2020 PublishPress + + WordPress Version Notices is released under the GPL + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/lib/vendor/publishpress/wordpress-version-notices/src/Autoloader.php b/lib/vendor/publishpress/wordpress-version-notices/src/Autoloader.php new file mode 100644 index 00000000..72c98d39 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-version-notices/src/Autoloader.php @@ -0,0 +1,51 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @package PublishPress\WordpressVersionNotices + * @category Core + * @author PublishPress + * @copyright Copyright (c) 2020 PublishPress. All rights reserved. + **/ + +namespace PublishPress\WordpressVersionNotices\Module; + +interface AdInterface +{ + public function init(); + + /** + * @param string $message + * @param string $linkURL + */ + public function display($message = '', $linkURL = ''); +} diff --git a/lib/vendor/publishpress/wordpress-version-notices/src/Module/MenuLink/Module.php b/lib/vendor/publishpress/wordpress-version-notices/src/Module/MenuLink/Module.php new file mode 100644 index 00000000..a4a3d872 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-version-notices/src/Module/MenuLink/Module.php @@ -0,0 +1,230 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @package PublishPress\WordpressVersionNotices + * @category Core + * @author PublishPress + * @copyright Copyright (c) 2020 PublishPress. All rights reserved. + **/ + +namespace PublishPress\WordpressVersionNotices\Module\MenuLink; + +use PublishPress\WordpressVersionNotices\Template\TemplateLoaderInterface; + +/** + * Class Module + * + * @package PublishPress\WordpressVersionNotices + */ +class Module +{ + const SETTINGS_FILTER = 'pp_version_notice_menu_link_settings'; + + const STYLE_HANDLE = 'pp-version-notice-menu-link-style'; + + const MENU_SLUG_SUFFIX = '-menu-upgrade-link'; + + /** + * @var TemplateLoaderInterface + */ + private $templateLoader; + + /** + * @var array + */ + private $globalSettings = []; + + /** + * @var array + */ + private $urlsMap = []; + + public function __construct(TemplateLoaderInterface $templateLoader) + { + $this->templateLoader = $templateLoader; + } + + public function init() + { + add_action('admin_head', [$this, 'adminHeadAddStyle']); + add_action('init', [$this, 'collectTheSettings'], 5); + add_action('admin_menu', [$this, 'addMenuLink'], 20); + add_action('admin_print_scripts', [$this, 'setUpgradeMenuLink'], 9999); + } + + public function collectTheSettings() + { + if (is_admin()) { + $this->globalSettings = apply_filters(self::SETTINGS_FILTER, []); + } + } + + public function adminHeadAddStyle() + { + ?> + + templateLoader; + + foreach ($this->globalSettings as $pluginName => $settings) { + if (is_array($settings['parent'])) { + foreach ($settings['parent'] as $parent) { + $menuPageURL = menu_page_url($parent, false); + + if (!empty($menuPageURL)) { + $settings['parent'] = $parent; + + break; + } + } + } + + if (!empty($settings['parent'])) { + $submenuSlug = $this->getSubmenuSlug($settings); + + add_submenu_page( + $settings['parent'], + $settings['label'], + $settings['label'], + 'read', + $submenuSlug, + function () use ($settings, $templateLoader) { + $context = [ + 'message' => __( + 'Amazing! We are redirecting you to our site...', + 'wordpress-version-notices' + ), + 'link' => $settings['link'] + ]; + + $templateLoader->displayOutput('menu-link', 'redirect-page', $context); + }, + 9999 + ); + + $this->urlsMap[$pluginName] = [ + 'slug' => $submenuSlug, + 'localUrl' => menu_page_url($submenuSlug, false), + 'redirectTo' => $settings['link'], + ]; + + // Add the CSS class to change the item color and add a reference to the respective URL. + $newItemIndex = false; + if (isset($submenu[$settings['parent']])) { + $newItemIndex = $this->getUpgradeMenuItemIndex($submenu[$settings['parent']], $settings); + } + + if (false !== $newItemIndex) { + $submenu[$settings['parent']][$newItemIndex][4] = 'pp-version-notice-upgrade-menu-item ' . $pluginName; + } + } + } + } + + private function getUpgradeMenuItemIndex($submenuItems, $settings) + { + if (!is_array($submenuItems)) { + return false; + } + + foreach ($submenuItems as $index => $item) { + if ($item[0] === $settings['label'] && $item[2] === $this->getSubmenuSlug($settings)) { + return $index; + } + } + + return false; + } + + public function setUpgradeMenuLink() + { + if (empty($this->urlsMap)) { + return; + } + + $convertedUrlsMap = []; + + foreach ($this->urlsMap as $pluginName => $urlData) { + $urlData['pluginName'] = $pluginName; + + $convertedUrlsMap[] = $urlData; + } + + $context = [ + 'convertedUrlsMap' => $convertedUrlsMap, + ]; + + $this->templateLoader->displayOutput('menu-link', 'menu-link-script', $context); + } +} diff --git a/lib/vendor/publishpress/wordpress-version-notices/src/Module/TopNotice/Module.php b/lib/vendor/publishpress/wordpress-version-notices/src/Module/TopNotice/Module.php new file mode 100644 index 00000000..d103be86 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-version-notices/src/Module/TopNotice/Module.php @@ -0,0 +1,228 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @package PublishPress\WordpressVersionNotices + * @category Core + * @author PublishPress + * @copyright Copyright (c) 2020 PublishPress. All rights reserved. + **/ + +namespace PublishPress\WordpressVersionNotices\Module\TopNotice; + +use PublishPress\WordpressVersionNotices\Module\AdInterface; +use PublishPress\WordpressVersionNotices\Template\TemplateInvalidArgumentsException; +use PublishPress\WordpressVersionNotices\Template\TemplateLoaderInterface; + +/** + * Class Module + * + * @package PublishPress\WordpressVersionNotices + */ +class Module implements AdInterface +{ + const SETTINGS_FILTER = 'pp_version_notice_top_notice_settings'; + + const DISPLAY_ACTION = 'pp_version_notice_display_top_notice'; + + /** + * @var TemplateLoaderInterface + */ + private $templateLoader; + + /** + * @var array + */ + private $exceptions = []; + + /** + * @var array + */ + private $settings = []; + + public function __construct(TemplateLoaderInterface $templateLoader) + { + $this->templateLoader = $templateLoader; + } + + public function init() + { + add_action(self::DISPLAY_ACTION, [$this, 'display'], 10, 2); + add_action('in_admin_header', [$this, 'displayTopNotice']); + add_action('admin_init', [$this, 'collectTheSettings'], 5); + add_action('admin_head', [$this, 'adminHeadAddStyle']); + } + + public function collectTheSettings() + { + $this->settings = apply_filters(self::SETTINGS_FILTER, []); + } + + /** + * @param string $message + * @param string $linkURL + */ + public function display($message = '', $linkURL = '') + { + try { + if (empty($message) || empty($linkURL)) { + throw new TemplateInvalidArgumentsException(); + } + + $context = [ + 'message' => $message, + 'linkURL' => $linkURL + ]; + + $this->templateLoader->displayOutput('top-notice', 'notice', $context); + } catch (\Exception $e) { + if (defined('WP_DEBUG') && WP_DEBUG) { + $this->exceptions[] = $e->getMessage(); + + add_action('admin_notices', [$this, 'showNoticeWithException']); + } + } + } + + /** + * @return array|false + */ + private function isValidScreen() + { + $screen = get_current_screen(); + + if (!empty($screen)) { + foreach ($this->settings as $pluginName => $setting) { + if (!is_array($setting) || !isset($setting['screens'])) { + continue; + } + + foreach ($setting['screens'] as $screenParams) { + if ($screenParams === true) { + return $setting; + } + + $validVars = 0; + foreach ($screenParams as $var => $value) { + if (isset($screen->$var) && $screen->$var === $value) { + $validVars++; + } + } + + if ($validVars === count($screenParams)) { + return $setting; + } + } + } + } + + return false; + } + + public function adminHeadAddStyle() + { + if (! $this->isValidScreen()) { + return; + } + + ?> + + isValidScreen()) { + do_action(self::DISPLAY_ACTION, $settings['message'], $settings['link']); + } + } + + public function showNoticeWithException() + { + $class = 'notice notice-error'; + $message = implode("
", $this->exceptions); + + printf('

%2$s

', esc_attr($class), esc_html($message)); + } +} diff --git a/lib/vendor/publishpress/wordpress-version-notices/src/ServicesProvider.php b/lib/vendor/publishpress/wordpress-version-notices/src/ServicesProvider.php new file mode 100644 index 00000000..849d1fc1 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-version-notices/src/ServicesProvider.php @@ -0,0 +1,54 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @package PublishPress\WordpressVersionNotices + * @category Core + * @author PublishPress + * @copyright Copyright (c) 2020 PublishPress. All rights reserved. + **/ + +namespace PublishPress\WordpressVersionNotices; + +use PublishPress\Pimple\Container; +use PublishPress\Pimple\ServiceProviderInterface; +use PublishPress\WordpressVersionNotices\Module\TopNotice\Module as TopNoticeModule; +use PublishPress\WordpressVersionNotices\Module\MenuLink\Module as MenuLinkModule; +use PublishPress\WordpressVersionNotices\Template\TemplateLoader; + +class ServicesProvider implements ServiceProviderInterface +{ + public function register(Container $pimple) + { + $pimple['TEMPLATES_PATH'] = function (Container $c) { + return PP_VERSION_NOTICES_BASE_PATH . '/templates'; + }; + + $pimple['module_top_notice'] = function (Container $c) { + return new TopNoticeModule($c['template_loader']); + }; + + $pimple['module_menu_link'] = function (Container $c) { + return new MenuLinkModule($c['template_loader']); + }; + + $pimple['template_loader'] = function (Container $c) { + return new TemplateLoader($c['TEMPLATES_PATH']); + }; + } +} diff --git a/lib/vendor/publishpress/wordpress-version-notices/src/Template/TemplateInvalidArgumentsException.php b/lib/vendor/publishpress/wordpress-version-notices/src/Template/TemplateInvalidArgumentsException.php new file mode 100644 index 00000000..566f4525 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-version-notices/src/Template/TemplateInvalidArgumentsException.php @@ -0,0 +1,33 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @package PublishPress\WordpressVersionNotices + * @category Core + * @author PublishPress + * @copyright Copyright (c) 2020 PublishPress. All rights reserved. + **/ + +namespace PublishPress\WordpressVersionNotices\Template; + +use RuntimeException; + +class TemplateInvalidArgumentsException extends RuntimeException +{ + +} diff --git a/lib/vendor/publishpress/wordpress-version-notices/src/Template/TemplateLoader.php b/lib/vendor/publishpress/wordpress-version-notices/src/Template/TemplateLoader.php new file mode 100644 index 00000000..f0f5a284 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-version-notices/src/Template/TemplateLoader.php @@ -0,0 +1,108 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @package PublishPress\WordpressVersionNotices + * @category Core + * @author PublishPress + * @copyright Copyright (c) 2020 PublishPress. All rights reserved. + **/ + +namespace PublishPress\WordpressVersionNotices\Template; + +class TemplateLoader implements TemplateLoaderInterface +{ + /** + * @var string + */ + private $templatesPath; + + /** + * TemplateLoader constructor. + * + * @param string $templatesPath + */ + public function __construct($templatesPath) + { + $this->templatesPath = $templatesPath; + } + + /** + * Load template for modules. + * + * @param $moduleName + * @param $templateName + * @param array $context + * @param bool $return + * + * @return false|string + * @throws TemplateNotFoundException + */ + private function load($moduleName, $templateName, $context = [], $return = false) + { + $templatePath = $this->templatesPath . '/' . $moduleName . '/' . $templateName . '.php'; + + if (!file_exists($templatePath)) { + throw new TemplateNotFoundException('Template file not found: ' . $templatePath); + } + + if ($return) { + ob_start(); + } + + extract($context); + + require $templatePath; + + if ($return) { + return ob_get_clean(); + } + + return false; + } + + /** + * Load template for modules. + * + * @param string $moduleName + * @param string $templateName + * @param array $context + * + * @throws TemplateNotFoundException + */ + public function displayOutput($moduleName, $templateName, $context = []) + { + echo $this->load($moduleName, $templateName, $context, false); + } + + /** + * Load template for modules. + * + * @param string $moduleName + * @param string $templateName + * @param array $context + * + * @return false|string + * + * @throws TemplateNotFoundException + */ + public function returnOutput($moduleName, $templateName, $context = []) + { + return $this->load($moduleName, $templateName, $context, true); + } +} diff --git a/lib/vendor/publishpress/wordpress-version-notices/src/Template/TemplateLoaderInterface.php b/lib/vendor/publishpress/wordpress-version-notices/src/Template/TemplateLoaderInterface.php new file mode 100644 index 00000000..48782321 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-version-notices/src/Template/TemplateLoaderInterface.php @@ -0,0 +1,53 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @package PublishPress\WordpressVersionNotices + * @category Core + * @author PublishPress + * @copyright Copyright (c) 2020 PublishPress. All rights reserved. + **/ + +namespace PublishPress\WordpressVersionNotices\Template; + +interface TemplateLoaderInterface +{ + /** + * Load template for modules. + * + * @param string $moduleName + * @param string $templateName + * @param array $context + * + * @throws TemplateNotFoundException + */ + public function displayOutput($moduleName, $templateName, $context = []); + + /** + * Load template for modules. + * + * @param string $moduleName + * @param string $templateName + * @param array $context + * + * @return false|string + * + * @throws TemplateNotFoundException + */ + public function returnOutput($moduleName, $templateName, $context = []); +} diff --git a/lib/vendor/publishpress/wordpress-version-notices/src/Template/TemplateNotFoundException.php b/lib/vendor/publishpress/wordpress-version-notices/src/Template/TemplateNotFoundException.php new file mode 100644 index 00000000..7a2a7acf --- /dev/null +++ b/lib/vendor/publishpress/wordpress-version-notices/src/Template/TemplateNotFoundException.php @@ -0,0 +1,33 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * @package PublishPress\WordpressVersionNotices + * @category Core + * @author PublishPress + * @copyright Copyright (c) 2020 PublishPress. All rights reserved. + **/ + +namespace PublishPress\WordpressVersionNotices\Template; + +use RuntimeException; + +class TemplateNotFoundException extends RuntimeException +{ + +} diff --git a/lib/vendor/publishpress/wordpress-version-notices/src/Versions.php b/lib/vendor/publishpress/wordpress-version-notices/src/Versions.php new file mode 100644 index 00000000..18a0fe3c --- /dev/null +++ b/lib/vendor/publishpress/wordpress-version-notices/src/Versions.php @@ -0,0 +1,85 @@ +versions[$versionString])) { + return false; + } + + $this->versions[$versionString] = $initializationCallback; + + return true; + } + + public function getVersions(): array + { + return $this->versions; + } + + public function latestVersion() + { + $keys = array_keys($this->versions); + if (empty($keys)) { + return false; + } + uasort($keys, 'version_compare'); + return end($keys); + } + + public function latestVersionCallback() + { + $latest = $this->latestVersion(); + if (empty($latest) || ! isset($this->versions[$latest])) { + return '__return_null'; + } + + return $this->versions[$latest]; + } + + /** + * @return Versions + * @codeCoverageIgnore + */ + public static function getInstance(): ?Versions + { + if (empty(self::$instance)) { + self::$instance = new self(); + } + + return self::$instance; + } + + /** + * @codeCoverageIgnore + */ + public static function initializeLatestVersion(): void + { + $self = self::getInstance(); + + call_user_func($self->latestVersionCallback()); + } + } +} diff --git a/lib/vendor/publishpress/wordpress-version-notices/src/autoload.php b/lib/vendor/publishpress/wordpress-version-notices/src/autoload.php new file mode 100644 index 00000000..a0d2e1d5 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-version-notices/src/autoload.php @@ -0,0 +1,42 @@ +register(new ServicesProvider()); + + // Load the modules + $module = $container['module_top_notice']; + $module->init(); + + $module = $container['module_menu_link']; + $module->init(); + + define('PP_VERSION_NOTICES_LOADED', true); + } +}, -125, 0); diff --git a/lib/vendor/publishpress/wordpress-version-notices/src/deprecated.php b/lib/vendor/publishpress/wordpress-version-notices/src/deprecated.php new file mode 100644 index 00000000..cea6c95a --- /dev/null +++ b/lib/vendor/publishpress/wordpress-version-notices/src/deprecated.php @@ -0,0 +1,35 @@ +register('2.1.2', __NAMESPACE__ . '\initialize2Dot1Dot2'); + } + } + + function initialize2Dot1Dot2() + { + require_once __DIR__ . '/autoload.php'; + + if (! defined('PUBLISHPRESS_WORDPRESS_VERSION_NOTICES_VERSION')) { + define('PUBLISHPRESS_WORDPRESS_VERSION_NOTICES_VERSION', '2.1.2'); + } + + do_action('publishpress_wordpress_version_notices_2Dot1Dot2_initialized'); + } +} diff --git a/lib/vendor/publishpress/wordpress-version-notices/templates/menu-link/menu-link-script.php b/lib/vendor/publishpress/wordpress-version-notices/templates/menu-link/menu-link-script.php new file mode 100644 index 00000000..ef5763d0 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-version-notices/templates/menu-link/menu-link-script.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/lib/vendor/publishpress/wordpress-version-notices/templates/menu-link/redirect-page.php b/lib/vendor/publishpress/wordpress-version-notices/templates/menu-link/redirect-page.php new file mode 100644 index 00000000..d1d4410f --- /dev/null +++ b/lib/vendor/publishpress/wordpress-version-notices/templates/menu-link/redirect-page.php @@ -0,0 +1,15 @@ +
+

+ +

+

+ + +
\ No newline at end of file diff --git a/lib/vendor/publishpress/wordpress-version-notices/templates/top-notice/notice.php b/lib/vendor/publishpress/wordpress-version-notices/templates/top-notice/notice.php new file mode 100644 index 00000000..a717a565 --- /dev/null +++ b/lib/vendor/publishpress/wordpress-version-notices/templates/top-notice/notice.php @@ -0,0 +1,6 @@ +'; +$message = sprintf('
' . $message, $linkStart, $linkEnd); +?> +
\ No newline at end of file diff --git a/orgSeries.php b/orgSeries.php index c8cd18df..fe15d62c 100644 --- a/orgSeries.php +++ b/orgSeries.php @@ -3,7 +3,7 @@ * Plugin Name: PublishPress Series * Plugin URI: https://publishpress.com/publishpress-series/ * Description: PublishPress Series allows you to group content together into a series. This is ideal for magazines, newspapers, short-story writers, teachers, comic artists, or anyone who writes multiple posts on the same topic. - * Version: 2.11.5 + * Version: 2.12.0 * Author: PublishPress * Author URI: https://publishpress.com/ * Text Domain: organize-series @@ -66,9 +66,13 @@ return; } -$includeFileRelativePath = '/publishpress/publishpress-instance-protection/include.php'; -if (file_exists(__DIR__ . '/vendor' . $includeFileRelativePath)) { - require_once __DIR__ . '/vendor' . $includeFileRelativePath; +if (! defined('PP_SERIES_LIB_VENDOR_PATH')) { + define('PP_SERIES_LIB_VENDOR_PATH', __DIR__ . '/lib/vendor'); +} + +$instanceProtectionIncPath = PP_SERIES_LIB_VENDOR_PATH . '/publishpress/instance-protection/include.php'; +if (is_file($instanceProtectionIncPath) && is_readable($instanceProtectionIncPath)) { + require_once $instanceProtectionIncPath; } if (class_exists('PublishPressInstanceProtection\\Config')) { @@ -80,16 +84,14 @@ $pluginChecker = new PublishPressInstanceProtection\InstanceChecker($pluginCheckerConfig); } -//composer autoload -$autoloadPath = __DIR__ . '/vendor/autoload.php'; -if (file_exists($autoloadPath)) { - require_once $autoloadPath; +$autoloadFilePath = PP_SERIES_LIB_VENDOR_PATH . '/autoload.php'; +if (! class_exists('ComposerAutoloaderInitPublishPressSeries') + && is_file($autoloadFilePath) + && is_readable($autoloadFilePath) +) { + require_once $autoloadFilePath; } -require_once PUBLISHPRESS_SERIES_VENDOR_PATH . '/publishpress/psr-container/lib/include.php'; -require_once PUBLISHPRESS_SERIES_VENDOR_PATH . '/publishpress/pimple-pimple/lib/include.php'; -require_once PUBLISHPRESS_SERIES_VENDOR_PATH . '/publishpress/wordpress-version-notices/src/include.php'; - add_action('plugins_loaded', function() { if (! class_exists('PublishPress\\OrganizeSeries\\Autoloader')) { require_once __DIR__ . '/includes-core/Autoloader.php'; @@ -103,7 +105,7 @@ register_activation_hook( __FILE__, 'pp_series_core_activation' ); if (!defined('ORG_SERIES_VERSION')) { - define('ORG_SERIES_VERSION', '2.11.5'); //the current version of the plugin + define('ORG_SERIES_VERSION', '2.12.0'); //the current version of the plugin define( 'SERIES_FILE_PATH', __FILE__ ); define( 'SERIES_PATH_URL', plugins_url('', __FILE__).'/' ); define('SERIES_LOC', plugins_url('', __FILE__).'/' ); //the uri of the orgSeries files. diff --git a/readme.txt b/readme.txt index 1535702f..ac600d48 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: issue, series, magazine, newspaper, publication Requires at least: 5.5 Requires PHP: 7.2.5 Tested up to: 6.3 -Stable tag: 2.11.5 +Stable tag: 2.12.0 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -174,6 +174,14 @@ Yes, Publishpress Series introduces a new taxonomy "series". Thanks to the rich == Changelog == +v2.12.0- 2023-08-17 +* Changed: Replaced Pimple library with a prefixed version of the library to avoid conflicts with other plugins; +* Changed: Replaced Psr/Container library with a prefixed version of the library to avoid conflicts with other plugins; +* Changed: Change min PHP version to 7.2.5. If not compatible, the plugin will not execute; +* Changed: Change min WP version to 5.5. If not compatible, the plugin will not execute; +* Changed: Updated internal libraries to latest versions; +* Changed: Refactor some occurrences of "plugins_loaded" replacing it by a new action: "plublishpress__loaded" which runs after the requirements and libraries are loaded, but before the plugin is initialized; + v2.11.5- 2023-07-20 * Update: Allow users to re-order drafts series, #815 * Update: Add series metabox order settings, #814