PluginProbe
Redirection / 4.5.1
Redirection v4.5.1
5.10.0 5.9.0 5.8.1 5.8.0 3.7.2 3.7.3 4.0 4.0.1 4.1 4.1.1 4.2 4.2.1 4.2.2 4.2.3 4.3 4.3.1 4.3.2 4.3.3 4.4 4.4.1 4.4.2 4.5 4.5.1 4.6.2 4.7.1 All 130 releases
redirection / database / schema / 231.php

231.php in Redirection 4.5.1, at database/schema/231.php

38 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Note: not localised as the messages aren't important enough
4 class Red_Database_231 extends Red_Database_Upgrader {
5 public function get_stages() {
6 return [
7 'remove_404_module_231' => 'Remove 404 module',
8 'create_404_table_231' => 'Create 404 table',
9 ];
10 }
11
12 protected function remove_404_module_231( $wpdb ) {
13 return $this->do_query( $wpdb, "UPDATE {$wpdb->prefix}redirection_groups SET module_id=1 WHERE module_id=3" );
14 }
15
16 protected function create_404_table_231( $wpdb ) {
17 $this->do_query( $wpdb, $this->get_404_table( $wpdb ) );
18 }
19
20 private function get_404_table( $wpdb ) {
21 $charset_collate = $this->get_charset();
22
23 return "CREATE TABLE `{$wpdb->prefix}redirection_404` (
24 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
25 `created` datetime NOT NULL,
26 `url` varchar(255) NOT NULL DEFAULT '',
27 `agent` varchar(255) DEFAULT NULL,
28 `referrer` varchar(255) DEFAULT NULL,
29 `ip` int(10) unsigned NOT NULL,
30 PRIMARY KEY (`id`),
31 KEY `created` (`created`),
32 KEY `url` (`url`(191)),
33 KEY `ip` (`ip`),
34 KEY `referrer` (`referrer`(191))
35 ) $charset_collate";
36 }
37 }
38