WordPress Installation Guidelines: Difference between revisions
No edit summary |
|||
| Line 13: | Line 13: | ||
== Installation == | == Installation == | ||
* 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. | |||
=== 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 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. | |||
== TinyMCE/WYSIWYG Editor Configuration == | == TinyMCE/WYSIWYG Editor Configuration == | ||
Revision as of 18:29, 11 December 2012
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
/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.
- It will be necessary to FTP the files from
- If the installation gets interrupted then it can get stuck in maintenance mode. In these cases delete the file named
.maintenancein thewp-admindirectory.
Installation
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 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:
/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.
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
@import url('/style/wysiwyg.css');directive. - Edit
functions.phpwithin 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
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:
ALTER TABLE wp_acf_fields ADD COLUMN instructions text DEFAULT NULL;
- On line 63 of
core/fields_save.phpchange'save_as_cf' => $field['save_as_cf'],
- to
'save_as_cf' => (int)$field['save_as_cf'],
- In the WordPress database:
WordPress blogs
Note: local IIS installations require authentication via IIS in order to run the upgrade script.
- damien jay - 3.3.1
- littledamien - 3.5
- bfhhandwriting - 3.3.1
- 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
- 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