Skip to content

Instantly share code, notes, and snippets.

View gedex's full-sized avatar
🏠
Working from home

Akeda Bagus gedex

🏠
Working from home
View GitHub Profile
#!/usr/bin/env bash
wcez_usage() {
if [[ ! -z "$1" ]]; then
echo -e "$1\n"
fi
echo "Usage: wcez <extension-slug> <dst> [-b branch] [-t tag]"
}
@gedex
gedex / notes.md
Created November 8, 2016 18:28
WooCommerce Software Add-on Notes

WooCommerce Software Add-on notes

Relationship

  • An order has many license keys (each license is a record in {db_prefix}_software_licenses table)
  • License key has many activations (each activation is a record in {db_prefix}__software_activations)

License key generation

@gedex
gedex / functions.php
Created November 14, 2016 21:36
Overriding default Monthly Payment Messaging in WooCommerce Gateway Affirm
<?php
add_filter( 'wc_gateway_affirm_as_low_as_data', function( $data ) {
$data['prompt'] = 'or as low as $%s per month'; // %s will replaced by JS
return $data;
} );
a:32:{i:1487609341;a:1:{s:43:"woocommerce_send_queued_transactional_email";a:1:{s:32:"c051ee229a7f301841f337df7409475e";a:2:{s:8:"schedule";b:0;s:4:"args";a:2:{s:6:"filter";s:46:"woocommerce_order_status_pending_to_processing";s:4:"args";a:2:{i:0;i:5789;i:1;O:8:"WC_Order":28:{s:10:"order_type";s:6:"simple";s:2:"id";i:0;s:4:"post";N;s:10:"order_date";s:0:"";s:13:"modified_date";s:0:"";s:16:"customer_message";s:0:"";s:13:"customer_note";s:0:"";s:11:"post_status";s:0:"";s:18:"prices_include_tax";b:0;s:16:"tax_display_cart";s:0:"";s:21:"display_totals_ex_tax";b:0;s:19:"display_cart_ex_tax";b:0;s:28:"�*�formatted_billing_address";s:0:"";s:29:"�*�formatted_shipping_address";s:0:"";s:20:"�*�status_transition";a:4:{s:4:"from";s:7:"pending";s:2:"to";s:10:"processing";s:4:"note";s:33:"Payment to be made upon delivery.";s:6:"manual";b:0;}s:7:"�*�data";a:28:{s:9:"parent_id";i:0;s:6:"status";s:10:"processing";s:8:"currency";s:3:"GBP";s:7:"version";s:5:"2.7.0";s:18:"prices_include_tax";b:0;s:12:"date_created";i:1487609331;
FILE: ...ins/woocommerce-sms-notifications/lib/class-clockwork-plugin.php
----------------------------------------------------------------------
FOUND 924 ERRORS AFFECTING 423 LINES
----------------------------------------------------------------------
2 | ERROR | [ ] You must use "/**" style comments for a file
| | comment
2 | ERROR | [x] Block comment text must start on a new line
19 | ERROR | [ ] Inline comments must end in full-stops,
| | exclamation marks, or question marks
FILE: ...ins/woocommerce-shipping-stamps/includes/class-wc-stamps-api.php
----------------------------------------------------------------------
FOUND 74 ERRORS AND 1 WARNING AFFECTING 55 LINES
----------------------------------------------------------------------
1 | ERROR | [ ] Missing file doc comment
13 | ERROR | [ ] Missing member variable doc comment
14 | ERROR | [ ] Missing member variable doc comment
15 | ERROR | [ ] Missing member variable doc comment
19 | ERROR | [x] There must be exactly one blank line before the
FILE: ...ing-per-product/includes/class-wc-shipping-per-product-admin.php
----------------------------------------------------------------------
FOUND 48 ERRORS AFFECTING 30 LINES
----------------------------------------------------------------------
1 | ERROR | [ ] Missing file doc comment
7 | ERROR | [ ] Missing class doc comment
35 | ERROR | [x] Each line in an array declaration must end in a
| | comma
49 | ERROR | [x] Expected 1 spaces after opening bracket; 0 found
package main
import (
"flag"
"fmt"
"strconv"
"strings"
)
var service = flag.String("service", "globalvalue", "service name")
This file has been truncated, but you can view the full file.
FILE: ...gins/woocommerce-shipping-multiple-addresses/class.ms_compat.php
----------------------------------------------------------------------
FOUND 400 ERRORS AFFECTING 349 LINES
----------------------------------------------------------------------
1 | ERROR | [ ] Filenames should be all lowercase with hyphens as
| | word separators. Expected class.ms-compat.php, but
| | found class.ms_compat.php.
22 | ERROR | [ ] Missing @package tag in file comment
24 | ERROR | [x] Inline control structures are not allowed
<?php
/**
* Base class for WooCommerce REST controller.
*
* @since 4.0.0
* @package WC_Stripe/API
*/
/**
* WooCommerce Stripe REST Controller.