PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 1.4.2.2
Visualizer – Tables & Charts Manager with Built-in AI Generator v1.4.2.2
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 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.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
← All changes | classes/Visualizer/Plugin.php +35 -81 3.1.21.4.2.2 View file →
@@ -1,5 +1,6 @@
1 1 <?php
2 +
2 3 // +----------------------------------------------------------------------+
3 4 // | Copyright 2013 Madpixels (email : visualizer@madpixels.net) |
4 5 // +----------------------------------------------------------------------+
5 6 // | This program is free software; you can redistribute it and/or modify |
@@ -17,8 +18,9 @@
17 18 // | MA 02110-1301 USA |
18 19 // +----------------------------------------------------------------------+
19 20 // | Author: Eugene Manuilov <eugene@manuilov.org> |
20 21 // +----------------------------------------------------------------------+
22 +
21 23 /**
22 24 * The core plugin class.
23 25 *
24 26 * @category Visualizer
@@ -26,60 +28,34 @@
26 28 * @since 1.0.0
27 29 */
28 30 class Visualizer_Plugin {
29 31
30 - const NAME = 'visualizer';
31 - const VERSION = '3.1.2';
32 + const NAME = 'visualizer';
33 + const VERSION = '1.4.2.2';
32 34
33 35 // custom post types
34 36 const CPT_VISUALIZER = 'visualizer';
35 37
36 38 // custom meta fields
37 - const CF_CHART_TYPE = 'visualizer-chart-type';
38 - const CF_SOURCE = 'visualizer-source';
39 - const CF_SERIES = 'visualizer-series';
39 + const CF_CHART_TYPE = 'visualizer-chart-type';
40 + const CF_SOURCE = 'visualizer-source';
41 + const CF_SERIES = 'visualizer-series';
40 42 const CF_DEFAULT_DATA = 'visualizer-default-data';
41 - const CF_SETTINGS = 'visualizer-settings';
43 + const CF_SETTINGS = 'visualizer-settings';
42 44
43 - const CF_SOURCE_FILTER = 'visualizer-source-filter';
44 -
45 45 // custom actions
46 - const ACTION_GET_CHARTS = 'visualizer-get-charts';
46 + const ACTION_GET_CHARTS = 'visualizer-get-charts';
47 47 const ACTION_CREATE_CHART = 'visualizer-create-chart';
48 - const ACTION_EDIT_CHART = 'visualizer-edit-chart';
49 - const ACTION_CLONE_CHART = 'visualizer-clone-chart';
48 + const ACTION_EDIT_CHART = 'visualizer-edit-chart';
49 + const ACTION_CLONE_CHART = 'visualizer-clone-chart';
50 50 const ACTION_DELETE_CHART = 'visualizer-delete-chart';
51 - const ACTION_UPLOAD_DATA = 'visualizer-upload-data';
52 - const ACTION_EXPORT_DATA = 'visualizer-export-data';
51 + const ACTION_UPLOAD_DATA = 'visualizer-upload-data';
53 52
54 - /**
55 - *Action used for fetching specific users/roles for permissions.
56 - */
57 - const ACTION_FETCH_PERMISSIONS_DATA = 'visualizer-fetch-permissions-data';
58 -
59 - /**
60 - *Action used for fetching db import data.
61 - */
62 - const ACTION_FETCH_DB_DATA = 'visualizer-fetch-db-data';
63 - const ACTION_SAVE_DB_QUERY = 'visualizer-save-db-query';
64 -
65 53 // custom filters
66 54 const FILTER_CHART_WRAPPER_CLASS = 'visualizer-chart-wrapper-class';
67 - const FILTER_GET_CHART_SERIES = 'visualizer-get-chart-series';
68 - const FILTER_GET_CHART_DATA = 'visualizer-get-chart-data';
69 - const FILTER_GET_CHART_SETTINGS = 'visualizer-get-chart-settings';
70 - const FILTER_UNDO_REVISIONS = 'visualizer-undo-revisions';
71 - const FILTER_HANDLE_REVISIONS = 'visualizer-handle-revisions';
55 + const FILTER_GET_CHART_SERIES = 'visualizer-get-chart-series';
56 + const FILTER_GET_CHART_DATA = 'visualizer-get-chart-data';
72 57
73 - const CF_DB_SCHEDULE = 'visualizer-db-schedule';
74 - const CF_DB_QUERY = 'visualizer-db-query';
75 -
76 - const CF_CHART_URL = 'visualizer-chart-url';
77 - const CF_CHART_SCHEDULE = 'visualizer-chart-schedule';
78 - // Added by Ash/Upwork
79 - const PRO_TEASER_URL = 'http://themeisle.com/plugins/visualizer-charts-and-graphs-pro-addon/';
80 - const PRO_TEASER_TITLE = 'Check PRO version ';
81 - // Added by Ash/Upwork
82 58 /**
83 59 * Singletone instance of the plugin.
84 60 *
85 61 * @since 1.0.0
@@ -105,15 +81,20 @@
105 81 * @since 1.0.0
106 82 *
107 83 * @access private
108 84 */
109 - private function __construct() {
110 - if ( VISUALIZER_DEBUG ) {
111 - add_action( 'themeisle_log_event', array( $this, 'themeisle_log_event_debug' ), 10, 5 );
112 - }
113 - }
85 + private function __construct() {}
114 86
115 87 /**
88 + * Private clone method.
89 + *
90 + * @since 1.0.0
91 + *
92 + * @access private
93 + */
94 + private function __clone() {}
95 +
96 + /**
116 97 * Returns singletone instance of the plugin.
117 98 *
118 99 * @since 1.0.0
119 100 *
@@ -129,35 +110,18 @@
129 110 return self::$_instance;
130 111 }
131 112
132 113 /**
133 - * Returns chart types.
134 - *
135 - * @since 1.0.0
136 - *
137 - * @static
138 - * @access public
139 - * @return array
140 - */
141 - public static function getChartTypes() {
142 - $array = array_keys( Visualizer_Module_Admin::_getChartTypesLocalized() );
143 -
144 - return $array;
145 - }
146 -
147 - /**
148 114 * Returns a module if it was registered before. Otherwise NULL.
149 115 *
150 116 * @since 1.0.0
151 117 *
152 118 * @access public
153 - *
154 119 * @param string $name The name of the module to return.
155 - *
156 120 * @return Visualizer_Module|null Returns a module if it was registered or NULL.
157 121 */
158 122 public function getModule( $name ) {
159 - return isset( $this->_modules[ $name ] ) ? $this->_modules[ $name ] : null;
123 + return isset( $this->_modules[$name] ) ? $this->_modules[$name] : null;
160 124 }
161 125
162 126 /**
163 127 * Determines whether the module has been registered or not.
@@ -164,15 +128,13 @@
164 128 *
165 129 * @since 1.0.0
166 130 *
167 131 * @access public
168 - *
169 132 * @param string $name The name of a module to check.
170 - *
171 133 * @return boolean TRUE if the module has been registered. Otherwise FALSE.
172 134 */
173 135 public function hasModule( $name ) {
174 - return isset( $this->_modules[ $name ] );
136 + return isset( $this->_modules[$name] );
175 137 }
176 138
177 139 /**
178 140 * Register new module in the plugin.
@@ -179,32 +141,24 @@
179 141 *
180 142 * @since 1.0.0
181 143 *
182 144 * @access public
183 - *
184 - * @param string $class The name of the module to use in the plugin.
145 + * @param string $module The name of the module to use in the plugin.
185 146 */
186 147 public function setModule( $class ) {
187 - $this->_modules[ $class ] = new $class( $this );
148 + $this->_modules[$class] = new $class( $this );
188 149 }
189 150
190 151 /**
191 - * Private clone method.
152 + * Returns chart types.
192 153 *
193 154 * @since 1.0.0
194 155 *
195 - * @access private
156 + * @static
157 + * @access public
158 + * @return array
196 159 */
197 - private function __clone() {
160 + public static function getChartTypes() {
161 + return array( 'line', 'area', 'bar', 'column', 'pie', 'geo', 'scatter', 'candlestick', 'gauge' );
198 162 }
199 163
200 - /**
201 - * For local testing, overrides the 'themeisle_log_event' hook and redirects to error.log.
202 - */
203 - final function themeisle_log_event_debug( $name, $message, $type, $file, $line ) {
204 - if ( Visualizer_Plugin::NAME !== $name ) {
205 - return;
206 - }
207 - error_log( sprintf( '%s (%s): %s in %s:%s', $name, $type, $message, $file, $line ) );
208 - }
209 -
210 -}
164 +}