| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: 3DPrint Lite |
| 4 |
Description: A plugin for selling 3D printing services. |
| 5 |
Author: Sergey Burkov |
| 6 |
Text Domain: 3dprint-lite |
| 7 |
Plugin URI: http://www.wp3dprinting.com |
| 8 |
Version: 2.1.8 |
| 9 |
*/ |
| 10 |
|
| 11 |
if ( ! defined( 'ABSPATH' ) ) { |
| 12 |
exit; // Exit if accessed directly |
| 13 |
} |
| 14 |
|
| 15 |
define('P3DLITE_VERSION', '2.1.8'); |
| 16 |
|
| 17 |
if ( !function_exists( 'get_home_path' ) ) { |
| 18 |
require_once ABSPATH . '/wp-admin/includes/file.php'; |
| 19 |
} |
| 20 |
|
| 21 |
include 'includes/3dprint-lite-functions.php'; |
| 22 |
|
| 23 |
if ( is_admin() ) { |
| 24 |
add_action( 'admin_enqueue_scripts', 'p3dlite_enqueue_scripts_backend' ); |
| 25 |
add_action( 'wp_ajax_p3dlite_handle_upload', 'p3dlite_handle_upload' ); |
| 26 |
add_action( 'wp_ajax_nopriv_p3dlite_handle_upload', 'p3dlite_handle_upload' ); |
| 27 |
include 'includes/3dprint-lite-admin.php'; |
| 28 |
} |
| 29 |
else { |
| 30 |
add_action( 'wp_enqueue_scripts', 'p3dlite_enqueue_scripts_frontend' ); |
| 31 |
include 'includes/3dprint-lite-frontend.php'; |
| 32 |
} |
| 33 |
|
| 34 |
register_activation_hook( __FILE__, 'p3dlite_activate' ); |
| 35 |
register_deactivation_hook( __FILE__, 'p3dlite_deactivate' ); |
| 36 |
|
| 37 |
add_action('init', 'p3dlite_check_installation'); |
| 38 |
function p3dlite_check_installation() { |
| 39 |
if ( ! function_exists( 'get_plugin_data' ) ) { |
| 40 |
require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 41 |
} |
| 42 |
$p3d_plugin_data = get_plugin_data( __FILE__ ); |
| 43 |
$p3d_current_version = get_option('p3dlite_version'); |
| 44 |
|
| 45 |
if (!empty($p3d_current_version) && version_compare($p3d_current_version, $p3d_plugin_data['Version'], '<')) { |
| 46 |
p3dlite_check_install(); |
| 47 |
} |
| 48 |
} |
| 49 |
?> |