Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin Hill whatthefork

View GitHub Profile
@whatthefork
whatthefork / sodium-keypair-generator.php
Created May 23, 2019
Sodium - Generate keypair for signing
View sodium-keypair-generator.php
/*
SODIUM CRYPTO
GENERATE NEW KEY PAIR FOR PACKAGE SIGNING
You can use this to create a signing keypair and use it to sign plugins and themes for WordPress 5.2 and newer:
*/
function generate_new_key_pair() {
View all_zones.php
<?php
function ibenic_get_all_zones() {
if( class_exists( 'WC_Shipping_Zones' ) ) {
$all_zones = WC_Shipping_Zones::get_zones();
return $all_zones;
}
return false;
}
View FreightRatesAndService.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class FreightRatesAndService {
protected $username = '';
protected $password = '';
protected $accessKey = '';
protected $sandbox = '';
protected $endpointUrl = '';
protected static $endpointUrls = array(
View woocommerce-send-email.php
<?php
/**
* Plugin Name: WooCommerce Send Email
* Plugin URI: https://gist.github.com/BFTrick/9bd089bc53b11f7ac3fb
* Description: Send an email when a page loads. Useful for testing email functionality.
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
View woocommerce-add-css-to-emails.php
<?php
/**
* Plugin Name: WooCommerce Add CSS to Emails
* Plugin URI: https://gist.github.com/BFTrick/01cc414ee56ce93715ec
* Description: Add CSS styles to WooCommerce emails
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
View WooCommerce - Show number of items in cart and total.php
<?php global $woocommerce; ?>
<a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>"><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?> - <?php echo $woocommerce->cart->get_cart_total(); ?></a>
View woocommerce-modal-variation.php
<?php
/*
Plugin Name: woocommerce modal variationn
Plugin URI: #
Description: show modal window with product variations after clicking -add to cart-.
Version: 0.1
Author: Maks Buriy
Author URI: mailto:byymster@gmail.com
License: GPL2
*/