| @@ -27,15 +27,14 @@ | ||
| 27 | 27 | */ |
| 28 | 28 | class Visualizer_Plugin { |
| 29 | 29 | |
| 30 | 30 | const NAME = 'visualizer'; |
| 31 | - const VERSION = '4.0.7'; | |
| 31 | + const VERSION = '3.3.4'; | |
| 32 | 32 | |
| 33 | 33 | // custom post types |
| 34 | 34 | const CPT_VISUALIZER = 'visualizer'; |
| 35 | 35 | |
| 36 | 36 | // custom meta fields |
| 37 | - const CF_CHART_IMAGE = 'visualizer-chart-image'; | |
| 38 | 37 | const CF_CHART_TYPE = 'visualizer-chart-type'; |
| 39 | 38 | const CF_SOURCE = 'visualizer-source'; |
| 40 | 39 | const CF_SERIES = 'visualizer-series'; |
| 41 | 40 | const CF_DEFAULT_DATA = 'visualizer-default-data'; |
| @@ -40,14 +39,11 @@ | ||
| 40 | 39 | const CF_SERIES = 'visualizer-series'; |
| 41 | 40 | const CF_DEFAULT_DATA = 'visualizer-default-data'; |
| 42 | 41 | const CF_SETTINGS = 'visualizer-settings'; |
| 43 | 42 | const CF_CHART_LIBRARY = 'visualizer-chart-library'; |
| 44 | - const CF_ERROR = 'visualizer-error'; | |
| 45 | - const CF_REMOTE_DB_PARAMS = 'visualizer-remote-db-params'; | |
| 46 | 43 | |
| 47 | 44 | const CF_SOURCE_FILTER = 'visualizer-source-filter'; |
| 48 | 45 | const CF_FILTER_CONFIG = 'visualizer-filter-config'; |
| 49 | - const CF_EDITABLE_TABLE = 'visualizer-editable-table'; | |
| 50 | 46 | |
| 51 | 47 | // custom actions |
| 52 | 48 | const ACTION_GET_CHARTS = 'visualizer-get-charts'; |
| 53 | 49 | const ACTION_CREATE_CHART = 'visualizer-create-chart'; |
| @@ -56,10 +52,8 @@ | ||
| 56 | 52 | const ACTION_DELETE_CHART = 'visualizer-delete-chart'; |
| 57 | 53 | const ACTION_UPLOAD_DATA = 'visualizer-upload-data'; |
| 58 | 54 | const ACTION_EXPORT_DATA = 'visualizer-export-data'; |
| 59 | 55 | |
| 60 | - const STORE_URL = 'https://store.themeisle.com/'; | |
| 61 | - | |
| 62 | 56 | /** |
| 63 | 57 | *Action used for fetching specific users/roles for permissions. |
| 64 | 58 | */ |
| 65 | 59 | const ACTION_FETCH_PERMISSIONS_DATA = 'visualizer-fetch-permissions-data'; |
| @@ -77,10 +71,8 @@ | ||
| 77 | 71 | const CF_JSON_URL = 'visualizer-json-url'; |
| 78 | 72 | const CF_JSON_ROOT = 'visualizer-json-root'; |
| 79 | 73 | const CF_JSON_SCHEDULE = 'visualizer-json-schedule'; |
| 80 | 74 | const CF_JSON_PAGING = 'visualizer-json-paging'; |
| 81 | - const CF_JSON_HEADERS = 'visualizer-json-headers'; | |
| 82 | - const CF_EDITOR = 'visualizer-editor'; | |
| 83 | 75 | |
| 84 | 76 | const ACTION_SAVE_FILTER_QUERY = 'visualizer-save-filter-query'; |
| 85 | 77 | |
| 86 | 78 | // custom filters |
| @@ -90,10 +82,8 @@ | ||
| 90 | 82 | const FILTER_GET_CHART_SETTINGS = 'visualizer-get-chart-settings'; |
| 91 | 83 | const FILTER_UNDO_REVISIONS = 'visualizer-undo-revisions'; |
| 92 | 84 | const FILTER_HANDLE_REVISIONS = 'visualizer-handle-revisions'; |
| 93 | 85 | const FILTER_GET_CHART_DATA_AS = 'visualizer-get-chart-data-as'; |
| 94 | - const FILTER_HANDLE_CACHE_EXPIRATION_TIME = 'visualizer-handle-expiration-time'; | |
| 95 | - const FILTER_CHART_TITLE = 'the_title'; | |
| 96 | 86 | |
| 97 | 87 | const CF_DB_SCHEDULE = 'visualizer-db-schedule'; |
| 98 | 88 | const CF_DB_QUERY = 'visualizer-db-query'; |
| 99 | 89 | |
| @@ -99,20 +89,10 @@ | ||
| 99 | 89 | |
| 100 | 90 | const CF_CHART_URL = 'visualizer-chart-url'; |
| 101 | 91 | const CF_CHART_SCHEDULE = 'visualizer-chart-schedule'; |
| 102 | 92 | // Added by Ash/Upwork |
| 103 | - const PRO_TEASER_URL = 'https://themeisle.com/plugins/visualizer-charts-and-graphs/upgrade/'; | |
| 93 | + const PRO_TEASER_URL = 'https://themeisle.com/plugins/visualizer-charts-and-graphs/upgrade/#pricing'; | |
| 104 | 94 | const PRO_TEASER_TITLE = 'Check PRO version '; |
| 105 | - | |
| 106 | - const CF_CHART_CACHE = 'visualizer-chart-cache'; | |
| 107 | - const CF_JSON_WOOCOMMERCE_SOURCE = 'visualizer-woocommerce-source'; | |
| 108 | - const CF_IS_WOOCOMMERCE_SOURCE = 'visualizer-is-woocommerce-source'; | |
| 109 | - | |
| 110 | - /** | |
| 111 | - * Name of the option for WordPress DB. | |
| 112 | - */ | |
| 113 | - const WP_DB_NAME = 'WordPress DB'; | |
| 114 | - | |
| 115 | 95 | // Added by Ash/Upwork |
| 116 | 96 | /** |
| 117 | 97 | * Singletone instance of the plugin. |
| 118 | 98 | * |
| @@ -133,15 +113,8 @@ | ||
| 133 | 113 | */ |
| 134 | 114 | private $_modules = array(); |
| 135 | 115 | |
| 136 | 116 | /** |
| 137 | - * Returns the date queries supported in the library date filter. | |
| 138 | - */ | |
| 139 | - public static function getSupportedDateFilter() { | |
| 140 | - return apply_filters( 'visualizer_filter_by_date', array( '' => __( 'All dates', 'visualizer' ), 'yesterday' => __( 'Yesterday', 'visualizer' ), 'last week' => __( 'Last Week', 'visualizer' ), 'last month' => __( 'Last Month', 'visualizer' ), 'last year' => __( 'Last Year', 'visualizer' ) ) ); | |
| 141 | - } | |
| 142 | - | |
| 143 | - /** | |
| 144 | 117 | * Private constructor. |
| 145 | 118 | * |
| 146 | 119 | * @since 1.0.0 |
| 147 | 120 | * |
| @@ -221,12 +194,12 @@ | ||
| 221 | 194 | * @since 1.0.0 |
| 222 | 195 | * |
| 223 | 196 | * @access public |
| 224 | 197 | * |
| 225 | - * @param string $class_name The name of the module to use in the plugin. | |
| 198 | + * @param string $class The name of the module to use in the plugin. | |
| 226 | 199 | */ |
| 227 | - public function setModule( $class_name ) { | |
| 228 | - $this->_modules[ $class_name ] = new $class_name( $this ); | |
| 200 | + public function setModule( $class ) { | |
| 201 | + $this->_modules[ $class ] = new $class( $this ); | |
| 229 | 202 | } |
| 230 | 203 | |
| 231 | 204 | /** |
| 232 | 205 | * Private clone method. |
| @@ -240,11 +213,12 @@ | ||
| 240 | 213 | |
| 241 | 214 | /** |
| 242 | 215 | * For local testing, overrides the 'themeisle_log_event' hook and redirects to error.log. |
| 243 | 216 | */ |
| 244 | - final public function themeisle_log_event_debug( $name, $message, $type, $file, $line ) { | |
| 217 | + final function themeisle_log_event_debug( $name, $message, $type, $file, $line ) { | |
| 245 | 218 | if ( Visualizer_Plugin::NAME !== $name ) { |
| 246 | 219 | return; |
| 247 | 220 | } |
| 248 | 221 | error_log( sprintf( '%s (%s): %s in %s:%s', $name, $type, $message, $file, $line ) ); |
| 249 | 222 | } |
| 223 | + | |
| 250 | 224 | } |