WordCamp Columbus Slides: Licensing and Business Models for Premium Plugins

Here are the slides from my talk: Licensing and Business Models for Premium Plugins (ppt).

And FYI, slides from my similar talk at WordCamp Philly (pretty similar, but more stuff on GPL in the beginning)

What You Need to Know About the GPL, Download: pptpptx

 

WordCamp Columbus Slides: Licensing and Business Models for Premium Plugins was last updated on June 18, 2011. Bookmark the permalink.

I’m Speaking at WordCamp Columbus, June 18th at 11:30am

I’m excited to say that I’ve been accepted as a speaker at WordCamp Columbus this coming Saturday. I was a last minute addition… so thanks to the WCC folks for working that out. (Shout out to Angie Meeker: @angiemeeker / blog)

My talk is on “Licensing and Business Models for Premium Plugins”, which is a fancy way of saying “How I plan to make money with Paid Memberships Pro“. Sadly, the event is all sold out, but if you are going or able to squeeze in somehow, I look forward to seeing you there.

More info on the schedule: http://wordcampcolumbus.com/schedule/

Thanks WordCamp Columbus Sponsors: http://wordcampcolumbus.com/sponsors/

I’m Speaking at WordCamp Columbus, June 18th at 11:30am was last updated on June 14, 2011. Bookmark the permalink.

Fix for WP Page Tree Plugin in WP 3+

The WP Page Tree plugin is a nice plugin. It shows a tree view of pages in your WP site… but it’s been broken since about version 3 or so.

I’m sure there are other tree view plugins that work well, but I liked that one. And it is actually an easy fix to get it working in WordPress versions 3+.

The issue was that the links generated in the tree view pointed to the old admin URLs for editing pages (page.php?action=edit&post=#). The new more generalized URLs for editing pages is (post.php?post=#&action=edit).

So, what you want to do is find line 404 in wppagetree.php (of version 2.8 of the plugin) and change page.php to post.php. That’s it. The whole block of code around there should look like:

if ($public) {
	// Create our own link to edit page for this ID
	$out .= "" . $pageTitle . "";
}
else {
	$out .= "" . $pageTitle . " #";
}

Or download this zip here which has version 2.8 of the plugin plus that one fix. I may upload it to the WP directory sometime, but then I’d have to maintain. Feel free to do it for me. 😉

Download: page-tree-fixed.zip

Fix for WP Page Tree Plugin in WP 3+ was last updated on June 2, 2011. Bookmark the permalink.

Disable the WordPress Admin Bar for Non-Admins Only

Here is a variation of some code I found on Yoast.com to disable the WP admin bar for non-admins only.

function yoast_hide_admin_bar_settings() 
{
?>
	

Just copy and paste this code into your functions.php or another plugin/theme file that can add hooks. Save/upload and watch it work.

Let me know if you have any trouble using this.

Disable the WordPress Admin Bar for Non-Admins Only was last updated on June 2, 2011. Bookmark the permalink.

WordCamp Philly 2010 Presentation Slides

Here are slides from my talk. I was told a video of the presentation will be up at WordPress.tv sometime soon. I’ll post a link when it is. And I’ll try to get these in SlideShare or something similar. I was having trouble with their site earlier.

Business Models for WordPress Plugin and Theme Distribution
What You Need to Know About the GPL

Download: ppt, pptx

WordCamp Philly 2010 Presentation Slides was last updated on November 2, 2010. Bookmark the permalink.

Duplicate comment detected; it looks as though you’ve already said that!

Not sure how long WordPress has been doing this, but there is a check for duplicate comments. If the same user/email posts the same exact comment on the same post, the user will get a message like:

Duplicate comment detected; it looks as though you’ve already said that!

This is great actually, and keeps people from submitting the same comment twice if they get impatient waiting for moderation or otherwise click that submit button twice.

As a blog owner and WordPress developer, there may be situations where you want to allow people to post the same comment. If you want to enable duplicate comments on your blog for some reason, you can use this code here. Just add it to your theme’s functions.php or put this in a .php in your plugins folder and enable it.

function enable_duplicate_comments_preprocess_comment($comment_data)
{
	//add some random content to comment to keep dupe checker from finding it
	$random = md5(time());	
	$comment_data['comment_content'] .= "disabledupes{" . $random . "}disabledupes";	
	
	return $comment_data;
}
add_filter('preprocess_comment', 'enable_duplicate_comments_preprocess_comment');

function enable_duplicate_comments_comment_post($comment_id)
{
	global $wpdb;
	
	//remove the random content
	$comment_content = $wpdb->get_var("SELECT comment_content FROM $wpdb->comments WHERE comment_ID = '$comment_id' LIMIT 1");	
	$comment_content = preg_replace("/disabledupes{.*}disabledupes/", "", $comment_content);
	$wpdb->query("UPDATE $wpdb->comments SET comment_content = '" . $wpdb->escape($comment_content) . "' WHERE comment_ID = '$comment_id' LIMIT 1");
		
	/*
		add your own dupe checker here if you want
	*/
}
add_action('comment_post', 'enable_duplicate_comments_comment_post');

For reference, here is the dupe check code in wp-includes/comment.php. A newer version should probably have a hook above and/or below to allow people to override the dupe checker more directly.

// Simple duplicate check
	// expected_slashed ($comment_post_ID, $comment_author, $comment_author_email, $comment_content)
	$dupe = "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND comment_approved != 'trash' AND ( comment_author = '$comment_author' ";
	if ( $comment_author_email )
		$dupe .= "OR comment_author_email = '$comment_author_email' ";
	$dupe .= ") AND comment_content = '$comment_content' LIMIT 1";
	if ( $wpdb->get_var($dupe) ) {
		do_action( 'comment_duplicate_trigger', $commentdata );
		if ( defined('DOING_AJAX') )
			die( __('Duplicate comment detected; it looks as though you’ve already said that!') );

		wp_die( __('Duplicate comment detected; it looks as though you’ve already said that!') );
	}
Duplicate comment detected; it looks as though you’ve already said that! was last updated on October 22, 2010. Bookmark the permalink.

Jason Speaking at WordCamp Philly October 30th at Temple University

I will be speaking on Business Models for Plugin/Theme Distribution. What You Need to Know About the GPL at WordCamp Philly October 30th, 2010 at Temple University in Philadelphia.

With lots of sweat and little luck, we’ll have our membership plugin available for some sort of release by then. But really I’m excited to share my thoughts on how to distribute, market, and make money off this plugin… and more interested in others ideas about the same.

If you want to hear me speak or are otherwise interested, get your ticket now.

Jason Speaking at WordCamp Philly October 30th at Temple University was last updated on September 23, 2010. Bookmark the permalink.

Tips and Tricks for Stranger Studios-coded Themes

If you’re a Stranger Studios client using one of our custom WordPress themes, these special formatting options may be available to you. If these tricks aren’t working as intended on your theme, contact us and we will troubleshoot!

Controlling Page Menus

  • Main Navigation Menu: The pages that appear in your site’s main menu have a custom field with the name “mainmenu” and the value “true”.
  • Footer Navigation Menu: The pages that appear in your site’s footer menu have a custom field with the name “footermenu” and the value “true”.
  • Mini-Navigation Menu: Some sites we have coded have a third menu, generally floated in the upper right header space. The pages that appear in your site’s mini menu have a custom field with the name “minimenu” and the value “true”.
  • The order in which the pages appear within the menu is controlled by the page’s “Order” attribute (found in the right hand column of the Edit Page screen within the admin).

Changing the Page title on the page vs. within a menu

Add a custom field with the name “longtitle” and the value of the longer page title. The custom field value will show up within the H2 tag on the page, but the shorter WordPress title will be used within navigation menus.

Hiding pages from the site map / sidebar menus

Add a custom field with the name “hide” and the value “true” to exclude it from your site map and other menus/navigation.

Controlling the content of the 404/Page Not Found

Rather than use the WordPress default content for a 404 page error, your theme has special functionality allowing you to control the text shown on this page. The page can be edited as any other WordPress page within the /wp-admin/ panel under Pages -> Edit Page. If you have a site with a lot of pages, do a page search for “404” to help locate this page.

Horizontal/Divider Line

I generally use a lot of thin grey lines to break up content and divide page or post content into meaningful chunks. This is the code for that thin line:

Here’s the HTML code above rendered as it would appear on your site:

Clearing DIVs

If you are preparing a page with a lot of floating images, you may find the content is rendering funky below the image. In order to clear out that floating image and make the new text render within the full page width, you want to insert a clearing div using this code:

Show excerpts from subpages on a Parent Page

We have written a special shortcode allowing you to display excerpts from the children of a parent page. The order in which these subpage excerpts display is controlled by the subpage’s “Order” attribute (found in the right hand column of the Edit Page screen within the admin). The shortcode will show the subpage title (linked), the excerpt (all content before the subpage’s “more” quicktag), and a link to “Continue Reading More About (subpagetitle) ».

The shortcode that will display subpage excerpts is:

[subpagelist]

To exclude any child pages from showing up in the list, write down a comma-separate list of subpage ids to exclude and use this shortcode:

[subpagelist exclude="1,2,3"]

Same Page As shortcode

Some clients have asked that one page have the same exact content as another page, just navigated to and titled in a different way. This could be useful if you are running landing page campaigns for the same content with a different styling or special meta data. Thus, we have written a special shortcode making one WordPress page dynamically pull in content from another page.

The shortcode that will display the same content as another page is:

[samepageas id="x"]

Where x is the id of the page you wish to pull in the content from.

SS-Downloads

If your site is equipped with the SS-Downloads plugin, click here for a tutorial on how to use that functionality. The basic jist is that you add a shortcode with the file name and optional title for download link like this:

[download file="http://path_to_file" title="optional title"]

The SS-Downloads plugin allows you to hide a downloadable file behind a required email capture on your site pages or blog posts. This would be useful for a White Paper download or other private content that you are using to generate a mailing list, track downloads, or simply block from mass-distribution.

Tips and Tricks for Stranger Studios-coded Themes was last updated on August 2, 2010. Bookmark the permalink.

SS-Downloads WordPress Plugin

Testing our new SS-Downloads plugin. It basically will require an email address before serving a specified file. Right now, I’m using a zip of the pre-release plugin for testing. I will update this to point to the latest version once it’s ready.

Should see a form or download link here.

[download file=”https://www.strangerstudios.com/wp-content/plugins/ss-downloads.zip”]

Future plans:

  • Option to require account creation (instead of just an email address). Done
  • Option to email file as attachment instead of showing a link. Done
  • Icons for files in template.

FAQ

Q: My downloads are incomplete, corrupt, or otherwise not downloading… especially large files.
A: This may be caused by a low memory issue or some other issue with serving the file through the getfile.php script. You can configure the plugin to simply redirect to the chosen file rather than serving it through the script by editing /ss-downloads/includes/setup.php and setting the GETFILE_REDIRECT value to true. The file will have to be served in a public web folder, and 733t hackers will be able to see the actual URL of the file.
Note: I’ve changed the GETFILE_REDIRECT to default to true. But if you have the inverse problem (the download is working, but you want to make it more secure by avoiding the redirect — which savvy users might be able to watch to get the URL of the file) you can set that value to false.
Edit:
Bob at 2bretired.com has a good writeup of how to clear out the download stats for your files if you want to do that sort of thing.
SS-Downloads WordPress Plugin was last updated on July 21, 2010. Bookmark the permalink.

Make One Category Display Full Posts in Thesis Theme

Update: Seems like this doesn’t work with the latest version of thesis. If you get it working, let me know.

Got a request from a client to have a specific category page on their WordPress blog running the Thesis theme show full posts (vs. excerpts) for just one category. So I’m going to figure it out and write the steps here for the benefit of humanity.

First, to be clear, I’m not talking about changing ALL CATEGORY PAGES from excerpts to full posts. That can be done easily through the Thesis Display Options. You would change the “Posts” display options to “display full content” and the “Archives” display options to “same as home page”.

What I want to do is show excerpts on every category page except one. You do this by settings up a custom category theme, and Thesis has its own way to do that. A custom category theme wasn’t optimal for this install, so I need to do something different. It’s good to have different ways of doing things. Maybe my method below works for you too.

Here’s what we’re going to do.

  1. Use the “thesis_hook_before_post_box” hook to check the current category and if it is the “Quick Takes” category, change the $thesis[‘display’][‘archives’][‘style’] value to “content”.
  2. Use the “thesis_hook_after_post_box” hook to change the $thesis[‘display’][‘archives’][‘style’] value back to what it was before we tweaked it.

Sounds complicated, but it’s only a few lines to add to the /custom/custom_functions.php file in your Thesis theme folder.

function quicktakes_fullpost_setup()
{
	$target_category = "Quick Takes";

	//saving the global archives display setting so we can revert later
	global $thesis, $saved_thesis_display_archives_style;
	$saved_thesis_display_archives_style = $thesis['display']['archives']['style'];

	//checking the category, if it's the target category, then set the display to full post
	$current_category = single_cat_title("", false);
	if($current_category == $target_category)
		$thesis['display']['archives']['style'] = "content";

}
function quicktakes_fullpost_cleanup()
{
	//we're setting the display archives style back to what it was before we tweaked it
	global $thesis, $saved_thesis_display_archives_style;
	$thesis['display']['archives']['style'] = $saved_thesis_display_archives_style;
}
add_action('thesis_hook_before_post_box', 'quicktakes_fullpost_setup');
add_action('thesis_hook_after_post_box', 'quicktakes_fullpost_cleanup');

Be sure to change the $target_category variable to the title of the category you want to change.

If you want to do the inverse of this, which would be to show the excerpt on just one category page and update show the full post on all others, you would:

  1. Change the Thesis Display Options for posts to “display full post content”
  2. Change the Thesis Display Options for archives to “same as your homepage”
  3. Then adjust line 12 in the code above to set the style to “excerpts” instead of “content.

I hope this helps. Let me know if you have any questions about this or similar customizations for Thesis.

Make One Category Display Full Posts in Thesis Theme was last updated on July 19, 2010. Bookmark the permalink.