GitHub'; } return $links; } /** * Add plugin action links * * @param array $input Registered links * @return array Merged links * * @since 1.0.0 */ public static function plugin_actions_links($links, $file) { $base = self::$multisite ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' ); if( $file == STATIFYBLACKLIST_BASE && current_user_can('manage_options') ) { array_unshift( $links, sprintf( '%s', esc_attr(add_query_arg( 'page', 'statify-blacklist', $base )), __('Settings')) ); } return $links; } /** * Filter database for cleanup. * * @since 1.1.0 */ public static function cleanup_database() { global $wpdb; /* Build filter regexp */ $refererRegexp = str_replace('.', '\.', implode('|', self::$_options['referer'])); if (!empty($refererRegexp)) { /* Execute filter on database */ $wpdb->query( $wpdb->prepare("DELETE FROM `$wpdb->statify` WHERE referrer REGEXP %s", $refererRegexp) ); } /* Optimize DB */ $wpdb->query("OPTIMIZE TABLE `$wpdb->statify`"); } }