Skip to content

Instantly share code, notes, and snippets.

@parsafatehi
parsafatehi / woocommerce_attributes_query.sql
Created January 17, 2022 12:02 — forked from zarei-dev/woocommerce_attributes_query.sql
woocommerce attributes sql query
SELECT
t.term_id AS 'Attribute Value ID',
TRIM('pa_' FROM tt.taxonomy) AS 'Attribute Name',
t.name AS 'Attribute Value',
COUNT(t.name) as 'num'
FROM
wp_posts AS p
INNER JOIN wp_term_relationships AS tr
ON
p.ID = tr.object_id
@parsafatehi
parsafatehi / regex-a-tag
Created August 9, 2022 11:07
regex for finding a tag with specific string
<\s*a[^>]*>(YOUR_STRING)<\s*\/\s*a>
We can't make this file beautiful and searchable because it's too large.
1,google.com
2,youtube.com
3,facebook.com
4,baidu.com
5,wikipedia.org
6,qq.com
7,amazon.com
8,yahoo.com
9,taobao.com
10,tmall.com
@parsafatehi
parsafatehi / wp-config.php
Created April 23, 2023 12:17 — forked from MikeNGarrett/wp-config.php
All those damned wp-config constants you can never remember.
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url