PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 3.4.3
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v3.4.3
3.4.3 3.4.2 3.4.1 3.4.0 3.3.9 3.3.8 3.3.7 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 All 196 releases
← All changes | admin/section/class-convertkit-admin-section-tools.php +6 -25 3.3.33.4.3 View file →
@@ -18,12 +18,8 @@
18 18 * Constructor
19 19 */
20 20 public function __construct() {
21 21
22 - // Initialize WP_Filesystem.
23 - require_once ABSPATH . 'wp-admin/includes/file.php';
24 - WP_Filesystem();
25 -
26 22 $this->settings_key = '_wp_convertkit_tools'; // Required for ConvertKit_Settings_Base, but we don't save settings on the Tools screen.
27 23 $this->name = 'tools';
28 24 $this->title = __( 'Tools', 'convertkit' );
29 25 $this->tab_text = __( 'Tools', 'convertkit' );
@@ -59,8 +55,9 @@
59 55 'import_configuration_success' => __( 'Configuration imported successfully.', 'convertkit' ),
60 56 'migrate_activecampaign_configuration_success' => __( 'ActiveCampaign forms migrated successfully.', 'convertkit' ),
61 57 'migrate_aweber_configuration_success' => __( 'AWeber forms migrated successfully.', 'convertkit' ),
62 58 'migrate_campaignmonitor_configuration_success' => __( 'Campaign Monitor forms migrated successfully.', 'convertkit' ),
59 + 'migrate_convertkit_legacy_forms_configuration_success' => __( 'Kit Legacy Forms migrated successfully.', 'convertkit' ),
63 60 'migrate_mc4wp_configuration_success' => __( 'MC4WP forms migrated successfully.', 'convertkit' ),
64 61 'migrate_mailpoet_configuration_success' => __( 'MailPoet forms migrated successfully.', 'convertkit' ),
65 62 'migrate_newsletter_configuration_success' => __( 'Newsletter forms migrated successfully.', 'convertkit' ),
66 63 )
@@ -123,10 +120,8 @@
123 120 * @since 1.9.6
124 121 */
125 122 private function maybe_download_log() {
126 123
127 - global $wp_filesystem;
128 -
129 124 // Bail if nonce verification fails.
130 125 if ( ! isset( $_REQUEST['_convertkit_settings_tools_nonce'] ) ) {
131 126 return;
132 127 }
@@ -147,9 +142,10 @@
147 142 header( 'Content-type: application/octet-stream' );
148 143 header( 'Content-Disposition: attachment; filename=convertkit-log.txt' );
149 144 header( 'Pragma: no-cache' );
150 145 header( 'Expires: 0' );
151 - echo esc_html( $wp_filesystem->get_contents( $log->get_filename() ) );
146 + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
147 + echo esc_html( (string) file_get_contents( $log->get_filename() ) );
152 148 exit();
153 149
154 150 }
155 151
@@ -160,10 +156,8 @@
160 156 * @since 1.9.6
161 157 */
162 158 private function maybe_download_system_info() {
163 159
164 - global $wp_filesystem;
165 -
166 160 // Bail if nonce verification fails.
167 161 if ( ! isset( $_REQUEST['_convertkit_settings_tools_nonce'] ) ) {
168 162 return;
169 163 }
@@ -179,23 +173,14 @@
179 173
180 174 // Get System Info.
181 175 $system_info = $this->get_system_info();
182 176
183 - // Write contents to temporary file.
184 - $tmpfile = tmpfile();
185 - $filename = stream_get_meta_data( $tmpfile )['uri'];
186 - $wp_filesystem->put_contents(
187 - $filename,
188 - esc_attr( $system_info )
189 - );
190 -
191 177 // Download.
192 178 header( 'Content-type: application/octet-stream' );
193 179 header( 'Content-Disposition: attachment; filename=convertkit-system-info.txt' );
194 180 header( 'Pragma: no-cache' );
195 181 header( 'Expires: 0' );
196 - echo esc_html( $wp_filesystem->get_contents( $filename ) );
197 - $wp_filesystem->delete( $filename );
182 + echo esc_html( $system_info );
198 183 exit();
199 184
200 185 }
201 186
@@ -261,13 +246,8 @@
261 246 if ( ! wp_verify_nonce( sanitize_key( $_REQUEST['_convertkit_settings_tools_nonce'] ), 'convertkit-settings-tools' ) ) {
262 247 return;
263 248 }
264 249
265 - // Allow us to easily interact with the filesystem.
266 - require_once ABSPATH . 'wp-admin/includes/file.php';
267 - WP_Filesystem();
268 - global $wp_filesystem;
269 -
270 250 // Bail if the submit button for importing the configuration was not clicked.
271 251 if ( ! array_key_exists( 'convertkit-import', $_REQUEST ) ) {
272 252 return;
273 253 }
@@ -282,9 +262,10 @@
282 262 $this->redirect_with_error_notice( 'import_configuration_upload_error' );
283 263 }
284 264
285 265 // Read file.
286 - $json = $wp_filesystem->get_contents( sanitize_text_field( wp_unslash( $_FILES['import']['tmp_name'] ) ) );
266 + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
267 + $json = file_get_contents( sanitize_text_field( wp_unslash( $_FILES['import']['tmp_name'] ) ) );
287 268
288 269 // Decode.
289 270 $import = json_decode( $json, true );
290 271