Editing
WordPress Installation Guidelines
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Overview == Basic rules for setting up and upgrading WordPress installations. == Updates == * 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 <code>/wp-content/themes/[theme_name]</code> 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 <code>.maintenance</code> in the <code>wp-admin</code> directory. == Pre-Installation (DEV server) == === Create a new website on the dev server === * 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 === ==== MySQL Administrator ==== * 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 ==== * 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 == === Workflow === === Guidelines === * 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 === * Download latest version of WordPress. * Unzip into the site directory. * (Optional, but recommended) Rename the root directory. See [[#Installing_WordPress_in_a_non-standard_location|Installing WordPress in a non-standard location]] === WordPress configuration settings & procedure === * 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 === * 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 === * See: [[Creating Custom WordPress Themes]] === Installing WordPress in a non-standard location === 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: <pre> /blog (public address) /wordpress/wp-admin (WordPress installation location with CMS) </pre> Copy the <code>index.php</code> file from the WordPress installation directory to the public blog location. <code>Index.php</code> 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 <code>/blog/wp-admin</code> to try to get at the WordPress editor. == Post-Installation (DEV server) == * TK: Version control == TinyMCE/WYSIWYG Editor Configuration == * 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 <code>@import url('/style/wysiwyg.css');</code> directive. * Edit <code>functions.php</code> within the current WordPress theme’s content directory (<code>/wp_base_dir/wp-content/themes/theme_name/</code>) <syntaxhighlight lang="php"> 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' ); </syntaxhighlight> Applying external stylesheets to the TinyMCE editor. Edit <code>wp-content/themes/mytheme/functions.php</code>: <syntaxhighlight lang="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"); </syntaxhighlight> Additional TinyMCE Plugins For example I wanted to use the TinyMCE "style" plugin. From the TinyMCE download I extracted the plugins directory <code>/tinymce.zip/tinymce/jscripts/plugins</code> to <code>/wpress/wp-content/plugins/tinymce_plugins</code>. (I renamed the orginal '''plugins''' folder to '''tinymce_plugins'''.) Then in <code>functions.php</code>: <syntaxhighlight lang="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"); </syntaxhighlight> And add the <code>styleprops</code> button in the TinyMCE button callback. see also: [http://littledamien.com/docs/?p=731 Adding a button to WordPress's HTML editor] == Quirks involved with installing plugins == === Plugin: Advanced Custom Fields === * 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:<br /><syntaxhighlight lang="sql"> ALTER TABLE wp_acf_fields ADD COLUMN instructions text DEFAULT NULL; </syntaxhighlight> ** On line 63 of <code>core/fields_save.php</code> change<br /><syntaxhighlight lang="php"> 'save_as_cf' => $field['save_as_cf'], </syntaxhighlight> ** to<br /><syntaxhighlight lang="php"> 'save_as_cf' => (int)$field['save_as_cf'], </syntaxhighlight> == WordPress blogs == Note: local IIS installations require authentication via IIS in order to run the upgrade script. * '''damien jay''' - 3.6 * '''littledamien''' - 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 ** 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. * '''[http://social.threaddesign.com/butterfly/wp-admin/ thread social]''' - 3.1.3 [[Category:WordPress]]
Summary:
Please note that all contributions to Littledamien Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Littledamien Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information