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

mohamedh on "A plugin with remote feature to create list of files."

$
0
0

Hi,

I would like to ask if it would be possible to create a list of files on another server.
let’s say my wp is hosted on server A and files on server B, how can I list files of server B in my wp blog installed on server A?(knowing that I have root control over both of them)
I need an option to list files automatically, for exemple, I enter the url of a page in the plugin and it creates a full list of links available to front-end users, I do not want the files to be imported to my server, I want them to stay on another server but only listed in my wp. I need it to be automatic too, like entering the link once, putting the shortcode of a list in a wp page and if the files are updated the list updates itself, I need to be like a bulk sync, I do not want to put every link manually because this will take a lot of time

I used to use [list yo files] which is a perfect plugin, but it lists only files on the same server located under the WP root directory

hope someone can help and thx in advance


G T on "Using external login page to replace WordPress login form"

$
0
0

Hi,

I am currently developing a WordPress-based system that allows students to login with their student portal account and editing their own academic profiles.

Background
-----------
Our school has a separate student portal that manage all personal information of the students and this system also support CAS authentication for other system. We used to write our own PHP code for enabling CAS authentication with that student portal.

However, this time, we choose WordPress as our platform since it has a complete content management system and plenty of choices of plugins. It can save our development time.

Problem
-----------
After some research, we found that WP has a filter called "authenticate" that can help to intercept user input while logging in the WP and do some further processing (such as including other authentication method). However, in this way, we are still forced to use the original login form. May I know if there is a filter to completely replace the login form and the new login form will be used to enable CAS authentication? How to do this? Thanks.

Since we are quite concern the security of the WP, we want the WP core can be updated though customization has been done. So, we avoid editing the wp-login.php and we prefer all editing is done on theme level.

Can you share some experience with me? Thanks.

crgeary on "Store extra data to a Post/Taxonomy relationship?"

$
0
0

Does anyone know how to store extra data to a Post/Taxonomy relationship in WordPress?

I have a post type "game", and a taxonomy "leagues", and I need a way to assign some extra information on the relationship.

If anyone has used Laravel before, it's just like the second example under "Working With Pivot Tables": http://laravel.com/docs/5.0/eloquent#working-with-pivot-tables

I basically need to store 1 boolean field which stores if the game is the "primary" game in that league.. It has to be done on the relationship as a game can exist in multiple leagues and they may not be "primary" in both.

Any help is greatly appreciated, however small. Thanks in advance :)

daza91 on "Facebook Page Plugin Width Problem"

$
0
0

Hey I am using the new facebook page plugin in a pop up to get more likes for my facebook site.

For the popup I am using the plugin "wbounce".

I have a problem with the width of the facebook box and I dont know anymore what I should do. I tried so many things and wasted so much time for that..

The facebook box is configured on the fb developer site on widht 500px, but in my pop up its something with 100px. I even tried css and the !important function. Nothing works.

Please help me!

This is the code in the popup-plugin:
<div class="modal-title">
<h3>Folge Alpha Inside auf Facebook!</h3>
</div>

<div class="modal-body" >
<p>Verpasse keinen Artikel mehr und erhalte deine tägliche Portion Motivation</p>

<div class="fb-page" data-href="https://www.facebook.com/pages/Alpha-Inside/334029926805762?ref=aymt_homepage_panel" data-width="500" data-hide-cover="false" data-show-facepile="true" data-show-posts="false"><div class="fb-xfbml-parse-ignore">

Alpha Inside
</div></div>
</div>

<div class="modal-footer">
<p>Ich möchte nicht über neue Artikel informiert und täglich motiviert werden</p>
</div>

this is the css
.fb-page {
width: 500px !important
}

You can check the popup and its code on this link. Just move your cursor to the close-button of your browser or your tab:
http://www.alphainside.de/6-wege-wie-du-mehr-spass-und-freude-im-leben-haben-kannst/

Thank you guys!

cyberlp23 on "Prevent posting when no category is selected"

$
0
0

Hello,

