$markerline) { // for each line in the file if (strpos($markerline, '# BEGIN ' . $section) !== false) { // if we're at the beginning of the section $state = false; } if ($state == true) { // as long as we're not in the section keep writing fwrite($f, trim($markerline) . "\n"); } if (strpos($markerline, '# END ' . $section) !== false) { // see if we're at the end of the section $state = true; } } @fclose($f); return true; } return true; } /** * Delete database tables * * @return boolean true */ public static function reset_db_tables() { // Reset (TRUNCATE) all the db tables of the plugin. global $wpdb; $wpdb->query('TRUNCATE ' . $wpdb->prefix . 'aiowps_login_lockdown'); $wpdb->query('TRUNCATE ' . $wpdb->prefix . 'aiowps_login_activity'); $wpdb->query('TRUNCATE ' . $wpdb->prefix . 'aiowps_global_meta'); $wpdb->query('TRUNCATE ' . $wpdb->prefix . 'aiowps_events'); $wpdb->query('TRUNCATE ' . $wpdb->prefix . 'aiowps_permanent_block'); return true; } } endif;