Changeset 2757457
- Timestamp:
- 07/16/2022 09:52:31 PM (4 years ago)
- Location:
- linkworth-wp-plugin/trunk
- Files:
-
- 3 edited
-
LinkWorth_WordPress.php (modified) (3 diffs)
-
lw_includes/LinkWorth_MU.php (modified) (2 diffs)
-
lw_includes/LinkWorth_admin.php (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
linkworth-wp-plugin/trunk/LinkWorth_WordPress.php
r2754739 r2757457 1159 1159 { 1160 1160 //SET DEFAULT VARIABLES 1161 $current_url = $_SERVER['SERVER_NAME']. htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8');1161 $current_url = htmlspecialchars($_SERVER['SERVER_NAME'], ENT_QUOTES, 'UTF-8') . htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8'); 1162 1162 $links = array(); 1163 1163 $tags = array(); … … 1428 1428 if( isset( $_POST['linkw-submit'] ) ) 1429 1429 { 1430 $options['title'] = s trip_tags( stripslashes( htmlspecialchars($_POST['linkw-title'], ENT_QUOTES, 'UTF-8') ));1430 $options['title'] = sanitize_text_field($_POST['linkw-title']); 1431 1431 update_option( 'lw_widget', $options ); 1432 1432 } … … 1444 1444 ?> 1445 1445 <p style="text-align:right; white-space:nowrap;"> 1446 <label for="linkw-title">Title: <input style="width: 200px;" id="linkw-title" name="linkw-title" type="text" value="<?php echo $title?>" /></label>1446 <label for="linkw-title">Title: <input style="width: 200px;" id="linkw-title" name="linkw-title" type="text" value="<?php echo esc_html($title) ?>" /></label> 1447 1447 </p> 1448 1448 <input type="hidden" id="linkw-submit" name="linkw-submit" value="1" /> -
linkworth-wp-plugin/trunk/lw_includes/LinkWorth_MU.php
r1748971 r2757457 75 75 @ini_set('default_socket_timeout', 10); 76 76 77 $lw_blog_string = @file_get_contents('http://www.linkworth.com/act/partner/code/plugin_feed.php?ping=1&web_id=' . LW_SITE_ID . '&hash=' . LW_SITE_HASH); 78 79 if($lw_blog_string) 80 { 81 update_site_option('lw_wpmu_blogs_waiting',1); 82 } 83 else 84 { 85 update_site_option('lw_wpmu_blogs_lastblogsupdate',time()-600); //Delay the update for 10 minutes incase of server issues. 86 } 77 $url = 'http://www.linkworth.com/act/partner/code/plugin_feed.php?ping=1&web_id=' . LW_SITE_ID . '&hash=' . LW_SITE_HASH; 78 79 $lw_blog_string = false; 80 $response = wp_remote_get($url); 81 $http_code = wp_remote_retrieve_response_code($response); 82 83 if ($http_code == '200') { 84 85 $lw_blog_string = wp_remote_retrieve_body($response); 86 87 if ($lw_blog_string) { 88 89 update_site_option('lw_wpmu_blogs_waiting',1); 90 91 } else { 92 93 update_site_option('lw_wpmu_blogs_lastblogsupdate',time()-600); //Delay the update for 10 minutes incase of server issues. 94 } 95 96 } else { 97 98 update_site_option('lw_wpmu_blogs_lastblogsupdate',time()-600); //Delay the update for 10 minutes incase of server issues. 99 } 87 100 } 88 101 } … … 99 112 @ini_set('default_socket_timeout', 10); 100 113 114 $lw_blog_string = false; 115 101 116 //PREVENT FUNCTION CALL IF CONSTANTS ARE NOT SET 102 if(defined('LW_SITE_ID') && defined('LW_SITE_HASH')) 103 { 104 $$lw_debug_information .= 'http://www.linkworth.com/act/partner/code/plugin_feed.php?web_id=' . LW_SITE_ID . '&hash=' . LW_SITE_HASH . '&format=xml&wpmu=1++'; 105 $lw_blog_string = @file_get_contents('http://www.linkworth.com/act/partner/code/plugin_feed.php?web_id=' . LW_SITE_ID . '&hash=' . LW_SITE_HASH . '&format=xml&wpmu=1'); 106 } 107 else 108 { 117 if (defined('LW_SITE_ID') && defined('LW_SITE_HASH')) { 118 119 $url = 'http://www.linkworth.com/act/partner/code/plugin_feed.php?web_id=' . LW_SITE_ID . '&hash=' . LW_SITE_HASH . '&format=xml&wpmu=1'; 120 121 $$lw_debug_information .= $url . '++'; 122 123 $response = wp_remote_get($url); 124 $http_code = wp_remote_retrieve_response_code($response); 125 126 if ($http_code == '200') { 127 128 $lw_blog_string = wp_remote_retrieve_body($response); 129 130 if ($lw_blog_string) { 131 132 update_site_option('lw_wpmu_blogs_waiting',1); 133 } 134 } 135 136 } else { 137 109 138 $lw_debug_information .= 'Constant not set++'; 110 139 } -
linkworth-wp-plugin/trunk/lw_includes/LinkWorth_admin.php
r2754259 r2757457 174 174 ?> 175 175 <div id="message" class="updated fade"> 176 <p><strong>Your host doesn't support <em> file_get_contents</em> or <em>curl</em>. Please ask your host to enable one or the other.</strong></p>176 <p><strong>Your host doesn't support <em>wp_remote_get</em> or <em>curl</em>. Please ask your host to enable one or the other.</strong></p> 177 177 </div> 178 178 <?php … … 218 218 <tr> 219 219 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;">Does your theme have a sidebar?</td> 220 <td><input type="radio" name="lw_ops[lw_sidebar]" id="lw_sidebar-no" value="0" <?php if(!isset($lw_sidebar) || $lw_sidebar == 0) { echo "checked='checked' "; }?>/><label for="lw_sidebar-no"> No </label></td>221 <td><input type="radio" name="lw_ops[lw_sidebar]" id="lw_sidebar-yes" value="1" <?php if($lw_sidebar == 1) { echo "checked='checked' "; }?>/><label for="lw_sidebar-yes"> Yes </label></td>220 <td><input type="radio" name="lw_ops[lw_sidebar]" id="lw_sidebar-no" value="0" <?php if(!isset($lw_sidebar) || $lw_sidebar == 0) { echo esc_attr("checked='checked' "); }?>/><label for="lw_sidebar-no"> No </label></td> 221 <td><input type="radio" name="lw_ops[lw_sidebar]" id="lw_sidebar-yes" value="1" <?php if($lw_sidebar == 1) { echo esc_attr("checked='checked' "); }?>/><label for="lw_sidebar-yes"> Yes </label></td> 222 222 </tr> 223 223 <tr> 224 224 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;">Display deals using the widget?</td> 225 <td><input type="radio" name="lw_ops[lw_sidebarwidget]" id="lw_sidebarwidget-no" value="0" <?php if(!isset($lw_sidebarwidget) || $lw_sidebarwidget == 0) { echo "checked='checked' "; }?>/><label for="lw_sidebar-no"> No </label></td>226 <td><input type="radio" name="lw_ops[lw_sidebarwidget]" id="lw_sidebarwidget-yes" value="1" <?php if($lw_sidebarwidget == 1) { echo "checked='checked' "; }?>/><label for="lw_sidebar-yes"> Yes </label></td>225 <td><input type="radio" name="lw_ops[lw_sidebarwidget]" id="lw_sidebarwidget-no" value="0" <?php if(!isset($lw_sidebarwidget) || $lw_sidebarwidget == 0) { echo esc_attr("checked='checked' "); }?>/><label for="lw_sidebar-no"> No </label></td> 226 <td><input type="radio" name="lw_ops[lw_sidebarwidget]" id="lw_sidebarwidget-yes" value="1" <?php if($lw_sidebarwidget == 1) { echo esc_attr("checked='checked' "); }?>/><label for="lw_sidebar-yes"> Yes </label></td> 227 227 </tr> 228 228 <tr> 229 229 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;">Display styled links?</td> 230 <td><input type="radio" name="lw_ops[lw_linktype]" id="lw_regular" onchange="jQuery('#colors').fadeOut('slow');" value="0" <?php if (!isset($lw_linktype) || $lw_linktype == 0) { echo "checked='checked' "; }?>/><label for="lw_regular"> No </label></td>231 <td><input type="radio" name="lw_ops[lw_linktype]" id="lw_cloud" onchange="jQuery('#colors').fadeIn('slow').css('display', 'inline-block');" value="1" <?php if ($lw_linktype == 1) { echo "checked='checked' "; }?>/><label for="lw_cloud"> Yes </label></td>230 <td><input type="radio" name="lw_ops[lw_linktype]" id="lw_regular" onchange="jQuery('#colors').fadeOut('slow');" value="0" <?php if (!isset($lw_linktype) || $lw_linktype == 0) { echo esc_attr("checked='checked' "); }?>/><label for="lw_regular"> No </label></td> 231 <td><input type="radio" name="lw_ops[lw_linktype]" id="lw_cloud" onchange="jQuery('#colors').fadeIn('slow').css('display', 'inline-block');" value="1" <?php if ($lw_linktype == 1) { echo esc_attr("checked='checked' "); }?>/><label for="lw_cloud"> Yes </label></td> 232 232 </tr> 233 233 <?php … … 242 242 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;"> Allow WPMU sub blogs manage their own id and hashes?</td> 243 243 <td colspan="2"> 244 <input type="checkbox" value="1" name="lw_ops[user_managed]" id="user_managed" <?php if(isset($user_managed) && $user_managed == 1){echo "checked='checked' ";}?>/>244 <input type="checkbox" value="1" name="lw_ops[user_managed]" id="user_managed" <?php if(isset($user_managed) && $user_managed == 1){echo esc_attr("checked='checked' ");}?>/> 245 245 </td> 246 246 </tr> … … 248 248 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;"> What is <span style="color:#FF0000;">MAIN</span> website's ID?</td> 249 249 <td colspan="2"> 250 <input type="text" name="lw_ops[site_id]" size="10" id="site_id" value="<?php if(defined('LW_SITE_ID')){echo LW_SITE_ID;} ?>"/>250 <input type="text" name="lw_ops[site_id]" size="10" id="site_id" value="<?php if(defined('LW_SITE_ID')){echo esc_html(LW_SITE_ID);} ?>"/> 251 251 </td> 252 252 </tr> … … 254 254 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;"> What is <span style="color:#FF0000;">MAIN</span> website's HASH ID?</td> 255 255 <td colspan="2"> 256 <input type="text" name="lw_ops[site_hash]" size="35" id="site_hash" value="<?php if(defined('LW_SITE_HASH')){echo LW_SITE_HASH;} ?>"/>256 <input type="text" name="lw_ops[site_hash]" size="35" id="site_hash" value="<?php if(defined('LW_SITE_HASH')){echo esc_html(LW_SITE_HASH);} ?>"/> 257 257 </td> 258 258 </tr> … … 260 260 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;"> What is THIS website's ID?</td> 261 261 <td colspan="2"> 262 <input type="text" name="lw_ops[website_id]" size="10" id="website_id" value="<?php if(defined('LW_WEBSITE_ID')) { echo LW_WEBSITE_ID; } ?>"/>262 <input type="text" name="lw_ops[website_id]" size="10" id="website_id" value="<?php if(defined('LW_WEBSITE_ID')) { echo esc_html(LW_WEBSITE_ID); } ?>"/> 263 263 </td> 264 264 </tr> … … 266 266 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;"> What is THIS website's HASH ID?</td> 267 267 <td colspan="2"> 268 <input type="text" name="lw_ops[website_hash]" size="35" id="website_hash" value="<?php if(defined('LW_HASH')) { echo LW_HASH; } ?>"/>268 <input type="text" name="lw_ops[website_hash]" size="35" id="website_hash" value="<?php if(defined('LW_HASH')) { echo esc_html(LW_HASH); } ?>"/> 269 269 </td> 270 270 </tr> … … 284 284 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;"> What is THIS website's SITE ID?</td> 285 285 <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 esc_attr($disabled_option) ?> />286 <input type="text" name="lw_ops[website_id]" size="10" id="website_id" value="<?php if(defined('LW_WEBSITE_ID')) { echo esc_html(LW_WEBSITE_ID); } ?>"<?php echo esc_attr($disabled_option) ?> /> 287 287 </td> 288 288 </tr> … … 290 290 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;"> What is THIS website's HASH ID?</td> 291 291 <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 esc_attr($disabled_option) ?> />292 <input type="text" name="lw_ops[website_hash]" size="35" id="website_hash" value="<?php if(defined('LW_HASH')) { echo esc_html(LW_HASH); } ?>"<?php echo esc_attr($disabled_option) ?> /> 293 293 </td> 294 294 </tr> … … 302 302 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;"> What is your website's ID?</td> 303 303 <td colspan="2"> 304 <input type="text" name="lw_ops[website_id]" size="10" id="website_id" value='<?php if(isset($website_id)) { echo $website_id; } ?>'/>304 <input type="text" name="lw_ops[website_id]" size="10" id="website_id" value='<?php if(isset($website_id)) { echo esc_html($website_id); } ?>'/> 305 305 </td> 306 306 </tr> … … 308 308 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;"> What is your website's HASH ID?</td> 309 309 <td colspan="2"> 310 <input type="text" name="lw_ops[website_hash]" size="35" id="website_hash" value='<?php if(isset($website_hash)) { echo $website_hash; } ?>'/>310 <input type="text" name="lw_ops[website_hash]" size="35" id="website_hash" value='<?php if(isset($website_hash)) { echo esc_html($website_hash); } ?>'/> 311 311 </td> 312 312 </tr> … … 317 317 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;"> Billboard ad base URL?</td> 318 318 <td colspan="2"> 319 <input type="text" name="lw_ops[billboard_base]" size="20" id="billboard_base" value='<?php if(isset($billboard_base)) { echo $billboard_base; } ?>'/>319 <input type="text" name="lw_ops[billboard_base]" size="20" id="billboard_base" value='<?php if(isset($billboard_base)) { echo esc_html($billboard_base); } ?>'/> 320 320 </td> 321 321 </tr> … … 375 375 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA; vertical-align:middle;">Font Size:</td> 376 376 <td> 377 <input name="lw_ops[lw_linksize]" value="<?php echo $lw_linksize ?>" style="width:90px;" /> <span style="font-weight:bold"><?php echo $lw_linkscale?></span>377 <input name="lw_ops[lw_linksize]" value="<?php echo esc_html($lw_linksize) ?>" style="width:90px;" /> <span style="font-weight:bold"><?php echo esc_html($lw_linkscale) ?></span> 378 378 </td> 379 379 </tr> … … 630 630 { 631 631 $wp_path_rel_to_home = str_replace($home, '', $siteurl); /* $siteurl - $home */ 632 $pos = strpos($_SERVER["SCRIPT_FILENAME"], $wp_path_rel_to_home); 633 $home_path = substr($_SERVER["SCRIPT_FILENAME"], 0, $pos); 632 $script_filename = htmlspecialchars($_SERVER["SCRIPT_FILENAME"], ENT_QUOTES, 'UTF-8'); 633 $pos = strpos($script_filename, $wp_path_rel_to_home); 634 $home_path = substr($script_filename, 0, $pos); 634 635 $home_path = trailingslashit( $home_path ); 635 636 } … … 664 665 <div id="message" class="updated fade"> 665 666 <p style="font-weight:bold;"> 666 Your theme has <?php echo $loop_count?> loop.667 Your theme has <?php echo esc_html($loop_count) ?> loop. 667 668 If you do not have a static page as your home page, your theme could be using more then one instance of 'The Loop.' 668 The number of loops could be higher then <?php echo $loop_count?>.669 The number of loops could be higher then <?php echo esc_html($loop_count) ?>. 669 670 </p> 670 671 </div> … … 675 676 ?> 676 677 <div id="message" class="updated fade"> 677 <p style="font-weight:bold;">Your theme has <?php echo $loop_count?> loop(s).</p>678 <p style="font-weight:bold;">Your theme has <?php echo esc_html($loop_count) ?> loop(s).</p> 678 679 </div> 679 680 <?php … … 709 710 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;"> Add rotating ads after what loop?</td> 710 711 <td> 711 <input type="text" name="lw_ops[loop_number]" size="5" id="loop_number" style="border:1px solid #406680; border-radius:0 0 0 0;" value='<?php if(isset($loop_number) && $loop_number > 0){ echo $loop_number; }?>'<?php echo $loop_option_disabled?> />712 <input type="text" name="lw_ops[loop_number]" size="5" id="loop_number" style="border:1px solid #406680; border-radius:0 0 0 0;" value='<?php if(isset($loop_number) && $loop_number > 0){ echo esc_html($loop_number); }?>'<?php echo esc_attr($loop_option_disabled) ?> /> 712 713 </td> 713 714 </tr> … … 733 734 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;"> Do not display ads after single page content?</td> 734 735 <td> 735 <input type="checkbox" value="1" name="lw_ops[nocontentads]" id="nocontentads" <?php if(isset($nocontentads) && $nocontentads == 1) { echo "checked='checked' "; }?>/>736 <input type="checkbox" value="1" name="lw_ops[nocontentads]" id="nocontentads" <?php if(isset($nocontentads) && $nocontentads == 1) { echo esc_attr("checked='checked' "); }?>/> 736 737 </td> 737 738 </tr> … … 739 740 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;"> Place LinkInTxt as Tags on single pages?</td> 740 741 <td> 741 <input type="checkbox" value="1" name="lw_ops[display_tagged]" <?php if(isset($display_tagged) && $display_tagged == 1) { echo "checked='checked' "; }?>/>742 <input type="checkbox" value="1" name="lw_ops[display_tagged]" <?php if(isset($display_tagged) && $display_tagged == 1) { echo esc_attr("checked='checked' "); }?>/> 742 743 </td> 743 744 </tr> … … 745 746 <td style="color:#333333; font-weight:bold; background-color:#EAF2FA;">Disable silent running?</td> 746 747 <td> 747 <input type="checkbox" value="1" name="lw_ops[disable_silent]" id="silent" <?php if(isset($disable_silent) && $disable_silent == 1) { echo "checked='checked' "; }?>/>748 <input type="checkbox" value="1" name="lw_ops[disable_silent]" id="silent" <?php if(isset($disable_silent) && $disable_silent == 1) { echo esc_attr("checked='checked' "); }?>/> 748 749 </td> 749 750 </tr>
Note: See TracChangeset
for help on using the changeset viewer.