install.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * MonsterInsights Lite Installation and Automatic Upgrades.
  4. *
  5. * This file handles special Lite install & upgrade routines.
  6. *
  7. * @package MonsterInsights
  8. * @subpackage Install/Upgrade
  9. * @since 6.0.0
  10. */
  11. // Exit if accessed directly
  12. if ( ! defined( 'ABSPATH' ) ) {
  13. exit;
  14. }
  15. // @todo: Add defaults for new installs
  16. //do_action( 'monsterinsights_after_new_install_routine', $version );
  17. // do_action( 'monsterinsights_after_existing_upgrade_routine', $version );
  18. // Add default
  19. //do_action( 'monsterinsights_after_install_routine', $version );
  20. function monsterinsights_lite_upgrade_from_yoast( $key, $network ) {
  21. if ( $network ) {
  22. $option = array();
  23. $option['key'] = $key;
  24. $option['type'] = '';
  25. $option['is_expired'] = false;
  26. $option['is_disabled'] = false;
  27. $option['is_invalid'] = false;
  28. update_site_option( 'monsterinsights_license', $option );
  29. } else {
  30. $option = array();
  31. $option['key'] = $key;
  32. $option['type'] = '';
  33. $option['is_expired'] = false;
  34. $option['is_disabled'] = false;
  35. $option['is_invalid'] = false;
  36. update_option( 'monsterinsights_license', $option );
  37. }
  38. }
  39. add_action( 'monsterinsights_upgrade_from_yoast', 'monsterinsights_lite_upgrade_from_yoast', 10, 2 );