Skip to content

Commit

Permalink
merge latest master and changelog changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Timi-Artturi Mäkelä committed Apr 27, 2022
2 parents 81deb99 + 69418cc commit 57b0ad9
Show file tree
Hide file tree
Showing 16 changed files with 1,193 additions and 201 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/composer-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Composer Diff
on:
pull_request:
paths:
- 'composer.lock'
jobs:
composer-diff:
name: Composer Diff
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # Required to make it possible to compare with PR base branch

- name: Generate composer diff
id: composer_diff # To reference the output in comment
uses: IonBazan/composer-diff-action@v1

- uses: marocchino/sticky-pull-request-comment@v2
with:
header: composer-diff # Creates a collapsed comment with the report
message: |
<details>
<summary>Composer package changes</summary>
${{ steps.composer_diff.outputs.composer_diff }}
</details>
61 changes: 61 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: PHP Composer

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [ '7.4', '8.0', '8.1' ]
stability: [ prefer-stable ]
include:
- php: '7.4'
composer: '1'
- php: '8.0'
composer: '2'
- php: '8.1'
composer: '2'

name: PHP ${{ matrix.php }} - ${{ matrix.stability }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:${{ matrix.composer }}
coverage: none

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}-${{ matrix.prefer }}-
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-

- name: Install dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress

- name: Run test suite
run: composer test
12 changes: 4 additions & 8 deletions travis.yml → .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@

# This uses newer and faster docker based build system
sudo: false

language: php

notifications:
Expand All @@ -12,10 +8,10 @@ notifications:

php:
- nightly
- 8.0
- 7.4
- 7.3

matrix:
jobs:
allow_failures:
- php: nightly

Expand All @@ -24,8 +20,8 @@ install:
- travis_retry composer update --no-interaction --prefer-dist --no-suggest --no-progress

script:
- phpunit
- composer test

cache:
directories:
- $HOME/.composer/cache
- $HOME/.composer/cache
25 changes: 23 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,31 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Changed

- Enabled PHP 8.0 and PHP 8.1 usage #18

## [Released]

## [1.0.1] - 2022-04-26
- Added filters oopi_before_save_post_acf and oopi_before_save_post_acf_type={field_type}.
## [1.2.0] - 2022-04-27

### Added
- Filters `oopi_before_save_post_acf` and `oopi_before_save_post_acf/type={field_type}`.

## [1.1.0] - 2022-02-21

### Added
- Schedule log cleaner cronjob on plugin activation. The cronjob deletes rows from log table older than the threshold set.

### Fixed
- Fixed autoloading, added composer test + more #17

## [1.0.1] - 2022-02-03

### Fixed

- Fixed inserting ACF data to attachments #19
- Fixed autoloading, added composer test + more #17

## [1.0.0] - 2020-08-27

Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ The `\Geniem\Oopi\Settings\` class is used to set and load all plugin settings.
- Setting key `table_name`, constant `OOPI_TABLE_NAME`, default value `geniem_importer_log`.
- Setting key `log_status_ok`, constant `OOPI_LOG_STATUS_OK`, default value `'OK'`.
- Setting key `log_status_fail`, constant `OOPI_LOG_STATUS_FAIL`, default value `'FAIL'`.
- Setting key `cron_interval_clean_log`, constant `OOPI_CRON_INTERVAL_CLEAN_LOG`, default `'daily'`.

### Accessing settings

Expand Down Expand Up @@ -188,6 +189,12 @@ The log provides a rollback feature. If an import fails the importer tries to ro

To disable the rollback feature set the `OOPI_ROLLBACK_DISABLE` constant with a value of `true`.

### Log cleanup

The plugin registers a log cleaner cronjob on plugin activation. The cronjob deletes all rows from the log table by status and import date threshold. Both the statuses and the threshold can be modified with filters `oopi_cron_log_cleaner_statuses` and `oopi_cron_log_cleaner_threshold`.

The cronjob is run with `'daily'` interval by default, it can be changed with `OOPI_CRON_INTERVAL_CLEAN_LOG` constant. Cronjob scheduling can be disabled by defining the constant as `false`.

## Tests

### Local tests
Expand All @@ -202,7 +209,7 @@ If you need to debug the tests, the container comes with [Xdebug 3](https://xdeb

### Travis CI

This repository also contains a GitHub integration for [Travic CI](https://travis-ci.org/). All commits to the `main` branch will be automatically tested with Travis.
This repository also contains a GitHub integration for [Travic CI](https://travis-ci.com/). All commits to the `master` branch will be automatically tested with Travis.

## Changelog

Expand Down
25 changes: 18 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"name": "Ville Siltala",
"email": "ville.siltala@geniem.com",
"homepage": "http://github.com/villesiltala",
"homepage": "https://github.com/villesiltala",
"role": "Developer"
},
{
Expand All @@ -19,17 +19,28 @@
"keywords": [
"wordpress", "plugin", "importer", "geniem"
],
"license": "GPL-3.0",
"minimum-stability": "dev",
"scripts": {
"test": "vendor/bin/phpunit"
},
"license": "GPL-3.0-or-later",
"minimum-stability": "stable",
"require": {
"php": ">=7.4",
"composer/installers": "^1.0.12"
"php": ">=7.4 || ^8.0 || ^8.1",
"composer/installers": "^1.0.12 || ^2"
},
"autoload": {
"psr-4": {"Geniem\\Oopi\\": "src/"}
"psr-4": {
"Geniem\\Oopi\\": ["src/", "plugin.php"]
}
},
"require-dev": {
"10up/wp_mock": "dev-master",
"roave/security-advisories": "dev-latest",
"10up/wp_mock": "^0.4.2",
"phpunit/phpunit": "^9"
},
"config": {
"allow-plugins": {
"composer/installers": true
}
}
}
Loading

0 comments on commit 57b0ad9

Please sign in to comment.