PluginProbe
BlockSpare – Gutenberg Blocks, AI Content Generator & Site Builder for News, Magazine & Blogs / 2.6.6
BlockSpare – Gutenberg Blocks, AI Content Generator & Site Builder for News, Magazine & Blogs v2.6.6
5.0.1 4.1.0 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 2.1.2 2.5.0 2.5.3 All 39 releases
← All changes | freemius/includes/managers/class-fs-clone-manager.php +6 -16 5.0.1 → 2.6.6 View file →
@@ -332,9 +332,9 @@
332 332 return null;
333 333 }
334 334
335 335 if ( ! isset( $this->all_installs ) ) {
336 - $this->all_installs = FS_DebugManager::get_all_modules_sites();
336 + $this->all_installs = Freemius::get_all_modules_sites();
337 337 }
338 338
339 339 // Check if there's another blog that has the same site.
340 340 $module_type = $instance->get_module_type();
@@ -411,14 +411,14 @@
411 411 *
412 412 * @author Vova Feldman (@svovaf)
413 413 * @since 2.5.0
414 414 *
415 - * @param Freemius $instance
416 - * @param FS_Plugin_License|null $license
415 + * @param Freemius $instance
416 + * @param string|false $license_key
417 417 *
418 418 * @return bool TRUE if successfully connected. FALSE if failed and had to restore install from backup.
419 419 */
420 - private function delete_install_and_connect( Freemius $instance, $license = null ) {
420 + private function delete_install_and_connect( Freemius $instance, $license_key = false ) {
421 421 $user = Freemius::_get_user_by_id( $instance->get_site()->user_id );
422 422
423 423 $instance->delete_current_install( true );
424 424
@@ -429,11 +429,8 @@
429 429 // Find the relevant FS user by email address.
430 430 $user = Freemius::_get_user_by_email( $current_user->user_email );
431 431 }
432 432
433 - $license_key = ( is_object( $license ) ? $license->secret_key : false );
434 - $license_owner_id = ( is_object( $license ) ? $license->user_id : null );
435 -
436 433 if ( is_object( $user ) ) {
437 434 // When a clone is found, we prefer to use the same user of the original install for the opt-in.
438 435 $instance->install_with_user( $user, $license_key, false, false );
439 436 } else {
@@ -441,16 +438,9 @@
441 438 $instance->opt_in(
442 439 false,
443 440 false,
444 441 false,
445 - $license_key,
446 - false,
447 - false,
448 - false,
449 - null,
450 - array(),
451 - true,
452 - $license_owner_id
442 + $license_key
453 443 );
454 444 }
455 445
456 446 if ( is_object( $instance->get_site() ) ) {
@@ -514,9 +504,9 @@
514 504 }
515 505 }
516 506
517 507 // If the site is a clone of another subsite in the network, or a localhost one, try to auto activate the license.
518 - return $this->delete_install_and_connect( $instance, $license );
508 + return $this->delete_install_and_connect( $instance, $license->secret_key );
519 509 }
520 510
521 511 /**
522 512 * @author Leo Fajardo (@leorw)