How to enable Themes and Plugins edit from WordPress Administrator panel

Posted August 18th, 2010 in plugins, wordpress by Dainius

Source

1. Search for the term “unset( $submenu['themes.php'][10]” in mu.php, you will find only one search result. At that place, you ned to make changes. We have provided below the before and after changes code. We need to comment two lines which are actually there to remove plugin editor and theme editor.

Before Changes

unset( $submenu['plugins.php'][15] ); // always remove the plugin editor
unset( $submenu['themes.php'][10] );  // always remove the themes editor

After Changes

/* unset( $submenu['plugins.php'][15] ); */ // always remove the plugin
/* unset( $submenu['themes.php'][10] ); */ // always remove the themes

2. After removing this check, you should be able to see the theme editor and plugin editor option but still those pages will not accessible. To remove that barrier, you need to make below changes in mu.php only.

Search for the term “if ( strpos( $_SERVER['PHP_SELF'], ‘user-new.php’” in mu.php and then see below the before and after code for the same line (search result)

Before Changes

$pages = array( 'theme-editor.php', 'plugin-editor.php' );
foreach( $pages as $page ) {
    if ( strpos( $_SERVER['PHP_SELF'], $page ) ) {
        wp_die( __('Page disabled by the administrator') );

After Changes

$pages = array( 'theme-editor.php', 'plugin-editor.php' );
  foreach( $pages as $page ) {
     if ( strpos( $_SERVER['PHP_SELF'], $page )&& !is_site_admin() ) {
         wp_die( __('Page disabled by the administrator') );

Now you can check in your WordPress MU dashboard; the theme editor and plugin editor should work properly in your MU installation.

Another solution Less filters plugin. By using plugin you gain "upgrade proof" changes, i.e. they still here after WordPress upgrade.

Warning: Always make backup copies before any code edit. Always.

WPMU domain mapping

Posted August 18th, 2010 in Featured, plugins, setup, wordpress by Dainius

If You planning to have some blogs under one WordPress installation (which is pretty easy and handy after WordPress 3.0 released) first of all consider to install as subdomain option. Remember - You can't change this in the future, so if you will make any mistake, You stuck or should install everything from scratch what is pretty time consuming.

When setup is in the past, You can create as much blogs as You would like. For example blog1.domain.com, blog2.domain.com, blog3.domain.com and so on. Such naming isn't acceptable in some situations. Sometimes I would like to reach particular blogs using "SEO friendly" and nice address like mycooldomain.com.

First of all You should connect to Your domain control panel like Plesk or Cpanel and go to Your domain settings. In domain settings assign an Alias mycooldomain.com for blog1.domain.com with default DNS records inherited from blog1.domain.com. If You would like to send e-mail or setup Google Apps e-mail account via mycooldomain.com You also should add MX records. For MX record You should consult Your hosting company and/or Google Apps help. When added and applied DNS records please be patient. It takes some time to fire them up. Up to couple of hours if You are lucky or even up to 24 hours sometimes.

Then login to Your blog administration panel as "Site admin" and install WordPress MU Domain Mapping plugin. When installation is complete go to SiteAdmin->Domain mapping section and enter IP address where Your WordPress is installed and tick "Permanent redirect". If unshure about IP simply ping your domain.com from terminal. Also You should see it when You are connected to Your hosting provider control panel. When done go to blog1.mydomain.com "back-end", then open Tools->Domain mapping enter mycooldomain.com under "Add new Domain" and press "Add".

Please be patient again. When You can reach mycooldomain.com from Your browser go to Tools->Domain Mapping again, mark mycooldomain.com and push "Set primary domain". If You done everything correctly, now you should reach Your project and Administration panel via mycooldomain.com.

DISCLAIMER: Always read manuals twice before changing anything in Your domain or blog configuration. This manual provided "as is" and always be sure You understand what you are doing. Only You are responsible for any misunderstanding and damage to Your site. If unsure what are You doing - hire or, at least, consult professional.

Bulk image resize under linux

Posted August 18th, 2010 in linux by Dainius

mogrify -resize 640 *.jpg

Command in example resize all jpg files in width down to 640px, if picture is smaller, takes original. Execute it in your terminal window.

If you don't have imagemagick, go and get it:

sudo apt-get install imagemagick

Page 13 of 13« First...910111213