diff --git a/.github/workflows/plugin-release.yml b/.github/workflows/plugin-release.yml index 253b84d..c8a1dae 100644 --- a/.github/workflows/plugin-release.yml +++ b/.github/workflows/plugin-release.yml @@ -1,4 +1,5 @@ -# This action takes care of packaging WordPress plugin that can be downloaded and installed +# GitHub Action: Packaging WordPress plugin that can be downloaded and installed +# Inspired by https://leoloso.com/posts/github-action-to-release-wp-plugin/ name: Plugin Release on: release: @@ -19,14 +20,14 @@ jobs: - name: Create artifact uses: montudor/action-zip@v0.1.0 with: - args: zip -X -r build/wetory-support.zip . -x *.git* nbproject/\* node_modules/\* .* "*/\.*" CODE_OF_CONDUCT.md CONTRIBUTING.md ISSUE_TEMPLATE.md PULL_REQUEST_TEMPLATE.md *.dist composer.* dev-helpers** build** + args: zip -X -r build/wetory-support.zip . -x *.git* */nbproject/* node_modules/\* .* "*/\.*" CODE_OF_CONDUCT.md CONTRIBUTING.md ISSUE_TEMPLATE.md PULL_REQUEST_TEMPLATE.md *.dist composer.* dev-helpers** build** - name: Upload artifact uses: actions/upload-artifact@v2 with: name: wetory-support path: build/wetory-support.zip - name: Upload to release - uses: JasonEtco/upload-to-release@master + uses: jasonetco/upload-to-release@master with: args: build/wetory-support.zip application/zip env: diff --git a/README.md b/README.md index bb48e20..09faf28 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,22 @@ -[![Plugin Release](https://github.com/wetory/wetory-support/actions/workflows/plugin-release.yml/badge.svg?event=release)](https://github.com/wetory/wetory-support/actions/workflows/plugin-release.yml) +[![Plugin Release](https://github.com/wetory/wetory-support/actions/workflows/plugin-release.yml/badge.svg)](https://github.com/wetory/wetory-support/actions/workflows/plugin-release.yml) # Wetory Support - -WordPress plugin for [wetory projects](https://www.wetory.eu/projects/). Add reusable content to improve development workflow. +WordPress plugin for [wetory projects](https://www.wetory.eu/projects/). Adds reusable content to improve development workflow. Following best practices from official [Plugin Developer Handbook](https://developer.wordpress.org/plugins/). ## Installation +Download latest version of [plugin](http://github.com/wetory/wetory-support/releases/latest/download/wetory-support.zip). Go to WordPress admin dashboard and navigate to **Plugins -> Add new**. Use **Upload Plugin** instead of public repository search. Then activate newly installed plugin. -Download repository [ZIP file](https://github.com/wetory/wetory-support/archive/master.zip), strip tag name from folder in ZIP fle. Go to WordPress admin dashboard and navigate to **Plugins -> Add new**. Use **Upload Plugin** instead of public repository search. Then activate newly installed plugin. - -## Usage +If older version of plugin is needed for investigation or compatibility problems, check [relese history](https://github.com/wetory/wetory-support/releases). -New menu **Wetory** is added to the admin sidebar navigation. Go to **Wetory -> Settings** to configure what you want to use from this plugin. +## Updates +Updates are handled from this private repository automatically with every new release. It will just appear in WordPress administration dashboard together with updates from plugin library. -![Plugin settings screen](https://github.com/wetory/wetory-support/blob/master/public/images/settings-screen.png) - -Visit **Wetory -> Dashboard** to review all configuraiton in use via sumary table. +## Usage +New menu item **Wetory** is added to the admin sidebar navigation. Go to **Wetory -> Settings** to configure what you want to use from this plugin. You can check **Wetory -> Dashboard** to review all configuraiton in use via sumary table. ![Plugin dashboard screen](https://github.com/wetory/wetory-support/blob/master/public/images/dashboard-screen.png) -## Contributing -Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. +More datailed plugin usage instructions will be published soon. ## License [GPLv2](http://www.gnu.org/licenses/gpl-2.0.html) diff --git a/includes/wetory-support-functions.php b/includes/wetory-support-functions.php index b32f493..888830e 100644 --- a/includes/wetory-support-functions.php +++ b/includes/wetory-support-functions.php @@ -300,7 +300,7 @@ function wetory_get_categories_by_post_type($post_type, $args = '') { function wetory_get_first_image_src($html) { $output = preg_match_all('//i', $html, $matches); - $first_img = $matches[1][0]; + $first_img = isset($matches[1][0]) ? $matches[1][0] : null; if(empty($first_img)){ return false;