PluginProbe
Ultimate Cursor – Interactive and Animated Custom Cursor and Background Effects Toolkit / 1.7.6
Ultimate Cursor – Interactive and Animated Custom Cursor and Background Effects Toolkit v1.7.6
2.4.1 2.4.0 2.3.3 2.3.2 2.3.1 2.3.0 2.2.3 2.2.2 2.2.1 trunk 1.0.0 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 All 56 releases
ultimate-cursor / ultimate-cursor.php

ultimate-cursor.php in Ultimate Cursor – Interactive and Animated Custom Cursor and Background Effects Toolkit 1.7.6, at ultimate-cursor.php

221 lines 5.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Plugin Name: Ultimate Cursor – Interactive and Animated Cursor Effects Toolkit
5 * Plugin URI: https://wordpress.org/plugins/ultimate-cursor
6 * Description: Make Your Website Stand Out with Unique Cursor Effects and Smooth Animations!🚀
7 * Version: 1.7.6
8 * Author: WPXERO
9 * Author URI: https://wpxero.com/ultimate-cursor
10 * Requires at least: 6.0
11 * Requires PHP: 7.4
12 * License: GPL3
13 * License URI: http://www.gnu.org/licenses/gpl-3.0.html
14 * Text Domain: ultimate-cursor
15 * Elementor requires at least: 3.0.0
16 * Elementor tested up to: 3.32.5
17 */
18
19
20 if (! defined('ABSPATH')) {
21 exit;
22 }
23
24 if (! defined('UCA_VERSION')) {
25 define('UCA_VERSION', '1.7.6');
26 }
27
28
29
30 /**
31 * UltimateCursor Class
32 */
33 class UltimateCursor {
34 /**
35 * The single class instance.
36 *
37 * @var $instance
38 */
39 private static $instance = null;
40 const VERSION = UCA_VERSION;
41 const MINIMUM_ELEMENTOR_VERSION = '3.0.0';
42 const MINIMUM_PHP_VERSION = '7.0';
43 /**
44 * Main Instance
45 * Ensures only one instance of this class exists in memory at any one time.
46 */
47 public static function instance() {
48 if (is_null(self::$instance)) {
49 self::$instance = new self();
50 self::$instance->init();
51 }
52 return self::$instance;
53 }
54
55 /**
56 * Path to the plugin directory
57 *
58 * @var $plugin_path
59 */
60 public $plugin_path;
61
62 /**
63 * URL to the plugin directory
64 *
65 * @var $plugin_url
66 */
67 public $plugin_url;
68 public $minimum_elementor_version;
69 public $minimum_php_version;
70
71 /**
72 * Ultimate Cursor constructor.
73 */
74 public function __construct() {
75 /* We do nothing here! */
76 }
77
78 /**
79 * Init options
80 */
81 public function init() {
82 $this->plugin_path = plugin_dir_path(__FILE__);
83 $this->plugin_url = plugin_dir_url(__FILE__);
84 $this->minimum_elementor_version = self::MINIMUM_ELEMENTOR_VERSION;
85 $this->minimum_php_version = self::MINIMUM_PHP_VERSION;
86
87
88 // include helper files.
89 $this->include_dependencies();
90 $this->init_freemius();
91
92 // hooks.
93 add_filter('user_has_cap', [$this, 'user_has_cap'], 10, 4);
94
95 // Disable Freemius license activation notice
96 // add_filter('fs_show_trial_notice_ultimate_cursor', '__return_false');
97
98 // init freemius.
99 }
100
101 public function init_freemius() {
102 if (!function_exists('ultimate_cursor_fs')) {
103 // Create a helper function for easy SDK access.
104 function ultimate_cursor_fs() {
105 global $ultimate_cursor_fs;
106
107 if (!isset($ultimate_cursor_fs)) {
108 // Activate multisite network integration.
109 if (!defined('WP_FS__PRODUCT_19720_MULTISITE')) {
110 define('WP_FS__PRODUCT_19720_MULTISITE', true);
111 }
112
113 // Include Freemius SDK.
114 $ultimate_cursor_fs = fs_dynamic_init(array(
115 'id' => '19720',
116 'slug' => 'ultimate-cursor',
117 'premium_slug' => 'ultimate-cursor-pro',
118 'type' => 'plugin',
119 'public_key' => 'pk_fb94765a4f619e83979c2825626c2',
120 'is_premium' => false,
121 'is_premium_only' => false,
122 'has_paid_plans' => true,
123 'is_live' => true,
124 'is_org_compliant' => true,
125 'parallel_activation' => array(
126 'enabled' => true,
127 'premium_version_basename' => 'ultimate-cursor-pro/ultimate-cursor-pro.php',
128 ),
129 'menu' => array(
130 'slug' => 'ultimate-cursor',
131 'first-path' => 'admin.php?page=ultimate-cursor',
132 'support' => false,
133 'contact' => false,
134 'pricing' => true,
135 ),
136 ));
137 }
138
139 return $ultimate_cursor_fs;
140 }
141
142 // Init Freemius.
143 ultimate_cursor_fs();
144 do_action('ultimate_cursor_fs_loaded');
145 }
146 }
147
148
149
150
151 public function user_has_cap($allcaps, $caps, $args, $user) {
152 if (is_user_logged_in() && in_array('upload_files', $caps)) {
153 $allcaps['upload_files'] = true;
154 }
155 return $allcaps;
156 }
157
158 /**
159 * Include dependencies
160 */
161 private function include_dependencies() {
162 require_once $this->plugin_path . 'classes/class-admin.php';
163 require_once $this->plugin_path . 'classes/class-assets.php';
164 require_once $this->plugin_path . 'classes/class-rest.php';
165 require_once $this->plugin_path . 'vendor/freemius/wordpress-sdk/start.php';
166 if (did_action('elementor/loaded')) {
167 require_once $this->plugin_path . 'classes/class-elementor.php';
168 }
169
170 if (!class_exists('Ultimate_Cursor_Pro')) {
171 require_once $this->plugin_path . 'classes/class-dashboard-widget.php';
172 }
173 }
174
175 /**
176 * Activation Hook
177 */
178 public function activation_hook() {
179 // Welcome Page Flag.
180 set_transient('_ultimate_cursor_welcome_screen_activation_redirect', true, 30);
181 }
182
183 /**
184 * Deactivation Hook
185 */
186 public function deactivation_hook() {
187 }
188 }
189
190 /**
191 * Function works with the Loader class instance
192 *
193 * @return object UltimateCursor
194 */
195 function ultimate_cursor() {
196 return UltimateCursor::instance();
197 }
198 add_action('plugins_loaded', 'ultimate_cursor');
199 add_action('admin_notices', function () {
200 if (function_exists('ultimate_cursor_fs')) {
201 ultimate_cursor_fs();
202 }
203 });
204 register_activation_hook(__FILE__, [ultimate_cursor(), 'activation_hook']);
205 register_deactivation_hook(__FILE__, [ultimate_cursor(), 'deactivation_hook']);
206
207 /**
208 * Get menu parameters for premium features
209 * This function is called when the pro version is active
210 */
211 function get_menu_params__premium_only() {
212 return array(
213 'slug' => 'ultimate-cursor',
214 'first-path' => 'admin.php?page=ultimate-cursor',
215 'account' => true,
216 'support' => false,
217 'contact' => false,
218 'pricing' => true,
219 );
220 }
221