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

knowdict on "Someone continuously refreshing page on my blog"

$
0
0

Hello guys,

I use counterize plugin for my blog.

Normally i get 20-30 visitors each day. However, there is a guy that continously refreshing my page since yesterday. He hit my page about 12000 times.

Why he can be doing this?

Is this harmful for me?

How can I block him?


kellyrowe on "Can't get into backend because of new plugin"

$
0
0

last week I installed a plugin for tracking hoping it would connect to our google analytics it didn't it basically seemed to do nothing but now I am trying to access the backend of my site and can't I am in a panic I am getting this message

Warning: Cannot modify header information - headers already sent by (output started at /home/content/22/8653322/html/wp-content/plugins/tracking-code/tracking-code.php:98) in /home/content/22/8653322/html/wp-includes/pluggable.php on line 896

how can I get in to delete this plug in all help appreciated

scossar on "unit testing examples"

$
0
0

I'm trying to learn about unit testing plugins.
Are there any plugins that have clearly-written/well-documented test suites that would be good for me to look at and learn from.

difimon on "Include and use PHP class into a wordpress page"

$
0
0

Dear all,

I have a class in PHP named sample.class.php which I want to include in a wordpress page to exploit its functions. I am using the template twentytwelve and I have installed the plugin exec PHP to write php code into wp pages. I tried to do this until now with bad results:

- I've created a folder called "includes" into this path wordpress/wp-content/twentytwelve and then:

- I've tried to do this in a wordpress page (but doesn't work)

<?php require_once('includes/sample.class.php');

and its error is the following:

Parse error: syntax error, unexpected ‘<’ in /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 11

...and also this:

include(get_bloginfo('twentytwelve').'/wp-content/twentytwelve/sample.class.php');

Anything works here. Can you explain me what I have to do in order to solve this mistake?

Thank you in advance.
Marco

mario_mh on "Make a Post "Scheduled" via XML-RPC"

$
0
0

Hi,

I am using WP in Version 3.9 and I am trying to make a post "scheduled" via the XML-RPC API. However, there is no field allowing to set a date. For my understanding, to make a post "scheduled" I need to set the post as "future" on the "post_status" field. But where can I set the date? There is no date field in the parameters:

http://codex.wordpress.org/XML-RPC_WordPress_API/Posts#wp.newPost

Thanks,

Mario

bob.passaro on "Adding fields to front-end registration form: sanitize?"

$
0
0

Working on a site that allows users to register from the front end as "subscribers."

I'm adding a couple fields to the Registration Form so they can fill in first and last names in their profile without having to go to the backend. The code below is more or less from the Codex.

My question: WP is using update_user_meta, which in turn calls update_metadata, so this is sanitized and safe to save to the database this way, correct? Just want to verify that I don't need to do additional security in plugin code I'm using:

// Add a new form element...
add_action('register_form','hz_register_form');

function hz_register_form (){
	$first_name = ( isset( $_POST['first_name'] ) ) ? $_POST['first_name']: '';
	?>
	<p>
		<label for="first_name"><?php _e( 'First Name' ) ?><br />
		<input type="text" name="first_name" id="first_name" class="input" value="<?php echo esc_attr(stripslashes($first_name)); ?>" size="25" /></label>
	</p>
	<?php

	$last_name = ( isset( $_POST['last_name'] ) ) ? $_POST['last_name']: '';
	?>
	<p>
		<label for="last_name"><?php _e( 'Last Name' ) ?><br />
		<input type="text" name="last_name" id="last_name" class="input" value="<?php echo esc_attr(stripslashes($last_name)); ?>" size="25" /></label>
	</p>
	<?php
}

// Add validation. In this case, we make sure first_name is required.
add_filter('registration_errors', 'hz_registration_errors', 10, 3);

function hz_registration_errors ($errors, $sanitized_user_login, $user_email) {

	if ( empty( $_POST['first_name'] ) || empty( $_POST['last_name'] ) )
		$errors->add( 'name_error', __( '<strong>ERROR</strong>: Please include your first and last names.' ) );

	return $errors;
}

// Save extra registration user meta.

add_action('user_register', 'hz_user_register');

function hz_user_register ($user_id) {
	if ( isset( $_POST['first_name'] ) )
		update_user_meta($user_id, 'first_name', $_POST['first_name']);

	if ( isset( $_POST['last_name'] ) )
		update_user_meta($user_id, 'last_name', $_POST['last_name']);
}

Detallado on "Edit my-sites.php title and text"

$
0
0

How to edit the title in multisite wordpress in my-sites.php.

I want to change the title "Wordpress < > Error" and I want to change the text "You have no permission for this blog, here are your blogs bla bla bla"

