Skip to content

Commit 989b23c

Browse files
committed
Simplify admin sidebar links and add database indexes
1 parent 3b2059e commit 989b23c

2 files changed

Lines changed: 8 additions & 27 deletions

File tree

includes/admin/sidebar.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,10 @@
2222
<a href="https://webberzone.com/support/product/freemkit/" target="_blank"><?php esc_html_e( 'Knowledge Base', 'freemkit' ); ?></a>
2323
</li>
2424
<li>
25-
<a href="https://wordpress.org/plugins/freemkit/faq/" target="_blank"><?php esc_html_e( 'FAQ', 'freemkit' ); ?></a>
25+
<a href="https://webberzone.com/request-support/" target="_blank"><?php esc_html_e( 'Request Support', 'freemkit' ); ?></a>
2626
</li>
2727
<li>
28-
<a href="https://wordpress.org/support/plugin/freemkit/" target="_blank"><?php esc_html_e( 'Support', 'freemkit' ); ?></a>
29-
</li>
30-
<li>
31-
<a href="https://wordpress.org/support/plugin/freemkit/reviews/" target="_blank"><?php esc_html_e( 'Reviews', 'freemkit' ); ?></a>
32-
</li>
33-
<li>
34-
<a href="https://github.com/webberzone/freemkit" target="_blank"><?php esc_html_e( 'Github repository', 'freemkit' ); ?></a>
35-
</li>
36-
<li>
37-
<a href="https://webberzone.com/" target="_blank"><?php esc_html_e( "Ajay's blog", 'freemkit' ); ?></a>
28+
<a href="https://ajaydsouza.com/" target="_blank"><?php esc_html_e( "Ajay's blog", 'freemkit' ); ?></a>
3829
</li>
3930
</ul>
4031
</div>
@@ -55,6 +46,8 @@
5546
<li><a href="https://webberzone.com/plugins/popular-authors/" target="_blank">Popular Authors</a></li>
5647
<li><a href="https://webberzone.com/plugins/autoclose/" target="_blank">Auto Close</a></li>
5748
<li><a href="https://webberzone.com/plugins/webberzone-link-warnings/" target="_blank">Link Warnings</a></li>
49+
<li><a href="https://webberzone.com/plugins/webberzone-code-block-highlighting/" target="_blank">Code Block Highlighting</a></li>
50+
</ul>
5851
</div>
5952
</div><!-- /.inside -->
6053
</div><!-- /.postbox -->

includes/class-database.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Database {
4444
* @since 1.0.0
4545
* @var string
4646
*/
47-
public $db_version = '2.0.0';
47+
public $db_version = '1.0.0';
4848

4949
/**
5050
* Constructor.
@@ -98,7 +98,9 @@ public function create_table() {
9898
PRIMARY KEY (id),
9999
KEY subscriber_id (subscriber_id),
100100
KEY plugin_id (plugin_id),
101-
KEY event_type (event_type)
101+
KEY event_type (event_type),
102+
KEY user_type (user_type),
103+
KEY created (created)
102104
) {$charset_collate};";
103105

104106
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
@@ -117,20 +119,6 @@ public function create_table() {
117119
);
118120
}
119121

120-
// Drop legacy columns from dev installs.
121-
$current_version = get_option( 'freemkit_db_version', '0' );
122-
if ( version_compare( $current_version, '2.0.0', '<' ) ) {
123-
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.SchemaChange,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
124-
$columns = $wpdb->get_results( "SHOW COLUMNS FROM {$this->table_name}", ARRAY_A );
125-
$col_names = wp_list_pluck( $columns, 'Field' );
126-
if ( in_array( 'tags', $col_names, true ) ) {
127-
$wpdb->query( "ALTER TABLE {$this->table_name} DROP COLUMN tags" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.SchemaChange,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
128-
}
129-
if ( in_array( 'forms', $col_names, true ) ) {
130-
$wpdb->query( "ALTER TABLE {$this->table_name} DROP COLUMN forms" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.SchemaChange,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
131-
}
132-
}
133-
134122
update_option( 'freemkit_db_version', $this->db_version );
135123

136124
return true;

0 commit comments

Comments
 (0)