Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Stoph
Mar 19, 2006

Give a hug - save a life.
For anyone doing custom loops or multiple loops per page, I've found using a custom iterator is outstandingly useful. Here is the one I've cobbled together over the last few months, including some other utility functions you don't need:

https://github.com/cmwelsh/zesty/blob/master/includes/zesty.php#L47

Use it like this, the arguments match a call to WP_Query:

code:
$query = Zesty::query(array(
    'post_type' => 'post',
    'posts_per_page' => -1,
    'post_status' => 'publish',
    'order' => 'DESC',
    'orderby' => 'date',
));
?>
<?php
<ul>
    <?php foreach ($query as $post) : ?>
        <li>
            <?= get_the_title() ?>
        </li>
    <?php endforeach; ?>
</ul>
Now that's sort of nice, right? It will automatically clean up after itself and reset everything back to normal once the loop is completed.

Adbot
ADBOT LOVES YOU

89
Feb 24, 2006

#worldchamps
I might need to holler at one of you guys that said you could help. But, for now, the main problem I'm having....all of the computers that used to see my old website hosted at wordpress.com just refuse to see the new website. They clear the caches and it's just like hidden somewhere in there. New users do not see the old site. This is what I did:

Moved my domain hosting from wordpress.com > bluehost.com
Changed my wordpress.com's primary blogs back to mysite.wordpress.com instead of mysite.com
Purchased the domain forwarding for users that go to mysite.wordpress.com to be forwarded to mysite.com (which is ALLLL bluehost now, new site).

So, there should be zero remnants of the old wordpress.com website, it's not even hosted there anymore. I moved it on Tuesday. mysite.wordpress.com still exists, but it forwards to mysite.com now........

Yet, the old users are still seeing the old version even after clearing their caches. WHY WON'T THE OLD SITE JUST DIE

Gyshall
Feb 24, 2009

Had a couple of drinks.
Saw a couple of things.
Sounds like a DNS problem. Can you check the settings on your local DNS server?

TwystNeko
Dec 25, 2004

*ya~~wn*
Is there a way to pull posts from a category onto a different page?

For example, I have a fairly elaborate front page set up, and wordpress is at /blog/. I want to pull 3 posts from a "Featured" category onto my index page.

Alternately, is there a way to have a very custom front page for a WP site?

The site in question is http://twyst.us

it's purely static at the moment, but I would like to make things like the "Recent Creations" dynamic as well.

Edit: I looked at setting up a front-page.php file, which should get me what I want.. except I can't figure out how to get to the blog - the link I was using (/blog/) now just shows the front page, instead of the post listing.

TwystNeko fucked around with this message at 08:24 on Jan 23, 2013

clown shoes
Jul 17, 2004

Nothing but clowns down here.
What would be a fair price to charge someone for setting up a WordPress portfolio site for a musician? I'd also include a tutorial and provide support.

clown shoes fucked around with this message at 14:39 on Jan 23, 2013

Gyshall
Feb 24, 2009

Had a couple of drinks.
Saw a couple of things.

TwystNeko posted:

Is there a way to pull posts from a category onto a different page?

For example, I have a fairly elaborate front page set up, and wordpress is at /blog/. I want to pull 3 posts from a "Featured" category onto my index page.

Alternately, is there a way to have a very custom front page for a WP site?

The site in question is http://twyst.us

it's purely static at the moment, but I would like to make things like the "Recent Creations" dynamic as well.

Edit: I looked at setting up a front-page.php file, which should get me what I want.. except I can't figure out how to get to the blog - the link I was using (/blog/) now just shows the front page, instead of the post listing.

What you want is to create a page - call it "Home" or something. Then go to Settings => Reading and select the "Home" page as your front page.

Then, you can set "Home" to have a custom template, and use that custom template to build "sections" for your home page. That is how I try to do it, at least.

