WordPress Plugin Development- Rich Media Institute Workshop
Upcoming SlideShare
Loading in...5
×
 

WordPress Plugin Development- Rich Media Institute Workshop

on

  • 4,558 views

“Plug-ins can extend WordPress to do almost anything you can imagine.” In this workshop we will cover the following areas, Extending WordPress, Customizing WordPress Plug-ins, Tips On Writing ...

“Plug-ins can extend WordPress to do almost anything you can imagine.” In this workshop we will cover the following areas, Extending WordPress, Customizing WordPress Plug-ins, Tips On Writing WordPress Plug-ins, Writing WordPress Plug-ins, and Essential WordPress Plug-ins. Plus, that isn’t enough, we will build a simple Flash plug-in by the end of the workshop that you can take with you!"

Statistics

Views

Total Views
4,558
Views on SlideShare
4,542
Embed Views
16

Actions

Likes
1
Downloads
48
Comments
0

2 Embeds 16

http://digibombinc.com 11
http://www.slideshare.net 5

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    WordPress Plugin Development- Rich Media Institute Workshop WordPress Plugin Development- Rich Media Institute Workshop Presentation Transcript

    • WordPress Plug-in Development Rich Media Institute Brendan Sera-Shriar BackSpaceStudios.com
    • Extending WordPress
      • “ Plug-ins can extend WordPress to do almost anything you can imagine.”
      • -WordPress.org
      • Well almost! There is a limit to what a plug-in can do. Quite often in order to achieve the desired functionality there is some customization of code required.
      • WordPress plug-ins help enhance and simplify the blogging experience of advanced users , especially web developers and designers.
    • Customizing WordPress Plug-ins
      • Not all plug-ins work out of the box! A good majority of powerful and essential plug-ins will require some customization. This means CODE!
        • A blogger with basic to expert knowledge of HTML/CSS, and for a lot plugins, PHP and MySQL experience is highly recommended.
        • A blogger who needs to display complex content in posts and pages like displaying and colorizing code snippets, running custom scripts only on certain posts or pages, incorporating custom web forms, etc.
        • A blogger who knows what they’re doing - The default configuration of WordPress is too &quot;fool-proof&quot;. For example, with the visual editor turned on, it will add unexpected indents and line breaks even inside <pre> tags. Additionally, it blocks you from adding <div> tags, automatically &quot;sanitizing&quot; them into <p> tags.
    • Tips On Writing WordPress Plug-ins
      • When all else fails! You don’t have to be a PHP or WordPress expert, anyone can create useful WordPress plug-ins without being a hacker.
        • Check out the Source of Plug-ins
        • One of the most helpful ways to improve your coding is by checking out the other plug-ins source code. Each plug-in author has a completely unique style of coding, and this can vary from super-advanced like the Google Sitemap Generator plug-in to the incredibly-simple like the AskApache Search Engine Verify plug-in.
        • Research with a Purpose
        • Instead of just picking plug-ins at random to reverse-engineer, surf the WordPress plug-in repository for unique plug-ins that perform a specific function or feature. For example; If you wanted to learn about MySQL search and replace code for WordPress, check out the source code of the excellent Search Regex plugin.
        • Use a plug-in Template
        • Any good Web Developer knows the extreme value of using modular, templateable code. CSS, XHTML, javascript, and PHP, all are geared towards templates. WordPress is one of the mack-daddies of templates, so why not use a template for plug-in files?
    • Let’s look at a few examples
    • BackSpaceStudios Extended/Custom Plug-Ins Custom Logins
    • BackSpaceStudios Extended/Custom Plug-Ins Login Redirect
    • BackSpaceStudios Extended/Custom Plug-Ins Random Flash Loader
    • BackSpaceStudios Extended/Custom Plug-Ins Event Calendar
    • BackSpaceStudios Extended/Custom Plug-Ins Custom Admin – Current Post View
    • BackSpaceStudios Extended/Custom Plug-Ins Custom Admin – DashView
    • BackSpaceStudios Extended/Custom Plug-Ins 1 WordPress Install, 2 designs – Custom MU
    • Writing WordPress Plug-ins
      • Conventions
      • For each new plug-in I create a folder in the /wp-content/plugins/ pluginname / and then in that folder I create the main plug-in file with the same name as the folder + .php so the plug-in file is /wp-content/plugins/pluginname/ pluginname.php .
      • I usually start by converting a php function that I have built or found and convert it by adding the necessary WP code.
      • Main Elements
        • Header Stuff (Name, version, etc…)
        • Add Menu Option
        • Set Up the Options Page
        • Register the Activation and Deactivation Hooks
        • The Main Function
        • *Always make sure to include a readme.txt with your plug-in package.
    • Let’s build a plug-in
    • Writing WordPress Plug-ins
      • We will convert a simple php function that randomly loads Flash files from any local or remote URL.
      • Lets take a look > http://backspacestudios.com/RMI/flashloader.php
    • Writing WordPress Plug-ins
      • randomflashloader.php header stuff
      • <?php
      • /*
      • Plugin Name: RandomFlashLoader
      • Plugin URI: http://www.backspacestudois.com/
      • Description: Randomly loads a flash file from your wp-content/plugins/randomflashloader/swf direcotry
      • Version: 1.0
      • Author: GeoffPalin, Brendan Sera-Shriar
      • Author URI: http://www.backspacestudios.com
      • */  
    • Writing WordPress Plug-ins
      • Continued…
      • /*
      • == Installation ==  
      • Put Your Steps Here
      • /*
      • /*
      • Add GPL License Here
      • */
      • Add Option Menu
      • add_action('admin_menu', 'random_flash_loader_options_setup');
    • Writing WordPress Plug-ins
      • Continued…
      • Setup the Options Page
      • function random_flash_loader_options_setup()
      • {
      • global $random_flash_loader_data;
      • add_options_page($random_flash_loader_data['Name'], 'RandomFlashLoader', 8, basename(__FILE__), 'random_flash_loader_page');
      • }
      • Register the Activation and Deactivation Hooks
      • register_deactivation_hook(__FILE__, 'random_flash_loader_deactivate');
      • register_activation_hook(__FILE__, 'random_flash_loader_activate');
    • Writing WordPress Plug-ins
      • Continued…
        • Random Flash Function
        • function randomflashloader(){
        • srand(microtime() *1000000);
        • $num= rand (0,3);
        • $loadswf = array();
        • $loadswf[0] = &quot;http://pv3world.com/labs/PV3interactive/pv3world_cube.swf&quot;;
        • $loadswf[1] = &quot;http://pv3world.com/labs/rays/rays.swf&quot;;
        • $loadswf[2] = &quot;http://pv3world.com/labs/PV3Galaxy/galaxy_cubes_interactive.swf&quot;;
        • $loadswf[3] = &quot;http://pv3world.com/labs/graffitiplane/graffiti_plane2.swf&quot;;
        • $displayswf.= &quot;<center>&quot;;
        • $displayswf.= &quot;<embed src=&quot;$loadswf[$num]&quot; &quot;;
        • $displayswf.= &quot;width =&quot;300&quot; height=&quot;250&quot; bgcolor=&quot;#000000&quot; border=&quot;0&quot;/>&quot;;
        • $displayswf.= &quot;</a>&quot;;
        • echo($displayswf);
        • }  
      • Bridging Two Worlds!
      • FlashPress is an extension to WordPress, which allows Flash designers/developers to use the WordPress engine to communicate with a Flash site. The use of the WordPress CMS in Flash overcomes many obstacles involved with maintaining and updating a Flash site.
      • The FlashPress development thread is restricted to contributors of this group. If you would like to contribute to this project please contact us at [email_address]
      • Launching soon http://www.flashpress.ca and http://www.flashpressdevelopers.com
      • We will be launching FlashPress at FITC Toronto 2009!
      • FREE PHUG Workshops
      • Current Scheduled Workshops:
      • Tiki Wiki
      • FBML and Facebook Fan Pages
      • The Power of Twitter
      • Advertising for the Social Web
      • Customizing WP2.7 Admin
      • We would like to thank some of our sponsors and affiliates:
      • PHUG, Lifecapture Interactive Inc., BackSpaceStudios, Mozilla Firefox, WordPress.org, Drupal.org,
      • FITC ( Flash In The Can ), RMI ( Rich Media Institute ), TikiWiki, Citadel Rock.
      • If you would like to present or no someone who does we are still taking applications. Please send us an
      • email at [email_address]
      • http://workshops.phug.ca
      • WordCamp Toronto 2009
      • Hosted by PHUG
      • WordCamp is a conference type of event that focuses squarely on everything WordPress. Everyone from casual end users all the way up to core developers show up to these events. These events are usually highlighted by speeches or keynotes by various people.
      • http://www.wordcamptoronto.com
    • Other Ways to Stay in Touch PHUG – Open Source Culture http://www.facebook.com/group.php?sid=17f1d77e9310971276dc2fd49210fa18&gid=5470619311 WordCamp Toronto http://www.facebook.com/group.php?gid=50753366566#/group.php?gid=50753366566 PHUG – Open Source Culture http://twitter.com/PHUGCulture WordCamp Toronto http://twitter.com/WordCampTO
    • Resources
        • http://www.backspacestudios.com
        • http://www.phug.ca
        • http://codex.wordpress.org/Working_with_WordPress#WordPress_Features
        • http://codex.wordpress.org/Template_Hierarchy
        • http://codex.wordpress.org/Conditional_Tags
        • http://codex.wordpress.org/Templates
        • http://codex.wordpress.org/Customizing_Your_Sidebar
        • http://www.tamba2.org.uk/wordpress/graphicalcss/
        • http://www.ndesign-studio.com
        • http://www.webdesignerwall.com
        • http://bloggingsquared.com
        • http://automattic.com
        • http://www.blog.spoongraphics.co.uk
        • http://www.webappers.com
        • http://www.wppotential.com
    • Thank You
      • WordPress Theme Design Workshop at RMI
      • Brendan Sera-Shriar, Director BackSpaceStudios
      • http://www.backspacestudios.com
      • [email_address]
      • Founder of PHUG – Open Source Culture
      • http://www.phug.ca