vendredi 20 novembre 2015

Where is the fsockopen/cURL to update order statuses after payment Paypal Express checkout?

I am using WooCommerce paypal Express checkout Payment Gate Way, My order status update after payment was successfully working and I want to know where is the code was in my website and need to customize the new order mail calling. Hope any one can help me. Thanks.



via Chebli Mohamed

This plugin stopping my wordpress shortcodes from working how do i fix it

this is a simple spintax plugin i like how ever its stopping my wordpress shortcodes working when i disable it , it then works can anybody examin my code and help me resolve this problem as i am not sure were the problem is thanks.

spinner.php

<?php

/*

Plugin Name: Spinnner

Plugin URI: http://justtheweb.com/

Version: 1.0

Author: Just the Web & <a href="http://ift.tt/1kMsT1R" target="_blank">RackTheme</a>

Author URI: http://ift.tt/1MZnXwj  

Description: Spinner is a SEO plugin for Wordpress that assists authors in “spinning” their content to make it more SEO friendly.

*/



/*

 * Defines a security variable to check for in included files.

 */

define('in_jtwSpinner', true);



/*

 * Set the plugin folder path

 */

$jtwSpinner_pluginPath = WP_PLUGIN_DIR .'/'. str_replace(basename( __FILE__),"",plugin_basename(__FILE__));

$jtwSpinner_pluginURL = WP_PLUGIN_URL .'/'. str_replace(basename( __FILE__),"",plugin_basename(__FILE__)) .'/';



require( $jtwSpinner_pluginPath . 'jtwCore.php' );





add_filter('the_title','exec_spin_title');



add_filter('the_content','exec_spin');

add_option('jtwspin_dividechar', ",");

add_option('jtwspin_startchar', "[");

add_option('jtwspin_endchar', "]");

add_action( 'widgets_init', 'jtwspinner_load_widgets' );



function exec_spin_title($post_title) { 



    global $startChar, $endChar, $divideChar;



    $startChar = get_option('jtwspin_startchar');

    $endChar = get_option('jtwspin_endchar');   

    $divideChar = get_option('jtwspin_dividechar');



    $post_title = str_replace('[wpts_spin]', '', $post_title);

    $post_title = str_replace('[/wpts_spin]', '', $post_title);



    return spinParse(-1, $post_title);



}



add_filter( "wpseo_title", 'tag2lowercase_title' ); 

add_filter( "wpseo_metadesc", 'tag2lowercase' ); 

function tag2lowercase($post_title) {   



    global $startChar, $endChar, $divideChar;



    $startChar = get_option('jtwspin_startchar');

    $endChar = get_option('jtwspin_endchar');   

    $divideChar = get_option('jtwspin_dividechar');



    $post_title = str_replace('[wpts_spin]', '', $post_title);

    $post_title = str_replace('[/wpts_spin]', '', $post_title);

    return spinParse(-1, $post_title);



    /*foreach( (array) $c as $k => $v ){

        $a[] = strtolower( $v );

    }

    return $a;*/



}



function tag2lowercase_title($post_title) { 



    global $startChar, $endChar, $divideChar;



    $startChar = get_option('jtwspin_startchar');

    $endChar = get_option('jtwspin_endchar');   

    $divideChar = get_option('jtwspin_dividechar');



    $post_title = str_replace('[wpts_spin]', '', $post_title);

    $post_title = str_replace('[/wpts_spin]', '', $post_title);

    return spinParse(-1, $post_title);



    /*foreach( (array) $c as $k => $v ){

        $a[] = strtolower( $v );

    }

    return $a;*/



}



add_filter( 'wp_title', 'filter_function_name', 100);

function filter_function_name($c) { 



    global $startChar, $endChar, $divideChar;



    $startChar = get_option('jtwspin_startchar');

    $endChar = get_option('jtwspin_endchar');   

    $divideChar = get_option('jtwspin_dividechar');



    $ddd = spinParse(-1, $c);

    return $ddd; 





}



/* Register Widget */

function jtwspinner_load_widgets() {

    register_widget('WordSpinnerWidget');

}



add_action('admin_menu', 'jtwspin_add_pages');

function jtwspin_add_pages() {



}







