| @@ -1,11 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | Plugin Name: Borderless |
| 5 | -Plugin URI: https://borderless.visualmodo.com/ | |
| 5 | +Plugin URI: https://visualmodo.com/borderless/ | |
| 6 | 6 | Description: One service packed with powerful tools to help you reach your purposes. |
| 7 | -Version: 1.2.0 | |
| 7 | +Version: 1.4.9 | |
| 8 | 8 | Author: Visualmodo |
| 9 | 9 | Author URI: https://visualmodo.com |
| 10 | 10 | License: GPLv3 or later |
| 11 | 11 | Text Domain: borderless |
| @@ -19,15 +19,22 @@ | ||
| 19 | 19 | /*-----------------------------------------------------------------------------------*/ |
| 20 | 20 | /* *. Borderless Constants |
| 21 | 21 | /*-----------------------------------------------------------------------------------*/ |
| 22 | 22 | |
| 23 | -define( 'BORDERLESS__VERSION', '1.2.0' ); | |
| 23 | +define( 'BORDERLESS__VERSION', '1.4.9' ); | |
| 24 | 24 | define( 'BORDERLESS__DIR', plugin_dir_path( __FILE__ ) ); |
| 25 | 25 | define( 'BORDERLESS__URL', plugins_url( '/', __FILE__ ) ); |
| 26 | 26 | define( 'BORDERLESS__INC', BORDERLESS__DIR . '/includes' ); |
| 27 | -define( 'BORDERLESS__ASSETS', BORDERLESS__DIR . '/assets' ); | |
| 27 | +define( 'BORDERLESS__ASSETS', BORDERLESS__URL . 'assets/' ); | |
| 28 | +define( 'BORDERLESS__STYLES', BORDERLESS__ASSETS . 'styles/' ); | |
| 29 | +define( 'BORDERLESS__SCRIPTS', BORDERLESS__ASSETS . 'scripts/' ); | |
| 30 | +define( 'BORDERLESS__LIB', BORDERLESS__ASSETS . 'lib/' ); | |
| 31 | +define( 'BORDERLESS__LIBRARY__DIR', BORDERLESS__DIR . '/includes/library/' ); | |
| 32 | +define( 'BORDERLESS__LIBRARY__URL', BORDERLESS__URL . 'includes/library/' ); | |
| 33 | +define( 'BORDERLESS__BLOCK_EDITOR', BORDERLESS__DIR . '/modules/block-editor' ); | |
| 34 | +define( 'BORDERLESS__ELEMENTOR', BORDERLESS__DIR . '/modules/elementor' ); | |
| 28 | 35 | define( 'BORDERLESS__WPBAKERY', BORDERLESS__DIR . '/modules/wpbakery' ); |
| 29 | -define( 'BORDERLESS__ELEMENTOR', BORDERLESS__DIR . '/modules/elementor' ); | |
| 36 | +define( 'BORDERLESS__LIBS', BORDERLESS__DIR . '/modules/libraries' ); | |
| 30 | 37 | define( 'BORDERLESS__RELATED_POSTS', BORDERLESS__DIR . '/modules/related-posts' ); |
| 31 | 38 | |
| 32 | 39 | /*-----------------------------------------------------------------------------------*/ |
| 33 | 40 | /* *. Borderless Core |
| @@ -32,9 +39,218 @@ | ||
| 32 | 39 | /*-----------------------------------------------------------------------------------*/ |
| 33 | 40 | /* *. Borderless Core |
| 34 | 41 | /*-----------------------------------------------------------------------------------*/ |
| 35 | 42 | |
| 36 | -require plugin_dir_path( __FILE__ ) . 'includes/class-borderless.php'; | |
| 43 | +class Borderless { | |
| 44 | + | |
| 45 | + /** | |
| 46 | + * The loader that's responsible for maintaining and registering all hooks that power | |
| 47 | + * the plugin. | |
| 48 | + * | |
| 49 | + * @since 1.0.0 | |
| 50 | + * @access protected | |
| 51 | + * @var Borderless_Loader $loader Maintains and registers all hooks for the plugin. | |
| 52 | + */ | |
| 53 | + protected $loader; | |
| 54 | + | |
| 55 | + /** | |
| 56 | + * The unique identifier of this plugin. | |
| 57 | + * | |
| 58 | + * @since 1.0.0 | |
| 59 | + * @access protected | |
| 60 | + * @var string $plugin_name The string used to uniquely identify this plugin. | |
| 61 | + */ | |
| 62 | + protected $plugin_name; | |
| 63 | + | |
| 64 | + /** | |
| 65 | + * The current version of the plugin. | |
| 66 | + * | |
| 67 | + * @since 1.0.0 | |
| 68 | + * @access protected | |
| 69 | + * @var string $version The current version of the plugin. | |
| 70 | + */ | |
| 71 | + protected $version; | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * Define the core functionality of the plugin. | |
| 75 | + * | |
| 76 | + * Set the plugin name and the plugin version that can be used throughout the plugin. | |
| 77 | + * Load the dependencies, define the locale, and set the hooks for the admin area and | |
| 78 | + * the public-facing side of the site. | |
| 79 | + * | |
| 80 | + * @since 1.0.0 | |
| 81 | + */ | |
| 82 | + public function __construct() { | |
| 83 | + | |
| 84 | + if ( defined( 'BORDERLESS__VERSION' ) ) { | |
| 85 | + $this->version = BORDERLESS__VERSION; | |
| 86 | + } else { | |
| 87 | + $this->version = '1.0.0'; | |
| 88 | + } | |
| 89 | + $this->plugin_name = 'borderless'; | |
| 90 | + | |
| 91 | + $this->borderless_load_dependencies(); | |
| 92 | + $this->borderless_define_public_hooks(); | |
| 93 | + | |
| 94 | + } | |
| 95 | + | |
| 96 | + /** | |
| 97 | + * Define the core functionality of the plugin. | |
| 98 | + * | |
| 99 | + * Set the plugin name and the plugin version that can be used throughout the plugin. | |
| 100 | + * Load the dependencies, define the locale, and set the hooks for the admin area and | |
| 101 | + * the public-facing side of the site. | |
| 102 | + * | |
| 103 | + * @since 1.0.0 | |
| 104 | + */ | |
| 105 | + | |
| 106 | + public function borderless_load_dependencies() { | |
| 107 | + | |
| 108 | + $options = get_option( 'borderless' ); | |
| 109 | + | |
| 110 | + $theme = wp_get_theme(get_template()); | |
| 111 | + | |
| 112 | + /** | |
| 113 | + * Dashboard Page. | |
| 114 | + */ | |
| 115 | + | |
| 116 | + require_once( BORDERLESS__INC . "/templates/dashboard.php" ); | |
| 117 | + | |
| 118 | + /** | |
| 119 | + * License Manager. | |
| 120 | + */ | |
| 121 | + | |
| 122 | + if ( ! class_exists( 'BORDERLESS__LICENSE' ) ) { | |
| 123 | + require_once( BORDERLESS__INC . '/license/client.php' ); | |
| 124 | + } | |
| 125 | + | |
| 126 | + if ( class_exists( 'BORDERLESS__LICENSE' ) ) { | |
| 127 | + $borderless_license = new BORDERLESS__LICENSE( __FILE__, 168804, BORDERLESS__VERSION, 'plugin', 'https://visualmodo.com', 'Borderless' ); | |
| 128 | + } | |
| 129 | + | |
| 130 | + /** | |
| 131 | + * The class responsible for orchestrating the actions and filters of the | |
| 132 | + * core plugin. | |
| 133 | + */ | |
| 134 | + require_once( BORDERLESS__INC . "/class-borderless-loader.php" ); | |
| 135 | + | |
| 136 | + /** | |
| 137 | + * The class responsible for defining all actions that occur in the public-facing | |
| 138 | + * side of the site. | |
| 139 | + */ | |
| 140 | + require_once( BORDERLESS__INC . "/class-borderless-public.php" ); | |
| 141 | + | |
| 142 | + require_once( BORDERLESS__INC . "/templates/system-info.php" ); | |
| 143 | + require_once( BORDERLESS__INC . "/icon-manager/icon-manager.php" ); | |
| 144 | + require_once( BORDERLESS__INC . "/custom-post-types/custom-post-types.php" ); | |
| 145 | + require_once( BORDERLESS__INC . "/svg/svg.php" ); | |
| 146 | + require_once( BORDERLESS__BLOCK_EDITOR . "/contact-information/contact-information.php" ); | |
| 147 | + require_once( BORDERLESS__BLOCK_EDITOR . "/social-icons/social-icons.php" ); | |
| 148 | + require_once( BORDERLESS__BLOCK_EDITOR . "/spacer/spacer.php" ); | |
| 149 | + require_once( BORDERLESS__ELEMENTOR . "/elementor.php" ); | |
| 150 | + require_once( BORDERLESS__WPBAKERY . "/wpbakery.php" ); | |
| 151 | + require_once( BORDERLESS__INC . "/widgets/button.php" ); | |
| 152 | + require_once( BORDERLESS__INC . "/widgets/contact-info.php" ); | |
| 153 | + require_once( BORDERLESS__INC . "/widgets/divider.php" ); | |
| 154 | + require_once( BORDERLESS__INC . "/widgets/search.php" ); | |
| 155 | + require_once( BORDERLESS__INC . "/widgets/social-media.php" ); | |
| 156 | + require_once( BORDERLESS__INC . "/widgets/spacer.php" ); | |
| 157 | + require_once( BORDERLESS__INC . "/helper.php" ); | |
| 158 | + | |
| 159 | + if ( isset( $options['related_posts'] ) ) { | |
| 160 | + require_once( BORDERLESS__RELATED_POSTS . "/related-posts.php" ); | |
| 161 | + } | |
| 162 | + | |
| 163 | + if ( $theme == 'Anzu' ) { | |
| 164 | + require_once( BORDERLESS__INC . "/custom-post-types/anzu-templates.php" ); | |
| 165 | + } | |
| 166 | + | |
| 167 | + if ( $theme != 'Aesir' && $theme != 'Architect' && $theme != 'Beyond' && $theme != 'Cafe' && $theme != 'Church' && $theme != 'Construction' && $theme != 'Cryptocurrency' && $theme != 'Dark' && $theme != 'Edge' && $theme != 'Education' && $theme != 'Employment' && $theme != 'Financial' && $theme != 'Fitness' && $theme != 'Food' && $theme != 'Forum' && $theme != 'Gym' && $theme != 'Hotel' && $theme != 'Ink' && $theme != 'It' && $theme != 'Marvel' && $theme != 'Mechanic' && $theme != 'Medical' && $theme != 'Minimalist' && $theme != 'Music' && $theme != 'Nectar' && $theme != 'Nonprofit' && $theme != 'Peak' && $theme != 'Petshop' && $theme != 'Photography' && $theme != 'Politic' && $theme != 'Rare' && $theme != 'Realestate' && $theme != 'Resume' && $theme != 'Salon' && $theme != 'Seller' && $theme != 'Spark' && $theme != 'Sport' && $theme != 'Stream' && $theme != 'Traveler' && $theme != 'Visualmentor' && $theme != 'Wedding' && $theme != 'Winehouse' && $theme != 'Zenith' ) { | |
| 168 | + | |
| 169 | + require_once( BORDERLESS__LIBRARY__DIR . "templates/templates.php" ); | |
| 170 | + require_once( BORDERLESS__LIBRARY__DIR . "importer.php" ); | |
| 171 | + | |
| 172 | + } | |
| 173 | + | |
| 174 | + $this->loader = new Borderless_Loader(); | |
| 175 | + | |
| 176 | + } | |
| 177 | + | |
| 178 | + /** | |
| 179 | + * Register all of the hooks related to the public-facing functionality | |
| 180 | + * of the plugin. | |
| 181 | + * | |
| 182 | + * @since 1.0.0 | |
| 183 | + * @access private | |
| 184 | + */ | |
| 185 | + private function borderless_define_public_hooks() { | |
| 186 | + | |
| 187 | + $plugin_public = new Borderless_Public( $this->get_plugin_name(), $this->get_version() ); | |
| 188 | + | |
| 189 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); | |
| 190 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); | |
| 191 | + | |
| 192 | + function borderless_settings_colors() { | |
| 193 | + $options = get_option( 'borderless' ); | |
| 194 | + | |
| 195 | + ?> | |
| 196 | + <style type="text/css"> | |
| 197 | + | |
| 198 | + :root { | |
| 199 | + --borderless-color-primary: <?php echo esc_attr( $options['primary_color'], '#0000FF' ); ?>; | |
| 200 | + --borderless-secondary-primary: <?php echo esc_attr( $options['secondary_color'], '#FF6819' ); ?>; | |
| 201 | + --borderless-color-tertiary: <?php echo esc_attr( $options['tertiary_color'], '#3FCC14' ); ?>; | |
| 202 | + } | |
| 203 | + | |
| 204 | + </style> | |
| 205 | + <?php | |
| 206 | + | |
| 207 | + } | |
| 208 | + add_action( 'wp_head', 'borderless_settings_colors' ); | |
| 209 | + | |
| 210 | + } | |
| 211 | + | |
| 212 | + /** | |
| 213 | + * Run the loader to execute all of the hooks with WordPress. | |
| 214 | + * | |
| 215 | + * @since 1.0.0 | |
| 216 | + */ | |
| 217 | + public function run() { | |
| 218 | + $this->loader->run(); | |
| 219 | + } | |
| 220 | + | |
| 221 | + /** | |
| 222 | + * The name of the plugin used to uniquely identify it within the context of | |
| 223 | + * WordPress and to define internationalization functionality. | |
| 224 | + * | |
| 225 | + * @since 1.0.0 | |
| 226 | + * @return string The name of the plugin. | |
| 227 | + */ | |
| 228 | + public function get_plugin_name() { | |
| 229 | + return $this->plugin_name; | |
| 230 | + } | |
| 231 | + | |
| 232 | + /** | |
| 233 | + * The reference to the class that orchestrates the hooks with the plugin. | |
| 234 | + * | |
| 235 | + * @since 1.0.0 | |
| 236 | + * @return Borderless_Loader Orchestrates the hooks of the plugin. | |
| 237 | + */ | |
| 238 | + public function get_loader() { | |
| 239 | + return $this->loader; | |
| 240 | + } | |
| 241 | + | |
| 242 | + /** | |
| 243 | + * Retrieve the version number of the plugin. | |
| 244 | + * | |
| 245 | + * @since 1.0.0 | |
| 246 | + * @return string The version number of the plugin. | |
| 247 | + */ | |
| 248 | + public function get_version() { | |
| 249 | + return $this->version; | |
| 250 | + } | |
| 251 | + | |
| 252 | +} | |
| 37 | 253 | |
| 38 | 254 | /*-----------------------------------------------------------------------------------*/ |
| 39 | 255 | /* *. Borderless Init |
| 40 | 256 | /*-----------------------------------------------------------------------------------*/ |