Commit d6beb22b authored by Quan Nguyen's avatar Quan Nguyen

update code

parent 70e67e4e
Pipeline #513 failed with stages
......@@ -18,8 +18,8 @@
* @package WordPress
*/
// ** URL setting ** //
define( 'WP_HOME', 'https://rangrangcoffee' );
define( 'WP_SITEURL', 'https://rangrangcoffee' );
define( 'WP_HOME', 'https://rangrangcoffee.com' );
define( 'WP_SITEURL', 'https://rangrangcoffee.com' );
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
......
{
"version": 3,
"mappings": "AAAA,AAAA,mBAAmB,CAAC;EAClB,UAAU,EAAE,IAAI;CACjB;;AAED,AAAA,eAAe,CAAC;EACd,UAAU,EAAE,IAAI;EAiFhB,sBAAsB;CA6BvB;;AA/GD,AAEE,eAFa,CAEb,EAAE,AAAA,aAAa,CAAC;EACd,SAAS,EAAE,IAAI;EACf,UAAU,EAAE,OAAO;EACnB,KAAK,EAAE,IAAI;EACX,OAAO,EAAE,IAAI;EACb,WAAW,EAAE,iBAAiB;EAC9B,aAAa,EAAE,IAAI;CACpB;;AATH,AAWE,eAXa,CAWb,EAAE,AAAA,WAAW;AAXf,eAAe,CAYb,EAAE,AAAA,WAAW,CAAC;EACZ,KAAK,EAAE,IAAI;EACX,UAAU,EAAE,MAAM;EAClB,WAAW,EAAE,MAAM;CAMpB;;AArBH,AAgBI,eAhBW,CAWb,EAAE,AAAA,WAAW,GAKT,GAAG;AAhBT,eAAe,CAYb,EAAE,AAAA,WAAW,GAIT,GAAG,CAAC;EACJ,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,QAAQ,EAAE,MAAM;CACjB;;AApBL,AAsBE,eAtBa,CAsBb,WAAW,CAAC,OAAO,AAAA,cAAc,CAAC;EAChC,KAAK,EAAE,IAAI;EACX,UAAU,EAAE,OAAO;EACnB,YAAY,EAAE,OAAO;CACtB;;AA1BH,AA2BE,eA3Ba,CA2Bb,aAAa,AAAA,QAAQ,CAAC;EACpB,KAAK,EAAE,OAAO;CACf;;A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C;EACX,KAAK,EAAE,IAAI;EACX,eAAe,EAAE,IAAI;EACrB,MAAM,EAAE,OAAO;CAChB;;AA/FH,AAgGE,eAhGa,CAgGb,WAAW,CAAC;EACV,UAAU,EAAE,SAAS;EACrB,aAAa,EAAE,GAAG;CACnB;;AAnGH,AAsGE,eAtGa,CAsGb,IAAI,AAAA,OAAO,CAAC;EACV,KAAK,EAAE,OAAO;EACd,WAAW,EAAE,IAAI;CAClB;;AAzGH,AA2GE,eA3Ga,CA2Gb,IAAI,AAAA,UAAU,CAAC;EACb,KAAK,EAAE,GAAG;EACV,WAAW,EAAE,IAAI;CAClB;;AAIH,AAAA,MAAM,AAAA,UAAU,CAAC;EACf,OAAO,EAAE,IAAI;EAAE,uBAAuB;EACtC,QAAQ,EAAE,KAAK;EAAE,mBAAmB;EACpC,OAAO,EAAE,CAAC;EAAE,gBAAgB;EAC5B,WAAW,EAAE,KAAK;EAAE,yBAAyB;EAC7C,IAAI,EAAE,CAAC;EACP,GAAG,EAAE,CAAC;EACN,KAAK,EAAE,IAAI;EAAE,gBAAgB;EAC7B,MAAM,EAAE,IAAI;EAAE,iBAAiB;EAC/B,QAAQ,EAAE,IAAI;EAAE,6BAA6B;EAC7C,gBAAgB,EAAE,KAAY;EAAE,oBAAoB;EACpD,gBAAgB,EAAE,kBAAkB;EAAE,sBAAsB;EAC5D,mBAAmB;CAUpB;;AAtBD,AAaE,MAbI,AAAA,UAAU,CAad,cAAc,CAAC;EACb,gBAAgB,EAAE,OAAO;EACzB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,MAAM,EAAE,cAAc;EACtB,KAAK,EAAE,GAAG;EACV,QAAQ,EAAE,MAAM;EAChB,MAAM,EAAE,KAAK;CACd",
"sources": [
"kiotviet-sync-admin.scss"
],
"names": [],
"file": "kiotviet-sync-admin.css"
}
\ No newline at end of file
#kv-clear-indexeddb {
margin-top: 20px;
}
.kvsync-wrapper {
margin-top: 20px;
h2.kv-title-top {
font-size: 16px;
background: #23282d;
color: #fff;
padding: 15px;
border-left: 5px solid #3da849;
margin-bottom: 20px;
}
// product
th.column-img,
td.column-img {
width: 60px;
text-align: center;
white-space: nowrap;
> img {
width: 100%;
height: auto;
overflow: hidden;
}
}
.wp-core-ui .button.button-danger {
color: #fff;
background: #ff4e4e;
border-color: #ff4e4e;
}
.stock_status.instock {
color: #7ad03a;
}
.stock_status.outofstock {
color: #a44;
}
.stock_status.onbackorder {
color: #eaa600;
}
// order
.order-status {
display: -webkit-inline-box;
display: inline-flex;
line-height: 2.5em;
color: #777;
background: #e5e5e5;
border-radius: 4px;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
margin: -0.25em 0;
cursor: inherit !important;
white-space: nowrap;
max-width: 100%;
}
.order-status.status-completed {
background: #c8d7e1;
color: #2e4453;
}
.order-status.status-on-hold {
background: #f8dda7;
color: #94660c;
}
.order-status.status-failed {
background: #eba3a3;
color: #761919;
}
.order-status.status-processing {
background: #c6e1c6;
color: #5b841b;
}
.order-status.status-trash {
background: #eba3a3;
color: #761919;
}
.order-status > span {
margin: 0 1em;
overflow: hidden;
text-overflow: ellipsis;
}
/* The Close Button */
.close {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
.detail-log {
word-break: break-all;
margin-bottom: 0px;
}
// webhook
span.active {
color: #7ad03a;
font-weight: bold;
}
span.no-active {
color: red;
font-weight: bold;
}
}
// log
.modal.log-modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
padding-top: 100px; /* Location of the box */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0, 0, 0); /* Fallback color */
background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
/* Modal Content */
.modal-content {
background-color: #fefefe;
margin: auto;
padding: 20px;
border: 1px solid #888;
width: 60%;
overflow: scroll;
height: 600px;
}
}
#kv-clear-indexeddb {
margin-top: 20px;
}
.kvsync-wrapper {
margin-top: 20px;
h2.kv-title-top {
font-size: 16px;
background: #23282d;
color: #fff;
padding: 15px;
border-left: 5px solid #3da849;
margin-bottom: 20px;
}
// product
th.column-img,
td.column-img {
width: 60px;
text-align: center;
white-space: nowrap;
> img {
width: 100%;
height: auto;
overflow: hidden;
}
}
.wp-core-ui .button.button-danger {
color: #fff;
background: #ff4e4e;
border-color: #ff4e4e;
}
.stock_status.instock {
color: #7ad03a;
}
.stock_status.outofstock {
color: #a44;
}
.stock_status.onbackorder {
color: #eaa600;
}
// order
.order-status {
display: -webkit-inline-box;
display: inline-flex;
line-height: 2.5em;
color: #777;
background: #e5e5e5;
border-radius: 4px;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
margin: -0.25em 0;
cursor: inherit !important;
white-space: nowrap;
max-width: 100%;
}
.order-status.status-completed {
background: #c8d7e1;
color: #2e4453;
}
.order-status.status-on-hold {
background: #f8dda7;
color: #94660c;
}
.order-status.status-failed {
background: #eba3a3;
color: #761919;
}
.order-status.status-processing {
background: #c6e1c6;
color: #5b841b;
}
.order-status.status-trash {
background: #eba3a3;
color: #761919;
}
.order-status > span {
margin: 0 1em;
overflow: hidden;
text-overflow: ellipsis;
}
/* The Close Button */
.close {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
.detail-log {
word-break: break-all;
margin-bottom: 0px;
}
// webhook
span.active {
color: #7ad03a;
font-weight: bold;
}
span.no-active {
color: red;
font-weight: bold;
}
}
// log
.modal.log-modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
padding-top: 100px; /* Location of the box */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0, 0, 0); /* Fallback color */
background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
/* Modal Content */
.modal-content {
background-color: #fefefe;
margin: auto;
padding: 20px;
border: 1px solid #888;
width: 60%;
overflow: scroll;
height: 600px;
}
}
<?php
/**
* Created by PhpStorm.
* User: bachh
* Date: 04/05/21
* Time: 11:32 AM
*/
require_once plugin_dir_path(dirname(__FILE__)) . '../includes/services/class-kiotviet-sync-services-auth.php';
if (!class_exists('WP_List_Table')) {
require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
}
class Kv_Webhooks_List extends WP_List_Table
{
public function __construct()
{
parent::__construct([
'singular' => __('Webhook'), //singular name of the listed records
'plural' => __('Webhooks'), //plural name of the listed records
'ajax' => true //should this table support ajax?
]);
}
public static function get_webhooks($per_page, $current_page)
{
$servicesAuth = new Kiotviet_Sync_Service_Auth();
$data = $servicesAuth->request("get", "https://public.kiotapi.com/webhooks");
return $data["data"]["data"];
}
public static function get_webhooks_count()
{
$servicesAuth = new Kiotviet_Sync_Service_Auth();
$data = $servicesAuth->request("get", "https://public.kiotapi.com/webhooks");
return count($data["data"]["data"]);
}
function no_items()
{
_e('No webhook found, dude.');
}
/**
* Handles data query and filter, sorting, and pagination.
*/
public function prepare_items()
{
$columns = $this->get_columns();
$hidden = array();
$sortable = array();
$this->_column_headers = array($columns, $hidden, $sortable);
$per_page = $this->get_items_per_page('customers_per_page', 25);
$current_page = $this->get_pagenum();
$this->set_pagination_args([
'total_items' => self::get_webhooks_count(), //WE have to calculate the total number of items
'per_page' => $per_page //WE have to determine how many items to show on a page
]);
$this->items = self::get_webhooks($per_page, $current_page);
}
public function column_default($item, $column_name)
{
switch ( $column_name ) {
case 'id':
return $item['id'];
case 'type':
return $item['type'];
case 'url':
return $item['url'];
case 'isActive':
if($item['isActive'] == true) {
return '<span class="active">Đã kích hoạt</span>';
} else {
return '<span class="no-active">Chưa kích hoạt</span>';
}
case 'retailerId':
return $item['retailerId'];
case 'description':
return $item['description'];
case 'modifiedDate':
$newDate = new DateTime($item['modifiedDate']);
return $newDate->format("d-m-Y H:i:s");
default:
return print_r( $item, true );
}
}
function column_cb($item)
{
return '';
}
function get_columns()
{
$columns = [
'id' => 'ID',
'type' => 'Loại',
'url' => 'URL',
'isActive' => 'Active',
'retailerId' => 'Retailer ID',
'description' => 'Mô tả',
'modifiedDate' => 'Ngày tạo'
];
return $columns;
}
public function get_sortable_columns()
{
$sortable_columns = array();
return $sortable_columns;
}
public function get_bulk_actions()
{
$actions = [
];
return $actions;
}
}
<?php
/**
* Created by PhpStorm.
* User: bachh
* Date: 04/05/21
* Time: 11:32 AM
*/
require_once plugin_dir_path(dirname(__FILE__)) . '../includes/services/class-kiotviet-sync-services-auth.php';
if (!class_exists('WP_List_Table')) {
require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
}
class Kv_Webhooks_List extends WP_List_Table
{
public function __construct()
{
parent::__construct([
'singular' => __('Webhook'), //singular name of the listed records
'plural' => __('Webhooks'), //plural name of the listed records
'ajax' => true //should this table support ajax?
]);
}
public static function get_webhooks($per_page, $current_page)
{
$servicesAuth = new Kiotviet_Sync_Service_Auth();
$data = $servicesAuth->request("get", "https://public.kiotapi.com/webhooks");
return $data["data"]["data"];
}
public static function get_webhooks_count()
{
$servicesAuth = new Kiotviet_Sync_Service_Auth();
$data = $servicesAuth->request("get", "https://public.kiotapi.com/webhooks");
return count($data["data"]["data"]);
}
function no_items()
{
_e('No webhook found, dude.');
}
/**
* Handles data query and filter, sorting, and pagination.
*/
public function prepare_items()
{
$columns = $this->get_columns();
$hidden = array();
$sortable = array();
$this->_column_headers = array($columns, $hidden, $sortable);
$per_page = $this->get_items_per_page('customers_per_page', 25);
$current_page = $this->get_pagenum();
$this->set_pagination_args([
'total_items' => self::get_webhooks_count(), //WE have to calculate the total number of items
'per_page' => $per_page //WE have to determine how many items to show on a page
]);
$this->items = self::get_webhooks($per_page, $current_page);
}
public function column_default($item, $column_name)
{
switch ( $column_name ) {
case 'id':
return $item['id'];
case 'type':
return $item['type'];
case 'url':
return $item['url'];
case 'isActive':
if($item['isActive'] == true) {
return '<span class="active">Đã kích hoạt</span>';
} else {
return '<span class="no-active">Chưa kích hoạt</span>';
}
case 'retailerId':
return $item['retailerId'];
case 'description':
return $item['description'];
case 'modifiedDate':
$newDate = new DateTime($item['modifiedDate']);
return $newDate->format("d-m-Y H:i:s");
default:
return print_r( $item, true );
}
}
function column_cb($item)
{
return '';
}
function get_columns()
{
$columns = [
'id' => 'ID',
'type' => 'Loại',
'url' => 'URL',
'isActive' => 'Active',
'retailerId' => 'Retailer ID',
'description' => 'Mô tả',
'modifiedDate' => 'Ngày tạo'
];
return $columns;
}
public function get_sortable_columns()
{
$sortable_columns = array();
return $sortable_columns;
}
public function get_bulk_actions()
{
$actions = [
];
return $actions;
}
}
<?php
/**
* Provide a admin area view for the plugin
*
* This file is used to markup the admin-facing aspects of the plugin.
*
* @link opss.com.vn
* @since 1.0.0
*
* @package Kiotviet_Sync
* @subpackage Kiotviet_Sync/admin/partials
*/
?>
<div class="kvsync-wrapper wrap">
<h2 class="kv-title-top">KiotViet Sync</h2>
<div id="kvsync"></div>
</div>
<?php
/**
* Provide a admin area view for the plugin
*
* This file is used to markup the admin-facing aspects of the plugin.
*
* @link opss.com.vn
* @since 1.0.0
*
* @package Kiotviet_Sync
* @subpackage Kiotviet_Sync/admin/partials
*/
?>
<div class="kvsync-wrapper wrap">
<h2 class="kv-title-top">KiotViet Sync</h2>
<div id="kvsync"></div>
</div>
<div id="view_log"></div>
<div id="myModal" class="modal log-modal">
<!-- Modal content -->
<div class="modal-content">
<p><pre class="detail-log"></pre></p>
</div>
</div>
<form method="get" action="admin.php">
<input type="hidden" name="page" value="plugin-kiotviet-sync-order">
<div class="kvsync-wrapper wrap">
<h2 class="kv-title-top">Lịch sử đồng bộ</h2>
<?php
$logsList->prepare_items();
$logsList->display();
?>
</div>
</form>
<script>
jQuery(function(){
jQuery('.view_log').click(function () {
jQuery('#myModal').css('display', 'block');
jQuery('.detail-log').text(JSON.stringify(jQuery(this).data('value'), null, 4));
});
});
jQuery(window).click(function(event){
var modal = document.getElementById('myModal');
if (event.target == modal) {
jQuery('#myModal').css('display', 'none');
}
})
</script>
<div id="view_log"></div>
<div id="myModal" class="modal log-modal">
<!-- Modal content -->
<div class="modal-content">
<p><pre class="detail-log"></pre></p>
</div>
</div>
<form method="get" action="admin.php">
<input type="hidden" name="page" value="plugin-kiotviet-sync-order">
<div class="kvsync-wrapper wrap">
<h2 class="kv-title-top">Lịch sử đồng bộ</h2>
<?php
$logsList->prepare_items();
$logsList->display();
?>
</div>
</form>
<script>
jQuery(function(){
jQuery('.view_log').click(function () {
jQuery('#myModal').css('display', 'block');
jQuery('.detail-log').text(JSON.stringify(jQuery(this).data('value'), null, 4));
});
});
jQuery(window).click(function(event){
var modal = document.getElementById('myModal');
if (event.target == modal) {
jQuery('#myModal').css('display', 'none');
}
})
</script>
<form method="get" action="admin.php">
<input type="hidden" name="page" value="plugin-kiotviet-sync-order">
<div class="kvsync-wrapper wrap">
<h2 class="kv-title-top">Danh sách đơn đặt hàng</h2>
<?php
$orderList->prepare_items();
$orderList->search_box('search', 'search_id');
$orderList->display();
?>
</div>
</form>
<script>
jQuery(function(){
jQuery('.re-sync-order').click(function(){
var jQuerythis = jQuery(this);
var orderId = jQuerythis.attr('data-id');
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data:{
order: orderId,
action: 'kiotviet_re_sync_order'
},
dataType: 'json',
beforeSend: function(){
jQuerythis.attr('disabled', 'disabled').val('Đang đồng bộ');
},
success: function(resp){
//console.log(resp);
if(resp.status === 'error'){
jQuerythis.closest('td').html(
'<strong style=\"color:red\">Thất bại</strong> <br />' +
'<small>' + resp.msg + '</small>'
);
} else {
jQuerythis.closest('td').html('<strong style=\"color:green\">Thành công</strong>');
}
}
});
});
});
</script>
<form method="get" action="admin.php">
<input type="hidden" name="page" value="plugin-kiotviet-sync-order">
<div class="kvsync-wrapper wrap">
<h2 class="kv-title-top">Danh sách đơn đặt hàng</h2>
<?php
$orderList->prepare_items();
$orderList->search_box('search', 'search_id');
$orderList->display();
?>
</div>
</form>
<script>
jQuery(function(){
jQuery('.re-sync-order').click(function(){
var jQuerythis = jQuery(this);
var orderId = jQuerythis.attr('data-id');
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data:{
order: orderId,
action: 'kiotviet_re_sync_order'
},
dataType: 'json',
beforeSend: function(){
jQuerythis.attr('disabled', 'disabled').val('Đang đồng bộ');
},
success: function(resp){
//console.log(resp);
if(resp.status === 'error'){
jQuerythis.closest('td').html(
'<strong style=\"color:red\">Thất bại</strong> <br />' +
'<small>' + resp.msg + '</small>'
);
} else {
jQuerythis.closest('td').html('<strong style=\"color:green\">Thành công</strong>');
}
}
});
});
});
</script>
<form method="get" action="admin.php">
<input type="hidden" name="page" value="plugin-kiotviet-sync-product">
<div class="kvsync-wrapper wrap">
<h2 class="kv-title-top">Danh sách sản phẩm</h2>
<?php
$productList->prepare_items();
$productList->search_box('search', 'search_id');
$productList->display();
?>
</div>
</form>
<script>
jQuery(function(){
jQuery(document).on('click', '.product_sync', function(){
var jQuerythis = jQuery(this);
var status = jQuerythis.data('status');
var product_id = jQuerythis.data('product-id');
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data:{
status:status,
product_id: product_id,
action: 'kiotviet_sync_update_status',
},
dataType: 'json',
beforeSend: function(){
jQuerythis.attr('disabled', 'disabled');
},
success: function(resp){
if(resp.status === 'success'){
if(resp.data){
jQuerythis.closest('td').find('.product_sync').data('status', 0).removeClass('button-danger').addClass('button-primary').val('Đang đồng bộ').removeAttr('disabled');
}else{
jQuerythis.closest('td').find('.product_sync').data('status', 1).removeClass('button-primary').addClass('button-danger').val('Ngừng đồng bộ').removeAttr('disabled');
}
}
}
});
});
});
</script>
<form method="get" action="admin.php">
<input type="hidden" name="page" value="plugin-kiotviet-sync-product">
<div class="kvsync-wrapper wrap">
<h2 class="kv-title-top">Danh sách sản phẩm</h2>
<?php
$productList->prepare_items();
$productList->search_box('search', 'search_id');
$productList->display();
?>
</div>
</form>
<script>
jQuery(function(){
jQuery(document).on('click', '.product_sync', function(){
var jQuerythis = jQuery(this);
var status = jQuerythis.data('status');
var product_id = jQuerythis.data('product-id');
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data:{
status:status,
product_id: product_id,
action: 'kiotviet_sync_update_status',
},
dataType: 'json',
beforeSend: function(){
jQuerythis.attr('disabled', 'disabled');
},
success: function(resp){
if(resp.status === 'success'){
if(resp.data){
jQuerythis.closest('td').find('.product_sync').data('status', 0).removeClass('button-danger').addClass('button-primary').val('Đang đồng bộ').removeAttr('disabled');
}else{
jQuerythis.closest('td').find('.product_sync').data('status', 1).removeClass('button-primary').addClass('button-danger').val('Ngừng đồng bộ').removeAttr('disabled');
}
}
}
});
});
});
</script>
<form method="get" action="admin.php">
<input type="hidden" name="page" value="plugin-kiotviet-sync-webhook">
<div class="kvsync-wrapper wrap">
<h2 class="kv-title-top">Danh sách webhook</h2>
<?php
$kiotviet_sync_retailer = get_option('kiotviet_sync_retailer');
if(!empty($kiotviet_sync_retailer)) {
$webhooksList->prepare_items();
$webhooksList->display();
} else { ?>
<div class="notice notice-warning is-dismissible">
<p><?php _e( 'Bạn phải đăng nhập để xem các webhook!', 'kiotviet-sync' ); ?></p>
</div>
<?php }
?>
</div>
</form>
<div class="wrap">
<h2>Thao tác</h2>
<button id="kv-clear-indexeddb">Clear Cache</button>
</div>
<script>
jQuery(function(){
jQuery(document).on('click', '#kv-clear-indexeddb', async function(){
if (confirm('Are you sure!')) {
const dbs = await window.indexedDB.databases();
dbs.forEach(db => {
if(db.name.includes("kiotviet_sync")) {
window.indexedDB.deleteDatabase(db.name);
}
})
alert("Clear Cache successful!")
}
});
});
</script>
<form method="get" action="admin.php">
<input type="hidden" name="page" value="plugin-kiotviet-sync-webhook">
<div class="kvsync-wrapper wrap">
<h2 class="kv-title-top">Danh sách webhook</h2>
<?php
$kiotviet_sync_retailer = get_option('kiotviet_sync_retailer');
if(!empty($kiotviet_sync_retailer)) {
$webhooksList->prepare_items();
$webhooksList->display();
} else { ?>
<div class="notice notice-warning is-dismissible">
<p><?php _e( 'Bạn phải đăng nhập để xem các webhook!', 'kiotviet-sync' ); ?></p>
</div>
<?php }
?>
</div>
</form>
<div class="wrap">
<h2>Thao tác</h2>
<button id="kv-clear-indexeddb">Clear Cache</button>
</div>
<script>
jQuery(function(){
jQuery(document).on('click', '#kv-clear-indexeddb', async function(){
if (confirm('Are you sure!')) {
const dbs = await window.indexedDB.databases();
dbs.forEach(db => {
if(db.name.includes("kiotviet_sync")) {
window.indexedDB.deleteDatabase(db.name);
}
})
alert("Clear Cache successful!")
}
});
});
</script>
<?php return array (
'root' =>
array (
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'aliases' =>
array (
),
'reference' => NULL,
'name' => '__root__',
),
'versions' =>
array (
'__root__' =>
array (
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'aliases' =>
array (
),
'reference' => NULL,
),
'citigo/kiotviet-php-sdk' =>
array (
'pretty_version' => '1.0.3',
'version' => '1.0.3.0',
'aliases' =>
array (
),
'reference' => '8b661c0b2c2b06d9249d42fa98f9d41e13b8dedd',
),
'giacocorsiglia/wordpress-stubs' =>
array (
'replaced' =>
array (
0 => '*',
),
),
'guzzlehttp/guzzle' =>
array (
'pretty_version' => '6.3.3',
'version' => '6.3.3.0',
'aliases' =>
array (
),
'reference' => '407b0cb880ace85c9b63c5f9551db498cb2d50ba',
),
'guzzlehttp/promises' =>
array (
'pretty_version' => 'v1.3.1',
'version' => '1.3.1.0',
'aliases' =>
array (
),
'reference' => 'a59da6cf61d80060647ff4d3eb2c03a2bc694646',
),
'guzzlehttp/psr7' =>
array (
'pretty_version' => '1.5.2',
'version' => '1.5.2.0',
'aliases' =>
array (
),
'reference' => '9f83dded91781a01c63574e387eaa769be769115',
),
'php-stubs/woocommerce-stubs' =>
array (
'pretty_version' => 'v5.4.0',
'version' => '5.4.0.0',
'aliases' =>
array (
),
'reference' => 'f0f6a806d92d8918d0dfccde5c7300ce182aec0d',
),
'php-stubs/wordpress-stubs' =>
array (
'pretty_version' => 'v5.7.2',
'version' => '5.7.2.0',
'aliases' =>
array (
),
'reference' => 'beda02c58f1c4689d42c8dde6a84f7f0c9c93f42',
),
'psr/http-message' =>
array (
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'aliases' =>
array (
),
'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363',
),
'psr/http-message-implementation' =>
array (
'provided' =>
array (
0 => '1.0',
),
),
'ralouphie/getallheaders' =>
array (
'pretty_version' => '2.0.5',
'version' => '2.0.5.0',
'aliases' =>
array (
),
'reference' => '5601c8a83fbba7ef674a7369456d12f1e0d0eafa',
),
),
);
<?php return array (
'root' =>
array (
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'aliases' =>
array (
),
'reference' => NULL,
'name' => '__root__',
),
'versions' =>
array (
'__root__' =>
array (
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'aliases' =>
array (
),
'reference' => NULL,
),
'citigo/kiotviet-php-sdk' =>
array (
'pretty_version' => '1.0.3',
'version' => '1.0.3.0',
'aliases' =>
array (
),
'reference' => '8b661c0b2c2b06d9249d42fa98f9d41e13b8dedd',
),
'giacocorsiglia/wordpress-stubs' =>
array (
'replaced' =>
array (
0 => '*',
),
),
'guzzlehttp/guzzle' =>
array (
'pretty_version' => '6.3.3',
'version' => '6.3.3.0',
'aliases' =>
array (
),
'reference' => '407b0cb880ace85c9b63c5f9551db498cb2d50ba',
),
'guzzlehttp/promises' =>
array (
'pretty_version' => 'v1.3.1',
'version' => '1.3.1.0',
'aliases' =>
array (
),
'reference' => 'a59da6cf61d80060647ff4d3eb2c03a2bc694646',
),
'guzzlehttp/psr7' =>
array (
'pretty_version' => '1.5.2',
'version' => '1.5.2.0',
'aliases' =>
array (
),
'reference' => '9f83dded91781a01c63574e387eaa769be769115',
),
'php-stubs/woocommerce-stubs' =>
array (
'pretty_version' => 'v5.4.0',
'version' => '5.4.0.0',
'aliases' =>
array (
),
'reference' => 'f0f6a806d92d8918d0dfccde5c7300ce182aec0d',
),
'php-stubs/wordpress-stubs' =>
array (
'pretty_version' => 'v5.7.2',
'version' => '5.7.2.0',
'aliases' =>
array (
),
'reference' => 'beda02c58f1c4689d42c8dde6a84f7f0c9c93f42',
),
'psr/http-message' =>
array (
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'aliases' =>
array (
),
'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363',
),
'psr/http-message-implementation' =>
array (
'provided' =>
array (
0 => '1.0',
),
),
'ralouphie/getallheaders' =>
array (
'pretty_version' => '2.0.5',
'version' => '2.0.5.0',
'aliases' =>
array (
),
'reference' => '5601c8a83fbba7ef674a7369456d12f1e0d0eafa',
),
),
);
<?php
// platform_check.php @generated by Composer
$issues = array();
if (!(PHP_VERSION_ID >= 50500)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 5.5.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
} elseif (!headers_sent()) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
);
}
<?php
// platform_check.php @generated by Composer
$issues = array();
if (!(PHP_VERSION_ID >= 50500)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 5.5.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
} elseif (!headers_sent()) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
);
}
root = true
[*]
charset = utf-8
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.yml]
indent_size = 2
root = true
[*]
charset = utf-8
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.yml]
indent_size = 2
MIT License
Copyright (c) 2019 Viktor Szépe
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.
MIT License
Copyright (c) 2019 Viktor Szépe
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.
# WooCommerce Stubs
[![Build Status](https://travis-ci.com/php-stubs/woocommerce-stubs.svg?branch=master)](https://travis-ci.com/php-stubs/woocommerce-stubs)
This package provides stub declarations for [WooCommerce](https://woocommerce.com/)
functions, classes and interfaces.
These stubs can help plugin and theme developers leverage static analysis tools
like [PHPStan](https://github.com/phpstan/phpstan),
which is not able to parse WooCommerce as it is not clean OOP code.
Stubs are generated directly from the [source](https://github.com/woocommerce/woocommerce)
using [giacocorsiglia/stubs-generator](https://github.com/GiacoCorsiglia/php-stubs-generator).
### Requirements
- PHP >=7.1
### Installation
Require this package as a development dependency with [Composer](https://getcomposer.org).
```bash
composer require --dev php-stubs/woocommerce-stubs
```
Alternatively you may download `woocommerce-stubs.php` directly.
### Usage in PHPStan
Include all stubs in PHPStan configuration file.
```yaml
parameters:
bootstrapFiles:
- %rootDir%/../../php-stubs/wordpress-stubs/wordpress-stubs.php
- %rootDir%/../../php-stubs/woocommerce-stubs/woocommerce-stubs.php
#- %rootDir%/../../php-stubs/woocommerce-stubs/woocommerce-packages-stubs.php
```
# WooCommerce Stubs
[![Build Status](https://travis-ci.com/php-stubs/woocommerce-stubs.svg?branch=master)](https://travis-ci.com/php-stubs/woocommerce-stubs)
This package provides stub declarations for [WooCommerce](https://woocommerce.com/)
functions, classes and interfaces.
These stubs can help plugin and theme developers leverage static analysis tools
like [PHPStan](https://github.com/phpstan/phpstan),
which is not able to parse WooCommerce as it is not clean OOP code.
Stubs are generated directly from the [source](https://github.com/woocommerce/woocommerce)
using [giacocorsiglia/stubs-generator](https://github.com/GiacoCorsiglia/php-stubs-generator).
### Requirements
- PHP >=7.1
### Installation
Require this package as a development dependency with [Composer](https://getcomposer.org).
```bash
composer require --dev php-stubs/woocommerce-stubs
```
Alternatively you may download `woocommerce-stubs.php` directly.
### Usage in PHPStan
Include all stubs in PHPStan configuration file.
```yaml
parameters:
bootstrapFiles:
- %rootDir%/../../php-stubs/wordpress-stubs/wordpress-stubs.php
- %rootDir%/../../php-stubs/woocommerce-stubs/woocommerce-stubs.php
#- %rootDir%/../../php-stubs/woocommerce-stubs/woocommerce-packages-stubs.php
```
{
"name": "php-stubs/woocommerce-stubs",
"description": "WooCommerce function and class declaration stubs for static analysis.",
"keywords": [
"woocommerce",
"wordpress",
"static analysis",
"phpstan"
],
"homepage": "https://github.com/php-stubs/woocommerce-stubs",
"license": "MIT",
"require": {
"php-stubs/wordpress-stubs": "^5.3.0"
},
"require-dev": {
"php": "~7.1",
"giacocorsiglia/stubs-generator": "^0.5.0"
},
"suggest": {
"szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan",
"symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions"
},
"minimum-stability": "stable",
"scripts": {
"post-install-cmd": "@composer --working-dir=source/ update --no-interaction --no-suggest",
"post-update-cmd" : "@composer --working-dir=source/ update --no-interaction --no-suggest",
"cleanup": "git status --short --ignored | sed -n -e 's#^!! ##p' | xargs -r rm -vrf"
},
"scripts-descriptions": {
"cleanup": "Remove all ignored files."
}
}
{
"name": "php-stubs/woocommerce-stubs",
"description": "WooCommerce function and class declaration stubs for static analysis.",
"keywords": [
"woocommerce",
"wordpress",
"static analysis",
"phpstan"
],
"homepage": "https://github.com/php-stubs/woocommerce-stubs",
"license": "MIT",
"require": {
"php-stubs/wordpress-stubs": "^5.3.0"
},
"require-dev": {
"php": "~7.1",
"giacocorsiglia/stubs-generator": "^0.5.0"
},
"suggest": {
"szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan",
"symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions"
},
"minimum-stability": "stable",
"scripts": {
"post-install-cmd": "@composer --working-dir=source/ update --no-interaction --no-suggest",
"post-update-cmd" : "@composer --working-dir=source/ update --no-interaction --no-suggest",
"cleanup": "git status --short --ignored | sed -n -e 's#^!! ##p' | xargs -r rm -vrf"
},
"scripts-descriptions": {
"cleanup": "Remove all ignored files."
}
}
<?php
return \StubsGenerator\Finder::create()
->in(['source/woocommerce/packages/*/src'])
// Action Scheduler.
->append(
\StubsGenerator\Finder::create()
->in([
'source/woocommerce/packages/action-scheduler/classes',
// Current classes extend deprecated ones.
'source/woocommerce/packages/action-scheduler/deprecated',
])
// Uses WP-CLI.
->notPath('WP_CLI')
->sortByName(true)
)
->append(
\StubsGenerator\Finder::create()
->in(['source/woocommerce/packages/action-scheduler'])
->files()
->depth('< 1')
->path('functions.php')
)
// WC Admin "includes".
->append(
\StubsGenerator\Finder::create()
->in(['source/woocommerce/packages/woocommerce-admin/includes'])
// Email templates.
->notPath('emails')
// Update functions.
->notPath('wc-admin-update-functions.php')
->sortByName(true)
)
->sortByName(true)
;
<?php
return \StubsGenerator\Finder::create()
->in(['source/woocommerce/packages/*/src'])
// Action Scheduler.
->append(
\StubsGenerator\Finder::create()
->in([
'source/woocommerce/packages/action-scheduler/classes',
// Current classes extend deprecated ones.
'source/woocommerce/packages/action-scheduler/deprecated',
])
// Uses WP-CLI.
->notPath('WP_CLI')
->sortByName(true)
)
->append(
\StubsGenerator\Finder::create()
->in(['source/woocommerce/packages/action-scheduler'])
->files()
->depth('< 1')
->path('functions.php')
)
// WC Admin "includes".
->append(
\StubsGenerator\Finder::create()
->in(['source/woocommerce/packages/woocommerce-admin/includes'])
// Email templates.
->notPath('emails')
// Update functions.
->notPath('wc-admin-update-functions.php')
->sortByName(true)
)
->sortByName(true)
;
<?php
return \StubsGenerator\Finder::create()
->in('source/woocommerce/includes')
->append(
\StubsGenerator\Finder::create()
->in(['source/woocommerce'])
->files()
->depth('< 1')
->path('woocommerce.php')
)
// Exclude woocommerce.com API as is uses the woocommerce-rest-api package.
->notPath('wccom-site/rest-api/endpoints')
// Templates.
->notPath('admin/views')
->notPath('admin/helper/views')
->notPath('admin/importers/views')
->notPath('admin/marketplace-suggestions/templates')
->notPath('admin/marketplace-suggestions/views')
->notPath('admin/meta-boxes/views')
->notPath('admin/plugin-updates/views')
->notPath('admin/settings/views')
// $ ls includes/shipping/*/includes/*.php
->notPath('shipping/flat-rate/includes/settings-flat-rate.php')
->notPath('shipping/legacy-flat-rate/includes/settings-flat-rate.php')
// Legacy WooCommerce API.
->notPath('api/legacy')
->notPath('legacy/api')
// Update functions.
->notPath('wc-update-functions.php')
->sortByName()
;
<?php
return \StubsGenerator\Finder::create()
->in('source/woocommerce/includes')
->append(
\StubsGenerator\Finder::create()
->in(['source/woocommerce'])
->files()
->depth('< 1')
->path('woocommerce.php')
)
// Exclude woocommerce.com API as is uses the woocommerce-rest-api package.
->notPath('wccom-site/rest-api/endpoints')
// Templates.
->notPath('admin/views')
->notPath('admin/helper/views')
->notPath('admin/importers/views')
->notPath('admin/marketplace-suggestions/templates')
->notPath('admin/marketplace-suggestions/views')
->notPath('admin/meta-boxes/views')
->notPath('admin/plugin-updates/views')
->notPath('admin/settings/views')
// $ ls includes/shipping/*/includes/*.php
->notPath('shipping/flat-rate/includes/settings-flat-rate.php')
->notPath('shipping/legacy-flat-rate/includes/settings-flat-rate.php')
// Legacy WooCommerce API.
->notPath('api/legacy')
->notPath('legacy/api')
// Update functions.
->notPath('wc-update-functions.php')
->sortByName()
;
#!/usr/bin/env bash
#
# Generate WooCommerce stubs from the source directory.
#
HEADER=$'/**\n * Generated stub declarations for WooCommerce.\n * @see https://woocommerce.com\n * @see https://github.com/php-stubs/woocommerce-stubs\n */'
FILE="woocommerce-stubs.php"
FILE_PKGS="woocommerce-packages-stubs.php"
set -e
test -f "$FILE"
test -f "$FILE_PKGS"
test -d "source/woocommerce"
# Exclude globals.
"$(dirname "$0")/vendor/bin/generate-stubs" \
--force \
--finder=finder.php \
--header="$HEADER" \
--functions \
--classes \
--interfaces \
--traits \
--out="$FILE"
# There are no WC functions to read these constants.
# See define_constants() in includes/class-woocommerce.php
#printf '\n%s\n' "define('WC_VERSION', '0.0.0');" >>"$FILE"
printf '\nnamespace {\n%s\n}\n' "define('WC_VERSION', '0.0.0');" >>"$FILE"
# Packages.
"$(dirname "$0")/vendor/bin/generate-stubs" \
--force \
--finder=finder-packages.php \
--header="$HEADER" \
--functions \
--classes \
--interfaces \
--traits \
--out="$FILE_PKGS"
# FIXME Add modern core arguments.
##sed -e 's#^\s*public function feedback(\$string#&, ...$args#' -i "$FILE_PKGS"
#!/usr/bin/env bash
#
# Generate WooCommerce stubs from the source directory.
#
HEADER=$'/**\n * Generated stub declarations for WooCommerce.\n * @see https://woocommerce.com\n * @see https://github.com/php-stubs/woocommerce-stubs\n */'
FILE="woocommerce-stubs.php"
FILE_PKGS="woocommerce-packages-stubs.php"
set -e
test -f "$FILE"
test -f "$FILE_PKGS"
test -d "source/woocommerce"
# Exclude globals.
"$(dirname "$0")/vendor/bin/generate-stubs" \
--force \
--finder=finder.php \
--header="$HEADER" \
--functions \
--classes \
--interfaces \
--traits \
--out="$FILE"
# There are no WC functions to read these constants.
# See define_constants() in includes/class-woocommerce.php
#printf '\n%s\n' "define('WC_VERSION', '0.0.0');" >>"$FILE"
printf '\nnamespace {\n%s\n}\n' "define('WC_VERSION', '0.0.0');" >>"$FILE"
# Packages.
"$(dirname "$0")/vendor/bin/generate-stubs" \
--force \
--finder=finder-packages.php \
--header="$HEADER" \
--functions \
--classes \
--interfaces \
--traits \
--out="$FILE_PKGS"
# FIXME Add modern core arguments.
##sed -e 's#^\s*public function feedback(\$string#&, ...$args#' -i "$FILE_PKGS"
#!/usr/bin/env bash
#
# Generate WooCommerce stubs from all the latest versions.
#
# Watch current release on Packagist.
# wget -qO- https://packagist.org/packages/woocommerce/woocommerce.json \
# | jq '.package.versions[] | select(.version_normalized=="4.4.0.0")'
set -e
WC_JSON="$(wget -q -O- "https://packagist.org/packages/woocommerce/woocommerce.json")"
# https://wordpress.org/plugins/woocommerce/advanced/
for V in 3.5 3.6 3.7 3.8 3.9 \
4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.8 4.9 \
5.0 5.1 5.2 5.3 5.4; do
# Find latest version
printf -v JQ_FILTER '.package.versions[].version | select(test("^%s\\\\.%s\\\\.\\\\d+$"))' "${V%.*}" "${V#*.}"
LATEST="$(jq -r "$JQ_FILTER" <<<"$WC_JSON" | sort -t "." -k 3 -g | tail -n 1)"
if [ -z "$LATEST" ]; then
echo "No version for ${V}!"
continue;
fi
echo "Releasing version ${LATEST} ..."
if git rev-parse "refs/tags/v${LATEST}" >/dev/null 2>&1; then
echo "Tag exists!"
continue;
fi
# Clean up source/ directory
git status --ignored --short -- source/ | sed -n -e 's#^!! ##p' | xargs --no-run-if-empty -- rm -rf
# Get new version
printf -v SED_EXP 's#\\("woocommerce/woocommerce"\\): "[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+"#\\1: "%s"#' "$LATEST"
sed -i -e "$SED_EXP" source/composer.json
composer run-script post-install-cmd
# FIXME https://github.com/woocommerce/woocommerce/issues/29078#issuecomment-777706511
composer run-script post-install-cmd
# Generate stubs
echo "Generating stubs ..."
./generate.sh
# Tag version
git commit --all -m "Generate stubs for WooCommerce ${LATEST}"
git tag "v${LATEST}"
done
#!/usr/bin/env bash
#
# Generate WooCommerce stubs from all the latest versions.
#
# Watch current release on Packagist.
# wget -qO- https://packagist.org/packages/woocommerce/woocommerce.json \
# | jq '.package.versions[] | select(.version_normalized=="4.4.0.0")'
set -e
WC_JSON="$(wget -q -O- "https://packagist.org/packages/woocommerce/woocommerce.json")"
# https://wordpress.org/plugins/woocommerce/advanced/
for V in 3.5 3.6 3.7 3.8 3.9 \
4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.8 4.9 \
5.0 5.1 5.2 5.3 5.4; do
# Find latest version
printf -v JQ_FILTER '.package.versions[].version | select(test("^%s\\\\.%s\\\\.\\\\d+$"))' "${V%.*}" "${V#*.}"
LATEST="$(jq -r "$JQ_FILTER" <<<"$WC_JSON" | sort -t "." -k 3 -g | tail -n 1)"
if [ -z "$LATEST" ]; then
echo "No version for ${V}!"
continue;
fi
echo "Releasing version ${LATEST} ..."
if git rev-parse "refs/tags/v${LATEST}" >/dev/null 2>&1; then
echo "Tag exists!"
continue;
fi
# Clean up source/ directory
git status --ignored --short -- source/ | sed -n -e 's#^!! ##p' | xargs --no-run-if-empty -- rm -rf
# Get new version
printf -v SED_EXP 's#\\("woocommerce/woocommerce"\\): "[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+"#\\1: "%s"#' "$LATEST"
sed -i -e "$SED_EXP" source/composer.json
composer run-script post-install-cmd
# FIXME https://github.com/woocommerce/woocommerce/issues/29078#issuecomment-777706511
composer run-script post-install-cmd
# Generate stubs
echo "Generating stubs ..."
./generate.sh
# Tag version
git commit --all -m "Generate stubs for WooCommerce ${LATEST}"
git tag "v${LATEST}"
done
MIT License
Copyright (c) 2019 Viktor Szépe
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.
MIT License
Copyright (c) 2019 Viktor Szépe
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.
{
"name": "php-stubs/wordpress-stubs",
"description": "WordPress function and class declaration stubs for static analysis.",
"keywords": [
"wordpress",
"static analysis",
"phpstan"
],
"homepage": "https://github.com/php-stubs/wordpress-stubs",
"license": "MIT",
"replace": {
"giacocorsiglia/wordpress-stubs": "*"
},
"require-dev": {
"php": "~7.1",
"giacocorsiglia/stubs-generator": "^0.5.0"
},
"suggest": {
"szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan",
"paragonie/sodium_compat": "Pure PHP implementation of libsodium",
"symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions"
},
"minimum-stability": "stable",
"scripts": {
"post-install-cmd": "@composer --working-dir=source/ update --no-interaction --no-suggest",
"post-update-cmd" : "@composer --working-dir=source/ update --no-interaction --no-suggest",
"cleanup": "git status --short --ignored | sed -n -e 's#^!! ##p' | xargs -r rm -vrf"
},
"scripts-descriptions": {
"cleanup": "Remove all ignored files."
}
}
{
"name": "php-stubs/wordpress-stubs",
"description": "WordPress function and class declaration stubs for static analysis.",
"keywords": [
"wordpress",
"static analysis",
"phpstan"
],
"homepage": "https://github.com/php-stubs/wordpress-stubs",
"license": "MIT",
"replace": {
"giacocorsiglia/wordpress-stubs": "*"
},
"require-dev": {
"php": "~7.1",
"giacocorsiglia/stubs-generator": "^0.5.0"
},
"suggest": {
"szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan",
"paragonie/sodium_compat": "Pure PHP implementation of libsodium",
"symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions"
},
"minimum-stability": "stable",
"scripts": {
"post-install-cmd": "@composer --working-dir=source/ update --no-interaction --no-suggest",
"post-update-cmd" : "@composer --working-dir=source/ update --no-interaction --no-suggest",
"cleanup": "git status --short --ignored | sed -n -e 's#^!! ##p' | xargs -r rm -vrf"
},
"scripts-descriptions": {
"cleanup": "Remove all ignored files."
}
}
{
"require": {
"php": "~7.1",
"ext-gettext": "*",
"ext-hash": "*",
"ext-json": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
"ext-sodium": "*",
"johnpbloch/wordpress": "5.7.2"
},
"minimum-stability": "stable"
}
{
"require": {
"php": "~7.1",
"ext-gettext": "*",
"ext-hash": "*",
"ext-json": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
"ext-sodium": "*",
"johnpbloch/wordpress": "5.7.2"
},
"minimum-stability": "stable"
}
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
<g>
<g>
<path d="M502,206.5h-82v-21.167c0-5.523-4.478-10-10-10H194c-5.522,0-10,4.477-10,10c0,5.523,4.478,10,10,10h206v76.666
c0,67.348-35.957,129.942-94.018,164H114.018C55.957,401.942,20,339.347,20,272v-76.666h67c5.522,0,10-4.477,10-10
c0-5.523-4.478-10-10-10H10c-5.522,0-10,4.477-10,10V272c0,37.8,10.16,74.864,29.382,107.183
C42.345,400.98,59.165,420.228,78.862,436H10c-5.522,0-10,4.477-10,10c0,36.393,29.607,66,66,66h312c36.393,0,66-29.607,66-66
c0-5.523-4.478-10-10-10h-92.862c18.129-14.516,33.812-31.983,46.302-51.667h28.227C468.785,384.333,512,341.118,512,288v-71.5
C512,210.977,507.523,206.5,502,206.5z M422.905,456c-4.578,20.572-22.974,36-44.905,36H66c-21.931,0-40.326-15.428-44.905-36
h90.244h197.322H422.905z M420,272v-5.5h32V288c0,20.034-16.299,36.333-36.333,36.333h-2.271C417.761,307.327,420,289.745,420,272
z M492,288c0,42.09-34.243,76.333-76.333,76.333h-17.02c3.193-6.521,6.045-13.197,8.537-20h8.483
C446.73,344.333,472,319.062,472,288v-31.5c0-5.523-4.478-10-10-10h-42v-20h72V288z"/>
</g>
</g>
<g>
<g>
<path d="M219.549,55.343l-5.203-6.533c-7.638-9.588-7.649-22.991-0.027-32.593c3.434-4.326,2.71-10.616-1.616-14.049
c-4.327-3.435-10.616-2.71-14.05,1.616c-13.442,16.936-13.422,40.575,0.049,57.487l5.203,6.533
c9.981,12.53,9.996,30.045,0.036,42.594l-5.332,6.718c-3.434,4.326-2.71,10.616,1.616,14.049c1.839,1.459,4.032,2.168,6.21,2.168
c2.946,0,5.865-1.296,7.84-3.784l5.332-6.718C235.387,102.949,235.364,75.197,219.549,55.343z"/>
</g>
</g>
<g>
<g>
<path d="M274.978,77.827l-5.203-6.532c-7.638-9.589-7.649-22.992-0.027-32.594c3.434-4.326,2.71-10.616-1.616-14.049
c-4.327-3.435-10.616-2.71-14.05,1.616c-13.442,16.936-13.422,40.575,0.049,57.488l5.203,6.533
c9.98,12.531,9.995,30.047,0.035,42.595l-5.331,6.717c-3.434,4.326-2.71,10.616,1.616,14.049c1.839,1.459,4.032,2.167,6.21,2.167
c2.946,0,5.866-1.297,7.84-3.784l5.33-6.717C290.815,125.435,290.792,97.683,274.978,77.827z"/>
</g>
</g>
<g>
<g>
<path d="M164.12,77.828l-5.203-6.532c-7.638-9.588-7.649-22.992-0.028-32.594c3.434-4.326,2.71-10.616-1.616-14.05
c-4.327-3.434-10.616-2.708-14.05,1.616c-13.441,16.936-13.421,40.576,0.05,57.488l5.203,6.533
c9.98,12.531,9.995,30.047,0.036,42.594l-5.332,6.717c-3.434,4.326-2.711,10.616,1.615,14.05c1.839,1.459,4.031,2.168,6.21,2.168
c2.946,0,5.865-1.296,7.839-3.783l5.333-6.718C179.957,125.436,179.934,97.684,164.12,77.828z"/>
</g>
</g>
<g>
<g>
<path d="M150.28,178.26c-1.86-1.86-4.44-2.93-7.07-2.93s-5.21,1.07-7.07,2.93c-1.859,1.87-2.93,4.44-2.93,7.07
s1.07,5.21,2.93,7.08c1.86,1.86,4.44,2.92,7.07,2.92s5.21-1.06,7.07-2.92c1.869-1.87,2.93-4.44,2.93-7.08
C153.21,182.7,152.149,180.12,150.28,178.26z"/>
</g>
</g>
<g>
<g>
<path d="M362,262c-5.522,0-10,4.477-10,10c0,37.119-15.056,73.598-41.308,100.083c-3.888,3.922-3.859,10.254,0.063,14.142
c1.95,1.933,4.495,2.898,7.04,2.898c2.574-0.001,5.148-0.989,7.103-2.962C354.832,355.961,372,314.351,372,272
C372,266.477,367.522,262,362,262z"/>
</g>
</g>
<g>
<g>
<path d="M293.885,399.225c-2.714-4.811-8.813-6.51-13.623-3.797l-0.228,0.129c-4.811,2.714-6.51,8.813-3.797,13.623
c1.838,3.258,5.227,5.089,8.719,5.089c1.664,0,3.352-0.417,4.904-1.292l0.228-0.129
C294.899,410.134,296.598,404.035,293.885,399.225z"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
<g>
<g>
<path d="M502,206.5h-82v-21.167c0-5.523-4.478-10-10-10H194c-5.522,0-10,4.477-10,10c0,5.523,4.478,10,10,10h206v76.666
c0,67.348-35.957,129.942-94.018,164H114.018C55.957,401.942,20,339.347,20,272v-76.666h67c5.522,0,10-4.477,10-10
c0-5.523-4.478-10-10-10H10c-5.522,0-10,4.477-10,10V272c0,37.8,10.16,74.864,29.382,107.183
C42.345,400.98,59.165,420.228,78.862,436H10c-5.522,0-10,4.477-10,10c0,36.393,29.607,66,66,66h312c36.393,0,66-29.607,66-66
c0-5.523-4.478-10-10-10h-92.862c18.129-14.516,33.812-31.983,46.302-51.667h28.227C468.785,384.333,512,341.118,512,288v-71.5
C512,210.977,507.523,206.5,502,206.5z M422.905,456c-4.578,20.572-22.974,36-44.905,36H66c-21.931,0-40.326-15.428-44.905-36
h90.244h197.322H422.905z M420,272v-5.5h32V288c0,20.034-16.299,36.333-36.333,36.333h-2.271C417.761,307.327,420,289.745,420,272
z M492,288c0,42.09-34.243,76.333-76.333,76.333h-17.02c3.193-6.521,6.045-13.197,8.537-20h8.483
C446.73,344.333,472,319.062,472,288v-31.5c0-5.523-4.478-10-10-10h-42v-20h72V288z"/>
</g>
</g>
<g>
<g>
<path d="M219.549,55.343l-5.203-6.533c-7.638-9.588-7.649-22.991-0.027-32.593c3.434-4.326,2.71-10.616-1.616-14.049
c-4.327-3.435-10.616-2.71-14.05,1.616c-13.442,16.936-13.422,40.575,0.049,57.487l5.203,6.533
c9.981,12.53,9.996,30.045,0.036,42.594l-5.332,6.718c-3.434,4.326-2.71,10.616,1.616,14.049c1.839,1.459,4.032,2.168,6.21,2.168
c2.946,0,5.865-1.296,7.84-3.784l5.332-6.718C235.387,102.949,235.364,75.197,219.549,55.343z"/>
</g>
</g>
<g>
<g>
<path d="M274.978,77.827l-5.203-6.532c-7.638-9.589-7.649-22.992-0.027-32.594c3.434-4.326,2.71-10.616-1.616-14.049
c-4.327-3.435-10.616-2.71-14.05,1.616c-13.442,16.936-13.422,40.575,0.049,57.488l5.203,6.533
c9.98,12.531,9.995,30.047,0.035,42.595l-5.331,6.717c-3.434,4.326-2.71,10.616,1.616,14.049c1.839,1.459,4.032,2.167,6.21,2.167
c2.946,0,5.866-1.297,7.84-3.784l5.33-6.717C290.815,125.435,290.792,97.683,274.978,77.827z"/>
</g>
</g>
<g>
<g>
<path d="M164.12,77.828l-5.203-6.532c-7.638-9.588-7.649-22.992-0.028-32.594c3.434-4.326,2.71-10.616-1.616-14.05
c-4.327-3.434-10.616-2.708-14.05,1.616c-13.441,16.936-13.421,40.576,0.05,57.488l5.203,6.533
c9.98,12.531,9.995,30.047,0.036,42.594l-5.332,6.717c-3.434,4.326-2.711,10.616,1.615,14.05c1.839,1.459,4.031,2.168,6.21,2.168
c2.946,0,5.865-1.296,7.839-3.783l5.333-6.718C179.957,125.436,179.934,97.684,164.12,77.828z"/>
</g>
</g>
<g>
<g>
<path d="M150.28,178.26c-1.86-1.86-4.44-2.93-7.07-2.93s-5.21,1.07-7.07,2.93c-1.859,1.87-2.93,4.44-2.93,7.07
s1.07,5.21,2.93,7.08c1.86,1.86,4.44,2.92,7.07,2.92s5.21-1.06,7.07-2.92c1.869-1.87,2.93-4.44,2.93-7.08
C153.21,182.7,152.149,180.12,150.28,178.26z"/>
</g>
</g>
<g>
<g>
<path d="M362,262c-5.522,0-10,4.477-10,10c0,37.119-15.056,73.598-41.308,100.083c-3.888,3.922-3.859,10.254,0.063,14.142
c1.95,1.933,4.495,2.898,7.04,2.898c2.574-0.001,5.148-0.989,7.103-2.962C354.832,355.961,372,314.351,372,272
C372,266.477,367.522,262,362,262z"/>
</g>
</g>
<g>
<g>
<path d="M293.885,399.225c-2.714-4.811-8.813-6.51-13.623-3.797l-0.228,0.129c-4.811,2.714-6.51,8.813-3.797,13.623
c1.838,3.258,5.227,5.089,8.719,5.089c1.664,0,3.352-0.417,4.904-1.292l0.228-0.129
C294.899,410.134,296.598,404.035,293.885,399.225z"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 512.001 512.001" style="enable-background:new 0 0 512.001 512.001;" xml:space="preserve">
<g>
<g>
<path d="M386.629,294.995c-6.54,0-12.643,1.912-17.778,5.207c-1.26-17.06-15.544-30.556-32.921-30.556
c-8.787,0-16.784,3.452-22.704,9.069c-5.84-9.321-16.206-15.532-27.994-15.532c-6.502,0-12.572,1.89-17.687,5.149V206.44
c-0.013-18.188-14.82-32.985-33.009-32.985c-8.815,0-17.103,3.434-23.34,9.67c-6.235,6.236-9.669,14.525-9.669,23.339v100.99
c-4.693-5.847-11.061-10.098-18.416-12.203c-9.397-2.692-19.283-1.561-27.836,3.184c-8.55,4.744-14.742,12.532-17.433,21.931
s-1.561,19.281,3.181,27.826c5.322,9.6,6.49,32.136,6.49,40.049c0.006,1.24,0.272,30.717,11.229,60.663
c15.103,41.278,43.064,63.097,80.862,63.097h75.504c31.58,0,59.788-15.582,79.428-43.876c2.413-3.476,1.551-8.25-1.925-10.663
c-3.476-2.413-8.25-1.55-10.663,1.925c-11.809,17.011-32.99,37.291-66.84,37.291h-75.504c-31.129,0-53.452-17.733-66.35-52.708
c-10.125-27.455-10.415-55.528-10.418-55.762c0.002-3.3-0.217-32.666-8.413-47.45c-2.757-4.968-3.414-10.713-1.85-16.175
c1.565-5.464,5.165-9.993,10.137-12.751c4.973-2.759,10.72-3.415,16.183-1.852c5.463,1.564,9.988,5.164,12.745,10.138
c7.563,13.632,9.525,21.358,9.89,23.025v44.957c0,4.231,3.43,7.661,7.661,7.661s7.661-3.43,7.661-7.661V206.464
c0-4.721,1.84-9.162,5.181-12.505c3.341-3.341,7.783-5.182,12.504-5.182c9.745,0,17.679,7.928,17.686,17.667v132.439
c0,4.231,3.43,7.661,7.661,7.661c4.231,0,7.661-3.43,7.661-7.661v-42.692c0-9.753,7.935-17.687,17.688-17.687
s17.687,7.934,17.687,17.687v6.464v27.974c0,4.231,3.43,7.661,7.661,7.661c4.231,0,7.661-3.43,7.661-7.661v-27.974
c0-9.753,7.935-17.688,17.688-17.688s17.688,7.935,17.688,17.688v25.348v13.237c0,4.231,3.43,7.661,7.661,7.661
s7.661-3.43,7.661-7.661v-13.237c0-9.753,7.935-17.687,17.688-17.687s17.687,7.934,17.687,17.687v58.465
c0,17.76-3.834,35.94-11.087,52.574c-1.691,3.879,0.083,8.394,3.961,10.086c3.88,1.691,8.394-0.082,10.086-3.961
c8.088-18.551,12.364-38.848,12.364-58.698v-58.465C419.638,309.803,404.83,294.995,386.629,294.995z"/>
</g>
</g>
<g>
<g>
<path d="M183.708,205.331H75.743c-24.466,0-44.37-19.904-44.37-44.37V59.693c-0.001-24.466,19.903-44.37,44.37-44.37h41.055
c4.231,0,7.661-3.43,7.661-7.661S121.029,0,116.798,0H75.743C42.827,0,16.049,26.778,16.049,59.693v101.268
c0,32.915,26.778,59.693,59.693,59.693h107.965c4.232,0,7.662-3.43,7.662-7.661C191.369,208.761,187.939,205.331,183.708,205.331z
"/>
</g>
</g>
<g>
<g>
<path d="M436.259,0H142.337c-4.231,0-7.661,3.43-7.661,7.661s3.43,7.661,7.661,7.661h293.923c24.466,0,44.37,19.904,44.37,44.37
v101.268c0,24.466-19.904,44.37-44.37,44.37h-146.83c-4.231,0-7.661,3.43-7.661,7.661c0,4.231,3.43,7.661,7.661,7.661h146.83
c32.915,0,59.693-26.778,59.693-59.693V59.693C495.952,26.778,469.174,0,436.259,0z"/>
</g>
</g>
<g>
<g>
<path d="M162.026,55.634c-4.938,0-9.726,1.796-9.726,5.985v39.055H118.63V61.619c0-4.19-4.938-5.985-9.726-5.985
c-4.938,0-9.726,1.796-9.726,5.985v97.265c0,4.04,4.789,6.135,9.726,6.135c4.789,0,9.726-2.095,9.726-6.135v-42.946h33.669v42.946
c0,4.04,4.789,6.135,9.727,6.135c4.789,0,9.726-2.095,9.726-6.135V61.619C171.752,57.429,166.814,55.634,162.026,55.634z"/>
</g>
</g>
<g>
<g>
<path d="M251.51,147.961h-42.347v-30.077h22.745c4.19,0,6.135-4.04,6.135-7.482c0-4.04-2.244-7.781-6.135-7.781h-22.745V72.693
h42.347c3.891,0,6.135-4.04,6.135-8.679c0-4.04-1.945-8.38-6.135-8.38H198.24c-4.339,0-8.53,2.095-8.53,6.135v97.114
c0,4.04,4.19,6.135,8.53,6.135h53.271c4.19,0,6.135-4.339,6.135-8.38C257.646,152.001,255.401,147.961,251.51,147.961z"/>
</g>
</g>
<g>
<g>
<path d="M324.987,147.96h-36.511v-86.34c-0.002-4.189-4.94-5.985-9.728-5.985c-4.938,0-9.726,1.796-9.726,5.985v97.265
c0,4.04,4.19,6.135,8.53,6.135h47.436c3.891,0,5.836-4.339,5.836-8.53C330.823,152.15,328.878,147.96,324.987,147.96z"/>
</g>
</g>
<g>
<g>
<path d="M378.856,55.634h-30.077c-4.49,0-7.333,2.843-7.333,5.985v97.265c0,4.04,4.789,6.135,9.726,6.135
c4.789,0,9.727-2.095,9.727-6.135v-34.716h16.759c19.752,0,35.165-9.428,35.165-33.968v-0.898
C412.824,64.763,397.86,55.634,378.856,55.634z M393.371,91.697c0,11.672-5.985,17.209-15.712,17.209H360.9V72.693h16.759
c9.726,0,15.712,5.537,15.712,17.209V91.697z"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 512.001 512.001" style="enable-background:new 0 0 512.001 512.001;" xml:space="preserve">
<g>
<g>
<path d="M386.629,294.995c-6.54,0-12.643,1.912-17.778,5.207c-1.26-17.06-15.544-30.556-32.921-30.556
c-8.787,0-16.784,3.452-22.704,9.069c-5.84-9.321-16.206-15.532-27.994-15.532c-6.502,0-12.572,1.89-17.687,5.149V206.44
c-0.013-18.188-14.82-32.985-33.009-32.985c-8.815,0-17.103,3.434-23.34,9.67c-6.235,6.236-9.669,14.525-9.669,23.339v100.99
c-4.693-5.847-11.061-10.098-18.416-12.203c-9.397-2.692-19.283-1.561-27.836,3.184c-8.55,4.744-14.742,12.532-17.433,21.931
s-1.561,19.281,3.181,27.826c5.322,9.6,6.49,32.136,6.49,40.049c0.006,1.24,0.272,30.717,11.229,60.663
c15.103,41.278,43.064,63.097,80.862,63.097h75.504c31.58,0,59.788-15.582,79.428-43.876c2.413-3.476,1.551-8.25-1.925-10.663
c-3.476-2.413-8.25-1.55-10.663,1.925c-11.809,17.011-32.99,37.291-66.84,37.291h-75.504c-31.129,0-53.452-17.733-66.35-52.708
c-10.125-27.455-10.415-55.528-10.418-55.762c0.002-3.3-0.217-32.666-8.413-47.45c-2.757-4.968-3.414-10.713-1.85-16.175
c1.565-5.464,5.165-9.993,10.137-12.751c4.973-2.759,10.72-3.415,16.183-1.852c5.463,1.564,9.988,5.164,12.745,10.138
c7.563,13.632,9.525,21.358,9.89,23.025v44.957c0,4.231,3.43,7.661,7.661,7.661s7.661-3.43,7.661-7.661V206.464
c0-4.721,1.84-9.162,5.181-12.505c3.341-3.341,7.783-5.182,12.504-5.182c9.745,0,17.679,7.928,17.686,17.667v132.439
c0,4.231,3.43,7.661,7.661,7.661c4.231,0,7.661-3.43,7.661-7.661v-42.692c0-9.753,7.935-17.687,17.688-17.687
s17.687,7.934,17.687,17.687v6.464v27.974c0,4.231,3.43,7.661,7.661,7.661c4.231,0,7.661-3.43,7.661-7.661v-27.974
c0-9.753,7.935-17.688,17.688-17.688s17.688,7.935,17.688,17.688v25.348v13.237c0,4.231,3.43,7.661,7.661,7.661
s7.661-3.43,7.661-7.661v-13.237c0-9.753,7.935-17.687,17.688-17.687s17.687,7.934,17.687,17.687v58.465
c0,17.76-3.834,35.94-11.087,52.574c-1.691,3.879,0.083,8.394,3.961,10.086c3.88,1.691,8.394-0.082,10.086-3.961
c8.088-18.551,12.364-38.848,12.364-58.698v-58.465C419.638,309.803,404.83,294.995,386.629,294.995z"/>
</g>
</g>
<g>
<g>
<path d="M183.708,205.331H75.743c-24.466,0-44.37-19.904-44.37-44.37V59.693c-0.001-24.466,19.903-44.37,44.37-44.37h41.055
c4.231,0,7.661-3.43,7.661-7.661S121.029,0,116.798,0H75.743C42.827,0,16.049,26.778,16.049,59.693v101.268
c0,32.915,26.778,59.693,59.693,59.693h107.965c4.232,0,7.662-3.43,7.662-7.661C191.369,208.761,187.939,205.331,183.708,205.331z
"/>
</g>
</g>
<g>
<g>
<path d="M436.259,0H142.337c-4.231,0-7.661,3.43-7.661,7.661s3.43,7.661,7.661,7.661h293.923c24.466,0,44.37,19.904,44.37,44.37
v101.268c0,24.466-19.904,44.37-44.37,44.37h-146.83c-4.231,0-7.661,3.43-7.661,7.661c0,4.231,3.43,7.661,7.661,7.661h146.83
c32.915,0,59.693-26.778,59.693-59.693V59.693C495.952,26.778,469.174,0,436.259,0z"/>
</g>
</g>
<g>
<g>
<path d="M162.026,55.634c-4.938,0-9.726,1.796-9.726,5.985v39.055H118.63V61.619c0-4.19-4.938-5.985-9.726-5.985
c-4.938,0-9.726,1.796-9.726,5.985v97.265c0,4.04,4.789,6.135,9.726,6.135c4.789,0,9.726-2.095,9.726-6.135v-42.946h33.669v42.946
c0,4.04,4.789,6.135,9.727,6.135c4.789,0,9.726-2.095,9.726-6.135V61.619C171.752,57.429,166.814,55.634,162.026,55.634z"/>
</g>
</g>
<g>
<g>
<path d="M251.51,147.961h-42.347v-30.077h22.745c4.19,0,6.135-4.04,6.135-7.482c0-4.04-2.244-7.781-6.135-7.781h-22.745V72.693
h42.347c3.891,0,6.135-4.04,6.135-8.679c0-4.04-1.945-8.38-6.135-8.38H198.24c-4.339,0-8.53,2.095-8.53,6.135v97.114
c0,4.04,4.19,6.135,8.53,6.135h53.271c4.19,0,6.135-4.339,6.135-8.38C257.646,152.001,255.401,147.961,251.51,147.961z"/>
</g>
</g>
<g>
<g>
<path d="M324.987,147.96h-36.511v-86.34c-0.002-4.189-4.94-5.985-9.728-5.985c-4.938,0-9.726,1.796-9.726,5.985v97.265
c0,4.04,4.19,6.135,8.53,6.135h47.436c3.891,0,5.836-4.339,5.836-8.53C330.823,152.15,328.878,147.96,324.987,147.96z"/>
</g>
</g>
<g>
<g>
<path d="M378.856,55.634h-30.077c-4.49,0-7.333,2.843-7.333,5.985v97.265c0,4.04,4.789,6.135,9.726,6.135
c4.789,0,9.727-2.095,9.727-6.135v-34.716h16.759c19.752,0,35.165-9.428,35.165-33.968v-0.898
C412.824,64.763,397.86,55.634,378.856,55.634z M393.371,91.697c0,11.672-5.985,17.209-15.712,17.209H360.9V72.693h16.759
c9.726,0,15.712,5.537,15.712,17.209V91.697z"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
<?php
/**
* Provide a admin area view for the plugin
*
* This file is used to markup the admin-facing aspects of the plugin.
*
* @link opss.com.vn
* @since 1.0.0
*
* @package Kiotviet_Sync
* @subpackage Kiotviet_Sync/admin/partials
*/
?>
<div class="wrapper">
<?php include "partials/rrc-kiotviet-sync-header.php"; ?>
<?php include "partials/rrc-kiotviet-sync-notice.php"; ?>
<div class="loading-api">
<div class="progress">
<div class="progress-bar progress-bar-indeterminate bg-green"></div>
</div>
<div class="progress-text">Dữ liệu đang được đồng bộ. Xin vui lòng chờ trong giây lát!</div>
</div>
<div class="page-wrapper order-content">
<div class="page-body">
<div class="container-xl">
<div class="row row-cards">
<div class="col-12">
<div class="card mw100">
<div class="card-header">
<h3 class="card-title">Đồng bộ</h3>
</div>
<div class="card-body">
<div class="nav-item d-md-flex me-3">
<div class="btn-sync-simple btn-product-action">
<a href="/wp-admin/admin.php?page=plugin-rrc-kiotviet-sync-product" class="btn btn-outline-white" id="product-sync" rel="noreferrer">
Đơn hàng
</a>
</div>
<div class="btn-sync-stock btn-product-action">
<a href="/wp-admin/admin.php?page=plugin-rrc-kiotviet-sync-product" class="btn btn-outline-white" id="product-sync" rel="noreferrer">
Xử lý đơn hàng Kiotviet
</a>
</div>
</div>
</div>
</div>
</div>
<div class="col-12">
<div class="card mw100">
<div class="table-responsive">
<table id="order-table" data-unique-id="index" data-response-handler="responseHandler"></table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
/**
* Provide a admin area view for the plugin
*
* This file is used to markup the admin-facing aspects of the plugin.
*
* @link opss.com.vn
* @since 1.0.0
*
* @package Kiotviet_Sync
* @subpackage Kiotviet_Sync/admin/partials
*/
?>
<div class="wrapper">
<?php include "partials/rrc-kiotviet-sync-header.php"; ?>
<?php include "partials/rrc-kiotviet-sync-notice.php"; ?>
<div class="loading-api">
<div class="progress">
<div class="progress-bar progress-bar-indeterminate bg-green"></div>
</div>
<div class="progress-text">Dữ liệu đang được đồng bộ. Xin vui lòng chờ trong giây lát!</div>
</div>
<div class="page-wrapper order-content">
<div class="page-body">
<div class="container-xl">
<div class="row row-cards">
<div class="col-12">
<div class="card mw100">
<div class="card-header">
<h3 class="card-title">Đồng bộ</h3>
</div>
<div class="card-body">
<div class="nav-item d-md-flex me-3">
<div class="btn-sync-simple btn-product-action">
<a href="/wp-admin/admin.php?page=plugin-rrc-kiotviet-sync-product" class="btn btn-outline-white" id="product-sync" rel="noreferrer">
Đơn hàng
</a>
</div>
<div class="btn-sync-stock btn-product-action">
<a href="/wp-admin/admin.php?page=plugin-rrc-kiotviet-sync-product" class="btn btn-outline-white" id="product-sync" rel="noreferrer">
Xử lý đơn hàng Kiotviet
</a>
</div>
</div>
</div>
</div>
</div>
<div class="col-12">
<div class="card mw100">
<div class="table-responsive">
<table id="order-table" data-unique-id="index" data-response-handler="responseHandler"></table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment