PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.9
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.9
4.4.9 4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 All 140 releases
← All changes | inc/Ajax/Order/ExportOrderCSVAjax.php +8 -1 4.4.5 → 4.4.9 View file →
@@ -21,9 +21,9 @@
21 21 *
22 22 * @author ThimPress
23 23 * @package LearnPress\Ajax
24 24 * @since 4.3.2.8
25 - * @version 1.0.0
25 + * @version 1.0.1
26 26 */
27 27 class ExportOrderCSVAjax extends AbstractAjax {
28 28 /**
29 29 * Export orders to CSV file, action call from js file: export-order.js
@@ -138,8 +138,10 @@
138 138 *
139 139 * @param string $export_id
140 140 *
141 141 * @return string
142 + * @since 4.3.2.8
143 + * @version 1.0.0
142 144 */
143 145 public static function get_export_csv_path( string $export_id = '' ): string {
144 146 $upload = wp_upload_dir();
145 147 $dir = $upload['basedir'] . '/lp-order-export';
@@ -145,8 +147,13 @@
145 147 $dir = $upload['basedir'] . '/lp-order-export';
146 148
147 149 if ( ! file_exists( $dir ) ) {
148 150 wp_mkdir_p( $dir );
151 + }
152 +
153 + $index_file = $dir . '/index.php';
154 + if ( ! file_exists( $index_file ) ) {
155 + file_put_contents( $index_file, "<?php\n// Silence is golden.\n" );
149 156 }
150 157
151 158 return $dir . "/lp-orders-{$export_id}.csv";
152 159 }