If you have Wordpress set up under a subdirectory, though, you'll probably want to look at turning your site into a Wordpress template and going that way, so Wordpress is installed at the root and can manage your other pages as well.

wordsauce posted:

What would be a fair price to charge someone for setting up a WordPress portfolio site for a musician? I'd also include a tutorial and provide support.

Completely depends on the client and the amount of content they need/want. My recommendation is to look at what guys around your area are charging.

I usually invoice clients for the template (pre-built or otherwise), any premium plugins I need, hosting for a year, any other custom tweaks I will need to make (like stylesheet tweaks, custom templates/pages etc), graphics, support for a year, etc.

TwystNeko
Dec 25, 2004

*ya~~wn*

Gyshall posted:

What you want is to create a page - call it "Home" or something. Then go to Settings => Reading and select the "Home" page as your front page.

Then, you can set "Home" to have a custom template, and use that custom template to build "sections" for your home page. That is how I try to do it, at least.

If you have Wordpress set up under a subdirectory, though, you'll probably want to look at turning your site into a Wordpress template and going that way, so Wordpress is installed at the root and can manage your other pages as well.


Yea, I'm in the process of making it a theme.

But the issue sort of remains: if I make it a custom page, what link would get me to the blog? I mean, I can go /blog/?cat=1, and have it give me the posts in category 1, but that's not really what I'm after. Is there a url like /blog/list or something that gives me the post listing page?

Question Mark Mound
Jun 14, 2006

Tokyo Crystal Mew
Dancing Godzilla

TwystNeko posted:

Yea, I'm in the process of making it a theme.

But the issue sort of remains: if I make it a custom page, what link would get me to the blog? I mean, I can go /blog/?cat=1, and have it give me the posts in category 1, but that's not really what I'm after. Is there a url like /blog/list or something that gives me the post listing page?
I have the same sort of thing, with the Blog as a subpage rather than the front page. Creating a "Blog" page and settings the page template to "Blog" or "Blog Excerpt" did it for me.

Gyshall
Feb 24, 2009

Had a couple of drinks.
Saw a couple of things.
I would make a custom page, then use queries and loops (http://codex.wordpress.org/The_Loop) to display on that page template.

I do this on a few clients, mainly those who want to have a static home page area with a slider, then also have a column of their latest blog posts, and then a section with other posts or content types (think real estate listings or stuff)

porkface
Dec 29, 2000

wordsauce posted:

What would be a fair price to charge someone for setting up a WordPress portfolio site for a musician? I'd also include a tutorial and provide support.

Charge hourly for support, and tell them to expect a budget of 4-10 hours/month for general maintenance and updates, not including customizations and additions.

This will cover most clients and gives you a pretty easy line to hold if they want you doing all kinds of new poo poo after the site launches.

TwystNeko
Dec 25, 2004

*ya~~wn*
Okay, I'm really confused now.

I reinstalled WP, and put the theme I'm working on back in. This was so I could control the root site. So WP is at http://twyst.us , the actual blog listing is http://twyst.us/blog/

So far, so good. Theme looks good.. but why is it that from the front page, clicking "Home" leads to http://twyst.us but once I'm on the blog page (a custom template that loads all the posts, as suggested earlier), home now leads to http://twyst.us/blog ? I'm using the site_url() command. Should I just hardcode it in?

the kawaiiest
Dec 22, 2010

Uguuuu ~

TwystNeko posted:

Okay, I'm really confused now.

I reinstalled WP, and put the theme I'm working on back in. This was so I could control the root site. So WP is at http://twyst.us , the actual blog listing is http://twyst.us/blog/

So far, so good. Theme looks good.. but why is it that from the front page, clicking "Home" leads to http://twyst.us but once I'm on the blog page (a custom template that loads all the posts, as suggested earlier), home now leads to http://twyst.us/blog ? I'm using the site_url() command. Should I just hardcode it in?
I'm clicking "home" from the blog page and it's taking me to http://twyst.us/.

Also do you take requests for balloon twisting because I would really like a moogle.

TwystNeko
Dec 25, 2004

*ya~~wn*
Heh, I actually fixed it - turns out that site_url() needs to be echoed, unlike all the other stuff along those lines. Now I'm struggling with getting pagination working! Fun times. :(

As for balloon requests, I could probably come up with a moogle. Maybe when I get this theme done. ;)

