WordPress Installation Guidelines: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 204: Line 204:
* '''littledamien''' - 3.6
* '''littledamien''' - 3.6
* '''[http://www.bfhhandwriting.com/blogwp/wp-admin bfhhandwriting]''' - 3.6
* '''[http://www.bfhhandwriting.com/blogwp/wp-admin bfhhandwriting]''' - 3.6
* '''[http://chickenopolis.com/_cms/wp-admin/ Sara Varon]''' - 3.6
* '''[http://baykids.org/_cms/wp-admin/ BayKids]''' - 3.6
* '''thousand oaks school'''<br />Thousand Oaks cannot be updated in any sort of practical manner. UC Telecom has taken it upon themselves to set the permissions of the files within the WordPress installation. Upgrading through the dashboard probably wouldn't work, and upgrading via FTP would overwrite those permissions.
* '''[http://www.rsrt.org/_cms/wp-admin RSRT]''' - 3.3.1 (?)<br />The passwords I have on file for this site don't currently work.
* '''[http://bridal.threaddesign.com/wpress/wp-admin/ thread bridal]''' - 3.1
* '''[http://bridal.threaddesign.com/wpress/wp-admin/ thread bridal]''' - 3.1
** This one is problematic. Upgrading to WP 3.1 required downloading and installing from the zip file.
** This one is problematic. Upgrading to WP 3.1 required downloading and installing from the zip file.
** Be careful to use the correct FTP account. One FTP account updates www.threaddesign.com and the other connects to bridal.threaddesign.com.
** Be careful to use the correct FTP account. One FTP account updates www.threaddesign.com and the other connects to bridal.threaddesign.com.
* '''[http://social.threaddesign.com/butterfly/wp-admin/ thread social]''' - 3.1.3
* '''[http://social.threaddesign.com/butterfly/wp-admin/ thread social]''' - 3.1.3
* '''thousand oaks school'''<br />Thousand Oaks cannot be updated in any sort of practical manner. UC Telecom has taken it upon themselves to set the permissions of the files within the WordPress installation. Upgrading through the dashboard probably wouldn't work, and upgrading via FTP would overwrite those permissions.
* '''[http://www.rsrt.org/_cms/wp-admin rsrt]''' - 3.3.1
* '''[http://chickenopolis.com/_cms/wp-admin/ Sara Varon]''' - 3.6
* '''[http://baykids.org/_cms/wp-admin/ BayKids]''' - 3.6


[[Category:WordPress]]
[[Category:WordPress]]

Latest revision as of 17:52, 12 August 2013

Overview[edit]

Basic rules for setting up and upgrading WordPress installations.

Updates[edit]

  • Back up database.
  • If the WP installation uses a pre-packaged theme (which should be avoided) then it should be assumed that updates will overwrite the theme files.
    • It will be necessary to FTP the files from /wp-content/themes/[theme_name] after the installation is complete.
    • Also, if it's ever necessary to manually upload the WP install, make sure to back up everything in the media library!
    • WP installations that use the default theme don’t seem to have this issue as much.
  • If the installation gets interrupted then it can get stuck in maintenance mode. In these cases delete the file named .maintenance in the wp-admin directory.

Pre-Installation (DEV server)[edit]

Create a new website on the dev server[edit]

  • Create the directory for the web files.
  • IIS Manager > <SERVER> > Sites (right click) > Add Web Site
    • Site name: descriptive name
    • Physical path: path to the directory created in the previous step
    • Connect As... (enter credentials)
    • Binding
      • Type http (default)
      • IP address All Unassigned (default)
      • Port 80 (default)
      • Host name staging address to give to client, e.g. clientsite.dbarchowsky.com
  • Click OK

TODO: Script this so it can be automated.

Create a MySQL database for the WordPress installation[edit]

MySQL Administrator[edit]

  • MySQL Administrator > Catalogs
    • Right click within the Schemata list > Create New Schema
    • Enter database name
  • MySQL Administrator > User Administration
    • Right click within User Accounts > Add New User
    • Enter user and password to be used by WordPress for its database connection
    • Click Apply changes
    • Select the new user account > Schema Priviledges tab
      • Select the WP database
      • Move all priviledges to the Assigned priviledges column
      • Click Apply changes
  • MySQL Administrator > Service Control
    • Stop Service
    • Start Service

phpMyAdmin[edit]

  • Log in with administrator privileges.
  • localhost > privileges tab > Add a new User (at the bottom of the page)
    • User name: user name
    • Use Generate password to create the password
    • Store user & password values in site config.
    • Database for user: 'Create database with same name and grant all privileges'
    • Global privileges: uncheck all
  • TODO: Script this so it can be automated.

Installation[edit]

Workflow[edit]

Guidelines[edit]

  • When installing for a client make sure to create an admin account and an editor account.
  • Give the client the editor account without admin privileges so they can’t attempt to update WP themselves.

Installing the WordPress distribution[edit]

