Any post install tips after installing WordPress 3.0.1?

01 Database Security 01.01 change your database prefix during install or after install this is security by obscurity but helps with automated scripts that could run over all databases to inject bad code in your content like scripts, iframes or display: bits 01.02 install a database backup plugin to automate the backup e.g. http://wordpress.org/extend/plugins/wp-db-backup/ Read … Read more

Rename UPLOADS folder with custom WP_CONTENT_DIR

After digging around, I ended up with using upload_dir filter. Here is what I tried in functions.php to change uploads to media. Hope it can help someone too 🙂 add_filter(‘upload_dir’, function($uploads) { $custom = []; foreach ($uploads as $key => $value) { if ( false !== strpos($value, ‘/app/uploads’) ) { $custom[$key] = str_replace(‘/app/uploads’, ‘/app/media’, $value); … Read more

Optimize shortcode callbacks

There is a very important programming principle: DRY – Don’t repeat yourself. Whenever you realize you are repeating almost the same job try to write an abstraction. For your pad* shortcodes this means: function get_padding( $atts ) { $args = shortcode_atts( array( ‘num’ => 10 ), $atts ); return str_repeat( ‘ ‘, (int) $args[‘num’] ); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)