Ok, so you’ve started to upgrade your CMS and you’ve found that your hitting issues, well this could be a number of reasons for example it could be a module you installed on your website. Weblog and various other modules have been issues for me in the past. WordPress actually disable and then re-enable all their plugins for you to prevent potential code clashes causing you issue. ImpressCMS and XOOPS however don’t or at least XOOPS didn’t on the last version I used before upgrading it to ImpressCMS which was 2.0.18.
Anyway, so if you’ve already overwritten your files with the new upgrade and your presented with a white screen or you having bodged upgrades then chances are its a module. First of all make sure you have a back up of your installation (which you should have from before the white screen and upgrade issues), reinstate your database to the back up (the bodged upgrade could have altered the tables). Log into your PHPMyAdmin or equivalent and then run this MySQL code.
Update table_modules SET isactive = '0' WHERE isactive = '1'
Make sure that this “table_modules” is changed to your table, so if its “mysite_modules” then put that other wise this won’t work.
Hit the go button and now all your active modules will be deactivated, now try your website and upgrade, hopefully this might have solved the issue for you. If it does, then only activate your modules one by one to find out which one was the trouble causer.
There are a ton of tutorials on this around the net, but most tell you about simply using a WordPress hook to stop the generator showing, but why add more code when you could just edit the original.
Why should I change the generator of my WordPress install?
WordPress, your themes and many plugins like to display the version number of your installation, this is a great way to let a potential hacker or cracker know if your using an insecure and buggy version and even though whilst your installing WordPress it may seem secure, at a later date a vulnerability may be found. Personally because of this I don’t like to display those details, Google maybe your friend along with other search engines, but remember they don’t only help you find sites.
Anyway, I digress again!
Open /wp-includes/general-template.php
Around line 2202 you will find a PHP switch with the following code:
2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 | switch ( $type ) { case 'html': $gen = '<meta name="generator" content="WordPress ' . get_bloginfo( 'version' ) . '">'; break; case 'xhtml': $gen = '<meta name="generator" content="WordPress ' . get_bloginfo( 'version' ) . '" />'; break; case 'atom': $gen = '<generator uri="http://wordpress.org/" version="' . get_bloginfo_rss( 'version' ) . '">WordPress</generator>'; break; case 'rss2': $gen = '<generator>http://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '</generator>'; break; case 'rdf': $gen = '<admin:generatorAgent rdf:resource="http://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '" />'; break; case 'comment': $gen = '<!-- generator="WordPress/' . get_bloginfo( 'version' ) . '" -->'; break; case 'export': $gen = '<!-- generator="WordPress/' . get_bloginfo_rss('version') . '" created="'. date('Y-m-d H:i') . '"-->'; break; } |
Basically a switch tests a case and if it matches it executes the cases code, so if your on a HTML page you will execute the part located in the case ‘html’:
2202 2203 2204 | case 'html': $gen = '<meta name="generator" content="WordPress ' . get_bloginfo( 'version' ) . '">'; break; |
You don’t really need to understand that to be honest, just change the relevant parts, your end result should look like the following:
2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 | switch ( $type ) { case 'html': $gen = '<meta name="generator" content="SJBNetwork">'; break; case 'xhtml': $gen = '<meta name="generator" content="SJBNetwork" />'; break; case 'atom': $gen = '<generator uri="http://sjbowers.net/" version="na">SJBNetwork</generator>'; break; case 'rss2': $gen = '<generator>http://sjbowers.net</generator>'; break; case 'rdf': $gen = '<admin:generatorAgent rdf:resource="http://sjbowers.net" />'; break; case 'comment': $gen = '<!-- generator="SJBNetwork" -->'; break; case 'export': $gen = '<!-- generator="SJBNetwork" created="'. date('Y-m-d H:i') . '"-->'; break; } |
Now if your running a WordPress multisite you won’t have to add a new function to every theme on your install, but keep in mind that some themes do add the generator meta tags themselves.
Remember though that when you update your WordPress installation that will need to make this change again.
If you do the above, you don’t need to do the next part to change the displayed generator in your theme. ![]()
If you are looking for the other option of adding a php function to your theme then open your themes folder, locate functions.php and add:
2202 | remove_action('wp_head', 'wp_generator'); |
Make sure this is encased in php tags.
There are a ton of pages all over the internet all explaining how to do this, some vary a little and some will work depending on your set up.
You will have seen many sites and people in forums say edit your php.ini, but sometimes it doesn’t appear to work, well there are a couple things to remember:
Now thats done and your happy with the sizes you want, you will need to create a php.ini file and pop it into your /public_html/ (If you own the server you could change the sites in your main php.ini file), att the follow to this file:
memory_limit = 100M post_max_size = 100M upload_max_filesize = 100M max_execution_time = 360 max_input_time = 120
I’ve changed the execution because larger files naturally take longer to upload and you don’t want things timing out, if they do then up it a little more. We have audio and video files uploaded. Don’t forget to check those changes have taken affect with PHPInfo.
Create a php file, call it whatever you like, perhaps just phpinfo.php, then add the following, save it and upload it:
phpinfo();
Load the file in your browser to see your php configuration.
The next part with running WordPress 3.0 Multisite is that you want these changes to be site wide and not just directory specific. Open your .htaccess and add the following line:
suPHP_ConfigPath /home/yoursite/public_html
Change the part /yoursite/ to what your physcial site location is. Normally with cpanel it would be your username (not e-mail address, but cPanel username). Check your upload forms now, they should all be showing the right upload size.