-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathqazana.php
128 lines (118 loc) · 3.61 KB
/
qazana.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
/**
* Plugin Name: Qazana: A Frontend page builder for WordPress
* Description: Front-end page builder for WordPress with live drag and drop editing. Build high quality responsive websites and landing pages visually. Any theme, anywhere.
* Plugin URI: https://qazana.net/
* Author: Qazana
* Version: 1.3.1
* Author URI: https://qazana.net/
*
* Text Domain: qazana
*
* Qazana is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* Qazana is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
/**
* Based on : Elementor plugin version 0.10.2
* Description: The most advanced frontend drag & drop page builder. Create high-end, pixel perfect websites at record speeds. Any theme, any page, any design.
* Plugin URI: https://elementor.com/
* Author: Elementor.com
* Author URI: https://elementor.com/
*
* Elementor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* Elementor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
define( 'QAZANA__FILE__', __FILE__ );
/**
* Qazana check PHP version.
*
* Check when the site doesn't have the minimum required PHP version.
*
* @since 1.3.1
*
* @return void
*/
function qazana_is_php_version_compatible() {
if ( ! version_compare( PHP_VERSION, '5.4', '>=' ) ) {
return false;
}
return true;
}
if ( ! qazana_is_php_version_compatible() ) {
add_action( 'admin_notices', 'qazana_fail_php_version' );
} else {
require plugin_dir_path( QAZANA__FILE__ ) . 'includes/plugin.php';
}
/**
* Show in WP Dashboard notice about the plugin is not activated.
*
* @since 1.0.0
*
* @return void
*/
function qazana_fail_php_version() {
$message = esc_html__( 'Qazana requires PHP version 5.4+, plugin is currently NOT ACTIVE.', 'qazana' );
$html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
echo wp_kses_post( $html_message );
}
/**
* Helper function for writing to log file.
*
* @since 1.0.0
*
* @param log data to log
* @param type log or export
*/
function qazana_write_log( $log, $type = '1' ) {
if ( true === WP_DEBUG ) {
if ( is_array( $log ) || is_object( $log ) ) {
if ( $type === '1' ) {
error_log( print_r( $log, true ) );
} else {
error_log( var_export( $log, true ) );
}
} else {
error_log( $log );
}
}
}
/**
* The main function responsible for returning the one true Qazana Instance
* to functions everywhere.
*
* Use this function like you would a global variable, except without needing
* to declare the global.
*
* Example: <?php $qazana = qazana(); ?>
*
* @since 1.0.0
*
* @return The one true Qazana Instance
*/
function qazana() {
if ( ! qazana_is_php_version_compatible() ) {
return;
}
// In tests we run the instance manually.
return Qazana\Plugin::instance();
}
if ( ! defined( 'QAZANA_TESTS' ) ) {
qazana();
}