Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "project",
"license": "GPLv3",
"require": {
"convertkit/convertkit-wordpress-libraries": "2.6.0"
"convertkit/convertkit-wordpress-libraries": "dev-move-log-location"
},
"require-dev": {
"php-webdriver/webdriver": "^1.0",
Expand Down
15 changes: 15 additions & 0 deletions uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@
// are not reliably available due to the Plugin being deactivated and going
// through deletion now.

// Delete the log file from the uploads directory.
// The Plugin's own directory is deleted by WordPress once this routine completes,
// so any historic log file stored there doesn't need deleting here.
// This mirrors ConvertKit_Log::get_log_file_name() in the Kit WordPress Libraries,
// which we can't call as the Plugin's classes aren't reliably available.
$upload_dir = wp_upload_dir();
if ( empty( $upload_dir['error'] ) && ! empty( $upload_dir['basedir'] ) ) {
$log_slug = sanitize_key( basename( __DIR__ ) );
$log_file = trailingslashit( $upload_dir['basedir'] ) . 'kit-logs/' . $log_slug . '-' . wp_hash( $log_slug ) . '.log';

if ( file_exists( $log_file ) ) {
wp_delete_file( $log_file );
}
}

// Get providers.
$providers = get_option( 'wpforms_providers' );

Expand Down