New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

479: Uninstall routine #513

Open
wants to merge 10 commits into
base: develop
from

Conversation

Projects
None yet
2 participants
@toolstack
Contributor

toolstack commented Jul 15, 2016

Resolves #479.

@toolstack toolstack added this to the 2.2 milestone Jul 15, 2016

$schema = gp_schema_get();
foreach ( $schema as $table => $sql ) {
$table_name = $wpdb->prefix . 'gp_' . $table;

This comment has been minimized.

@ocean90

ocean90 Sep 4, 2016

Member

This looks wrong, the prefix can be customized via $gp_table_prefix.

$wpdb->query( "DROP TABLE {$table_name};" ); // WPCS: unprepared SQL ok.
}
// Delete the WordPress options we use.

This comment has been minimized.

@ocean90

ocean90 Sep 4, 2016

Member

'WordPress' sounds confusing in this context, the options are used by GlotPress.
Better: // Delete options.

There is a lot of 'we' in this function too, this should be avoided.

$schema = gp_schema_get();
foreach ( $schema as $table => $sql ) {
$table_name = $wpdb->{'gp_' . $table};

This comment has been minimized.

@ocean90

ocean90 Sep 6, 2016

Member

Does this work if the plugin is disabled?

This comment has been minimized.

@toolstack

toolstack Sep 6, 2016

Contributor

Yes, that's why the additional defines are included above.

@toolstack toolstack force-pushed the 479-uninstall-routine branch 2 times, most recently from 4047748 to e60800c Sep 7, 2016

*
* @var GP_WP_Settings
*/
public static $wp_settings;

This comment has been minimized.

@ocean90

ocean90 Sep 13, 2016

Member

This looks weird. Can we make that $admin and use it for all (future) stuff which is handled in the WordPress admin?

This should also only be initialized when we're in the admin, not on the front end.

@toolstack toolstack force-pushed the 479-uninstall-routine branch from 61ccaa5 to f61f16d Sep 13, 2016

@ocean90 ocean90 modified the milestones: 2.2, 2.3 Sep 15, 2016

toolstack added some commits Jul 15, 2016

Add uninstall routine.
Includes a new settings page in WP Admin to allow a user to select to delete the data from the database as well.

Also includes a CLI for deleting the data from the command line.
Add 'IF EXISTS' to the drop table command to avoid errors.
For example if a custom permissions table is defined the default permissions table may already have been deleted and would throw an error.
Changed GP class variable name and added additional info on the setti…
…ngs page.

Also, only create the instance when in the admin console.

@toolstack toolstack force-pushed the 479-uninstall-routine branch from 1b882ab to 6c6d5bd Nov 15, 2016

@ocean90 ocean90 modified the milestones: 2.3, Future Nov 28, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment