| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Clever Fox |
| 4 |
* Description: Clever Fox plugin to enhance the functionality for free themes made by Nayra Themes. More than 60000+ trusted websites with Nayra Themes. It provides intuitive features to your website. 45+ Themes compatible with Clever Fox. See below free themes listed here. Avril, Gradiant, Flavita, Fiona Blog, MetaSoft, Conceptly & ColorPress is one of highest installations themes in our collections. Visit our website and find theme as you need. https://www.nayrathemes.com/themes/ |
| 5 |
* Version: 30.0 |
| 6 |
* Author: nayrathemes |
| 7 |
* Author URI: https://nayrathemes.com |
| 8 |
* Requires at least : 4.6 or higher |
| 9 |
* License: GPLv3 or later |
| 10 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html |
| 11 |
* Text Domain: clever-fox |
| 12 |
* Requires PHP: 7.4 |
| 13 |
*/ |
| 14 |
|
| 15 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 16 |
|
| 17 |
define( 'CLEVERFOX_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
| 18 |
define( 'CLEVERFOX_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 19 |
define( 'CLEVERFOX_FOOTER_ABOUT', 'There are many variations of dummy passages of Lorem Ipsum a available, but the majority have suffered that is alteration in some that form injected humour or randomised' ); |
| 20 |
|
| 21 |
function cleverfox_activate() { |
| 22 |
|
| 23 |
/** |
| 24 |
* Load Custom control in Customizer |
| 25 |
*/ |
| 26 |
define( 'CLEVERFOX_DIRECTORY', plugin_dir_url( __FILE__ ) . '/inc/custom-controls/' ); |
| 27 |
define( 'CLEVERFOX_DIRECTORY_URI', plugin_dir_url( __FILE__ ) . '/inc/custom-controls/' ); |
| 28 |
if ( class_exists( 'WP_Customize_Control' ) ) { |
| 29 |
require_once('inc/custom-controls/controls/range-validator/range-control.php'); |
| 30 |
require_once CLEVERFOX_PLUGIN_DIR . 'inc/upgrade/init.php'; |
| 31 |
} |
| 32 |
|
| 33 |
$cleverfox_theme = wp_get_theme(); // gets the current theme |
| 34 |
if ( 'StartKit' == $cleverfox_theme->name){ |
| 35 |
require_once('inc/startkit/startkit.php'); |
| 36 |
} |
| 37 |
|
| 38 |
if ( 'StartBiz' == $cleverfox_theme->name){ |
| 39 |
require_once('inc/startbiz/startbiz.php'); |
| 40 |
} |
| 41 |
|
| 42 |
if ('Arowana' == $cleverfox_theme->name){ |
| 43 |
require_once('inc/arowana/arowana.php'); |
| 44 |
} |
| 45 |
|
| 46 |
if ('Envira' == $cleverfox_theme->name){ |
| 47 |
require_once('inc/envira/envira.php'); |
| 48 |
} |
| 49 |
|
| 50 |
if( 'Hantus' == $cleverfox_theme->name){ |
| 51 |
require_once('inc/hantus/hantus.php'); |
| 52 |
} |
| 53 |
|
| 54 |
if( 'Thai Spa' == $cleverfox_theme->name){ |
| 55 |
require_once('inc/thai-spa/thai-spa.php'); |
| 56 |
} |
| 57 |
|
| 58 |
if( 'Conceptly' == $cleverfox_theme->name){ |
| 59 |
require_once('inc/conceptly/conceptly.php'); |
| 60 |
} |
| 61 |
|
| 62 |
if( 'Ameya' == $cleverfox_theme->name){ |
| 63 |
require_once('inc/ameya/ameya.php'); |
| 64 |
} |
| 65 |
|
| 66 |
if( 'Azwa' == $cleverfox_theme->name){ |
| 67 |
require_once('inc/azwa/azwa.php'); |
| 68 |
} |
| 69 |
|
| 70 |
if( 'Avril' == $cleverfox_theme->name){ |
| 71 |
require_once('inc/avril/avril.php'); |
| 72 |
} |
| 73 |
|
| 74 |
if( 'Aera' == $cleverfox_theme->name){ |
| 75 |
require_once('inc/aera/aera.php'); |
| 76 |
} |
| 77 |
|
| 78 |
if( 'Avail' == $cleverfox_theme->name){ |
| 79 |
require_once('inc/avail/avail.php'); |
| 80 |
} |
| 81 |
|
| 82 |
if( 'Avtari' == $cleverfox_theme->name){ |
| 83 |
require_once('inc/avtari/avtari.php'); |
| 84 |
} |
| 85 |
|
| 86 |
if( 'Fiona Blog' == $cleverfox_theme->name){ |
| 87 |
require_once('inc/fiona-blog/fiona-blog.php'); |
| 88 |
} |
| 89 |
|
| 90 |
if( 'MetaSoft' == $cleverfox_theme->name ){ |
| 91 |
require_once('inc/metasoft/metasoft.php'); |
| 92 |
} |
| 93 |
|
| 94 |
if( 'Belltech' == $cleverfox_theme->name){ |
| 95 |
require_once('inc/belltech/belltech.php'); |
| 96 |
} |
| 97 |
|
| 98 |
if( 'Fiona Food' == $cleverfox_theme->name){ |
| 99 |
require_once('inc/fiona-food/fiona-food.php'); |
| 100 |
} |
| 101 |
|
| 102 |
if( 'Fiona News' == $cleverfox_theme->name){ |
| 103 |
require_once('inc/fiona-news/fiona-news.php'); |
| 104 |
} |
| 105 |
|
| 106 |
if( 'Axtia' == $cleverfox_theme->name){ |
| 107 |
require_once('inc/axtria/axtria.php'); |
| 108 |
} |
| 109 |
|
| 110 |
if( 'Aravalli' == $cleverfox_theme->name){ |
| 111 |
require_once('inc/aravalli/aravalli.php'); |
| 112 |
} |
| 113 |
|
| 114 |
if( 'Arbuda' == $cleverfox_theme->name){ |
| 115 |
require_once('inc/arbuda/arbuda.php'); |
| 116 |
} |
| 117 |
|
| 118 |
if( 'Boostify' == $cleverfox_theme->name){ |
| 119 |
require_once('inc/boostify/boostify.php'); |
| 120 |
} |
| 121 |
|
| 122 |
if( 'Gradiant' == $cleverfox_theme->name){ |
| 123 |
require_once('inc/gradiant/gradiant.php'); |
| 124 |
} |
| 125 |
|
| 126 |
if( 'Aviser' == $cleverfox_theme->name){ |
| 127 |
require_once('inc/aviser/aviser.php'); |
| 128 |
} |
| 129 |
|
| 130 |
if( 'Comoxa' == $cleverfox_theme->name){ |
| 131 |
require_once('inc/comoxa/comoxa.php'); |
| 132 |
} |
| 133 |
|
| 134 |
if( 'Techine' == $cleverfox_theme->name){ |
| 135 |
require_once('inc/techine/techine.php'); |
| 136 |
} |
| 137 |
|
| 138 |
if( 'ColorPress' == $cleverfox_theme->name){ |
| 139 |
require_once('inc/colorpress/colorpress.php'); |
| 140 |
} |
| 141 |
|
| 142 |
if( 'Flavita' == $cleverfox_theme->name){ |
| 143 |
require_once('inc/flavita/flavita.php'); |
| 144 |
} |
| 145 |
|
| 146 |
if( 'Avitech' == $cleverfox_theme->name){ |
| 147 |
require_once('inc/avitech/avitech.php'); |
| 148 |
} |
| 149 |
|
| 150 |
if( 'Colorsy' == $cleverfox_theme->name){ |
| 151 |
require_once('inc/colorsy/colorsy.php'); |
| 152 |
} |
| 153 |
|
| 154 |
if( 'Ampark' == $cleverfox_theme->name){ |
| 155 |
require_once('inc/ampark/ampark.php'); |
| 156 |
} |
| 157 |
|
| 158 |
if( 'Eduvert' == $cleverfox_theme->name){ |
| 159 |
require_once('inc/eduvert/eduvert.php'); |
| 160 |
} |
| 161 |
|
| 162 |
if( 'Varuda' == $cleverfox_theme->name){ |
| 163 |
require_once('inc/varuda/varuda.php'); |
| 164 |
} |
| 165 |
|
| 166 |
if( 'Cosmics' == $cleverfox_theme->name){ |
| 167 |
require_once('inc/cosmics/cosmics.php'); |
| 168 |
} |
| 169 |
|
| 170 |
if( 'StartWeb' == $cleverfox_theme->name){ |
| 171 |
require_once('inc/startweb/startweb.php'); |
| 172 |
} |
| 173 |
|
| 174 |
if( 'Appointo' == $cleverfox_theme->name){ |
| 175 |
require_once('inc/appointo/appointo.php'); |
| 176 |
} |
| 177 |
|
| 178 |
if( 'Renoval' == $cleverfox_theme->name){ |
| 179 |
require_once('inc/renoval/renoval.php'); |
| 180 |
} |
| 181 |
|
| 182 |
if( 'Builderse' == $cleverfox_theme->name){ |
| 183 |
require_once('inc/builderse/builderse.php'); |
| 184 |
} |
| 185 |
|
| 186 |
if( 'Eractor' == $cleverfox_theme->name){ |
| 187 |
require_once('inc/eractor/eractor.php'); |
| 188 |
} |
| 189 |
|
| 190 |
if( 'Medazin' == $cleverfox_theme->name){ |
| 191 |
require_once('inc/medazin/medazin.php'); |
| 192 |
} |
| 193 |
|
| 194 |
if( 'Medisafe' == $cleverfox_theme->name){ |
| 195 |
require_once('inc/medisafe/medisafe.php'); |
| 196 |
} |
| 197 |
|
| 198 |
if( 'TimeBlog' == $cleverfox_theme->name){ |
| 199 |
require_once('inc/timeblog/timeblog.php'); |
| 200 |
} |
| 201 |
|
| 202 |
if( 'Convo' == $cleverfox_theme->name){ |
| 203 |
require_once('inc/convo/convo.php'); |
| 204 |
} |
| 205 |
|
| 206 |
if( 'Avenza' == $cleverfox_theme->name){ |
| 207 |
require_once('inc/avenza/avenza.php'); |
| 208 |
} |
| 209 |
|
| 210 |
if( 'CardioPress' == $cleverfox_theme->name){ |
| 211 |
require_once('inc/cardiopress/cardiopress.php'); |
| 212 |
} |
| 213 |
|
| 214 |
if( 'DoctorHub' == $cleverfox_theme->name){ |
| 215 |
require_once('inc/doctorhub/doctorhub.php'); |
| 216 |
} |
| 217 |
|
| 218 |
if( 'Accron' == $cleverfox_theme->name){ |
| 219 |
require_once('inc/accron/accron.php'); |
| 220 |
} |
| 221 |
|
| 222 |
if( 'Acronix' == $cleverfox_theme->name){ |
| 223 |
require_once('inc/acronix/acronix.php'); |
| 224 |
} |
| 225 |
|
| 226 |
if( 'Evita' == $cleverfox_theme->name){ |
| 227 |
require_once('inc/evita/evita.php'); |
| 228 |
} |
| 229 |
|
| 230 |
if( 'Corpex' == $cleverfox_theme->name){ |
| 231 |
require_once('inc/corpex/corpex.php'); |
| 232 |
} |
| 233 |
|
| 234 |
if( 'Cormex' == $cleverfox_theme->name){ |
| 235 |
require_once('inc/cormex/cormex.php'); |
| 236 |
} |
| 237 |
|
| 238 |
if( 'Profolio' == $cleverfox_theme->name){ |
| 239 |
require_once('inc/profolio/profolio.php'); |
| 240 |
} |
| 241 |
|
| 242 |
if( 'VillaPress' == $cleverfox_theme->name){ |
| 243 |
require_once('inc/villapress/villapress.php'); |
| 244 |
} |
| 245 |
|
| 246 |
if( 'NexCraft' == $cleverfox_theme->name){ |
| 247 |
require_once('inc/nexcraft/nexcraft.php'); |
| 248 |
} |
| 249 |
|
| 250 |
if( 'Evion' == $cleverfox_theme->name){ |
| 251 |
require_once('inc/evion/evion.php'); |
| 252 |
} |
| 253 |
|
| 254 |
if( 'Nexcraft BPO' == $cleverfox_theme->name){ |
| 255 |
require_once('inc/nexcraft-bpo/nexcraft-bpo.php'); |
| 256 |
} |
| 257 |
|
| 258 |
if( 'GradiantX' == $cleverfox_theme->name){ |
| 259 |
require_once('inc/gradiantx/gradiantx.php'); |
| 260 |
} |
| 261 |
|
| 262 |
if( 'ColorFlow' == $cleverfox_theme->name){ |
| 263 |
require_once('inc/colorflow/colorflow.php'); |
| 264 |
} |
| 265 |
|
| 266 |
if( 'Shadiant' == $cleverfox_theme->name){ |
| 267 |
require_once('inc/shadiant/shadiant.php'); |
| 268 |
} |
| 269 |
if( 'Webique' == $cleverfox_theme->name){ |
| 270 |
require_once('inc/webique/webique.php'); |
| 271 |
} |
| 272 |
if( 'Websy' == $cleverfox_theme->name){ |
| 273 |
require_once('inc/websy/websy.php'); |
| 274 |
} |
| 275 |
if( 'Webora' == $cleverfox_theme->name){ |
| 276 |
require_once('inc/webora/webora.php'); |
| 277 |
} |
| 278 |
if( 'WebAura' == $cleverfox_theme->name){ |
| 279 |
require_once('inc/webaura/webaura.php'); |
| 280 |
} |
| 281 |
if( 'News 25' == $cleverfox_theme->name){ |
| 282 |
require_once('inc/news-25/news-25.php'); |
| 283 |
} |
| 284 |
if( 'News25 Live' == $cleverfox_theme->name){ |
| 285 |
require_once('inc/news25-live/news25-live.php'); |
| 286 |
} |
| 287 |
if( 'News25 Prime' == $cleverfox_theme->name){ |
| 288 |
require_once('inc/news25-prime/news25-prime.php'); |
| 289 |
} |
| 290 |
if( 'News25 Breaking' == $cleverfox_theme->name){ |
| 291 |
require_once('inc/news25-breaking/news25-breaking.php'); |
| 292 |
} |
| 293 |
if( 'News25 Press' == $cleverfox_theme->name){ |
| 294 |
require_once('inc/news25-press/news25-press.php'); |
| 295 |
} |
| 296 |
if( 'News25 Headline' == $cleverfox_theme->name){ |
| 297 |
require_once('inc/news25-headline/news25-headline.php'); |
| 298 |
} |
| 299 |
if( 'Hotel 26' == $cleverfox_theme->name){ |
| 300 |
require_once('inc/hotel-26/hotel-26.php'); |
| 301 |
} |
| 302 |
if( 'Hotel Elegance' == $cleverfox_theme->name){ |
| 303 |
require_once('inc/hotel-elegance/hotel-elegance.php'); |
| 304 |
} |
| 305 |
if( 'Hotel Prime' == $cleverfox_theme->name){ |
| 306 |
require_once('inc/hotel-prime/hotel-prime.php'); |
| 307 |
} |
| 308 |
if( 'Axivo' == $cleverfox_theme->name){ |
| 309 |
require_once('inc/axivo/axivo.php'); |
| 310 |
} |
| 311 |
if( 'Mukundra' == $cleverfox_theme->name){ |
| 312 |
require_once('inc/mukundra/mukundra.php'); |
| 313 |
} |
| 314 |
} |
| 315 |
add_action( 'init', 'cleverfox_activate' ); |
| 316 |
|
| 317 |
|
| 318 |
$cleverfox_theme = wp_get_theme(); |
| 319 |
|
| 320 |
/** |
| 321 |
* Fiona Widgets |
| 322 |
*/ |
| 323 |
if( 'Fiona Blog' == $cleverfox_theme->name || 'Fiona Food' == $cleverfox_theme->name || 'Fiona News' == $cleverfox_theme->name || 'TimeBlog' == $cleverfox_theme->name){ |
| 324 |
require CLEVERFOX_PLUGIN_DIR . 'inc/fiona-blog/widgets/class-fiona-widgets.php'; |
| 325 |
} |
| 326 |
|
| 327 |
|
| 328 |
/** |
| 329 |
* Gradiant Block |
| 330 |
*/ |
| 331 |
if( 'Gradiant' == $cleverfox_theme->name || 'Comoxa' == $cleverfox_theme->name || 'ColorPress' == $cleverfox_theme->name || 'Flavita' == $cleverfox_theme->name || 'GradiantX' == $cleverfox_theme->name || 'ColorFlow' == $cleverfox_theme->name || 'Shadiant' == $cleverfox_theme->name ){ |
| 332 |
require CLEVERFOX_PLUGIN_DIR . '/inc/gradiant/block/info-box.php'; |
| 333 |
} |
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
/** |
| 338 |
* Renoval Block |
| 339 |
*/ |
| 340 |
if( 'Renoval' == $cleverfox_theme->name ){ |
| 341 |
require CLEVERFOX_PLUGIN_DIR . '/inc/renoval/block/info-box.php'; |
| 342 |
} |
| 343 |
|
| 344 |
/** |
| 345 |
* Webique Block |
| 346 |
*/ |
| 347 |
if( 'Webique' == $cleverfox_theme->name ){ |
| 348 |
require CLEVERFOX_PLUGIN_DIR . '/inc/webique/block/info-box.php'; |
| 349 |
} |
| 350 |
|
| 351 |
/** |
| 352 |
* Profolio |
| 353 |
*/ |
| 354 |
if( 'Profolio' == $cleverfox_theme->name ){ |
| 355 |
require CLEVERFOX_PLUGIN_DIR . 'inc/profolio/cpt/cpt-main.php'; |
| 356 |
} |
| 357 |
|
| 358 |
/** |
| 359 |
* NexCraft CPT |
| 360 |
*/ |
| 361 |
if( 'NexCraft' == $cleverfox_theme->name || 'Nexcraft BPO' == $cleverfox_theme->name ){ |
| 362 |
require CLEVERFOX_PLUGIN_DIR . 'inc/nexcraft/cpt/cpt-main.php'; |
| 363 |
} |
| 364 |
|
| 365 |
if ( ! class_exists( 'CleverFox_Setup' ) ) { |
| 366 |
|
| 367 |
/** |
| 368 |
* Customizer Loader |
| 369 |
* |
| 370 |
* @since 1.0.0 |
| 371 |
*/ |
| 372 |
class CleverFox_Setup { |
| 373 |
|
| 374 |
/** |
| 375 |
* Instance |
| 376 |
* |
| 377 |
* @access private |
| 378 |
* @var object |
| 379 |
*/ |
| 380 |
private static $instance; |
| 381 |
|
| 382 |
/** |
| 383 |
* Initiator |
| 384 |
*/ |
| 385 |
public static function get_instance() { |
| 386 |
if ( ! isset( self::$instance ) ) { |
| 387 |
self::$instance = new self; |
| 388 |
} |
| 389 |
return self::$instance; |
| 390 |
} |
| 391 |
|
| 392 |
/** |
| 393 |
* Constructor |
| 394 |
*/ |
| 395 |
public function __construct() { |
| 396 |
add_action( 'admin_menu', array($this, 'clever_fox_setup_menu') ); |
| 397 |
add_action( 'wp_ajax_clever_fox_activate_theme', array( $this, 'activate_theme' ),2 ); |
| 398 |
add_action('wp_ajax_nopriv_clever_fox_activate_theme', 'activate_theme'); |
| 399 |
// add_action( 'wp_ajax_clever-fox-activate-theme', array( $this, 'activate_theme' ),1 ); |
| 400 |
add_action( 'admin_enqueue_scripts', array( $this, 'clever_fox_enqueue_scripts' ) ); |
| 401 |
} |
| 402 |
|
| 403 |
public function activate_theme() { |
| 404 |
/** |
| 405 |
* Activate theme |
| 406 |
* |
| 407 |
* @since 1.0 |
| 408 |
* @return void |
| 409 |
*/ |
| 410 |
function cleverfox_activate_theme_once() { |
| 411 |
// Check nonce for security |
| 412 |
check_ajax_referer('clever_fox_nonce', 'security'); |
| 413 |
|
| 414 |
// Ensure the request came from a logged-in user with appropriate permissions |
| 415 |
if (!current_user_can('manage_options')) { |
| 416 |
wp_send_json_error(array( |
| 417 |
'success' => false, |
| 418 |
'message' => __('You do not have permission to activate themes.', 'clever-fox') |
| 419 |
)); |
| 420 |
} |
| 421 |
|
| 422 |
// Validate and sanitize the theme name |
| 423 |
$cleverfox_theme_name = isset($_POST['theme_name']) ? sanitize_text_field(wp_unslash($_POST['theme_name'])) : ''; |
| 424 |
|
| 425 |
if (empty($cleverfox_theme_name)) { |
| 426 |
wp_send_json_error(array( |
| 427 |
'success' => false, |
| 428 |
'message' => __('Invalid theme name.', 'clever-fox') |
| 429 |
)); |
| 430 |
} |
| 431 |
|
| 432 |
|
| 433 |
// Check if the theme activation mode is set |
| 434 |
if (get_option('theme_activation_mode') !== 'activated') { |
| 435 |
// Set the theme activation mode to prevent running this code again |
| 436 |
update_option('theme_activation_mode', 'activated'); |
| 437 |
$specia_current_theme_raw = filter_input(INPUT_POST, 'specia_current_theme', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
| 438 |
$specia_current_theme = $specia_current_theme_raw ? sanitize_text_field(strtolower($specia_current_theme_raw)) : ''; |
| 439 |
|
| 440 |
if (!empty($specia_current_theme)) { |
| 441 |
switch_theme($specia_current_theme); |
| 442 |
wp_send_json_success( |
| 443 |
array( |
| 444 |
'success' => true, |
| 445 |
'message' => __('Theme Successfully Activated', 'clever-fox'), |
| 446 |
) |
| 447 |
); |
| 448 |
} |
| 449 |
|
| 450 |
wp_die(); |
| 451 |
} |
| 452 |
} |
| 453 |
|
| 454 |
add_action('after_switch_theme', 'cleverfox_activate_theme_once'); |
| 455 |
} |
| 456 |
|
| 457 |
public function clever_fox_enqueue_scripts() { |
| 458 |
wp_enqueue_style('clever-fox-admin',CLEVERFOX_PLUGIN_URL .'inc/assets/css/admin.css','','0.0'); |
| 459 |
wp_enqueue_script( 'jquery-ui-core' ); |
| 460 |
wp_enqueue_script( 'jquery-ui-dialog' ); |
| 461 |
wp_enqueue_style( 'wp-jquery-ui-dialog' ); |
| 462 |
|
| 463 |
wp_enqueue_script( 'clever-fox-install-theme', CLEVERFOX_PLUGIN_URL . 'inc/assets/js/install-theme.js', array( 'jquery' ),'0.0',true ); |
| 464 |
|
| 465 |
wp_enqueue_script( 'clever-fox-filter-tabs', CLEVERFOX_PLUGIN_URL . 'inc/assets/js/filter-tabs.js', array( 'jquery' ),'0.0',true ); |
| 466 |
|
| 467 |
$data = apply_filters( |
| 468 |
'cleverfox_install_theme_localize_vars', |
| 469 |
array( |
| 470 |
'installed' => __( 'Installed! Activating..', 'clever-fox' ), |
| 471 |
'activating' => __( 'Activating..', 'clever-fox' ), |
| 472 |
'activated' => __( 'Activated! Reloading..', 'clever-fox' ), |
| 473 |
'installing' => __( 'Installing..', 'clever-fox' ), |
| 474 |
'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ), |
| 475 |
'security' => wp_create_nonce( 'my-special-string' ) |
| 476 |
) |
| 477 |
); |
| 478 |
wp_localize_script( 'clever-fox-install-theme', 'CleverFoxInstallThemeVars', $data ); |
| 479 |
} |
| 480 |
|
| 481 |
public function clever_fox_setup_menu() { |
| 482 |
add_menu_page( 'Clever Fox', 'Clever Fox', 'manage_options', 'clever-fox', array($this, 'clever_fox_page_init') ); |
| 483 |
} |
| 484 |
|
| 485 |
|
| 486 |
function clever_fox_page_init(){ |
| 487 |
echo "<h2 class='clever-heading'>Nayra Themes Compatible Themes</h2>"; |
| 488 |
?> |
| 489 |
|
| 490 |
<div class="filter-buttons"> |
| 491 |
<button class="filter-button button-primary" data-category="all"><?php esc_html_e('All','clever-fox'); ?></button> |
| 492 |
<button class="filter-button button-primary" data-category="Business"><?php esc_html_e('Business','clever-fox'); ?></button> |
| 493 |
<button class="filter-button button-primary" data-category="Agency"><?php esc_html_e('Agency','clever-fox'); ?></button> |
| 494 |
<button class="filter-button button-primary" data-category="Corporate"><?php esc_html_e('Corporate','clever-fox'); ?></button> |
| 495 |
<button class="filter-button button-primary" data-category="Multipurpose"><?php esc_html_e('Multipurpose','clever-fox'); ?></button> |
| 496 |
<button class="filter-button button-primary" data-category="IT-Software"><?php esc_html_e('IT & Software','clever-fox'); ?></button> |
| 497 |
<button class="filter-button button-primary" data-category="Education"><?php esc_html_e('Education','clever-fox'); ?></button> |
| 498 |
<button class="filter-button button-primary" data-category="Hotel-Resorts"><?php esc_html_e('Hotel & Resorts','clever-fox'); ?></button> |
| 499 |
<button class="filter-button button-primary" data-category="News-Blog"><?php esc_html_e('News & Blog','clever-fox'); ?></button> |
| 500 |
<button class="filter-button button-primary" data-category="Spa-Saloon"><?php esc_html_e('Spa Saloon','clever-fox'); ?></button> |
| 501 |
<button class="filter-button button-primary" data-category="Events"><?php esc_html_e('Events','clever-fox'); ?></button> |
| 502 |
<button class="filter-button button-primary" data-category="Construction"><?php esc_html_e('Construction','clever-fox'); ?></button> |
| 503 |
<button class="filter-button button-primary" data-category="Medical"><?php esc_html_e('Medical','clever-fox'); ?></button> |
| 504 |
</div> |
| 505 |
|
| 506 |
<?php |
| 507 |
|
| 508 |
$api_url = 'https://api.wordpress.org/themes/info/1.1/?action=query_themes&request[author]=nayrathemes&request[per_page]=100'; |
| 509 |
|
| 510 |
// Read JSON file |
| 511 |
$response = wp_remote_get( $api_url ); |
| 512 |
|
| 513 |
if ( is_wp_error( $response ) ) { |
| 514 |
$error_message = $response->get_error_message(); |
| 515 |
} else { |
| 516 |
$json_data = wp_remote_retrieve_body( $response ); |
| 517 |
} |
| 518 |
|
| 519 |
// Decode JSON data into PHP array |
| 520 |
$response_data = json_decode($json_data); |
| 521 |
|
| 522 |
|
| 523 |
// All user data exists in 'data' object |
| 524 |
$cleverfox_theme_data = $response_data->themes; |
| 525 |
|
| 526 |
// Traverse array and display user data |
| 527 |
|
| 528 |
?> |
| 529 |
|
| 530 |
<div class="specia-sites-panel wp-clearfix"> |
| 531 |
<div class="specia-sites-wrapper" id="wrap-disk"> |
| 532 |
<?php foreach ($cleverfox_theme_data as $cleverfox_themes) { |
| 533 |
|
| 534 |
$cleverfox_theme = wp_get_theme(); |
| 535 |
|
| 536 |
$get_theme_staus=''; |
| 537 |
// Theme installed and activate. |
| 538 |
if ( $cleverfox_themes->name == $cleverfox_theme->name ) { |
| 539 |
$get_theme_staus= 'installed-and-active'; |
| 540 |
$specia_btn_value= 'Activated'; |
| 541 |
}else{ |
| 542 |
|
| 543 |
// Theme installed but not activate. |
| 544 |
foreach ( (array) wp_get_themes() as $cleverfox_theme_dir => $cleverfox_themesss ) { |
| 545 |
if ( $cleverfox_themes->name == $cleverfox_themesss->name ) { |
| 546 |
$get_theme_staus= 'installed-but-inactive'; |
| 547 |
$specia_btn_value= 'Activate Now'; |
| 548 |
} |
| 549 |
//$get_theme_staus= 'not-installed'; |
| 550 |
} |
| 551 |
} |
| 552 |
|
| 553 |
?> |
| 554 |
|
| 555 |
|
| 556 |
<?php |
| 557 |
if ( ($cleverfox_themes->name) == "Ampark" || ($cleverfox_themes->name) == "Axivo" ): |
| 558 |
$cleverfox_theme_category ="Business"; |
| 559 |
|
| 560 |
elseif ( ($cleverfox_themes->name) == "Avitech" ): |
| 561 |
$cleverfox_theme_category ="Business"; |
| 562 |
|
| 563 |
elseif ( ($cleverfox_themes->name) == "Aviser" ): |
| 564 |
$cleverfox_theme_category ="Business"; |
| 565 |
|
| 566 |
elseif ( ($cleverfox_themes->name) == "Axtia" ): |
| 567 |
$cleverfox_theme_category ="Business"; |
| 568 |
|
| 569 |
elseif ( ($cleverfox_themes->name) == "Avail" ): |
| 570 |
$cleverfox_theme_category ="Business"; |
| 571 |
|
| 572 |
elseif ( ($cleverfox_themes->name) == "Aera" ): |
| 573 |
$cleverfox_theme_category ="Business"; |
| 574 |
|
| 575 |
elseif ( ($cleverfox_themes->name) == "Avril" ): |
| 576 |
$cleverfox_theme_category ="Business"; |
| 577 |
|
| 578 |
elseif ( ($cleverfox_themes->name) == "Varuda" ): |
| 579 |
$cleverfox_theme_category ="Business"; |
| 580 |
|
| 581 |
elseif ( ($cleverfox_themes->name) == "Avtari" ): |
| 582 |
$cleverfox_theme_category ="Business"; |
| 583 |
|
| 584 |
elseif ( ($cleverfox_themes->name) == "Techine" ): |
| 585 |
$cleverfox_theme_category ="Agency"; |
| 586 |
|
| 587 |
elseif ( ($cleverfox_themes->name) == "Conceptly" || ($cleverfox_themes->name) == "Convo" ): |
| 588 |
$cleverfox_theme_category ="Agency"; |
| 589 |
|
| 590 |
elseif ( ($cleverfox_themes->name) == "Ameya" ): |
| 591 |
$cleverfox_theme_category ="Agency"; |
| 592 |
|
| 593 |
elseif ( ($cleverfox_themes->name) == "Azwa" ): |
| 594 |
$cleverfox_theme_category ="Agency"; |
| 595 |
|
| 596 |
elseif ( ($cleverfox_themes->name) == "Colorsy" ): |
| 597 |
$cleverfox_theme_category ="Corporate"; |
| 598 |
|
| 599 |
elseif ( ($cleverfox_themes->name) == "ColorPress" ): |
| 600 |
$cleverfox_theme_category ="Corporate"; |
| 601 |
|
| 602 |
elseif ( ($cleverfox_themes->name) == "Flavita" ): |
| 603 |
$cleverfox_theme_category ="Corporate"; |
| 604 |
|
| 605 |
elseif ( ($cleverfox_themes->name) == "Comoxa" ): |
| 606 |
$cleverfox_theme_category ="Corporate"; |
| 607 |
|
| 608 |
elseif ( ($cleverfox_themes->name) == "Gradiant" ): |
| 609 |
$cleverfox_theme_category ="Corporate"; |
| 610 |
|
| 611 |
elseif ( ($cleverfox_themes->name) == "Boostify" ): |
| 612 |
$cleverfox_theme_category ="Multipurpose"; |
| 613 |
|
| 614 |
elseif ( ($cleverfox_themes->name) == "Envira" ): |
| 615 |
$cleverfox_theme_category ="Multipurpose"; |
| 616 |
|
| 617 |
elseif ( ($cleverfox_themes->name) == "StartKit" ): |
| 618 |
$cleverfox_theme_category ="Multipurpose"; |
| 619 |
|
| 620 |
elseif ( ($cleverfox_themes->name) == "StartBiz" ): |
| 621 |
$cleverfox_theme_category ="Multipurpose"; |
| 622 |
|
| 623 |
elseif ( ($cleverfox_themes->name) == "Arowana" ): |
| 624 |
$cleverfox_theme_category ="Multipurpose"; |
| 625 |
|
| 626 |
elseif ( ($cleverfox_themes->name) == "StartWeb" ): |
| 627 |
$cleverfox_theme_category ="Multipurpose"; |
| 628 |
|
| 629 |
elseif ( ($cleverfox_themes->name) == "MetaSoft" ): |
| 630 |
$cleverfox_theme_category ="IT-Software"; |
| 631 |
|
| 632 |
elseif ( ($cleverfox_themes->name) == "Belltech" ): |
| 633 |
$cleverfox_theme_category ="IT-Software"; |
| 634 |
|
| 635 |
elseif ( ($cleverfox_themes->name) == "Eduvert" ): |
| 636 |
$cleverfox_theme_category ="Education"; |
| 637 |
|
| 638 |
elseif ( ($cleverfox_themes->name) == "Aravalli" || ($cleverfox_themes->name) == "VillaPress" || ($cleverfox_themes->name) == "Hotel 26" || ($cleverfox_themes->name) == "Hotel Elegance" || ($cleverfox_themes->name) == "Hotel Prime" || ($cleverfox_themes->name) == "Mukundra" ): |
| 639 |
$cleverfox_theme_category ="Hotel-Resorts"; |
| 640 |
|
| 641 |
elseif ( ($cleverfox_themes->name) == "Arbuda" ): |
| 642 |
$cleverfox_theme_category ="Hotel-Resorts"; |
| 643 |
|
| 644 |
elseif ( ($cleverfox_themes->name) == "Fiona Blog" ): |
| 645 |
$cleverfox_theme_category ="News-Blog"; |
| 646 |
|
| 647 |
elseif ( ($cleverfox_themes->name) == "Fiona Food" ): |
| 648 |
$cleverfox_theme_category ="News-Blog"; |
| 649 |
|
| 650 |
elseif ( ($cleverfox_themes->name) == "Fiona News" ): |
| 651 |
$cleverfox_theme_category ="News-Blog"; |
| 652 |
|
| 653 |
elseif ( ($cleverfox_themes->name) == "TimeBlog" ): |
| 654 |
$cleverfox_theme_category ="News-Blog"; |
| 655 |
|
| 656 |
elseif ( ($cleverfox_themes->name) == "Hantus" ): |
| 657 |
$cleverfox_theme_category ="Spa-Saloon"; |
| 658 |
|
| 659 |
elseif ( ($cleverfox_themes->name) == "Thai Spa" ): |
| 660 |
$cleverfox_theme_category ="Spa-Saloon"; |
| 661 |
|
| 662 |
elseif ( ($cleverfox_themes->name) == "Cosmics" ): |
| 663 |
$cleverfox_theme_category ="Spa-Saloon"; |
| 664 |
|
| 665 |
elseif ( ($cleverfox_themes->name) == "EventPress" ): |
| 666 |
$cleverfox_theme_category ="Events"; |
| 667 |
|
| 668 |
elseif ( ($cleverfox_themes->name) == "Appointo" ): |
| 669 |
$cleverfox_theme_category ="Agency"; |
| 670 |
|
| 671 |
elseif ( ($cleverfox_themes->name) == "Renoval" || ($cleverfox_themes->name) == "Builderse" || ($cleverfox_themes->name) == "Eractor"): |
| 672 |
$cleverfox_theme_category ="Construction"; |
| 673 |
|
| 674 |
elseif ( ($cleverfox_themes->name) == "Medazin" || ($cleverfox_themes->name) == "DoctorHub" || ($cleverfox_themes->name) == "CardioPress" || ($cleverfox_themes->name) == "Medisafe" ): |
| 675 |
$cleverfox_theme_category ="Medical"; |
| 676 |
|
| 677 |
elseif ( ($cleverfox_themes->name) == "News 25" || ($cleverfox_themes->name) == "News25 Live" || ($cleverfox_themes->name) == "News25 Prime" || ($cleverfox_themes->name) == "News25 Breaking" || ($cleverfox_themes->name) == "News25 Press" || ($cleverfox_themes->name) == "News25 Headline" ): |
| 678 |
$cleverfox_theme_category ="News-Blog"; |
| 679 |
|
| 680 |
else : |
| 681 |
$cleverfox_theme_category ="Business"; |
| 682 |
endif; |
| 683 |
?> |
| 684 |
<div id="specia-theme-activation-xl" data-category="<?php echo esc_html($cleverfox_theme_category); ?>" class="clever-fox-sites-items <?php echo esc_html($cleverfox_themes->name); ?>"> |
| 685 |
<div class="clever-fox-items-inner"> |
| 686 |
<div class="specia-demo-screenshot"> |
| 687 |
<div class="specia-demo-image" style="background-image: url(<?php echo esc_url($cleverfox_themes->screenshot_url); ?>);"></div> |
| 688 |
<div class="specia-demo-actions"> |
| 689 |
<a class="clever-fox-btn clever-fox-btn-outline" href="https://nayrathemes.com/demo/pro/<?php echo esc_html($cleverfox_themes->slug); ?>" target="_blank"><?php esc_html_e('Preview','clever-fox'); ?></a> |
| 690 |
<?php |
| 691 |
if($get_theme_staus !== 'installed-and-active' && $get_theme_staus !== 'installed-but-inactive'): |
| 692 |
$get_theme_staus= 'not-installed'; |
| 693 |
$specia_btn_value= 'Install & Activate Now'; |
| 694 |
endif; |
| 695 |
$cleverfox_theme_status = 'clever-fox-theme-' . $get_theme_staus; |
| 696 |
echo wp_kses_post(sprintf(/* translators: 1: Theme Slug 3:Anchor Class 4: Text */ __( '<a href="#" class="%3$s xl-btn-active clever-fox-btn-outline xl-install-action clever-fox-btn" data-theme-slug="%1$s">%4$s</a>', 'clever-fox' ), esc_html($cleverfox_themes->name),esc_url( admin_url( 'themes.php?theme=%1$s' ) ), esc_html($cleverfox_theme_status), esc_html($specia_btn_value) ) ); |
| 697 |
//switch_theme( $cleverfox_themes->name ); |
| 698 |
?> |
| 699 |
</div> |
| 700 |
</div> |
| 701 |
<div class="sp-demo-meta sp-demo-meta--with-preview"> |
| 702 |
<div class="sp-demo-name"><h4 title="Nayra Themes"><a href="<?php echo esc_url(admin_url('theme-install.php?search='.$cleverfox_themes->name)); ?>"><?php echo esc_html($cleverfox_themes->name); ?></a></h4></div> |
| 703 |
<a class="clever-fox-btn clever-fox-btn-outline" href="https://nayrathemes.com/<?php echo esc_html($cleverfox_themes->slug); ?>-pro/" target="_blank"><?php esc_html_e('Buy Now','clever-fox'); ?></a> |
| 704 |
</div> |
| 705 |
<?php //echo $get_theme_staus; ?> |
| 706 |
</div> |
| 707 |
</div> |
| 708 |
<?php } ?> |
| 709 |
</div> |
| 710 |
</div> |
| 711 |
|
| 712 |
<?php |
| 713 |
} |
| 714 |
|
| 715 |
} |
| 716 |
}// End if(). |
| 717 |
|
| 718 |
/** |
| 719 |
* Kicking this off by calling 'get_instance()' method |
| 720 |
*/ |
| 721 |
CleverFox_Setup::get_instance(); |
| 722 |
|
| 723 |
|
| 724 |
/** |
| 725 |
* The code during plugin activation. |
| 726 |
*/ |
| 727 |
function cleverfox__activate() { |
| 728 |
require_once plugin_dir_path( __FILE__ ) . 'inc/cleverfox-activator.php'; |
| 729 |
Cleverfox_Activator::activate(); |
| 730 |
} |
| 731 |
register_activation_hook( __FILE__, 'cleverfox__activate' ); |