QuizToon on "Dropdown type plugin"

$
0
0

HI all,

I was looking at some websites to get some ideas for social media on the website and came across this

http://pettersolberg.com/

I like the way the links at the top expand when yoou click on them with the social info inside when it expands.

Does anyone know of a plugin that does this or how this effect was achieved?

Many Thanks


lordalerion on "LDD Directory Lite"

$
0
0

My intitall question is here
http://wordpress.org/support/topic/submit-listings-without-requiring-the-user-to-login?replies=2

While using this plugin, it allows a visitor to submit info and generate a profile. instead of allowing them to create an account, I want them to just submit the information under the admin account. So they don't need to deal with editing their profile and logging in.

This is the only hint I have

"Right now you would have to remove the is_user_logged_in() checks at various points of the submission process, and you would have to supply a $user_id in ldl_submit_generate_listing(). This would mean all listings would be owned by the same user and you would lose the ability to allow people to manage/update a listing on their own."

The problem is, I don't know where to add the $user_id in ldl_submit_generate_listing() - I don't know how that supposed to be written.

Thanks!

if (!is_user_logged_in()) {
ldl_get_template_part('login');
return;
}

if ($lddlite_submit_processor->is_processing() && !$lddlite_submit_processor->has_errors()) {
do_action('lddlite_submit_pre_process', $lddlite_submit_processor);

if (ldl_submit_generate_listing()) {
ldl_get_template_part('submit', 'success');
do_action('lddlite_submit_post_process', $lddlite_submit_processor);

return;
}

}

totoro3 on "How to make a file look like it does not exist (404 redirect)"

$
0
0

I am trying to figure out how to make a file appear like a file not found. If for example someone goes to site.com/post-that-does-not-exist/ they will be sent to the 404 page (at the same URL) with a 404 header.

I want this to happen if someone goes to files in my plugin eg site.com/wp-includes/plugins/my-plugin/my-plugin.php

I saw on this page that code like this will hide your file content if it is accessed directly:

defined('ABSPATH') or die("No script kiddies please!");

So how can I change this to display the 404 page?

Thanks in advance for any advice.

petedc on "Listing Custom Posts in Custom Taxonomy"

$
0
0

Hi

I have a CT of Staff Department and CP of Staff.

I want to display all the posts listed by e.g:

Parent Category
- Child Category
- Post Name
- Post Name
- Post Name
- Child Category
- Post Name
- Post Name
Parent Category
- Child Category
- Post Name
- Post Name
- Post Name
- Child Category
- Post Name
- Post Name

I have the following code which works fine but only displays the posts under the category it is listed in.

function dc_show_staff(){
    $terms = get_terms( 'staff_department' );

    foreach ( $terms as $term ) {
        $term_name = $term->name;

        $args = array(
                'orderby'   => 'title',
                'order'     => 'ASC',
                'post_per_page' => -1,
                'hide_empty' => 0,
                'tax_query'   => array(
                                array(
                                  'taxonomy' => 'staff_department' ,
                                  'field' => 'slug',
                                  'terms' => $term->slug,
                                  'include_children' => 0
                                )),
                );       

        $term_posts = new WP_Query( $args );

        while( $term_posts->have_posts() ) {
            $term_posts->the_post();

            if ( $term_name ) {
                $output .= '<h3>'.$term_name.'</h3><div class="row">';
                $term_name = '';
            }

            $output .= '<div class="col-sm-2 staff-item">';
            $output .= '<a href="' . get_permalink() . '">' .get_the_post_thumbnail($post->ID , 'thumbnail', 'class=img img-circle img-responsive'). '</a>';
            $output .= '<a href="'.get_permalink().'">'.get_the_title().'</a>';
            $output .= get_post_meta($post->ID, 'job_title', true);
            $output .= '</div>';
        }

        if ( !$term_name ) {
          $output .= '</div>';
        }
    }
    wp_reset_postdata();
    wp_reset_query();

    return $output;
}

How would I modify this to display the Parent Category as a header for each child category? Thanks!

Brownator on "Inserting posts kills code below?"

$
0
0

I have the following code. It seems like the code runs fine till it actually inserts the post into the database. Then the code after that doesn't work, almost as if once the post is inserted the code breaks off.

<?php

echo "starting test";

$my_post = array(
  'post_title'    => 'My post',
  'post_content'  => 'This is my post.',
  'post_status'   => 'publish',
  'post_author'   => 1,
  'post_category' => array(17)
);

echo "<br/>inserting post";

// Insert the post into the database
$thepost = wp_insert_post( $my_post, $wp_error );

echo "<br/>post inserted";

?>

