PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.4
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.4
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / models / FrmAddon.php

FrmAddon.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 5.4, at classes/models/FrmAddon.php

712 lines 21.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( 'You are not allowed to call this page directly.' );
4 }
5
6 class FrmAddon {
7 public $store_url = 'https://formidableforms.com';
8 public $download_id;
9 public $plugin_file;
10 public $plugin_folder;
11 public $plugin_name;
12 public $plugin_slug;
13 public $option_name;
14 public $version;
15 public $author = 'Strategy11';
16 public $is_parent_licence = false;
17 public $needs_license = true;
18 private $is_expired_addon = false;
19 public $license;
20 protected $get_beta = false;
21
22 public function __construct() {
23
24 if ( empty( $this->plugin_slug ) ) {
25 $this->plugin_slug = preg_replace( '/[^a-zA-Z0-9_\s]/', '', str_replace( ' ', '_', strtolower( $this->plugin_name ) ) );
26 }
27 if ( empty( $this->option_name ) ) {
28 $this->option_name = 'edd_' . $this->plugin_slug . '_license_';
29 }
30
31 $this->plugin_folder = plugin_basename( $this->plugin_file );
32 $this->license = $this->get_license();
33
34 add_filter( 'frm_installed_addons', array( &$this, 'insert_installed_addon' ) );
35 $this->edd_plugin_updater();
36 }
37
38 public static function load_hooks() {
39 add_filter( 'frm_include_addon_page', '__return_true' );
40 //new static();
41 }
42
43 public function insert_installed_addon( $plugins ) {
44 $plugins[ $this->plugin_slug ] = $this;
45
46 return $plugins;
47 }
48
49 public static function get_addon( $plugin_slug ) {
50 $plugins = apply_filters( 'frm_installed_addons', array() );
51 $plugin = false;
52 if ( isset( $plugins[ $plugin_slug ] ) ) {
53 $plugin = $plugins[ $plugin_slug ];
54 }
55
56 return $plugin;
57 }
58
59 public function edd_plugin_updater() {
60
61 $this->is_license_revoked();
62 $license = $this->license;
63
64 add_action( 'after_plugin_row_' . plugin_basename( $this->plugin_file ), array( $this, 'maybe_show_license_message' ), 10, 2 );
65
66 if ( ! empty( $license ) ) {
67
68 if ( 'formidable/formidable.php' !== $this->plugin_folder ) {
69 add_filter( 'plugins_api', array( &$this, 'plugins_api_filter' ), 10, 3 );
70 }
71
72 add_filter( 'site_transient_update_plugins', array( &$this, 'clear_expired_download' ) );
73 }
74 }
75
76 /**
77 * Updates information on the "View version x.x details" page with custom data.
78 *
79 * @uses api_request()
80 *
81 * @param mixed $_data
82 * @param string $_action
83 * @param object $_args
84 *
85 * @return object $_data
86 */
87 public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
88
89 if ( $_action != 'plugin_information' ) {
90 return $_data;
91 }
92
93 $slug = basename( $this->plugin_file, '.php' );
94 $slug2 = str_replace( '/' . $slug . '.php', '', $this->plugin_folder );
95 if ( empty( $_args->slug ) || ( $_args->slug != $slug && $_args->slug !== $slug2 ) ) {
96 return $_data;
97 }
98
99 $item_id = $this->download_id;
100 if ( empty( $item_id ) ) {
101 $_data = array(
102 'name' => $this->plugin_name,
103 'excerpt' => '',
104 'changelog' => 'See the full changelog at <a href="' . esc_url( $this->store_url . '/changelog/' ) . '"></a>',
105 'banners' => array(
106 'high' => '',
107 'low' => 'https://ps.w.org/formidable/assets/banner-1544x500.png',
108 ),
109 );
110 } else {
111 $api = new FrmFormApi( $this->license );
112 $plugins = $api->get_api_info();
113 $_data = $plugins[ $item_id ];
114 }
115
116 $_data['sections'] = array(
117 'description' => $_data['excerpt'],
118 'changelog' => $_data['changelog'],
119 );
120 $_data['author'] = '<a href="' . esc_url( $this->store_url ) . '">' . esc_html( $this->author ) . '</a>';
121 $_data['homepage'] = $this->store_url;
122
123 return (object) $_data;
124 }
125
126 public function get_license() {
127 $license = $this->maybe_get_pro_license();
128 if ( ! empty( $license ) ) {
129 return $license;
130 }
131
132 $license = trim( get_option( $this->option_name . 'key' ) );
133 if ( empty( $license ) ) {
134 $license = $this->activate_defined_license();
135 }
136
137 return $license;
138 }
139
140 /**
141 * @since 3.04.03
142 */
143 protected function maybe_get_pro_license() {
144 // prevent a loop if $this is the pro plugin
145 $get_license = FrmAppHelper::pro_is_installed() && is_callable( 'FrmProAppHelper::get_updater' ) && $this->plugin_name != 'Formidable Pro';
146
147 if ( ! $get_license ) {
148 return false;
149 }
150
151 $api = new FrmFormApi();
152 $api->get_pro_updater();
153 $license = $api->get_license();
154 if ( empty( $license ) ) {
155 return false;
156 }
157
158 $this->get_api_info( $license );
159 if ( ! $this->is_parent_licence ) {
160 $license = false;
161 }
162
163 return $license;
164 }
165
166 /**
167 * Activate the license in wp-config.php
168 *
169 * @since 2.04
170 */
171 public function activate_defined_license() {
172 $license = $this->get_defined_license();
173 if ( ! empty( $license ) && ! $this->is_active() && $this->is_time_to_auto_activate() ) {
174 $response = $this->activate_license( $license );
175 $this->set_auto_activate_time();
176 if ( ! $response['success'] ) {
177 $license = '';
178 }
179 }
180
181 return $license;
182 }
183
184 /**
185 * Check the wp-config.php for the license key
186 *
187 * @since 2.04
188 */
189 public function get_defined_license() {
190 $consant_name = 'FRM_' . strtoupper( $this->plugin_slug ) . '_LICENSE';
191
192 return defined( $consant_name ) ? constant( $consant_name ) : false;
193 }
194
195 public function set_license( $license ) {
196 update_option( $this->option_name . 'key', $license );
197 }
198
199 /**
200 * If the license is in the config, limit the frequency of checks.
201 * The license may be entered incorrectly, so we don't want to check on every page load.
202 *
203 * @since 2.04
204 */
205 private function is_time_to_auto_activate() {
206 $last_try = get_option( $this->option_name . 'last_activate' );
207
208 return ( ! $last_try || $last_try < strtotime( '-1 day' ) );
209 }
210
211 private function set_auto_activate_time() {
212 update_option( $this->option_name . 'last_activate', time() );
213 }
214
215 public function is_active() {
216 return get_option( $this->option_name . 'active' );
217 }
218
219 /**
220 * @since 3.04.03
221 *
222 * @param array error
223 */
224 public function maybe_clear_license( $error ) {
225 if ( $error['code'] === 'disabled' && $error['license'] === $this->license ) {
226 $this->clear_license();
227 }
228 }
229
230 public function clear_license() {
231 delete_option( $this->option_name . 'active' );
232 delete_option( $this->option_name . 'key' );
233 delete_site_option( $this->transient_key() );
234 delete_option( $this->transient_key() );
235 $this->delete_cache();
236 }
237
238 public function set_active( $is_active ) {
239 update_option( $this->option_name . 'active', $is_active );
240 $this->delete_cache();
241 FrmAppHelper::save_combined_js();
242 $this->update_pro_capabilities();
243 }
244
245 /**
246 * Updates roles capabilities after pro license is active.
247 *
248 * @since 5.0
249 */
250 protected function update_pro_capabilities() {
251 global $wp_roles;
252
253 $caps = FrmAppHelper::frm_capabilities( 'pro_only' );
254 $roles = get_editable_roles();
255 $settings = new FrmSettings();
256 foreach ( $caps as $cap => $cap_desc ) {
257 $cap_roles = (array) ( isset( $settings->$cap ) ? $settings->$cap : 'administrator' );
258
259 // Make sure administrators always have permissions.
260 if ( ! in_array( 'administrator', $cap_roles ) ) {
261 array_push( $cap_roles, 'administrator' );
262 }
263
264 foreach ( $roles as $role => $details ) {
265 if ( in_array( $role, $cap_roles ) ) {
266 $wp_roles->add_cap( $role, $cap );
267 } else {
268 $wp_roles->remove_cap( $role, $cap );
269 }
270 }
271 }
272 }
273
274 /**
275 * @since 3.04.03
276 */
277 protected function delete_cache() {
278 delete_transient( 'frm_api_licence' );
279
280 $api = new FrmFormApi( $this->license );
281 $api->reset_cached();
282
283 $api = new FrmFormTemplateApi( $this->license );
284 $api->reset_cached();
285
286 $api = new FrmApplicationApi( $this->license );
287 $api->reset_cached();
288 }
289
290 /**
291 * The Pro version includes the show_license_message function.
292 * We need an extra check before we allow it to show a message.
293 *
294 * @since 3.04.03
295 */
296 public function maybe_show_license_message( $file, $plugin ) {
297 if ( $this->is_expired_addon || isset( $plugin['package'] ) ) {
298 // let's not show a ton of duplicate messages
299 return;
300 }
301
302 $this->show_license_message( $file, $plugin );
303 }
304
305 public function show_license_message( $file, $plugin ) {
306 $message = '';
307 if ( empty( $this->license ) ) {
308 /* translators: %1$s: Plugin name, %2$s: Start link HTML, %3$s: end link HTML */
309 $message = sprintf( esc_html__( 'Your %1$s license key is missing. Please add it on the %2$slicenses page%3$s.', 'formidable' ), esc_html( $this->plugin_name ), '<a href="' . esc_url( admin_url( 'admin.php?page=formidable-settings' ) ) . '">', '</a>' );
310 } else {
311 $api = new FrmFormApi( $this->license );
312 $errors = $api->error_for_license();
313 if ( ! empty( $errors ) ) {
314 $message = reset( $errors );
315 }
316 }
317
318 if ( empty( $message ) ) {
319 return;
320 }
321
322 $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
323 $id = sanitize_title( $plugin['Name'] ) . '-next';
324
325 echo '<tr class="plugin-update-tr active" id="' . esc_attr( $id ) . '"><td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange"><div class="update-message notice error inline notice-error notice-alt"><p>';
326 echo FrmAppHelper::kses( $message, 'a' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
327 echo '<script type="text/javascript">var d = document.getElementById("' . esc_attr( $id ) . '").previousSibling;if ( d !== null ){ d.className = d.className + " update"; }</script>';
328 echo '</p></div></td></tr>';
329 }
330
331 public function clear_expired_download( $transient ) {
332 if ( ! is_object( $transient ) ) {
333 return $transient;
334 }
335
336 if ( $this->is_current_version( $transient ) ) {
337 //make sure it doesn't show there is an update if plugin is up-to-date
338 if ( isset( $transient->response[ $this->plugin_folder ] ) ) {
339 unset( $transient->response[ $this->plugin_folder ] );
340 }
341 } elseif ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) {
342 $this->prepare_update_details( $transient->response[ $this->plugin_folder ] );
343
344 // if the transient has expired, clear the update and trigger it again
345 if ( $transient->response[ $this->plugin_folder ] === false ) {
346 if ( ! $this->has_been_cleared() ) {
347 $this->cleared_plugins();
348 $this->manually_queue_update();
349 }
350 unset( $transient->response[ $this->plugin_folder ] );
351 }
352 }
353
354 return $transient;
355 }
356
357 /**
358 * Check if the plugin information is correct to allow an update
359 *
360 * @since 3.04.03
361 *
362 * @param object $transient - the current plugin info saved for update
363 */
364 private function prepare_update_details( &$transient ) {
365 $version_info = $transient;
366 $has_beta_url = isset( $version_info->beta ) && ! empty( $version_info->beta );
367 if ( $this->get_beta && ! $has_beta_url ) {
368 $version_info = (object) $this->get_api_info( $this->license );
369 }
370
371 if ( isset( $version_info->new_version ) && ! empty( $version_info->new_version ) ) {
372 $this->clear_old_plugin_version( $version_info );
373 if ( $version_info === false ) { // was cleared with timeout
374 $transient = false;
375 } else {
376 $this->maybe_use_beta_url( $version_info );
377
378 if ( version_compare( $version_info->new_version, $this->version, '>' ) ) {
379 $transient = $version_info;
380 }
381 }
382 }
383 }
384
385 /**
386 * Get the API info for this plugin
387 *
388 * @since 3.04.03
389 */
390 protected function get_api_info( $license ) {
391 $api = new FrmFormApi( $license );
392 $addon = $api->get_addon_for_license( $this );
393
394 // if there is no download url, this license does not apply to the addon
395 if ( isset( $addon['package'] ) ) {
396 $this->is_parent_licence = true;
397 } elseif ( isset( $addon['error'] ) ) {
398 // if the license is expired, we must assume all add-ons were packaged
399 $this->is_parent_licence = true;
400 $this->is_expired_addon = true;
401 }
402
403 return $addon;
404 }
405
406 /**
407 * Make sure transients don't stick around on sites that
408 * don't save the transient expiration
409 *
410 * @since 2.05.05
411 */
412 private function clear_old_plugin_version( &$version_info ) {
413 $timeout = ( isset( $version_info->timeout ) && ! empty( $version_info->timeout ) ) ? $version_info->timeout : 0;
414 if ( ! empty( $timeout ) && time() > $timeout ) {
415 $version_info = false; // Cache is expired
416 $api = new FrmFormApi( $this->license );
417 $api->reset_cached();
418 }
419 }
420
421 /**
422 * The beta url is always included if the download has a beta.
423 * Check if the beta should be downloaded.
424 *
425 * @since 3.04.03
426 */
427 private function maybe_use_beta_url( &$version_info ) {
428 if ( $this->get_beta && isset( $version_info->beta ) && ! empty( $version_info->beta ) ) {
429 $version_info->new_version = $version_info->beta['version'];
430 $version_info->package = $version_info->beta['package'];
431 if ( isset( $version_info->plugin ) && ! empty( $version_info->plugin ) ) {
432 $version_info->plugin = $version_info->beta['plugin'];
433 }
434 }
435 }
436
437 private function is_current_version( $transient ) {
438 if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) {
439 return false;
440 }
441
442 $response = ! isset( $transient->response ) || empty( $transient->response );
443 if ( $response ) {
444 return true;
445 }
446
447 return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] === $transient->response[ $this->plugin_folder ]->new_version;
448 }
449
450 private function has_been_cleared() {
451 $last_cleared = get_option( 'frm_last_cleared' );
452
453 return ( $last_cleared && $last_cleared > gmdate( 'Y-m-d H:i:s', strtotime( '-5 minutes' ) ) );
454 }
455
456 private function cleared_plugins() {
457 update_option( 'frm_last_cleared', gmdate( 'Y-m-d H:i:s' ) );
458 }
459
460 private function is_license_revoked() {
461 if ( empty( $this->license ) || empty( $this->plugin_slug ) || isset( $_POST['license'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
462 return;
463 }
464
465 if ( is_multisite() ) {
466 $last_checked = get_site_option( $this->transient_key() );
467 } else {
468 $last_checked = get_option( $this->transient_key() );
469 }
470
471 $seven_days_ago = gmdate( 'Y-m-d H:i:s', strtotime( '-7 days' ) );
472
473 if ( ! $last_checked || $last_checked < $seven_days_ago ) {
474 // check weekly
475 if ( is_multisite() ) {
476 update_site_option( $this->transient_key(), gmdate( 'Y-m-d H:i:s' ) );
477 } else {
478 update_option( $this->transient_key(), gmdate( 'Y-m-d H:i:s' ) );
479 }
480
481 $response = $this->get_license_status();
482 if ( 'revoked' === $response['status'] || 'blocked' === $response['status'] || 'disabled' === $response['status'] ) {
483 $this->clear_license();
484 }
485 }
486 }
487
488 /**
489 * Use a new cache after the license is changed, or Formidable is updated.
490 */
491 private function transient_key() {
492 return 'frm_' . md5( sanitize_key( $this->license . '_' . $this->plugin_slug ) );
493 }
494
495 public static function activate() {
496 FrmAppHelper::permission_check( 'frm_change_settings' );
497 check_ajax_referer( 'frm_ajax', 'nonce' );
498
499 $license = stripslashes( FrmAppHelper::get_param( 'license', '', 'post', 'sanitize_text_field' ) );
500 if ( empty( $license ) ) {
501 wp_die(
502 json_encode(
503 array(
504 'message' => __( 'Oops! You forgot to enter your license number.', 'formidable' ),
505 'success' => false,
506 )
507 )
508 );
509 }
510
511 $plugin_slug = FrmAppHelper::get_param( 'plugin', '', 'post', 'sanitize_text_field' );
512 $response = self::activate_license_for_plugin( $license, $plugin_slug );
513
514 echo json_encode( $response );
515 wp_die();
516 }
517
518 /**
519 * @since 4.08
520 */
521 public static function activate_license_for_plugin( $license, $plugin_slug ) {
522 $this_plugin = self::get_addon( $plugin_slug );
523 return $this_plugin->activate_license( $license );
524 }
525
526 private function activate_license( $license ) {
527 $this->set_license( $license );
528 $this->license = $license;
529
530 $response = $this->get_license_status();
531 $response['message'] = '';
532 $response['success'] = false;
533
534 if ( $response['error'] ) {
535 $response['message'] = $response['status'];
536 } else {
537 $messages = $this->get_messages();
538 if ( is_string( $response['status'] ) && isset( $messages[ $response['status'] ] ) ) {
539 $response['message'] = $messages[ $response['status'] ];
540 } else {
541 $response['message'] = FrmAppHelper::kses( $response['status'], array( 'a' ) );
542 }
543
544 $is_valid = false;
545 if ( 'valid' === $response['status'] ) {
546 $is_valid = 'valid';
547 $response['success'] = true;
548 }
549 $this->set_active( $is_valid );
550 }
551
552 return $response;
553 }
554
555 private function get_license_status() {
556 $response = array(
557 'status' => 'missing',
558 'error' => true,
559 );
560 if ( empty( $this->license ) ) {
561 $response['error'] = false;
562
563 return $response;
564 }
565
566 try {
567 $response['error'] = false;
568 $license_data = $this->send_mothership_request( 'activate_license' );
569
570 // $license_data->license will be either "valid" or "invalid"
571 if ( is_array( $license_data ) ) {
572 if ( in_array( $license_data['license'], array( 'valid', 'invalid' ), true ) ) {
573 $response['status'] = $license_data['license'];
574 }
575 } else {
576 $response['status'] = $license_data;
577 }
578 } catch ( Exception $e ) {
579 $response['status'] = $e->getMessage();
580 }
581
582 return $response;
583 }
584
585 private function get_messages() {
586 return array(
587 'valid' => __( 'Your license has been activated. Enjoy!', 'formidable' ),
588 'invalid' => __( 'That license key is invalid', 'formidable' ),
589 'expired' => __( 'That license is expired', 'formidable' ),
590 'revoked' => __( 'That license has been refunded', 'formidable' ),
591 'no_activations_left' => __( 'That license has been used on too many sites', 'formidable' ),
592 'invalid_item_id' => __( 'Oops! That is the wrong license key for this plugin.', 'formidable' ),
593 'missing' => __( 'That license key is invalid', 'formidable' ),
594 );
595 }
596
597 /**
598 * @since 4.03
599 */
600 public static function reset_cache() {
601 FrmAppHelper::permission_check( 'frm_change_settings' );
602 check_ajax_referer( 'frm_ajax', 'nonce' );
603
604 $this_plugin = self::set_license_from_post();
605 $this_plugin->delete_cache();
606
607 $response = array(
608 'success' => true,
609 'message' => __( 'Cache cleared', 'formidable' ),
610 );
611
612 echo json_encode( $response );
613 wp_die();
614 }
615
616 public static function deactivate() {
617 FrmAppHelper::permission_check( 'frm_change_settings' );
618 check_ajax_referer( 'frm_ajax', 'nonce' );
619
620 $this_plugin = self::set_license_from_post();
621
622 $response = array(
623 'success' => false,
624 'message' => '',
625 );
626 try {
627 // $license_data->license will be either "deactivated" or "failed"
628 $license_data = $this_plugin->send_mothership_request( 'deactivate_license' );
629 if ( is_array( $license_data ) && 'deactivated' === $license_data['license'] ) {
630 $response['success'] = true;
631 $response['message'] = __( 'That license was removed successfully', 'formidable' );
632 } else {
633 $response['message'] = __( 'There was an error deactivating your license.', 'formidable' );
634 }
635 } catch ( Exception $e ) {
636 $response['message'] = $e->getMessage();
637 }
638
639 $this_plugin->clear_license();
640
641 echo json_encode( $response );
642 wp_die();
643 }
644
645 /**
646 * @since 4.03
647 */
648 private static function set_license_from_post() {
649 $plugin_slug = FrmAppHelper::get_param( 'plugin', '', 'post', 'sanitize_text_field' );
650 $this_plugin = self::get_addon( $plugin_slug );
651 $license = $this_plugin->get_license();
652 $this_plugin->license = $license;
653 return $this_plugin;
654 }
655
656 public function send_mothership_request( $action ) {
657 $api_params = array(
658 'edd_action' => $action,
659 'license' => $this->license,
660 'url' => home_url(),
661 );
662 if ( is_numeric( $this->download_id ) ) {
663 $api_params['item_id'] = absint( $this->download_id );
664 } else {
665 $api_params['item_name'] = rawurlencode( $this->plugin_name );
666 }
667
668 $arg_array = array(
669 'body' => $api_params,
670 'timeout' => 25,
671 'user-agent' => $this->plugin_slug . '/' . $this->version . '; ' . get_bloginfo( 'url' ),
672 );
673
674 $resp = wp_remote_post( $this->store_url, $arg_array );
675 $body = wp_remote_retrieve_body( $resp );
676
677 $message = __( 'Your License Key was invalid', 'formidable' );
678 if ( is_wp_error( $resp ) ) {
679 $link = FrmAppHelper::admin_upgrade_link( 'api', 'knowledgebase/why-cant-i-activate-formidable-pro/' );
680 /* translators: %1$s: Start link HTML, %2$s: End link HTML */
681 $message = sprintf( __( 'You had an error communicating with the Formidable API. %1$sClick here%2$s for more information.', 'formidable' ), '<a href="' . esc_url( $link ) . '" target="_blank">', '</a>' );
682 $message .= ' ' . $resp->get_error_message();
683 } elseif ( 'error' === $body || is_wp_error( $body ) ) {
684 $message = __( 'You had an HTTP error connecting to the Formidable API', 'formidable' );
685 } else {
686 $json_res = json_decode( $body, true );
687 if ( null !== $json_res ) {
688 if ( is_array( $json_res ) && isset( $json_res['error'] ) ) {
689 $message = $json_res['error'];
690 } else {
691 $message = $json_res;
692 }
693 } elseif ( isset( $resp['response'] ) && isset( $resp['response']['code'] ) ) {
694 /* translators: %1$s: Error code, %2$s: Error message */
695 $message = sprintf( __( 'There was a %1$s error: %2$s', 'formidable' ), $resp['response']['code'], $resp['response']['message'] . ' ' . $resp['body'] );
696 }
697 }
698
699 return $message;
700 }
701
702 public function manually_queue_update() {
703 $updates = new stdClass();
704 $updates->last_checked = 0;
705 $updates->response = array();
706 $updates->translations = array();
707 $updates->no_update = array();
708 $updates->checked = array();
709 set_site_transient( 'update_plugins', $updates );
710 }
711 }
712