| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | <?php |
| 2 | +if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly | |
| 2 | 3 | |
| 3 | - | |
| 4 | 4 | function deepl_install_plugin() { |
| 5 | 5 | if ( !get_option( 'deepl_plugin_installed') ) { |
| 6 | 6 | update_option( 'deepl_plugin_installed', 0 ); |
| 7 | 7 | } |
| @@ -19,7 +19,11 @@ | ||
| 19 | 19 | if( !get_option( $key ) ) { |
| 20 | 20 | update_option( $key, 1 ); |
| 21 | 21 | } |
| 22 | 22 | } |
| 23 | + | |
| 24 | + global $wp_filesystem; if ( empty( $wp_filesystem ) ) { require_once( ABSPATH . 'wp-admin/includes/file.php' ); WP_Filesystem(); } | |
| 25 | + $wpdeepl_dir_path = wp_normalize_path( WPDEEPL_FILES ); | |
| 26 | + if ( ! $wp_filesystem->is_dir( $wpdeepl_dir_path ) ) { $wp_filesystem->mkdir( $wpdeepl_dir_path, 0755 ); } | |
| 23 | 27 | |
| 24 | 28 | update_option('wpdeepl_plugin_installed', 1 ); |
| 25 | 29 | } |