PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 1.5.6
Visualizer – Tables & Charts Manager with Built-in AI Generator v1.5.6
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 +45 -73 3.0.91.5.6 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,52 +28,42 @@
26 28 * @since 1.0.0
27 29 */
28 30 class Visualizer_Plugin {
29 31
30 - const NAME = 'visualizer';
31 - const VERSION = '3.0.9';
32 + const NAME = 'visualizer';
33 + const VERSION = '1.5.5';
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 - // Added by Ash/Upwork
53 - const ACTION_EXPORT_DATA = 'visualizer-export-data';
51 + const ACTION_UPLOAD_DATA = 'visualizer-upload-data';
52 + // Added by Ash/Upwork
53 + const ACTION_EXPORT_DATA = 'visualizer-export-data';
54 54
55 - /**
56 - *Action used for fetching specific users/roles for permissions.
57 - */
58 - const ACTION_FETCH_PERMISSIONS_DATA = 'visualizer-fetch-permissions-data';
59 -
60 55 // custom filters
61 56 const FILTER_CHART_WRAPPER_CLASS = 'visualizer-chart-wrapper-class';
62 - const FILTER_GET_CHART_SERIES = 'visualizer-get-chart-series';
63 - const FILTER_GET_CHART_DATA = 'visualizer-get-chart-data';
64 - const FILTER_GET_CHART_SETTINGS = 'visualizer-get-chart-settings';
65 - const FILTER_UNDO_REVISIONS = 'visualizer-undo-revisions';
66 - const FILTER_HANDLE_REVISIONS = 'visualizer-handle-revisions';
57 + const FILTER_GET_CHART_SERIES = 'visualizer-get-chart-series';
58 + const FILTER_GET_CHART_DATA = 'visualizer-get-chart-data';
59 + const FILTER_GET_CHART_SETTINGS = 'visualizer-get-chart-settings';
67 60
68 - const CF_CHART_URL = 'visualizer-chart-url';
69 - const CF_CHART_SCHEDULE = 'visualizer-chart-schedule';
70 - // Added by Ash/Upwork
71 - const PRO_TEASER_URL = 'http://themeisle.com/plugins/visualizer-charts-and-graphs-pro-addon/';
72 - const PRO_TEASER_TITLE = 'Check PRO version ';
73 - // Added by Ash/Upwork
61 + // Added by Ash/Upwork
62 + const PRO_TEASER_URL = "http://themeisle.com/plugins/visualizer-charts-and-graphs-pro-addon/";
63 + const PRO_TEASER_TITLE = "Check PRO version ";
64 + // Added by Ash/Upwork
65 +
74 66 /**
75 67 * Singletone instance of the plugin.
76 68 *
77 69 * @since 1.0.0
@@ -97,15 +89,20 @@
97 89 * @since 1.0.0
98 90 *
99 91 * @access private
100 92 */
101 - private function __construct() {
102 - if ( VISUALIZER_DEBUG ) {
103 - add_action( 'themeisle_log_event', array( $this, 'themeisle_log_event_debug' ), 10, 5 );
104 - }
105 - }
93 + private function __construct() {}
106 94
107 95 /**
96 + * Private clone method.
97 + *
98 + * @since 1.0.0
99 + *
100 + * @access private
101 + */
102 + private function __clone() {}
103 +
104 + /**
108 105 * Returns singletone instance of the plugin.
109 106 *
110 107 * @since 1.0.0
111 108 *
@@ -121,35 +118,18 @@
121 118 return self::$_instance;
122 119 }
123 120
124 121 /**
125 - * Returns chart types.
126 - *
127 - * @since 1.0.0
128 - *
129 - * @static
130 - * @access public
131 - * @return array
132 - */
133 - public static function getChartTypes() {
134 - $array = array_keys( Visualizer_Module_Admin::_getChartTypesLocalized() );
135 -
136 - return $array;
137 - }
138 -
139 - /**
140 122 * Returns a module if it was registered before. Otherwise NULL.
141 123 *
142 124 * @since 1.0.0
143 125 *
144 126 * @access public
145 - *
146 127 * @param string $name The name of the module to return.
147 - *
148 128 * @return Visualizer_Module|null Returns a module if it was registered or NULL.
149 129 */
150 130 public function getModule( $name ) {
151 - return isset( $this->_modules[ $name ] ) ? $this->_modules[ $name ] : null;
131 + return isset( $this->_modules[$name] ) ? $this->_modules[$name] : null;
152 132 }
153 133
154 134 /**
155 135 * Determines whether the module has been registered or not.
@@ -156,15 +136,13 @@
156 136 *
157 137 * @since 1.0.0
158 138 *
159 139 * @access public
160 - *
161 140 * @param string $name The name of a module to check.
162 - *
163 141 * @return boolean TRUE if the module has been registered. Otherwise FALSE.
164 142 */
165 143 public function hasModule( $name ) {
166 - return isset( $this->_modules[ $name ] );
144 + return isset( $this->_modules[$name] );
167 145 }
168 146
169 147 /**
170 148 * Register new module in the plugin.
@@ -171,32 +149,26 @@
171 149 *
172 150 * @since 1.0.0
173 151 *
174 152 * @access public
175 - *
176 - * @param string $class The name of the module to use in the plugin.
153 + * @param string $module The name of the module to use in the plugin.
177 154 */
178 155 public function setModule( $class ) {
179 - $this->_modules[ $class ] = new $class( $this );
156 + $this->_modules[$class] = new $class( $this );
180 157 }
181 158
182 159 /**
183 - * Private clone method.
160 + * Returns chart types.
184 161 *
185 162 * @since 1.0.0
186 163 *
187 - * @access private
164 + * @static
165 + * @access public
166 + * @return array
188 167 */
189 - private function __clone() {
168 + public static function getChartTypes() {
169 + $array = array_keys(Visualizer_Module_Admin::_getChartTypesLocalized());
170 + unset($array[0]); // all
171 + return $array;
190 172 }
191 173
192 - /**
193 - * For local testing, overrides the 'themeisle_log_event' hook and redirects to error.log.
194 - */
195 - final function themeisle_log_event_debug( $name, $message, $type, $file, $line ) {
196 - if ( Visualizer_Plugin::NAME !== $name ) {
197 - return;
198 - }
199 - error_log( sprintf( '%s (%s): %s in %s:%s', $name, $type, $message, $file, $line ) );
200 - }
201 -
202 -}
174 +}