Plugin Directory


Ignore:
Location:
linkworth-wp-plugin
Files:
7 added
3 edited

Legend:

Unmodified
Added
Removed
  • linkworth-wp-plugin/trunk/LinkWorth_WordPress.php

    r2750802 r2754739  
    55Description: LinkWorth Easy Link Syndication for WordPress and WPMU
    66Author: LinkWorth
    7 Version: 3.3.3
     7Version: 3.3.4
    88Author URI: http://www.linkworth.com/
    99License: GPLv2 or later
     
    308308    }
    309309
    310     function get_contents( $url )
    311     {
    312         global $lw_debug_information;
    313 
    314         $lw_debug_information .= 'get_contents() running - '.$url.'++';
    315 
    316         if( !empty( $url ) )
    317         {
    318             $curl_handle = curl_init();
    319             curl_setopt( $curl_handle, CURLOPT_URL, $url );
    320             curl_setopt( $curl_handle, CURLOPT_CONNECTTIMEOUT, 30 );
    321             curl_setopt( $curl_handle, CURLOPT_RETURNTRANSFER, true );
    322 
    323             if( @ini_get('open_basedir') == '' && @ini_get('safe_mode') == 'Off' )
    324             {
    325                 curl_setopt( $curl_handle, CURLOPT_FOLLOWLOCATION, true );
    326                 curl_setopt( $curl_handle, CURLOPT_MAXREDIRS, 2 );
    327             }
    328 
    329             if( curl_exec( $curl_handle ) === false )
    330             {
    331                 $curl_error = 'Curl error: ' . curl_error( $curl_handle );
    332             }
    333 
    334             $string = curl_exec( $curl_handle );
    335             curl_close( $curl_handle );
    336         }
    337 
    338         if( isset( $_GET['debug'] ) )
    339         {
    340             if( !empty( $curl_error ) )
    341             {
    342                 $lw_debug_information .= $curl_error.'++';
    343             }
    344 
    345             if( empty( $string ) )
    346             {
    347                 $lw_debug_information .= 'get_contents() empty++';
    348             }
    349         }
    350 
    351         return $string;
    352     }
     310    function get_contents($url)
     311    {
     312        global $lw_debug_information;
     313
     314        $string = '';
     315        $wp_remote_get_error = '';
     316
     317        $lw_debug_information .= 'get_contents() running - '.$url.'++';
     318
     319        if (!empty($url)) {
     320
     321            $response = wp_remote_get($url);
     322            $http_code = wp_remote_retrieve_response_code($response);
     323
     324            if ($http_code == '200') {
     325
     326                $string = wp_remote_retrieve_body($response);
     327
     328            } else {
     329
     330                $wp_remote_get_error = 'get_contents() error: ' . wp_remote_retrieve_header($response, 'status');
     331            }
     332        }
     333
     334        if (isset($_GET['debug'])) {
     335
     336            if (!empty($wp_remote_get_error)) {
     337
     338                $lw_debug_information .= $wp_remote_get_error.'++';
     339            }
     340
     341            if (empty($string)) {
     342
     343                $lw_debug_information .= 'get_contents() empty++';
     344            }
     345        }
     346
     347        return $string;
     348    }
    353349
    354350    // ---------------------------------------------------------------------------------------
     
    651647        }
    652648
    653         if( function_exists( 'curl_init' ) )
     649        if( function_exists( 'wp_remote_get' ) )
    654650        {
    655651            $support_array['can_get_ads'] = 1;
     
    836832                        if( is_numeric( $ad['location'] ) )
    837833                        {
    838                             $page_uri = $_SERVER['REQUEST_URI'];
     834                            $page_uri = htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8');
    839835
    840836                            if( is_home() || is_front_page() )
     
    11631159        {
    11641160            //SET DEFAULT VARIABLES
    1165             $current_url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
     1161            $current_url = $_SERVER['SERVER_NAME'] . htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8');
    11661162            $links = array();
    11671163            $tags = array();
     
    14321428        if( isset( $_POST['linkw-submit'] ) )
    14331429        {
    1434             $options['title'] = strip_tags( stripslashes( $_POST['linkw-title'] ) );
     1430            $options['title'] = strip_tags( stripslashes( htmlspecialchars($_POST['linkw-title'], ENT_QUOTES, 'UTF-8') ) );
    14351431            update_option( 'lw_widget', $options );
    14361432        }
     
    14381434        if( !empty( $options['title'] ) )
    14391435        {
    1440             $title = htmlspecialchars( $options['title'], ENT_QUOTES );
     1436            $title = $options['title'];
    14411437        }
    14421438        else
  • linkworth-wp-plugin/trunk/lw_includes/LinkWorth_admin.php

    r2750802 r2754739  
    2121
    2222    //UPDATE DEALS
    23     if( isset( $_POST['lw_update_deal_list'] ) )
     23    if( isset( $_POST['lw_update_deal_list'] ) && wp_verify_nonce($_POST['update_general_settings_field'], 'update_general_settings_action') )
    2424    {
    2525        update_option( 'lw_cache_time', 0 );
     
    3232
    3333    //DELETE SETTINGS
    34     if( isset( $_POST['lw_delete_settings'] ) )
     34    if( isset( $_POST['lw_delete_settings'] ) && wp_verify_nonce($_POST['update_advanced_options_field'], 'update_advanced_options_action') )
    3535    {
    3636        delete_option('lw_linkintxts');
     
    4646        $billboard_base = 'pages';
    4747    }
    48     elseif( isset( $_POST['lw_update_settings'] ) )
     48    elseif( isset( $_POST['lw_update_settings'] ) && wp_verify_nonce($_POST['update_advanced_options_field'], 'update_advanced_options_action') )
    4949    {
    5050        //PROCESS POST BEFOR UPDATING
     
    7272            }
    7373
    74             $updated_lw_options['loop_number'] = $_POST['lw_ops']['loop_number'];
    75             $updated_lw_options['nocontentads'] = $_POST['lw_ops']['nocontentads'];
    76             $updated_lw_options['debug'] = $_POST['lw_ops']['debug'];
    77             $updated_lw_options['disable_silent'] = $_POST['lw_ops']['disable_silent'];
    78             $updated_lw_options['lw_linkscale'] = $_POST['lw_ops']['lw_linkscale'];
     74            $updated_lw_options['loop_number'] = sanitize_text_field($_POST['lw_ops']['loop_number']);
     75            $updated_lw_options['nocontentads'] = sanitize_text_field($_POST['lw_ops']['nocontentads']);
     76            $updated_lw_options['debug'] = sanitize_text_field($_POST['lw_ops']['debug']);
     77            $updated_lw_options['disable_silent'] = sanitize_text_field($_POST['lw_ops']['disable_silent']);
     78            $updated_lw_options['lw_linkscale'] = sanitize_text_field($_POST['lw_ops']['lw_linkscale']);
    7979        }
    8080        else
    8181        {
    82             $updated_lw_options['lw_sidebar'] = $_POST['lw_ops']['lw_sidebar'];
    83             $updated_lw_options['lw_sidebarwidget'] = $_POST['lw_ops']['lw_sidebarwidget'];
     82            $updated_lw_options['lw_sidebar'] = sanitize_text_field($_POST['lw_ops']['lw_sidebar']);
     83            $updated_lw_options['lw_sidebarwidget'] = sanitize_text_field($_POST['lw_ops']['lw_sidebarwidget']);
    8484            $updated_lw_options['lw_cssmod'] = 0;
    85             $updated_lw_options['lw_linktype'] = $_POST['lw_ops']['lw_linktype'];
    86             $updated_lw_options['lw_linkcolor'] = $_POST['lw_ops']['lw_linkcolor'];
    87             $updated_lw_options['website_id'] = $_POST['lw_ops']['website_id'];
    88             $updated_lw_options['website_hash'] = $_POST['lw_ops']['website_hash'];
    89             $updated_lw_options['billboard_base'] = $_POST['lw_ops']['billboard_base'];
    90             $updated_lw_options['lw_linksize'] = $_POST['lw_ops']['lw_linksize'];
     85            $updated_lw_options['lw_linktype'] = sanitize_text_field($_POST['lw_ops']['lw_linktype']);
     86            $updated_lw_options['lw_linkcolor'] = sanitize_text_field($_POST['lw_ops']['lw_linkcolor']);
     87            $updated_lw_options['website_id'] = sanitize_text_field($_POST['lw_ops']['website_id']);
     88            $updated_lw_options['website_hash'] = sanitize_text_field($_POST['lw_ops']['website_hash']);
     89            $updated_lw_options['billboard_base'] = sanitize_text_field($_POST['lw_ops']['billboard_base']);
     90            $updated_lw_options['lw_linksize'] = sanitize_text_field($_POST['lw_ops']['lw_linksize']);
    9191
    9292            if( isset( $_POST['lw_ops']['site_id'] ) && isset( $_POST['lw_ops']['site_hash'] ) )
    9393            {
    94                 $updated_lw_options['site_id'] = $_POST['lw_ops']['site_id'];
    95                 $updated_lw_options['site_hash'] = $_POST['lw_ops']['site_hash'];
     94                $updated_lw_options['site_id'] = sanitize_text_field($_POST['lw_ops']['site_id']);
     95                $updated_lw_options['site_hash'] = sanitize_text_field($_POST['lw_ops']['site_hash']);
    9696            }
    9797        }
     
    284284                    <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;"> What is THIS website's SITE ID?</td>
    285285                    <td colspan="2">
    286                         <input type="text" name="lw_ops[website_id]" size="10" id="website_id" value="<?php if(defined('LW_WEBSITE_ID')) { echo LW_WEBSITE_ID; } ?>"<?php echo $disabled_option ?> />
     286                        <input type="text" name="lw_ops[website_id]" size="10" id="website_id" value="<?php if(defined('LW_WEBSITE_ID')) { echo LW_WEBSITE_ID; } ?>"<?php echo esc_attr($disabled_option) ?> />
    287287                    </td>
    288288                </tr>
     
    290290                    <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;"> What is THIS website's HASH ID?</td>
    291291                    <td colspan="2">
    292                         <input type="text" name="lw_ops[website_hash]" size="35" id="website_hash" value="<?php if(defined('LW_HASH')) { echo LW_HASH; } ?>"<?php echo $disabled_option ?> />
     292                        <input type="text" name="lw_ops[website_hash]" size="35" id="website_hash" value="<?php if(defined('LW_HASH')) { echo LW_HASH; } ?>"<?php echo esc_attr($disabled_option) ?> />
    293293                    </td>
    294294                </tr>
     
    362362                        <select name="lw_ops[lw_linkcolor]" style="width:100px;">
    363363                            <option value="">Select One</option>
    364                             <option value="1"<?php echo $lw_color_array_selected[1] ?>>AquaMarine</option>
    365                             <option value="2"<?php echo $lw_color_array_selected[2] ?>>Forest</option>
    366                             <option value="3"<?php echo $lw_color_array_selected[3] ?>>Winter</option>
    367                             <option value="4"<?php echo $lw_color_array_selected[4] ?>>Summer</option>
    368                             <option value="5"<?php echo $lw_color_array_selected[5] ?>>Fruity</option>
    369                             <option value="6"<?php echo $lw_color_array_selected[6] ?>>Baby</option>
    370                             <option value="7"<?php echo $lw_color_array_selected[7] ?>>Highway</option>
     364                            <option value="1"<?php echo esc_attr($lw_color_array_selected[1]) ?>>AquaMarine</option>
     365                            <option value="2"<?php echo esc_attr($lw_color_array_selected[2]) ?>>Forest</option>
     366                            <option value="3"<?php echo esc_attr($lw_color_array_selected[3]) ?>>Winter</option>
     367                            <option value="4"<?php echo esc_attr($lw_color_array_selected[4]) ?>>Summer</option>
     368                            <option value="5"<?php echo esc_attr($lw_color_array_selected[5]) ?>>Fruity</option>
     369                            <option value="6"<?php echo esc_attr($lw_color_array_selected[6]) ?>>Baby</option>
     370                            <option value="7"<?php echo esc_attr($lw_color_array_selected[7]) ?>>Highway</option>
    371371                        </select>
    372372                    </td>
     
    383383                <tr>
    384384                    <td colspan='2'>
    385                         <a href="#" style="color:<?php echo $test_color[0];?>; font-size:<?php echo $lw_linksize.$lw_linkscale;?>;">Link 1</a> &nbsp; &nbsp; &nbsp;
    386                         <a href="#" style="color:<?php echo $test_color[1];?>; font-size:<?php echo $lw_linksize.$lw_linkscale;?>;">Another Link</a> &nbsp; &nbsp; &nbsp;
    387                         <a href="#" style="color:<?php echo $test_color[2];?>; font-size:<?php echo $lw_linksize.$lw_linkscale;?>;">Anchor 4</a> &nbsp; &nbsp; &nbsp;
     385                        <a href="#" style="color:<?php echo esc_attr($test_color[0]);?>; font-size:<?php echo esc_attr($lw_linksize.$lw_linkscale);?>;">Link 1</a> &nbsp; &nbsp; &nbsp;
     386                        <a href="#" style="color:<?php echo esc_attr($test_color[1]);?>; font-size:<?php echo esc_attr($lw_linksize.$lw_linkscale);?>;">Another Link</a> &nbsp; &nbsp; &nbsp;
     387                        <a href="#" style="color:<?php echo esc_attr($test_color[2]);?>; font-size:<?php echo esc_attr($lw_linksize.$lw_linkscale);?>;">Anchor 4</a> &nbsp; &nbsp; &nbsp;
    388388                        <br />
    389                         <a href="#" style="color:<?php echo $test_color[3];?>; font-size:<?php echo $lw_linksize.$lw_linkscale;?>;">A Link</a> &nbsp; &nbsp; &nbsp;
    390                         <a href="#" style="color:<?php echo $test_color[4];?>; font-size:<?php echo $lw_linksize.$lw_linkscale;?>;">Click me</a> &nbsp; &nbsp; &nbsp;
    391                         <a href="#" style="color:<?php echo $test_color[5];?>; font-size:<?php echo $lw_linksize.$lw_linkscale;?>;">Another Anchor</a> &nbsp; &nbsp; &nbsp;
     389                        <a href="#" style="color:<?php echo esc_attr($test_color[3]);?>; font-size:<?php echo esc_attr($lw_linksize.$lw_linkscale);?>;">A Link</a> &nbsp; &nbsp; &nbsp;
     390                        <a href="#" style="color:<?php echo esc_attr($test_color[4]);?>; font-size:<?php echo esc_attr($lw_linksize.$lw_linkscale);?>;">Click me</a> &nbsp; &nbsp; &nbsp;
     391                        <a href="#" style="color:<?php echo esc_attr($test_color[5]);?>; font-size:<?php echo esc_attr($lw_linksize.$lw_linkscale);?>;">Another Anchor</a> &nbsp; &nbsp; &nbsp;
    392392                    </td>
    393393                </tr>
     
    426426        <p style="display:inline-block; margin-top:0;"><small><em>(Overview of published adverts.)</em></small></p>
    427427        <p>Information listed here has been generated based on the lists of approved ads in your LinkWorth account on our servers.</p>
    428        
     428
    429429        <table cellspacing="0" cellpadding="0" class="widefat">
    430430            <thead>
     
    474474?>
    475475            <tr>
    476                 <td><a href="<?php echo $protocol.$ad['url']?>"><?php echo $ad['anchor']?></a></td>
    477                 <td><?php echo $lw_humanloc ?></td>
    478                 <td><?php echo ((!is_array($ad['description']) || !empty($ad['description'])) ? $ad['description'] : '');?></td>
     476                <td><a href="<?php echo esc_url($protocol.$ad['url'])?>"><?php echo esc_html($ad['anchor'])?></a></td>
     477                <td><?php echo esc_html($lw_humanloc) ?></td>
     478                <td><?php echo ((!is_array($ad['description']) || !empty($ad['description'])) ? esc_html($ad['description']) : '');?></td>
    479479            </tr>
    480480<?php
     
    514514?>
    515515            <tr>
    516                 <td><a href="<?php echo $ad['url'] ?>"><?php echo $ad['anchor'] ?></a></td>
    517                 <td><?php echo $lw_humanloc ?></td>
    518                 <td><?php echo $ad['pagename'] ?> <?php echo $ad['description'] ?></td>
     516                <td><a href="<?php echo esc_url($ad['url']) ?>"><?php echo esc_html($ad['anchor']) ?></a></td>
     517                <td><?php echo esc_html($lw_humanloc) ?></td>
     518                <td><?php echo esc_html($ad['pagename']) ?> <?php echo esc_html($ad['description']) ?></td>
    519519            </tr>
    520520<?php
     
    553553?>
    554554            <tr>
    555                 <td style="vertical-align:top;"><a href="<?php echo $protocol.$example_ad['url'] ?>" title="<?php echo $example_ad['description'] ?>"><?php echo $example_ad['anchor'] ?></a></td>
    556                 <td style="vertical-align:top;"><?php echo $lw_humanloc ?></td>
     555                <td style="vertical-align:top;"><a href="<?php echo esc_url($protocol.$example_ad['url']) ?>" title="<?php echo esc_attr($example_ad['description']) ?>"><?php echo esc_html($example_ad['anchor']) ?></a></td>
     556                <td style="vertical-align:top;"><?php echo esc_html($lw_humanloc) ?></td>
    557557                <td>
    558558<?php
     
    564564                        $protocol = ($hyperlink['use_https'])? 'https://' : 'http://';
    565565?>
    566                     <a href="<?php echo $protocol.$hyperlink['url'] ?>" title="<?php echo $hyperlink['description'] ?>"><?php echo $hyperlink['anchor'] ?></a><?php echo (($current_count < $hyperlink_count) ? ' ,' : '')?>
     566                    <a href="<?php echo esc_url($protocol.$hyperlink['url']) ?>" title="<?php echo esc_attr($hyperlink['description']) ?>"><?php echo esc_html($hyperlink['anchor']) ?></a><?php echo (($current_count < $hyperlink_count) ? ' ,' : '')?>
    567567<?php
    568568                        $current_count++;
     
    596596?>
    597597            <tr>
    598                 <td><a href="<?php echo $protocol.$ad['url'] ?>"><?php echo $ad['anchor'] ?></a></td>
    599                 <td><?php echo $ad['webpageurl'] ?></td>
     598                <td><a href="<?php echo esc_url($protocol.$ad['url']) ?>"><?php echo esc_html($ad['anchor']) ?></a></td>
     599                <td><?php echo esc_html($ad['webpageurl']) ?></td>
    600600                <td></td>
    601601            </tr>
     
    618618                </tr>
    619619            </table>
     620            <?php wp_nonce_field( 'update_general_settings_action', 'update_general_settings_field' ); ?>
    620621            </form>
    621622        </fieldset>
     
    663664        <div id="message" class="updated fade">
    664665            <p style="font-weight:bold;">
    665                 Your theme has <?php echo $loop_count ?> loop. 
     666                Your theme has <?php echo $loop_count ?> loop.
    666667                If you do not have a static page as your home page, your theme could be using more then one instance of 'The Loop.'
    667668                The number of loops could be higher then <?php echo $loop_count ?>.
     
    693694            <h2>LinkWorth Advanced Configuration</h2>
    694695
    695             <form method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>">
     696            <form method="post" action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8') ?>">
    696697            <table cellspacing="0" cellpadding="0" class="widefat" style="width:auto;">
    697698                <thead>
     
    723724?>
    724725                        <select name="lw_ops[lw_linkscale]">
    725                             <option value="px"<?php echo $lw_size_array_selected['px'] ?>>Pixels</option>
    726                             <option value="pt"<?php echo $lw_size_array_selected['pt'] ?>>Points</option>
    727                             <option value="em"<?php echo $lw_size_array_selected['em'] ?>>Ems</option>
     726                            <option value="px"<?php echo esc_attr($lw_size_array_selected['px']) ?>>Pixels</option>
     727                            <option value="pt"<?php echo esc_attr($lw_size_array_selected['pt']) ?>>Points</option>
     728                            <option value="em"<?php echo esc_attr($lw_size_array_selected['em']) ?>>Ems</option>
    728729                        </select>
    729730                    </td>
     
    770771
    771772            <input type="hidden" name="updating_advanced_options" value="1" />
     773            <?php wp_nonce_field( 'update_advanced_options_action', 'update_advanced_options_field' ); ?>
    772774            </form>
    773775        </fieldset>
  • linkworth-wp-plugin/trunk/readme.txt

    r2750802 r2754739  
    44Tags: ads, sidebar, post, content, ad, text links, links
    55Requires at least: 2.3
    6 Tested up to: 5.9
    7 Stable tag: 3.3
     6Tested up to: 6.0
     7Stable tag: 3.3.3
    88
    99Easily publish different types of text link products and in-content ads from linkworth.com.
Note: See TracChangeset for help on using the changeset viewer.