Skip to content

Commit

Permalink
reduce database cpu usage
Browse files Browse the repository at this point in the history
  • Loading branch information
joshp23 committed Mar 12, 2021
1 parent 7f29a0f commit 6c887ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions expiry/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Expiry
Plugin URI: https://github.com/joshp23/YOURLS-Expiry
Description: Will set expiration conditions on your links (or not)
Version: 2.3.4
Version: 2.3.5
Author: Josh Panter
Author URI: https://unfettered.net
*/
Expand Down Expand Up @@ -568,7 +568,7 @@ function show_expiry_tablerow($row, $keyword, $url, $title, $ip, $clicks, $times
// If the keyword is set to expire, make the URL show in green;
$table = YOURLS_DB_PREFIX . 'expiry';

$sql = "SELECT * FROM $table WHERE BINARY `keyword` = :keyword";
$sql = "SELECT * FROM $table WHERE `keyword` = :keyword";
$binds = array('keyword' => $keyword);
$expiry = $ydb->fetchOne($sql, $binds);

Expand Down Expand Up @@ -1282,7 +1282,7 @@ function expiry_activated() {
// Create the expiry table
$table = YOURLS_DB_PREFIX . 'expiry';
$table_expiry = "CREATE TABLE IF NOT EXISTS `".$table."` (";
$table_expiry .= "keyword varchar(200) NOT NULL, ";
$table_expiry .= "keyword binary(100) NOT NULL, ";
$table_expiry .= "type varchar(5) NOT NULL, ";
$table_expiry .= "click varchar(5), ";
$table_expiry .= "timestamp varchar(20), ";
Expand Down

0 comments on commit 6c887ca

Please sign in to comment.