Example #1
0
 /**
  * Placeholder for activation function
  * Nothing being called here yet.
  *
  * @since 0.1
  *
  * @return 0.1
  */
 public function activate()
 {
     // bail out if the php version is lower than
     if (version_compare(PHP_VERSION, $this->min_php, '<')) {
         deactivate_plugins(basename(WPERP_FILE));
         $error = '<h1>An Error Occured</h1>';
         $error .= '<h2>Your installed PHP Version is: ' . PHP_VERSION . '</h2>';
         $error .= '<p>The <strong>WP ERP</strong> plugin requires PHP version <strong>' . $this->min_php . '</strong> or greater';
         $error .= '<p>The version of your PHP is <a href="http://php.net/supported-versions.php" target="_blank"><strong>unsupported and old</strong></a>. ';
         $error .= 'You should update your PHP software or contact your host regarding this matter.</p>';
         wp_die($error, 'Plugin Activation Error', array('response' => 200, 'back_link' => true));
     }
     $this->create_tables();
     $this->set_default_modules();
     $this->create_roles();
     $this->set_role();
     $this->create_cron_jobs();
     $current_erp_version = get_option('wp_erp_version', null);
     $current_db_version = get_option('wp_erp_db_version', null);
     if (is_null($current_erp_version) && is_null($current_db_version) && apply_filters('erp_enable_setup_wizard', true)) {
         set_transient('_erp_activation_redirect', 1, 30);
     }
     // update to latest version
     $latest_version = erp_get_version();
     update_option('wp_erp_version', $latest_version);
     update_option('wp_erp_db_version', $latest_version);
 }
Example #2
0
<div class="wrap about-wrap">
    <?php 
list($display_version) = explode('-', erp_get_version());
?>

    <h1><?php 
printf(esc_html__('Welcome to WP ERP', 'wp-erp'));
?>
</h1>

    <div class="about-text">
        <?php 
printf(esc_html__('Thank you for installing WP ERP %s!', 'wp-erp'), $display_version);
?>
    </div>

    <h2><?php 
_e('Getting Started', 'wp-erp');
?>
</h2>

    <ol>
        <li><?php 
printf(__('Setup %s', 'wp-erp'), sprintf('<a target="_blank" href="' . admin_url('admin.php?page=erp-company') . '">%s</a>', __('Company Information', 'wp-erp')));
?>
</li>
        <li><?php 
printf(__('Create %s', 'wp-erp'), sprintf('<a target="_blank" href="' . admin_url('admin.php?page=erp-hr-depts') . '">%s</a>', __('Departments', 'wp-erp')));
?>
</li>
        <li><?php