User Tools

Site Tools




database (woocommerce) reports

header("Content-type: text/plain");
$db = mysql_connect('SERVER', 'USER', 'PASS');
mysql_select_db('DATABASE', $db);
echo("VAT Numbers\n-------------------------------------\n");
$sql = "SELECT post_id,meta_value FROM wp_postmeta WHERE meta_key='VAT Number'";
//$sql = "SELECT post_id,meta_value FROM wp_postmeta WHERE meta_key='_billing_country'";
$result = mysql_query($sql);
if (!$result) {
    $message  = 'Invalid query: ' . mysql_error() . "\n";
    $message .= 'Whole query: ' . $sql;
while ($row = mysql_fetch_assoc($result)) {
    echo $row['post_id'] . " " . $row['meta_value'] . "\n";

"connection refused" in WooCommerce

when testing locally without HTTPS you can disable SSL otherwise all pages with personal info are served through HTTPS.

  • Disable Force secure checkout in WooCommerce > Settings > Checkout

site url


fix permissions on OSX

cd ~/Sites/yoursite
sudo chown -R _www .
sudo chmod -R g+w .

Sync DB's

Query Monitor debug plugin

wordpress on localhost lamp doesn't let me install plugins

add this to wp-config.php. But don't use this on production servers.



From Since WordPress 4.0 the thumbnails didn't load any more. So began searching for the loading of thumbnails in your code and tried commented out line 7 and 8 of single-album.php and line 3 and 4 of single-album-ajax.php and added

$picture = $photo->picture;

Set file permissions On Mac OS X (Leopard), the Apache HTTP Server runs under the user account, _www which belongs to the group _www. To allow WordPress to configure wp-config.php during installation, update files during upgrades, and update the .htaccess file for pretty permalinks, give the server write permission on the files.

One way to do this is to change the owner of the wordpress directory and its contents to _www. Keep the group as staff, a group to which your user account belongs and give write permissions to the group.

$ cd /<wherever>/Sites/<thesite>
$ sudo chown -R _www wordpress
$ sudo chmod -R g+w wordpress

This way, the WordPress directories have a permission level of 775 and files have a permission level of 664. No file nor directory is world-writeable.

wordpress.txt · Last modified: 2015/11/23 19:47 by rick