Edit:

Okay, got that done, but now I have a stylistic question regarding posts - If you look at http://twyst.us/blog_tmp/single_post.html, there's a few things that I want to happen regardless of what I'm posting.

The header image, I've got handled. The blockquote thing, I can manage. But the links - I want them all to have this format:
code:
<a href="#" class="roll-link"><span data-title="whatever">whatever</span></a>
Is there a way to do this? Like with a filter or something? Seems to be a pretty simple regex to do it..

TwystNeko fucked around with this message at 07:10 on Jan 24, 2013

Gyshall
Feb 24, 2009

Had a couple of drinks.
Saw a couple of things.
I would make a filter/hook in your functions.php to replace all WYSIWYG content links like that - yes, I think that could be possible. Sounds involved though - any reason you want to have a span inside every link?

TwystNeko
Dec 25, 2004

*ya~~wn*
Well, that's exactly what I did. Also made it add a class to blockquotes. And the span is for a neat effect my links do. It wasn't that hard, mostly just figuring out a regex that won't screw up on repeated application. Now all I have left to do is the comments, I think.

Stoph
Mar 19, 2006

Give a hug - save a life.
You should prefix links to other pages on your website with get_home_url() instead of get_site_url().

site_url() is where WordPress is installed (it might be a subdirectory), home_url() is the root of your website

For even more confusion, refer to is_home() vs is_front_page(). It's mostly due to backwards compatibility that these things are so confusingly named.

Adraeus
Jan 25, 2008

by Y Kant Ozma Post
I have a Related Posts section that I want to order by the number of tags that match the current post's tags.

Essentially, I want to:

  • Get the current post's tags
  • Get the posts whose tags match any of the current post's tags
  • Get the tags for each of those posts
  • Compare the current post's tags with each related post's tags
  • Count the number of matches in each comparison
  • Order the query output by the number of matches in descending order

What's the best way to accomplish that?

PHP code:
<div class="module-generic">
	<h3>Related Articles</h3>
	<div class="module-content">
		<ul>
		<?php
			$tags = wp_get_post_tags($post->ID);
			$tag_ids = array();
			if($tags) {
				$tagcount = count($tags);
				for($i = 0; $i < $tagcount; $i++) {
					$tag_ids[$i] = $tags[$i]->term_id;
				}
				$args = array(
					'category_name' => 'features',
					'tag__in' => $tag_ids,
					'post__not_in' => array($post->ID),
					'posts_per_page' => 5,
					'caller_get_posts' => 1
				);
			}
		?>
		<?php $my_query = new WP_Query($args); if($my_query->have_posts()): while($my_query->have_posts()): $my_query->the_post(); ?>
			<li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
		<?php endwhile; endif; wp_reset_query(); ?>
		</ul>
	</div>
</div>
e: I tried the array route, but once I have the number of matches, I don't know how to sort the query by the number of matches.

