diff --git a/.builder-rsync-filters b/.builder-rsync-filters deleted file mode 100644 index 05579623..00000000 --- a/.builder-rsync-filters +++ /dev/null @@ -1,63 +0,0 @@ -- *.code-workspace -- .babelrc -- .builder-rsync-filters -- .distignore -- .env.testing.linux.dist -- .env.testing.mac.dist -- .eslintrc.js -- .git -- .gitattributes -- .github -- .gitignore -- .idea -- .php-cs-fixer.cache -- .phpcs.xml -- .phplint-cache -- .phplint.yml -- .vscode -- .wordpress-org -- /dist -- Gruntfile.js -- README-build.md -- README.md -- RoboFile.php -- bin -- builder -- builder.yml -- builder.yml.dist -- codeception.dist.yml -- cypress -- cypress.json -- jest.config.ts -- jsconfig.json -- mix-manifest.json -- node_modules -- package-lock.json -- package.json -- phpcs.xml -- psalm.xml -- ray-dist.php -- ray.php -- screenshot-*.png -- scripts -- tailwind.config.js -- tests -- vendor/pimple/pimple/.gitignore -- vendor/pimple/pimple/.php_cs.dist -- vendor/psr/container/.gitignore -- 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/pimple/pimple/CHANGELOG -- vendor/pimple/pimple/README.rst -- vendor/pimple/pimple/composer.json -- vendor/pimple/pimple/ext -- vendor/pimple/pimple/phpunit.xml.dist -- vendor/pimple/pimple/src/Pimple/Tests -- vendor/psr/container/composer.json -- webpack.config.js -- webpack.mix.js diff --git a/.distignore b/.distignore new file mode 100644 index 00000000..92cf5f00 --- /dev/null +++ b/.distignore @@ -0,0 +1,73 @@ +# 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 +.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 +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 +webpack.config.js +webpack.mix.js diff --git a/.gitattributes b/.gitattributes index 44e94a61..bbd1f0ef 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,15 +1,3 @@ -.babelrc export-ignore -.distignore export-ignore -.DS_Store export-ignore -.editorconfig export-ignore -.git export-ignore -.gitattributes export-ignore -.github export-ignore -.gitignore export-ignore -.gitlab-ci.yml export-ignore -.phplint.yml export-ignore -.travis.yml export-ignore -.vscode export-ignore *.bash export-ignore *.cache export-ignore *.code-workspace export-ignore @@ -21,19 +9,39 @@ *.tar.gz export-ignore *.testing export-ignore *.zip export-ignore +.DS_Store export-ignore +.babelrc 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 +.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 -composer.json export-ignore -composer.lock export-ignore docker-compose.yml export-ignore -Gruntfile.js export-ignore -Gruntfile.js 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 @@ -47,8 +55,8 @@ phpmd.xml export-ignore phpunit.xml export-ignore phpunit.xml.dist export-ignore psalm.xml export-ignore -README.md export-ignore -RoboFile.php export-ignore -Thumbs.db export-ignore webpack.config.js 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 e897ee73..17354c0a 100644 --- a/.github/ISSUE_TEMPLATE/release-free-plugin.md +++ b/.github/ISSUE_TEMPLATE/release-free-plugin.md @@ -1,37 +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 Capabilities 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` and check if there is any relevant update. Check if you need to lock the current version for any dependency. The `--no-dev` argument is optional here, since the build script will make sure to run the build with that argument. -- [ ] 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. Use `$ vendor/bin/robo version ` -- [ ] Commit the changes to the release branch -- [ ] Build the zip package using `$ vendor/bin/robo build`. It should create a package in the `./dist` dir. -- [ ] Send 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 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) - -#### SVN Repo -- [ ] Cleanup the `trunk` directory. -- [ ] Unzip the built package and move files to the `trunk` -- [ ] Remove any eventual file that shouldn't be released in the package (if you find anything, make sure to create an issue to fix the build script) -- [ ] Look for new files `$ svn status | grep \?` and add them using `$ svn add ` -- [ ] Look for removed files `$ svn status | grep !` and remove them `$ svn rm ` -- [ ] Create the new tag `$ svn cp trunk tags/` -- [ ] Commit the changes `$ svn ci -m 'Releasing '` -- [ ] Wait until WordPress updates the version number and make the 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 f5b040b1..cdb2a378 100644 --- a/.github/ISSUE_TEMPLATE/release-pro-plugin.md +++ b/.github/ISSUE_TEMPLATE/release-pro-plugin.md @@ -1,30 +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 Capabilities 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 -- [ ] Clone free version shared file to pro version -- [ ] Run `composer update` and check if there is any relevant update. Check if you need to lock the current version for any dependency. The `--no-dev` argument is optional here, since the build script will make sure to run the build with that argument. -- [ ] 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. Use `$ vendor/bin/robo version ` -- [ ] Commit the changes to the release branch -- [ ] Build the zip package using `$ vendor/bin/robo build`. It should create a package in the `./dist` dir. -- [ ] Send 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) -- [ ] Update EDD registry and upload the new package -- [ ] 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 08321dc9..56f1334c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,28 @@ -*.log -wp-config.php -wp-content/advanced-cache.php -wp-content/backup-db/ -wp-content/backups/ -wp-content/blogs.dir/ -wp-content/cache/ -wp-content/upgrade/ -wp-content/uploads/ -wp-content/mu-plugins/ -wp-content/wp-cache-config.php -wp-content/plugins/hello.php +.svn +.git +.DS_Store +wpcom-helper.php + +/local.sh +node_modules -/.htaccess -/license.txt -/readme.html -/sitemap.xml -/sitemap.xml.gz +/.properties.ini -vendor/ +/packages +/vendor +/lib/**/.git +/builder +.idea /dist -.DS_Store -.idea/ +builder.yml +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..f7392459 --- /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/.rsync-filters-pre-build b/.rsync-filters-pre-build new file mode 100644 index 00000000..9e2b913b --- /dev/null +++ b/.rsync-filters-pre-build @@ -0,0 +1,64 @@ +- *.code-workspace +- .babelrc +- .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 +- .gitignore +- .idea +- .php-cs-fixer.cache +- .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_wp +- bin +- builder +- builder.yml +- builder.yml.dist +- codeception.dist.yml +- cs +- 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 +- /vendor/bin +- webpack.config.js +- webpack.mix.js diff --git a/README.md b/README.md index 07387d75..d38b2796 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Capability-Manager-Enhanced +# PublishPress Capabilities ## Description @@ -29,4 +29,4 @@ We will review and contact you as soon as possible. ## License -License: [GPLv3 or later](http://www.gnu.org/licenses/gpl-3.0.html) \ No newline at end of file +License: [GPLv3 or later](http://www.gnu.org/licenses/gpl-3.0.html) diff --git a/builder/docker/Dockerfile b/builder/docker/Dockerfile deleted file mode 100644 index 21beff21..00000000 --- a/builder/docker/Dockerfile +++ /dev/null @@ -1,128 +0,0 @@ -FROM php:7.4-cli - -RUN set -ex; \ - \ - apt-get update; \ - apt-get install -y \ - libyaml-dev \ - g++ \ - make \ - autoconf \ - libzip-dev \ - curl \ - libcurl4-openssl-dev \ - wget \ - bash \ - coreutils \ - git \ - openssh-client \ - patch \ - subversion \ - tini \ - unzip \ - zip \ - rsync \ - ; \ - \ - 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; \ - apt-get remove -y \ - g++ \ - make \ - autoconf\ - ; \ - \ - apt-get purge -y --auto-remove; \ - rm -rf /var/lib/apt/lists/* - -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 - -ENV COMPOSER_ALLOW_SUPERUSER 1 -ENV COMPOSER_HOME /tmp -ENV COMPOSER_VERSION 2.3.7 - -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.2.58/install-php-extensions \ - ; \ - echo 182011b3dca5544a70fdeb587af44ed1760aa9a2ed37d787d0f280a99f92b008e638c37762360cd85583830a097665547849cb2293c4a0ee32c2a36ef7a349e2 /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/f24b8f860b95b52167f91bbd3e3a7bcafe043038/web/installer \ - ; \ - echo 3137ad86bd990524ba1dedc2038309dfa6b63790d3ca52c28afea65dcc2eaead16fb33e9a72fd2a7a8240afaf26e065939a2d472f3b0eeaa575d1e8648f9bf19 /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 {} + - -RUN mkdir /app - -VOLUME /app - -WORKDIR /app - -COPY scripts/build.sh /usr/local/bin/ppbuild - -RUN chmod +x /usr/local/bin/ppbuild - -ENTRYPOINT ["bash"] diff --git a/builder/docker/scripts/build b/builder/docker/scripts/build deleted file mode 100755 index 8dec3660..00000000 --- a/builder/docker/scripts/build +++ /dev/null @@ -1,224 +0,0 @@ -#!/usr/bin/env bash -start_time=$(date +%s) - -script_version="1.1.1" - -command=${1} -source_path=$(pwd) -scripts_path="${source_path}/builder/docker/scripts" -dist_path="${source_path}/dist" -cols=$(tput cols) - - -####################################### -# Get the plugin name from composer.json file. -# Globals: -# scripts_path -# source_path -# Returns: -# The plugin name. -####################################### -get_plugin_name() { - php "${scripts_path}/parse-json.php" "${source_path}/composer.json" "extra.plugin-name" -} -plugin_name=$(get_plugin_name) - -####################################### -# Get the plugin slug from composer.json file. -# Globals: -# scripts_path -# source_path -# Returns: -# The plugin slug. -####################################### -get_plugin_slug() { - php "${scripts_path}/parse-json.php" "${source_path}/composer.json" "extra.plugin-slug" -} -plugin_slug=$(get_plugin_slug) - -####################################### -# Get the plugin folder from composer.json file. -# Globals: -# scripts_path -# source_path -# Returns: -# The plugin folder. -####################################### -get_plugin_folder() { - php "${scripts_path}/parse-json.php" "${source_path}/composer.json" "extra.plugin-folder" -} -plugin_folder=$(get_plugin_folder) - -####################################### -# Get the plugin version from the main plugin file. -# Returns: -# The plugin version. -####################################### -get_plugin_version() { - # TODO: Remove the hardcoded plugin slug - cat $plugin_slug.php | grep "* Version:" | sed 's/ //g' | awk -F: '{print $NF}' -} -plugin_version=$(get_plugin_version) - -tmp_build_dir="${dist_path}/${plugin_folder}" - -####################################### -# 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}" -} - -####################################### -# Delete the temporary plugin folder in the dist dir. -# Globals: -# plugin_name -# tmp_build_dir -# Outputs: -# The current step message. -####################################### -clean_dist() { - echo_step "Removing the folder ${tmp_build_dir} if exists" - rm -rf "${tmp_build_dir}" -} - -####################################### -# Build the plugin code to a subdir named -# as the plugin name in the dist dir. -# Globals: -# tmp_build_dir -# source_path -# Outputs: -# Step messages. -####################################### -build_to_dir() { - clean_dist - - echo_step "Copying plugin files to the dist dir" - mkdir -p "${tmp_build_dir}" - rsync -r -f 'merge .builder-rsync-filters' "${source_path}/" "${tmp_build_dir}" - - echo_step "Running composer install" - echo "" - composer install --no-dev --working-dir="${tmp_build_dir}" - - echo "" -} - -####################################### -# Build the plugin code to a subdir named -# as the plugin name in the dist dir and -# pack the folder in a zip file stored -# in the dist dir, by default. -# Globals: -# dist_path -# plugin_name -# plugin_version -# Outputs: -# Step messages. -####################################### -pack_built_dir() { - zip_filename="${plugin_name}-${plugin_version}.zip" - zip_path="${dist_path}/${zip_filename}" - echo_step "Removing old zip file, if exists" - rm -f "${zip_path}" - pushd "${dist_path}" > /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 - echo "" - echo "Plugin successfully built to a zip file!" - show_time - ;; - "clean") - echo "Cleaning directory on dist dir:" - echo "" - clean_dist - ;; - *) - echo "invalid option ${command}" - ;; -esac diff --git a/builder/docker/scripts/parse-json.php b/builder/docker/scripts/parse-json.php deleted file mode 100644 index 2ca82d75..00000000 --- a/builder/docker/scripts/parse-json.php +++ /dev/null @@ -1,48 +0,0 @@ -pluginSlug = 'capsman-enhanced'; - $pluginCheckerConfig->pluginFolder = 'capability-manager-enhanced'; - $pluginCheckerConfig->pluginName = 'PublishPress Capabilities'; +$invalid_php_version = version_compare(phpversion(), $min_php_version, '<'); +$invalid_wp_version = version_compare($wp_version, $min_wp_version, '<'); - $pluginChecker = new PublishPressInstanceProtection\InstanceChecker($pluginCheckerConfig); +if ($invalid_php_version || $invalid_wp_version) { + return; } -if (!defined('CAPSMAN_VERSION')) { - define('CAPSMAN_VERSION', '2.9.1'); - define('CAPSMAN_ENH_VERSION', CAPSMAN_VERSION); - define('PUBLISHPRESS_CAPS_VERSION', CAPSMAN_VERSION); +if (!defined('PP_CAPABILITIES_LIB_VENDOR_PATH')) { + define('PP_CAPABILITIES_LIB_VENDOR_PATH', __DIR__ . '/lib/vendor'); } -foreach (get_option('active_plugins') as $plugin_file) { - if ( false !== strpos($plugin_file, 'capsman.php') ) { - add_action('admin_notices', function() { - echo '
' . sprintf(esc_html__('%1s Error: %2s PublishPress Capabilities cannot function because another copy of Capability Manager is active.', 'capsman-enhanced'), '', '') . '
'; - }); - return; - } +$instanceProtectionIncPath = PP_CAPABILITIES_LIB_VENDOR_PATH . '/publishpress/instance-protection/include.php'; +if (is_file($instanceProtectionIncPath) && is_readable($instanceProtectionIncPath)) { + require_once $instanceProtectionIncPath; } -$pro_active = false; +if (class_exists('PublishPressInstanceProtection\\Config')) { + $pluginCheckerConfig = new PublishPressInstanceProtection\Config(); + $pluginCheckerConfig->pluginSlug = 'capsman-enhanced'; + $pluginCheckerConfig->pluginFolder = 'capability-manager-enhanced'; + $pluginCheckerConfig->pluginName = 'PublishPress Capabilities'; -foreach ((array)get_option('active_plugins') as $plugin_file) { - if (false !== strpos($plugin_file, 'capabilities-pro.php')) { - $pro_active = true; - break; - } + $pluginChecker = new PublishPressInstanceProtection\InstanceChecker($pluginCheckerConfig); } -if (!$pro_active && is_multisite()) { - foreach (array_keys((array)get_site_option('active_sitewide_plugins')) as $plugin_file) { - if (false !== strpos($plugin_file, 'capabilities-pro.php')) { - $pro_active = true; - break; - } - } +$autoloadFilePath = PP_CAPABILITIES_LIB_VENDOR_PATH . '/autoload.php'; +if ( + !class_exists('ComposerAutoloaderInitPublishPressCapabilities') + && is_file($autoloadFilePath) + && is_readable($autoloadFilePath) +) { + require_once $autoloadFilePath; } -if ($pro_active) { - add_filter( - 'plugin_row_meta', - function($links, $file) - { - if ($file == plugin_basename(__FILE__)) { - $links[]= '' . esc_html__('This plugin can be deleted.', 'capsman-enhanced') . ''; - } - - return $links; - }, - 10, 2 - ); -} +add_action('plugins_loaded', function () { -if (defined('CME_FILE') || $pro_active) { - return; -} + if (!defined('CAPSMAN_VERSION')) { + define('CAPSMAN_VERSION', '2.10.0'); + define('CAPSMAN_ENH_VERSION', CAPSMAN_VERSION); + define('PUBLISHPRESS_CAPS_VERSION', CAPSMAN_VERSION); + } -define ( 'CME_FILE', __FILE__ ); -define ('PUBLISHPRESS_CAPS_ABSPATH', __DIR__); + foreach (get_option('active_plugins') as $plugin_file) { + if (false !== strpos($plugin_file, 'capsman.php')) { + add_action('admin_notices', function () { + echo '
' . sprintf(esc_html__('%1s Error: %2s PublishPress Capabilities cannot function because another copy of the plugin is active.', 'capsman-enhanced'), '', '') . '
'; + }); + return; + } + } -require_once (dirname(__FILE__) . '/includes/functions.php'); + $pro_active = false; -// ============================================ START PROCEDURE ========== + foreach ((array)get_option('active_plugins') as $plugin_file) { + if (false !== strpos($plugin_file, 'capabilities-pro.php')) { + $pro_active = true; + break; + } + } + + if (!$pro_active && is_multisite()) { + foreach (array_keys((array)get_site_option('active_sitewide_plugins')) as $plugin_file) { + if (false !== strpos($plugin_file, 'capabilities-pro.php')) { + $pro_active = true; + break; + } + } + } + + if ($pro_active) { + add_filter( + 'plugin_row_meta', + function ($links, $file) { + if ($file == plugin_basename(__FILE__)) { + $links[] = '' . esc_html__('This plugin can be deleted.', 'capsman-enhanced') . ''; + } + + return $links; + }, + 10, + 2 + ); + } + + if (defined('CME_FILE') || $pro_active) { + return; + } + + define('CME_FILE', __FILE__); + define('PUBLISHPRESS_CAPS_ABSPATH', __DIR__); + + require_once(dirname(__FILE__) . '/includes/functions.php'); + + // ============================================ START PROCEDURE ========== -// Check required PHP version. -if ( version_compare(PHP_VERSION, '5.4.0', '<') ) { - // Send an armin warning - add_action('admin_notices', function() { - $data = get_plugin_data(__FILE__); - load_plugin_textdomain('capsman-enhanced', false, basename(dirname(__FILE__)) .'/languages'); - echo '

