Skip to content

Instantly share code, notes, and snippets.

View microbite-websites's full-sized avatar

microbite-websites

View GitHub Profile
@microbite-websites
microbite-websites / Microbite WebP Converter
Created September 25, 2025 01:54
* Automatically converts uploaded images (JPEG, PNG, GIF, HEIC) to optimized WebP format. * This snippet is perfect for handling large image uploads - it intelligently resizes images * to your specified dimensions and converts them to WebP for maximum compression while * maintaining quality. Original files are replaced with optimized versions t…
<?php
/**
* Microbite WebP Converter
*
* Automatically converts uploaded images (JPEG, PNG, GIF, HEIC) to optimized WebP format.
* This snippet is perfect for handling large image uploads - it intelligently resizes images
* to your specified dimensions and converts them to WebP for maximum compression while
* maintaining quality. Original files are replaced with optimized versions to save server space.
*
@microbite-websites
microbite-websites / gist:c971fa3ee595853512816b4c9703c97b
Created October 11, 2025 05:17
Woocommerce Product Schema - This script willl add product schema to all your woo products without the need to yoast pro or other specialty plugins
// Version 2024-04-28
// For support email info@microbite.com.au
// Bricks - Woo product schema
function update_price_valid_until() {
$currentDate = date('Y-m-d');
$priceValidUntil = get_option('woocommerce_price_valid_until');
if (empty($priceValidUntil) || $currentDate >= $priceValidUntil) {
$priceValidUntil = date('Y-m-d', strtotime('+6 months'));