Changeset 1000579
- Timestamp:
- 10/02/2014 12:00:38 PM (11 years ago)
- Location:
- broken-link-manager/trunk
- Files:
-
- 13 edited
-
config/class/broken_url.php (modified) (4 diffs)
-
config/class/log_url.php (modified) (2 diffs)
-
config/class/redirected_url.php (modified) (3 diffs)
-
config/functions.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
wblm-broken-url.php (modified) (3 diffs)
-
wblm-dashboard.php (modified) (2 diffs)
-
wblm-redirect-url.php (modified) (3 diffs)
-
wblm-settings.php (modified) (3 diffs)
-
wblm-url-add.php (modified) (2 diffs)
-
wblm-url-edit.php (modified) (2 diffs)
-
wblm-url-log.php (modified) (3 diffs)
-
wblm.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
broken-link-manager/trunk/config/class/broken_url.php
r998351 r1000579 82 82 function inline_editor() { 83 83 return ' 84 <form method="post" action="admin.php?page=wblm-broken&editURL=on">85 <input type="hidden" value="%s" name="url">86 <input type="hidden" value="old" name="type">87 <input type="hidden" value="%s" name="rpage">88 84 <div class="blc-inline-editor-content"> 89 85 <label> 90 86 <span class="title">URL</span> 91 <span><input type="text" placeholder="http://" name="new_url " value="" class="wblm-table-add-field" /></span>87 <span><input type="text" placeholder="http://" name="new_url%s" value="" class="wblm-table-add-field" /></span> 92 88 </label> 93 < input type="submit" class="button-primary save alignright" value="Add" />89 <button type="submit" class="button-primary save alignright" name="urlAdd" value="%s">Add</button> 94 90 <div class="clear"></div> 95 </div> 96 </form>'; 91 </div>'; 97 92 } 98 93 … … 108 103 109 104 function column_new_url($item){ 110 $rpage = isset($_GET['page']) ? 'page=' . $_GET['page'] : 'page=wblm-broken';111 $rpage .= isset($_GET['orderby']) ? '&orderby=' . $_GET['orderby'] : null;112 $rpage .= isset($_GET['order']) ? '&order=' . $_GET['order'] : null;113 $rpage .= isset($_GET['paged']) ? '&paged=' . $_GET['paged'] : null;114 $rpage .= isset($_GET['s']) ? '&s=' . $_GET['s'] : null;115 105 $actions = array( 116 'add_url' => sprintf($this->inline_editor() ,$item['id'],$ rpage),106 'add_url' => sprintf($this->inline_editor() ,$item['id'],$item['id']), 117 107 ); 118 108 return sprintf('%1$s %2$s', $item['new_url'], $this->row_actions($actions) ); 119 109 } 120 110 111 121 112 function get_bulk_actions() { 122 113 $actions = array( 123 'delete' => 'Delete' 114 'delete' => 'Delete URL (URLs and URLs LOG)', 115 'deleteLog' => 'Delete only URL LOG' 124 116 ); 125 117 return $actions; … … 129 121 return sprintf('<input type="checkbox" name="url[]" value="%s" />', $item['id']); 130 122 } 131 123 124 function process_bulk_action() { 125 $url = null; 126 if( 'delete'===$this->current_action() ) { 127 foreach($_POST['url'] as $url) { 128 global $wpdb; 129 $wpdb->query("DELETE FROM " . TABLE_WBLM . " WHERE id = $url"); 130 $wpdb->query("DELETE FROM " . TABLE_WBLM_LOG . " WHERE url = $url"); 131 } 132 }elseif( 'deleteLog'===$this->current_action() ) { 133 foreach($_POST['url'] as $url) { 134 global $wpdb; 135 $wpdb->query("DELETE FROM " . TABLE_WBLM_LOG . " WHERE url = $url"); 136 } 137 } 138 139 $urlAdd = isset($_REQUEST['urlAdd']) ? $_REQUEST['urlAdd'] : null; 140 if($urlAdd){ 141 global $wpdb; 142 $new_url = isset($_REQUEST['new_url'.$urlAdd]) ? $_REQUEST['new_url'.$urlAdd] : null; 143 $wpdb->query("UPDATE " . TABLE_WBLM . " SET `new_url` = '$new_url', `active` = '1' WHERE id = '$urlAdd'"); 144 } 145 146 147 148 149 } 150 132 151 133 152 function prepare_items($search=''){ … … 141 160 142 161 $this->_column_headers = array($columns, $hidden, $sortable); 162 $this->process_bulk_action(); 143 163 144 164 $paged = isset($_REQUEST['paged']) ? max(0, intval($_REQUEST['paged']) - 1) : 0; -
broken-link-manager/trunk/config/class/log_url.php
r998351 r1000579 140 140 141 141 function column_cb($item) { 142 return sprintf( 143 '<input type="checkbox" name="url[]" value="%s" />', $item['id'] 144 ); 145 } 142 return sprintf('<input type="checkbox" name="log[]" value="%s" />', $item['id']); 143 } 144 145 146 function process_bulk_action() { 147 $url = null; 148 if( 'delete'===$this->current_action() ) { 149 foreach($_POST['log'] as $log) { 150 global $wpdb; 151 $wpdb->query("DELETE FROM " . TABLE_WBLM_LOG . " WHERE id = $log"); 152 } 153 } 154 } 155 156 146 157 147 158 function prepare_items($url='',$search=''){ … … 155 166 156 167 $this->_column_headers = array($columns, $hidden, $sortable); 168 $this->process_bulk_action(); 157 169 158 170 $paged = isset($_REQUEST['paged']) ? max(0, intval($_REQUEST['paged']) - 1) : 0; -
broken-link-manager/trunk/config/class/redirected_url.php
r998351 r1000579 88 88 function get_bulk_actions() { 89 89 $actions = array( 90 'delete' => 'Delete' 90 'delete' => 'Delete URL (URLs and URLs LOG)', 91 'deleteLog' => 'Delete only URL LOG' 91 92 ); 92 93 return $actions; … … 96 97 return sprintf('<input type="checkbox" name="url[]" value="%s" />', $item['id']); 97 98 } 99 100 function process_bulk_action() { 101 $url = null; 102 if( 'delete'===$this->current_action() ) { 103 foreach($_POST['url'] as $url) { 104 global $wpdb; 105 $wpdb->query("DELETE FROM " . TABLE_WBLM . " WHERE id = $url"); 106 $wpdb->query("DELETE FROM " . TABLE_WBLM_LOG . " WHERE url = $url"); 107 } 108 }elseif( 'deleteLog'===$this->current_action() ) { 109 foreach($_POST['url'] as $url) { 110 global $wpdb; 111 $wpdb->query("DELETE FROM " . TABLE_WBLM_LOG . " WHERE url = $url"); 112 } 113 } 114 } 115 98 116 99 117 function prepare_items($search=''){ … … 107 125 108 126 $this->_column_headers = array($columns, $hidden, $sortable); 127 $this->process_bulk_action(); 109 128 110 129 $paged = isset($_REQUEST['paged']) ? max(0, intval($_REQUEST['paged']) - 1) : 0; -
broken-link-manager/trunk/config/functions.php
r998351 r1000579 50 50 _e('Updated ', 'wblm'); 51 51 52 echo '<script type="text/javascript">53 window.location="'. admin_url("admin.php?$page"). '";54 </script>';52 //echo '<script type="text/javascript"> 53 //window.location="'. admin_url("admin.php?$page"). '"; 54 //</script>'; 55 55 } 56 56 … … 94 94 } 95 95 96 function get_wblmFooter(){ 97 echo '<div class="navbar navbar-default" id="footer" role="footer">© All rights reserved, <a target="_blank" href="http://k-78.de">K78 Let`s do more</a> and <a target="_blank" href="http://beqo.de">BEQO</a> ver. <?php echo WBLM_VERSION; ?></div>'; 98 } 99 100 function get_wblmTopNavi(){ 101 $topNavi =' 102 <ul class="nav navbar-top-links navbar-right"> 103 <li class="dropdown"> 104 <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-tasks fa-fw"></i> <i class="fa fa-caret-down"></i></a> 105 <ul class="dropdown-menu dropdown-user"> 106 <li><a href="%s"><div><i class="fa fa-area-chart fa-fw"></i> Dashboard</div></a></li> 107 <li class="divider"></li> 108 <li><a href="%s"><div><i class="fa fa-link fa-fw"></i> Redirect URLs</div></a></li> 109 <li class="divider"></li> 110 <li><a href="%s"><div><i class="fa fa-unlink fa-fw"></i> Broken URLs</div></a></li> 111 <li class="divider"></li> 112 <li><a href="%s"><div><i class="fa fa-plus fa-fw"></i> Add URLs</div></a></li> 113 <li class="divider"></li> 114 <li><a href="%s"><div><i class="fa fa-list-alt fa-fw"></i> Log</div></a></li> 115 <li class="divider"></li> 116 <li><a class="text-center" href="%s"><i class="fa fa-cogs "></i> 117 <strong>Settings</strong></a></li> 118 </ul> 119 </li> 120 </ul>'; 121 printf($topNavi, admin_url("admin.php?page=wblm-dashboard"), admin_url("admin.php?page=wblm-redirect"), admin_url("admin.php?page=wblm-broken"), admin_url("admin.php?page=wblm-add-url"), admin_url("admin.php?page=wblm-log"), admin_url("admin.php?page=wblm-settings")); 122 } 123 124 96 125 if($settingsSaveFunc){ wpslSettingsSave(); } 97 126 if($editURLFunc){ wpslEditURL(); } -
broken-link-manager/trunk/readme.txt
r998351 r1000579 4 4 Requires at least: 3.0 5 5 Tested up to: 4.0 6 Stable tag: 0. 2.96 Stable tag: 0.3.0 7 7 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8NYR3F4RVTBHS 8 8 … … 16 16 17 17 > <strong>SEO Friendly</strong><br> 18 > Method 301, as recommended by Google, is used in the routing process. Thus, you will not suffer from loss by broken links in terms of SEO. 18 > Method 301, as recommended by Google, is used in the routing process. Thus, you will not suffer from loss by broken links in terms of SEO.<br> 19 19 > [Click here for more information about 301 redirect](https://support.google.com/webmasters/answer/93633?hl=en) 20 20 … … 40 40 41 41 == Changelog == 42 43 = 0.3.0 = 44 * wp_debug_log warnings were organized. 45 * Added Bulk delete feature 46 * Added Bulk delete feature for LOG 47 * Added menu icon 48 * Beta version now ended 42 49 43 50 = 0.2.9 BETA = -
broken-link-manager/trunk/wblm-broken-url.php
r997783 r1000579 16 16 <div class="row"> 17 17 <div class="col-lg-12"> 18 <h3 class="page-header"> Broken URLs</h3>19 <?php include WBLM_CONFIG_PATH . 'topnavi.php'; ?>18 <h3 class="page-header"><?php _e('Broken URLs', 'wblm') ?></h3> 19 <?php get_wblmTopNavi(); ?> 20 20 </div> 21 21 <!-- /.col-lg-12 --> … … 37 37 <div class="panel-body"> 38 38 <div class="table-responsive"> 39 <form action="<?php echo admin_url('admin.php?page=wblm-broken'); ?>" id="wpse-list-table-form" method="post"> 39 40 <?php $WblmListTable->display(); ?> 41 </form> 40 42 </div> 41 43 <!-- /.table-responsive --> … … 49 51 </div> 50 52 <!-- /#page-wrapper --> 51 <?php include WBLM_CONFIG_PATH . 'footer.php'; ?>53 <?php get_wblmFooter(); ?> 52 54 </div> -
broken-link-manager/trunk/wblm-dashboard.php
r997783 r1000579 20 20 <div class="col-lg-12"> 21 21 <h1 class="page-header"><?php _e('Dashboard', 'wblm') ?></h1> 22 <?php include WBLM_CONFIG_PATH . 'topnavi.php'; ?>22 <?php get_wblmTopNavi(); ?> 23 23 </div> 24 <!-- /.col-lg-12 -->25 24 </div> 26 25 <!-- /.row --> … … 170 169 </div> 171 170 <!-- /#page-wrapper --> 172 <?php include WBLM_CONFIG_PATH . 'footer.php'; ?>171 <?php get_wblmFooter(); ?> 173 172 </div> 174 173 <!-- /#wrapper --> -
broken-link-manager/trunk/wblm-redirect-url.php
r997783 r1000579 17 17 <div class="col-lg-12"> 18 18 <h3 class="page-header"><?php _e('Redirected URLs', 'wblm') ?></h3> 19 <?php include WBLM_CONFIG_PATH . 'topnavi.php'; ?>19 <?php get_wblmTopNavi(); ?> 20 20 </div> 21 21 <!-- /.col-lg-12 --> … … 35 35 <div class="panel-body"> 36 36 <div class="table-responsive"> 37 <form action="<?php echo admin_url('admin.php?page=wblm-redirect'); ?>" id="wpse-list-table-form" method="post"> 37 38 <?php $WblmListTable->display(); ?> 39 </form> 38 40 </div> 39 41 <!-- /.table-responsive --> … … 47 49 </div> 48 50 <!-- /#page-wrapper --> 49 <?php include WBLM_CONFIG_PATH . 'footer.php'; ?>51 <?php get_wblmFooter(); ?> 50 52 </div> -
broken-link-manager/trunk/wblm-settings.php
r997315 r1000579 7 7 </a> 8 8 </div> 9 <!-- /.navbar-header -->10 9 </nav> 11 10 … … 14 13 <div class="col-lg-12"> 15 14 <h3 class="page-header"><?php _e('Settings', 'wblm') ?></h3> 16 <?php include WBLM_CONFIG_PATH . 'topnavi.php'; ?>15 <?php get_wblmTopNavi(); ?> 17 16 </div> 18 17 <!-- /.col-lg-12 --> 19 18 </div> 20 <!-- /.row -->21 22 19 <form class="form-horizontal" role="form" action="admin.php?page=wblm-settings&settingsSave=on" method="post"> 23 24 25 20 <!-- General Settings --> 26 21 <div class="row"> … … 214 209 </div> 215 210 <!-- /#page-wrapper --> 216 <?php include WBLM_CONFIG_PATH . 'footer.php'; ?>211 <?php get_wblmFooter(); ?> 217 212 </div> 218 213 <!-- /#wrapper --> -
broken-link-manager/trunk/wblm-url-add.php
r997783 r1000579 11 11 <div id="page-wrapper"> 12 12 <div class="row"> 13 <div class="col-lg-12"><h3 class="page-header"><?php _e('Add URL', 'wblm') ?></h3><?php include WBLM_CONFIG_PATH . 'topnavi.php'; ?></div> 14 <!-- /.col-lg-12 --> 13 <div class="col-lg-12"><h3 class="page-header"><?php _e('Add URL', 'wblm') ?></h3><?php get_wblmTopNavi(); ?></div> 15 14 </div> 16 15 <!-- /.row --> … … 52 51 </div> 53 52 <!-- /#page-wrapper --> 54 <?php include WBLM_CONFIG_PATH . 'footer.php'; ?>53 <?php get_wblmFooter(); ?> 55 54 </div> 56 55 <!-- /#wrapper --> -
broken-link-manager/trunk/wblm-url-edit.php
r997315 r1000579 17 17 <div class="row"> 18 18 <div class="col-lg-12"> 19 <h3 class="page-header"><?php _e('Edit URL', 'wblm') ?></h3><?php include WBLM_CONFIG_PATH . 'topnavi.php'; ?> 19 <h3 class="page-header"><?php _e('Edit URL', 'wblm') ?></h3> 20 <?php get_wblmTopNavi(); ?> 20 21 </div> 21 22 <!-- /.col-lg-12 --> … … 62 63 </div> 63 64 <!-- /#page-wrapper --> 64 <?php include WBLM_CONFIG_PATH . 'footer.php'; ?>65 <?php get_wblmFooter(); ?> 65 66 </div> 66 67 <!-- /#wrapper --> -
broken-link-manager/trunk/wblm-url-log.php
r997783 r1000579 18 18 <div class="col-lg-12"> 19 19 <h3 class="page-header">LOG</h3> 20 <?php include WBLM_CONFIG_PATH . 'topnavi.php'; ?>20 <?php get_wblmTopNavi(); ?> 21 21 </div> 22 22 <!-- /.col-lg-12 --> … … 37 37 <div class="panel-body"> 38 38 <div class="table-responsive"> 39 <?php $WblmListTable->display(); ?> 39 <form action="<?php echo admin_url('admin.php?page=wblm-log'); ?>" id="wpse-list-table-form" method="post"> 40 <?php $WblmListTable->display(); ?> 41 </form> 40 42 </div> 41 43 <!-- /.table-responsive --> … … 49 51 </div> 50 52 <!-- /#page-wrapper --> 51 <?php include WBLM_CONFIG_PATH . 'footer.php'; ?>53 <?php get_wblmFooter(); ?> 52 54 </div> -
broken-link-manager/trunk/wblm.php
r998351 r1000579 4 4 Plugin URI: https://wordpress.org/plugins/broken-link-manager 5 5 Description: WBLM -> Wordpress Broken Link Manager. This plugin helps you check, organise and monitor your broken backlinks. 6 Version: 0. 2.96 Version: 0.3.0 7 7 Author: Hüseyin Kocak 8 8 Author URI: http://k-78.de … … 25 25 along with this program. If not, see <http://www.gnu.org/licenses/>. 26 26 */ 27 if(!defined('WBLM_VERSION')) { 28 define( 'WBLM_VERSION', '0.2.9' ); 29 } 27 if ( ! function_exists( 'get_plugins' ) ) { 28 require_once ABSPATH . 'wp-admin/includes/plugin.php'; 29 } 30 $get_wblm = get_plugin_data(__FILE__); 30 31 if(!defined('WBLM_PLUGIN_PATH')) { 31 32 define( 'WBLM_PLUGIN_PATH', trailingslashit( dirname( __FILE__ ) ) ); 32 33 } 34 if(!defined('WBLM_VERSION')) { 35 define( 'WBLM_VERSION', $get_wblm['Version'] ); 36 } 33 37 if(!defined('WBLM_CONFIG_PATH')) { 34 38 define( 'WBLM_CONFIG_PATH', WBLM_PLUGIN_PATH . 'config/' ); … … 41 45 } 42 46 if(!defined('WBLM_NAME')) { 43 define( 'WBLM_NAME', 'BROKEN LINK MANAGER' ); 47 define( 'WBLM_NAME', strtoupper($get_wblm['Name']) ); 48 } 49 if(!defined('WBLM_ICON')) { 50 define( 'WBLM_ICON', $get_wblm['AuthorURI'].'/wblm/icon.png?ver='.WBLM_VERSION ); 44 51 } 45 52 global $wpdb; … … 84 91 wp_enqueue_script( 'wblm-morris', plugins_url( '/js/plugins/morris/morris.min.js', __FILE__ ), array('jquery', 'wblm-bootstrap', 'wblm-raphael'), null, true ); 85 92 wp_enqueue_script( 'wblm-dashboard-data', plugins_url( '/js/dashboard.php', __FILE__ ), array('jquery', 'wblm-bootstrap', 'wblm-raphael', 'wblm-morris'), null, true ); 86 }87 function wblm_menu(){88 include 'wblm-admin.php';89 93 } 90 94 function menuDashboardFunc(){ … … 135 139 $wpdb->query($sql_wblm_log); 136 140 /************************************************************************************* 137 * LOG KLASORU(SIMDILIK SADECE KLASOR OLUSTURULUYOR)141 * LOG PATH (SIMDILIK SADECE KLASOR OLUSTURULUYOR) 138 142 *************************************************************************************/ 139 143 $log_dir = WBLM_PLUGIN_PATH.'/log'; … … 217 221 global $wpdb; 218 222 if ( $wp_query->is_404() ){ 219 $current_time = current_time( 'mysql' ); 220 221 $referer = $_SERVER['HTTP_REFERER']; 222 if (!$referer){$referer = 'Direct';} 223 $useragent = $_SERVER['HTTP_USER_AGENT']; 224 $ip = $_SERVER['REMOTE_ADDR']; 225 $admin_email = get_option('admin_email'); 226 227 $https = isset($_SERVER[HTTPS]) ? $_SERVER[HTTPS] : null; 228 $brokenUrl = 'http' . $https . '://' . $_SERVER[HTTP_HOST] . $_SERVER[REQUEST_URI]; 229 230 $url_check = $wpdb->get_row("SELECT * FROM " . TABLE_WBLM . " WHERE old_url = '$brokenUrl' limit 1"); 231 $urlID = $url_check->id; 232 233 if($url_check->old_url){ 234 if(SAVE_URL_STATS){ 235 $urlHit = $url_check->hit + 1; 236 $wpdb->query("UPDATE " . TABLE_WBLM . " SET `hit` = '$urlHit' WHERE id = '$urlID'"); 237 } 238 if($url_check->new_url){ 239 $redirectedUrl = $url_check->new_url; 223 $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'Direct'; 224 $useragent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null; 225 $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null; 226 $current_time = current_time('mysql'); 227 $https = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : null; 228 $brokenUrl = 'http' . $https . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 229 230 $url_check = $wpdb->get_row("SELECT * FROM " . TABLE_WBLM . " WHERE old_url = '$brokenUrl' limit 1"); 231 $urlID = isset($url_check->id) ? $url_check->id : null; 232 233 if($urlID){ 234 if(SAVE_URL_STATS){ 235 $urlHit = $url_check->hit + 1; 236 $wpdb->query("UPDATE " . TABLE_WBLM . " SET `hit` = '$urlHit' WHERE id = '$urlID'"); 237 } 238 if($url_check->new_url){ 239 $redirectedUrl = $url_check->new_url; 240 }else{ 241 $redirectedUrl = 0; 242 if(SAVE_URL_LOG){ 243 if(REDIRECT_DEFAULT_URL){$http_statu = 301;}else{$http_statu = 404;} 244 $wpdb->query("INSERT INTO " . TABLE_WBLM_LOG . " (`url`, `date`, `referer`, `useragent`, `ip`, `broken`, `http_statu`) VALUES ('$urlID', '$current_time', '$referer', '$useragent', '$ip', '1', '$http_statu')"); 245 }//SAVE_URL_LOG 246 } 240 247 }else{ 241 248 $redirectedUrl = 0; 242 if(SAVE_URL_LOG){ 243 if(REDIRECT_DEFAULT_URL){$http_statu = 301;}else{$http_statu = 404;} 244 $wpdb->query("INSERT INTO " . TABLE_WBLM_LOG . " (`url`, `date`, `referer`, `useragent`, `ip`, `broken`, `http_statu`) VALUES ('$urlID', '$current_time', '$referer', '$useragent', '$ip', '1', '$http_statu')"); 245 }//SAVE_URL_LOG 249 if(SAVE_BROKEN_URLS){ 250 $wpdb->query("INSERT INTO " . TABLE_WBLM . " (`old_url`, `hit`) VALUES ('$brokenUrl', '1')"); 251 if(SAVE_URL_LOG){ 252 if(REDIRECT_DEFAULT_URL){$http_statu = 301;}else{$http_statu = 404;} 253 $newUrl = $wpdb->get_row("SELECT id FROM " . TABLE_WBLM . " where `old_url` = '$brokenUrl'"); 254 $newUrlID = $newUrl->id; 255 $wpdb->query("INSERT INTO " . TABLE_WBLM_LOG . " (`url`, `date`, `referer`, `useragent`, `ip`, `broken`, `http_statu`) VALUES ('$newUrlID', '$current_time', '$referer', '$useragent', '$ip', '1', '$http_statu')"); 256 }//SAVE_URL_LOG 257 }//SAVE_BROKEN_URLS 246 258 } 247 }else{ 248 $redirectedUrl = 0; 249 if(SAVE_BROKEN_URLS){ 250 $wpdb->query("INSERT INTO " . TABLE_WBLM . " (`old_url`, `hit`) VALUES ('$brokenUrl', '1')"); 251 if(SAVE_URL_LOG){ 252 if(REDIRECT_DEFAULT_URL){$http_statu = 301;}else{$http_statu = 404;} 253 $newUrl = $wpdb->get_row("SELECT id FROM " . TABLE_WBLM . " where `old_url` = '$brokenUrl'"); 254 $newUrlID = $newUrl->id; 255 $wpdb->query("INSERT INTO " . TABLE_WBLM_LOG . " (`url`, `date`, `referer`, `useragent`, `ip`, `broken`, `http_statu`) VALUES ('$newUrlID', '$current_time', '$referer', '$useragent', '$ip', '1', '$http_statu')"); 256 }//SAVE_URL_LOG 257 }//SAVE_BROKEN_URLS 258 } 259 259 260 if ($redirectedUrl){ 260 261 if(SAVE_URL_LOG){ … … 287 288 } 288 289 function createBaclinksMenu() { 289 $menu_wblm_dashboard = add_menu_page("Backlinks", "Backlinks", 'manage_options', "wblm-dashboard", "menuDashboardFunc" );290 $menu_wblm_dashboard = add_menu_page("Backlinks", "Backlinks", 'manage_options', "wblm-dashboard", "menuDashboardFunc", WBLM_ICON); 290 291 $menu_wblm_redirecturl = add_submenu_page("wblm-dashboard", "Redirected URLs", "Redirected URLs", 'manage_options', "wblm-redirect", "menuRedirectUrlFunc"); 291 292 $menu_wblm_brokenurl = add_submenu_page("wblm-dashboard", "Broken URLs", "Broken URLs", 'manage_options', "wblm-broken", "menuBrokenUrlFunc");
Note: See TracChangeset
for help on using the changeset viewer.