Skip to content

Commit

Permalink
Merge branch 'release-0-1-0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jhotadhari committed Sep 25, 2019
2 parents f4aa969 + 40f0a54 commit 19af834
Show file tree
Hide file tree
Showing 32 changed files with 2,632 additions and 676 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 0.1.0 - 2019-09-25
Background Processing

### Added
- Handle `meta_input` field for Term imports
- Use `wpautop`for certain fields. Fields are filtered by "yaim_{$type}_autop_keys" filter
- Handle p2p connections for post import
- Use a5hleyrich/wp-background-processing and process all imports in background

### Changed
- More stable log

### Fixed
- Multilang values for directly nested attributes. eg `meta_input`. Also works if some directly nested attributes have translations, and others not.

## 0.0.2 - 2019-09-23
Taxonomy Term Import

Expand Down
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"require": {},
"require": {
},
"require-dev": {
"croox/wp-dev-env-frame": "0.7.2",
"composer/installers": "*",
"dealerdirect/phpcodesniffer-composer-installer": "0.5.0",
"wptrt/wpthemereview": "0.1.0",
"mustangostang/spyc": "^0.6.2",
"a5hleyrich/wp-background-processing": "^1.0",
"cmb2/cmb2": "^2.6"
},
"repositories": [
Expand All @@ -22,7 +24,8 @@
"extra": {
"installer-paths": {
"vendor/{$vendor}/{$name}": [
"cmb2/cmb2"
"cmb2/cmb2",
"a5hleyrich/wp-background-processing"
]
}
}
Expand Down
40 changes: 38 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions dist/trunk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ Upload and install this Theme the same way you'd install any other Theme.

## Changelog ##

## 0.1.0 - 2019-09-25
Background Processing

### Added
- Handle `meta_input` field for Term imports
- Use `wpautop`for certain fields. Fields are filtered by "yaim_{$type}_autop_keys" filter
- Handle p2p connections for post import
- Use a5hleyrich/wp-background-processing and process all imports in background

### Changed
- More stable log

### Fixed
- Multilang values for directly nested attributes. eg `meta_input`. Also works if some directly nested attributes have translations, and others not.

## 0.0.2 - 2019-09-23
Taxonomy Term Import

Expand Down
66 changes: 66 additions & 0 deletions dist/trunk/classes/Admin_Message_Log.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php

namespace yaim;

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}

use croox\wde\utils;

class Admin_Message_Log {

protected $msgs = array();

protected static $option_key = 'yaim_log';

protected $start;

public function __construct(){
$this->start = date('d-M-Y H:i:s T');
update_option( self::$option_key . '_start', $this->start );

$this->add_entries( array( $this->start, '' ) );

}

public function add_entries( $msgs = array(), $key = null ){
foreach( $msgs as $msg ) {
$this->add_entry( $msg );
}
}

public function add_entry( $msg = '', $key = null ){
if ( null === $key ) {
$this->msgs[] = $msg;
} else {
if ( array_key_exists( $key, $this->msgs ) ) {
$this->msgs[$key] .= $msg;

} else {
$this->msgs[$key] = $msg;
}
}
}

public function get(){
return $this->msgs;
}

public static function get_from_db(){
$msgs = get_option( self::$option_key );
$last = get_option( self::$option_key . '_start' );
return array(
'msgs' => $msgs,
'last_start' => get_option( self::$option_key . '_start' ),
'last_log_saved' => count( $msgs ) > 0 && $msgs[0] === $last,
);
}

public function save(){
update_option( self::$option_key, $this->msgs );
}

}

Loading

0 comments on commit 19af834

Please sign in to comment.