Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all 8245 articles
Browse latest View live

Dave McHale on "New plugin disableMU looking for feedback"

$
0
0

http://wordpress.org/plugins/disablemu/

Hey all, I just had my first submitted plugin approved, and figured I would post here for feedback if anyone cares to take a look.

It's pretty straightforward: it simply writes a few lines to your wp-config.php on activation & removes them on deactivation, the purpose being to "hide" the /mu-plugins directory from WordPress to ensure no arbitrary code can be run from there.

Please be gentle ;) Thanks!


TheCellarRoom on "combining RSS feeds to post items through WordPress"

$
0
0

Hello,

I have written some php code to produce RSS feeds when new data is added to my database. I have a website (customised) with WordPress that is used to display this data which also works as a blog with its own RSS feed (rss2, atom) etc.

I would like to merge my other custom rss feeds into the WordPress RSS so new data is pushed through a combined RSS feed, ideally without hacking the core WordPress code.

I cannot see any hooks in the feed-xxx.php files in WordPress to do this, so was wondering if anyone knew a way this could be done?

Essentially i want to add content to the RSS feed (as separate items) without them appearing as posts on the actual blog - bonus content if you like, to subscribers.

The codex and search of wordpress.org doesn't return very much when searching for RSS and almost all of google returns RSS feed subscription button widgets or taking other site's feeds and publishing them as posts.

bradical911 on "Alphabetical ordering with Query Posts and 2 Meta Keys"

$
0
0

I have a query for custom posts and I have managed to order the results alphabetically based on the title first then ordered by the meta key "Species". This works great.

<?php $posts = query_posts($query_string . '&meta_key=Species&orderby=title+meta_value&order=ASC'); ?>

The problem is that is would like to also order by a 2nd meta key called "Variety" so in my mind the query might look something like this but it doesn't work.

<?php $posts = query_posts($query_string . '&meta_key1=Species&&meta_key=Variety&orderby=title+meta_value1+meta_value2&order=ASC'); ?>

Please help my client is giving me shit!

JanDieckmann on "List all posts inside a category"

$
0
0

I am a little bit confused because I thought this would be a simple task but I fail while implementing. I found similar requests and howtos, but either there are to old and don't fit into the latest codes or I don't understand them. And I also don't succeed to change the code by myself based on my little knowledge and using trial and error.

It is just the wish to get a list of all posts inside a specified category that shows only the titles which should be linked. In other words: if I add a category to the menu, I will see the whole posts, one after the other, if I chose this link in the navigation. So it should be done with a little modification of the category.php, in my case the one from twenty twelve, right?:

<?php
/**
 * The template for displaying Category pages
 *
 * Used to display archive-type pages for posts in a category.
 *
 * @link http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Twenty_Twelve
 * @since Twenty Twelve 1.0
 */

