diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6fc4636 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: php-actions/composer@v6 + with: + # Lowest supported PHP version + php_version: "7.4" + - run: composer run package + - name: Release + uses: fnkr/github-action-ghr@v1 + env: + GHR_COMPRESS: zip + GHR_PATH: releases/ + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index c923bf8..62d6fb7 100644 --- a/.gitignore +++ b/.gitignore @@ -98,3 +98,4 @@ vendor !/src/vendor tests/coverage +releases diff --git a/CHANGELOG.md b/CHANGELOG.md index 93523df..288f5fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## Version [3.7.0] (2023-03-??) + +- Updates can now be provided through the Admin interface + ## Version [3.6.4] (2023-02-09) ### Fix diff --git a/README.md b/README.md index c83c3f4..bc933b7 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,43 @@ -# README +# Plugin OpenPDC Base -### OpenPDC base +This repository contains the the OpenwebConcept OpenPDC plugin. -Plugin to add the OpenwebConcept OpenPDC to your project. +## Installation -- Contributors: Yard | Digital Agency -- Requires at least: 4.8 -- Tested up to: 5.4.2 -- Requires PHP: 7.2 -- Stable tag: 3.5.0 +Before installation, make sure you install following required plugins: + - [RWMB Metabox](https://wordpress.org/plugins/meta-box/) + - [Posts 2 Posts](https://wordpress.org/plugins/posts-to-posts/) + +### For users +1. Download the latest release from [the releases page](https://github.com/OpenWebconcept/plugin-pdc-base/releases) +2. Unzip and move all files to the `/wp-content/plugins/pdc-base` directory. +3. Log into the WordPress admin and activate the 'Yard | OpenPDC Base' plugin through the 'plugins' menu +4. Go to the 'PDC instellingen' pagina in the left-hand menu to enter some of the required settings -### How do I get set up? +### For developers +To contribute to this project, no dependencies are required. However, you will need to download [Composer](https://getcomposer.org/) to run tests or create an optimized build of the plugin. -- Unzip and/or move all files to the /wp-content/plugins/pdc-base directory -- Log into WordPress admin and activate the ‘PDC Base’ plugin through the ‘Plugins’ menu** -- Go to the 'PDC instellingen pagina' in the left-hand menu to enter some of the required settings +1. Clone this repository to your machine and/or WordPress installation +2. Optionally use Composer (`composer install`) to install the dev dependencies -### **Error(s)? -Where the activate 'PDCBase' plugin causes the following error +To create an optimized and zipped build, run the `composer run package` command. This requires `Composer`, `rsync` and `zip` to run. + +### Activation error(s)? +When activating the 'PDCBase' plugin is causing the following error: ![activateplugin-error](./assets/images/pluginactivate-error.png) - just install the missing ones via: +Install the following required plugins: - [RWMB Metabox](https://wordpress.org/plugins/meta-box/) - [Posts 2 Posts](https://wordpress.org/plugins/posts-to-posts/) - In addition, you still have to install the extra dependencies with Composer. Depending on your setup, you do this by opening your terminal, navigating to the OpenPDC plugin folder and running `sudo -u www-data composer install` there. - - Reactivating the plugin works fine now. +Activating the plugin after installation should fix the issue: ![pluginactivated](./assets/images/pluginactivated.png) -#### Additional Settings +### Additional Settings -On the 'PDC instellingen pagina' there are 2 settings optional for extending the slug used in the 'view in portal' url. +On the 'PDC instellingen' page there are 2 optional settings for extending the slug used in the 'view in portal' url. The 'view in portal' button can be found in de wp-admin bar on the editor pages of the pdc-items or inside the 'quick edit' blocks on the overview page of pdc-items. With these optional settings the theme and subtheme can be included into the 'view in portal' url. @@ -41,7 +45,7 @@ Additionally, there is a possibility to use a fourth layer called 'pdc-groups'. Finally, pdc-items can support multiple identifications for scheduling an appointment. Currently there are meta settings for DigiD, eHerkenning and eIDAS. You can set those values in the editor of a pdc-item. -### Connections +## Connections Some connections between posttypes are required for the portal to work properly. The required connections and in the correct order when filling the website: @@ -50,11 +54,11 @@ Some connections between posttypes are required for the portal to work properly. 3. pdc-group -> pdc-item, pdc-theme and pdc-subtheme (pdc-groups usage is optional) 4. pdc-item -> pdc-theme, pdc-subtheme -### Filters & Actions +## Filters & Actions There are various [hooks](https://codex.wordpress.org/Plugin_API/Hooks), which allows for changing the output. -##### Action for changing main Plugin object. +### Action for changing main Plugin object. ```php 'owc/pdc-base/plugin' @@ -72,86 +76,86 @@ Via the plugin object the following config settings can be adjusted - settings_pages - taxonomies -##### Filters the Posts to Posts connection defaults. +### Filters the Posts to Posts connection defaults. ```php owc/pdc-base/p2p-connection-defaults ``` -##### Filters the per Posts to Posts connection, connection type args. +### Filters the per Posts to Posts connection, connection type args. ```php owc/pdc-base/before-register-p2p-connection/{$posttypes_from}/{$posttypes_to]} ``` -##### Filters the data retrieved for this Rest API field. +### Filters the data retrieved for this Rest API field. ```php owc/pdc-base/rest-api/pdcitem/field/get-links ``` -##### Filters the data retrieved for this Rest API field. +### Filters the data retrieved for this Rest API field. ```php owc/pdc-base/rest-api/pdcitem/field/get-forms ``` -##### Filters the data retrieved for this Rest API field. +### Filters the data retrieved for this Rest API field. ```php owc/pdc-base/rest-api/pdcitem/field/get-downloads ``` -##### Filters the data retrieved for this Rest API field. +### Filters the data retrieved for this Rest API field. ```php owc/pdc-base/rest-api/pdcitem/field/get-title-alternative ``` -##### Filters the data retrieved for this Rest API field. +### Filters the data retrieved for this Rest API field. ```php owc/pdc-base/rest-api/pdcitem/field/get-appointment ``` -##### Filters the data retrieved for this Rest API field. +### Filters the data retrieved for this Rest API field. ```php owc/pdc-base/rest-api/pdcitem/field/get-featured_image ``` -##### Filters the data retrieved for this Rest API field. +### Filters the data retrieved for this Rest API field. ```php owc/pdc-base/rest-api/pdcitem/field/get-taxonomies owc/pdc-base/core/posttype/posttypes/pdc_item/get-taxonomies/taxonomy-ids ``` -##### Filters the data retrieved for this Rest API field. +### Filters the data retrieved for this Rest API field. ```php owc/pdc-base/rest-api/pdcitem/field/get-connections ``` -##### Filters the data retrieved for this Rest API field. +### Filters the data retrieved for this Rest API field. ```php owc/pdc-base/rest-api/pdcsubcategory/field/has-report ``` -##### Filters the data retrieved for this Rest API field. +### Filters the data retrieved for this Rest API field. ```php owc/pdc-base/rest-api/pdcsubcategory/field/has-appointment ``` -##### Filters the metaboxes to be registered just before registration. +### Filters the metaboxes to be registered just before registration. ```php owc/pdc-base/before-register-metaboxes ``` -##### Filters the settings to be registered just before registration. +### Filters the settings to be registered just before registration. ```php owc/pdc-base/before-register-settings @@ -164,7 +168,7 @@ owc/pdc-base/rest-api/shared-items/field/before-creation-featured-image owc/pdc-base/rest-api/shared-items/field/after-creation-featured-image ``` -### Translations +## Translations If you want to use your own set of labels/names/descriptions and so on you can do so. All text output in this plugin is controlled via the gettext methods. @@ -181,7 +185,7 @@ This plugin provides an easy interface for custom translations and a way to stor For instructions how to use the 'Loco Translate' plugin, we advice you to read the Beginners's guide page on their website: https://localise.biz/wordpress/plugin/beginners or start at the homepage: https://localise.biz/wordpress/plugin -### Running tests +## Running tests To run the Unit tests go to a command-line. @@ -197,9 +201,9 @@ For code coverage report, generate report with command line command and view res composer unit-coverage ``` -### Contribution guidelines +## Contribution guidelines -##### Writing tests +### Writing tests Have a look at the code coverage reports to see where more coverage can be obtained. Write tests. @@ -207,4 +211,4 @@ Create a Pull request to the OWC repository. ### Who do I talk to? -IF you have questions about or suggestions for this plugin, please contact Holger Peters from Gemeente Buren. +If you have questions about or suggestions for this plugin, please contact Holger Peters from Gemeente Buren. diff --git a/bin/package.sh b/bin/package.sh new file mode 100755 index 0000000..52b303c --- /dev/null +++ b/bin/package.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +## Remove old packages +rm -rf ./releases +mkdir -p ./releases + +# Copy current dir to tmp +rsync \ + -ua \ + --exclude='vendor/*' \ + --exclude='releases/*' \ + ./ ./releases/pdc-base/ + +# Remove current vendor folder (if any) +# and install the dependencies without dev packages. +cd ./releases/pdc-base || exit +composer install -o --no-dev + +# Remove unneeded files in a WordPress plugin +rm -rf ./.git ./composer.json ./.gitignore ./.editorconfig ./.eslintignore \ + ./.eslintrc ./.php-cs-fixer.php ./composer.lock ./bin \ + ./phpstan.neon.dist ./phpunit.xml.dist ./tests \ + ./DOCKER_ENV ./docker_tag ./output.log ./.github + +cd ../ + +# Create a zip file from the optimized plugin folder +zip -rq pdc-base.zip ./pdc-base +rm -rf ./pdc-base + +echo "Zip completed @ $(pwd)/pdc-base.zip" diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml deleted file mode 100644 index 6596d90..0000000 --- a/bitbucket-pipelines.yml +++ /dev/null @@ -1,27 +0,0 @@ -image: yardinternet/php7.2-composer - -pipelines: - custom: - manually: - - step: - name: unit test - caches: - - composer - - vendor-directory - script: - - composer install --no-interaction --no-progress --prefer-dist --ignore-platform-reqs - - ./vendor/bin/phpunit --testsuite "Unit Test Suite" - branches: - "{master,develop}": - - step: - name: unit test - caches: - - composer - - vendor-directory - script: - - composer install --no-interaction --no-progress --prefer-dist --ignore-platform-reqs - - ./vendor/bin/phpunit --testsuite "Unit Test Suite" - -definitions: - caches: - vendor-directory: vendor diff --git a/composer.json b/composer.json index 2d111ae..9240469 100644 --- a/composer.json +++ b/composer.json @@ -10,8 +10,9 @@ ], "type": "wordpress-plugin", "require": { - "php": "^7.0|^8.0", - "johnbillion/extended-cpts": "^4.0" + "php": "^7.4|^8.0", + "johnbillion/extended-cpts": "^4.0", + "yahnis-elsts/plugin-update-checker": "^5.0" }, "require-dev": { "10up/wp_mock": "~0.5", @@ -37,6 +38,7 @@ "@unit" ], "unit": "clear && ./vendor/bin/phpunit --testdox --stderr --testsuite 'Unit Test Suite' --colors=always", - "unit-coverage": "clear && XDEBUG_MODE=coverage ./vendor/bin/phpunit --stderr --testsuite 'Unit Test Suite' --prepend tests/xdebug-filter.php --colors=always --coverage-html ./tests/coverage" + "unit-coverage": "clear && XDEBUG_MODE=coverage ./vendor/bin/phpunit --stderr --testsuite 'Unit Test Suite' --prepend tests/xdebug-filter.php --colors=always --coverage-html ./tests/coverage", + "package": "chmod +x ./bin/package.sh && ./bin/package.sh" } } diff --git a/composer.lock b/composer.lock index 0b8d8e4..cfd6a8a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c150af69ad7383b95f169b6a5e91dbae", + "content-hash": "ff20c75b853648a6f9dc6493461c3bc1", "packages": [ { "name": "johnbillion/extended-cpts", @@ -74,6 +74,56 @@ } ], "time": "2021-03-21T00:26:19+00:00" + }, + { + "name": "yahnis-elsts/plugin-update-checker", + "version": "v5.0", + "source": { + "type": "git", + "url": "https://github.com/YahnisElsts/plugin-update-checker.git", + "reference": "81be284da76f12c8751b477b2a0fa44364d26f84" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/YahnisElsts/plugin-update-checker/zipball/81be284da76f12c8751b477b2a0fa44364d26f84", + "reference": "81be284da76f12c8751b477b2a0fa44364d26f84", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.6.20" + }, + "type": "library", + "autoload": { + "files": [ + "load-v5p0.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Yahnis Elsts", + "email": "whiteshadow@w-shadow.com", + "homepage": "https://w-shadow.com/", + "role": "Developer" + } + ], + "description": "A custom update checker for WordPress plugins and themes. Useful if you can't host your plugin in the official WP repository but still want it to support automatic updates.", + "homepage": "https://github.com/YahnisElsts/plugin-update-checker/", + "keywords": [ + "automatic updates", + "plugin updates", + "theme updates", + "wordpress" + ], + "support": { + "issues": "https://github.com/YahnisElsts/plugin-update-checker/issues", + "source": "https://github.com/YahnisElsts/plugin-update-checker/tree/v5.0" + }, + "time": "2022-10-28T17:46:32+00:00" } ], "packages-dev": [ @@ -125,16 +175,16 @@ }, { "name": "antecedent/patchwork", - "version": "2.1.21", + "version": "2.1.25", "source": { "type": "git", "url": "https://github.com/antecedent/patchwork.git", - "reference": "25c1fa0cd9a6e6d0d13863d8df8f050b6733f16d" + "reference": "17314e042d45e0dacb0a494c2d1ef50e7621136a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antecedent/patchwork/zipball/25c1fa0cd9a6e6d0d13863d8df8f050b6733f16d", - "reference": "25c1fa0cd9a6e6d0d13863d8df8f050b6733f16d", + "url": "https://api.github.com/repos/antecedent/patchwork/zipball/17314e042d45e0dacb0a494c2d1ef50e7621136a", + "reference": "17314e042d45e0dacb0a494c2d1ef50e7621136a", "shasum": "" }, "require": { @@ -167,9 +217,9 @@ ], "support": { "issues": "https://github.com/antecedent/patchwork/issues", - "source": "https://github.com/antecedent/patchwork/tree/2.1.21" + "source": "https://github.com/antecedent/patchwork/tree/2.1.25" }, - "time": "2022-02-07T07:28:34+00:00" + "time": "2023-02-19T12:51:24+00:00" }, { "name": "composer/pcre", @@ -391,16 +441,16 @@ }, { "name": "doctrine/annotations", - "version": "1.14.1", + "version": "1.14.3", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "9e034d7a70032d422169f27d8759e8d84abb4f51" + "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/9e034d7a70032d422169f27d8759e8d84abb4f51", - "reference": "9e034d7a70032d422169f27d8759e8d84abb4f51", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", + "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", "shasum": "" }, "require": { @@ -461,9 +511,9 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.14.1" + "source": "https://github.com/doctrine/annotations/tree/1.14.3" }, - "time": "2022-12-12T12:46:12+00:00" + "time": "2023-02-01T09:20:38+00:00" }, { "name": "doctrine/deprecations", @@ -510,30 +560,30 @@ }, { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", "phpbench/phpbench": "^0.16 || ^1", "phpstan/phpstan": "^1.4", "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -560,7 +610,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { @@ -576,20 +626,20 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "doctrine/lexer", - "version": "2.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "3cf140b81e55d5d640f73367d829db7e3023ef69" + "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/3cf140b81e55d5d640f73367d829db7e3023ef69", - "reference": "3cf140b81e55d5d640f73367d829db7e3023ef69", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", + "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", "shasum": "" }, "require": { @@ -638,7 +688,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/2.0.0" + "source": "https://github.com/doctrine/lexer/tree/2.1.0" }, "funding": [ { @@ -654,7 +704,7 @@ "type": "tidelift" } ], - "time": "2022-12-11T10:51:23+00:00" + "time": "2022-12-14T08:49:07+00:00" }, { "name": "friendsofphp/php-cs-fixer", @@ -949,16 +999,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.2", + "version": "v4.15.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc" + "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", - "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", "shasum": "" }, "require": { @@ -999,9 +1049,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" }, - "time": "2022-11-12T15:38:23+00:00" + "time": "2023-03-05T19:49:14+00:00" }, { "name": "phar-io/manifest", @@ -1172,25 +1222,22 @@ }, { "name": "php-stubs/wordpress-stubs", - "version": "v6.1.0", + "version": "v6.1.1", "source": { "type": "git", "url": "https://github.com/php-stubs/wordpress-stubs.git", - "reference": "19e7966c8e70a99a4824b3e5d1526680a151f13b" + "reference": "601c429ba8d91ef50a2a1bec05a7cd38b88064ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/19e7966c8e70a99a4824b3e5d1526680a151f13b", - "reference": "19e7966c8e70a99a4824b3e5d1526680a151f13b", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/601c429ba8d91ef50a2a1bec05a7cd38b88064ff", + "reference": "601c429ba8d91ef50a2a1bec05a7cd38b88064ff", "shasum": "" }, - "replace": { - "giacocorsiglia/wordpress-stubs": "*" - }, "require-dev": { "nikic/php-parser": "< 4.12.0", "php": "~7.3 || ~8.0", - "php-stubs/generator": "^0.8.1", + "php-stubs/generator": "^0.8.3", "phpdocumentor/reflection-docblock": "^5.3", "phpstan/phpstan": "^1.2" }, @@ -1213,22 +1260,22 @@ ], "support": { "issues": "https://github.com/php-stubs/wordpress-stubs/issues", - "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.1.0" + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.1.1" }, - "time": "2022-11-09T05:33:25+00:00" + "time": "2023-02-09T11:10:35+00:00" }, { "name": "phpstan/phpstan", - "version": "1.9.3", + "version": "1.10.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "709999b91448d4f2bb07daffffedc889b33e461c" + "reference": "8d39218664b45a4a42d5be66d2b63dcf8c149982" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/709999b91448d4f2bb07daffffedc889b33e461c", - "reference": "709999b91448d4f2bb07daffffedc889b33e461c", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/8d39218664b45a4a42d5be66d2b63dcf8c149982", + "reference": "8d39218664b45a4a42d5be66d2b63dcf8c149982", "shasum": "" }, "require": { @@ -1258,7 +1305,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.3" + "source": "https://github.com/phpstan/phpstan/tree/1.10.4" }, "funding": [ { @@ -1274,27 +1321,27 @@ "type": "tidelift" } ], - "time": "2022-12-13T10:28:10+00:00" + "time": "2023-03-06T13:39:20+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.20", + "version": "9.2.26", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "af7463c955007de36db0c5e26d03e2f933c2e980" + "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/af7463c955007de36db0c5e26d03e2f933c2e980", - "reference": "af7463c955007de36db0c5e26d03e2f933c2e980", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.15", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -1309,8 +1356,8 @@ "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { @@ -1343,7 +1390,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.20" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" }, "funding": [ { @@ -1351,7 +1398,7 @@ "type": "github" } ], - "time": "2022-12-13T07:49:28+00:00" + "time": "2023-03-06T12:58:08+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1596,20 +1643,20 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.27", + "version": "9.6.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38" + "reference": "9125ee085b6d95e78277dc07aa1f46f9e0607b8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a2bc7ffdca99f92d959b3f2270529334030bba38", - "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9125ee085b6d95e78277dc07aa1f46f9e0607b8d", + "reference": "9125ee085b6d95e78277dc07aa1f46f9e0607b8d", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", + "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -1647,7 +1694,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.5-dev" + "dev-master": "9.6-dev" } }, "autoload": { @@ -1678,7 +1725,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.27" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.4" }, "funding": [ { @@ -1694,7 +1741,7 @@ "type": "tidelift" } ], - "time": "2022-12-09T07:31:23+00:00" + "time": "2023-02-27T13:06:37+00:00" }, { "name": "psr/cache", @@ -2259,16 +2306,16 @@ }, { "name": "sebastian/environment", - "version": "5.1.4", + "version": "5.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { @@ -2310,7 +2357,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" }, "funding": [ { @@ -2318,7 +2365,7 @@ "type": "github" } ], - "time": "2022-04-03T09:37:03+00:00" + "time": "2023-02-03T06:03:51+00:00" }, { "name": "sebastian/exporter", @@ -2632,16 +2679,16 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", "shasum": "" }, "require": { @@ -2680,10 +2727,10 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, "funding": [ { @@ -2691,7 +2738,7 @@ "type": "github" } ], - "time": "2020-10-26T13:17:30+00:00" + "time": "2023-02-03T06:07:39+00:00" }, { "name": "sebastian/resource-operations", @@ -2750,16 +2797,16 @@ }, { "name": "sebastian/type", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { @@ -2794,7 +2841,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, "funding": [ { @@ -2802,7 +2849,7 @@ "type": "github" } ], - "time": "2022-09-12T14:47:03+00:00" + "time": "2023-02-03T06:13:03+00:00" }, { "name": "sebastian/version", @@ -2859,16 +2906,16 @@ }, { "name": "symfony/console", - "version": "v5.4.16", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8e9b9c8dfb33af6057c94e1b44846bee700dc5ef" + "reference": "c77433ddc6cdc689caf48065d9ea22ca0853fbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8e9b9c8dfb33af6057c94e1b44846bee700dc5ef", - "reference": "8e9b9c8dfb33af6057c94e1b44846bee700dc5ef", + "url": "https://api.github.com/repos/symfony/console/zipball/c77433ddc6cdc689caf48065d9ea22ca0853fbd9", + "reference": "c77433ddc6cdc689caf48065d9ea22ca0853fbd9", "shasum": "" }, "require": { @@ -2938,7 +2985,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.16" + "source": "https://github.com/symfony/console/tree/v5.4.21" }, "funding": [ { @@ -2954,7 +3001,7 @@ "type": "tidelift" } ], - "time": "2022-11-25T14:09:27+00:00" + "time": "2023-02-25T16:59:41+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3025,16 +3072,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v5.4.9", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc" + "reference": "f0ae1383a8285dfc6752b8d8602790953118ff5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", - "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f0ae1383a8285dfc6752b8d8602790953118ff5a", + "reference": "f0ae1383a8285dfc6752b8d8602790953118ff5a", "shasum": "" }, "require": { @@ -3090,7 +3137,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.9" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.21" }, "funding": [ { @@ -3106,7 +3153,7 @@ "type": "tidelift" } ], - "time": "2022-05-05T16:45:39+00:00" + "time": "2023-02-14T08:03:56+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -3189,16 +3236,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.13", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "ac09569844a9109a5966b9438fc29113ce77cf51" + "reference": "e75960b1bbfd2b8c9e483e0d74811d555ca3de9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/ac09569844a9109a5966b9438fc29113ce77cf51", - "reference": "ac09569844a9109a5966b9438fc29113ce77cf51", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/e75960b1bbfd2b8c9e483e0d74811d555ca3de9f", + "reference": "e75960b1bbfd2b8c9e483e0d74811d555ca3de9f", "shasum": "" }, "require": { @@ -3233,7 +3280,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.13" + "source": "https://github.com/symfony/filesystem/tree/v5.4.21" }, "funding": [ { @@ -3249,20 +3296,20 @@ "type": "tidelift" } ], - "time": "2022-09-21T19:53:16+00:00" + "time": "2023-02-14T08:03:56+00:00" }, { "name": "symfony/finder", - "version": "v5.4.11", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c" + "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/7872a66f57caffa2916a584db1aa7f12adc76f8c", - "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c", + "url": "https://api.github.com/repos/symfony/finder/zipball/078e9a5e1871fcfe6a5ce421b539344c21afef19", + "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19", "shasum": "" }, "require": { @@ -3296,7 +3343,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.11" + "source": "https://github.com/symfony/finder/tree/v5.4.21" }, "funding": [ { @@ -3312,20 +3359,20 @@ "type": "tidelift" } ], - "time": "2022-07-29T07:37:50+00:00" + "time": "2023-02-16T09:33:00+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.4.11", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "54f14e36aa73cb8f7261d7686691fd4d75ea2690" + "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/54f14e36aa73cb8f7261d7686691fd4d75ea2690", - "reference": "54f14e36aa73cb8f7261d7686691fd4d75ea2690", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9", + "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9", "shasum": "" }, "require": { @@ -3365,7 +3412,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.11" + "source": "https://github.com/symfony/options-resolver/tree/v5.4.21" }, "funding": [ { @@ -3381,7 +3428,7 @@ "type": "tidelift" } ], - "time": "2022-07-20T13:00:38+00:00" + "time": "2023-02-14T08:03:56+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4021,16 +4068,16 @@ }, { "name": "symfony/process", - "version": "v5.4.11", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1" + "reference": "d4ce417ebcb0b7d090b4c178ed6d3accc518e8bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/6e75fe6874cbc7e4773d049616ab450eff537bf1", - "reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1", + "url": "https://api.github.com/repos/symfony/process/zipball/d4ce417ebcb0b7d090b4c178ed6d3accc518e8bd", + "reference": "d4ce417ebcb0b7d090b4c178ed6d3accc518e8bd", "shasum": "" }, "require": { @@ -4063,7 +4110,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.11" + "source": "https://github.com/symfony/process/tree/v5.4.21" }, "funding": [ { @@ -4079,7 +4126,7 @@ "type": "tidelift" } ], - "time": "2022-06-27T16:58:25+00:00" + "time": "2023-02-21T19:46:44+00:00" }, { "name": "symfony/service-contracts", @@ -4166,16 +4213,16 @@ }, { "name": "symfony/stopwatch", - "version": "v5.4.13", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "6df7a3effde34d81717bbef4591e5ffe32226d69" + "reference": "f83692cd869a6f2391691d40a01e8acb89e76fee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/6df7a3effde34d81717bbef4591e5ffe32226d69", - "reference": "6df7a3effde34d81717bbef4591e5ffe32226d69", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f83692cd869a6f2391691d40a01e8acb89e76fee", + "reference": "f83692cd869a6f2391691d40a01e8acb89e76fee", "shasum": "" }, "require": { @@ -4208,7 +4255,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.13" + "source": "https://github.com/symfony/stopwatch/tree/v5.4.21" }, "funding": [ { @@ -4224,20 +4271,20 @@ "type": "tidelift" } ], - "time": "2022-09-28T13:19:49+00:00" + "time": "2023-02-14T08:03:56+00:00" }, { "name": "symfony/string", - "version": "v5.4.15", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "571334ce9f687e3e6af72db4d3b2a9431e4fd9ed" + "reference": "edac10d167b78b1d90f46a80320d632de0bd9f2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/571334ce9f687e3e6af72db4d3b2a9431e4fd9ed", - "reference": "571334ce9f687e3e6af72db4d3b2a9431e4fd9ed", + "url": "https://api.github.com/repos/symfony/string/zipball/edac10d167b78b1d90f46a80320d632de0bd9f2f", + "reference": "edac10d167b78b1d90f46a80320d632de0bd9f2f", "shasum": "" }, "require": { @@ -4294,7 +4341,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.15" + "source": "https://github.com/symfony/string/tree/v5.4.21" }, "funding": [ { @@ -4310,20 +4357,20 @@ "type": "tidelift" } ], - "time": "2022-10-05T15:16:54+00:00" + "time": "2023-02-22T08:00:55+00:00" }, { "name": "szepeviktor/phpstan-wordpress", - "version": "v1.1.6", + "version": "v1.1.7", "source": { "type": "git", "url": "https://github.com/szepeviktor/phpstan-wordpress.git", - "reference": "27784541f184a1ea3b6656fc8a882bb9adf45fc2" + "reference": "979dcb81a01942b576b9fbf72dcb9515c57a4aa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/27784541f184a1ea3b6656fc8a882bb9adf45fc2", - "reference": "27784541f184a1ea3b6656fc8a882bb9adf45fc2", + "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/979dcb81a01942b576b9fbf72dcb9515c57a4aa8", + "reference": "979dcb81a01942b576b9fbf72dcb9515c57a4aa8", "shasum": "" }, "require": { @@ -4334,11 +4381,11 @@ }, "require-dev": { "composer/composer": "^2.1.14", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.1", "phpstan/phpstan-strict-rules": "^1.2", "phpunit/phpunit": "^8.0 || ^9.0", - "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.6.1" + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.8" }, "type": "phpstan-extension", "extra": { @@ -4367,7 +4414,7 @@ ], "support": { "issues": "https://github.com/szepeviktor/phpstan-wordpress/issues", - "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.1.6" + "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.1.7" }, "funding": [ { @@ -4379,7 +4426,7 @@ "type": "github" } ], - "time": "2022-12-01T14:56:51+00:00" + "time": "2023-02-04T13:10:27+00:00" }, { "name": "theseer/tokenizer", @@ -4438,7 +4485,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.0|^8.0" + "php": "^7.4|^8.0" }, "platform-dev": [], "plugin-api-version": "2.3.0" diff --git a/pdc-base.php b/pdc-base.php index 013b608..e4ed910 100644 --- a/pdc-base.php +++ b/pdc-base.php @@ -4,7 +4,7 @@ * Plugin Name: Yard | PDC Base * Plugin URI: https://www.openwebconcept.nl/ * Description: Acts as foundation for other PDC related content plugins. This plugin implements actions to allow for other plugins to add and/or change Custom Posttypes, Metaboxes, Taxonomies, en Posts 2 posts relations. - * Version: 3.6.4 + * Version: 3.7.0 * Author: Yard | Digital Agency * Author URI: https://www.yard.nl/ * License: GPL-3.0 diff --git a/src/Base/Foundation/Plugin.php b/src/Base/Foundation/Plugin.php index c4a06b8..3e6bee6 100644 --- a/src/Base/Foundation/Plugin.php +++ b/src/Base/Foundation/Plugin.php @@ -2,6 +2,8 @@ namespace OWC\PDC\Base\Foundation; +use YahnisElsts\PluginUpdateChecker\v5\PucFactory; + class Plugin { /** @@ -17,7 +19,7 @@ class Plugin * * @var string */ - const VERSION = '3.6.4'; + const VERSION = '3.7.0'; /** * Path to the root of the plugin. @@ -68,6 +70,8 @@ public function boot(): bool return false; } + $this->checkForUpdate(); + // Set up service providers $this->callServiceProviders('register'); @@ -85,6 +89,25 @@ public function boot(): bool return true; } + protected function checkForUpdate() + { + if (! class_exists(PucFactory::class)) { + return; + } + + try { + $updater = PucFactory::buildUpdateChecker( + 'https://github.com/OpenWebconcept/plugin-openpub-base/', + $this->rootPath . '/openpub-base.php', + 'openpub-base' + ); + + $updater->getVcsApi()->enableReleaseAssets(); + } catch (\Throwable $e) { + error_log($e->getMessage()); + } + } + /** * Allows for hooking into the plugin name. */