Changeset 2011075
- Timestamp:
- 01/12/2019 08:57:21 AM (7 years ago)
- Location:
- wp-slack-logbot/trunk
- Files:
-
- 3 edited
-
class-wp-slack-logbot.php (modified) (5 diffs)
-
includes/class-slack-logbot.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-slack-logbot/trunk/class-wp-slack-logbot.php
r2000958 r2011075 8 8 * Text Domain: wp-slack-logbot 9 9 * Domain Path: /languages 10 * Version: 1. 510 * Version: 1.6 11 11 * 12 12 * @package Wp_Slack_Logbot … … 44 44 * @var string $slack_logbot_version 45 45 */ 46 var $slack_logbot_version = '1. 4';46 var $slack_logbot_version = '1.6'; 47 47 48 48 /** … … 67 67 // uninstall hook. 68 68 register_uninstall_hook( __FILE__, 'WP_Slack_Logbot::uninstall' ); 69 70 add_action( 'upgrader_process_complete', array( $this, 'upgrade' ), 9, 2 ); 71 } 72 73 /** 74 * Upgrade Plugin. 75 * 76 * @param string $object object. 77 * @param array $options Options. 78 */ 79 public function upgrade( $object, $options ) { 80 $current_plugin = plugin_basename( __FILE__ ); 81 if ( 'update' === $options['action'] && 'plugin' === $options['type'] ) { 82 foreach ( $options['plugins'] as $plugin ) { 83 if ( $plugin === $current_plugin ) { 84 $this->install(); 85 break; 86 } 87 } 88 } 69 89 } 70 90 … … 83 103 // Delete duplicated event_id rows except for min id. 84 104 $wpdb->query( "DELETE FROM {$wpdb->prefix}slack_logbot WHERE {$wpdb->prefix}slack_logbot.id NOT IN (SELECT * FROM (SELECT MIN(id) FROM {$wpdb->prefix}slack_logbot GROUP BY event_id HAVING COUNT(event_id) > 1) sl1) AND {$wpdb->prefix}slack_logbot.event_id IN (SELECT * FROM (SELECT event_id FROM {$wpdb->prefix}slack_logbot GROUP BY event_id HAVING COUNT(event_id) > 1) sl2)" ); 105 // Drop index. 106 $wpdb->query( "ALTER TABLE {$wpdb->prefix}slack_logbot DROP INDEX message" ); 107 // Add a new index. 108 $wpdb->query( "ALTER TABLE {$wpdb->prefix}slack_logbot ADD UNIQUE message(event_id)" ); 85 109 } 86 110 … … 111 135 112 136 update_option( 'slack_logbot_version', $this->slack_logbot_version ); 137 remove_action( 'upgrader_process_complete', array( $this, 'install' ), 9 ); 113 138 } 114 139 -
wp-slack-logbot/trunk/includes/class-slack-logbot.php
r2000958 r2011075 165 165 } 166 166 167 $msg_id = $data['event_client_msg_id']; 168 169 // System message will be null. 170 if ( $msg_id ) { 171 $post_content .= '<li id="' . $msg_id . '">'; 167 $event_id = $data['event_id']; 168 169 if ( $event_id ) { 170 $post_content .= '<li id="' . $event_id . '">'; 172 171 } else { 173 172 $post_content .= '<li>'; … … 253 252 $count = preg_match_all( '/\<(?P<url>http.*?)\>/', $ret_str, $match ); 254 253 for ( $i = 0; $i < $count; $i++ ) { 255 $pattern = ' {\<' . $match['url'][ $i ] . '\>}';256 $ret_str = preg_replace( $pattern, make_clickable( $match['url'][ $i ] ), $ret_str );254 $pattern = '<' . $match['url'][ $i ] . '>'; 255 $ret_str = str_replace( $pattern, make_clickable( $match['url'][ $i ] ), $ret_str ); 257 256 } 258 257 … … 266 265 } 267 266 267 // Replace mention strings to @channel or @here. 268 $ret_str = str_replace( '<!channel>', '@channel', $ret_str ); 269 $ret_str = str_replace( '<!here>', '@here', $ret_str ); 270 268 271 return $ret_str; 269 272 } -
wp-slack-logbot/trunk/readme.txt
r2000958 r2011075 6 6 Tested up to: 5.1-alpha-20181015.143023 7 7 Requires PHP: 5.3 8 Stable tag: 1. 5.08 Stable tag: 1.6.0 9 9 License: GPLv2 or later 10 10 License URI: LICENSE … … 78 78 == Changelog == 79 79 80 = 1.6 = 81 * Minor bug fixes 82 80 83 = 1.5 = 81 84 * Minor bug fixes
Note: See TracChangeset
for help on using the changeset viewer.