I'm trying to trigger an action if, when a user tries to publish a post, no category is selected:
- It could either be just an alert message (and the post is still published);
- Or actually alter message + preventing the post from being published.

Searching on this forum, I've found the code:

jQuery('#submitdiv').on('click','#publish',function(e){
            var $checked = jQuery('#category-all li input:checked');
            if ( $checked.length <= 0 ) { //Checks if cat is selected
            alert("Please Select atleast one category");
            return false;
            }else{ //Else continue
                return true;
            }
            });

But I have no idea where to put it.

Thanks!

mg33 on "Pages Containing Porn Added to Site, Discovered Via Google Analytics"

$
0
0

Hello,

I have recently discovered through Google Analytics and my C-Panel stats that multiple porn related pages have been added to my site, and are accessible via URLs on the live site. I deleted some of these a week ago through PHPMyAdmin and from the Wordpress (deleting the pages there).

Doing another review of the site tonight to update .htaccess to block traffic from a variety of referrers, I noticed that there are still porn pages on the site, but I can't see them in the Wordpress page list. I can access them and edit them, but they're not listed in Pages.

I've added Wordfence and run a scan to discover a ton of malicious pages added to various plugins (executable PHP files / base64() pages).

Obviously I'm going to need to delete these and tighten up the security. But my question is, where are these porn pages if I can't see them in Wordpress>Pages? I don't have access to PHPMyAdmin right now because my host CPanel is down temporarily. I've got a lot of cleanup to do, but looking for some advice on a) what to do, and, b) how to keep this from ever happening again.

I'm using the WP Security plugin, passwords should be good; maybe this was a recent exploit of a hack done on the site quite a while back.

Just want to solve my problem. Thanks for your help!

diveman1 on "URL Json API coding"

$
0
0

Hi everyone, I'm hoping you can help me with this. I have a custom made API (made by someone else) that I need to implement on a site. The API uses Json and is accessible via URL's. The problem is I don't know the best way to put it into action in Wordpress. It should display a clothing list and clothing details for a particular piece of clothing. Can anyone give any advice, or make any recommendations on how to get this to work? Thanks in advance for your help. Here's what I have so far:

-----Begin------
<script	src="resources/js/jquery-1.10.2.js"></script>
<input type="button" onclick="ajaxtest1()" value="getAllClothing"> &nbsp; &nbsp; Clothing List &nbsp; &nbsp;<select id="clolist"></select><br/>
<br/>
<input type="text" id="cloid"><input type="button" onclick="ajaxtest2()" value="getClothingDetails"><br/>

<div id="test1"></div>
<script>
	var headerdata = {};
	headerdata["auth"] = "1234567890987654321qwerty";

	function ajaxtest1() {
		var data = {
			"consumerName" : "microsite",
			"serviceName" : "getClothingList"
		};
		ajaxCall(data, headerdata,ClothingList)
	}

	function ajaxtest2() {
		var cloid=$("#cloid").val();
		var data = {
			"consumerName" : "microsite",
			"data" : "{\"ClothingId\" : \""+cloid+"\"}",
			"serviceName" : "getClothingDetails"
		};
		ajaxCall(data, headerdata,ClothingDetails)
	}

	function ClothingList(data) {
		var obj=JSON.parse(data)
		var list=obj.ClothingList;
		$("#clolist").html("");
		if(list.length==undefined){
				$("#clolist").append(new Option("--No Clothing--", ""));
		}else if(list.length>0){
				$("#clolist").append(new Option("--Clothing--", ""));
			$.each(list, function (i, val) {
				$("#clolist").append(new Option(val.ClothingName,val.ClothingID));
			});
		}
	}

	function ClothingDetails(data) {
		$("#test1").html("");
		var obj=JSON.parse(data)
		var clo=obj.clothing;
		console.log(clo);
		$("#test1").append("Name : <span>"+clo.ClothingDisplayName+"</span><br/>")
		$("#test1").append("Color : <span>"+clo.clothingColor+"</span><br/>")
		$("#test1").append("Sizes : <span>"+clo.clothingSizes+"</span><br/>")
	}

	function ajaxCall(data, headerdata,callback) {
		$.ajax({
			type : "POST",
			url : "http://1.1.1.1:8111/meh/api/apiService",
			data : data,
			headers : headerdata,
			crossDomain : true,
			success : callback,
			error : function(data, status) {
				alert("Error  " + status);
			}
		});
	}