PHP code:
<?php
	$tags = wp_get_post_tags($post->ID);
	if($tags) {
		// Get the current post's tags
		$tag_count = count($tags);
		$tag_ids = array();
		$cur_tags = array();
		for($i = 0; $i < $tag_count; $i++) {
			$tag_ids[$i] = $tags[$i]->term_id;
			array_push($cur_tags, $tags[$i]->name);
		}

		// Get the posts whose tags match any of the current post's tags
		$args = array(
			'category_name' => 'features',
			'tag__in' => $tag_ids,
			'post__not_in' => array($post->ID),
			'posts_per_page' => 5,
			'caller_get_posts' => 1
		);
		$rel_posts = get_posts($args);
		
		// Get the IDs for each of those posts
		$rel_ids = array();
		foreach($rel_posts as $rel_post) {
			array_push($rel_ids, $rel_post->ID);
		}
		
		// Get the tags for each of those posts
		$rel_tag_count = count($rel_ids);
		$rel_posts_tags = array();
		for($i = 0; $i < $rel_tag_count; $i++) {
			$rel_tags = wp_get_post_tags($rel_ids[$i], array('fields' => 'names'));
			array_push($rel_posts_tags, $rel_tags);
		}
		
		// Compare the current post's tags with each related post's tags
		// Count the number of matches in each comparison	
		$rel_match_count = array();
		for($i = 0; $i < $rel_tag_count; $i++) {
			$rel_matches = count(array_intersect($cur_tags, $rel_posts_tags[$i]));
			array_push($rel_match_count, $rel_matches);
		}
		ksort($rel_match_count);

		// Order the query output by the number of matches in descending order
	}
?>

Adraeus fucked around with this message at 10:13 on Jan 25, 2013

kedo
Nov 27, 2007

Question for your WordPress gurus:

How idiotic would it be to somehow hack WP into working as a public login / posting system? I'm super comfortable developing in it so this is appealing to me, but I also realize this isn't really what it's made for.

Super basic functionality description:
• Ability for users to create accounts
• Ability for those users to make posts

I've only ever used WP for projects that were just glorified blogs or basic sites that needed a simple CMS. However now I'm working on a new project that's a little more community driven, and I've never really explored that. The reason why I'm even considering WP is because I know how I'd organize and act on content (eg. categories, tags, etc).

Any good plugins to look at? Anything I should be aware of going into this? Or is this just a dumb idea? Seems to me that the biggest problem might be number of users / posts. I worry that this wouldn't be sustainable if you had several hundred / thousand users.

TwystNeko
Dec 25, 2004

*ya~~wn*
So what's the best way to improve my search results on google and the like? Meta keywords? Or is just going to be based on content?

porkface
Dec 29, 2000

TwystNeko posted:

So what's the best way to improve my search results on google and the like? Meta keywords? Or is just going to be based on content?

