PluginProbe
Chartify – WordPress Chart Plugin / 3.2.7
Chartify – WordPress Chart Plugin v3.2.7
3.8.0 3.7.9 3.7.8 3.7.7 3.7.6 3.7.5 trunk 1.0.0 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 All 83 releases
← All changes | includes/class-chart-builder.php +346 -272 trunk3.2.7 View file →
@@ -1,272 +1,346 @@
1 -<?php
2 -
3 -/**
4 - * The file that defines the core plugin class
5 - *
6 - * A class definition that includes attributes and functions used across both the
7 - * public-facing side of the site and the admin area.
8 - *
9 - * @link https://ays-pro.com/
10 - * @since 1.0.0
11 - *
12 - * @package Chart_Builder
13 - * @subpackage Chart_Builder/includes
14 - */
15 -
16 -/**
17 - * The core plugin class.
18 - *
19 - * This is used to define internationalization, admin-specific hooks, and
20 - * public-facing site hooks.
21 - *
22 - * Also maintains the unique identifier of this plugin as well as the current
23 - * version of the plugin.
24 - *
25 - * @since 1.0.0
26 - * @package Chart_Builder
27 - * @subpackage Chart_Builder/includes
28 - * @author Chart Builder Team <info@ays-pro.com>
29 - */
30 -class Chart_Builder {
31 -
32 - /**
33 - * The loader that's responsible for maintaining and registering all hooks that power
34 - * the plugin.
35 - *
36 - * @since 1.0.0
37 - * @access protected
38 - * @var Chart_Builder_Loader $loader Maintains and registers all hooks for the plugin.
39 - */
40 - protected $loader;
41 -
42 - /**
43 - * The unique identifier of this plugin.
44 - *
45 - * @since 1.0.0
46 - * @access protected
47 - * @var string $plugin_name The string used to uniquely identify this plugin.
48 - */
49 - protected $plugin_name;
50 -
51 - /**
52 - * The current version of the plugin.
53 - *
54 - * @since 1.0.0
55 - * @access protected
56 - * @var string $version The current version of the plugin.
57 - */
58 - protected $version;
59 -
60 - /**
61 - * Define the core functionality of the plugin.
62 - *
63 - * Set the plugin name and the plugin version that can be used throughout the plugin.
64 - * Load the dependencies, define the locale, and set the hooks for the admin area and
65 - * the public-facing side of the site.
66 - *
67 - * @since 1.0.0
68 - */
69 - public function __construct() {
70 - if ( defined( 'CHART_BUILDER_VERSION' ) ) {
71 - $this->version = CHART_BUILDER_VERSION;
72 - } else {
73 - $this->version = '1.0.0';
74 - }
75 - $this->plugin_name = "chart-builder";
76 -
77 - $this->load_dependencies();
78 - $this->set_locale();
79 - $this->define_admin_hooks();
80 - $this->define_public_hooks();
81 -
82 - }
83 -
84 - /**
85 - * Load the required dependencies for this plugin.
86 - *
87 - * Include the following files that make up the plugin:
88 - *
89 - * - Chart_Builder_Loader. Orchestrates the hooks of the plugin.
90 - * - Chart_Builder_i18n. Defines internationalization functionality.
91 - * - Chart_Builder_Admin. Defines all hooks for the admin area.
92 - * - Chart_Builder_Public. Defines all hooks for the public side of the site.
93 - *
94 - * Create an instance of the loader which will be used to register the hooks
95 - * with WordPress.
96 - *
97 - * @since 1.0.0
98 - * @access private
99 - */
100 - private function load_dependencies() {
101 -
102 - if ( ! class_exists( 'WP_List_Table' ) ) {
103 - require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
104 - }
105 -
106 - /**
107 - * The classes responsible for defining all actions including db that occur in the plugin area.
108 - */
109 - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-chart-builder-functions.php';
110 - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-chart-builder-db-actions.php';
111 - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-chart-builder-actions.php';
112 -
113 - /**
114 - * The class responsible for defining all functions for getting all form integrations
115 - */
116 - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-chart-builder-integrations.php';
117 -
118 - /**
119 - * The class responsible for orchestrating the actions and filters of the
120 - * core plugin.
121 - */
122 - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-chart-builder-loader.php';
123 -
124 - /**
125 - * The class responsible for defining internationalization functionality
126 - * of the plugin.
127 - */
128 - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-chart-builder-i18n.php';
129 -
130 - /**
131 - * The class responsible for defining all actions that occur in the admin area.
132 - */
133 - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-chart-builder-admin.php';
134 -
135 - /**
136 - * The class responsible for defining all actions that occur in the public-facing
137 - * side of the site.
138 - */
139 - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-chart-builder-public.php';
140 -
141 - $this->loader = new Chart_Builder_Loader();
142 -
143 - }
144 -
145 - /**
146 - * Define the locale for this plugin for internationalization.
147 - *
148 - * Uses the Chart_Builder_i18n class in order to set the domain and to register the hook
149 - * with WordPress.
150 - *
151 - * @since 1.0.0
152 - * @access private
153 - */
154 - private function set_locale() {
155 -
156 - $plugin_i18n = new Chart_Builder_i18n();
157 -
158 - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
159 -
160 - }
161 -
162 - /**
163 - * Register all of the hooks related to the admin area functionality
164 - * of the plugin.
165 - *
166 - * @since 1.0.0
167 - * @access private
168 - */
169 - private function define_admin_hooks() {
170 -
171 - $plugin_admin = new Chart_Builder_Admin( $this->get_plugin_name(), $this->get_version() );
172 -
173 - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
174 - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
175 -
176 -
177 - $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_admin_menu' );
178 -
179 - // $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_general_settings_submenu', 120 );
180 -
181 -
182 - // Add Chart page sources contents
183 - $this->loader->add_action( 'ays_cb_chart_page_sources_contents', $plugin_admin, 'ays_chart_page_source_contents', 10, 3 );
184 - // $this->loader->add_filter( 'ays_cb_chart_page_sources_contents_settings', $plugin_admin, 'source_contents_import_from_wordpress_settings', 50, 2 );
185 - $this->loader->add_filter( 'ays_cb_chart_page_sources_contents_settings', $plugin_admin, 'source_contents_manual_settings', 70, 2 );
186 -
187 - // Add Chart page settings contents
188 - $this->loader->add_action( 'ays_cb_chart_page_settings_contents', $plugin_admin, 'ays_chart_page_settings_contents', 10, 3 );
189 - $this->loader->add_filter( 'ays_cb_chart_page_settings_contents_settings', $plugin_admin, 'settings_contents_general_settings', 50, 2 );
190 - $this->loader->add_filter( 'ays_cb_chart_page_settings_contents_settings', $plugin_admin, 'settings_contents_styles_settings', 60, 2 );
191 - $this->loader->add_filter( 'ays_cb_chart_page_settings_contents_settings', $plugin_admin, 'settings_contents_tooltip_settings', 70, 2 );
192 -
193 -
194 - // Add Settings link to the plugin
195 - $plugin_basename = plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_name . '.php' );
196 - $this->loader->add_filter( 'plugin_action_links_' . $plugin_basename, $plugin_admin, 'add_action_links' );
197 -
198 -
199 - // Admin AJAX action
200 - $this->loader->add_action( 'wp_ajax_ays_chart_admin_ajax', $plugin_admin, 'ays_admin_ajax' );
201 - $this->loader->add_action( 'wp_ajax_nopriv_ays_chart_admin_ajax', $plugin_admin, 'ays_admin_ajax' );
202 - $this->loader->add_action( 'wp_ajax_deactivate_plugin_option_cb', $plugin_admin, 'deactivate_plugin_option');
203 - $this->loader->add_action( 'wp_ajax_nopriv_deactivate_plugin_option_cb', $plugin_admin, 'deactivate_plugin_option');
204 -
205 - }
206 -
207 - /**
208 - * Register all of the hooks related to the public-facing functionality
209 - * of the plugin.
210 - *
211 - * @since 1.0.0
212 - * @access private
213 - */
214 - private function define_public_hooks() {
215 -
216 - $plugin_public = new Chart_Builder_Public( $this->get_plugin_name(), $this->get_version() );
217 -
218 - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
219 - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
220 -
221 - }
222 -
223 - /**
224 - * Register all of the hooks related to the integrations functionality
225 - * of the plugin.
226 - *
227 - * @since 1.0.0
228 - * @access private
229 - */
230 -
231 -
232 - /**
233 - * Run the loader to execute all of the hooks with WordPress.
234 - *
235 - * @since 1.0.0
236 - */
237 - public function run() {
238 - $this->loader->run();
239 - }
240 -
241 - /**
242 - * The name of the plugin used to uniquely identify it within the context of
243 - * WordPress and to define internationalization functionality.
244 - *
245 - * @since 1.0.0
246 - * @return string The name of the plugin.
247 - */
248 - public function get_plugin_name() {
249 - return $this->plugin_name;
250 - }
251 -
252 - /**
253 - * The reference to the class that orchestrates the hooks with the plugin.
254 - *
255 - * @since 1.0.0
256 - * @return Chart_Builder_Loader Orchestrates the hooks of the plugin.
257 - */
258 - public function get_loader() {
259 - return $this->loader;
260 - }
261 -
262 - /**
263 - * Retrieve the version number of the plugin.
264 - *
265 - * @since 1.0.0
266 - * @return string The version number of the plugin.
267 - */
268 - public function get_version() {
269 - return $this->version;
270 - }
271 -
272 -}
1 +<?php
2 +
3 +/**
4 + * The file that defines the core plugin class
5 + *
6 + * A class definition that includes attributes and functions used across both the
7 + * public-facing side of the site and the admin area.
8 + *
9 + * @link https://ays-pro.com/
10 + * @since 1.0.0
11 + *
12 + * @package Chart_Builder
13 + * @subpackage Chart_Builder/includes
14 + */
15 +
16 +/**
17 + * The core plugin class.
18 + *
19 + * This is used to define internationalization, admin-specific hooks, and
20 + * public-facing site hooks.
21 + *
22 + * Also maintains the unique identifier of this plugin as well as the current
23 + * version of the plugin.
24 + *
25 + * @since 1.0.0
26 + * @package Chart_Builder
27 + * @subpackage Chart_Builder/includes
28 + * @author Chart Builder Team <info@ays-pro.com>
29 + */
30 +class Chart_Builder {
31 +
32 + /**
33 + * The loader that's responsible for maintaining and registering all hooks that power
34 + * the plugin.
35 + *
36 + * @since 1.0.0
37 + * @access protected
38 + * @var Chart_Builder_Loader $loader Maintains and registers all hooks for the plugin.
39 + */
40 + protected $loader;
41 +
42 + /**
43 + * The unique identifier of this plugin.
44 + *
45 + * @since 1.0.0
46 + * @access protected
47 + * @var string $plugin_name The string used to uniquely identify this plugin.
48 + */
49 + protected $plugin_name;
50 +
51 + /**
52 + * The current version of the plugin.
53 + *
54 + * @since 1.0.0
55 + * @access protected
56 + * @var string $version The current version of the plugin.
57 + */
58 + protected $version;
59 +
60 + /**
61 + * Define the core functionality of the plugin.
62 + *
63 + * Set the plugin name and the plugin version that can be used throughout the plugin.
64 + * Load the dependencies, define the locale, and set the hooks for the admin area and
65 + * the public-facing side of the site.
66 + *
67 + * @since 1.0.0
68 + */
69 + public function __construct() {
70 + if ( defined( 'CHART_BUILDER_VERSION' ) ) {
71 + $this->version = CHART_BUILDER_VERSION;
72 + } else {
73 + $this->version = '1.0.0';
74 + }
75 + $this->plugin_name = "chart-builder";
76 +
77 + $this->load_dependencies();
78 + $this->set_locale();
79 + $this->define_admin_hooks();
80 + $this->define_public_hooks();
81 + $this->define_integrations_hooks();
82 +
83 + }
84 +
85 + /**
86 + * Load the required dependencies for this plugin.
87 + *
88 + * Include the following files that make up the plugin:
89 + *
90 + * - Chart_Builder_Loader. Orchestrates the hooks of the plugin.
91 + * - Chart_Builder_i18n. Defines internationalization functionality.
92 + * - Chart_Builder_Admin. Defines all hooks for the admin area.
93 + * - Chart_Builder_Public. Defines all hooks for the public side of the site.
94 + *
95 + * Create an instance of the loader which will be used to register the hooks
96 + * with WordPress.
97 + *
98 + * @since 1.0.0
99 + * @access private
100 + */
101 + private function load_dependencies() {
102 +
103 + if ( ! class_exists( 'WP_List_Table' ) ) {
104 + require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
105 + }
106 +
107 + /**
108 + * The classes responsible for defining all actions including db that occur in the plugin area.
109 + */
110 + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-chart-builder-functions.php';
111 + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-chart-builder-settings-db-actions.php';
112 + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-chart-builder-db-actions.php';
113 + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-chart-builder-actions.php';
114 +
115 + /**
116 + * The class responsible for defining all functions for getting all form integrations
117 + */
118 + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-chart-builder-integrations.php';
119 +
120 + /**
121 + * The class responsible for orchestrating the actions and filters of the
122 + * core plugin.
123 + */
124 + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-chart-builder-loader.php';
125 +
126 + /**
127 + * The class responsible for defining internationalization functionality
128 + * of the plugin.
129 + */
130 + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-chart-builder-i18n.php';
131 +
132 + /**
133 + * The class responsible for defining all actions that occur in the admin area.
134 + */
135 + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-chart-builder-admin.php';
136 +
137 + /**
138 + * The class responsible for defining all actions that occur in the public-facing
139 + * side of the site.
140 + */
141 + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-chart-builder-public.php';
142 +
143 + $this->loader = new Chart_Builder_Loader();
144 +
145 + }
146 +
147 + /**
148 + * Define the locale for this plugin for internationalization.
149 + *
150 + * Uses the Chart_Builder_i18n class in order to set the domain and to register the hook
151 + * with WordPress.
152 + *
153 + * @since 1.0.0
154 + * @access private
155 + */
156 + private function set_locale() {
157 +
158 + $plugin_i18n = new Chart_Builder_i18n();
159 +
160 + $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
161 +
162 + }
163 +
164 + /**
165 + * Register all of the hooks related to the admin area functionality
166 + * of the plugin.
167 + *
168 + * @since 1.0.0
169 + * @access private
170 + */
171 + private function define_admin_hooks() {
172 +
173 + $plugin_admin = new Chart_Builder_Admin( $this->get_plugin_name(), $this->get_version() );
174 +
175 + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
176 + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
177 + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'disable_scripts', 100 );
178 +
179 + $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_admin_menu' );
180 +
181 + $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_charts_submenu', 115 );
182 + $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_add_new_submenu', 120 );
183 + $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_general_settings_submenu', 125 );
184 + $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_dashboard_submenu', 130 );
185 + $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_featured_plugins_submenu', 135 );
186 + $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_chart_features_submenu', 145 );
187 +
188 +
189 + // Add Chart page sources contents
190 + $this->loader->add_action( 'ays_cb_chart_page_sources_contents', $plugin_admin, 'ays_chart_page_source_contents', 10, 3 );
191 + $this->loader->add_filter( 'ays_cb_chart_page_sources_contents_settings', $plugin_admin, 'source_contents_import_from_csv_settings', 40, 2 );
192 + // $this->loader->add_filter( 'ays_cb_chart_page_sources_contents_settings', $plugin_admin, 'source_contents_import_from_wordpress_settings', 50, 2 );
193 + $this->loader->add_filter( 'ays_cb_chart_page_sources_contents_settings', $plugin_admin, 'source_contents_import_from_db_settings', 60, 2 );
194 + $this->loader->add_filter( 'ays_cb_chart_page_sources_contents_settings', $plugin_admin, 'source_contents_import_from_external_db_settings', 65, 2 );
195 + $this->loader->add_filter( 'ays_cb_chart_page_sources_contents_settings', $plugin_admin, 'source_contents_quiz_maker_integration_settings', 70, 2 );
196 + $this->loader->add_filter( 'ays_cb_chart_page_sources_contents_settings', $plugin_admin, 'source_contents_woocommerce_integration_settings', 80, 2 );
197 + $this->loader->add_filter( 'ays_cb_chart_page_sources_contents_settings', $plugin_admin, 'source_contents_manual_settings', 90, 2 );
198 + $this->loader->add_filter( 'ays_cb_chart_page_sources_contents_settings_chartjs', $plugin_admin, 'source_contents_manual_settings_chartjs', 90, 2 );
199 +
200 + // Add Chart page settings contents
201 + $this->loader->add_action( 'ays_cb_chart_page_settings_contents', $plugin_admin, 'ays_chart_page_settings_contents', 10, 3 );
202 + $this->loader->add_filter( 'ays_cb_chart_page_settings_contents_settings', $plugin_admin, 'settings_contents_general_settings', 50, 2 );
203 + $this->loader->add_filter( 'ays_cb_chart_page_settings_contents_settings', $plugin_admin, 'settings_contents_tooltip_settings', 70, 2 );
204 + $this->loader->add_filter( 'ays_cb_chart_page_settings_contents_settings', $plugin_admin, 'settings_contents_legend_settings', 80, 2 );
205 + $this->loader->add_filter( 'ays_cb_chart_page_settings_contents_settings', $plugin_admin, 'settings_contents_horizontal_axis_settings', 90, 2 );
206 + $this->loader->add_filter( 'ays_cb_chart_page_settings_contents_settings', $plugin_admin, 'settings_contents_vertical_axis_settings', 100, 2 );
207 + $this->loader->add_filter( 'ays_cb_chart_page_settings_contents_settings', $plugin_admin, 'settings_contents_animation_settings', 110, 2 );
208 + $this->loader->add_filter( 'ays_cb_chart_page_settings_contents_settings', $plugin_admin, 'settings_contents_live_chart_settings', 115, 2 );
209 + $this->loader->add_filter( 'ays_cb_chart_page_settings_contents_settings', $plugin_admin, 'settings_contents_export_options', 120, 2 );
210 + $this->loader->add_filter( 'ays_cb_chart_page_settings_contents_settings_chartjs', $plugin_admin, 'settings_contents_general_settings_chartjs', 50, 2 );
211 +
212 + // Add Chart page styles contents
213 + $this->loader->add_action( 'ays_cb_chart_page_styles_contents', $plugin_admin, 'ays_chart_page_styles_contents', 10, 3 );
214 + $this->loader->add_filter( 'ays_cb_chart_page_styles_contents_settings', $plugin_admin, 'settings_contents_chart_styles_settings', 50, 2 );
215 + $this->loader->add_filter( 'ays_cb_chart_page_styles_contents_settings', $plugin_admin, 'settings_contents_chart_area_styles_settings', 60, 2 );
216 + $this->loader->add_filter( 'ays_cb_chart_page_styles_contents_settings', $plugin_admin, 'settings_contents_title_styles_settings', 70, 2 );
217 + $this->loader->add_filter( 'ays_cb_chart_page_styles_contents_settings', $plugin_admin, 'settings_contents_description_styles_settings', 80, 2 );
218 + $this->loader->add_filter( 'ays_cb_chart_page_styles_contents_settings_chartjs', $plugin_admin, 'settings_contents_chart_styles_settings_chartjs', 50, 2 );
219 + $this->loader->add_filter( 'ays_cb_chart_page_styles_contents_settings_chartjs', $plugin_admin, 'settings_contents_title_styles_settings_chartjs', 70, 2 );
220 + $this->loader->add_filter( 'ays_cb_chart_page_styles_contents_settings_chartjs', $plugin_admin, 'settings_contents_description_styles_settings_chartjs', 80, 2 );
221 +
222 + // Add Chart page advanced settings contents
223 + $this->loader->add_action( 'ays_cb_chart_page_advanced_settings_contents', $plugin_admin, 'ays_chart_page_advanced_settings_contents', 10, 3 );
224 + $this->loader->add_filter( 'ays_cb_chart_page_advanced_settings_contents_settings', $plugin_admin, 'settings_contents_advanced_settings', 50, 2 );
225 + $this->loader->add_filter( 'ays_cb_chart_page_advanced_settings_contents_settings', $plugin_admin, 'settings_contents_slices_settings', 60, 2 );
226 + $this->loader->add_filter( 'ays_cb_chart_page_advanced_settings_contents_settings', $plugin_admin, 'settings_contents_series_settings', 70, 2 );
227 + $this->loader->add_filter( 'ays_cb_chart_page_advanced_settings_contents_settings', $plugin_admin, 'settings_contents_row_settings', 80, 2 );
228 + $this->loader->add_filter( 'ays_cb_chart_page_advanced_settings_contents_settings_chartjs', $plugin_admin, 'settings_contents_advanced_settings_chartjs', 50, 2 );
229 +
230 + // Add Settings link to the plugin
231 + $plugin_basename = plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_name . '.php' );
232 + $this->loader->add_filter( 'plugin_action_links_' . $plugin_basename, $plugin_admin, 'add_action_links' );
233 +
234 +
235 + // Admin AJAX action
236 + $this->loader->add_action( 'wp_ajax_ays_chart_admin_ajax', $plugin_admin, 'ays_admin_ajax' );
237 + $this->loader->add_action( 'wp_ajax_nopriv_ays_chart_admin_ajax', $plugin_admin, 'ays_admin_ajax' );
238 + $this->loader->add_action( 'wp_ajax_deactivate_plugin_option_cb', $plugin_admin, 'deactivate_plugin_option');
239 + $this->loader->add_action( 'wp_ajax_nopriv_deactivate_plugin_option_cb', $plugin_admin, 'deactivate_plugin_option');
240 +
241 + $this->loader->add_action( 'wp_ajax_ays_chart_install_plugin', $plugin_admin, 'ays_chart_install_plugin' );
242 + $this->loader->add_action( 'wp_ajax_nopriv_ays_chart_install_plugin', $plugin_admin, 'ays_chart_install_plugin' );
243 +
244 + $this->loader->add_action( 'wp_ajax_ays_chart_activate_plugin', $plugin_admin, 'ays_chart_activate_plugin' );
245 + $this->loader->add_action( 'wp_ajax_nopriv_ays_chart_activate_plugin', $plugin_admin, 'ays_chart_activate_plugin' );
246 +
247 + $this->loader->add_action( 'elementor/widgets/widgets_registered', $plugin_admin, 'chart_builder_el_widgets_registered' );
248 +
249 + $this->loader->add_action( 'in_admin_footer', $plugin_admin, 'chart_builder_admin_footer', 1 );
250 +
251 + // Sale Banner
252 + $this->loader->add_action( 'admin_notices', $plugin_admin, 'ays_chart_sale_banner', 1 );
253 + $this->loader->add_action( 'wp_ajax_ays_chart_dismiss_button', $plugin_admin, 'ays_chart_dismiss_button' );
254 + $this->loader->add_action( 'wp_ajax_nopriv_ays_chart_dismiss_button', $plugin_admin, 'ays_chart_dismiss_button' );
255 + }
256 +
257 + /**
258 + * Register all of the hooks related to the public-facing functionality
259 + * of the plugin.
260 + *
261 + * @since 1.0.0
262 + * @access private
263 + */
264 + private function define_public_hooks() {
265 +
266 + $plugin_public = new Chart_Builder_Public( $this->get_plugin_name(), $this->get_version() );
267 +
268 + // $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
269 + // $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
270 +
271 + }
272 +
273 + /**
274 + * Register all of the hooks related to the integrations functionality
275 + * of the plugin.
276 + *
277 + * @since 1.0.0
278 + * @access private
279 + */
280 + private function define_integrations_hooks() {
281 +
282 + $plugin_integrations = new Chart_Builder_Integrations( $this->get_plugin_name(), $this->get_version() );
283 +
284 + // Form Maker Integrations / form page
285 + $this->loader->add_action( 'ays_cb_chart_page_integrations', $plugin_integrations, 'ays_chart_page_integrations_content' );
286 +
287 + // Form Maker Integrations / settings page
288 + $this->loader->add_action( 'ays_cb_settings_page_integrations', $plugin_integrations, 'ays_settings_page_integrations_content' );
289 +
290 +
291 + // ===== Google integration =====
292 +
293 + // Google integration / settings page
294 + $this->loader->add_filter( 'ays_cb_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_google_sheet_content', 50, 2 );
295 + $this->loader->add_filter( 'ays_cb_chart_page_sources_contents_settings', $plugin_integrations, 'source_contents_import_from_google_sheet_settings', 50, 2 );
296 +
297 + // ===== Google integration =====
298 +
299 + // ===== Database integration =====
300 + $this->loader->add_filter( 'ays_cb_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_database_content', 50, 3 );
301 +
302 + // ===== Database integration =====
303 + }
304 +
305 +
306 + /**
307 + * Run the loader to execute all of the hooks with WordPress.
308 + *
309 + * @since 1.0.0
310 + */
311 + public function run() {
312 + $this->loader->run();
313 + }
314 +
315 + /**
316 + * The name of the plugin used to uniquely identify it within the context of
317 + * WordPress and to define internationalization functionality.
318 + *
319 + * @since 1.0.0
320 + * @return string The name of the plugin.
321 + */
322 + public function get_plugin_name() {
323 + return $this->plugin_name;
324 + }
325 +
326 + /**
327 + * The reference to the class that orchestrates the hooks with the plugin.
328 + *
329 + * @since 1.0.0
330 + * @return Chart_Builder_Loader Orchestrates the hooks of the plugin.
331 + */
332 + public function get_loader() {
333 + return $this->loader;
334 + }
335 +
336 + /**
337 + * Retrieve the version number of the plugin.
338 + *
339 + * @since 1.0.0
340 + * @return string The version number of the plugin.
341 + */
342 + public function get_version() {
343 + return $this->version;
344 + }
345 +
346 +}