</script>
---------End

soyximo on "How do I store sensitive data on custom post fields?"

$
0
0

I'm building a website for an actors representative, It displays public information like: actor's name, photos, videobooks, cv etc but they are also storing some sensitive data like: phone numbers, bank account number, social security etc to use on their daily tasks (like in a CRM). Is there a way to secure this fields so that they are only available through the wp-admin? could someone do a query from the front end and compromise this kind of information?

Many thanks.


Budzan on "Custom posts and taxonomy permalinks"

$
0
0

Hello guys,
I've got the problem that i cant handle without your help.
Here's the thing:

I want to create custom posts named Transmisje, and than custom categories for it (taxonomies) - Dyscyplina, and then get:

mydomain.pl/transmisje - archive page with posts from custom posts 'Transmisje'

mydomain.pl/tramsisje/dyscyplina/name-of-custom-category - archive page for custom categories (taxonomies) in Dyscyplina

and the las one, for the single custom post mydomain.pl/dyscyplina/name-of-custom-category/post-name

I was looking for tutorials and Ive made custom posts, and taxonomies, and something that should resolve the permalinks problem but nothing helped.

here is the code:

function my_custom_post_product() {
	$labelsProduct = array(
		'name'               => _x( 'Produkty', 'post type general name' ),
		'singular_name'      => _x( 'Produkty', 'post type singular name' ),
		'add_new'            => _x( 'Dodaj nowy produkt', 'book' ),
		'add_new_item'       => __( 'Dodawanie nowego produktu' ),
		'edit_item'          => __( 'Edytuj produkt' ),
		'new_item'           => __( 'Nowy produkt' ),
		'all_items'          => __( 'Lista produktów' ),
		'view_item'          => __( 'Zobacz produkt' ),
		'search_items'       => __( 'Szukaj produktu' ),
		'not_found'          => __( 'Nie znaleziono produktów' ),
		'not_found_in_trash' => __( 'Nie znalezionko produktów w koszu' ),
		'parent_item_colon'  => '',
		'menu_name'          => 'Transmisje'
	);
	$argsProduct = array(
		'labels'        => $labelsProduct,
		'description'   => 'Wprowadź nowy produkt.',
		'public'        => true,
		'menu_position' => 5,
		'supports'      => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ),
		'has_archive'   => true,
		'hierarchical'	=> true,
		'rewrite'		=> array('slug' => 'transmisje/%dyscyplina%','with_front' => false),
		'query_var'		=> true,
		//'rewrite'		=> true,
		//'publicly_queryable' => false,
	);
	register_post_type( 'transmisje', $argsProduct );
}

add_action( 'init', 'my_custom_post_product' );

/* A taxonomies for products (category taxonomy) */
function my_taxonomies_product() {
	$labelsTaxProducts = array(
		'name'              => _x( 'Kategorie', 'taxonomy general name' ),
		'singular_name'     => _x( 'Kategorie', 'taxonomy singular name' ),
		'search_items'      => __( 'Wyszukaj kategorie' ),
		'all_items'         => __( 'Wszystkie kategorie' ),
		'parent_item'       => __( 'Rodzic kategorii' ),
		'parent_item_colon' => __( 'Rodzic produktu:' ),
		'edit_item'         => __( 'Edytuj kategorie' ),
		'update_item'       => __( 'Aktualizuj kategorie' ),
		'add_new_item'      => __( 'Dodaj nową kategorie' ),
		'new_item_name'     => __( 'Nazwa nowej kategorii' ),
		'menu_name'         => __( 'Dyscypliny' ),
	);
	$argsTaxProducts = array(
		'labels' => $labelsTaxProducts,
		'hierarchical' 	=> true,
		'public'		=> true,
		'query_var'		=> 'dyscyplina',
		//slug prodotto deve coincidere con il primo parametro dello slug del Custom Post Type correlato
		'rewrite'		=>  array('slug' => 'dyscyplina' ),
		'_builtin'		=> false,
	);
	register_taxonomy( 'dyscyplina', 'transmisje', $argsTaxProducts );
}