' . esc_html__('Warning:', 'capsman-enhanced') . ' ' - . sprintf(esc_html__('The active plugin %s is not compatible with your PHP version.', 'capsman-enhanced') .'

', - '«' . esc_html($data['Name']) . ' ' . esc_html($data['Version']) . '»') - . sprintf(esc_html__('%s is required for this plugin.', 'capsman-enhanced'), 'PHP-5 ') - . '

'; - }); -} else { global $pagenow; // redirect legacy URLs if (!empty($_REQUEST['page'])) { - foreach(['capsman' => 'pp-capabilities', 'capsman-tool' => 'pp-capabilities-backup'] as $find => $replace) { + foreach (['capsman' => 'pp-capabilities', 'capsman-tool' => 'pp-capabilities-backup'] as $find => $replace) { if (isset($_REQUEST['page']) && ($find == $_REQUEST['page']) && !empty($_SERVER['REQUEST_URI'])) { $location = str_replace("page=$find", "page=$replace", esc_url_raw($_SERVER['REQUEST_URI'])); - header( "Location: $location", true); + header("Location: $location", true); exit; } } @@ -143,21 +155,22 @@ function($links, $file) require_once(__DIR__ . '/includes-core/CoreAdmin.php'); new \PublishPress\Capabilities\CoreAdmin(); } -} -add_action( 'init', '_cme_init' ); -add_action( 'plugins_loaded', '_cme_act_pp_active', 1 ); + add_action('init', '_cme_init'); + add_action( 'plugins_loaded', '_cme_act_pp_active', 1); -add_action( 'init', '_cme_cap_helper', 49 ); // Press Permit Cap Helper, registered at 50, will leave caps which we've already defined -//add_action( 'wp_loaded', '_cme_cap_helper_late_init', 99 ); // now instead adding registered_post_type, registered_taxonomy action handlers for latecomers - // @todo: do this in PP Core also + add_action('init', '_cme_cap_helper', 49); // Press Permit Cap Helper, registered at 50, will leave caps which we've already defined + //add_action( 'wp_loaded', '_cme_cap_helper_late_init', 99 ); // now instead adding registered_post_type, registered_taxonomy action handlers for latecomers + // @todo: do this in PP Core also -if ( is_multisite() ) - require_once ( dirname(__FILE__) . '/includes/network.php' ); + if (is_multisite()) + require_once (dirname(__FILE__) . '/includes/network.php'); -// Check if Permissions is installed -if (!cme_is_plugin_active('press-permit-core.php') && !cme_is_plugin_active('presspermit-pro.php')) { - define('CAPSMAN_PERMISSIONS_INSTALLED', false); -} else { - define('CAPSMAN_PERMISSIONS_INSTALLED', true); -} + // Check if Permissions is installed + if (!cme_is_plugin_active('press-permit-core.php') && !cme_is_plugin_active('presspermit-pro.php')) { + define('CAPSMAN_PERMISSIONS_INSTALLED', false); + } else { + define('CAPSMAN_PERMISSIONS_INSTALLED', true); + } + do_action('publishpress_capabilities_loaded'); +}, -10); diff --git a/composer.json b/composer.json index 624a7690..4e252022 100644 --- a/composer.json +++ b/composer.json @@ -10,30 +10,27 @@ } ], "config": { - "preferred-install": "dist" + "preferred-install": { + "*": "dist" + } }, "minimum-stability": "stable", + "prefer-stable": true, "require": { - "php": ">=5.6.20", - "psr/container": "1.0.0", - "pimple/pimple": "3.2.3.*", - "publishpress/wordpress-reviews": "^1.1", - "publishpress/wordpress-version-notices": "^1", - "publishpress/wordpress-banners": "^1.2", - "publishpress/publishpress-instance-protection": "1.0.2" + "php": ">=7.2.5" }, - "repositories": [ - { - "type": "git", - "url": "https://github.com/publishpress/publishpress-instance-protection" - } - ], "scripts": { - "build": "builder/docker/scripts/build build", - "build-unpacked": "builder/docker/scripts/build build-dir" + "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": "capability-manager-enhanced", + "plugin-name": "publishpress-capabilities", "plugin-slug": "capsman-enhanced", "plugin-folder": "capability-manager-enhanced" } diff --git a/composer.lock b/composer.lock index e4927c68..215934b7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,329 +4,16 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b7989875fad94f7ec80bfe57560467c4", - "packages": [ - { - "name": "pimple/pimple", - "version": "v3.2.3", - "source": { - "type": "git", - "url": "https://github.com/silexphp/Pimple.git", - "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32", - "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/container": "^1.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "^3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2.x-dev" - } - }, - "autoload": { - "psr-0": { - "Pimple": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Pimple, a simple Dependency Injection Container", - "homepage": "http://pimple.sensiolabs.org", - "keywords": [ - "container", - "dependency injection" - ], - "support": { - "issues": "https://github.com/silexphp/Pimple/issues", - "source": "https://github.com/silexphp/Pimple/tree/master" - }, - "time": "2018-01-21T07:42:36+00:00" - }, - { - "name": "psr/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/master" - }, - "time": "2017-02-14T16:28:37+00:00" - }, - { - "name": "publishpress/publishpress-instance-protection", - "version": "v1.0.2", - "source": { - "type": "git", - "url": "https://github.com/publishpress/legacy-instance-protection.git", - "reference": "ef1a631a41b723ce2e856f534ff4befbe914e964" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/publishpress/legacy-instance-protection/zipball/ef1a631a41b723ce2e856f534ff4befbe914e964", - "reference": "ef1a631a41b723ce2e856f534ff4befbe914e964", - "shasum": "" - }, - "require": { - "php": ">=5.6.20" - }, - "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": { - "source": "https://github.com/publishpress/legacy-instance-protection/tree/v1.0.2" - }, - "abandoned": "publishpress/instance-protection", - "time": "2022-06-03T17:41:36+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": "1.1.4", - "source": { - "type": "git", - "url": "https://github.com/publishpress/library-wordpress-version-notices.git", - "reference": "a46b552ac4cbec26d743307611e5dd8d56f80a57" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/publishpress/library-wordpress-version-notices/zipball/a46b552ac4cbec26d743307611e5dd8d56f80a57", - "reference": "a46b552ac4cbec26d743307611e5dd8d56f80a57", - "shasum": "" - }, - "require": { - "php": ">=5.6.20", - "pimple/pimple": "~3.2.0", - "psr/container": "~1.0.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" - }, - "type": "library", - "autoload": { - "psr-4": { - "PPVersionNotices\\": "src/" - } - }, - "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/1.1.4" - }, - "time": "2022-06-06T15:45:54+00:00" - } - ], + "content-hash": "b9ac341cd2f0c03080c2c461bb6f2532", + "packages": [], "packages-dev": [], "aliases": [], "minimum-stability": "stable", "stability-flags": [], - "prefer-stable": false, + "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=5.6.20" + "php": ">=7.2.5" }, "platform-dev": [], "plugin-api-version": "2.3.0" diff --git a/dev-workspace/build b/dev-workspace/build new file mode 100755 index 00000000..54684e85 --- /dev/null +++ b/dev-workspace/build @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +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 new file mode 100755 index 00000000..bfbae301 --- /dev/null +++ b/dev-workspace/build-push @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# This command requires to be logged in on Docker Hub. Check `docker login --help` for more information. + +DOCKER_HOST_IP=$(php ./scripts/getip) docker buildx build --platform linux/amd64,linux/arm64 --push -t publishpress/dev-workspace-terminal:capabilities-free-2 ./docker diff --git a/dev-workspace/cache/.gitignore b/dev-workspace/cache/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/dev-workspace/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/dev-workspace/docker/Dockerfile b/dev-workspace/docker/Dockerfile new file mode 100644 index 00000000..38ae516c --- /dev/null +++ b/dev-workspace/docker/Dockerfile @@ -0,0 +1,4 @@ +FROM publishpress/dev-workspace-terminal:generic-2 + +ENV PLUGIN_NAME="PublishPress Capabilities" +ENV PLUGIN_TYPE="FREE" diff --git a/dev-workspace/docker/compose.yaml b/dev-workspace/docker/compose.yaml new file mode 100644 index 00000000..4cc47f47 --- /dev/null +++ b/dev-workspace/docker/compose.yaml @@ -0,0 +1,23 @@ +name: devworkspace_capabilities_free +services: + terminal: + build: ./docker + image: publishpress/dev-workspace-terminal:capabilities-free-2 + command: ["zsh"] + stdin_open: true + tty: true + working_dir: "/project" + volumes: + - ../../:/project + - ../cache/.zsh_history:/root/.zsh_history + - ../cache/.bash_history:/root/.bash_history + - ../cache/.npm/_cacache:/root/.npm/_cacache + - ../cache/.npm/_logs:/root/.npm/_logs + - ../cache/.oh-my-zsh/log:/root/.oh-my-zsh/log + - ../cache/.composer/cache:/root/.composer/cache + - ../cache/.composer/auth.json:/root/.composer/auth.json + - /var/run/docker.sock:/var/run/docker.sock + extra_hosts: + - "dockerhost:${DOCKER_HOST_IP}" + environment: + - DOCKER_HOST_IP=${DOCKER_HOST_IP} diff --git a/dev-workspace/run b/dev-workspace/run new file mode 100755 index 00000000..b3cf172d --- /dev/null +++ b/dev-workspace/run @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +# Create empty cache files if not exists. +[[ -d cache/.npm/_cacache ]] || mkdir -p cache/.npm/_cacache +[[ -d cache/.npm/_logs ]] || mkdir -p cache/.npm/_logs +[[ -d cache/.composer/cache ]] || mkdir -p cache/.composer/cache +[[ -d cache/.oh-my-zsh/log ]] || mkdir -p cache/.oh-my-zsh/log +[[ -f cache/.zsh_history ]] || touch cache/.zsh_history +[[ -f cache/.bash_history ]] || touch cache/.bash_history +[[ -f cache/.composer/auth.json ]] || echo '{}' > cache/.composer/auth.json + +export DOCKER_HOST_IP=$(php ./scripts/getip) + +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 +cm->setAdminCapability(); + + $pp_capabilities = apply_filters('cme_publishpress_capabilities_capabilities', []); + $role = get_role('administrator'); + foreach ($pp_capabilities as $cap) { + $role->add_cap($cap); + $current_user->allcaps[$cap] = true; + } $msg = esc_html__('Roles and Capabilities reset to WordPress defaults', 'capsman-enhanced'); diff --git a/includes/filters.php b/includes/filters.php index e12c9554..dd06ac01 100644 --- a/includes/filters.php +++ b/includes/filters.php @@ -53,7 +53,7 @@ function add( $object ) { add_filter('plugin_action_links_' . plugin_basename(CME_FILE), '_cme_fltPluginActionLinks', 10, 2); -add_action('plugins_loaded', '_cme_migrate_pp_options'); +add_action('publishpress_capabilities_loaded', '_cme_migrate_pp_options'); function _cme_publishpress_roles_js() { diff --git a/includes/functions.php b/includes/functions.php index 9c2ac842..5c26568f 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -447,7 +447,7 @@ function pp_capabilities_sidebox_banner($banner_title, $banner_messages) //funtion is used which will no longer be true after removing the banner. wp_enqueue_style( 'pp-wordpress-banners-style', - plugin_dir_url(CME_FILE) . 'vendor/publishpress/wordpress-banners/assets/css/style.css', + plugin_dir_url(CME_FILE) . 'lib/vendor/publishpress/wordpress-banners/assets/css/style.css', false, PP_WP_BANNERS_VERSION ); @@ -487,7 +487,7 @@ function pp_capabilities_pro_sidebox() //funtion is used which will no longer be true after removing the banner. wp_enqueue_style( 'pp-wordpress-banners-style', - plugin_dir_url(CME_FILE) . 'vendor/publishpress/wordpress-banners/assets/css/style.css', + plugin_dir_url(CME_FILE) . 'lib/vendor/publishpress/wordpress-banners/assets/css/style.css', false, PP_WP_BANNERS_VERSION ); diff --git a/includes/manager.php b/includes/manager.php index 9659c03e..2661b283 100644 --- a/includes/manager.php +++ b/includes/manager.php @@ -130,6 +130,13 @@ class CapabilityManager */ public $ID; + /** + * Module URL. + * + * @var string + */ + public $mod_url; + public function __construct() { $this->ID = 'capsman'; @@ -248,7 +255,7 @@ protected function moduleLoad () add_filter( 'option_' . $role_key, array( &$this, 'reinstate_db_roles' ), PHP_INT_MAX ); } - $action = (defined('PP_CAPABILITIES_COMPAT_MODE')) ? 'init' : 'plugins_loaded'; + $action = (defined('PP_CAPABILITIES_COMPAT_MODE')) ? 'init' : 'publishpress_capabilities_loaded'; add_action( $action, array( &$this, 'processRoleUpdate' ) ); } @@ -321,7 +328,7 @@ protected function pluginUpdate () } /** - * Adds admin panel menus. (At plugins loading time. This is before plugins_loaded). + * Adds admin panel menus. * User needs to have 'manage_capabilities' to access this menus. * This is set as an action in the parent class constructor. * diff --git a/languages/capsman-enhanced-es_ES.mo b/languages/capsman-enhanced-es_ES.mo index 2e690d19..386b316d 100644 Binary files a/languages/capsman-enhanced-es_ES.mo and b/languages/capsman-enhanced-es_ES.mo differ diff --git a/languages/capsman-enhanced-es_ES.po b/languages/capsman-enhanced-es_ES.po index 9f096721..a93c73ec 100644 --- a/languages/capsman-enhanced-es_ES.po +++ b/languages/capsman-enhanced-es_ES.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: Plugins - PublishPress Capabilities – User Role " "Access, Editor Permissions, Admin Menus - Stable (latest release)\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-08-01 12:21+0000\n" +"PO-Revision-Date: 2023-08-03 13:20+0200\n" "Last-Translator: \n" "Language-Team: Spanish (Spain)\n" "Language: es_ES\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" #: includes/pp-ui.php:65 msgid "" @@ -38,7 +38,7 @@ msgstr "%1$d usuarios movidos al perfil por defecto %2$s." #: includes/features/frontend-features/frontend-features.php:250 #, php-format msgid "%1$s = Apply custom styling" -msgstr "" +msgstr "%1$s = Aplica estilo personalizado" #: includes/admin.php:1680 msgid "%1$s = Capability denied, even if granted by another role %2$s" @@ -169,11 +169,11 @@ msgstr "Añadir un bloque" #: includes/features/frontend-features/frontend-features-ui.php:74 msgid "Add Body Class" -msgstr "" +msgstr "Añadir clase de cuerpo" #: includes/features/frontend-features/frontend-features-ui.php:73 msgid "Add Custom CSS" -msgstr "" +msgstr "Añadir CSS personalizado" #: includes/features/restrict-editor-features.php:47 #: includes/roles/roles.php:10 @@ -206,7 +206,7 @@ msgstr "Añadir o quitar esta capacidad del perfil de WordPress" #: includes/features/frontend-features/frontend-features-ui.php:129 msgid "Add post metabox:" -msgstr "" +msgstr "Añadir caja meta de entrada:" #: includes/admin.php:1787 msgid "Add to role" @@ -283,7 +283,7 @@ msgstr[1] "Todos los %s" #: includes/features/frontend-features/frontend-features-ui.php:147 #: includes/features/frontend-features/frontend-features-action.php:58 msgid "All fields are required." -msgstr "" +msgstr "Todos los campos son obligatorios." #: includes/roles/class/class-pp-roles-admin.php:646 msgid "All Roles" @@ -336,12 +336,12 @@ msgstr "" #: includes/features/frontend-features/frontend-features-action.php:41 #: includes/features/frontend-features/frontend-features-action.php:110 msgid "An error occured!" -msgstr "" +msgstr "Se ha producido un error!" #: includes/features/frontend-features/frontend-features.php:151 #, php-format msgid "Apply for %1$s" -msgstr "" +msgstr "Applica para %1$s" #: includes/manager.php:212 msgid "Are you sure you want to delete this item ?" @@ -445,7 +445,7 @@ msgstr "Cuerpo" #: includes/features/frontend-features/frontend-features-ui.php:221 msgid "Body Class" -msgstr "" +msgstr "Clase de cuerpo" #: includes/roles/class/class-pp-roles-admin.php:303 #, php-format @@ -499,7 +499,7 @@ msgstr "" #: includes/features/frontend-features/frontend-features-ui.php:144 msgid "Cancel Edit" -msgstr "" +msgstr "Cancelar edición" #: includes/roles/class/class-pp-roles-actions.php:523 msgid "" @@ -529,6 +529,8 @@ msgstr "" #: includes/functions-admin.php:336 msgid "Capabilities allows you to change the permissions for any user role." msgstr "" +"Las capacidades te permiten cambiar los permisos de cualquier perfil de " +"usuario." #: includes/pp-ui.php:75 msgid "" @@ -596,6 +598,7 @@ msgstr "Lista de comprobación" #: includes/features/frontend-features/frontend-features-metaboxes.php:77 msgid "Choose Frontend Features that will apply to this post." msgstr "" +"Elige las características de vista pública que se aplicarán a esta entrada." #: includes/features/editor-features.php:130 msgid "Classic" @@ -606,10 +609,8 @@ msgid "Classic editor" msgstr "Editor clásico" #: includes/features/editor-features-classic.php:1 -#, fuzzy -#| msgid "Classic Editor %s Restriction" msgid "Classic Editor %s Restrictions" -msgstr "Restricción para %s en el editor clásico" +msgstr "Restricciones %s del editor clásico" #: includes/admin.php:718 includes/admin.php:1019 includes/admin.php:1129 #: includes/admin.php:1182 includes/admin.php:1397 @@ -683,7 +684,7 @@ msgstr "Crear esta definición de perfil en nuevos (futuros) sitios" #: includes/features/frontend-features/frontend-features-ui.php:226 msgid "Custom CSS" -msgstr "" +msgstr "CSS personalizado" #: includes-core/editor-features-promo.php:95 msgid "Custom item one" @@ -703,8 +704,8 @@ msgstr "" #: includes/admin.php:1573 msgid "" -"Custom Post Visibility statuses, fully implemented throughout wp-admin " -"(Pro)" +"Custom Post Visibility statuses, fully implemented throughout wp-admin " +"(Pro)" msgstr "" "Estados de Custom Post Visibility, totalmente implementados en todo el " "escritorio (Pro)" @@ -864,7 +865,7 @@ msgstr "Edición" #: includes/features/frontend-features/frontend-features-ui.php:44 msgid "Editing:" -msgstr "" +msgstr "Edición:" #: includes/features/restrict-editor-features.php:45 #: includes/features/restrict-editor-features.php:55 @@ -872,10 +873,8 @@ msgid "Editor" msgstr "Editor" #: includes/features/editor-features.php:69 -#, fuzzy -#| msgid "Editor Feature Restriction" msgid "Editor Feature Restrictions" -msgstr "Restricción de la característica del editor" +msgstr "Restricciones de las características del editor" #: includes/functions-admin.php:205 includes/functions-admin.php:340 #: includes/functions-admin.php:410 includes/manager.php:452 @@ -908,18 +907,26 @@ msgid "" "Enter classes that should be added to the body HTML. Separate multiple " "values with a space (custom-item-one custom-item-two)." msgstr "" +"Introduce las clases que deben añadirse al cuerpo HTML. Separa los valores " +"múltiples con un espacio ( elemento-personalizado-uno elemento-personalizado-" +"dos)." #: includes/features/frontend-features/frontend-features-ui.php:91 msgid "" -"Enter custom CSS to be added to frontend pages. Examples: .custom-style-1 { " -"color: red; } #custom-header { background: red; } " +"Enter custom CSS to be added to frontend pages. Examples: .custom-style-1 " +"{ color: red; } #custom-header { background: red; } " msgstr "" +"Introduce el CSS personalizado que se añadirá a las páginas de la vista " +"pública. Ejemplos: .custom-style-1 { color: red; } #custom-header " +"{ background: red; } " #: includes/features/frontend-features/frontend-features-ui.php:80 msgid "" "Enter IDs or classes to hide. Separate multiple values with a comma (.custom-" "item-one, .custom-item-two, #new-item-id)." msgstr "" +"Introduce los IDs o clases a ocultar. Separa los valores múltiples con una " +"coma (.custom-item-one, .custom-item-two, #new-item-id)." #: includes/roles/class/class-pp-roles-admin.php:520 msgid "Enter the relative path only without domain for login redirect." @@ -1018,7 +1025,7 @@ msgstr "Imagen destacada" #: includes/features/frontend-features/frontend-features-ui.php:65 msgid "Features:" -msgstr "" +msgstr "Características:" #: includes/admin.php:1018 includes/admin.php:1128 includes/admin.php:1181 #: includes/admin.php:1396 @@ -1040,17 +1047,19 @@ msgstr "Aviso en el pie de página de la vista pública" #: includes/features/frontend-features/frontend-features-action.php:92 msgid "Frontend element item updated. Save changes to enable for role." msgstr "" +"Elemento de la vista pública actualizado. Guarda los cambios para habilitar " +"el perfil." #: includes/features/frontend-features/frontend-features-data.php:16 msgid "Frontend Elements" -msgstr "" +msgstr "Elementos de la vista pública" #: includes/functions-admin.php:220 includes/functions-admin.php:350 #: includes/functions-admin.php:424 #: includes/features/frontend-features/frontend-features-metaboxes.php:55 #: includes/features/frontend-features/frontend-features.php:70 msgid "Frontend Features" -msgstr "" +msgstr "Características de la vista pública" #: includes/functions-admin.php:351 #: includes/features/frontend-features/frontend-features.php:247 @@ -1058,6 +1067,8 @@ msgid "" "Frontend Features allows you to add or remove elements from the frontend of " "your site." msgstr "" +"Las características de la vista pública te permiten de añadir o quitar " +"elementos de la vista pública de tu sitio." #: includes/roles/class/class-pp-roles-admin.php:106 msgid "General" @@ -1079,8 +1090,8 @@ msgstr "" msgid "" "Grant supplemental content permissions to a BuddyPress group (Pro)" msgstr "" -"Otorgar permisos de contenido suplementario a un grupo de BuddyPress " -"(Pro)" +"Otorgar permisos de contenido suplementario a un grupo de BuddyPress " +"(Pro)" #: includes/features/editor-features.php:127 msgid "Gutenberg" @@ -1091,10 +1102,8 @@ msgid "Gutenberg editor" msgstr "Editor Gutenberg" #: includes/features/editor-features-gutenberg.php:1 -#, fuzzy -#| msgid "Gutenberg Editor %s Restriction" msgid "Gutenberg Editor %s Restrictions" -msgstr "Restricción para %s en el editor Gutenberg" +msgstr "Restricciones %s del editor Gutenberg" #: includes/admin.php:236 msgid "" @@ -1129,7 +1138,7 @@ msgstr "Ayuda" #: includes/features/frontend-features/frontend-features-ui.php:216 msgid "Hidden IDs or Classes" -msgstr "" +msgstr "ID o clases ocultas" #: includes/roles/class/class-pp-roles-list-table.php:302 msgid "Hide" @@ -1137,7 +1146,7 @@ msgstr "Ocultar" #: includes/features/frontend-features/frontend-features-ui.php:72 msgid "Hide IDs or Classes" -msgstr "" +msgstr "Oculta ID o clases" #: includes/functions.php:759 msgid "Home Link" @@ -1157,7 +1166,7 @@ msgstr "Cómo utilizar las características del editor" #: includes/features/frontend-features/frontend-features.php:253 msgid "How to use Frontend Features" -msgstr "" +msgstr "Cómo utilizar las características de la vista pública" #: includes/features/nav-menus.php:307 msgid "How to use Nav Menus" @@ -1237,7 +1246,7 @@ msgstr "Copia de seguridad inicial de todos los perfiles" #: includes/features/frontend-features/frontend-features-action.php:56 #: includes/features/frontend-features/frontend-features-action.php:119 msgid "Invalid action. Reload this page and try again." -msgstr "" +msgstr "Acción no válida. Recarga esta página e inténtalo de nuevo." #: includes/admin.php:668 includes/admin.php:1292 msgid "Invalid Capabilities" @@ -1249,7 +1258,7 @@ msgstr "¡Token nonce no válido!" #: includes/features/frontend-features/frontend-features-action.php:121 msgid "Invalid request!." -msgstr "" +msgstr "¡Solicitud no válida!." #: includes/roles/class/class-pp-roles-actions.php:211 msgid "Invalid role name entry: %s" @@ -1285,11 +1294,11 @@ msgstr "Cargar más" #: includes/features/frontend-features/frontend-features-action.php:60 msgid "Load on page types is required." -msgstr "" +msgstr "Es obligatorio subir los tipos de página." #: includes/features/frontend-features/frontend-features-ui.php:105 msgid "Load on page types:" -msgstr "" +msgstr "Subir los tipos de página:" #: includes/features/nav-menus.php:26 #: includes/features/frontend-features/frontend-features.php:39 @@ -1430,6 +1439,8 @@ msgstr "Se han añadido nuevas capacidades al perfil." #: includes/features/frontend-features/frontend-features-action.php:94 msgid "New frontend element added. Save changes to enable for role." msgstr "" +"Nuevo elemento de la vista pública añadido. Guarda los cambios para " +"habilitar el perfil." #: includes/handler.php:45 msgid "New role created." @@ -1524,7 +1535,7 @@ msgstr "Título de la página" #: includes/features/frontend-features/frontend-features-ui.php:235 msgid "Pages" -msgstr "" +msgstr "Páginas" #: includes/features/restrict-editor-features.php:481 msgid "Paragraph" @@ -1582,7 +1593,7 @@ msgstr "Slug de la entrada" #: includes/features/frontend-features/frontend-features-ui.php:243 msgid "Post Type Metabox" -msgstr "" +msgstr "Caja meta de tipo de contenido" #: includes/manager.php:208 msgid "Post type registration does not define this capability distinctly" @@ -1594,8 +1605,6 @@ msgid "Preview" msgstr "Previsualizar" #: includes/features/profile-features.php:43 -#, fuzzy -#| msgid "Profile Features Restrictions" msgid "Profile Feature Restrictions" msgstr "Restricciones de las características del perfil" @@ -1700,17 +1709,17 @@ msgstr "Rehacer" #: includes/features/profile-features.php:225 msgid "Refresh available profile items for this role" -msgstr "" +msgstr "Actualiza los elementos de perfil disponibles para este perfil" #: includes/features/profile-features.php:227 msgid "Refresh Profile Features" -msgstr "" +msgstr "Actualiza las características del perfil" #: includes/admin.php:1581 msgid "Regulate permissions for Edit Flow post statuses (Pro)" msgstr "" -"Regular los permisos de los estados de las entradas de Edit Flow (Pro)" -"" +"Regular los permisos de los estados de las entradas de Edit Flow (Pro)" #: includes/functions.php:510 msgid "Remove anything in the WordPress admin" @@ -1789,7 +1798,7 @@ msgstr "Barra derecha" #: includes/features/frontend-features/frontend-features.php:58 msgid "Role" -msgstr "" +msgstr "Perfil" #: includes/admin.php:73 msgid "Role Capabilities" @@ -1827,6 +1836,8 @@ msgstr "Perfiles" msgid "" "Roles allows you to create, edit, and delete all the user roles on your site." msgstr "" +"«Perfiles» te permite de crear, editar y borrar todos los perfiles de tu " +"sitio." #: includes/backup.php:308 msgid "Roles and Capabilities" @@ -1869,7 +1880,7 @@ msgstr "Guardar el borrador" #: includes/features/frontend-features/frontend-features-ui.php:149 msgid "Save Edit" -msgstr "" +msgstr "Guardar edición" #: includes/features/editor-features.php:115 #: includes/features/editor-features.php:217 @@ -1901,7 +1912,7 @@ msgstr "consulta %1$sUso de perfiles%2$s: «Perfiles de patrones»" #: includes/features/frontend-features/frontend-features-metaboxes.php:90 #, php-format msgid "Select %1$s..." -msgstr "" +msgstr "Seleccionar %1$s..." #: includes/roles/class/class-pp-roles-admin.php:418 msgid "Select %s" @@ -1914,11 +1925,11 @@ msgstr "Seleccionar editor permitido" #: includes-core/CoreAdmin.php:121 msgid "Select pages..." -msgstr "" +msgstr "Seleccionar páginas…" #: includes-core/frontend-features-promo.php:39 msgid "Select post types..." -msgstr "" +msgstr "Seleccionar tipos de contenido…" #: includes/settings-ui.php:190 msgid "Select roles..." @@ -1933,11 +1944,11 @@ msgstr "" #: includes/features/frontend-features/frontend-features-action.php:136 msgid "Selected item deleted successfully" -msgstr "" +msgstr "Los elementos seccionados han sido borrado con éxito" #: includes/features/frontend-features/frontend-features-ui.php:113 msgid "Selected Pages" -msgstr "" +msgstr "Páginas seleccionadas" #: includes/functions-admin.php:233 includes/functions-admin.php:461 #: includes/features/restrict-editor-features.php:397 @@ -1968,7 +1979,7 @@ msgstr "Mostrar solo los cambios de los perfiles actuales" #: includes/features/editor-features.php:135 msgid "show Classic Editor controls" -msgstr "" +msgstr "muestra los controles del editor clásico" #: includes/settings-ui.php:114 msgid "Show private post types" @@ -2039,7 +2050,7 @@ msgstr "Etiquetas" #: includes/functions.php:512 msgid "Target Frontend Features for specific pages" -msgstr "" +msgstr "Características de la vista pública para páginas específicas" #: includes/admin.php:214 msgid "Taxonomies" @@ -2212,13 +2223,15 @@ msgstr "Esta capacidad no está disponible para este tipo de contenido." #: includes/features/frontend-features/frontend-features-ui.php:41 msgid "" -"This feature allows you to modify the site frontend by hiding IDs or classes," -" adding CSS styles, or adding body classes." +"This feature allows you to modify the site frontend by hiding IDs or " +"classes, adding CSS styles, or adding body classes." msgstr "" +"Esta característica te permite modificar la vista pública del sitio " +"ocultando ID o clases, añadiendo estilos CSS o añadiendo clases de cuerpo." #: includes/features/frontend-features/frontend-features-ui.php:121 msgid "This feature will be added to all pages." -msgstr "" +msgstr "Esta característica se añadirá a todas las páginas." #: capsman-enhanced.php:85 msgid "This plugin can be deleted." @@ -2229,6 +2242,9 @@ msgid "" "This will add a metabox on the post editing screen. You can use this feature " "to add body classes only for that post." msgstr "" +"Esto añadirá una caja meta en la pantalla de edición de la entrada. Puedes " +"utilizar esta característica para añadir clases de cuerpo solo para esa " +"entrada." #: includes/pp-ui.php:176 msgid "" @@ -2240,7 +2256,7 @@ msgstr "" #: includes/features/frontend-features/frontend-features-ui.php:58 msgid "This will only show here in the WordPress admin area." -msgstr "" +msgstr "Esto solo se mostrará aquí en el área de administración de WordPress." #: includes/settings-ui.php:95 msgid "" @@ -2256,7 +2272,7 @@ msgstr "Título" #: includes/features/frontend-features/frontend-features-ui.php:52 msgid "Title:" -msgstr "" +msgstr "Título:" #: includes/features/profile-features.php:103 #: includes/features/profile-features.php:122 @@ -2373,7 +2389,7 @@ msgstr "Usuarios" #: includes/features/frontend-features/frontend-features-ui.php:251 msgid "View" -msgstr "" +msgstr "Ver" #: includes/admin.php:1722 includes/features/profile-features.php:237 #: includes/features/admin-features.php:252 includes/features/nav-menus.php:306 @@ -2425,7 +2441,7 @@ msgstr "" #: includes/features/frontend-features/frontend-features-ui.php:112 msgid "Whole Site" -msgstr "" +msgstr "Sitio completo" #: includes/roles/class/class-pp-roles-admin.php:122 msgid "WooCommerce" @@ -2458,8 +2474,8 @@ msgstr "" #: includes/admin.php:1597 msgid "WPML integration to mirror permissions to translations (Pro)" msgstr "" -"Integración de WPML para replicar los permisos a las traducciones (Pro)" -"" +"Integración de WPML para replicar los permisos a las traducciones (Pro)" #: includes/features/restrict-admin-features.php:69 msgid "Yoast SEO" @@ -2508,12 +2524,16 @@ msgstr "" #: includes-core/CoreAdmin.php:126 msgid "You can select page types where this element will be added." msgstr "" +"Puedes seleccionar los tipos de página en los que se añadirá este elemento." #: includes-core/frontend-features-promo.php:25 msgid "" "You can use Frontend Features to target specific posts and pages. This " "feature is available in PublishPress Capabilities Pro." msgstr "" +"Puedes utilizar las «Características de vista pública» para dirigir " +"publicaciones y páginas específicas. Esta característica está disponible en " +"PublishPress Capabilities Pro." #: includes/handler.php:250 msgid "You cannot remove Manage Capabilities from Administrators" @@ -2541,6 +2561,7 @@ msgstr "No tienes permisos para gestionar las características del editor." #: includes/features/frontend-features/frontend-features-action.php:117 msgid "You do not have permission to manage frontend features." msgstr "" +"No tienes permisos para gestionar las características de la vista pública." #: includes/manager.php:701 msgid "You do not have permission to manage navigation menus." diff --git a/languages/capsman-enhanced-fr_FR.mo b/languages/capsman-enhanced-fr_FR.mo index 52ac41f1..e6198c32 100644 Binary files a/languages/capsman-enhanced-fr_FR.mo and b/languages/capsman-enhanced-fr_FR.mo differ diff --git a/languages/capsman-enhanced-fr_FR.po b/languages/capsman-enhanced-fr_FR.po index 9f3aeafc..55ed5764 100644 --- a/languages/capsman-enhanced-fr_FR.po +++ b/languages/capsman-enhanced-fr_FR.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: Plugins - PublishPress Capabilities – User Role " "Access, Editor Permissions, Admin Menus - Stable (latest release)\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-08-01 12:21+0000\n" +"PO-Revision-Date: 2023-08-05 10:27+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" #: includes/pp-ui.php:65 msgid "" @@ -38,7 +38,7 @@ msgstr "%1$d utilisateurs/utilisatrices déplacés vers le rôle par défaut %2 #: includes/features/frontend-features/frontend-features.php:250 #, php-format msgid "%1$s = Apply custom styling" -msgstr "" +msgstr "%1$s = Appliquer un style personnalisé" #: includes/admin.php:1680 msgid "%1$s = Capability denied, even if granted by another role %2$s" @@ -169,11 +169,11 @@ msgstr "Ajouter un bloc" #: includes/features/frontend-features/frontend-features-ui.php:74 msgid "Add Body Class" -msgstr "" +msgstr "Ajouter une classe de corps" #: includes/features/frontend-features/frontend-features-ui.php:73 msgid "Add Custom CSS" -msgstr "" +msgstr "Ajouter CSS personnalisé" #: includes/features/restrict-editor-features.php:47 #: includes/roles/roles.php:10 @@ -206,7 +206,7 @@ msgstr "Ajouter ou supprimer une permission au rôle WordPress" #: includes/features/frontend-features/frontend-features-ui.php:129 msgid "Add post metabox:" -msgstr "" +msgstr "Ajouter une boîte méta de publication :" #: includes/admin.php:1787 msgid "Add to role" @@ -283,7 +283,7 @@ msgstr[1] "Tous les %s" #: includes/features/frontend-features/frontend-features-ui.php:147 #: includes/features/frontend-features/frontend-features-action.php:58 msgid "All fields are required." -msgstr "" +msgstr "Tous les champs sont obligatoires." #: includes/roles/class/class-pp-roles-admin.php:646 msgid "All Roles" @@ -337,12 +337,12 @@ msgstr "" #: includes/features/frontend-features/frontend-features-action.php:41 #: includes/features/frontend-features/frontend-features-action.php:110 msgid "An error occured!" -msgstr "" +msgstr "Une erreur s’est produite !" #: includes/features/frontend-features/frontend-features.php:151 #, php-format msgid "Apply for %1$s" -msgstr "" +msgstr "Appliquer pour %1$s" #: includes/manager.php:212 msgid "Are you sure you want to delete this item ?" @@ -449,7 +449,7 @@ msgstr "Corps" #: includes/features/frontend-features/frontend-features-ui.php:221 msgid "Body Class" -msgstr "" +msgstr "Classe de corps" #: includes/roles/class/class-pp-roles-admin.php:303 #, php-format @@ -499,7 +499,7 @@ msgstr "peut lire les articles publiés avec la visibilité privée" #: includes/features/frontend-features/frontend-features-ui.php:144 msgid "Cancel Edit" -msgstr "" +msgstr "Annuler la modification" #: includes/roles/class/class-pp-roles-actions.php:523 msgid "" @@ -524,11 +524,13 @@ msgstr "Permissions" msgid "Capabilities allows you change the permissions for any user role." msgstr "" "Permissions vous permet de modifier les permissions pour tout rôle " -"d’utilisateur et d’utilisatrice." +"d’utilisateur/utilisatrice." #: includes/functions-admin.php:336 msgid "Capabilities allows you to change the permissions for any user role." msgstr "" +"Permissions vous permet de modifier les permissions pour tout rôle " +"d’utilisateur/utilisatrice." #: includes/pp-ui.php:75 msgid "" @@ -596,6 +598,8 @@ msgstr "Liste de contrôle" #: includes/features/frontend-features/frontend-features-metaboxes.php:77 msgid "Choose Frontend Features that will apply to this post." msgstr "" +"Choisissez les fonctionnalités de l’interface publique qui s’appliquent à " +"cette publication." #: includes/features/editor-features.php:130 msgid "Classic" @@ -606,10 +610,8 @@ msgid "Classic editor" msgstr "Éditeur classique" #: includes/features/editor-features-classic.php:1 -#, fuzzy -#| msgid "Classic Editor %s Restriction" msgid "Classic Editor %s Restrictions" -msgstr "Restriction %s de l’éditeur classique" +msgstr "Restrictions %s de l’éditeur classique" #: includes/admin.php:718 includes/admin.php:1019 includes/admin.php:1129 #: includes/admin.php:1182 includes/admin.php:1397 @@ -684,7 +686,7 @@ msgstr "Créer cette définition de rôle dans les nouveaux (futurs) sites" #: includes/features/frontend-features/frontend-features-ui.php:226 msgid "Custom CSS" -msgstr "" +msgstr "CSS personnalisé" #: includes-core/editor-features-promo.php:95 msgid "Custom item one" @@ -704,8 +706,8 @@ msgstr "" #: includes/admin.php:1573 msgid "" -"Custom Post Visibility statuses, fully implemented throughout wp-admin " -"(Pro)" +"Custom Post Visibility statuses, fully implemented throughout wp-admin " +"(Pro)" msgstr "" "États de visibilité de publication personnalisés, entièrement mis en œuvre " "dans wp-admin. (Pro)" @@ -866,7 +868,7 @@ msgstr "Édition" #: includes/features/frontend-features/frontend-features-ui.php:44 msgid "Editing:" -msgstr "" +msgstr "Édition :" #: includes/features/restrict-editor-features.php:45 #: includes/features/restrict-editor-features.php:55 @@ -874,8 +876,6 @@ msgid "Editor" msgstr "Éditeur" #: includes/features/editor-features.php:69 -#, fuzzy -#| msgid "Editor Feature Restriction" msgid "Editor Feature Restrictions" msgstr "Restriction des fonctionnalités de l’éditeur" @@ -912,18 +912,25 @@ msgid "" "Enter classes that should be added to the body HTML. Separate multiple " "values with a space (custom-item-one custom-item-two)." msgstr "" +"Saisissez les classes qui doivent être ajoutées au corps HTML. Séparez les " +"valeurs multiples par un espace (custom-item-one custom-item-two)." #: includes/features/frontend-features/frontend-features-ui.php:91 msgid "" -"Enter custom CSS to be added to frontend pages. Examples: .custom-style-1 { " -"color: red; } #custom-header { background: red; } " +"Enter custom CSS to be added to frontend pages. Examples: .custom-style-1 " +"{ color: red; } #custom-header { background: red; } " msgstr "" +"Saisissez le CSS personnalisé à ajouter aux pages de l’interface publique. " +"Exemples : .custom-style-1 { color: red; } #custom-header { background: " +"red; } " #: includes/features/frontend-features/frontend-features-ui.php:80 msgid "" "Enter IDs or classes to hide. Separate multiple values with a comma (.custom-" "item-one, .custom-item-two, #new-item-id)." msgstr "" +"Saisissez les identifiants ou les classes à masquer. Séparez les valeurs " +"multiples par une virgule (.custom-item-one, .custom-item-two, #new-item-id)." #: includes/roles/class/class-pp-roles-admin.php:520 msgid "Enter the relative path only without domain for login redirect." @@ -1025,7 +1032,7 @@ msgstr "Image mise en avant" #: includes/features/frontend-features/frontend-features-ui.php:65 msgid "Features:" -msgstr "" +msgstr "Fonctionnalité :" #: includes/admin.php:1018 includes/admin.php:1128 includes/admin.php:1181 #: includes/admin.php:1396 @@ -1047,17 +1054,19 @@ msgstr "Notification dans le pied de page de l’interface publique" #: includes/features/frontend-features/frontend-features-action.php:92 msgid "Frontend element item updated. Save changes to enable for role." msgstr "" +"L’élément de l’interface publique a bien été mis à jour. Enregistrer les " +"modifications pour activer le rôle." #: includes/features/frontend-features/frontend-features-data.php:16 msgid "Frontend Elements" -msgstr "" +msgstr "Éléments de l’interface publique" #: includes/functions-admin.php:220 includes/functions-admin.php:350 #: includes/functions-admin.php:424 #: includes/features/frontend-features/frontend-features-metaboxes.php:55 #: includes/features/frontend-features/frontend-features.php:70 msgid "Frontend Features" -msgstr "" +msgstr "Fonctionnalités de l’interface publique" #: includes/functions-admin.php:351 #: includes/features/frontend-features/frontend-features.php:247 @@ -1065,6 +1074,8 @@ msgid "" "Frontend Features allows you to add or remove elements from the frontend of " "your site." msgstr "" +"Les fonctionnalités de l’interface publique vous permet d’ajouter ou de " +"supprimer des éléments de l’interface publique de votre site." #: includes/roles/class/class-pp-roles-admin.php:106 msgid "General" @@ -1098,10 +1109,8 @@ msgid "Gutenberg editor" msgstr "Éditeur Gutenberg" #: includes/features/editor-features-gutenberg.php:1 -#, fuzzy -#| msgid "Gutenberg Editor %s Restriction" msgid "Gutenberg Editor %s Restrictions" -msgstr "Restriction %s de l’éditeur Gutenberg" +msgstr "Restrictions %s de l’éditeur Gutenberg" #: includes/admin.php:236 msgid "" @@ -1136,7 +1145,7 @@ msgstr "Aide" #: includes/features/frontend-features/frontend-features-ui.php:216 msgid "Hidden IDs or Classes" -msgstr "" +msgstr "Identifiants ou classes masqués" #: includes/roles/class/class-pp-roles-list-table.php:302 msgid "Hide" @@ -1144,7 +1153,7 @@ msgstr "Masquer" #: includes/features/frontend-features/frontend-features-ui.php:72 msgid "Hide IDs or Classes" -msgstr "" +msgstr "Masquer identifiants ou classes" #: includes/functions.php:759 msgid "Home Link" @@ -1164,7 +1173,7 @@ msgstr "Mode d’emploi des fonctionnalités de l’éditeur" #: includes/features/frontend-features/frontend-features.php:253 msgid "How to use Frontend Features" -msgstr "" +msgstr "Mode d’emploi des fonctionnalités de l’interface publique" #: includes/features/nav-menus.php:307 msgid "How to use Nav Menus" @@ -1244,7 +1253,7 @@ msgstr "Sauvegarde initiale de tous les rôles" #: includes/features/frontend-features/frontend-features-action.php:56 #: includes/features/frontend-features/frontend-features-action.php:119 msgid "Invalid action. Reload this page and try again." -msgstr "" +msgstr "Action invalide. Rechargez cette page et réessayez." #: includes/admin.php:668 includes/admin.php:1292 msgid "Invalid Capabilities" @@ -1256,7 +1265,7 @@ msgstr "Jeton de nonce invalide !" #: includes/features/frontend-features/frontend-features-action.php:121 msgid "Invalid request!." -msgstr "" +msgstr "Demande invalide !" #: includes/roles/class/class-pp-roles-actions.php:211 msgid "Invalid role name entry: %s" @@ -1292,11 +1301,11 @@ msgstr "Charger plus" #: includes/features/frontend-features/frontend-features-action.php:60 msgid "Load on page types is required." -msgstr "" +msgstr "Le chargement des types de pages est obligatoire." #: includes/features/frontend-features/frontend-features-ui.php:105 msgid "Load on page types:" -msgstr "" +msgstr "Le chargement des types de pages :" #: includes/features/nav-menus.php:26 #: includes/features/frontend-features/frontend-features.php:39 @@ -1435,6 +1444,8 @@ msgstr "Nouvelle permission ajouté au rôle." #: includes/features/frontend-features/frontend-features-action.php:94 msgid "New frontend element added. Save changes to enable for role." msgstr "" +"Le nouvel élément de l’interface publique a été ajouté. Enregistrez les " +"modifications pour activer le rôle." #: includes/handler.php:45 msgid "New role created." @@ -1526,7 +1537,7 @@ msgstr "Titre de la page" #: includes/features/frontend-features/frontend-features-ui.php:235 msgid "Pages" -msgstr "" +msgstr "Pages" #: includes/features/restrict-editor-features.php:481 msgid "Paragraph" @@ -1583,7 +1594,7 @@ msgstr "Slug de publication" #: includes/features/frontend-features/frontend-features-ui.php:243 msgid "Post Type Metabox" -msgstr "" +msgstr "Boîte méta de type de publication" #: includes/manager.php:208 msgid "Post type registration does not define this capability distinctly" @@ -1597,8 +1608,6 @@ msgid "Preview" msgstr "Aperçu" #: includes/features/profile-features.php:43 -#, fuzzy -#| msgid "Profile Features Restrictions" msgid "Profile Feature Restrictions" msgstr "Restrictions des fonctionnalités du profil" @@ -1706,11 +1715,11 @@ msgstr "Rétablir" #: includes/features/profile-features.php:225 msgid "Refresh available profile items for this role" -msgstr "" +msgstr "Actualiser les éléments de profil disponibles pour ce rôle" #: includes/features/profile-features.php:227 msgid "Refresh Profile Features" -msgstr "" +msgstr "Actualiser les fonctionnalités de profil" #: includes/admin.php:1581 msgid "Regulate permissions for Edit Flow post statuses (Pro)" @@ -1795,7 +1804,7 @@ msgstr "Barre de droite" #: includes/features/frontend-features/frontend-features.php:58 msgid "Role" -msgstr "" +msgstr "Rôle" #: includes/admin.php:73 msgid "Role Capabilities" @@ -1833,6 +1842,8 @@ msgstr "Rôles" msgid "" "Roles allows you to create, edit, and delete all the user roles on your site." msgstr "" +"Rôles vous permet de créer, de modifier et de supprimer tous les rôles " +"d’utilisateur/utilisatrice sur votre site." #: includes/backup.php:308 msgid "Roles and Capabilities" @@ -1872,7 +1883,7 @@ msgstr "Enregistrer le brouillon" #: includes/features/frontend-features/frontend-features-ui.php:149 msgid "Save Edit" -msgstr "" +msgstr "Enregistrer la modification" #: includes/features/editor-features.php:115 #: includes/features/editor-features.php:217 @@ -1904,7 +1915,7 @@ msgstr "voir %1$sUtilisation des rôles%2$s : « Modèle de rôle »." #: includes/features/frontend-features/frontend-features-metaboxes.php:90 #, php-format msgid "Select %1$s..." -msgstr "" +msgstr "Sélectionnez %1$s..." #: includes/roles/class/class-pp-roles-admin.php:418 msgid "Select %s" @@ -1917,11 +1928,11 @@ msgstr "Sélectionner l’éditeur/éditrice autorisé" #: includes-core/CoreAdmin.php:121 msgid "Select pages..." -msgstr "" +msgstr "Sélectionnez les pages…" #: includes-core/frontend-features-promo.php:39 msgid "Select post types..." -msgstr "" +msgstr "Sélectionnez les types de publication…" #: includes/settings-ui.php:190 msgid "Select roles..." @@ -1931,16 +1942,16 @@ msgstr "Sélectionner les rôles…" #: includes/roles/class/class-pp-roles-admin.php:289 msgid "Select the allowed editor options for users in this role." msgstr "" -"Sélectionnez les options d’édition autorisées pour les " -"utilisateurs/utilisatrices de ce rôle." +"Sélectionnez les options d’édition autorisées pour les utilisateurs/" +"utilisatrices de ce rôle." #: includes/features/frontend-features/frontend-features-action.php:136 msgid "Selected item deleted successfully" -msgstr "" +msgstr "L’élément sélectionné a bien été supprimé." #: includes/features/frontend-features/frontend-features-ui.php:113 msgid "Selected Pages" -msgstr "" +msgstr "Pages sélectionnées" #: includes/functions-admin.php:233 includes/functions-admin.php:461 #: includes/features/restrict-editor-features.php:397 @@ -1971,7 +1982,7 @@ msgstr "Afficher uniquement les changements par rapport aux rôles actuels" #: includes/features/editor-features.php:135 msgid "show Classic Editor controls" -msgstr "" +msgstr "afficher les contrôles de l’éditeur classique" #: includes/settings-ui.php:114 msgid "Show private post types" @@ -2043,6 +2054,7 @@ msgstr "Étiquettes" #: includes/functions.php:512 msgid "Target Frontend Features for specific pages" msgstr "" +"Cibler des fonctionnalités de l’interface publique pour des pages spécifiques" #: includes/admin.php:214 msgid "Taxonomies" @@ -2218,13 +2230,16 @@ msgstr "Cette permission n’est pas disponible pour ce type de publication." #: includes/features/frontend-features/frontend-features-ui.php:41 msgid "" -"This feature allows you to modify the site frontend by hiding IDs or classes," -" adding CSS styles, or adding body classes." +"This feature allows you to modify the site frontend by hiding IDs or " +"classes, adding CSS styles, or adding body classes." msgstr "" +"Cette fonctionnalité vous permet de modifier l’interface publique du site en " +"masquant des ID ou des classes, en ajoutant des styles CSS ou des classes de " +"corps." #: includes/features/frontend-features/frontend-features-ui.php:121 msgid "This feature will be added to all pages." -msgstr "" +msgstr "Cette fonctionnalité sera ajoutée à toutes les pages." #: capsman-enhanced.php:85 msgid "This plugin can be deleted." @@ -2235,6 +2250,9 @@ msgid "" "This will add a metabox on the post editing screen. You can use this feature " "to add body classes only for that post." msgstr "" +"Cela ajoutera une boîte méta à l’écran d’édition de la publication. Vous " +"pouvez utiliser cette fonctionnalité pour ajouter des classes de corps " +"uniquement pour cette publication." #: includes/pp-ui.php:176 msgid "" @@ -2246,7 +2264,7 @@ msgstr "" #: includes/features/frontend-features/frontend-features-ui.php:58 msgid "This will only show here in the WordPress admin area." -msgstr "" +msgstr "Cela n’apparaîtra que dans la zone d’administration de WordPress." #: includes/settings-ui.php:95 msgid "" @@ -2263,7 +2281,7 @@ msgstr "Titre" #: includes/features/frontend-features/frontend-features-ui.php:52 msgid "Title:" -msgstr "" +msgstr "Titre :" #: includes/features/profile-features.php:103 #: includes/features/profile-features.php:122 @@ -2384,7 +2402,7 @@ msgstr "Utilisateurs" #: includes/features/frontend-features/frontend-features-ui.php:251 msgid "View" -msgstr "" +msgstr "Voir" #: includes/admin.php:1722 includes/features/profile-features.php:237 #: includes/features/admin-features.php:252 includes/features/nav-menus.php:306 @@ -2436,7 +2454,7 @@ msgstr "" #: includes/features/frontend-features/frontend-features-ui.php:112 msgid "Whole Site" -msgstr "" +msgstr "Site entier" #: includes/roles/class/class-pp-roles-admin.php:122 msgid "WooCommerce" @@ -2469,8 +2487,8 @@ msgstr "" #: includes/admin.php:1597 msgid "WPML integration to mirror permissions to translations (Pro)" msgstr "" -"Intégration WPML pour refléter les droits dans les traductions (Pro)" -"" +"Intégration WPML pour refléter les droits dans les traductions (Pro)" #: includes/features/restrict-admin-features.php:69 msgid "Yoast SEO" @@ -2519,13 +2537,16 @@ msgstr "" #: includes-core/CoreAdmin.php:126 msgid "You can select page types where this element will be added." -msgstr "" +msgstr "Vous pouvez sélectionner les types de page où cet élément sera ajouté." #: includes-core/frontend-features-promo.php:25 msgid "" "You can use Frontend Features to target specific posts and pages. This " "feature is available in PublishPress Capabilities Pro." msgstr "" +"Vous pouvez utiliser les « Fonctionnalités de l’interface publique » pour " +"cibler des publications et des pages spécifiques. Cette fonctionnalité est " +"disponible dans PublishPress Capabilities Pro." #: includes/handler.php:250 msgid "You cannot remove Manage Capabilities from Administrators" @@ -2554,6 +2575,7 @@ msgstr "Vous n’êtes pas autorisé à gérer les fonctionnalités de l’édit #: includes/features/frontend-features/frontend-features-action.php:117 msgid "You do not have permission to manage frontend features." msgstr "" +"Vous n’êtes pas autorisé à gérer les fonctionnalités de l’interface publique." #: includes/manager.php:701 msgid "You do not have permission to manage navigation menus." diff --git a/languages/capsman-enhanced-it_IT.mo b/languages/capsman-enhanced-it_IT.mo index 4db77676..7d2a5e81 100644 Binary files a/languages/capsman-enhanced-it_IT.mo and b/languages/capsman-enhanced-it_IT.mo differ diff --git a/languages/capsman-enhanced-it_IT.po b/languages/capsman-enhanced-it_IT.po index 03ca7478..419a73db 100644 --- a/languages/capsman-enhanced-it_IT.po +++ b/languages/capsman-enhanced-it_IT.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: Plugins - PublishPress Capabilities – User Role " "Access, Editor Permissions, Admin Menus - Stable (latest release)\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-08-01 12:21+0000\n" +"PO-Revision-Date: 2023-08-01 19:08+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" #: includes/pp-ui.php:65 msgid "" @@ -38,7 +38,7 @@ msgstr "%1$d utenti sono passati al ruolo predefinito %2$s." #: includes/features/frontend-features/frontend-features.php:250 #, php-format msgid "%1$s = Apply custom styling" -msgstr "" +msgstr "%1$s = applica stile personalizzato" #: includes/admin.php:1680 msgid "%1$s = Capability denied, even if granted by another role %2$s" @@ -168,11 +168,11 @@ msgstr "Aggiungi blocco" #: includes/features/frontend-features/frontend-features-ui.php:74 msgid "Add Body Class" -msgstr "" +msgstr "Aggiungi la classe del body" #: includes/features/frontend-features/frontend-features-ui.php:73 msgid "Add Custom CSS" -msgstr "" +msgstr "Aggiungi CSS personalizzato" #: includes/features/restrict-editor-features.php:47 #: includes/roles/roles.php:10 @@ -204,7 +204,7 @@ msgstr "Aggiungi o rimuovi questa capacità dal ruolo di WordPress" #: includes/features/frontend-features/frontend-features-ui.php:129 msgid "Add post metabox:" -msgstr "" +msgstr "Aggiungi metabox articolo:" #: includes/admin.php:1787 msgid "Add to role" @@ -281,7 +281,7 @@ msgstr[1] "Tutti %s" #: includes/features/frontend-features/frontend-features-ui.php:147 #: includes/features/frontend-features/frontend-features-action.php:58 msgid "All fields are required." -msgstr "" +msgstr "Tutti i campi sono obbligatori." #: includes/roles/class/class-pp-roles-admin.php:646 msgid "All Roles" @@ -334,12 +334,12 @@ msgstr "" #: includes/features/frontend-features/frontend-features-action.php:41 #: includes/features/frontend-features/frontend-features-action.php:110 msgid "An error occured!" -msgstr "" +msgstr "Si è verificato un errore!" #: includes/features/frontend-features/frontend-features.php:151 #, php-format msgid "Apply for %1$s" -msgstr "" +msgstr "Applica a %1$s" #: includes/manager.php:212 msgid "Are you sure you want to delete this item ?" @@ -441,7 +441,7 @@ msgstr "Contenuto" #: includes/features/frontend-features/frontend-features-ui.php:221 msgid "Body Class" -msgstr "" +msgstr "Classe body" #: includes/roles/class/class-pp-roles-admin.php:303 #, php-format @@ -495,7 +495,7 @@ msgstr "" #: includes/features/frontend-features/frontend-features-ui.php:144 msgid "Cancel Edit" -msgstr "" +msgstr "Annulla modifiche" #: includes/roles/class/class-pp-roles-actions.php:523 msgid "" @@ -522,7 +522,7 @@ msgstr "Capacità ti consente di cambiare le autorizzazioni per ciascun ruolo." #: includes/functions-admin.php:336 msgid "Capabilities allows you to change the permissions for any user role." -msgstr "" +msgstr "Capacità ti consente di cambiare le autorizzazioni per ciascun ruolo." #: includes/pp-ui.php:75 msgid "" @@ -588,7 +588,7 @@ msgstr "Elenco di controllo" #: includes/features/frontend-features/frontend-features-metaboxes.php:77 msgid "Choose Frontend Features that will apply to this post." -msgstr "" +msgstr "Scegli le caratteristiche di frontend da applicare a questo articolo." #: includes/features/editor-features.php:130 msgid "Classic" @@ -599,10 +599,8 @@ msgid "Classic editor" msgstr "Editor classico" #: includes/features/editor-features-classic.php:1 -#, fuzzy -#| msgid "Classic Editor %s Restriction" msgid "Classic Editor %s Restrictions" -msgstr "Salva le limitazioni %s dell'editor classico" +msgstr "Limitazioni %s dell'editor classico" #: includes/admin.php:718 includes/admin.php:1019 includes/admin.php:1129 #: includes/admin.php:1182 includes/admin.php:1397 @@ -676,7 +674,7 @@ msgstr "Crea la definizione di questo ruolo nei nuovi (futuri) siti" #: includes/features/frontend-features/frontend-features-ui.php:226 msgid "Custom CSS" -msgstr "" +msgstr "CSS personalizzato" #: includes-core/editor-features-promo.php:95 msgid "Custom item one" @@ -696,8 +694,8 @@ msgstr "" #: includes/admin.php:1573 msgid "" -"Custom Post Visibility statuses, fully implemented throughout wp-admin " -"(Pro)" +"Custom Post Visibility statuses, fully implemented throughout wp-admin " +"(Pro)" msgstr "" "Stati di visibilità degli articoli personalizzati, completamente " "implementati in wp-admin (Pro)" @@ -857,7 +855,7 @@ msgstr "Modifica" #: includes/features/frontend-features/frontend-features-ui.php:44 msgid "Editing:" -msgstr "" +msgstr "Modifica:" #: includes/features/restrict-editor-features.php:45 #: includes/features/restrict-editor-features.php:55 @@ -865,17 +863,15 @@ msgid "Editor" msgstr "Editor" #: includes/features/editor-features.php:69 -#, fuzzy -#| msgid "Editor Feature Restriction" msgid "Editor Feature Restrictions" -msgstr "Limitazione delle funzioni dell'editor" +msgstr "Limitazioni delle funzionalità dell'editor" #: includes/functions-admin.php:205 includes/functions-admin.php:340 #: includes/functions-admin.php:410 includes/manager.php:452 #: includes/settings-ui.php:33 #: includes/roles/class/class-pp-roles-list-table.php:173 msgid "Editor Features" -msgstr "Funzioni dell'editor" +msgstr "Funzionalità dell'editor" #: includes/functions-admin.php:341 includes/features/editor-features.php:235 msgid "" @@ -902,18 +898,25 @@ msgid "" "Enter classes that should be added to the body HTML. Separate multiple " "values with a space (custom-item-one custom-item-two)." msgstr "" +"Inserisci le classi che dovranno essere aggiunte al body HTML. Separa i " +"valori multipli con uno spazio (elemento-personalizzato-uno elemento-" +"personalizzato-due)." #: includes/features/frontend-features/frontend-features-ui.php:91 msgid "" -"Enter custom CSS to be added to frontend pages. Examples: .custom-style-1 { " -"color: red; } #custom-header { background: red; } " +"Enter custom CSS to be added to frontend pages. Examples: .custom-style-1 " +"{ color: red; } #custom-header { background: red; } " msgstr "" +"Inserisci il CSS personalizzato da aggiungere alle pagine nel frontend. " +"Esempi: .custom-style-1 { color: red; } #custom-header { background: red; } " #: includes/features/frontend-features/frontend-features-ui.php:80 msgid "" "Enter IDs or classes to hide. Separate multiple values with a comma (.custom-" "item-one, .custom-item-two, #new-item-id)." msgstr "" +"Inserisci gli ID o le classi da nascondere. Separa i valori multipli con una " +"virgola (.custom-item-one, .custom-item-two, #new-item-id)." #: includes/roles/class/class-pp-roles-admin.php:520 msgid "Enter the relative path only without domain for login redirect." @@ -1012,7 +1015,7 @@ msgstr "Immagine in evidenza" #: includes/features/frontend-features/frontend-features-ui.php:65 msgid "Features:" -msgstr "" +msgstr "Funzionalità:" #: includes/admin.php:1018 includes/admin.php:1128 includes/admin.php:1181 #: includes/admin.php:1396 @@ -1034,17 +1037,19 @@ msgstr "Avviso nel footer del frontend" #: includes/features/frontend-features/frontend-features-action.php:92 msgid "Frontend element item updated. Save changes to enable for role." msgstr "" +"Voce dell'elemento del frontend aggiornata. Salva le modifiche per " +"abilitarle per il ruolo." #: includes/features/frontend-features/frontend-features-data.php:16 msgid "Frontend Elements" -msgstr "" +msgstr "Elementi frontend" #: includes/functions-admin.php:220 includes/functions-admin.php:350 #: includes/functions-admin.php:424 #: includes/features/frontend-features/frontend-features-metaboxes.php:55 #: includes/features/frontend-features/frontend-features.php:70 msgid "Frontend Features" -msgstr "" +msgstr "Funzionalità di frontend" #: includes/functions-admin.php:351 #: includes/features/frontend-features/frontend-features.php:247 @@ -1052,6 +1057,8 @@ msgid "" "Frontend Features allows you to add or remove elements from the frontend of " "your site." msgstr "" +"Funzionalità di frontend ti consente di aggiungere o eliminare elementi dal " +"frontend del tuo sito." #: includes/roles/class/class-pp-roles-admin.php:106 msgid "General" @@ -1073,8 +1080,8 @@ msgstr "" msgid "" "Grant supplemental content permissions to a BuddyPress group (Pro)" msgstr "" -"Concede autorizzazioni di contenuto supplementari a un gruppo BuddyPress " -"(Pro)" +"Concede autorizzazioni di contenuto supplementari a un gruppo BuddyPress " +"(Pro)" #: includes/features/editor-features.php:127 msgid "Gutenberg" @@ -1085,10 +1092,8 @@ msgid "Gutenberg editor" msgstr "Editor Gutenberg" #: includes/features/editor-features-gutenberg.php:1 -#, fuzzy -#| msgid "Gutenberg Editor %s Restriction" msgid "Gutenberg Editor %s Restrictions" -msgstr "Salva le limitazioni %s dell'editor Gutenberg" +msgstr "Limitazioni %s dell'editor Gutenberg" #: includes/admin.php:236 msgid "" @@ -1123,7 +1128,7 @@ msgstr "Aiuto" #: includes/features/frontend-features/frontend-features-ui.php:216 msgid "Hidden IDs or Classes" -msgstr "" +msgstr "ID o classi nascoste" #: includes/roles/class/class-pp-roles-list-table.php:302 msgid "Hide" @@ -1131,7 +1136,7 @@ msgstr "Nascondi" #: includes/features/frontend-features/frontend-features-ui.php:72 msgid "Hide IDs or Classes" -msgstr "" +msgstr "Nascondi ID o classi" #: includes/functions.php:759 msgid "Home Link" @@ -1147,11 +1152,11 @@ msgstr "Come si usano le capacità" #: includes/features/editor-features.php:241 msgid "How to use Editor Features" -msgstr "Come si usano le funzioni dell'editor" +msgstr "Come si usano le funzionalità dell'editor" #: includes/features/frontend-features/frontend-features.php:253 msgid "How to use Frontend Features" -msgstr "" +msgstr "Come si usano le funzionalità di frontend" #: includes/features/nav-menus.php:307 msgid "How to use Nav Menus" @@ -1229,7 +1234,7 @@ msgstr "Backup iniziali di tutti i ruoli" #: includes/features/frontend-features/frontend-features-action.php:56 #: includes/features/frontend-features/frontend-features-action.php:119 msgid "Invalid action. Reload this page and try again." -msgstr "" +msgstr "Azione non valida. Ricarica la pagina e riprova." #: includes/admin.php:668 includes/admin.php:1292 msgid "Invalid Capabilities" @@ -1241,7 +1246,7 @@ msgstr "Token nonce non valido!" #: includes/features/frontend-features/frontend-features-action.php:121 msgid "Invalid request!." -msgstr "" +msgstr "Richiesta non valida!." #: includes/roles/class/class-pp-roles-actions.php:211 msgid "Invalid role name entry: %s" @@ -1277,11 +1282,11 @@ msgstr "Carica altro" #: includes/features/frontend-features/frontend-features-action.php:60 msgid "Load on page types is required." -msgstr "" +msgstr "È obbligatorio caricare i tipi di pagina." #: includes/features/frontend-features/frontend-features-ui.php:105 msgid "Load on page types:" -msgstr "" +msgstr "Caricare i tipi di pagina:" #: includes/features/nav-menus.php:26 #: includes/features/frontend-features/frontend-features.php:39 @@ -1423,6 +1428,8 @@ msgstr "La nuova capacità é stata aggiunta al ruolo." #: includes/features/frontend-features/frontend-features-action.php:94 msgid "New frontend element added. Save changes to enable for role." msgstr "" +"Aggiunto nuovo elemento del frontend. Salva le modifiche per abilitarle per " +"il ruolo." #: includes/handler.php:45 msgid "New role created." @@ -1514,7 +1521,7 @@ msgstr "Titolo pagina" #: includes/features/frontend-features/frontend-features-ui.php:235 msgid "Pages" -msgstr "" +msgstr "Pagine" #: includes/features/restrict-editor-features.php:481 msgid "Paragraph" @@ -1571,7 +1578,7 @@ msgstr "Post Slug" #: includes/features/frontend-features/frontend-features-ui.php:243 msgid "Post Type Metabox" -msgstr "" +msgstr "Metabox tipo di contenuto" #: includes/manager.php:208 msgid "Post type registration does not define this capability distinctly" @@ -1585,8 +1592,6 @@ msgid "Preview" msgstr "Anteprima" #: includes/features/profile-features.php:43 -#, fuzzy -#| msgid "Profile Features Restrictions" msgid "Profile Feature Restrictions" msgstr "Restrizioni alle caratteristiche profilo" @@ -1692,17 +1697,17 @@ msgstr "Ripeti" #: includes/features/profile-features.php:225 msgid "Refresh available profile items for this role" -msgstr "" +msgstr "Aggiorna gli elementi del profilo disponibili per questo ruolo" #: includes/features/profile-features.php:227 msgid "Refresh Profile Features" -msgstr "" +msgstr "Aggiorna le caratteristiche del profilo" #: includes/admin.php:1581 msgid "Regulate permissions for Edit Flow post statuses (Pro)" msgstr "" -"Regola le autorizzazioni per gli stati dell'articolo in Edit Flow (Pro)" -"" +"Regola le autorizzazioni per gli stati dell'articolo in Edit Flow (Pro)" #: includes/functions.php:510 msgid "Remove anything in the WordPress admin" @@ -1781,7 +1786,7 @@ msgstr "Barra destra" #: includes/features/frontend-features/frontend-features.php:58 msgid "Role" -msgstr "" +msgstr "Ruolo" #: includes/admin.php:73 msgid "Role Capabilities" @@ -1819,6 +1824,8 @@ msgstr "Ruoli" msgid "" "Roles allows you to create, edit, and delete all the user roles on your site." msgstr "" +"Ruoli ti permette di creare, modificare ed eliminare tutti i ruoli del tuo " +"sito." #: includes/backup.php:308 msgid "Roles and Capabilities" @@ -1858,7 +1865,7 @@ msgstr "Salva bozza" #: includes/features/frontend-features/frontend-features-ui.php:149 msgid "Save Edit" -msgstr "" +msgstr "Salva modifiche" #: includes/features/editor-features.php:115 #: includes/features/editor-features.php:217 @@ -1890,7 +1897,7 @@ msgstr "vedi %1$sUtilizzo dei ruoli%2$s: \"Modelli di ruolo\"" #: includes/features/frontend-features/frontend-features-metaboxes.php:90 #, php-format msgid "Select %1$s..." -msgstr "" +msgstr "Seleziona %1$s..." #: includes/roles/class/class-pp-roles-admin.php:418 msgid "Select %s" @@ -1903,11 +1910,11 @@ msgstr "Seleziona autore autorizzato" #: includes-core/CoreAdmin.php:121 msgid "Select pages..." -msgstr "" +msgstr "Seleziona le pagine…" #: includes-core/frontend-features-promo.php:39 msgid "Select post types..." -msgstr "" +msgstr "Seleziona i tipi di contenuto…" #: includes/settings-ui.php:190 msgid "Select roles..." @@ -1921,11 +1928,11 @@ msgstr "" #: includes/features/frontend-features/frontend-features-action.php:136 msgid "Selected item deleted successfully" -msgstr "" +msgstr "Gli elementi selezionati sono stati eliminati correttamente" #: includes/features/frontend-features/frontend-features-ui.php:113 msgid "Selected Pages" -msgstr "" +msgstr "Pagine selezionate" #: includes/functions-admin.php:233 includes/functions-admin.php:461 #: includes/features/restrict-editor-features.php:397 @@ -1956,7 +1963,7 @@ msgstr "Mostra le modifiche solo dai ruoli attuali" #: includes/features/editor-features.php:135 msgid "show Classic Editor controls" -msgstr "" +msgstr "mostra i controlli dell'editor classico" #: includes/settings-ui.php:114 msgid "Show private post types" @@ -2027,7 +2034,7 @@ msgstr "Tag" #: includes/functions.php:512 msgid "Target Frontend Features for specific pages" -msgstr "" +msgstr "Caratteristiche di frontend mirate per pagine specifiche" #: includes/admin.php:214 msgid "Taxonomies" @@ -2199,13 +2206,15 @@ msgstr "Questa funzionalità non è disponibile per questo tipo di contenuto." #: includes/features/frontend-features/frontend-features-ui.php:41 msgid "" -"This feature allows you to modify the site frontend by hiding IDs or classes," -" adding CSS styles, or adding body classes." +"This feature allows you to modify the site frontend by hiding IDs or " +"classes, adding CSS styles, or adding body classes." msgstr "" +"Questa funzionalità ti permette di modificare il frontend del sito " +"nascondendo gli ID o le classi, aggiungendo stili CSS o classi al body." #: includes/features/frontend-features/frontend-features-ui.php:121 msgid "This feature will be added to all pages." -msgstr "" +msgstr "Questa funzionalità verrà aggiunta a tutte le pagine." #: capsman-enhanced.php:85 msgid "This plugin can be deleted." @@ -2216,6 +2225,9 @@ msgid "" "This will add a metabox on the post editing screen. You can use this feature " "to add body classes only for that post." msgstr "" +"Questo aggiugerà un metabox nella schermata di modifica dell'articolo. Puoi " +"usare questa funzionalità per aggiungere classi al body solo per " +"quell'articolo." #: includes/pp-ui.php:176 msgid "" @@ -2228,6 +2240,7 @@ msgstr "" #: includes/features/frontend-features/frontend-features-ui.php:58 msgid "This will only show here in the WordPress admin area." msgstr "" +"Questo sarà mostrato soltanto qui nell'area di amministrazione di WordPress." #: includes/settings-ui.php:95 msgid "" @@ -2243,7 +2256,7 @@ msgstr "Titolo" #: includes/features/frontend-features/frontend-features-ui.php:52 msgid "Title:" -msgstr "" +msgstr "Titolo:" #: includes/features/profile-features.php:103 #: includes/features/profile-features.php:122 @@ -2360,7 +2373,7 @@ msgstr "Utenti" #: includes/features/frontend-features/frontend-features-ui.php:251 msgid "View" -msgstr "" +msgstr "Vedi" #: includes/admin.php:1722 includes/features/profile-features.php:237 #: includes/features/admin-features.php:252 includes/features/nav-menus.php:306 @@ -2412,7 +2425,7 @@ msgstr "" #: includes/features/frontend-features/frontend-features-ui.php:112 msgid "Whole Site" -msgstr "" +msgstr "Sito intero" #: includes/roles/class/class-pp-roles-admin.php:122 msgid "WooCommerce" @@ -2445,8 +2458,8 @@ msgstr "" #: includes/admin.php:1597 msgid "WPML integration to mirror permissions to translations (Pro)" msgstr "" -"Integrazione con WPML per trasmettere le autorizzazioni alle traduzioni " -"(Pro)" +"Integrazione con WPML per trasmettere le autorizzazioni alle traduzioni " +"(Pro)" #: includes/features/restrict-admin-features.php:69 msgid "Yoast SEO" @@ -2495,13 +2508,16 @@ msgstr "" #: includes-core/CoreAdmin.php:126 msgid "You can select page types where this element will be added." -msgstr "" +msgstr "Puoi selezionare i tipi di pagina dove verrà aggiunto questo elemento." #: includes-core/frontend-features-promo.php:25 msgid "" "You can use Frontend Features to target specific posts and pages. This " "feature is available in PublishPress Capabilities Pro." msgstr "" +"Puoi utilizzare le funzionalità di frontend per indirizzare articoli e " +"pagine specifiche. Questa caratteristica è disponibile in PublishPress " +"Capabilities Pro." #: includes/handler.php:250 msgid "You cannot remove Manage Capabilities from Administrators" @@ -2530,7 +2546,7 @@ msgstr "Non hai i permessi per gestire le funzionalità dell'editor." #: includes/features/frontend-features/frontend-features-action.php:54 #: includes/features/frontend-features/frontend-features-action.php:117 msgid "You do not have permission to manage frontend features." -msgstr "" +msgstr "Non hai i permessi per gestire le funzionalità di frontend." #: includes/manager.php:701 msgid "You do not have permission to manage navigation menus." diff --git a/languages/capsman-enhanced.pot b/languages/capsman-enhanced.pot index 18b1ed4f..eaf6fa84 100644 --- a/languages/capsman-enhanced.pot +++ b/languages/capsman-enhanced.pot @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: PublishPress Capabilities\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-01 12:15+0000\n" +"POT-Creation-Date: 2023-09-06 13:52+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Kevin Behrens \n" "Language-Team: PublishPress \n" @@ -90,11 +90,11 @@ msgstr "" msgid "%1$sReturn to Administrator view%2$s" msgstr "" -#: capsman-enhanced.php:55 +#: capsman-enhanced.php:80 #, php-format msgid "" "%1s Error: %2s PublishPress Capabilities cannot function because another " -"copy of Capability Manager is active." +"copy of the plugin is active." msgstr "" #: includes/admin.php:1608 @@ -112,11 +112,6 @@ msgstr "" msgid "%s info/purchase" msgstr "" -#: capsman-enhanced.php:115 -#, php-format -msgid "%s is required for this plugin." -msgstr "" - #: includes/backup-handler.php:119 #, php-format msgid "%s restored from last backup." @@ -163,11 +158,11 @@ msgid "" "never automatically replaced." msgstr "" -#: includes/manager.php:1327 +#: includes/manager.php:1334 msgid "About" msgstr "" -#: includes/manager.php:1327 +#: includes/manager.php:1334 msgid "About PublishPress Capabilities" msgstr "" @@ -207,15 +202,15 @@ msgstr "" msgid "Add New Category" msgstr "" -#: includes/manager.php:213 +#: includes/manager.php:220 msgid "Add or clear custom item entry before saving changes." msgstr "" -#: includes/manager.php:211 +#: includes/manager.php:218 msgid "Add or remove capability from the role normally" msgstr "" -#: includes/manager.php:210 +#: includes/manager.php:217 msgid "Add or remove this capability from the WordPress role" msgstr "" @@ -244,7 +239,7 @@ msgid "Admin Feature Restrictions" msgstr "" #: includes/functions-admin.php:216 includes/functions-admin.php:345 -#: includes/functions-admin.php:417 includes/manager.php:453 +#: includes/functions-admin.php:417 includes/manager.php:460 #: includes/roles/class/class-pp-roles-list-table.php:174 msgid "Admin Features" msgstr "" @@ -269,8 +264,8 @@ msgstr "" msgid "Admin Menu restrictions" msgstr "" -#: includes/functions-admin.php:439 includes/manager.php:454 -#: includes-core/CoreAdmin.php:80 +#: includes/functions-admin.php:439 includes/manager.php:461 +#: includes-core/CoreAdmin.php:76 #: includes/roles/class/class-pp-roles-list-table.php:176 msgid "Admin Menus" msgstr "" @@ -342,7 +337,7 @@ msgstr "" msgid "Apply for %1$s" msgstr "" -#: includes/manager.php:212 +#: includes/manager.php:219 msgid "Are you sure you want to delete this item ?" msgstr "" @@ -391,7 +386,7 @@ msgstr "" msgid "Backup Tool for PublishPress Capabilities" msgstr "" -#: includes/manager.php:1012 +#: includes/manager.php:1019 msgid "Bad form Received" msgstr "" @@ -488,12 +483,12 @@ msgid "" "Cannot delete default role. You have to change it first." msgstr "" -#: includes/manager.php:1329 +#: includes/manager.php:1336 msgid "Capabilites Documentation" msgstr "" #: includes/functions-admin.php:335 includes/functions-admin.php:403 -#: includes/manager.php:346 includes/manager.php:451 +#: includes/manager.php:353 includes/manager.php:458 #: includes/settings-ui.php:32 includes/admin-load.php:468 #: includes/roles/class/class-pp-roles-admin.php:721 #: includes/roles/class/class-pp-roles-list-table.php:172 @@ -595,11 +590,11 @@ msgstr "" msgid "Comments" msgstr "" -#: includes/manager.php:1331 +#: includes/manager.php:1338 msgid "Contact" msgstr "" -#: includes/manager.php:1331 +#: includes/manager.php:1338 msgid "Contact the PublishPress team" msgstr "" @@ -769,7 +764,7 @@ msgstr "" msgid "Document Panel" msgstr "" -#: includes/manager.php:1329 +#: includes/manager.php:1336 msgid "Documentation" msgstr "" @@ -826,7 +821,7 @@ msgid "Editor Feature Restrictions" msgstr "" #: includes/functions-admin.php:205 includes/functions-admin.php:340 -#: includes/functions-admin.php:410 includes/manager.php:452 +#: includes/functions-admin.php:410 includes/manager.php:459 #: includes/settings-ui.php:33 #: includes/roles/class/class-pp-roles-list-table.php:173 msgid "Editor Features" @@ -912,11 +907,11 @@ msgstr "" msgid "Exclude users in selected roles from User Testing." msgstr "" -#: includes/manager.php:207 +#: includes/manager.php:214 msgid "Explicitly negate these capabilities by storing as disabled" msgstr "" -#: includes/manager.php:206 +#: includes/manager.php:213 msgid "Explicity negate this capability by storing as disabled" msgstr "" @@ -1111,7 +1106,7 @@ msgid "" "will be lost." msgstr "" -#: includes/manager.php:1316 +#: includes/manager.php:1323 #, php-format msgid "If you like %s, please leave us a %s rating. Thank you!" msgstr "" @@ -1299,7 +1294,7 @@ msgid "Nav Menu" msgstr "" #: includes/functions-admin.php:360 includes/functions-admin.php:447 -#: includes/manager.php:455 +#: includes/manager.php:462 #: includes/roles/class/class-pp-roles-list-table.php:177 msgid "Nav Menus" msgstr "" @@ -1316,7 +1311,7 @@ msgstr "" msgid "Need PublishPress Capabilities Support?" msgstr "" -#: includes/backup-handler.php:283 +#: includes/backup-handler.php:285 msgid "Needed function to create default roles not found!" msgstr "" @@ -1341,7 +1336,7 @@ msgstr "" msgid "New backup saved." msgstr "" -#: includes/manager.php:971 +#: includes/manager.php:978 msgid "New capability added to role." msgstr "" @@ -1496,7 +1491,7 @@ msgstr "" msgid "Post Type Metabox" msgstr "" -#: includes/manager.php:208 +#: includes/manager.php:215 msgid "Post type registration does not define this capability distinctly" msgstr "" @@ -1704,7 +1699,7 @@ msgid "" "capabilities." msgstr "" -#: includes/manager.php:449 includes/roles/class/class-pp-roles-admin.php:177 +#: includes/manager.php:456 includes/roles/class/class-pp-roles-admin.php:177 #: includes/roles/class/class-pp-roles-list-table.php:170 msgid "Role Name" msgstr "" @@ -1727,7 +1722,7 @@ msgstr "" msgid "Roles and Capabilities" msgstr "" -#: includes/backup-handler.php:296 +#: includes/backup-handler.php:304 msgid "Roles and Capabilities reset to WordPress defaults" msgstr "" @@ -1804,7 +1799,7 @@ msgstr "" msgid "Select allowed editor" msgstr "" -#: includes-core/CoreAdmin.php:121 +#: includes-core/CoreAdmin.php:117 msgid "Select pages..." msgstr "" @@ -1838,8 +1833,8 @@ msgstr "" msgid "Settings saved." msgstr "" -#: includes/manager.php:562 includes/manager.php:616 includes/manager.php:664 -#: includes/manager.php:714 includes/manager.php:796 +#: includes/manager.php:569 includes/manager.php:623 includes/manager.php:671 +#: includes/manager.php:721 includes/manager.php:803 msgid "Settings updated." msgstr "" @@ -1989,11 +1984,6 @@ msgid "" "lowercase and contains only letters, numbers and underscores." msgstr "" -#: capsman-enhanced.php:113 -#, php-format -msgid "The active plugin %s is not compatible with your PHP version." -msgstr "" - #: includes/admin.php:1297 msgid "" "The following entries have no effect. Please assign desired capabilities on " @@ -2034,7 +2024,7 @@ msgstr "" msgid "The selected %1$s roles were successfully deleted. %2$s" msgstr "" -#: includes/handler.php:61 includes/handler.php:89 includes/manager.php:983 +#: includes/handler.php:61 includes/handler.php:89 includes/manager.php:990 msgid "The selected role is not editable." msgstr "" @@ -2081,7 +2071,7 @@ msgid "" "to be controlled independently." msgstr "" -#: includes/manager.php:209 +#: includes/manager.php:216 msgid "This capability is explicitly negated. Click to add/remove normally." msgstr "" @@ -2099,7 +2089,7 @@ msgstr "" msgid "This feature will be added to all pages." msgstr "" -#: capsman-enhanced.php:85 +#: capsman-enhanced.php:109 msgid "This plugin can be deleted." msgstr "" @@ -2240,7 +2230,7 @@ msgstr "" msgid "User Testing" msgstr "" -#: includes/manager.php:450 +#: includes/manager.php:457 #: includes/roles/class/class-pp-roles-list-table.php:171 msgid "Users" msgstr "" @@ -2260,7 +2250,7 @@ msgstr "" msgid "View Knowledge Base" msgstr "" -#: capsman-enhanced.php:112 includes/backup.php:285 includes/backup.php:332 +#: includes/backup.php:285 includes/backup.php:332 msgid "Warning:" msgstr "" @@ -2357,7 +2347,7 @@ msgid "" "PublishPress Capabilities Pro" msgstr "" -#: includes-core/CoreAdmin.php:126 +#: includes-core/CoreAdmin.php:122 msgid "You can select page types where this element will be added." msgstr "" @@ -2375,38 +2365,38 @@ msgstr "" msgid "You do not have permission to access this page." msgstr "" -#: includes/manager.php:578 includes/manager.php:600 includes/manager.php:679 -#: includes/manager.php:730 includes/manager.php:813 +#: includes/manager.php:585 includes/manager.php:607 includes/manager.php:686 +#: includes/manager.php:737 includes/manager.php:820 msgid "You do not have permission to manage admin features." msgstr "" -#: includes/manager.php:905 includes/manager.php:939 includes/manager.php:957 +#: includes/manager.php:912 includes/manager.php:946 includes/manager.php:964 msgid "You do not have permission to manage capabilities." msgstr "" -#: includes/manager.php:505 includes/manager.php:527 +#: includes/manager.php:512 includes/manager.php:534 msgid "You do not have permission to manage editor features." msgstr "" -#: includes/manager.php:631 includes/manager.php:653 +#: includes/manager.php:638 includes/manager.php:660 #: includes/features/frontend-features/frontend-features-action.php:54 #: includes/features/frontend-features/frontend-features-action.php:117 msgid "You do not have permission to manage frontend features." msgstr "" -#: includes/manager.php:701 +#: includes/manager.php:708 msgid "You do not have permission to manage navigation menus." msgstr "" -#: includes/manager.php:752 +#: includes/manager.php:759 msgid "You do not have permission to manage profile features." msgstr "" -#: includes/manager.php:482 +#: includes/manager.php:489 msgid "You do not have permission to manage roles." msgstr "" -#: includes/manager.php:1170 +#: includes/manager.php:1177 msgid "You do not have permission to perform this action." msgstr "" @@ -2414,7 +2404,7 @@ msgstr "" msgid "You do not have permission to restore backup." msgstr "" -#: includes/manager.php:1132 +#: includes/manager.php:1139 msgid "You do not have permission to restore roles." msgstr "" diff --git a/lib/composer.json b/lib/composer.json new file mode 100644 index 00000000..d83eaa85 --- /dev/null +++ b/lib/composer.json @@ -0,0 +1,21 @@ +{ + "minimum-stability": "dev", + "prefer-stable": true, + "config": { + "vendor-dir": "vendor", + "preferred-install": { + "*": "dist" + }, + "platform-check": false, + "autoloader-suffix": "PublishPressCapabilities" + }, + "require": { + "php": ">=7.2.5", + "publishpress/psr-container": "^2.0", + "publishpress/pimple-pimple": "^3.5", + "publishpress/wordpress-reviews": "^1.1", + "publishpress/instance-protection": "^2.0", + "publishpress/wordpress-version-notices": "^2.1", + "publishpress/wordpress-banners": "^1.3" + } +} diff --git a/lib/composer.lock b/lib/composer.lock new file mode 100644 index 00000000..3424560c --- /dev/null +++ b/lib/composer.lock @@ -0,0 +1,432 @@ +{ + "_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": "c8cd15a16d106116f5bb584106ab5426", + "packages": [ + { + "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-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/autoload.php b/lib/vendor/autoload.php new file mode 100644 index 00000000..41dbbbc4 --- /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..a188b76e --- /dev/null +++ b/lib/vendor/composer/autoload_files.php @@ -0,0 +1,14 @@ + $vendorDir . '/publishpress/psr-container/lib/include.php', + '24b27b1b9a32bf58eda571c3e5ae3480' => $vendorDir . '/publishpress/pimple-pimple/lib/include.php', + '0078757fbd019a5f202f2be6585c3626' => $vendorDir . '/publishpress/wordpress-banners/BannersMain.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 @@ +register(true); + + $filesToLoad = \Composer\Autoload\ComposerStaticInitPublishPressCapabilities::$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..2565573d --- /dev/null +++ b/lib/vendor/composer/autoload_static.php @@ -0,0 +1,28 @@ + __DIR__ . '/..' . '/publishpress/psr-container/lib/include.php', + '24b27b1b9a32bf58eda571c3e5ae3480' => __DIR__ . '/..' . '/publishpress/pimple-pimple/lib/include.php', + '0078757fbd019a5f202f2be6585c3626' => __DIR__ . '/..' . '/publishpress/wordpress-banners/BannersMain.php', + '41c664bd04a95c2d6a2f2a3e00f06593' => __DIR__ . '/..' . '/publishpress/wordpress-reviews/ReviewsController.php', + 'a61bc28a742b9f9f2fd5ef4d2d1e2037' => __DIR__ . '/..' . '/publishpress/wordpress-version-notices/src/include.php', + ); + + public static $classMap = array ( + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->classMap = ComposerStaticInitPublishPressCapabilities::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/lib/vendor/composer/installed.json b/lib/vendor/composer/installed.json new file mode 100644 index 00000000..0d2c1a2e --- /dev/null +++ b/lib/vendor/composer/installed.json @@ -0,0 +1,435 @@ +{ + "packages": [ + { + "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-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..74758c18 --- /dev/null +++ b/lib/vendor/composer/installed.php @@ -0,0 +1,77 @@ + array( + 'name' => '__root__', + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => '145e37dd296fc582db3b045feb88c0dc426709d4', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev' => true, + ), + 'versions' => array( + '__root__' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => '145e37dd296fc582db3b045feb88c0dc426709d4', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + '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-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-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/readme.txt b/readme.txt index f9ee0d25..c63615d1 100644 --- a/readme.txt +++ b/readme.txt @@ -4,10 +4,10 @@ Contributors: publishpress, kevinB, stevejburge, andergmartins, olatechpro Author: PublishPress Author URI: https://publishpress.com Tags: capabilities, permissions, admin menus, user roles, user role editor, access control, members, edit capabilities, publishpress capabilities, multisite capabilities, roles access, post editing screen, taxonomy capabilities, post permissions, page permisisons, woocommerce capabilities, user testing, user switching, hide metaboxes, hide editor features, media library capabilities, post type permissions, user role capabilities, edit user roles, administrator, editor, subscriber, contributor, author, shop manager -Requires at least: 4.9.7 -Tested up to: 6.2 -Requires PHP: 5.6.20 -Stable tag: 2.9.1 +Requires at least: 5.5 +Requires PHP: 7.2.5 +Tested up to: 6.3 +Stable tag: 2.10.0 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -410,6 +410,14 @@ Fixed : Security issue. Please update. == Changelog == += 2.10.0 - 6 Sep 2023 = + * 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: "publishpress_capabilities_loaded" which runs after the requirements and libraries are loaded, but before the plugin is initialized; + = 2.9.1 - 1 Aug 2023 = * Fixed : Fatal error: Uncaught Error: Call to a member function has_cap() on null in Installer class, #880