Archive for Uncategorized

If you are running WordPress on OS X using XAMPP for local development then you likely have tried to upload core or a plugin and encountered the following error while prompted for FTP Connect Information:

To perform the requested action, WordPress needs to access your web server.

This is because by default XAMPP runs as the user `nobody` on Mac and this causes some permissions issues. Additionally WordPress prior to upgrading writes a file to the system and then checks to see which user wrote the file. If this file does not match the user running PHP it will refuse to upgrade, even if write permissions existed. chmod 777 is not sufficient to get past this; you must have the correct user as well. I don’t know why they did this and if there’s a technical reason for it, but it’s annoying.

The solution: Edit your httpd.conf to run as your username for the user and staff for the group.

Open httpd.conf in TextEdit:

sudo open -e /Applications/XAMPP/xamppfiles/etc/httpd.conf

Change:

User nobody
Group nogroup

To:

User your_mac_username
Group staff

Restart Xampp and this should correct the problem; you can verify it worked by running in a .php file.

If you still encounter issues you can check a couple of other things. First verify ownership (most likely problem):

sudo chown -R your_mac_username:staff /path_to_webroot/www/

Next confirm permissions (you can change 777 if you need higher security):

sudo chmod -R 777 /path_to_webroot/www/

Categories Uncategorized
Comments (0)

The following code added to the bottom of P2′s functions.php will allow P2 to send email notifications to all other responders in a comments thread.

// PluginBuddy Email Notification Patch for P2
// by Dustin Bolton on September 10, 2010.
// http://pluginbuddy.com http://dustinbolton.com
add_action( 'comment_post', 'email_notification' );
function email_notification( $comment_id ) {
	$emails = array();
	$comment = get_comment( $comment_id, ARRAY_A );

	// Get emails of all responders.
	$comments = get_comments( 'post_id=' . $comment['comment_post_ID'] );
	foreach( $comments as $this_comment ) {
		if ( $this_comment->comment_author_email != $comment['comment_author_email'] ) { // Only add emails that are not this comment poster.
			array_push( $emails, $this_comment->comment_author_email );
		}
	}

	$emails = array_unique( $emails ); // Strip all duplicate email addresses.

	// Get email address of thread starter to strip them from receiving replies since that is automatic in P2.
	$original_post = get_post( $comment['comment_post_ID'], ARRAY_A );
	$original_poster = get_userdata( $original_post['post_author'] );
	$emails = array_diff( $emails, array( $original_poster->user_email ) ); // Remove from array.

	// Send emails.
	foreach( $emails as $this_email ) {
		wp_mail( $this_email, 'P2 thread updated!', "There has been an update to a thread you posted in by " . $comment['comment_author'] . " on " . $comment['comment_date'] . ":\n\n" . $comment['comment_content'] );
	}
}
// End PluginBuddy Email Notification Patch.
Categories Uncategorized
Comments (1)

Incongruity

by Dustin

Comment posted by macemoneta over at Slashdot: “The problem for many people is the incongruity between how they were raised and reality. People are generally raised to believe that people are good, that there are norms of behavior, there is justice in the world, authority figures can be trusted, things happen for reason and are overseen by an omnipotent deity. As we grow up, we learn that these are simply convenient lies that define our society.

When presented with conflicting visual evidence, we can be shocked and damaged – our world view is broken. Some go into denial (classifying the content as depravity), and some go into depression (recognizing that society is simply a veneer). Education and experience over time tends to break these falsehoods more gently, incrementally.”

Categories Uncategorized
Comments (0)

I recently had a customer that had ~70,000 revisions on posts on his WordPress site. This caused his database to skyrocket to 400mb+. I discovered the cause of these revisions to be the plugin FeedWordpress. FeedWordPress was triggering WordPress to create massive amounts of revisions. Because of this the plugin I wrote, BackupBuddy, could not back up his site without running into PHP timeout issues. In this post is the solution I used to resolve this problem.

In the root directory of your WordPress installation, open wp-config.php in a text editor and insert the following line on a new line somewhere between the top ( looks like ) lines of the file:

define('WP_POST_REVISIONS', false);

Running the following SQL (change wp_ to your prefix) in phpmyadmin will clear out all revisions:

DELETE a,b,c
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)
WHERE a.post_type = 'revision';

Finally, run the following SQL query to optimize (clean up) your posts table:

OPTIMIZE TABLE wp_posts;

Categories Uncategorized
Comments (0)

Slideshow Demo

by Dustin


DisplayBuddy Slideshow available NOW from PluginBuddy.com. Purchase here.

Below is a simple preview using defaults from two of the Slideshow modes:

Here we see some fish. They are very colorful.

Categories Uncategorized
Comments (11)