WordPress configuration settings & procedure[edit]

  • Configure the installation using WordPress's script by navigating to [staging_server]/[root_dir]/wp-admin/
    • Database Name: [CLIENT]_wp (this may have to change to accommodate the client's hosting provider)
    • User Name: [CLIENT]_wp (this may have to change to accommodate the client's hosting provider)
    • Password: Go get a new secure one.
    • Database Host: localhost (default setting)
    • Table Prefix: wp_ (default setting)
    • Record the first 3 settings somewhere, like in the (non-WP) app_config file.
    • Click OK
  • WordPress installs the database objects.
  • Click Run the install when prompted.
  • Enter Site Title, Username, Password, Email, and Allow search engines to index this site when prompted
    • Enter "admin" user credentials, using a very secure password.
    • Enter your own email address.
    • Click OK or whatever.

Client configuration[edit]

  • Log in as "admin".
  • Create a editor account for the client's use.
    • Dashboard > Users > Add New
      • Username and strong but semi-english password
      • Client's email address
      • Role: Editor

Theme[edit]

Installing WordPress in a non-standard location[edit]

How to install WordPress in a non-standard location to make it at least a little bit difficult for people to hack it.

  • Install WordPress somewhere other than the location that you would ultimately like to have the public access it.
    • The WordPress directory and the directory where the public will access the blog should be at the same level down from the website root directory.
    • So the set up might be something like this:
/blog (public address)
/wordpress/wp-admin (WordPress installation location with CMS)

Copy the index.php file from the WordPress installation directory to the public blog location. Index.php basically just makes a call to the WordPress library to pull in all the content to render the page. As long as all the include directives resolve ok, that index.php file will work anywhere on the site, but bad people won’t be able to simply type /blog/wp-admin to try to get at the WordPress editor.

Post-Installation (DEV server)[edit]

  • TK: Version control

TinyMCE/WYSIWYG Editor Configuration[edit]

  • Create a separate stylesheet containing styles that can be applied through the Style dropdown in the TinyMCE editor.
  • Import that stylesheet into the main stylesheet with a @import url('/style/wysiwyg.css'); directive.
  • Edit functions.php within the current WordPress theme’s content directory (/wp_base_dir/wp-content/themes/theme_name/)
if ( ! function_exists( 'myCustomTinyMCE' ) ):
/**
 * Adds a styles dropdown menu to the tinymce visual editor buttons.
 * Adds custom css classes as options to that dropdown editor.
 *
 * @since WPThemeName 1.0
 */
 function myCustomTinyMCE($init) {
/* Adds the buttons at the begining. (theme_advanced_buttons2_add adds them at the end) */
	$init['theme_advanced_buttons2_add_before'] = 'styleselect';
 	$init['theme_advanced_styles'] = 'footnote=footnote,head=head';
	return $init;
}
endif;
add_filter('tiny_mce_before_init', 'myCustomTinyMCE' );

Applying external stylesheets to the TinyMCE editor. Edit wp-content/themes/mytheme/functions.php:

if ( ! function_exists( "rsrt_editor_styles" )) :
    function rsrt_editor_styles( $url ) {
        if (!empty($url)) {
            $url .= ",";
        }
        /*
         * this is how you apply other stylesheets to the TinyMCE editor
         * separate multiple stylesheet URLs with commas
         */
        $url .= "/css/wysiwyg.css";
        return ($url);
     }
endif;
add_filter("mce_css", "rsrt_editor_styles");

Additional TinyMCE Plugins

For example I wanted to use the TinyMCE "style" plugin.

From the TinyMCE download I extracted the plugins directory /tinymce.zip/tinymce/jscripts/plugins to /wpress/wp-content/plugins/tinymce_plugins. (I renamed the orginal plugins folder to tinymce_plugins.)

Then in functions.php:

function myCustomTinyMCEPlugins($plugins) {
    $url = get_bloginfo('wpurl')."/wp-content/plugins/tinymce_plugins/style/editor_plugin.js";
    $plugin_array["style"] = $url;
    return $plugin_array;
}
add_filter("mce_external_plugins", "myCustomTinyMCEPlugins");

And add the styleprops button in the TinyMCE button callback.

see also: Adding a button to WordPress's HTML editor

Quirks involved with installing plugins[edit]

Plugin: Advanced Custom Fields[edit]

  • Error: Go to define a field for the plugin. After clicking "Save Field" nothing happens and the field simply disappears.
  • Fix: Forum post describing the error and the fix.
    • In the WordPress database:
      ALTER TABLE wp_acf_fields ADD COLUMN instructions text DEFAULT NULL;
    • On line 63 of core/fields_save.php change
      'save_as_cf' => $field['save_as_cf'],
    • to
      'save_as_cf' => (int)$field['save_as_cf'],

WordPress blogs[edit]

Note: local IIS installations require authentication via IIS in order to run the upgrade script.

  • damien jay - 3.6
  • littledamien - 3.6
  • bfhhandwriting - 3.6
  • Sara Varon - 3.6
  • BayKids - 3.6
  • thousand oaks school
    Thousand Oaks cannot be updated in any sort of practical manner. UC Telecom has taken it upon themselves to set the permissions of the files within the WordPress installation. Upgrading through the dashboard probably wouldn't work, and upgrading via FTP would overwrite those permissions.
  • RSRT - 3.3.1 (?)
    The passwords I have on file for this site don't currently work.
  • thread bridal - 3.1
    • This one is problematic. Upgrading to WP 3.1 required downloading and installing from the zip file.
    • Be careful to use the correct FTP account. One FTP account updates www.threaddesign.com and the other connects to bridal.threaddesign.com.
  • thread social - 3.1.3