Data Tables Generator by Supsystic - Version 1.10.8

Version Description

/ 26.03.2021 = * Add fix OVH

Download this release

Release Info

Developer supsystic.com
Plugin Icon 128x128 Data Tables Generator by Supsystic
Version 1.10.8
Comparing to
See all releases

Code changes from version 1.10.7 to 1.10.8

Files changed (3) hide show
  1. app/SupsysticTables.php +205 -205
  2. index.php +1 -1
  3. readme.txt +4 -1
app/SupsysticTables.php CHANGED
@@ -1,205 +1,205 @@
1
- <?php
2
-
3
- /**
4
- * Class SupsysticTables
5
- */
6
- class SupsysticTables
7
- {
8
- private $environment;
9
-
10
- public function __construct()
11
- {
12
- if (!class_exists('Rsc_Autoloader', false)) {
13
- require dirname(dirname(__FILE__)) . '/vendor/Rsc/Autoloader.php';
14
- Rsc_Autoloader::register();
15
- }
16
-
17
- add_action('init', array($this, 'addShortcodeButton'));
18
-
19
- $menuSlug = 'supsystic-tables';
20
- $pluginPath = dirname(dirname(__FILE__));
21
- $environment = new Rsc_Environment('st', '1.10.7', $pluginPath);
22
-
23
- /* Configure */
24
- $environment->configure(
25
- array(
26
- 'optimizations' => 1,
27
- 'environment' => $this->getPluginEnvironment(),
28
- 'default_module' => 'tables',
29
- 'lang_domain' => 'supsystic_tables',
30
- 'lang_path' => plugin_basename(dirname(__FILE__)) . '/langs',
31
- 'plugin_prefix' => 'SupsysticTables',
32
- 'plugin_source' => $pluginPath . '/src',
33
- 'plugin_title_name' => 'Data Tables',
34
- 'plugin_menu' => array(
35
- 'page_title' => __('Tables by Supsystic', $menuSlug),
36
- 'menu_title' => __('Tables by Supsystic', $menuSlug),
37
- 'capability' => 'manage_options',
38
- 'menu_slug' => $menuSlug,
39
- 'icon_url' => 'dashicons-editor-table',
40
- 'position' => '102.2',
41
- ),
42
- 'shortcode_prefix' => $menuSlug,
43
- 'shortcode_name' => defined('SUPSYSTIC_TABLES_SHORTCODE_NAME') ? SUPSYSTIC_TABLES_SHORTCODE_NAME : $menuSlug,
44
- 'shortcode_part_name' => defined('SUPSYSTIC_TABLES_PART_SHORTCODE_NAME') ? SUPSYSTIC_TABLES_PART_SHORTCODE_NAME : $menuSlug . '-part',
45
- 'shortcode_cell_name' => defined('SUPSYSTIC_TABLES_CELL_SHORTCODE_NAME') ? SUPSYSTIC_TABLES_CELL_SHORTCODE_NAME : $menuSlug . '-cell-full',
46
- 'shortcode_value_name' => defined('SUPSYSTIC_TABLES_VALUE_SHORTCODE_NAME') ? SUPSYSTIC_TABLES_VALUE_SHORTCODE_NAME : $menuSlug . '-cell',
47
- 'db_prefix' => 'supsystic_tbl_',
48
- 'hooks_prefix' => 'supsystic_tbl_',
49
- 'ajax_url' => admin_url('admin-ajax.php'),
50
- 'admin_url' => admin_url(),
51
- 'plugin_db_update' => true,
52
- 'revision_key' => '_supsystic_tables_rev',
53
- 'revision' => 61,
54
- 'welcome_page_was_showed' => get_option('supsystic_tbl_welcome_page_was_showed'),
55
- 'promo_controller' => 'SupsysticTables_Promo_Controller'
56
- )
57
- );
58
-
59
- $this->environment = $environment;
60
- $this->initFilesystem();
61
- }
62
-
63
- public function run()
64
- {
65
- $this->environment->run();
66
- }
67
-
68
- public function createSchema()
69
- {
70
- global $wpdb;
71
-
72
- if (is_file($schema = dirname(__FILE__) . '/configs/dbschema.sql')) {
73
- $prefix = $wpdb->prefix . $this->environment
74
- ->getConfig()
75
- ->get('db_prefix');
76
-
77
- $sql = str_replace('%prefix%', $prefix, file_get_contents($schema));
78
-
79
- if (!function_exists('dbDelta')) {
80
- require_once(ABSPATH.'wp-admin/includes/upgrade.php');
81
- }
82
- $wpdb->query('SET FOREIGN_KEY_CHECKS=0');
83
- dbDelta($sql);
84
- $wpdb->query('SET FOREIGN_KEY_CHECKS=1');
85
- update_option($this->environment->getPluginName().'_installed', 1);
86
- }
87
- }
88
-
89
- public function dropSchema()
90
- {
91
- global $wpdb;
92
-
93
- $prefix = $wpdb->prefix . $this->environment
94
- ->getConfig()
95
- ->get('db_prefix');
96
-
97
- $tables = $wpdb->get_results('SHOW TABLES LIKE \''.$prefix.'%\'', ARRAY_N);
98
-
99
- if (count($tables) < 1) {
100
- return;
101
- }
102
-
103
- $wpdb->query('SET FOREIGN_KEY_CHECKS=0');
104
- foreach ($tables as $inded => $table) {
105
- $wpdb->query('DROP TABLE IF EXISTS '.array_pop($table).' CASCADE;');
106
- }
107
-
108
- $wpdb->query('SET FOREIGN_KEY_CHECKS=1');
109
- }
110
-
111
- public function getEnvironment()
112
- {
113
- return $this->environment;
114
- }
115
-
116
- protected function getPluginEnvironment()
117
- {
118
- $environment = Rsc_Environment::ENV_PRODUCTION;
119
-
120
- if (defined('WP_DEBUG') && WP_DEBUG) {
121
- if (defined('SUPSYSTIC_STB_DEBUG') && SUPSYSTIC_STB_DEBUG) {
122
- $environment = Rsc_Environment::ENV_DEVELOPMENT;
123
- }
124
- }
125
-
126
- return $environment;
127
- }
128
-
129
- protected function checkCacheHtacess()
130
- {
131
- $fullPath = wp_upload_dir();
132
- $fullPath = $fullPath['basedir'];
133
- $fullPath = $fullPath.'/supsystic-tables/cache/tables/.htaccess';
134
- if(!file_exists($fullPath)){
135
- $content = '<Files ~ "^.*">' . "\n";
136
- $content .= 'Deny from all' . "\n";
137
- $content .= '</Files>' . "\n";
138
- file_put_contents($fullPath, $content);
139
- }
140
- }
141
-
142
- protected function initFilesystem()
143
- {
144
- $directories = array(
145
- 'tmp' => '/supsystic-tables',
146
- 'log' => '/supsystic-tables/log',
147
- 'cache' => '/supsystic-tables/cache',
148
- 'cache_tables' => '/supsystic-tables/cache/tables',
149
- );
150
-
151
- foreach ($directories as $key => $dir) {
152
- if (false !== $fullPath = $this->makeDirectory($dir)) {
153
- $this->environment->getConfig()->add('plugin_' . $key, $fullPath);
154
- }
155
- }
156
-
157
- $this->checkCacheHtacess();
158
- }
159
-
160
- /**
161
- * Make directory in uploads directory.
162
- * @param string $directory Relative to the WP_UPLOADS dir
163
- * @return bool|string FALSE on failure, full path to the directory on success
164
- */
165
- protected function makeDirectory($directory)
166
- {
167
- $uploads = wp_upload_dir();
168
-
169
- $basedir = $uploads['basedir'];
170
- $dir = $basedir . $directory;
171
- if (!is_dir($dir)) {
172
- if (false === @mkdir($dir, 0775, true)) {
173
- return false;
174
- }
175
- } else {
176
- if (! is_writable($dir)) {
177
- return false;
178
- }
179
- }
180
-
181
- return $dir;
182
- }
183
-
184
- public function addShortcodeButton() {
185
- add_filter('mce_external_plugins', array($this, 'addButton'));
186
- add_filter('mce_buttons', array($this, 'registerButton'));
187
- wp_enqueue_script('jquery');
188
- if(is_admin()) {
189
- wp_enqueue_script('stb-bpopup-js', $this->environment->getConfig()->get('plugin_url') . '/app/assets/js/plugins/jquery.bpopup.min.js', array('jquery'), false, true);
190
- wp_enqueue_style('stb-bpopup', $this->environment->getConfig()->get('plugin_url') . '/app/assets/css/editor-dialog.css');
191
- }
192
- }
193
-
194
- public function addButton( $plugin_array ) {
195
- $plugin_array['addShortcodeDataTable'] = $this->environment->getConfig()->get('plugin_url') . '/app/assets/js/buttons.js';
196
-
197
- return $plugin_array;
198
- }
199
-
200
- public function registerButton( $buttons ) {
201
- array_push( $buttons, 'addShortcodeDataTable', 'selectShortcode' );
202
-
203
- return $buttons;
204
- }
205
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class SupsysticTables
5
+ */
6
+ class SupsysticTables
7
+ {
8
+ private $environment;
9
+
10
+ public function __construct()
11
+ {
12
+ if (!class_exists('Rsc_Autoloader', false)) {
13
+ require dirname(dirname(__FILE__)) . '/vendor/Rsc/Autoloader.php';
14
+ Rsc_Autoloader::register();
15
+ }
16
+
17
+ add_action('init', array($this, 'addShortcodeButton'));
18
+
19
+ $menuSlug = 'supsystic-tables';
20
+ $pluginPath = dirname(dirname(__FILE__));
21
+ $environment = new Rsc_Environment('st', '1.10.7', $pluginPath);
22
+
23
+ /* Configure */
24
+ $environment->configure(
25
+ array(
26
+ 'optimizations' => 1,
27
+ 'environment' => $this->getPluginEnvironment(),
28
+ 'default_module' => 'tables',
29
+ 'lang_domain' => 'supsystic_tables',
30
+ 'lang_path' => plugin_basename(dirname(__FILE__)) . '/langs',
31
+ 'plugin_prefix' => 'SupsysticTables',
32
+ 'plugin_source' => $pluginPath . '/src',
33
+ 'plugin_title_name' => 'Data Tables',
34
+ 'plugin_menu' => array(
35
+ 'page_title' => __('Tables by Supsystic', $menuSlug),
36
+ 'menu_title' => __('Tables by Supsystic', $menuSlug),
37
+ 'capability' => 'manage_options',
38
+ 'menu_slug' => $menuSlug,
39
+ 'icon_url' => 'dashicons-editor-table',
40
+ 'position' => '102.2',
41
+ ),
42
+ 'shortcode_prefix' => $menuSlug,
43
+ 'shortcode_name' => defined('SUPSYSTIC_TABLES_SHORTCODE_NAME') ? SUPSYSTIC_TABLES_SHORTCODE_NAME : $menuSlug,
44
+ 'shortcode_part_name' => defined('SUPSYSTIC_TABLES_PART_SHORTCODE_NAME') ? SUPSYSTIC_TABLES_PART_SHORTCODE_NAME : $menuSlug . '-part',
45
+ 'shortcode_cell_name' => defined('SUPSYSTIC_TABLES_CELL_SHORTCODE_NAME') ? SUPSYSTIC_TABLES_CELL_SHORTCODE_NAME : $menuSlug . '-cell-full',
46
+ 'shortcode_value_name' => defined('SUPSYSTIC_TABLES_VALUE_SHORTCODE_NAME') ? SUPSYSTIC_TABLES_VALUE_SHORTCODE_NAME : $menuSlug . '-cell',
47
+ 'db_prefix' => 'supsystic_tbl_',
48
+ 'hooks_prefix' => 'supsystic_tbl_',
49
+ 'ajax_url' => admin_url('admin-ajax.php'),
50
+ 'admin_url' => admin_url(),
51
+ 'plugin_db_update' => true,
52
+ 'revision_key' => '_supsystic_tables_rev',
53
+ 'revision' => 61,
54
+ 'welcome_page_was_showed' => get_option('supsystic_tbl_welcome_page_was_showed'),
55
+ 'promo_controller' => 'SupsysticTables_Promo_Controller'
56
+ )
57
+ );
58
+
59
+ $this->environment = $environment;
60
+ $this->initFilesystem();
61
+ }
62
+
63
+ public function run()
64
+ {
65
+ $this->environment->run();
66
+ }
67
+
68
+ public function createSchema()
69
+ {
70
+ global $wpdb;
71
+
72
+ if (is_file($schema = dirname(__FILE__) . '/configs/dbschema.sql')) {
73
+ $prefix = $wpdb->prefix . $this->environment
74
+ ->getConfig()
75
+ ->get('db_prefix');
76
+
77
+ $sql = str_replace('%prefix%', $prefix, file_get_contents($schema));
78
+
79
+ if (!function_exists('dbDelta')) {
80
+ require_once(ABSPATH.'wp-admin/includes/upgrade.php');
81
+ }
82
+ $wpdb->query('SET FOREIGN_KEY_CHECKS=0');
83
+ dbDelta($sql);
84
+ $wpdb->query('SET FOREIGN_KEY_CHECKS=1');
85
+ update_option($this->environment->getPluginName().'_installed', 1);
86
+ }
87
+ }
88
+
89
+ public function dropSchema()
90
+ {
91
+ global $wpdb;
92
+
93
+ $prefix = $wpdb->prefix . $this->environment
94
+ ->getConfig()
95
+ ->get('db_prefix');
96
+
97
+ $tables = $wpdb->get_results('SHOW TABLES LIKE \''.$prefix.'%\'', ARRAY_N);
98
+
99
+ if (count($tables) < 1) {
100
+ return;
101
+ }
102
+
103
+ $wpdb->query('SET FOREIGN_KEY_CHECKS=0');
104
+ foreach ($tables as $inded => $table) {
105
+ $wpdb->query('DROP TABLE IF EXISTS '.array_pop($table).' CASCADE;');
106
+ }
107
+
108
+ $wpdb->query('SET FOREIGN_KEY_CHECKS=1');
109
+ }
110
+
111
+ public function getEnvironment()
112
+ {
113
+ return $this->environment;
114
+ }
115
+
116
+ protected function getPluginEnvironment()
117
+ {
118
+ $environment = Rsc_Environment::ENV_PRODUCTION;
119
+
120
+ if (defined('WP_DEBUG') && WP_DEBUG) {
121
+ if (defined('SUPSYSTIC_STB_DEBUG') && SUPSYSTIC_STB_DEBUG) {
122
+ $environment = Rsc_Environment::ENV_DEVELOPMENT;
123
+ }
124
+ }
125
+
126
+ return $environment;
127
+ }
128
+
129
+ protected function checkCacheHtacess()
130
+ {
131
+ $fullPath = wp_upload_dir();
132
+ $fullPath = $fullPath['basedir'];
133
+ $fullPath = $fullPath.'/supsystic-tables/cache/tables/.htaccess';
134
+ if(!file_exists($fullPath)){
135
+ $content = '<Files ~ "^.*">' . "\n";
136
+ $content .= 'Deny from all' . "\n";
137
+ $content .= '</Files>' . "\n";
138
+ file_put_contents($fullPath, $content);
139
+ }
140
+ }
141
+
142
+ protected function initFilesystem()
143
+ {
144
+ $directories = array(
145
+ 'tmp' => '/supsystic-tables',
146
+ 'log' => '/supsystic-tables/log',
147
+ 'cache' => '/supsystic-tables/cache',
148
+ 'cache_tables' => '/supsystic-tables/cache/tables',
149
+ );
150
+
151
+ foreach ($directories as $key => $dir) {
152
+ if (false !== $fullPath = $this->makeDirectory($dir)) {
153
+ $this->environment->getConfig()->add('plugin_' . $key, $fullPath);
154
+ }
155
+ }
156
+
157
+ $this->checkCacheHtacess();
158
+ }
159
+
160
+ /**
161
+ * Make directory in uploads directory.
162
+ * @param string $directory Relative to the WP_UPLOADS dir
163
+ * @return bool|string FALSE on failure, full path to the directory on success
164
+ */
165
+ protected function makeDirectory($directory)
166
+ {
167
+ $uploads = wp_upload_dir();
168
+
169
+ $basedir = $uploads['basedir'];
170
+ $dir = $basedir . $directory;
171
+ if (!is_dir($dir)) {
172
+ if (false === @mkdir($dir, 0775, true)) {
173
+ return false;
174
+ }
175
+ } else {
176
+ if (! is_writable($dir)) {
177
+ return false;
178
+ }
179
+ }
180
+
181
+ return $dir;
182
+ }
183
+
184
+ public function addShortcodeButton() {
185
+ add_filter('mce_external_plugins', array($this, 'addButton'));
186
+ add_filter('mce_buttons', array($this, 'registerButton'));
187
+ wp_enqueue_script('jquery');
188
+ if(is_admin()) {
189
+ wp_enqueue_script('stb-bpopup-js', $this->environment->getConfig()->get('plugin_url') . '/app/assets/js/plugins/jquery.bpopup.min.js', array('jquery'), false, true);
190
+ wp_enqueue_style('stb-bpopup', $this->environment->getConfig()->get('plugin_url') . '/app/assets/css/editor-dialog.css');
191
+ }
192
+ }
193
+
194
+ public function addButton( $plugin_array ) {
195
+ $plugin_array['addShortcodeDataTable'] = $this->environment->getConfig()->get('plugin_url') . '/app/assets/js/buttons.js';
196
+
197
+ return $plugin_array;
198
+ }
199
+
200
+ public function registerButton( $buttons ) {
201
+ array_push( $buttons, 'addShortcodeDataTable', 'selectShortcode' );
202
+
203
+ return $buttons;
204
+ }
205
+ }
index.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Data Tables Generator by Supsystic
5
  * Plugin URI: http://supsystic.com
6
  * Description: Create and manage beautiful data tables with custom design. No HTML knowledge is required
7
- * Version: 1.10.7
8
  * Author: supsystic.com
9
  * Author URI: http://supsystic.com
10
  * Text Domain: supsystic_tables
4
  * Plugin Name: Data Tables Generator by Supsystic
5
  * Plugin URI: http://supsystic.com
6
  * Description: Create and manage beautiful data tables with custom design. No HTML knowledge is required
7
+ * Version: 1.10.8
8
  * Author: supsystic.com
9
  * Author URI: http://supsystic.com
10
  * Text Domain: supsystic_tables
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: supsystic.com
3
  Tags: data table, spreadsheet, table builder, charts, graphs, wordpress table plugin, excel, line chart, pie chart, visualise data
4
  Tested up to: 5.7
5
- Stable tag: 1.10.7
6
 
7
  Create data tables with charts and graphs. Custom design, navigation, searching and ordering functions. Export to PDF, CSV, Print. Excel spreadsheet. WooCommerce Integration.
8
 
@@ -214,6 +214,9 @@ It's perfect for product [Price List](http://woo.supsystic.com/price-list "Price
214
  Create custom order forms which increase your conversion rate!
215
 
216
  == Changelog ==
 
 
 
217
  = 1.10.7 / 19.03.2021 =
218
  * Add fix for import
219
 
2
  Contributors: supsystic.com
3
  Tags: data table, spreadsheet, table builder, charts, graphs, wordpress table plugin, excel, line chart, pie chart, visualise data
4
  Tested up to: 5.7
5
+ Stable tag: 1.10.8
6
 
7
  Create data tables with charts and graphs. Custom design, navigation, searching and ordering functions. Export to PDF, CSV, Print. Excel spreadsheet. WooCommerce Integration.
8
 
214
  Create custom order forms which increase your conversion rate!
215
 
216
  == Changelog ==
217
+ = 1.10.8 / 26.03.2021 =
218
+ * Add fix OVH
219
+
220
  = 1.10.7 / 19.03.2021 =
221
  * Add fix for import
222