delete function changed
-
Hey,
your plugin is really nice but I think, that the delete function is not perfect.
Because every time when we delete a redirection, all positions for all other redirects are set again. With our example we have 3000 redirects and when we not delete a bulk number of redirects is for each delete action 3000 updates.My new code for the file models/redirect.php => Line: 215
public function delete() { global $wpdb; $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}redirection_items WHERE id=%d", $this->id ) ); RE_Log::delete_for_id( $this->id ); // Reorder all elements (new) $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}redirection_items SET position = position - 1 WHERE position=%d", (int)$this->position ) ); Red_Module::flush( $this->group_id ); }
The topic ‘delete function changed’ is closed to new replies.