Plugin Directory

Changeset 1735544


Ignore:
Timestamp:
09/25/2017 01:51:25 PM (9 years ago)
Author:
unloqer
Message:
  • Fixed upgrade compatibility from v1.x to 2.x
Location:
unloq/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • unloq/trunk/includes/class-activator.php

    r1735499 r1735544  
    3939        if(version_compare($currentVersion, UQ_VERSION, '=='))
    4040            return;
    41 
    4241        $this->upgradeFromVersionOne();
     42        // we store the current plugin version
     43        $this->util->wp_option('update', 'unloq_version', UQ_VERSION);
    4344    }
    4445
     
    6566            'platform'         => 'WORDPRESS'
    6667        ));
     68
    6769        // we check if the apiKey is set and valid from old settings
    6870        // and only in this case we proceed with migrating data
     
    104106            $this->util->wp_option('update', 'unloq_settings', $unloqSettings);
    105107
    106             // we store the current plugin version
    107             $this->util->wp_option('update', 'unloq_version', UQ_VERSION);
    108 
    109108            // remove the setting from the old plugin
    110109            $this->util->wp_option('delete', 'wpunloq');
  • unloq/trunk/readme.txt

    r1735499 r1735544  
    117117
    118118== Changelog ==
     119= 2.1.1 =
     120* Fixed upgrade compatibility from v1.x to 2.x
    119121= 2.1.0 =
    120122* Fixed issues with v1.x compatibility by adding the "SSO" Feature. You can now seamlessly enable v1.x login-style
  • unloq/trunk/unloq.php

    r1735499 r1735544  
    1818
    1919define('UQ_PLUGIN', 'unloq');
    20 define('UQ_VERSION', '2.1.0');
     20define('UQ_VERSION', '2.1.1');
    2121define('UQ_VENDORS', plugin_dir_url(__FILE__) . 'vendors');
    2222define('UQ_VENDORS_DIR', plugin_dir_path(__FILE__) . 'vendors');
     
    2929require plugin_dir_path(__FILE__) . 'includes/class-core.php';
    3030
    31 function unloq_activate() {
    32     add_option('Activated_Unloq_Plugin', 'UNLOQ');
    33 }
    34 register_activation_hook(__FILE__, 'unloq_activate');
    35 
    36 
    3731function load_wp_unloq() {
    38     if ( is_admin() && get_option( 'Activated_Unloq_Plugin' ) == 'UNLOQ' ) {
    39         require plugin_dir_path(__FILE__) . 'includes/class-activator.php';
    40         $activator = new Wp_Unloq_Activator();
    41         $activator->activate();
    42         delete_option('Activated_Unloq_Plugin');
    43     }
     32    if(!is_admin()) return;
     33    if(!current_user_can('manage_options')) return;
     34    require plugin_dir_path(__FILE__) . 'includes/class-activator.php';
     35    $activator = new Wp_Unloq_Activator();
     36    $activator->activate();
    4437}
    4538add_action( 'admin_init', 'load_wp_unloq' );
Note: See TracChangeset for help on using the changeset viewer.