| @@ -27,9 +27,9 @@ | ||
| 27 | 27 | */ |
| 28 | 28 | class Visualizer_Plugin { |
| 29 | 29 | |
| 30 | 30 | const NAME = 'visualizer'; |
| 31 | - const VERSION = '3.0.6'; | |
| 31 | + const VERSION = '3.2.0'; | |
| 32 | 32 | |
| 33 | 33 | // custom post types |
| 34 | 34 | const CPT_VISUALIZER = 'visualizer'; |
| 35 | 35 | |
| @@ -40,8 +40,9 @@ | ||
| 40 | 40 | const CF_DEFAULT_DATA = 'visualizer-default-data'; |
| 41 | 41 | const CF_SETTINGS = 'visualizer-settings'; |
| 42 | 42 | |
| 43 | 43 | const CF_SOURCE_FILTER = 'visualizer-source-filter'; |
| 44 | + const CF_FILTER_CONFIG = 'visualizer-filter-config'; | |
| 44 | 45 | |
| 45 | 46 | // custom actions |
| 46 | 47 | const ACTION_GET_CHARTS = 'visualizer-get-charts'; |
| 47 | 48 | const ACTION_CREATE_CHART = 'visualizer-create-chart'; |
| @@ -48,9 +49,8 @@ | ||
| 48 | 49 | const ACTION_EDIT_CHART = 'visualizer-edit-chart'; |
| 49 | 50 | const ACTION_CLONE_CHART = 'visualizer-clone-chart'; |
| 50 | 51 | const ACTION_DELETE_CHART = 'visualizer-delete-chart'; |
| 51 | 52 | const ACTION_UPLOAD_DATA = 'visualizer-upload-data'; |
| 52 | - // Added by Ash/Upwork | |
| 53 | 53 | const ACTION_EXPORT_DATA = 'visualizer-export-data'; |
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | 56 | *Action used for fetching specific users/roles for permissions. |
| @@ -56,14 +56,37 @@ | ||
| 56 | 56 | *Action used for fetching specific users/roles for permissions. |
| 57 | 57 | */ |
| 58 | 58 | const ACTION_FETCH_PERMISSIONS_DATA = 'visualizer-fetch-permissions-data'; |
| 59 | 59 | |
| 60 | + /** | |
| 61 | + *Action used for fetching db import data. | |
| 62 | + */ | |
| 63 | + const ACTION_FETCH_DB_DATA = 'visualizer-fetch-db-data'; | |
| 64 | + const ACTION_SAVE_DB_QUERY = 'visualizer-save-db-query'; | |
| 65 | + | |
| 66 | + const ACTION_JSON_GET_ROOTS = 'visualizer-json-get-roots'; | |
| 67 | + const ACTION_JSON_GET_DATA = 'visualizer-json-get-data'; | |
| 68 | + const ACTION_JSON_SET_DATA = 'visualizer-json-set-data'; | |
| 69 | + const ACTION_JSON_SET_SCHEDULE = 'visualizer-json-set-schedule'; | |
| 70 | + const CF_JSON_URL = 'visualizer-json-url'; | |
| 71 | + const CF_JSON_ROOT = 'visualizer-json-root'; | |
| 72 | + const CF_JSON_SCHEDULE = 'visualizer-json-schedule'; | |
| 73 | + const CF_JSON_PAGING = 'visualizer-json-paging'; | |
| 74 | + | |
| 75 | + const ACTION_SAVE_FILTER_QUERY = 'visualizer-save-filter-query'; | |
| 76 | + | |
| 60 | 77 | // custom filters |
| 61 | 78 | const FILTER_CHART_WRAPPER_CLASS = 'visualizer-chart-wrapper-class'; |
| 62 | 79 | const FILTER_GET_CHART_SERIES = 'visualizer-get-chart-series'; |
| 63 | 80 | const FILTER_GET_CHART_DATA = 'visualizer-get-chart-data'; |
| 64 | 81 | const FILTER_GET_CHART_SETTINGS = 'visualizer-get-chart-settings'; |
| 82 | + const FILTER_UNDO_REVISIONS = 'visualizer-undo-revisions'; | |
| 83 | + const FILTER_HANDLE_REVISIONS = 'visualizer-handle-revisions'; | |
| 84 | + const FILTER_GET_CHART_DATA_AS = 'visualizer-get-chart-data-as'; | |
| 65 | 85 | |
| 86 | + const CF_DB_SCHEDULE = 'visualizer-db-schedule'; | |
| 87 | + const CF_DB_QUERY = 'visualizer-db-query'; | |
| 88 | + | |
| 66 | 89 | const CF_CHART_URL = 'visualizer-chart-url'; |
| 67 | 90 | const CF_CHART_SCHEDULE = 'visualizer-chart-schedule'; |
| 68 | 91 | // Added by Ash/Upwork |
| 69 | 92 | const PRO_TEASER_URL = 'http://themeisle.com/plugins/visualizer-charts-and-graphs-pro-addon/'; |
| @@ -96,8 +119,11 @@ | ||
| 96 | 119 | * |
| 97 | 120 | * @access private |
| 98 | 121 | */ |
| 99 | 122 | private function __construct() { |
| 123 | + if ( VISUALIZER_DEBUG ) { | |
| 124 | + add_action( 'themeisle_log_event', array( $this, 'themeisle_log_event_debug' ), 10, 5 ); | |
| 125 | + } | |
| 100 | 126 | } |
| 101 | 127 | |
| 102 | 128 | /** |
| 103 | 129 | * Returns singletone instance of the plugin. |
| @@ -181,7 +207,17 @@ | ||
| 181 | 207 | * |
| 182 | 208 | * @access private |
| 183 | 209 | */ |
| 184 | 210 | private function __clone() { |
| 211 | + } | |
| 212 | + | |
| 213 | + /** | |
| 214 | + * For local testing, overrides the 'themeisle_log_event' hook and redirects to error.log. | |
| 215 | + */ | |
| 216 | + final function themeisle_log_event_debug( $name, $message, $type, $file, $line ) { | |
| 217 | + if ( Visualizer_Plugin::NAME !== $name ) { | |
| 218 | + return; | |
| 219 | + } | |
| 220 | + error_log( sprintf( '%s (%s): %s in %s:%s', $name, $type, $message, $file, $line ) ); | |
| 185 | 221 | } |
| 186 | 222 | |
| 187 | 223 | } |