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