Skip to content

Instantly share code, notes, and snippets.

View vapvarun's full-sized avatar
👋
AI Developer & WordPress Expert. Building MCP servers & Plugins

Varun Kumar Dubey vapvarun

👋
AI Developer & WordPress Expert. Building MCP servers & Plugins
View GitHub Profile
@vapvarun
vapvarun / 01-snippet.txt
Created April 14, 2026 04:06
Configure a CDN for WooCommerce (woocustomdev.com)
/cart/*
/checkout/*
/my-account/*
/wp-admin/*
/wp-login.php
/wp-json/*
@vapvarun
vapvarun / 01-wp.sh
Created April 14, 2026 04:05
Wordfence Weekly April 2026 (tweakswp.com)
wp plugin list --format=csv | grep -E "perfmatters|ninja-forms-uploads|mw-wp-form"
@vapvarun
vapvarun / 01-mv.sh
Created April 14, 2026 04:05
Move WordPress Content Directory (tweakswp.com)
mv /home/user/public_html/wp-content /home/user/assets
@vapvarun
vapvarun / 01-snippet.php
Created April 14, 2026 04:05
How to Extend the EDD Checkout with Custom Fields (eddsellservices.com)
// 1. Render
add_action( 'edd_purchase_form_after_personal_info', function () {
$value = edd_get_option( 'vat_id_placeholder', '' );
?>
<fieldset id="edd_checkout_vat_id">
<legend><?php esc_html_e( 'VAT ID (optional)', 'mystore' ); ?></legend>
<p>
<label class="edd-label" for="edd-vat-id">
<?php esc_html_e( 'EU VAT Registration Number', 'mystore' ); ?>
</label>
@vapvarun
vapvarun / 01-snippet.txt
Created April 14, 2026 04:05
How to Build Custom Blocks for Block Themes Using the WordPress Block API (brndle.com)
my-theme/blocks/team-member/
block.json # metadata, WordPress reads this to register the block
edit.js # React component rendered in the editor
save.js # HTML saved to post_content (for static blocks)
render.php # PHP template (for dynamic blocks), alternative to save.js
style.scss # shared styles (editor + frontend)
editor.scss # editor-only styles (optional)
view.js # frontend JavaScript (optional)
@vapvarun
vapvarun / 01-snippet.txt
Created April 14, 2026 04:05
Meta 7.9 Million Scrape (unite4india.com)
User-agent: GPTBot
Disallow: /
User-agent: ClaudeBot
Disallow: /
User-agent: anthropic-ai
Disallow: /
User-agent: Meta-ExternalAgent
@vapvarun
vapvarun / 01-snippet.php
Created April 14, 2026 04:05
WordPress Transients API: Cache Database Queries for Better Performance (wppioneer.com)
set_transient( 'my_cache_key', $data, HOUR_IN_SECONDS );
$cached = get_transient( 'my_cache_key' );
delete_transient( 'my_cache_key' );
@vapvarun
vapvarun / 01-snippet.php
Created April 14, 2026 04:05
WooCommerce Coupons, Discounts and Sales: Complete Setup Guide (wppioneer.com)
add_action( 'template_redirect', function () {
if ( ! empty( $_GET['coupon'] ) ) {
$code = sanitize_text_field( $_GET['coupon'] );
if ( wc_get_cart_remove_url() && ! WC()->cart->has_discount( $code ) ) {
WC()->cart->apply_coupon( $code );
}
}
} );
@vapvarun
vapvarun / 01-snippet.txt
Created April 14, 2026 04:05
Headless WordPress with Next.js: Why and How to Go Decoupled (wppioneer.com)
# Next.js page query
query GetPost($slug: ID!) {
post(id: $slug, idType: SLUG) {
title
content
date
featuredImage {
node { sourceUrl altText mediaDetails { width height } }
}
seo { title metaDesc canonical }
@vapvarun
vapvarun / 01-npm.sh
Created April 14, 2026 04:05
@wordpress/build: The Next-Gen Plugin Build Tool (attowp.com)
npm install --save-dev @wordpress/build