the line "post inserted" never shows up, as iff the wp_insert_post almost kills the file once it executes?

Davit8924 on "I forbid you to make any changes to my site!"

$
0
0

Hello dear administration Wordpress. Dear administration, please tell me, why are you changing the size of the letters on my site? Who were you allowed? who gave you this right to change the font size on websites? I am writing to you in the first and last time. I'm STRICTLY FORBIDDEN to make any changes to my site, my site is registered as the media, and I have all the necessary documents in order to apply for you in court for ILLEGAL changes on my site. Last time when you DELIBERATELY change the size of the letters on my site my site fell and within 2 days I could not recover my mysql site. I STRICTLY FORBID YOU TO MAKE ANY CHANGES TO MY SITE, CONSIDER THIS A FORMAL REQUEST. In cases of recurrence of unlawful intrusion on my site and changing the font size, I will write a complaint against you to the FBI, the Guardian and the British Embassy in Armenia. I have enough dokazatelstvo that would apply for you in court.

Note:

The Text above was written messages, if necessary, will be included in a complaint against you.

Yours Sincerely David Yeghiazaryan

kmn14650 on "My website was hacked"

$
0
0

When you search our website Upper Canada Organic Products in google there are sub links that take you to an on-line Pharmacy called Worldhealthcare24.com
I have downloaded and ran the Anti-Malware and it detected three potential threats. Now I need to confirm and delete them. Help how do I do that?
Thanks Kristine

fromstephen on "get_terms orderby random not working"

$
0
0

Hi

Im trying to get list a custom taxonomy category list with a random order. So that every time you refresh the page, a new order appears.

So far i can list the custom taxonomy but I can't get the random orderly to work.

Any help would be appreciated.


<?php

foreach (get_terms('your_taxonomy' ,
array(
"orderby" => "rand",
"number" => 5,
'hide_empty' => 1,
'exclude' => array($cat->term_id),

)) as $cat) :

?>

<li class='post'>
slug, 'your_taxonomy'); ?>"><div class='thumb-post'>

<img src="<?php echo z_taxonomy_image_url($cat->term_id, 'poster'); ?>" />

</div>
<h2> <?php echo $cat->name; ?></h2>
<p class='meta'>
Directed By <?php echo single_cat_title('' , false); ?>
</p>

<?php endforeach; ?>


Milknut on "Someone is trying to hack my site."

$
0
0

Someone is trying to hack my site! I'm getting hundreds of login attempts a minute and emails telling me that someone keeps getting locked out. It's clearly some kind of automated password-guessing program. It doesn't look like they know my username, so I'm not really worried that it will succeed. But the hundreds of emails are annoying. Is there anything I can do?

KarinUlli on "Redirecting login to another website"

$
0
0

Hi!
I'm making a site for a client. He has already a site with an user system, where the users log in to a "back end" on a different web-page. So say the site's adress is http://www.companyname.com, and there you can find a login-form wich sends you to http://www.theservicethecompanyoffers.com :) I want this users to be able to log in from the new website I'm creating, but I'm a little lost, I think.
After some research I think I need to first import the users to the wp database, and then redirect the login url to http://www.theservicethecompanyoffers.com. Is this right? In that case, how do I redirect the users there?
And by the way, I'm using a child theme.

danMWD on "update user action hook"

$
0
0

Hi

Perhaps I am looking in the wrong place of the Codex but I am trying to find the "action hook" for updating a user. Instead of the action hook "user_register" I was trying to find the equivalent for when a user updates their profile/email. As with user_register I would like to access the data immediately after the user updates their details.

Is there such an action? - could someone point me in the right direction please.

Thanks.

hopetommola on "TinyMCE Custom Color Palette"

$
0
0

I was using the following in functions.php to restrict / customize the available colors in the wysiwyg editor to brand colors only.

function hope_custom_palette( $hopecolors ) { $hopecolors['theme_advanced_text_colors'] = 'F46A1F,002244,91420E,F0AB00,F7E654,BED600,00685B,5482AB,00B0CA,BBE7E6,4D4F53,000000'; $hopecolors['theme_advanced_more_colors'] = false; return $hopecolors; } add_filter('tiny_mce_before_init', 'hope_custom_palette');

It's come to my attention that this no longer works because of the inclusion of TinyMCE 4 in the WordPress core.

Can anyone suggest a manner to do this at the theme level, rather than editing it in the core itself? (and therefore having to revise after every core upgrade ...)

Much thanks
CT

Emmasmithxs on "Site Recovery"

$
0
0

I am not been able to log in to my account i think site is is hacked just tell me steps to recover it.

Viewing all 8245 articles
Browse latest View live




Latest Images