• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Making WordPress Your CMS and Automatically Updating a Self Hosted WordPress Plugin
 

Making WordPress Your CMS and Automatically Updating a Self Hosted WordPress Plugin

on

  • 1,872 views

A presentation to the South Yorkshire WordPress group in October 2011. Chris Witham shares his experience of making the WordPress dashboard more client friendly through a single bespoke plugin. The ...

A presentation to the South Yorkshire WordPress group in October 2011. Chris Witham shares his experience of making the WordPress dashboard more client friendly through a single bespoke plugin. The talk finishes with a look at how to Automatically Update a WordPress plugin if you don't want to host it in the WordPress.org repository.

Statistics

Views

Total Views
1,872
Views on SlideShare
1,854
Embed Views
18

Actions

Likes
0
Downloads
0
Comments
0

1 Embed 18

http://paper.li 18

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

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
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Making WordPress Your CMS and Automatically Updating a Self Hosted WordPress Plugin Making WordPress Your CMS and Automatically Updating a Self Hosted WordPress Plugin Presentation Transcript

  • MAKING WORDPRESS YOUR CMS Remind clients that you exist Provide support contact details Provide helpful hints Tell your clients what you’re doingAutomatically Update Your Plugin
  • CUSTOM LOGIN SCREEN•Add clients logo•Add link to your site•Move Error messages abovethe logo
  • LOGIN LOGO<?phpfunction my_custom_login_logo() { echo <style type="text/css"> h1 a { background-image:url(.get_bloginfo(siteurl)./wp-content/custom-login-logo.png) !important; } .login .message { margin-top:-150px;margin-bottom:110px;} </style>;}
  • LOGIN YOUR LINK<?phpfunction my_custom_login_credit() { ?> <p style="position:absolute;top:428px;left:50%;margin-left:5px;">served by <a href="http://www.yourdomain.com"title="Your Name" style="text-decoration:none;">YourName</a></p><?php }add_action(login_footer, my_custom_login_credit);?>
  • CUSTOM LOGIN SCREEN•Add clients logo•Add link to your site
  • EDITOR PERMISSIONS•Allow editors to managemenus and widgets
  • EDITOR PERMISSIONS<?php// get the the role object$role_object = get_role( editor );// add capability to this role object$role_object->add_cap( edit_theme_options );?>
  • EDITOR PERMISSIONS•Allow editors to managemenus and widgets
  • ‘PIMP’ THE TITLE BAR•Add your logo•Add your name and link•Add support contact details
  • ‘PIMP’ THE TITLE BAR<?phpadd_action(admin_head, my_custom_logo);function my_custom_logo() { echo <style type="text/css"> #header-logo { background-image: url(http://yourdomain.com/logo.gif) !important; }</style>;}?>
  • ‘PIMP’ THE TITLE BAR<?phpfunction fs_admin_link() { ?> <span style="font:normal 14px Georgia;padding: 8px 8px5px;margin: 0;float: left;">served by <a href="http://www.yourdomain.com">Your Name</a> | email: <ahref="mailto:you@yourdomain.co.uk" title="Email Your NameSupport">you@yourdomain.com</a> | tel: 000 0000 0000</span><?php }add_action(in_admin_header, fs_admin_link);?>
  • ‘PIMP’ THE TITLE BAR•Add your logo•Add your name and link•Add support contact details
  • ‘PIMP’ THE FOOTER•Remove unwanted links•Add your name and link
  • ‘PIMP’ THE FOOTER<?phpadd_filter( admin_footer_text, my_admin_footer_text );function my_admin_footer_text( $default_text ) { return <span id="footer-thankyou">Website managed by<a href="http://yourdomain.com">Your Name</a><span> |Powered by <a href="http://www.wordpress.org">WordPress</a>;}?>
  • ‘PIMP’ THE FOOTER•Remove unwanted links•Add your name and link
  • DECLUTTER THE DASHBOARD•Remove confusing widgets•Add support information•Add your RSS feed
  • DECLUTTER THE DASHBOARD<?php// remove unnecessary dashboard widgetsfunction remove_dashboard_widgets(){ global $wp_meta_boxes; // do not remove "Right Now" for administrators if (!current_user_can(activate_plugins)) { unset($wp_meta_boxes[dashboard][normal][core][dashboard_right_now]); } // remove widgets for everyone unset($wp_meta_boxes[dashboard][normal][core][dashboard_plugins]); unset($wp_meta_boxes[dashboard][normal][core][dashboard_recent_comments]); unset($wp_meta_boxes[dashboard][normal][core][dashboard_incoming_links]); unset($wp_meta_boxes[dashboard][side][core][dashboard_primary]); unset($wp_meta_boxes[dashboard][side][core][dashboard_secondary]);}add_action(wp_dashboard_setup, remove_dashboard_widgets);?>
  • DECLUTTER THE DASHBOARD<?phpadd_action(wp_dashboard_setup, my_custom_dashboard_widgets);function my_custom_dashboard_widgets() {global $wp_meta_boxes;wp_add_dashboard_widget(my_note_widget, Your Name Support, custom_dashboard_me);}function custom_dashboard_me() {echo <p>Welcome to your WordPress Dashboard, from here you can edit all of the content onyour website.</p><p>Need help? For support please email us at <ahref="mailto:you@yourdomain.com">you@yourdomain.com</a>.</p><p>You can find moreinformation on our <a href="http://www.yourdomain.com" title="Your Title">website</a>.</p>;}?>
  • DECLUTTER THE DASHBOARD<?phpadd_action(wp_dashboard_setup, my_dashboard_widgets);function my_dashboard_widgets() { global $wp_meta_boxes; // add a custom dashboard widget wp_add_dashboard_widget( dashboard_custom_feed, My News,dashboard_custom_feed_output ); //add new RSS feed output}function dashboard_custom_feed_output() { echo <div class="rss-widget">; wp_widget_rss_output(array( url => http://www.yourdomain.com/rss, //put your feed URL here title => My News, items => 3, //how many posts to show show_summary => 1, show_author => 0, show_date => 1 )); echo "</div>";}?>
  • DECLUTTER THE DASHBOARD•Remove confusing widgets•Add support information•Add your RSS feed
  • RECAP•Make the login screen look pretty•Allow Editors to manage menus and widgets•Add your details and logo to the title bar•Put your name in the footer and remove confusing links•Make the dashboard less confusing and more useful•Add these codes to functions.php•Or even better, your own plugin•If you create a plugin and add it to all your client sites...•... enable automatic updates before you start!
  • HOW TO - AUTO UPDATES• Visit http://w-shadow.com/blog/2010/09/02/automatic- updates-for-any-plugin/• Update plugin header• Create metadata.json• Zip your plugin• Upload metadata.json and plugin.zip to web server
  • W-SHADOW.COM
  • UPDATE PLUGIN HEADER<?phprequire plugin-updates/plugin-update-checker.php;$MyUpdateChecker = new PluginUpdateChecker( http://yourdomain.com/plugins/yourplugin/metadata.json, __FILE__, yourplugin);?>
  • UPLOAD ‘PLUGIN UPDATES’•Download the file from w-shadow.com•Add the file to your plugin folder•Have a beer•This sets up the WordPress schedule•Checks every 12 hours
  • CREATE METADATA.JSON{ "name" : "My Plugin Name", "slug" : "myslug", "download_url" : "http://domain.com/plugins/pluginname/pluginname.zip", "version" : "0.5", "author" : "Chris Witham", "sections" : { "description" : "Add a description here." }
  • UPLOAD TO SERVER
  • UPLOAD TO SERVER•Upload metadata.json and plugin.zip to your webserver•Manually update the plugin on client site•Ensure client site plugin is looking at your server•Wait... (now is a good time for another beer!)•... an hour later, or 12!
  • UPLOAD TO SERVER•Upload metadata.json and plugin.zip to your webserver•Manually update the plugin on client site•Ensure client site plugin is looking at your server•Wait... (now is a good time for another beer!)•... an hour later, or 12!
  • UPLOAD TO SERVER•Upload metadata.json and plugin.zip to your webserver•Manually update the plugin on client site•Ensure client site plugin is looking at your server•Wait... (now is a good time for another beer!)•... an hour later, or 12!
  • LIVE DEMO...
  • MAKING WORDPRESS YOUR CMS+ Automatically Update Your Plugin By Chris Witham For South Yorkshire WordPress October 2011