PluginProbe
المنتور فارسی / trunk
المنتور فارسی vtrunk
2.8.3 2.8.2 2.8.1 2.8.0 trunk 2.3.16 2.4.10 2.4.11 2.4.20 2.4.9 2.5.4 2.7.1 2.7.10 2.7.11 2.7.11.2 2.7.11.4 2.7.11.5 2.7.12 2.7.13 2.7.14 2.7.15 2.7.16 2.7.17 2.7.5 2.7.5.1 All 41 releases
persian-elementor / persian-elementor.php

persian-elementor.php in المنتور فارسی trunk, at persian-elementor.php

130 lines 3.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: ال�
5 نتور فارسی
6 * Plugin URI:
7 * Description: بسته کا�
8 ل فارسی‌ساز ال�
9 نتور با 13 فونت ایرانی، ترج�
10 ه ال�
11 نتور و ال�
12 نتور پرو، آیکون‌های ایرانی، تقوی�
13 ش�
14 سی، ویجت‌های نقشه نشان و آپارات.
15 * Version: 2.8.3
16 * Author: ال�
17 نتور فارسی
18 * Author URI:
19 * Text Domain: persian-elementor
20 * License: GPL2
21 * Elementor tested up to: 4.2.0
22 * Elementor Pro tested up to: 4.2.0
23 */
24 if (!defined('ABSPATH')) {
25 exit;
26 }
27
28 final class Persian_Elementor
29 {
30 private static $instance = null;
31 private $options = [];
32
33 public static function get_instance()
34 {
35 if (is_null(self::$instance)) {
36 self::$instance = new self();
37 }
38 return self::$instance;
39 }
40
41 private function __construct()
42 {
43 add_action('plugins_loaded', [$this, 'init']);
44
45 // Clear cleanup cron on plugin deactivation
46 register_deactivation_hook(__FILE__, function () {
47 wp_clear_scheduled_hook('persian_elementor_cleanup_transactions');
48 });
49 }
50
51 public function init()
52 {
53 $this->define_constants();
54 if (!did_action('elementor/loaded')) {
55 return;
56 }
57 $this->load_textdomain();
58 $this->include_files();
59 $this->register_hooks();
60 }
61
62 private function define_constants()
63 {
64 define('PERSIAN_ELEMENTOR', plugin_dir_path(__FILE__));
65 define('PERSIAN_ELEMENTOR_URL', plugin_dir_url(__FILE__));
66 define('PERSIAN_ELEMENTOR_VERSION', '2.8.3');
67 }
68
69 public function load_textdomain()
70 {
71 load_plugin_textdomain('persian-elementor');
72 }
73
74 private function include_files()
75 {
76 $includes = [
77 'plugin.php',
78 'includes/translate.php',
79 'includes/fonts.php',
80 'includes/icon.php',
81 'includes/options.php',
82 ];
83
84 // Load optional components based on settings
85 $options = get_option('persian_elementor', []);
86
87 // Add form fields functionality if enabled (default to enabled if option doesn't exist)
88 if ($options['efa-form-fields'] ?? true) {
89 $includes[] = 'widget/form-fields/form-fields.php';
90 }
91
92 // Add Aparat video integration if enabled (default to enabled if option doesn't exist)
93 if ($options['efa-aparat-video'] ?? true) {
94 $includes[] = 'widget/aparat/aparat-video.php';
95 }
96
97 // Add Neshan map widget if enabled (default to enabled if option doesn't exist)
98 if ($options['efa-neshan-map'] ?? true) {
99 $includes[] = 'widget/neshan/neshan-map.php';
100 }
101
102 // Add typography control if enabled (default to enabled if option doesn't exist)
103 if ($options['efa-all-font'] ?? true) {
104 $includes[] = 'widget/class-group-control-typography.php';
105 }
106
107 // Add ZarinPal payment button if enabled (default to enabled if option doesn't exist)
108 if ($options['efa-zarinpal-button'] ?? true) {
109 $includes[] = 'widget/zarinpal/zarinpal-handler.php';
110 $includes[] = 'widget/zarinpal/zarinpal-register.php';
111 }
112
113 foreach ($includes as $file) {
114 $path = PERSIAN_ELEMENTOR . $file;
115 if (file_exists($path)) {
116 require_once $path;
117 } else {
118 error_log("File missing: " . esc_html($path));
119 }
120 }
121 }
122
123 public function register_hooks()
124 {
125 $this->options = get_option('persian_elementor', []);
126 }
127 }
128
129 Persian_Elementor::get_instance();
130