Commit d6beb22b authored by Quan Nguyen's avatar Quan Nguyen

update code

parent 70e67e4e
Pipeline #513 failed with stages
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
* @package WordPress * @package WordPress
*/ */
// ** URL setting ** // // ** URL setting ** //
define( 'WP_HOME', 'https://rangrangcoffee' ); define( 'WP_HOME', 'https://rangrangcoffee.com' );
define( 'WP_SITEURL', 'https://rangrangcoffee' ); define( 'WP_SITEURL', 'https://rangrangcoffee.com' );
// ** MySQL settings - You can get this info from your web host ** // // ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */ /** The name of the database for WordPress */
......
{ {
"version": 3, "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,OAA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fb,MAAM,AAAA,MAAM,CAAC;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": [ "sources": [
"kiotviet-sync-admin.scss" "kiotviet-sync-admin.scss"
], ],
"names": [], "names": [],
"file": "kiotviet-sync-admin.css" "file": "kiotviet-sync-admin.css"
} }
\ No newline at end of file
#kv-clear-indexeddb { #kv-clear-indexeddb {
margin-top: 20px; margin-top: 20px;
} }
.kvsync-wrapper { .kvsync-wrapper {
margin-top: 20px; margin-top: 20px;
h2.kv-title-top { h2.kv-title-top {
font-size: 16px; font-size: 16px;
background: #23282d; background: #23282d;
color: #fff; color: #fff;
padding: 15px; padding: 15px;
border-left: 5px solid #3da849; border-left: 5px solid #3da849;
margin-bottom: 20px; margin-bottom: 20px;
} }
// product // product
th.column-img, th.column-img,
td.column-img { td.column-img {
width: 60px; width: 60px;
text-align: center; text-align: center;
white-space: nowrap; white-space: nowrap;
> img { > img {
width: 100%; width: 100%;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
} }
} }
.wp-core-ui .button.button-danger { .wp-core-ui .button.button-danger {
color: #fff; color: #fff;
background: #ff4e4e; background: #ff4e4e;
border-color: #ff4e4e; border-color: #ff4e4e;
} }
.stock_status.instock { .stock_status.instock {
color: #7ad03a; color: #7ad03a;
} }
.stock_status.outofstock { .stock_status.outofstock {
color: #a44; color: #a44;
} }
.stock_status.onbackorder { .stock_status.onbackorder {
color: #eaa600; color: #eaa600;
} }
// order // order
.order-status { .order-status {
display: -webkit-inline-box; display: -webkit-inline-box;
display: inline-flex; display: inline-flex;
line-height: 2.5em; line-height: 2.5em;
color: #777; color: #777;
background: #e5e5e5; background: #e5e5e5;
border-radius: 4px; border-radius: 4px;
border-bottom: 1px solid rgba(0, 0, 0, 0.05); border-bottom: 1px solid rgba(0, 0, 0, 0.05);
margin: -0.25em 0; margin: -0.25em 0;
cursor: inherit !important; cursor: inherit !important;
white-space: nowrap; white-space: nowrap;
max-width: 100%; max-width: 100%;
} }
.order-status.status-completed { .order-status.status-completed {
background: #c8d7e1; background: #c8d7e1;
color: #2e4453; color: #2e4453;
} }
.order-status.status-on-hold { .order-status.status-on-hold {
background: #f8dda7; background: #f8dda7;
color: #94660c; color: #94660c;
} }
.order-status.status-failed { .order-status.status-failed {
background: #eba3a3; background: #eba3a3;
color: #761919; color: #761919;
} }
.order-status.status-processing { .order-status.status-processing {
background: #c6e1c6; background: #c6e1c6;
color: #5b841b; color: #5b841b;
} }
.order-status.status-trash { .order-status.status-trash {
background: #eba3a3; background: #eba3a3;
color: #761919; color: #761919;
} }
.order-status > span { .order-status > span {
margin: 0 1em; margin: 0 1em;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
/* The Close Button */ /* The Close Button */
.close { .close {
color: #aaaaaa; color: #aaaaaa;
float: right; float: right;
font-size: 28px; font-size: 28px;
font-weight: bold; font-weight: bold;
} }
.close:hover, .close:hover,
.close:focus { .close:focus {
color: #000; color: #000;
text-decoration: none; text-decoration: none;
cursor: pointer; cursor: pointer;
} }
.detail-log { .detail-log {
word-break: break-all; word-break: break-all;
margin-bottom: 0px; margin-bottom: 0px;
} }
// webhook // webhook
span.active { span.active {
color: #7ad03a; color: #7ad03a;
font-weight: bold; font-weight: bold;
} }
span.no-active { span.no-active {
color: red; color: red;
font-weight: bold; font-weight: bold;
} }
} }
// log // log
.modal.log-modal { .modal.log-modal {
display: none; /* Hidden by default */ display: none; /* Hidden by default */
position: fixed; /* Stay in place */ position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */ z-index: 1; /* Sit on top */
padding-top: 100px; /* Location of the box */ padding-top: 100px; /* Location of the box */
left: 0; left: 0;
top: 0; top: 0;
width: 100%; /* Full width */ width: 100%; /* Full width */
height: 100%; /* Full height */ height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */ overflow: auto; /* Enable scroll if needed */
background-color: rgb(0, 0, 0); /* Fallback color */ background-color: rgb(0, 0, 0); /* Fallback color */
background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */ background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
/* Modal Content */ /* Modal Content */
.modal-content { .modal-content {
background-color: #fefefe; background-color: #fefefe;
margin: auto; margin: auto;
padding: 20px; padding: 20px;
border: 1px solid #888; border: 1px solid #888;
width: 60%; width: 60%;
overflow: scroll; overflow: scroll;
height: 600px; height: 600px;
} }
} }
<?php <?php
/** /**
* Created by PhpStorm. * Created by PhpStorm.
* User: bachh * User: bachh
* Date: 04/05/21 * Date: 04/05/21
* Time: 11:32 AM * Time: 11:32 AM
*/ */
require_once plugin_dir_path(dirname(__FILE__)) . '../includes/services/class-kiotviet-sync-services-auth.php'; require_once plugin_dir_path(dirname(__FILE__)) . '../includes/services/class-kiotviet-sync-services-auth.php';
if (!class_exists('WP_List_Table')) { if (!class_exists('WP_List_Table')) {
require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php'); require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
} }
class Kv_Webhooks_List extends WP_List_Table class Kv_Webhooks_List extends WP_List_Table
{ {
public function __construct() public function __construct()
{ {
parent::__construct([ parent::__construct([
'singular' => __('Webhook'), //singular name of the listed records 'singular' => __('Webhook'), //singular name of the listed records
'plural' => __('Webhooks'), //plural name of the listed records 'plural' => __('Webhooks'), //plural name of the listed records
'ajax' => true //should this table support ajax? 'ajax' => true //should this table support ajax?
]); ]);
} }
public static function get_webhooks($per_page, $current_page) public static function get_webhooks($per_page, $current_page)
{ {
$servicesAuth = new Kiotviet_Sync_Service_Auth(); $servicesAuth = new Kiotviet_Sync_Service_Auth();
$data = $servicesAuth->request("get", "https://public.kiotapi.com/webhooks"); $data = $servicesAuth->request("get", "https://public.kiotapi.com/webhooks");
return $data["data"]["data"]; return $data["data"]["data"];
} }
public static function get_webhooks_count() public static function get_webhooks_count()
{ {
$servicesAuth = new Kiotviet_Sync_Service_Auth(); $servicesAuth = new Kiotviet_Sync_Service_Auth();
$data = $servicesAuth->request("get", "https://public.kiotapi.com/webhooks"); $data = $servicesAuth->request("get", "https://public.kiotapi.com/webhooks");
return count($data["data"]["data"]); return count($data["data"]["data"]);
} }
function no_items() function no_items()
{ {
_e('No webhook found, dude.'); _e('No webhook found, dude.');
} }
/** /**
* Handles data query and filter, sorting, and pagination. * Handles data query and filter, sorting, and pagination.
*/ */
public function prepare_items() public function prepare_items()
{ {
$columns = $this->get_columns(); $columns = $this->get_columns();
$hidden = array(); $hidden = array();
$sortable = array(); $sortable = array();
$this->_column_headers = array($columns, $hidden, $sortable); $this->_column_headers = array($columns, $hidden, $sortable);
$per_page = $this->get_items_per_page('customers_per_page', 25); $per_page = $this->get_items_per_page('customers_per_page', 25);
$current_page = $this->get_pagenum(); $current_page = $this->get_pagenum();
$this->set_pagination_args([ $this->set_pagination_args([
'total_items' => self::get_webhooks_count(), //WE have to calculate the total number of items '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 '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); $this->items = self::get_webhooks($per_page, $current_page);
} }
public function column_default($item, $column_name) public function column_default($item, $column_name)
{ {
switch ( $column_name ) { switch ( $column_name ) {
case 'id': case 'id':
return $item['id']; return $item['id'];
case 'type': case 'type':
return $item['type']; return $item['type'];
case 'url': case 'url':
return $item['url']; return $item['url'];
case 'isActive': case 'isActive':
if($item['isActive'] == true) { if($item['isActive'] == true) {
return '<span class="active">Đã kích hoạt</span>'; return '<span class="active">Đã kích hoạt</span>';
} else { } else {
return '<span class="no-active">Chưa kích hoạt</span>'; return '<span class="no-active">Chưa kích hoạt</span>';
} }
case 'retailerId': case 'retailerId':
return $item['retailerId']; return $item['retailerId'];
case 'description': case 'description':
return $item['description']; return $item['description'];
case 'modifiedDate': case 'modifiedDate':
$newDate = new DateTime($item['modifiedDate']); $newDate = new DateTime($item['modifiedDate']);
return $newDate->format("d-m-Y H:i:s"); return $newDate->format("d-m-Y H:i:s");
default: default:
return print_r( $item, true ); return print_r( $item, true );
} }
} }
function column_cb($item) function column_cb($item)
{ {
return ''; return '';
} }
function get_columns() function get_columns()
{ {
$columns = [ $columns = [
'id' => 'ID', 'id' => 'ID',
'type' => 'Loại', 'type' => 'Loại',
'url' => 'URL', 'url' => 'URL',
'isActive' => 'Active', 'isActive' => 'Active',
'retailerId' => 'Retailer ID', 'retailerId' => 'Retailer ID',
'description' => 'Mô tả', 'description' => 'Mô tả',
'modifiedDate' => 'Ngày tạo' 'modifiedDate' => 'Ngày tạo'
]; ];
return $columns; return $columns;
} }
public function get_sortable_columns() public function get_sortable_columns()
{ {
$sortable_columns = array(); $sortable_columns = array();
return $sortable_columns; return $sortable_columns;
} }
public function get_bulk_actions() public function get_bulk_actions()
{ {
$actions = [ $actions = [
]; ];
return $actions; return $actions;
} }
} }
<?php <?php
/** /**
* Provide a admin area view for the plugin * Provide a admin area view for the plugin
* *
* This file is used to markup the admin-facing aspects of the plugin. * This file is used to markup the admin-facing aspects of the plugin.
* *
* @link opss.com.vn * @link opss.com.vn
* @since 1.0.0 * @since 1.0.0
* *
* @package Kiotviet_Sync * @package Kiotviet_Sync
* @subpackage Kiotviet_Sync/admin/partials * @subpackage Kiotviet_Sync/admin/partials
*/ */
?> ?>
<div class="kvsync-wrapper wrap"> <div class="kvsync-wrapper wrap">
<h2 class="kv-title-top">KiotViet Sync</h2> <h2 class="kv-title-top">KiotViet Sync</h2>
<div id="kvsync"></div> <div id="kvsync"></div>
</div> </div>
<div id="view_log"></div> <div id="view_log"></div>
<div id="myModal" class="modal log-modal"> <div id="myModal" class="modal log-modal">
<!-- Modal content --> <!-- Modal content -->
<div class="modal-content"> <div class="modal-content">
<p><pre class="detail-log"></pre></p> <p><pre class="detail-log"></pre></p>
</div> </div>
</div> </div>
<form method="get" action="admin.php"> <form method="get" action="admin.php">
<input type="hidden" name="page" value="plugin-kiotviet-sync-order"> <input type="hidden" name="page" value="plugin-kiotviet-sync-order">
<div class="kvsync-wrapper wrap"> <div class="kvsync-wrapper wrap">
<h2 class="kv-title-top">Lịch sử đồng bộ</h2> <h2 class="kv-title-top">Lịch sử đồng bộ</h2>
<?php <?php
$logsList->prepare_items(); $logsList->prepare_items();
$logsList->display(); $logsList->display();
?> ?>
</div> </div>
</form> </form>
<script> <script>
jQuery(function(){ jQuery(function(){
jQuery('.view_log').click(function () { jQuery('.view_log').click(function () {
jQuery('#myModal').css('display', 'block'); jQuery('#myModal').css('display', 'block');
jQuery('.detail-log').text(JSON.stringify(jQuery(this).data('value'), null, 4)); jQuery('.detail-log').text(JSON.stringify(jQuery(this).data('value'), null, 4));
}); });
}); });
jQuery(window).click(function(event){ jQuery(window).click(function(event){
var modal = document.getElementById('myModal'); var modal = document.getElementById('myModal');
if (event.target == modal) { if (event.target == modal) {
jQuery('#myModal').css('display', 'none'); jQuery('#myModal').css('display', 'none');
} }
}) })
</script> </script>
<form method="get" action="admin.php"> <form method="get" action="admin.php">
<input type="hidden" name="page" value="plugin-kiotviet-sync-order"> <input type="hidden" name="page" value="plugin-kiotviet-sync-order">
<div class="kvsync-wrapper wrap"> <div class="kvsync-wrapper wrap">
<h2 class="kv-title-top">Danh sách đơn đặt hàng</h2> <h2 class="kv-title-top">Danh sách đơn đặt hàng</h2>
<?php <?php
$orderList->prepare_items(); $orderList->prepare_items();
$orderList->search_box('search', 'search_id'); $orderList->search_box('search', 'search_id');
$orderList->display(); $orderList->display();
?> ?>
</div> </div>
</form> </form>
<script> <script>
jQuery(function(){ jQuery(function(){
jQuery('.re-sync-order').click(function(){ jQuery('.re-sync-order').click(function(){
var jQuerythis = jQuery(this); var jQuerythis = jQuery(this);
var orderId = jQuerythis.attr('data-id'); var orderId = jQuerythis.attr('data-id');
jQuery.ajax({ jQuery.ajax({
type: 'POST', type: 'POST',
url: ajaxurl, url: ajaxurl,
data:{ data:{
order: orderId, order: orderId,
action: 'kiotviet_re_sync_order' action: 'kiotviet_re_sync_order'
}, },
dataType: 'json', dataType: 'json',
beforeSend: function(){ beforeSend: function(){
jQuerythis.attr('disabled', 'disabled').val('Đang đồng bộ'); jQuerythis.attr('disabled', 'disabled').val('Đang đồng bộ');
}, },
success: function(resp){ success: function(resp){
//console.log(resp); //console.log(resp);
if(resp.status === 'error'){ if(resp.status === 'error'){
jQuerythis.closest('td').html( jQuerythis.closest('td').html(
'<strong style=\"color:red\">Thất bại</strong> <br />' + '<strong style=\"color:red\">Thất bại</strong> <br />' +
'<small>' + resp.msg + '</small>' '<small>' + resp.msg + '</small>'
); );
} else { } else {
jQuerythis.closest('td').html('<strong style=\"color:green\">Thành công</strong>'); jQuerythis.closest('td').html('<strong style=\"color:green\">Thành công</strong>');
} }
} }
}); });
}); });
}); });
</script> </script>
<form method="get" action="admin.php"> <form method="get" action="admin.php">
<input type="hidden" name="page" value="plugin-kiotviet-sync-product"> <input type="hidden" name="page" value="plugin-kiotviet-sync-product">
<div class="kvsync-wrapper wrap"> <div class="kvsync-wrapper wrap">
<h2 class="kv-title-top">Danh sách sản phẩm</h2> <h2 class="kv-title-top">Danh sách sản phẩm</h2>
<?php <?php
$productList->prepare_items(); $productList->prepare_items();
$productList->search_box('search', 'search_id'); $productList->search_box('search', 'search_id');
$productList->display(); $productList->display();
?> ?>
</div> </div>
</form> </form>
<script> <script>
jQuery(function(){ jQuery(function(){
jQuery(document).on('click', '.product_sync', function(){ jQuery(document).on('click', '.product_sync', function(){
var jQuerythis = jQuery(this); var jQuerythis = jQuery(this);
var status = jQuerythis.data('status'); var status = jQuerythis.data('status');
var product_id = jQuerythis.data('product-id'); var product_id = jQuerythis.data('product-id');
jQuery.ajax({ jQuery.ajax({
type: 'POST', type: 'POST',
url: ajaxurl, url: ajaxurl,
data:{ data:{
status:status, status:status,
product_id: product_id, product_id: product_id,
action: 'kiotviet_sync_update_status', action: 'kiotviet_sync_update_status',
}, },
dataType: 'json', dataType: 'json',
beforeSend: function(){ beforeSend: function(){
jQuerythis.attr('disabled', 'disabled'); jQuerythis.attr('disabled', 'disabled');
}, },
success: function(resp){ success: function(resp){
if(resp.status === 'success'){ if(resp.status === 'success'){
if(resp.data){ if(resp.data){
jQuerythis.closest('td').find('.product_sync').data('status', 0).removeClass('button-danger').addClass('button-primary').val('Đang đồng bộ').removeAttr('disabled'); jQuerythis.closest('td').find('.product_sync').data('status', 0).removeClass('button-danger').addClass('button-primary').val('Đang đồng bộ').removeAttr('disabled');
}else{ }else{
jQuerythis.closest('td').find('.product_sync').data('status', 1).removeClass('button-primary').addClass('button-danger').val('Ngừng đồng bộ').removeAttr('disabled'); jQuerythis.closest('td').find('.product_sync').data('status', 1).removeClass('button-primary').addClass('button-danger').val('Ngừng đồng bộ').removeAttr('disabled');
} }
} }
} }
}); });
}); });
}); });
</script> </script>
<form method="get" action="admin.php"> <form method="get" action="admin.php">
<input type="hidden" name="page" value="plugin-kiotviet-sync-webhook"> <input type="hidden" name="page" value="plugin-kiotviet-sync-webhook">
<div class="kvsync-wrapper wrap"> <div class="kvsync-wrapper wrap">
<h2 class="kv-title-top">Danh sách webhook</h2> <h2 class="kv-title-top">Danh sách webhook</h2>
<?php <?php
$kiotviet_sync_retailer = get_option('kiotviet_sync_retailer'); $kiotviet_sync_retailer = get_option('kiotviet_sync_retailer');
if(!empty($kiotviet_sync_retailer)) { if(!empty($kiotviet_sync_retailer)) {
$webhooksList->prepare_items(); $webhooksList->prepare_items();
$webhooksList->display(); $webhooksList->display();
} else { ?> } else { ?>
<div class="notice notice-warning is-dismissible"> <div class="notice notice-warning is-dismissible">
<p><?php _e( 'Bạn phải đăng nhập để xem các webhook!', 'kiotviet-sync' ); ?></p> <p><?php _e( 'Bạn phải đăng nhập để xem các webhook!', 'kiotviet-sync' ); ?></p>
</div> </div>
<?php } <?php }
?> ?>
</div> </div>
</form> </form>
<div class="wrap"> <div class="wrap">
<h2>Thao tác</h2> <h2>Thao tác</h2>
<button id="kv-clear-indexeddb">Clear Cache</button> <button id="kv-clear-indexeddb">Clear Cache</button>
</div> </div>
<script> <script>
jQuery(function(){ jQuery(function(){
jQuery(document).on('click', '#kv-clear-indexeddb', async function(){ jQuery(document).on('click', '#kv-clear-indexeddb', async function(){
if (confirm('Are you sure!')) { if (confirm('Are you sure!')) {
const dbs = await window.indexedDB.databases(); const dbs = await window.indexedDB.databases();
dbs.forEach(db => { dbs.forEach(db => {
if(db.name.includes("kiotviet_sync")) { if(db.name.includes("kiotviet_sync")) {
window.indexedDB.deleteDatabase(db.name); window.indexedDB.deleteDatabase(db.name);
} }
}) })
alert("Clear Cache successful!") alert("Clear Cache successful!")
} }
}); });
}); });
</script> </script>
<?php return array ( <?php return array (
'root' => 'root' =>
array ( array (
'pretty_version' => '1.0.0+no-version-set', 'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0', 'version' => '1.0.0.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => NULL, 'reference' => NULL,
'name' => '__root__', 'name' => '__root__',
), ),
'versions' => 'versions' =>
array ( array (
'__root__' => '__root__' =>
array ( array (
'pretty_version' => '1.0.0+no-version-set', 'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0', 'version' => '1.0.0.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => NULL, 'reference' => NULL,
), ),
'citigo/kiotviet-php-sdk' => 'citigo/kiotviet-php-sdk' =>
array ( array (
'pretty_version' => '1.0.3', 'pretty_version' => '1.0.3',
'version' => '1.0.3.0', 'version' => '1.0.3.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '8b661c0b2c2b06d9249d42fa98f9d41e13b8dedd', 'reference' => '8b661c0b2c2b06d9249d42fa98f9d41e13b8dedd',
), ),
'giacocorsiglia/wordpress-stubs' => 'giacocorsiglia/wordpress-stubs' =>
array ( array (
'replaced' => 'replaced' =>
array ( array (
0 => '*', 0 => '*',
), ),
), ),
'guzzlehttp/guzzle' => 'guzzlehttp/guzzle' =>
array ( array (
'pretty_version' => '6.3.3', 'pretty_version' => '6.3.3',
'version' => '6.3.3.0', 'version' => '6.3.3.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '407b0cb880ace85c9b63c5f9551db498cb2d50ba', 'reference' => '407b0cb880ace85c9b63c5f9551db498cb2d50ba',
), ),
'guzzlehttp/promises' => 'guzzlehttp/promises' =>
array ( array (
'pretty_version' => 'v1.3.1', 'pretty_version' => 'v1.3.1',
'version' => '1.3.1.0', 'version' => '1.3.1.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => 'a59da6cf61d80060647ff4d3eb2c03a2bc694646', 'reference' => 'a59da6cf61d80060647ff4d3eb2c03a2bc694646',
), ),
'guzzlehttp/psr7' => 'guzzlehttp/psr7' =>
array ( array (
'pretty_version' => '1.5.2', 'pretty_version' => '1.5.2',
'version' => '1.5.2.0', 'version' => '1.5.2.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '9f83dded91781a01c63574e387eaa769be769115', 'reference' => '9f83dded91781a01c63574e387eaa769be769115',
), ),
'php-stubs/woocommerce-stubs' => 'php-stubs/woocommerce-stubs' =>
array ( array (
'pretty_version' => 'v5.4.0', 'pretty_version' => 'v5.4.0',
'version' => '5.4.0.0', 'version' => '5.4.0.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => 'f0f6a806d92d8918d0dfccde5c7300ce182aec0d', 'reference' => 'f0f6a806d92d8918d0dfccde5c7300ce182aec0d',
), ),
'php-stubs/wordpress-stubs' => 'php-stubs/wordpress-stubs' =>
array ( array (
'pretty_version' => 'v5.7.2', 'pretty_version' => 'v5.7.2',
'version' => '5.7.2.0', 'version' => '5.7.2.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => 'beda02c58f1c4689d42c8dde6a84f7f0c9c93f42', 'reference' => 'beda02c58f1c4689d42c8dde6a84f7f0c9c93f42',
), ),
'psr/http-message' => 'psr/http-message' =>
array ( array (
'pretty_version' => '1.0.1', 'pretty_version' => '1.0.1',
'version' => '1.0.1.0', 'version' => '1.0.1.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363',
), ),
'psr/http-message-implementation' => 'psr/http-message-implementation' =>
array ( array (
'provided' => 'provided' =>
array ( array (
0 => '1.0', 0 => '1.0',
), ),
), ),
'ralouphie/getallheaders' => 'ralouphie/getallheaders' =>
array ( array (
'pretty_version' => '2.0.5', 'pretty_version' => '2.0.5',
'version' => '2.0.5.0', 'version' => '2.0.5.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '5601c8a83fbba7ef674a7369456d12f1e0d0eafa', 'reference' => '5601c8a83fbba7ef674a7369456d12f1e0d0eafa',
), ),
), ),
); );
<?php <?php
// platform_check.php @generated by Composer // platform_check.php @generated by Composer
$issues = array(); $issues = array();
if (!(PHP_VERSION_ID >= 50500)) { if (!(PHP_VERSION_ID >= 50500)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 5.5.0". You are running ' . PHP_VERSION . '.'; $issues[] = 'Your Composer dependencies require a PHP version ">= 5.5.0". You are running ' . PHP_VERSION . '.';
} }
if ($issues) { if ($issues) {
if (!headers_sent()) { if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error'); header('HTTP/1.1 500 Internal Server Error');
} }
if (!ini_get('display_errors')) { if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { 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); fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
} elseif (!headers_sent()) { } 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; 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( trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues), 'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR E_USER_ERROR
); );
} }
root = true root = true
[*] [*]
charset = utf-8 charset = utf-8
indent_size = 4 indent_size = 4
indent_style = space indent_style = space
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true
[*.yml] [*.yml]
indent_size = 2 indent_size = 2
MIT License MIT License
Copyright (c) 2019 Viktor Szépe Copyright (c) 2019 Viktor Szépe
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
# WooCommerce Stubs # WooCommerce Stubs
[![Build Status](https://travis-ci.com/php-stubs/woocommerce-stubs.svg?branch=master)](https://travis-ci.com/php-stubs/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/) This package provides stub declarations for [WooCommerce](https://woocommerce.com/)
functions, classes and interfaces. functions, classes and interfaces.
These stubs can help plugin and theme developers leverage static analysis tools These stubs can help plugin and theme developers leverage static analysis tools
like [PHPStan](https://github.com/phpstan/phpstan), like [PHPStan](https://github.com/phpstan/phpstan),
which is not able to parse WooCommerce as it is not clean OOP code. 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) Stubs are generated directly from the [source](https://github.com/woocommerce/woocommerce)
using [giacocorsiglia/stubs-generator](https://github.com/GiacoCorsiglia/php-stubs-generator). using [giacocorsiglia/stubs-generator](https://github.com/GiacoCorsiglia/php-stubs-generator).
### Requirements ### Requirements
- PHP >=7.1 - PHP >=7.1
### Installation ### Installation
Require this package as a development dependency with [Composer](https://getcomposer.org). Require this package as a development dependency with [Composer](https://getcomposer.org).
```bash ```bash
composer require --dev php-stubs/woocommerce-stubs composer require --dev php-stubs/woocommerce-stubs
``` ```
Alternatively you may download `woocommerce-stubs.php` directly. Alternatively you may download `woocommerce-stubs.php` directly.
### Usage in PHPStan ### Usage in PHPStan
Include all stubs in PHPStan configuration file. Include all stubs in PHPStan configuration file.
```yaml ```yaml
parameters: parameters:
bootstrapFiles: bootstrapFiles:
- %rootDir%/../../php-stubs/wordpress-stubs/wordpress-stubs.php - %rootDir%/../../php-stubs/wordpress-stubs/wordpress-stubs.php
- %rootDir%/../../php-stubs/woocommerce-stubs/woocommerce-stubs.php - %rootDir%/../../php-stubs/woocommerce-stubs/woocommerce-stubs.php
#- %rootDir%/../../php-stubs/woocommerce-stubs/woocommerce-packages-stubs.php #- %rootDir%/../../php-stubs/woocommerce-stubs/woocommerce-packages-stubs.php
``` ```
{ {
"name": "php-stubs/woocommerce-stubs", "name": "php-stubs/woocommerce-stubs",
"description": "WooCommerce function and class declaration stubs for static analysis.", "description": "WooCommerce function and class declaration stubs for static analysis.",
"keywords": [ "keywords": [
"woocommerce", "woocommerce",
"wordpress", "wordpress",
"static analysis", "static analysis",
"phpstan" "phpstan"
], ],
"homepage": "https://github.com/php-stubs/woocommerce-stubs", "homepage": "https://github.com/php-stubs/woocommerce-stubs",
"license": "MIT", "license": "MIT",
"require": { "require": {
"php-stubs/wordpress-stubs": "^5.3.0" "php-stubs/wordpress-stubs": "^5.3.0"
}, },
"require-dev": { "require-dev": {
"php": "~7.1", "php": "~7.1",
"giacocorsiglia/stubs-generator": "^0.5.0" "giacocorsiglia/stubs-generator": "^0.5.0"
}, },
"suggest": { "suggest": {
"szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan", "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan",
"symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions" "symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions"
}, },
"minimum-stability": "stable", "minimum-stability": "stable",
"scripts": { "scripts": {
"post-install-cmd": "@composer --working-dir=source/ update --no-interaction --no-suggest", "post-install-cmd": "@composer --working-dir=source/ update --no-interaction --no-suggest",
"post-update-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" "cleanup": "git status --short --ignored | sed -n -e 's#^!! ##p' | xargs -r rm -vrf"
}, },
"scripts-descriptions": { "scripts-descriptions": {
"cleanup": "Remove all ignored files." "cleanup": "Remove all ignored files."
} }
} }
<?php <?php
return \StubsGenerator\Finder::create() return \StubsGenerator\Finder::create()
->in(['source/woocommerce/packages/*/src']) ->in(['source/woocommerce/packages/*/src'])
// Action Scheduler. // Action Scheduler.
->append( ->append(
\StubsGenerator\Finder::create() \StubsGenerator\Finder::create()
->in([ ->in([
'source/woocommerce/packages/action-scheduler/classes', 'source/woocommerce/packages/action-scheduler/classes',
// Current classes extend deprecated ones. // Current classes extend deprecated ones.
'source/woocommerce/packages/action-scheduler/deprecated', 'source/woocommerce/packages/action-scheduler/deprecated',
]) ])
// Uses WP-CLI. // Uses WP-CLI.
->notPath('WP_CLI') ->notPath('WP_CLI')
->sortByName(true) ->sortByName(true)
) )
->append( ->append(
\StubsGenerator\Finder::create() \StubsGenerator\Finder::create()
->in(['source/woocommerce/packages/action-scheduler']) ->in(['source/woocommerce/packages/action-scheduler'])
->files() ->files()
->depth('< 1') ->depth('< 1')
->path('functions.php') ->path('functions.php')
) )
// WC Admin "includes". // WC Admin "includes".
->append( ->append(
\StubsGenerator\Finder::create() \StubsGenerator\Finder::create()
->in(['source/woocommerce/packages/woocommerce-admin/includes']) ->in(['source/woocommerce/packages/woocommerce-admin/includes'])
// Email templates. // Email templates.
->notPath('emails') ->notPath('emails')
// Update functions. // Update functions.
->notPath('wc-admin-update-functions.php') ->notPath('wc-admin-update-functions.php')
->sortByName(true) ->sortByName(true)
) )
->sortByName(true) ->sortByName(true)
; ;
<?php <?php
return \StubsGenerator\Finder::create() return \StubsGenerator\Finder::create()
->in('source/woocommerce/includes') ->in('source/woocommerce/includes')
->append( ->append(
\StubsGenerator\Finder::create() \StubsGenerator\Finder::create()
->in(['source/woocommerce']) ->in(['source/woocommerce'])
->files() ->files()
->depth('< 1') ->depth('< 1')
->path('woocommerce.php') ->path('woocommerce.php')
) )
// Exclude woocommerce.com API as is uses the woocommerce-rest-api package. // Exclude woocommerce.com API as is uses the woocommerce-rest-api package.
->notPath('wccom-site/rest-api/endpoints') ->notPath('wccom-site/rest-api/endpoints')
// Templates. // Templates.
->notPath('admin/views') ->notPath('admin/views')
->notPath('admin/helper/views') ->notPath('admin/helper/views')
->notPath('admin/importers/views') ->notPath('admin/importers/views')
->notPath('admin/marketplace-suggestions/templates') ->notPath('admin/marketplace-suggestions/templates')
->notPath('admin/marketplace-suggestions/views') ->notPath('admin/marketplace-suggestions/views')
->notPath('admin/meta-boxes/views') ->notPath('admin/meta-boxes/views')
->notPath('admin/plugin-updates/views') ->notPath('admin/plugin-updates/views')
->notPath('admin/settings/views') ->notPath('admin/settings/views')
// $ ls includes/shipping/*/includes/*.php // $ ls includes/shipping/*/includes/*.php
->notPath('shipping/flat-rate/includes/settings-flat-rate.php') ->notPath('shipping/flat-rate/includes/settings-flat-rate.php')
->notPath('shipping/legacy-flat-rate/includes/settings-flat-rate.php') ->notPath('shipping/legacy-flat-rate/includes/settings-flat-rate.php')
// Legacy WooCommerce API. // Legacy WooCommerce API.
->notPath('api/legacy') ->notPath('api/legacy')
->notPath('legacy/api') ->notPath('legacy/api')
// Update functions. // Update functions.
->notPath('wc-update-functions.php') ->notPath('wc-update-functions.php')
->sortByName() ->sortByName()
; ;
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# Generate WooCommerce stubs from the source directory. # 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 */' 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="woocommerce-stubs.php"
FILE_PKGS="woocommerce-packages-stubs.php" FILE_PKGS="woocommerce-packages-stubs.php"
set -e set -e
test -f "$FILE" test -f "$FILE"
test -f "$FILE_PKGS" test -f "$FILE_PKGS"
test -d "source/woocommerce" test -d "source/woocommerce"
# Exclude globals. # Exclude globals.
"$(dirname "$0")/vendor/bin/generate-stubs" \ "$(dirname "$0")/vendor/bin/generate-stubs" \
--force \ --force \
--finder=finder.php \ --finder=finder.php \
--header="$HEADER" \ --header="$HEADER" \
--functions \ --functions \
--classes \ --classes \
--interfaces \ --interfaces \
--traits \ --traits \
--out="$FILE" --out="$FILE"
# There are no WC functions to read these constants. # There are no WC functions to read these constants.
# See define_constants() in includes/class-woocommerce.php # See define_constants() in includes/class-woocommerce.php
#printf '\n%s\n' "define('WC_VERSION', '0.0.0');" >>"$FILE" #printf '\n%s\n' "define('WC_VERSION', '0.0.0');" >>"$FILE"
printf '\nnamespace {\n%s\n}\n' "define('WC_VERSION', '0.0.0');" >>"$FILE" printf '\nnamespace {\n%s\n}\n' "define('WC_VERSION', '0.0.0');" >>"$FILE"
# Packages. # Packages.
"$(dirname "$0")/vendor/bin/generate-stubs" \ "$(dirname "$0")/vendor/bin/generate-stubs" \
--force \ --force \
--finder=finder-packages.php \ --finder=finder-packages.php \
--header="$HEADER" \ --header="$HEADER" \
--functions \ --functions \
--classes \ --classes \
--interfaces \ --interfaces \
--traits \ --traits \
--out="$FILE_PKGS" --out="$FILE_PKGS"
# FIXME Add modern core arguments. # FIXME Add modern core arguments.
##sed -e 's#^\s*public function feedback(\$string#&, ...$args#' -i "$FILE_PKGS" ##sed -e 's#^\s*public function feedback(\$string#&, ...$args#' -i "$FILE_PKGS"
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# Generate WooCommerce stubs from all the latest versions. # Generate WooCommerce stubs from all the latest versions.
# #
# Watch current release on Packagist. # Watch current release on Packagist.
# wget -qO- https://packagist.org/packages/woocommerce/woocommerce.json \ # wget -qO- https://packagist.org/packages/woocommerce/woocommerce.json \
# | jq '.package.versions[] | select(.version_normalized=="4.4.0.0")' # | jq '.package.versions[] | select(.version_normalized=="4.4.0.0")'
set -e set -e
WC_JSON="$(wget -q -O- "https://packagist.org/packages/woocommerce/woocommerce.json")" WC_JSON="$(wget -q -O- "https://packagist.org/packages/woocommerce/woocommerce.json")"
# https://wordpress.org/plugins/woocommerce/advanced/ # https://wordpress.org/plugins/woocommerce/advanced/
for V in 3.5 3.6 3.7 3.8 3.9 \ 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 \ 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 5.0 5.1 5.2 5.3 5.4; do
# Find latest version # Find latest version
printf -v JQ_FILTER '.package.versions[].version | select(test("^%s\\\\.%s\\\\.\\\\d+$"))' "${V%.*}" "${V#*.}" 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)" LATEST="$(jq -r "$JQ_FILTER" <<<"$WC_JSON" | sort -t "." -k 3 -g | tail -n 1)"
if [ -z "$LATEST" ]; then if [ -z "$LATEST" ]; then
echo "No version for ${V}!" echo "No version for ${V}!"
continue; continue;
fi fi
echo "Releasing version ${LATEST} ..." echo "Releasing version ${LATEST} ..."
if git rev-parse "refs/tags/v${LATEST}" >/dev/null 2>&1; then if git rev-parse "refs/tags/v${LATEST}" >/dev/null 2>&1; then
echo "Tag exists!" echo "Tag exists!"
continue; continue;
fi fi
# Clean up source/ directory # Clean up source/ directory
git status --ignored --short -- source/ | sed -n -e 's#^!! ##p' | xargs --no-run-if-empty -- rm -rf git status --ignored --short -- source/ | sed -n -e 's#^!! ##p' | xargs --no-run-if-empty -- rm -rf
# Get new version # Get new version
printf -v SED_EXP 's#\\("woocommerce/woocommerce"\\): "[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+"#\\1: "%s"#' "$LATEST" printf -v SED_EXP 's#\\("woocommerce/woocommerce"\\): "[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+"#\\1: "%s"#' "$LATEST"
sed -i -e "$SED_EXP" source/composer.json sed -i -e "$SED_EXP" source/composer.json
composer run-script post-install-cmd composer run-script post-install-cmd
# FIXME https://github.com/woocommerce/woocommerce/issues/29078#issuecomment-777706511 # FIXME https://github.com/woocommerce/woocommerce/issues/29078#issuecomment-777706511
composer run-script post-install-cmd composer run-script post-install-cmd
# Generate stubs # Generate stubs
echo "Generating stubs ..." echo "Generating stubs ..."
./generate.sh ./generate.sh
# Tag version # Tag version
git commit --all -m "Generate stubs for WooCommerce ${LATEST}" git commit --all -m "Generate stubs for WooCommerce ${LATEST}"
git tag "v${LATEST}" git tag "v${LATEST}"
done done
MIT License MIT License
Copyright (c) 2019 Viktor Szépe Copyright (c) 2019 Viktor Szépe
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
{ {
"name": "php-stubs/wordpress-stubs", "name": "php-stubs/wordpress-stubs",
"description": "WordPress function and class declaration stubs for static analysis.", "description": "WordPress function and class declaration stubs for static analysis.",
"keywords": [ "keywords": [
"wordpress", "wordpress",
"static analysis", "static analysis",
"phpstan" "phpstan"
], ],
"homepage": "https://github.com/php-stubs/wordpress-stubs", "homepage": "https://github.com/php-stubs/wordpress-stubs",
"license": "MIT", "license": "MIT",
"replace": { "replace": {
"giacocorsiglia/wordpress-stubs": "*" "giacocorsiglia/wordpress-stubs": "*"
}, },
"require-dev": { "require-dev": {
"php": "~7.1", "php": "~7.1",
"giacocorsiglia/stubs-generator": "^0.5.0" "giacocorsiglia/stubs-generator": "^0.5.0"
}, },
"suggest": { "suggest": {
"szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan", "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan",
"paragonie/sodium_compat": "Pure PHP implementation of libsodium", "paragonie/sodium_compat": "Pure PHP implementation of libsodium",
"symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions" "symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions"
}, },
"minimum-stability": "stable", "minimum-stability": "stable",
"scripts": { "scripts": {
"post-install-cmd": "@composer --working-dir=source/ update --no-interaction --no-suggest", "post-install-cmd": "@composer --working-dir=source/ update --no-interaction --no-suggest",
"post-update-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" "cleanup": "git status --short --ignored | sed -n -e 's#^!! ##p' | xargs -r rm -vrf"
}, },
"scripts-descriptions": { "scripts-descriptions": {
"cleanup": "Remove all ignored files." "cleanup": "Remove all ignored files."
} }
} }
{ {
"require": { "require": {
"php": "~7.1", "php": "~7.1",
"ext-gettext": "*", "ext-gettext": "*",
"ext-hash": "*", "ext-hash": "*",
"ext-json": "*", "ext-json": "*",
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-openssl": "*", "ext-openssl": "*",
"ext-sodium": "*", "ext-sodium": "*",
"johnpbloch/wordpress": "5.7.2" "johnpbloch/wordpress": "5.7.2"
}, },
"minimum-stability": "stable" "minimum-stability": "stable"
} }
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!-- 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" <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"> viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
<g> <g>
<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 <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,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 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 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 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 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 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 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"/> C446.73,344.333,472,319.062,472,288v-31.5c0-5.523-4.478-10-10-10h-42v-20h72V288z"/>
</g> </g>
</g> </g>
<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 <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 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 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"/> 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>
<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 <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 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 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"/> 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>
<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 <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 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 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"/> 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>
<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 <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 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"/> C153.21,182.7,152.149,180.12,150.28,178.26z"/>
</g> </g>
</g> </g>
<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 <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 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"/> C372,266.477,367.522,262,362,262z"/>
</g> </g>
</g> </g>
<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 <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 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"/> 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>
<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> </svg>
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!-- 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" <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"> viewBox="0 0 512.001 512.001" style="enable-background:new 0 0 512.001 512.001;" xml:space="preserve">
<g> <g>
<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 <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-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-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 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 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 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-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 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 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 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.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 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 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 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 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 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"/> 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>
<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 <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 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 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>
<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 <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 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"/> 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>
<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 <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 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"/> 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>
<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 <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 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"/> 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>
<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 <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"/> 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>
<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 <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 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 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"/> 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>
<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> </svg>
<?php <?php
/** /**
* Provide a admin area view for the plugin * Provide a admin area view for the plugin
* *
* This file is used to markup the admin-facing aspects of the plugin. * This file is used to markup the admin-facing aspects of the plugin.
* *
* @link opss.com.vn * @link opss.com.vn
* @since 1.0.0 * @since 1.0.0
* *
* @package Kiotviet_Sync * @package Kiotviet_Sync
* @subpackage Kiotviet_Sync/admin/partials * @subpackage Kiotviet_Sync/admin/partials
*/ */
?> ?>
<div class="wrapper"> <div class="wrapper">
<?php include "partials/rrc-kiotviet-sync-header.php"; ?> <?php include "partials/rrc-kiotviet-sync-header.php"; ?>
<?php include "partials/rrc-kiotviet-sync-notice.php"; ?> <?php include "partials/rrc-kiotviet-sync-notice.php"; ?>
<div class="loading-api"> <div class="loading-api">
<div class="progress"> <div class="progress">
<div class="progress-bar progress-bar-indeterminate bg-green"></div> <div class="progress-bar progress-bar-indeterminate bg-green"></div>
</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 class="progress-text">Dữ liệu đang được đồng bộ. Xin vui lòng chờ trong giây lát!</div>
</div> </div>
<div class="page-wrapper order-content"> <div class="page-wrapper order-content">
<div class="page-body"> <div class="page-body">
<div class="container-xl"> <div class="container-xl">
<div class="row row-cards"> <div class="row row-cards">
<div class="col-12"> <div class="col-12">
<div class="card mw100"> <div class="card mw100">
<div class="card-header"> <div class="card-header">
<h3 class="card-title">Đồng bộ</h3> <h3 class="card-title">Đồng bộ</h3>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="nav-item d-md-flex me-3"> <div class="nav-item d-md-flex me-3">
<div class="btn-sync-simple btn-product-action"> <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"> <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 Đơn hàng
</a> </a>
</div> </div>
<div class="btn-sync-stock btn-product-action"> <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"> <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 Xử lý đơn hàng Kiotviet
</a> </a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="col-12"> <div class="col-12">
<div class="card mw100"> <div class="card mw100">
<div class="table-responsive"> <div class="table-responsive">
<table id="order-table" data-unique-id="index" data-response-handler="responseHandler"></table> <table id="order-table" data-unique-id="index" data-response-handler="responseHandler"></table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</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