function jtwspin_admin() {

    $disallowed = array('|','||','+');

  // variables for the field and option names 

  $fieldFirst = 'jtwspin_divide';

    $fieldSecond = 'jtwspin_start';

    $fieldThird = 'jtwspin_end';

    $hidden_field_name = 'jtwspin_hidden';





    if( $_POST[ $hidden_field_name ] == 'Y' ) {



        if ((in_array($_POST[$fieldFirst],$disallowed)) || (in_array($_POST[$fieldSecond],$disallowed)) || (in_array($_POST[$fieldThird],$disallowed))) {

            echo ('<div class="updated"><p><strong>OPTIONS WERE NOT UPDATED!</strong></p>

                  <p>Part of that combination has been found to produce unexpected results. Please dont use any of the following:<br /><br />');

            foreach ($disallowed as $value) {

                echo $value."&nbsp;&nbsp;";

            }

            echo ('</p></div>');

            } else {



            update_option( 'jtwspin_dividechar', $_POST[ $fieldFirst ] );

            update_option( 'jtwspin_startchar', $_POST[ $fieldSecond ] );

            update_option( 'jtwspin_endchar', $_POST[ $fieldThird ] );



            echo ('<div class="updated"><p><strong>Options Saved</strong></p></div>');

        }

    }





    echo '<div class="wrap">';

    echo "<h2>Spinnner Settings</h2>";

    ?>

        <p>Use these settings to define your start, end and dividing character for spinning text within your content.  <br /><em>Example usage</em>: The [quick,brown,dirty,clean] fox [jumped,leaped,ran] across the bridge.</p>

        <form name="form1" method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">

        <input type="hidden" name="<?php echo $hidden_field_name; ?>" value="Y">

        <table class="widefat" cellspacing="0" id="jtw-spinnner">

            <thead>

            <tr>

                <th scope="col" class="manage-column">Split Character</th>

                <th scope="col" class="manage-column">Begin Character</th>

                <th scope="col" class="manage-column">End Character</th>

            </tr>

            </thead>



            <tr>

                <td><input type="text" name="<?php echo $fieldFirst; ?>" value="<?php echo get_option('jtwspin_dividechar'); ?>" size="2" maxlength="1" /></td>

                <td><input type="text" name="<?php echo $fieldSecond; ?>" value="<?php echo get_option('jtwspin_startchar'); ?>" size="2" maxlength="2" /></td>

                <td><input type="text" name="<?php echo $fieldThird; ?>" value="<?php echo get_option('jtwspin_endchar'); ?>" size="2" maxlength="2" /></td>    

            </tr>

        </table>



        <p class="submit"><input type="submit" name="Submit" value="Save" /></p>



</form>



</div>







<?php







} 





$startChar = get_option('jtwspin_startchar');

$endChar = get_option('jtwspin_endchar');   

$divideChar = get_option('jtwspin_dividechar');





function spinParse($pos, &$data) {

    $startPos = $pos;

    global $startChar, $endChar, $divideChar;



    //print "Start Position: $startPos | Length: ".strlen($data)."<br>";



    while ($pos++ < strlen($data)) {

        //print "Current Position: $pos | Character: ".substr($data, $pos, 1)."<br>";



        if (substr($data, $pos, strlen($startChar)) == $startChar) {

            spinParse($pos, $data);

        } elseif (substr($data, $pos, strlen($endChar)) == $endChar) {

            $entirespinner = substr($data, $startPos+strlen($startChar), ($pos - $startPos)-strlen($endChar));

            $data = str_replace($startChar.$entirespinner.$endChar,spinProcess($entirespinner),$data);

            $pos = -1;

        }



        //echo ($data."<br />");

    }





    return $data;



}





function spinProcess($input) {

    global $divideChar;



    //echo ("Process Request: '$input'");

    $txt = split($divideChar,$input);



    $selection = $txt[mt_rand(0,count($txt)-1)];

    //echo (" | Result: '$selection'<br />");

    return $selection;



}





function exec_spin($text) { 

    global $startChar, $endChar, $divideChar;



    $startChar = get_option('jtwspin_startchar');

    $endChar = get_option('jtwspin_endchar');   

    $divideChar = get_option('jtwspin_dividechar');



    return spinParse(-1, $text);





}











class WordSpinnerWidget extends WP_Widget {



    function WordSpinnerWidget() {

        $widget_ops = array('classname' => 'widget_text_spinner', 'description' => __('Spinnable text(s), with opening and closing chars'));

        $control_ops = array('width' => 400, 'height' => 350);

        $this->WP_Widget('spinningwords', __('Spin it!'), $widget_ops, $control_ops);

    }



    function widget( $args, $instance ) {

        extract($args);

        $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title']);

        $text = apply_filters( 'widget_text', exec_spin($instance['text']) );



        echo $before_widget;



        if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?>

            <div class="textwidget"><?php echo $instance['filter'] ? wpautop($text) : $text; ?></div>

        <?php

        echo $after_widget;

    }



    function update( $new_instance, $old_instance ) {

        $instance = $old_instance;

        $instance['title'] = strip_tags($new_instance['title']);



        if ( current_user_can('unfiltered_html') )

            $instance['text'] =  $new_instance['text'];

        else

            $instance['text'] = wp_filter_post_kses( $new_instance['text'] );

            $instance['filter'] = isset($new_instance['filter']);



        return $instance;



    }



    function form( $instance ) {

        $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'text' => '' ) );

        $title = strip_tags($instance['title']);

        $text = format_to_edit($instance['text']);

?>

        <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 esc_attr($title); ?>" /></p>

        <textarea class="widefat" rows="16" cols="20" id="<?php echo $this->get_field_id('text'); ?>" name="<?php echo $this->get_field_name('text'); ?>"><?php echo $text; ?></textarea>

        <p><input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox" <?php checked($instance['filter']); ?> />&nbsp;<label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e('Automatically add paragraphs.'); ?></label></p>

<?php

    }

}

?>

jtwCore.php

<?php

