WP Table Builder – WordPress Table Plugin - Version 1.1.7

Version Description

  • FIX: Table Column Missing on Mobile Screens.
  • FIX: Table Row Missing on Mobile Screens.
  • IMPROVEMENT: More Compact Table View.
  • CHANGE: Default Cell Padding Value to 10.
Download this release

Release Info

Developer imtiazrayhan
Plugin Icon 128x128 WP Table Builder – WordPress Table Plugin
Version 1.1.7
Comparing to
See all releases

Code changes from version 1.1.6 to 1.1.7

inc/admin/css/admin.css CHANGED
@@ -1363,8 +1363,6 @@ table.wptb-table {
1363
  .wptb-ph-element {
1364
  position: relative;
1365
  border: 1px solid #fff0;
1366
- margin-top: 15px;
1367
- margin-bottom: 15px;
1368
  min-height: 15px;
1369
  }
1370
 
1363
  .wptb-ph-element {
1364
  position: relative;
1365
  border: 1px solid #fff0;
 
 
1366
  min-height: 15px;
1367
  }
1368
 
inc/admin/managers/elements-manager.php CHANGED
@@ -65,6 +65,8 @@ class Elements_Manager {
65
 
66
  $object->init_controls();
67
  }
 
 
68
  }
69
 
70
  /**
65
 
66
  $object->init_controls();
67
  }
68
+
69
+ do_action( 'wp-table-builder/elements_registered', $this );
70
  }
71
 
72
  /**
inc/admin/views/builder/table-settings-element.php CHANGED
@@ -174,7 +174,7 @@ class Table_Settings_Element extends Controls_Stack {
174
  ],
175
  'min' => '0',
176
  'max' => '50',
177
- 'defaultValue' => 15,
178
  'dimension' => 'px'
179
  ]
180
  );
174
  ],
175
  'min' => '0',
176
  'max' => '50',
177
+ 'defaultValue' => 10,
178
  'dimension' => 'px'
179
  ]
180
  );
inc/core/class-init.php CHANGED
@@ -116,7 +116,6 @@ class Init {
116
  $this->version = NS\PLUGIN_VERSION;
117
  $this->plugin_basename = NS\PLUGIN_BASENAME;
118
  $this->plugin_text_domain = NS\PLUGIN_TEXT_DOMAIN;
119
-
120
 
121
  $this->load_dependencies();
122
  $this->set_locale();
@@ -126,9 +125,7 @@ class Init {
126
  $this->table_preview();
127
 
128
  if( isset( $_GET['page'] ) && sanitize_text_field( $_GET['page'] ) == 'wptb-builder' ) {
129
- $this->elements_manager = new Elements_Manager();
130
- $this->controls_manager = new Controls_Manager();
131
- add_action( 'admin_footer', [$this, 'wp_footer_js_templates'] );
132
  }
133
  }
134
 
@@ -277,23 +274,22 @@ class Init {
277
  public function get_plugin_text_domain() {
278
  return $this->plugin_text_domain;
279
  }
280
-
281
  /**
282
- * WP footer.
283
- *
284
- * Prints Elementor editor with all the editor templates, and render controls,
285
- * widgets and content elements.
286
- *
287
- * Fired by `wp_footer` action.
288
- *
289
- * @since 1.0.0
290
- * @access public
291
- */
292
- public function wp_footer_js_templates() {
293
- $this->elements_manager->output_elements_templates();
294
- $this->elements_manager->output_directories_icons();
295
- $this->elements_manager->output_elements_scripts();
296
- $this->controls_manager->output_controls_templates();
297
- $this->controls_manager->output_control_stacks();
298
- }
299
  }
116
  $this->version = NS\PLUGIN_VERSION;
117
  $this->plugin_basename = NS\PLUGIN_BASENAME;
118
  $this->plugin_text_domain = NS\PLUGIN_TEXT_DOMAIN;
 
119
 
120
  $this->load_dependencies();
121
  $this->set_locale();
125
  $this->table_preview();
126
 
127
  if( isset( $_GET['page'] ) && sanitize_text_field( $_GET['page'] ) == 'wptb-builder' ) {
128
+ $this->elements_resources();
 
 
129
  }
130
  }
131
 