get_header(); ?>

	<section id="primary" class="site-content">
		<div id="content" role="main">

		<?php if ( have_posts() ) : ?>
			<header class="archive-header">
				<h1 class="archive-title"><?php printf( __( 'Category Archives: %s', 'twentytwelve' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1>

			<?php if ( category_description() ) : // Show an optional category description ?>
				<div class="archive-meta"><?php echo category_description(); ?></div>
			<?php endif; ?>
			</header><!-- .archive-header -->

			<?php
			/* Start the Loop */
			while ( have_posts() ) : the_post();

				/* Include the post format-specific template for the content. If you want to
				 * this in a child theme then include a file called called content-___.php
				 * (where ___ is the post format) and that will be used instead.
				 */
				get_template_part( 'content', get_post_format() );

			endwhile;

			twentytwelve_content_nav( 'nav-below' );
			?>

		<?php else : ?>
			<?php get_template_part( 'content', 'none' ); ?>
		<?php endif; ?>

		</div><!-- #content -->
	</section><!-- #primary -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>

Another idea is to get such a list as a sub menu, when I hover the cursor over the category link in the nav menu. Is this possible to?

I researched now and found out that there are also plugins to create list-like pages but I am not sure what might be a better solution to reach my goal. That is why I finally decided to ask for suggestions and help here.

Bye
Jan

Dave Navarro, Jr. on "AJAX best practices"

$
0
0

I am coding a plugin that allows logged-in authors to edit data in a widget area on the front-end using AJAX.

I basically have it working, however the example my code is based on (from the Lynda.com tutorials) does not use a NONCE when submitting data from the form to WP using AJAX.

Is a NONCE not necessary when using AJAX? Or is it best practice to always use a NONCE when submitting data?

Yorgos on "woocommerce upsell products display as tabel-list"

$
0
0

As the topic title says what I want is to customize the display of upsell products from grid display to table-list display

Thank you in advance for your time and help !

Yorgo

endinox on "My site hacked by all-open-24.com"

Vokrik on "Generate Loop with Custom Post type query problem"

$
0
0

Hi, I am having a problem with generating loop for my custom post type.

I am adding a post type "coffee_break" to a custom made theme by external developer.

For adding the Custom Post Type I used a plugin called "WCK - Custom Fields and Custom Post Types Creator"... All is hunky dory until I try to create a loop in the UI using a loop builder in the pagebuilder. The problem is that the proper query should look like this (it's generated when using old post type 'testimonial')
SELECT wp_posts.* FROM wp_posts JOIN wp_icl_translations t ON wp_posts.ID = t.element_id AND t.element_type IN ('post_testimonial','post_attachment')...

With the coffee_break I get this

SELECT wp_posts.* FROM wp_posts JOIN wp_icl_translations t ON wp_posts.ID = t.element_id AND t.element_type IN ('post_attachment') ...

The difference is that in the first case, t.element_type contains ('post_testimonial','post_attachment'), the coffee_break only ('post_attachment') and therefore it finds nothing.

Do you know how can this happen? Is there a problem with initialization of a custom post type?


nikhilbhuktar on "can't login to wp-admin even after resetting password"

$
0
0

Hello,
I have this website on the wordpress platform. It was working fine till 2 hours ago, when i tried to login now, I'm unable to access it. I reset the password from phpMyadmin, but with newly set password also i can't login into my account. Another problem the website is showing posts which were written about a month ago. Is this normal problem with wordpress or somebody has hacked my website. If it is hacked then please provide me some solution.
Thank you

elelel on "Having to prove I'm human when I log in? Have I been hacked?"

$
0
0

Hello
I'm a wordpress newbie but I've taken time to try to protect my site from hacks and I'm constantly reading and trying to take it all in. Anyway to my point. I know you can get plugins which make you prove you're human to log in etc. but I don't have one of these installed and yet just now I had to do a little maths sum to log in to my wordpress site.

I've looked through my plugins and can't find anything of that type which has been installed. I use Bruteprotect which seems to be down and so I can't see on my dashboard if there has been a lot of people attempting to hack or log in.

Is this something which wordpress just enforces itself or is it likely I have an intruder? How do I find out? I go on vacation tomorrow and the last thing I need is having to spend hours upon hours trying to figure out coding things which I do understand.

Panic!

sadovnikov on "Generating slugs for pending and draft posts"

$
0
0

Hello!
By default WP doesn't generate wp_name for pending and draft posts. I tried to fix this using wp_insert_post_data filter to add an unique post_name value and post_type_link filter to generate permalinks for custom type posts with pending and draft status, and it doesn't seem to break something.
Is it a good practice or shouldn't I have done this?

manishchakma on "Strange php code at the beginning of every php files"

$
0
0

There are some strange php codes are automatically added at the beginning of all php files(WP root files, plugins, theme files etc). You can see this screenshot for that strange code - http://awesomescreenshot.com/0753n4sxd4

Any ideas, how can i fix that?

danielep1985 on "Site hacked by verifiedcasinos.com"

$
0
0

Maybe someone here has been hacked by VerifiedCasinos.com and knows what i should be looking for or what files to look in for the script i need to remove.

I have read the http://codex.wordpress.org/FAQ_My_site_was_hacked article and basically gone down the list.

I am now at find and remove the hack but i'm not too sure what i need to be looking for. I have already scanned the site (my hosting provider did as well) and no male-ware is detected. Blue Host was unable to help me and ended up telling me that they were going to suspend my account if I don't get the problem fixed - then immediately closed out of the chat with no further explanation.

The website is http://www.akashaeducation.com.

If anyone think they could help me out i would really appreciate it.

Thanks

jc718 on "Hyperlink icon (How to change the image)"

$
0
0

Hello,

Everyone knows about that icon, a vector illustration of a chain that usually sits to the right of a hyperlink (when it is linked on a WordPress widget, or within a post?) I need to know if that icon could be changed into some other image like a bullet per say?

I would at least like to find out if anyone knows if that icon can be removed, or ignored from a command within the style-sheet or somewhere else in the editor?

Thanks.

jc718 on "Hyperlink icon (How to change the image)"

$
0
0

Hello,

Everyone knows about that icon, a vector illustration of a chain that usually sits to the right of a hyperlink, when it appears on WordPress; I need to know if that icon could be changed into some other image like a bullet per say?

I would at least like to find out if anyone knows if that icon can be removed, or ignored from a command within the style-sheet or somewhere else in the editor?

Thanks.


Ryan Hellyer on "Taxonomy bug"

$
0
0

I'm not sure if this is a bug in core or if I'm doing something wrong.

I have some code which generates a post-type called "Books" and I'm adding support for the post_tag taxonomy via register_taxonomy_for_object_type().

<?php

function test() {
	$args = array(
		'public' => true,
		'label'  => 'Books',
	);
	register_post_type( 'book', $args );

	register_taxonomy_for_object_type( 'post_tag', 'book' );
}
add_action( 'init', 'test' );

There are three posts in the book post-type:
http://uploads.ryanhellyer.net/random/2014/10/books-tags.png

Viewing the tags in the book post-type shows up all of the tags, including those from the posts post-type (note that the "Asten" tag indicates it has one post):
http://uploads.ryanhellyer.net/random/2014/10/books-tag.png

If I click on the Asten post tag, it displays no posts at all.
http://uploads.ryanhellyer.net/random/2014/10/books-tag-good.png

If I go to the posts post-type, the Asten post tag does show a post as expected:
http://uploads.ryanhellyer.net/random/2014/10/posts-tag.png

Question: Why does the "Asten" post tag display "1" when I'm on the book post-type? There is no post for the book post-type with a tag of "Asten" and so this should surely say "0" right? Clicking something which indicates there is one post, but it displaying zero does not make sense to me.

Mike on "Website Hacked"

The Barefoot Bookworm on "WP pingbacks exploited for DDoS attacks?"

$
0
0

A blogger recently got attacked by a hacker who used pingbacks to try and overload his servers. Here's the entire post about it: http://trilema.com/2014/o-hai-let-me-wanna-be/

Of particular note in this post is the message displayed only to WP users whose blogs were used in the attack:

You are seeing this because your blog was recently used as part of a DDOS attack against Trilema.

The way this works is that the attacker sends pingbacks to a long list of blogs. The blogs in question then load the indicated url to try and verify if the pingback is legitimate (ie, if the url of the pinged blog actually appears on page), resulting in massive traffic spikes for the victim.

This works because WordPress pingbacks are poorly implemented. A more solid implementation would verify if the pingback originates from the same IP as the site that supposedly sent it, and discard the request if there's a mismatch. The current implementation allows pingbacks to be sent by any arbitrary IP, and so allow a malicious user yet another DDOS vector.

Please do your part by fixing your pingbacks implementation. The easiest way would be to open the file xmlrpc.php found in the root directory of your blog installtion, and modify the part that says

// Let's check the remote site

		$linea = wp_remote_fopen( $pagelinkedfrom );

To instead say

// Let's check the remote site

    // First, make sure we're not being used for DDoS!

    if (gethostbyname(parse_url($pagelinkedfrom, PHP_URL_HOST))
      <> $_SERVER['REMOTE_ADDR'])
      die ("Sorry, you will have to send this from your blog's IP.");

    		$linea = wp_remote_fopen( $pagelinkedfrom );

This checks that the IP of the domain you think you've been pinged by and the IP of the client informing you were pinged match, and dies if they don't - rendering this particular DDoS avenue inoperable while maintaining all the pingback functionality you could possibily want.

Thanks for being part of the solution!

Wordpress community, sound off? Does this vulnerability really exist, and if so, is it possible to fix it in the core? What do you think of the proposed solution? Could there be a possible downside to it?

I'm not a programmer and I had never heard about such a vulnerability before, but since my blog was one of the blogs implicated (the list is almost 300 MB, have asked the blogger to check it for me) I'm obviously quite concerned and I wonder if other people have heard of or experienced such attacks before.

Will Haynes on "Plugins storing postmeta: How much is too much?"

$
0
0

I'm working to develop a plugin that will be adding attaching quite a bit of information to each post. This could end up being anywhere from 15-25 items about each post.

I'm debating whether it's a better idea to add this data directly to the post meta table, or whether I should be creating a new table for the purposes of my plugin.

If I were doing this for a small site, I wouldn't waste much time on this debate. However, this is a plugin intended mainly for larger sites with upwards of 100,000 posts each.

At the very least, I'm hoping someone could explain the theoretical complications with creating millions of rows. Would it really bother sql too much? Would the indexes in place realistically nullify the problem?

Thanks,

wjh.

maltris on "Only show posts depending on the date given in a custom field"

$
0
0

I have a custom field with a german style date written in it:

15.10.2014

I want to exclude the post with this custom fields value since its 16.10.2014. Before, the post should be normally shown.

Now there is a special requirement. The post should be still accessible. But it should be removed from the search results and categorys etc.

My brain is kind of laggy now, so please give me a kickstart on this. Maybe someone already did something like this?

Viewing all 8245 articles
Browse latest View live




Latest Images