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
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
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: ...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
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;
@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;
} );
@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

#!/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]"
}
+-------------------------------------------------+-----------+--------------------------------------------------+------------+-------+
| EXTENSION | MISMATCH? | MSG | HAS LABEL? | ISSUE |
+-------------------------------------------------+-----------+--------------------------------------------------+------------+-------+
| woocommerce-warranty | Yes | * Plugin's Text Domain doesn't | No | |
| | | match with repo's slug. | | |
| | | Expecting woocommerce-warranty | | |
| | | in Text Domain. | | |
| woocommerce-xero | Yes | * Plugin
#!/usr/bin/env bash
set -e
CUR_DIR=$(pwd)
PRE_COMMIT_URL="https://gist.githubusercontent.com/gedex/f7441bb14fbb04058c24014d8d8db8c9/raw/5aadc9e6e42c8ddc1f79bfc57e15ef2b5f75b604/pre-commit"
PRE_COMMIT="/tmp/the-extendables-pre-commit"
echo "Your WP_PLUGIN_Dir. No trailing slash."
printf "($CUR_DIR): "
#!/usr/bin/env bash
# Store current directory.
CUR_DIR=$(pwd)
default_old_gh_org="woothemes"
default_new_gh_org="woocommerce"
default_plugins_dir="$CUR_DIR"
echo "Your WP_PLUGIN_DIR. No trailing slash."