274
  public function get_plugin_text_domain() {
275
  return $this->plugin_text_domain;
276
  }
277
+
278
  /**
279
+ * Run all the necessary resources for Elements and Controls
280
+ *
281
+ * @since 1.1.5
282
+ */
283
+ public function elements_resources() {
284
+ $this->elements_manager = new Elements_Manager();
285
+ $this->controls_manager = new Controls_Manager();
286
+
287
+ add_action( 'admin_footer', function() {
288
+ $this->elements_manager->output_elements_templates();
289
+ $this->elements_manager->output_directories_icons();
290
+ $this->elements_manager->output_elements_scripts();
291
+ $this->controls_manager->output_controls_templates();
292
+ $this->controls_manager->output_control_stacks();
293
+ } );
294
+ }
 
295
  }
inc/core/class-preview.php DELETED
@@ -1,289 +0,0 @@
1
- <?php
2
-
3
- namespace WP_Table_Builder\Inc\Core;
4
- use WP_Table_Builder\Inc\Common\Helpers;
5
- use WP_Table_Builder\Inc\Admin\Tables as Tables;
6
- use WP_Table_Builder as NS;
7
-
8
- /**
9
- * Show preview table
10
- *
11
- * @link http://wptablebuilder.com/
12
- * @since 1.0.1
13
- *
14
- * @author Imtiaz Rayhan
15
- */
16
-
17
-
18
- class Preview {
19
-
20
- /**
21
- * Instance to instantiate object.
22
- *
23
- * @since 1.0.1
24
- *
25
- * @var $instance
26
- */
27
- protected static $instance;
28
-
29
- /**
30
- * Table data.
31
- *
32
- * @since 1.0.1
33
- *
34
- * @var array
35
- */
36
- public $table_data;
37
-
38
- /**
39
- * Singleton pattern, making only one instance of the class.
40
- *
41
- * @since 1.0.1
42
- */
43
- public static function instance() {
44
- if ( ! isset( self::$instance ) ) {
45
- $className = __CLASS__;
46
- self::$instance = new $className;
47
- }
48
-
49
- return self::$instance;
50
- }
51
-
52
- /**
53
- * Constructor.
54
- *
55
- * @since 1.0.1
56
- */
57
- private function __construct() {
58
-
59
- if ( ! $this->is_preview_page() ) {
60
- return;
61
- }
62
-
63
- $this->hooks();
64
-
65
- }
66
-
67
-
68
- /**
69
- * Check if the current page request meets the requirements for the table preview page.
70
- *
71
- * @since 1.0.1
72
- *
73
- * @return bool
74
- */
75
- public function is_preview_page() {
76
-
77
- // if this is a preview page, then continue
78
- if ( empty( $_GET['post_type'] ) && empty( $_GET['p'] ) ) {
79
- return false;
80
- } elseif ( sanitize_text_field( $_GET['post_type'] ) !== 'wptb-tables' ) {
81
- return false;
82
- }
83
-
84
- // if the user is authorized and if user rights are valid
85
- if ( ! is_user_logged_in() || ! Helpers::wptb_current_user_can() ) {
86
- return false;
87
- }
88
-
89
- $this->table_data = $this->get_table_data( absint( $_GET['p'] ) );
90
-
91
- // Check if the form is available
92
- if ( empty( $this->table_data ) ) {
93
- return false;
94
- }
95
-
96
- // Check nonce
97
- $nonce = sanitize_text_field( $_GET['_wpnonce'] );
98
- if ( ! $nonce || ! wp_verify_nonce( $nonce, 'wptb_nonce_table_preview' ) && ! wp_verify_nonce( $nonce, 'wptb_nonce_table' ) ) {
99
- return false;
100
- }
101
-
102
- return true;
103
-
104
- }
105
-
106
- public function get_table_data( $id ) {
107
-
108
- if ( false === $id ) {
109
- return false;
110
- }
111
-
112
- if ( ! empty( $id ) ) {
113
- $post = get_post( $id );
114
- $nonce = sanitize_text_field( $_GET['_wpnonce'] );
115
- if( $nonce && wp_verify_nonce( $nonce, 'wptb_nonce_table' ) ) {
116
- $post = ! empty( $post ) && 'wptb-tables' === $post->post_type && get_post_meta( $id, '_wptb_content_', true ) ? $post : false;
117
- } else if( $nonce && wp_verify_nonce( $nonce, 'wptb_nonce_table_preview' ) ) {
118
- $time_over = false;
119
- $preview_id = absint( $_GET['preview_id'] );
120
- $preview_id_meta = get_post_meta( $id, '_wptb_preview_id_', true );
121
- $ts = absint( $_GET['ts'] );
122
- if( ! $ts ) {
123
- $ts = 1;
124
- } else {
125
- if( $ts < 10 ) {
126
- $ts += 1;
127
- } else {
128
- $time_over = true;
129
- }
130
- }
131
-
132
- if( $preview_id_meta != $preview_id && ! $time_over ) {
133
- echo '<div style="display:table; width:100%; height:100%;">'
134
- . '<div style="display:table-cell; width:100%; vertical-align:middle; text-align:center;"><img src="' . wp_normalize_path( NS\WP_TABLE_BUILDER_URL . 'inc/admin/views/builder/icons/icon-128x128.png' ) . '">'
135
- . '<p>' . __( 'Generating preview...', 'wp-table-builder' ) . '</p></div>'
136
- . '</div>';
137
- echo '<script>setTimeout( function() {'
138
- . 'let newHref = new URL( "' . get_site_url() . $_SERVER['REQUEST_URI'] . '" );'
139
- . 'newHref.searchParams.set( "ts", ' . $ts . ' );'
140
- . 'window.location.href=newHref.toString();'
141
- . '} , 1000 );</script>';
142
- die();
143
- }
144
-
145
- $post = ! empty( $post ) && 'wptb-tables' === $post->post_type && get_post_meta( $id, '_wptb_content_preview_', true ) ? $post : false;
146
- }
147
-
148
- }
149
-
150
- if ( empty( $post ) ) {
151
- return false;
152
- }
153
-
154
- return $post;
155
-
156
- }
157
-
158
- /**
159
- * Adds functions to event handlers and filtering functions
160
- * for displaying necessary content.
161
- *
162
- * @since 1.0.1
163
- */
164
- public function hooks() {
165
-
166
- add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) );
167
-
168
- add_filter( 'the_title', array( $this, 'the_title' ), 100 );
169
-
170
- add_filter( 'the_content', array( $this, 'the_content' ), 999 );
171
-
172
- add_filter( 'get_the_excerpt', array( $this, 'the_content' ), 999 );
173
-
174
- //add_filter( 'template_include', array( $this, 'template_include' ) );
175
-
176
- add_filter( 'post_thumbnail_html', '__return_empty_string' );
177
-
178
- }
179
-
180
- /**
181
- * Modify query, limit for one post.
182
- *
183
- * @since 1.0.1
184
- *
185
- * @param $query The WP_Query instance.
186
- */
187
- public function pre_get_posts( $query ) {
188
-
189
- if ( ! is_admin() && $query->is_main_query() ) {
190
- $query->set( 'posts_per_page', 1 );
191
- }
192
-
193
- }
194
-
195
- /**
196
- * Change page title for table preview
197
- *
198
- * @since 1.0.1
199
- *
200
- * @param string $title Page title.
201
- *
202
- * @return string
203
- */
204
- public function the_title( $title ) {
205
-
206
- if( ( is_singular( 'post' ) || is_singular( 'page' ) ) && in_the_loop() ) {
207
- $title = sprintf(
208
- esc_html__( '%s Preview', 'wp-table-builder' ),
209
- ! empty( $this->table_data->post_title ) ? sanitize_text_field( $this->table_data->post_title ) : esc_html__( 'Table', 'wp-table-builder' )
210
- );
211
- }
212
-
213
- return $title;
214
-
215
- }
216
-
217
- /**
218
- * Change page content for table preview.
219
- *
220
- * @since 1.0.1
221
- *
222
- * @return string
223
- */
224
- public function the_content() {
225
-
226
- $message = esc_html__( 'This is a preview of your table. This page is not publicly accessible.', 'wp-table-builder' );
227
-
228
- do_action( 'wptb_frontend_enqueue_style' );
229
- do_action( 'wptb_frontend_enqueue_script' );
230
-
231
- // Check nonce
232
- $nonce = sanitize_text_field( $_GET['_wpnonce'] );
233
- if( $nonce && wp_verify_nonce( $nonce, 'wptb_nonce_table' ) ) {
234
- $html = get_post_meta( absint( $this->table_data->ID ) , '_wptb_content_', true );
235
- } else if( $nonce && wp_verify_nonce( $nonce, 'wptb_nonce_table_preview' ) ) {
236
- $html = get_post_meta( absint( $this->table_data->ID ) , '_wptb_content_preview_', true );
237
- }
238
-
239
- if ( preg_match_all( '|<wptb_shortcode_container_element(.+)</wptb_shortcode_container_element>|isU', $html, $arr ) ) {
240
- foreach ( $arr[1] as $value ) {
241
- if( ! isset( $args['internal_shortcodes_stop'] ) && $value ) {
242
- $pattern = get_shortcode_regex();
243
-
244
- if ( preg_match_all( '/'. $pattern .'/s', $value, $matches ) ) {
245
-
246
- for( $i = 0; $i < count( $matches[0] ); $i++ ) {
247
- $shortcode = $matches[0][$i];
248
- if( isset( $matches[2][$i] ) && $matches[2][$i] == 'wptb' ) {
249
-
250
- $shortcode = str_replace( ']' , ' internal_shortcodes_stop="1"]' , $matches[0][$i] );
251
-
252
- $div_outer_html_new = str_replace( $matches[0][$i] , $shortcode , $value );
253
-
254
- $html = str_replace( $value, $div_outer_html_new, $html );
255
-
256
- $html = str_replace( $div_outer_html_new, do_shortcode( $div_outer_html_new ), $html );
257
- } else {
258
- $html = str_replace( $value, do_shortcode( $value ), $html );
259
- }
260
- }
261
- }
262
- }
263
- }
264
- }
265
-
266
- //$content = do_shortcode( $content );
267
- $html = '<div class="wptb-table-container wptb-table-' . absint( $this->table_data->ID ) . '">'
268
- . '<div style="text-align:center;">' . $message . '</div>'
269
- . '<div class="wptb-table-container-matrix">' . $html . '</div>'
270
- . '</div>';
271
-
272
- return $html;
273
-
274
- }
275
-
276
- /**
277
- * Forced inclusion of page templates.
278
- *
279
- * @since 1.0.1
280
- *
281
- * @return array
282
- */
283
- public function template_include() {
284
-
285
- return locate_template( array( 'single.php', 'singular.php', 'index.php' ) );
286
-
287
- }
288
-
289
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/frontend/css/wp-table-builder-frontend.css CHANGED
@@ -87,7 +87,7 @@ table.wptb-preview-table {
87
  .wptb-table-container table td {
88
  /*width: 100px;*/
89
  box-sizing: content-box;
90
- padding: 15px;
91
  background-color: inherit;
92
  vertical-align: middle;
93
  }
@@ -124,8 +124,6 @@ table.wptb-preview-table {
124
  .wptb-ph-element {
125
  position: relative;
126
  border: 1px solid #fff0;
127
- margin-top: 15px;
128
- margin-bottom: 15px;
129
  }
130
 
131
  .wptb-elem-placeholder {
87
  .wptb-table-container table td {
88
  /*width: 100px;*/
89
  box-sizing: content-box;
90
+ padding: 10px;
91
  background-color: inherit;
92
  vertical-align: middle;
93
  }
124
  .wptb-ph-element {
125
  position: relative;
126
  border: 1px solid #fff0;
 
 
127
  }
128
 
129
  .wptb-elem-placeholder {
inc/frontend/js/wp-table-builder-frontend.js CHANGED
@@ -185,7 +185,14 @@
185
  let previewTableWidth = previewTable.offsetWidth;
186
 
187
  // get count of table columns
188
- let tableColumns = previewTable.dataset.tableColumns;
 
 
 
 
 
 
 
189
 
190
  // check the top line if it is presented as a title
191
  let tablePreviewHeadIndic = previewTable.classList.contains( 'wptb-table-preview-head' )
185
  let previewTableWidth = previewTable.offsetWidth;
186
 
187
  // get count of table columns
188
+ let tableColumns;
189
+ let previewTableRows = previewTable.rows;
190
+ if( previewTableRows.length > 0 ) {
191
+ let firstRow = previewTableRows[0];
192
+ let tdsRow = firstRow.querySelectorAll( 'td' );
193
+
194
+ tableColumns = tdsRow.length;
195
+ }
196
 
197
  // check the top line if it is presented as a title
198
  let tablePreviewHeadIndic = previewTable.classList.contains( 'wptb-table-preview-head' )
inc/libraries/autoloader.php CHANGED
@@ -29,6 +29,10 @@ spl_autoload_register( function( $class_name ) {
29
  // Split the class name into an array to read the namespace and class.
30
  $file_parts = explode( '\\', $class_name );
31
 
 
 
 
 
32
  // Do a reverse loop through $file_parts to build the path to the file.
33
  $namespace = '';
34
  for ( $i = count( $file_parts ) - 1; $i > 0; $i-- ) {
29
  // Split the class name into an array to read the namespace and class.
30
  $file_parts = explode( '\\', $class_name );
31
 
32
+ if( $file_parts[0] !== 'WP_Table_Builder' ) {
33
+ return;
34
+ }
35
+
36
  // Do a reverse loop through $file_parts to build the path to the file.
37
  $namespace = '';
38
  for ( $i = count( $file_parts ) - 1; $i > 0; $i-- ) {
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: wptb, imtiazrayhan, istiakrayhan, ultimateblocks, wpcdplugin, wple
3
  Tags: table, table builder, drag and drop
4
  Requires at least: 4.9
5
  Tested up to: 5.4
6
- Stable tag: 1.1.6
7
  Requires PHP: 5.6
8
  License: GPL3+
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
@@ -80,6 +80,13 @@ That's it. You're done!
80
 
81
  == Changelog ==
82
 
 
 
 
 
 
 
 
83
  = 1.1.6 =
84
 
85
  * ADD: Option to Import Tables from CSV Files.
3
  Tags: table, table builder, drag and drop
4
  Requires at least: 4.9
5
  Tested up to: 5.4
6
+ Stable tag: 1.1.7
7
  Requires PHP: 5.6
8
  License: GPL3+
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
80
 
81
  == Changelog ==
82
 
83
+ = 1.1.7 =
84
+
85
+ * FIX: Table Column Missing on Mobile Screens.
86
+ * FIX: Table Row Missing on Mobile Screens.
87
+ * IMPROVEMENT: More Compact Table View.
88
+ * CHANGE: Default Cell Padding Value to 10.
89
+
90
  = 1.1.6 =
91
 
92
  * ADD: Option to Import Tables from CSV Files.
wp-table-builder.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: WP Table Builder
16
  * Plugin URI: https://wptablebuilder.com/
17
  * Description: Drag and Drop Responsive Table Builder Plugin for WordPress.
18
- * Version: 1.1.6
19
  * Author: WP Table Builder
20
  * Author URI: https://wptablebuilder.com//
21
  * License: GPL-3.0+
@@ -39,7 +39,7 @@ define( __NAMESPACE__ . '\NS', __NAMESPACE__ . '\\' );
39
 
40
  define( NS . 'WP_TABLE_BUILDER', 'wp-table-builder' );
41
 
42
- define( NS . 'PLUGIN_VERSION', '1.1.6' );
43
 
44
  define( NS . 'WP_TABLE_BUILDER_DIR', plugin_dir_path( __FILE__ ) );
45
 
15
  * Plugin Name: WP Table Builder
16
  * Plugin URI: https://wptablebuilder.com/
17
  * Description: Drag and Drop Responsive Table Builder Plugin for WordPress.
18
+ * Version: 1.1.7
19
  * Author: WP Table Builder
20
  * Author URI: https://wptablebuilder.com//
21
  * License: GPL-3.0+
39
 
40
  define( NS . 'WP_TABLE_BUILDER', 'wp-table-builder' );
41
 
42
+ define( NS . 'PLUGIN_VERSION', '1.1.7' );
43
 
44
  define( NS . 'WP_TABLE_BUILDER_DIR', plugin_dir_path( __FILE__ ) );
45