add_action( 'init', 'my_taxonomies_product', 0 );

add_filter('post_link', 'dyscyplina_permalink', 1, 3);
add_filter('post_type_link', 'dyscyplina_permalink', 1, 3);

function category_permalink($permalink, $post_id, $leavename) {
	//con %category% catturo il rewrite del Custom Post Type
    if (strpos($permalink, '%dyscyplina%') === FALSE) return $permalink;
        // Get post
        $post = get_post($post_id);
        if (!$post) return $permalink;

        // Get taxonomy terms
        $terms = wp_get_object_terms($post->ID, 'dyscyplina');
        if (!is_wp_error($terms) && !empty($terms) && is_object($terms[0]))
        	$taxonomy_slug = $terms[0]->slug;
        else $taxonomy_slug = 'no-category';

    return str_replace('%dyscyplina%', $taxonomy_slug, $permalink);
}

what I have now?

On the home page permalinks are just with my domain
on the mydomain.pl/transmisje/ I have permalinks mydomain.pl/transmisje/

and on the mydomain.pl/dyscyplina/name-of-custom-category/ permalink is "mydomain.pl/dyscyplina/name-of-custom-category/"

It looks that permalink is generating wrong, but I don't know why. I will be very pleased if you could help me guys!

Thanks, Budzan

Drew McIntire on "How to set custom permalink of archive"

lcorino on "Classipress POST AN AD not working"

$
0
0

When attempting to post an ad, the only thing that comes up is the listing price - the category option is blank and it does not give you the option of going any further. No one can post ads on my classified site.. help!

Qasim Jan on "how to Know the Active installations Of My Plugin"

$
0
0

i have uploaded a plugin one month before. it shows that 27 persons has downloaded my plugin. Now i want to know that how many users did install my plugin. help me please.

thanks

Bharadwaj on "Block Displaying text at footer due to error plugin"

ziasultan on "amazon api integration"

$
0
0

Hi everyone
I want to know how to integrate amazon api in wordpress and upload .csv file so that product will change when i upload a new .csv file
Thank u

molarum on "Faking a page"

$
0
0

Hell everybody,

i'm posting my first post so i'm not quite sure if this is the correct sub. My problem i want to solve is: I want to create a plugin for shopping stuff. All of you know i'm going to need a checkout cart. My main problem is how to achive a link to cart in my shopping cart widget, which uses the default page layout of the current theme, and displays the cart as a page in the theme. I thought about building a shortcode and parsing this shortcode as a string in the template but i'm not sure how to achieve this. Any ideas on this topic?

I hope you could help me :)

Greetings from germany


icetek on "html entity problems with xmlrpc python."

$
0
0

If I try to send HTML through post.content via python Wordpress xmlrpc it scrambles up and renders & html entity characters breaking HTML entirely. What could cause this and how do I fix it?

quenenni on "get theme version from outside a wp instance"

$
0
0

Hello,

I wrote few days ago about getting plugins version from outside WP:
https://wordpress.org/support/topic/get-plugins-version-from-outside-a-wp-instance

My script works perfectly.

Now I'm trying to do the same for the themes, but so far, no luck, and I don't know why.

Instead of using the address
https://api.wordpress.org/plugins/info/1.0/
I'm using:
https://api.wordpress.org/themes/info/1.0/

As stated here http://codex.wordpress.org/WordPress.org_API

Themes
v1.0 will return its content serialized, v1.1 as a JSON object.

https://api.wordpress.org/themes/info/1.0/
https://api.wordpress.org/themes/info/1.1/

But no matter what I tried, I have a "404 page not found."
I tried with several themes (included all the twentysomething, the WP defaults themes), and with the 3 different extensions (json / xml / php).
I tried also using parameters in the query.. but also without luck.

Any idea why it doesn't work for the themes?
A problem with the API / server?

Thanks

PS: Am I missing something or there is no preview available when writing a post?

rairose on "Form content is scrunched, need to widen cells."

$
0
0

My page is at: http://www.fcslubbock.org/personal-responsibility-map/

The form is at the bottom of the page. I built it using Form Maker Version 1.7.48.

I am trying to widen the cells in which the text and selection options are, so that everything is in line, rather than the text (on the left side of the form) falling into multiple lines.

Can someone please advise me on where I can make the CSS edit for this issue? Thank you in advance for any help you can provide :-)

AbacusDataSystems on "Current date display has gone crazy!"

$
0
0

The date at the right side of the header at http://www.mornystannit.info has never been wrong until now. I noticed it just a few days ago, but do not know exactly when the date display went wrong. Now, it always shows the time as "14:33", and the year is random; only the day of the month is correct.

What on Earth could have caused this suddenly?

The code has never been changed. Here it is:

$d = 'Y-m-j H:i:s';
$datum = mysql2date( 'H:i, l, jS F, Y', time($d) );
$before = '';
$after = '';
echo apply_filters('the_date', $datum, 'H:i, l, jS F, Y', $before, $after);

dea_om on "wp_list_table bulk action not working"

$
0
0

Hi,
I'm trying to do a plugin which uses custom table and custom post type with custom taxonomies. To show the data from the custom table I'm extending the wp_list_table class. The data is shown correctly, but my trouble starts when I want to delete the record or do anything on that page. I'm trying to implement the bulk delete and also the mouse over delete but it's just not working. The mouse over delete "button" is not appearing at all and when I click the apply button for the bulk delete it just redirects me to a You do not have sufficient permissions to access this page. I don't know what I'm doing wrong. Any ideas?
The code for the delete:

function column_name( $item ) {

		$delete_nonce = wp_create_nonce( 'bsp_delete_student' );

		$title = '<strong>' . $item['students_name'] . '</strong>';

		$actions = [
			'delete'=>sprintf('<a href="?post_type=%s&page=%s&action=%s&student=%s">Delete</a>', $_REQUEST['post_type'], $_REQUEST['page'], 'delete', $item->students_id)
		];

		return $title . $this->row_actions( $actions );
	}

	function get_bulk_actions(){
		$actions=array(
		'delete'=>__( 'Delete' )
		);
		return $actions;

	}
public function process_bulk_action() {

		//Detect when a bulk action is being triggered...
		if ( 'delete' === $this->current_action() ) {

			// In our file that handles the request, verify the nonce.
			$nonce = esc_attr( $_REQUEST['_wpnonce'] );

			if ( ! wp_verify_nonce( $nonce, 'bsp_delete_student' ) ) {
				die( 'Go get a life script kiddies' );
			}
			else {
				self::delete_student( absint( $_GET['student'] ) );

				wp_redirect( esc_url( add_query_arg() ) );
				exit;
			}

		}

		// If the delete bulk action is triggered
		if ( ( isset( $_POST['action'] ) && $_POST['action'] == 'delete' )
		     || ( isset( $_POST['action2'] ) && $_POST['action2'] == 'delete' )
		) {

			$delete_ids = esc_sql( $_POST['delete'] );

			// loop over the array of record IDs and delete them
			foreach ( $delete_ids as $id ) {
				self::delete_student( $id );

			}

			wp_redirect( esc_url( add_query_arg() ) );
			exit;
		}
	}

	public static function bsp_delete_student($id){
		global $wpdb;
		$wpdb->delete(
			"{$wpdb->prefix}students",
			[ 'students_id' => $id ],
			[ '%d' ]
		);
	}

I've changed the code a couple of times for the delete function but I always get the same error message. Any help would be greatly appreciated.

Viewing all 8245 articles
Browse latest View live




Latest Images