| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 3 |
|
| 4 |
/* |
| 5 |
Plugin Name: WP Store Locator |
| 6 |
Description: An easy to use location management system that enables users to search for nearby physical stores |
| 7 |
Author: Tijmen Smit |
| 8 |
Author URI: https://wpstorelocator.co/ |
| 9 |
Version: 2.3.23 |
| 10 |
Text Domain: wp-store-locator |
| 11 |
Domain Path: /languages/ |
| 12 |
License: GPL v3 |
| 13 |
|
| 14 |
WP Store Locator |
| 15 |
Copyright (C) 2013 Tijmen Smit - tijmen@wpstorelocator.co |
| 16 |
|
| 17 |
This program is free software: you can redistribute it and/or modify |
| 18 |
it under the terms of the GNU General Public License as published by |
| 19 |
the Free Software Foundation, either version 3 of the License, or |
| 20 |
(at your option) any later version. |
| 21 |
|
| 22 |
This program is distributed in the hope that it will be useful, |
| 23 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 24 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 25 |
GNU General Public License for more details. |
| 26 |
|
| 27 |
You should have received a copy of the GNU General Public License |
| 28 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 29 |
|
| 30 |
@package WP_Store_locator |
| 31 |
@category Core |
| 32 |
@author Tijmen Smit |
| 33 |
*/ |
| 34 |
|
| 35 |
if ( ! class_exists( 'WP_Store_locator' ) ) { |
| 36 |
|
| 37 |
class WP_Store_locator { |
| 38 |
|
| 39 |
/** |
| 40 |
* WPSL Custom post type object. |
| 41 |
* |
| 42 |
* @var object|WPSL_Post_Types |
| 43 |
* @since 2.0.0 |
| 44 |
*/ |
| 45 |
public $post_types; |
| 46 |
|
| 47 |
/** |
| 48 |
* WPSL_i18n object. |
| 49 |
* |
| 50 |
* @var object|WPSL_i18n |
| 51 |
* @since 2.0.0 |
| 52 |
*/ |
| 53 |
public $i18n; |
| 54 |
|
| 55 |
/** |
| 56 |
* WPSL_Frontend object. |
| 57 |
* |
| 58 |
* @var object|WPSL_Frontend |
| 59 |
* @since 2.2.14 |
| 60 |
*/ |
| 61 |
public $frontend; |
| 62 |
|
| 63 |
/** |
| 64 |
* WPSL_Templates object. |
| 65 |
* |
| 66 |
* @var object|WPSL_Templates |
| 67 |
* @since 2.2.11 |
| 68 |
*/ |
| 69 |
public $templates; |
| 70 |
|
| 71 |
/** |
| 72 |
* Class constructor |
| 73 |
*/ |
| 74 |
function __construct() { |
| 75 |
|
| 76 |
$this->define_constants(); |
| 77 |
$this->includes(); |
| 78 |
|
| 79 |
add_action( 'init', array( $this, 'plugin_settings' ) ); |
| 80 |
|
| 81 |
// Load classes |
| 82 |
$this->post_types = new WPSL_Post_Types(); |
| 83 |
$this->i18n = new WPSL_i18n(); |
| 84 |
$this->frontend = new WPSL_Frontend(); |
| 85 |
$this->templates = new WPSL_Templates(); |
| 86 |
|
| 87 |
register_activation_hook( __FILE__, array( $this, 'install' ) ); |
| 88 |
} |
| 89 |
|
| 90 |
/** |
| 91 |
* Setup plugin constants. |
| 92 |
* |
| 93 |
* @since 1.0.0 |
| 94 |
* @return void |
| 95 |
*/ |
| 96 |
public function define_constants() { |
| 97 |
|
| 98 |
if ( !defined( 'WPSL_VERSION_NUM' ) ) |
| 99 |
define( 'WPSL_VERSION_NUM', '2.3.23' ); |
| 100 |
|
| 101 |
if ( !defined( 'WPSL_URL' ) ) |
| 102 |
define( 'WPSL_URL', plugin_dir_url( __FILE__ ) ); |
| 103 |
|
| 104 |
if ( !defined( 'WPSL_BASENAME' ) ) |
| 105 |
define( 'WPSL_BASENAME', plugin_basename( __FILE__ ) ); |
| 106 |
|
| 107 |
if ( !defined( 'WPSL_PLUGIN_DIR' ) ) |
| 108 |
define( 'WPSL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 109 |
} |
| 110 |
|
| 111 |
/** |
| 112 |
* Include the required files. |
| 113 |
* |
| 114 |
* @since 2.0.0 |
| 115 |
* @return void |
| 116 |
*/ |
| 117 |
public function includes() { |
| 118 |
|
| 119 |
require_once( WPSL_PLUGIN_DIR . 'inc/wpsl-functions.php' ); |
| 120 |
require_once( WPSL_PLUGIN_DIR . 'inc/wpsl-exclude-optimization.php' ); |
| 121 |
require_once( WPSL_PLUGIN_DIR . 'inc/class-templates.php' ); |
| 122 |
require_once( WPSL_PLUGIN_DIR . 'inc/class-post-types.php' ); |
| 123 |
require_once( WPSL_PLUGIN_DIR . 'inc/class-i18n.php' ); |
| 124 |
require_once( WPSL_PLUGIN_DIR . 'frontend/class-frontend.php' ); |
| 125 |
require_once( WPSL_PLUGIN_DIR . 'admin/class-block.php' ); |
| 126 |
|
| 127 |
if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) { |
| 128 |
require_once( WPSL_PLUGIN_DIR . 'admin/roles.php' ); |
| 129 |
require_once( WPSL_PLUGIN_DIR . 'admin/class-admin.php' ); |
| 130 |
} |
| 131 |
} |
| 132 |
|
| 133 |
/** |
| 134 |
* Setup the plugin settings. |
| 135 |
* |
| 136 |
* @since 2.0.0 |
| 137 |
* @return void |
| 138 |
*/ |
| 139 |
public function plugin_settings() { |
| 140 |
|
| 141 |
global $wpsl_settings, $wpsl_default_settings; |
| 142 |
|
| 143 |
$wpsl_settings = wpsl_get_settings(); |
| 144 |
$wpsl_default_settings = wpsl_get_default_settings(); |
| 145 |
} |
| 146 |
|
| 147 |
/** |
| 148 |
* Install the plugin data. |
| 149 |
* |
| 150 |
* @since 2.0.0 |
| 151 |
* @return void |
| 152 |
*/ |
| 153 |
public function install( $network_wide ) { |
| 154 |
require_once( WPSL_PLUGIN_DIR . 'inc/install.php' ); |
| 155 |
|
| 156 |
wpsl_install( $network_wide ); |
| 157 |
} |
| 158 |
} |
| 159 |
|
| 160 |
$GLOBALS['wpsl'] = new WP_Store_locator(); |
| 161 |
} |