/*
 * jtwCore.php
 * Defines functions which involve shared/re-usable JTW classes and frameworks.
 */

if (!defined('in_jtwSpinner')) die('This file cannot be accessed directly.');

/*
 * jtwSpinner_menu()
 * Checks if global JTW menu exists, and if not, registers it.
 * Adds relevant menu items to JTW menu.
 */

if (!function_exists('jtwSpinner_menu')) {
    function jtwSpinner_menu() { 
        global $jtwSpinner_pluginURL;

        if (!defined('jtw_menu_setup')) {
            // Create the menu

            $icon = $jtwSpinner_pluginURL . 'images/icon.ico';

            if (function_exists('add_object_page')) {
                add_object_page( 'Just The Web Plugins', 'Just The Web', 'manage_options', 'jtw', 'jtwCore_menu', $icon);   
            } else {
                add_menu_page( 'Just The Web Plugins', 'Just The Web', 'manage_options', 'jtw', 'jtwCore_menu', $icon);
            }

            define('jtw_menu_setup', true);
        }    

        // Add the subpages we need
        add_submenu_page('jtw', 'Spinner - Settings', 'Spinner', 'manage_options', 'jtw-extended-options', 'jtwspin_admin');
    }
    add_action('admin_menu', 'jtwSpinner_menu');
}

/*
 * jtwCore_menu()
 * A standard menu to give support and contact information for plugins.
 */

if (!function_exists('jtwCore_menu')) {
    function jtwCore_menu() {
        ?>
        <div class="wrap">

            <div id="icon-options-general" class="icon32">
                <br />
            </div>

            <h2>Just The Web Plugins</h2>

            <p>Here we can publish information about our plugins, etc.</p>

        </div>
        <?php
    }
}



via Chebli Mohamed

How to solve "Invalid Taxonomy", displays Array array on WordPress page?

When I var_dump($myVar); I'm getting this:

WP_Error Object ([errors] => Array ([invalid_taxonomy] => Array ([0]
=> Invalid Taxonomy)) [error_data] => Array ())

, and displays Array array on WordPress page and not the expected taxonomy.



via Chebli Mohamed

How do I use a sitemap with a custom menu for Wordpress

I have a custom menu that displays as the main navigation for the top part of a website. I would like to use the same custom menu as the sitemap for the website. Is there a wordpress plugin that allows this type of functionality?



via Chebli Mohamed

How do I use a sitemap with a custom menu for Wordpress

I have a custom menu that displays as the main navigation for the top part of a website. I would like to use the same custom menu as the sitemap for the website. Is there a wordpress plugin that allows this type of functionality?



via Chebli Mohamed

Parse error: syntax error, unexpected ')' in /home/prayqxia/public_html/http://ift.tt/1I1QCox on line 36

I tried to insert this code to my wordpress site, in my theme fuction.php file. that was when I start to experience this problem.

/** * Checks if a particular user has a role. * Returns true if a match was found. * * @param string $role Role name. * @param int $user_id (Optional) The ID of a user. Defaults to the current user. * @return bool */ function appthemes_check_user_role( $role, $user_id = null ) {

if ( is_numeric( $user_id ) )
$user = get_userdata( $user_id );
else
    $user = wp_get_current_user();

if ( empty( $user ) )
return false;

return in_array( $role, (array) $user->roles );

}



via Chebli Mohamed

Wordpress plugin pass javascript variable to php

Can somebody help me? I'm feeling so stupid. I took example code from WordPress codex, made a example plugin in my webpage, but there no respond...

PHP code is here:

/**
 * Plugin Name: Ada Ajax Test
 * Description: WP Codex based ajax example
 * Version: 1.0.0
 * Author: M. A. Tomas
 * Author URI: http://www.matomas.cz
 * License: GPL2
 */

add_action( 'admin_enqueue_scripts', 'my_enqueue' );
function my_enqueue($hook) {
    if( 'index.php' != $hook ) {
    // Only applies to dashboard panel
    return;
    }

    wp_enqueue_script( 'ajax-script', plugins_url( '/js/my_query.js', __FILE__ ), array('jquery') );

    // in JavaScript, object properties are accessed as ajax_object.ajax_url, ajax_object.we_value
    wp_localize_script( 'ajax-script', 'ajax_object',
            array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'we_value' => 1234 ) );
}

// Same handler function...
add_action( 'wp_ajax_my_action', 'my_action_callback' );
function my_action_callback() {
    global $wpdb;
    $whatever = intval( $_POST['whatever'] );
    $whatever += 10;
  return $whatever;
    wp_die();

}



 // shortcode pro zobrazeni na strance
add_shortcode( 'ajax-zkouska', 'my_action_callback' );

and Javascript code in external file is here:

    // JavaScript Document

jQuery(document).ready(function($) {
    var data = {
        'action': 'my_action',
        'whatever': ajax_object.we_value      // We pass php values differently!
    };
    // We can also pass the url value separately from ajaxurl for front end AJAX implementations
    jQuery.post(ajax_object.ajax_url, data, function(response) {
        alert('Got this from the server: ' + response);
    });
});

Where I mistake?



via Chebli Mohamed