SEO is a huge industry and is way more complex than my answer, but roughly in order of priority:
    * Page titles
    * Content
    * Good markup that prioritizes the right terms/headlngs
    * META Description is a ways down the list (most don't pay attention to keywords anymore)

The best resource for DIY and learning is SEOmoz - http://www.seomoz.org/

Adraeus
Jan 25, 2008

by Y Kant Ozma Post

kedo posted:

Any good plugins to look at? Anything I should be aware of going into this? Or is this just a dumb idea? Seems to me that the biggest problem might be number of users / posts. I worry that this wouldn't be sustainable if you had several hundred / thousand users.

Take a look at BuddyPress and the premium plugins. What you're looking for is there. I saw it last night.

Stoph
Mar 19, 2006

Give a hug - save a life.

porkface posted:

SEO is a huge industry and is way more complex than my answer, but roughly in

Also, don't forget the importance of in-URL keywords. By that I mean https://www.yourcompany.com/keyword-keyword-keyword/

kedo
Nov 27, 2007

Adraeus posted:

Take a look at BuddyPress and the premium plugins. What you're looking for is there. I saw it last night.

Looks promising – thanks!

Adraeus
Jan 25, 2008

by Y Kant Ozma Post
Does anyone else have an issue with WP forcing PHP's nl2br() to use non-XHTML compliant break tags?

TwystNeko
Dec 25, 2004

*ya~~wn*
Okay, I'm about to start choking someone over this crap.

I'm trying to pull data from a custom table in the WP database, "bad_referrals". The code I'm using is this:
code:
<?php 
function get_referrals($phone) { 
	global $wpdb;
	$remove = array('(',')','-');
	$phone = str_replace($remove, '', $phone);
	$query = "SELECT name,referrals from bad_referrals where phone='$phone'";
	echo $query;
	$wpdb->show_errors();
	$client = $wpdb->get_row($query);
	$wpdb->hide_errors();
	print_r($client);
	return array('name' => $client->name, 'referrals' => $client->referrals);
// returns an array of name and referrals
}

$c = get_referrals($_GET['phone']);
?>
The database is there. Running the query directly on the database works. There are no errors being thrown.

But no data. At all. I've gone through every possible permutation of $wpdb->get_var, ->get_result, get_row, using ->prepare, NOTHING WORKS. :suicide: Any ideas?

And of course someone in the #wordpress channel suggests "PODS framework", which is a gigantic amount of overkill for one table with 4 fields. Then when I say "that's not what I'm after", he says "You just don't understand it!". Seriously, what the hell.

TwystNeko fucked around with this message at 23:28 on Jan 27, 2013

Stoph
Mar 19, 2006

Give a hug - save a life.

TwystNeko posted:

I'm trying to pull data from a custom table in the WP database, "bad_referrals". The code I'm using is this:

Allow me to be a little blunt. This code is the biggest pile of utter loving poo poo. It has a huge SQL injection hole because you are blindly trusting the GET variable contents in your MySQL query.

Moving on, the way to go would be like this:

code:
$query_string = "
    SELECT name, referrals
    FROM bad_referrals
    WHERE phone = '%s'";

$result = $wpdb->get_row($wpdb->prepare($query_string, $phone));
See how I use the %s placeholder to allow $wpdb->prepare to escape the value going into that position.

This doesn't actually help with your question (your original code looked like it should work) but now you won't be a douchebag who gets your clients' sites hacked.

Try printing the value of $phone before you pass it into the query - maybe the error is in your input.

Stoph fucked around with this message at 00:09 on Jan 28, 2013

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

I'm completely new to Wordpress. I'm working on someone else's site and all I have access to is the Dashboard (no server access). What I'm needing to do is have the user fill out a form with their name, email address, and which document they want (three checkboxes), and upon submitting the form an email is automatically sent to the user with their chosen document attached to it. Is this even possible to do?

TwystNeko
Dec 25, 2004

*ya~~wn*

Stoph posted:

Allow me to be a little blunt. This code is the biggest pile of utter loving poo poo. It has a huge SQL injection hole because you are blindly trusting the GET variable contents in your MySQL query.

Moving on, the way to go would be like this:

code:
$query_string = "
    SELECT name, referrals
    FROM bad_referrals
    WHERE phone = '%s'";

$result = $wpdb->get_row($wpdb->prepare($query_string, $phone));
See how I use the %s placeholder to allow $wpdb->prepare to escape the value going into that position.

This doesn't actually help with your question (your original code looked like it should work) but now you won't be a douchebag who gets your clients' sites hacked.

Try printing the value of $phone before you pass it into the query - maybe the error is in your input.

Oh, I'm well aware of the SQL injections. Just mostly trying to get SOMETHING to work so throwing something horribly dirty together.

And I did use the whole $wpdb->prepare routine as well, and none of that worked at all. And everything shows as correct with the inputs and queries. Still nothing, which is what's really irritating.

Edit: And now I figured out WHY nothing was working. Hint: make sure you don't have old wp installed databasees with similar names. :downs:

TwystNeko fucked around with this message at 03:16 on Jan 28, 2013

Flaggy
Jul 6, 2007

Grandpa Cthulu needs his napping chair



Grimey Drawer
Is there a way to embed video without using youtube. I want to upload a video and not have it associated to youtube. (Bosses request for that) is there a way to do it? What format should the video be in?

kedo
Nov 27, 2007

caiman posted:

I'm completely new to Wordpress. I'm working on someone else's site and all I have access to is the Dashboard (no server access). What I'm needing to do is have the user fill out a form with their name, email address, and which document they want (three checkboxes), and upon submitting the form an email is automatically sent to the user with their chosen document attached to it. Is this even possible to do?

Without knowledge of and/or access to code you are pretty much limited to installing / using plugins. This one will should do what you want: http://wordpress.org/extend/plugins/contact-form-7/

If the FTP login info isn't saved in the dashboard, you'll need that to install a new plugin. And depending on how the server is setup it may or may not work out of the box. Sometimes you have to tweak various server settings for email forms to function properly. Just do lots of testing.

Flaggy posted:

Is there a way to embed video without using youtube. I want to upload a video and not have it associated to youtube. (Bosses request for that) is there a way to do it? What format should the video be in?

Either upload it on another site that's not YouTube (Vimeo is a good option) or there's always VideoPress (which costs money, but isn't associated with any video site – from your boss's perspective the video will just live on your site).

You could also just upload it as a .mp4 or whatever format it's in and hope that people have the right codecs to play it, but that's not a great option.

e: You can also use Flash CS3 or greater to wrap the video in a Flash player, which you could then just upload to your server and insert into a post via HTML. However this obviously would not work on all devices since it's Flash.

kedo fucked around with this message at 17:44 on Jan 28, 2013

thegasman2000
Feb 12, 2005
Update my TFLC log? BOLLOCKS!
/
:backtowork:
I have started using the "Responsive" theme as a base for a few projects and find its pretty good. I was just wondering if anyone has managed to get a left sidebar and right sidebar on the same page? seems like there should be a option for it somewhere!

Adraeus
Jan 25, 2008

by Y Kant Ozma Post

kedo posted:

Either upload it on another site that's not YouTube (Vimeo is a good option) or there's always VideoPress (which costs money, but isn't associated with any video site – from your boss's perspective the video will just live on your site).

I think Vimeo is the best option in this case because I think your video doesn't have to be public to embed the video in a page. If you host the video yourself, you'll need enough space on the server and you'll need to pay for bandwidth, whose costs increase as you upload more videos. That said, the White House uses YouTube.

wwb
Aug 17, 2004

Real issue with hosting video yourself these days is dealing with all the permutations like transcoding for a half-dozen different mobile device codecs. Using a provider makes tons of sense, and there are very cost effective ones out there.

For content: ah, the joys of wordpress. They forgot IIS7 can handle permalinks and such so we get to hack the core to keep our sites going.

All Hat
Jul 11, 2008

He that is without int among you, let him first cast a long

What might be the reason for an upload of a specific <300kb pdf causing an http error in the default uploader and a 403 on new-media.php?

Smaller and larger files upload without problems (pdf, jpg, doc), I've tried renaming the file, and saving it with a new name from Acrobat Reader X.

edit: It's made in PDFCreator v 0.9.8 / GPL Ghostscript 8.64. Could this have something to do with it?

All Hat fucked around with this message at 13:13 on Jan 29, 2013

Toast
Dec 7, 2002

GoonsWithSpoons.com :chef:Generalissimo:chef:
What is everyone using for comments these days? The last oh... 15 sites I've done were never going to see a post comment but it's important to a new client. Is Disqus still pretty much the best bet?

Twiin
Nov 11, 2003

King of Suck!

Toast posted:

What is everyone using for comments these days? The last oh... 15 sites I've done were never going to see a post comment but it's important to a new client. Is Disqus still pretty much the best bet?

I use Jetpack.

DNQ
Sep 7, 2004

Let me hear you balalaika's ringing out, come and keep your comrade warm!
I'm at my wits end with Wordpress and getting constantly hacked - to the extent I'm starting to wonder I don't have the knowledge or skills to run this anymore.

I received some excellent advice a couple of pages ago for my blog (http://www.themasterplanblog.com/) and followed this advice. I've installed Wordfence and run scans, I've changed my admin passwords, deleted all plugins and superfluous themes (other than official current Wordpress theme), and yet I'm still constantly getting hacked/having problems.

Latest issue is all my formatting and fonts have disappeared. No matter which theme I use there are no fonts or formatting.

Wordfence and Sucuri are both giving me nothing - no idea what's gone wrong and/or how to fix it.. ideas welcome.

DNQ fucked around with this message at 14:22 on Feb 1, 2013

kedo
Nov 27, 2007

DNQ posted:

I'm at my wits end with Wordpress and getting constantly hacked - to the extent I'm starting to wonder I don't have the knowledge or skills to run this anymore.

I received some excellent advice a couple of pages ago for my blog (http://www.themasterplanblog.com/) and followed this advice. I've installed Wordfence and run scans, I've changed my admin passwords, deleted all plugins and superfluous themes (other than official current Wordpress theme), and yet I'm still constantly getting hacked/having problems.

Latest issue is all my formatting and fonts have disappeared. No matter which theme I use there are no fonts or formatting.

Wordfence and Sucuri are both giving me nothing - no idea what's gone wrong and/or how to fix it.. ideas welcome.

I might look at your .htaccess to start – I tried to view your stylesheet and it redirected me to another URL.

Fixing a hacked WP site can be a huge pain in the rear end. I seriously doubt that installing plugins will fix the issue. The only way I've ever been able to completely fix a hacked WP site in the past has been to find the offending code (often in base64 – so look for that) in whatever files / parts of the database it resides in, deleting it, updating WP to the most recent version and as a last resort, exporting posts and starting over from scratch with a completely fresh install. I hope you have clean backups somewhere.

What you need to do is going to depend a lot on how exactly your site was hacked, so without seeing the files it's hard to give you a solid recommendation besides this: plugins won't fix your site.

fakedit: You should also consider changing all your usernames and and passwords both in WordPress and on FTP / hosting control panel, if you haven't already.

realedit: And if you're not up to trying to manually sanitize all the code, you might want to consider going with wordpress.com

Gyshall
Feb 24, 2009

Had a couple of drinks.
Saw a couple of things.
What kind of hacks? One of the biggest downfalls to a Wordpress install is having your database accessible to the outside.

Where is it hosted? Did you change SQL passwords too?

Adbot
ADBOT LOVES YOU

Adraeus
Jan 25, 2008

by Y Kant Ozma Post
You can also try changing your file/folder permissions. Here's a bash script I found that I've been using to set up new installs on my dev server.

code:
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from [url]http://codex.wordpress.org/Hardening_WordPress#File_permissions[/url]
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=apache # <-- wordpress owner
WP_GROUP=apache # <-- wordpress group
WP_ROOT=/var/www/html # <-- wordpress root directory
WS_GROUP=apache # <-- webserver group

# reset to safe defaults
find ${WP_ROOT} -exec chown ${WP_OWNER}:${WP_GROUP} {} \;
find ${WP_ROOT} -type d -exec chmod 755 {} \;
find ${WP_ROOT} -type f -exec chmod 644 {} \;

# allow wordpress to manage wp-config.php (but prevent world access)
chgrp ${WS_GROUP} ${WP_ROOT}/wp-config.php
chmod 660 ${WP_ROOT}/wp-config.php

# allow wordpress to manage .htaccess
touch ${WP_ROOT}/.htaccess
chgrp ${WS_GROUP} ${WP_ROOT}/.htaccess
chmod 664 ${WP_ROOT}/.htaccess

# allow wordpress to manage wp-content
find ${WP_ROOT}/wp-content -exec chgrp ${WS_GROUP} {} \;
find ${WP_ROOT}/wp-content -type d -exec chmod 775 {} \;
find ${WP_ROOT}/wp-content -type f -exec chmod 664 {} \;
Take a look at the link in the comments:
http://codex.wordpress.org/Hardening_WordPress

Disable error output, too, on your production server.

There are also good books on Linux, Apache, and PHP/MySQL security, but I forgot which ones I'd recommend.

Adraeus fucked around with this message at 15:43 on Feb 1, 2013

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply