Changeset 158918
- Timestamp:
- 09/29/2009 11:23:14 AM (16 years ago)
- Location:
- lj-longtail-seo/trunk
- Files:
-
- 2 edited
-
lj-longtail-seo.php (modified) (11 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lj-longtail-seo/trunk/lj-longtail-seo.php
r158509 r158918 5 5 Description: LJ Longtail SEO is a tool that detects search engine visits and uses this information to display a list of links based on second page search results 6 6 Author: Jon Smith 7 Version: 1. 27 Version: 1.3 8 8 Author URI: http://www.thelazysysadmin.net/ 9 9 */ … … 12 12 13 13 private $dbversion = "1.75"; 14 private $pluginversion = "1. 2";14 private $pluginversion = "1.3"; 15 15 16 16 private $defaults = array … … 20 20 'widget-numitems' => '5', 21 21 'daysbeforearchive' => '28', 22 'showdonate' => false 22 'showdonate' => false, 23 'showkeywordreport' => false 23 24 ); 24 25 … … 28 29 add_action('plugins_loaded', array(&$this, 'plugins_loaded')); 29 30 30 add_filter("wp_head", array(&$this, "checkreferrer")); 31 add_filter('wp_head', array(&$this, 'checkreferrer')); 32 add_filter('plugin_action_links', array(&$this, 'plugin_action_links'), 10, 2 ); 31 33 32 34 register_activation_hook(__FILE__, array(&$this, 'db_install')); … … 65 67 if ($query != false) { 66 68 $query = urldecode($query); 67 $query = preg_replace('/[^a-zA-Z0-9-\/. ]/', '', $query); 68 $query = ereg_replace("[ \t\n\r]+", " ", $query); 69 $query = $this->stripunwantedcharacters($query); 69 70 $query = strtolower($query); 70 71 $serpposition = $this->get_serpposition($arraylist); … … 74 75 } 75 76 } 77 } 78 79 function stripunwantedcharacters($string) { 80 $return = str_replace("'", '', $string); 81 $return = str_replace('"', '', $return); 82 $return = str_replace('+', '', $return); 83 $return = ereg_replace("[ \t\n\r]+", " ", $return); 84 $return = htmlspecialchars($return); 85 86 return $return; 76 87 } 77 88 … … 255 266 256 267 $links_archivedays = isset($_REQUEST['linksarchivedays']) ? $_REQUEST['linksarchivedays'] : 28; 268 $links_keywordreport = isset($_REQUEST['linkskeywordreport']) ? $_REQUEST['linkskeywordreport'] : 0; 257 269 $links_donate = isset($_REQUEST['linksdonate']) ? $_REQUEST['linksdonate'] : 0; 258 270 259 271 $options['daysbeforearchive'] = sprintf("%d", $links_archivedays); 272 $options['showkeywordreport'] = ($links_keywordreport == 1) ? true : false; 260 273 $options['showdonate'] = ($links_donate == 1) ? true : false; 261 274 … … 368 381 </table> 369 382 383 <?php 384 if ($options['showkeywordreport']) { 385 ?> 386 <h3>Keyword Report</h3> 387 <div class="clear"></div> 388 <style type="text/css"> 389 <!-- 390 .ljlongtailseo-box { 391 padding: 0px 0px 0px 25px; 392 } 393 .ljlongtailseo-section { 394 float: left; 395 } 396 .ljlongtailseo-section ul { 397 list-style-type: disc; 398 padding: 0px 15px 0px 0px; 399 } 400 .ljlongtailseo-section li { 401 margin-bottom: 0px; 402 } 403 .ljlongtailseo-section-next { 404 padding-left: 10px; 405 } 406 .ljlongtailseo-clear { 407 clear: both; 408 } 409 --> 410 </style> 411 <?php 412 413 $array = $this->getkeywordarray(); 414 415 echo "<div class='ljlongtailseo-box'>\n"; 416 417 $count = count($array); 418 419 if ($count > 100) { 420 $count = 100; 421 } 422 423 $mod = ceil($count / 4); 424 425 $i = 0; 426 foreach ($array as $item) { 427 if (($i % $mod) == 0) { 428 echo " <div class='ljlongtailseo-section"; 429 if ($i > 0) { 430 echo " ljlongtailseo-section-next"; 431 } 432 echo "'>\n"; 433 echo " <ul>\n"; 434 } 435 436 echo " <li>".$item['term']." (".$item['count'].")</li>\n"; 437 438 if ((($i+1) % $mod) == 0) { 439 echo " </ul>\n"; 440 echo " </div>\n"; 441 } 442 443 $i++; 444 445 if ($i >= $count) break; 446 } 447 448 if ((($i) % $mod) != 0) { 449 echo " </ul>\n"; 450 echo " </div>\n"; 451 } 452 453 echo "</div>\n"; 454 455 echo "<div class='ljlongtailseo-clear'></div>\n"; 456 457 } 458 ?> 370 459 <h3>Maintenance</h3> 371 460 <div class="clear"></div> … … 389 478 390 479 <td><input name="linksarchivedays" id="linksarchivedays" type="text" value="<?php echo $options['daysbeforearchive']; ?>" size="40" aria-required="true" /><br /> 391 <span class="description">Number of days before database records get marked as archived. Records marked as archive are not used for the widget display.</span></td> 480 <span class="description">Number of days before database records get marked as archived. Records marked as archived are not used for the widget display.</span></td> 481 </tr> 482 <tr valign="top"> 483 <th scope="row">Show Keyword Report</th> 484 <td><fieldset><legend class="screen-reader-text"><span>Show Keyword Report</span></legend> 485 <label for="linkskeywordreport"> 486 <input name="linkskeywordreport" type="checkbox" id="linkskeywordreport" value="1" <?php if ($options['showkeywordreport']) echo "checked='checked'"; ?> /> 487 To display a keyword report in the admin screen check this option.</label><br /> 488 </fieldset></td> 392 489 </tr> 393 490 <tr valign="top"> … … 426 523 427 524 } 525 526 function getkeywordarray() { 527 global $wpdb; 528 529 $table_name = $wpdb->prefix."ljlongtailseo"; 530 531 $sql = "SELECT query FROM $table_name WHERE archive = 0;"; 532 $results = $wpdb->get_results($sql, ARRAY_A); 533 534 $array = array(); 535 536 foreach ($results as $result) { 537 $terms = explode(' ', $result['query']); 538 foreach ($terms as $term) { 539 if (isset($array[$term])) { 540 $array[$term]["count"]++; 541 } else { 542 $array[$term]["count"] = 1; 543 $array[$term]["term"] = $term; 544 } 545 } 546 } 547 548 //arsort($array); 549 uasort($array, array(&$this, 'sort_terms')); 550 551 return $array; 552 } 553 554 function sort_terms($a, $b) { 555 return ($b['count'] - $a['count']); 556 } 428 557 429 558 function db_install() { … … 471 600 } 472 601 602 function plugin_action_links( $links, $file ) { 603 static $this_plugin; 604 605 if( empty($this_plugin) ) 606 $this_plugin = plugin_basename(__FILE__); 607 608 if ( $file == $this_plugin ) 609 $links[] = '<a href="' . admin_url( 'options-general.php?page=lj-longtail-seo/lj-longtail-seo.php' ) . '">Settings</a>'; 610 611 return $links; 612 } 473 613 } 474 614 -
lj-longtail-seo/trunk/readme.txt
r158509 r158918 1 1 === Plugin Name === 2 2 Contributors: littlejon 3 Tags: serp, position, longtail, long tail, results, google, bing, yahoo, SEO, widget, sidebar 3 Tags: serp, position, longtail, long tail, results, google, bing, yahoo, SEO, widget, sidebar, keywords, keyword 4 4 Requires at least: 2.5 5 5 Tested up to: 2.8.4 6 6 Donate link: http://www.thelazysysadmin.net/software/appreciation/ 7 Stable tag: 1. 27 Stable tag: 1.3 8 8 9 9 LJ Longtail SEO is a tool that detects search engine visits and uses this information to display a list of links based on second page search results … … 14 14 15 15 The results in the database are aged off based on customizable settings so that once your longtail keywords have been boosted they will fall off the list and give way for other searches. 16 17 Admin interface has an optional keyword report that can be turned on via an option (On a large blog it is possible that there could be a performance hit on the admin page when using this option. Please note this will not slow down the blog side, just the admin page.). The keyword report will show the Top 100 keywords ordered by popularity and also showing the number of times the keyword has occurred. 16 18 17 19 A widget will display a list of the popular searches that have come from search engine result pages beyond the first and provide a link on your sidebar back to the pages found. … … 48 50 == Changelog == 49 51 52 = 1.3 = 53 54 * Added support for international characters 55 * Added keyword report section in admin interface 56 50 57 = 1.2 = 51 58
Note: See TracChangeset
for help on using the changeset viewer.