PluginProbe
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards / 5.5.85
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards v5.5.85
5.5.85 5.5.84 5.5.83 5.5.82 5.5.81 5.5.80 5.5.79 5.5.77 5.5.76 5.5.75 5.5.73 5.5.72 5.5.22 5.5.23 5.5.29 5.5.3 5.5.31 5.5.32 5.5.34 5.5.35 5.5.36 5.5.37 5.5.4 5.5.40 5.5.41 All 161 releases
← All changes | WPDataAccess/Dashboard/WPDA_Dashboard.php +382 -439 5.5.3 → 5.5.85 View file →
@@ -1,11 +1,12 @@
1 1 <?php
2 2
3 -// phpcs:ignore Standard.Category.SniffName.ErrorCode
3 +// phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing -- verified on page
4 4 namespace WPDataAccess\Dashboard;
5 5
6 6 use WP_Data_Access_Admin;
7 7 use WPDataAccess\Data_Dictionary\WPDA_Dictionary_Lists;
8 +use WPDataAccess\Plugin_Table_Models\WPDA_App_Model;
8 9 use WPDataAccess\Plugin_Table_Models\WPDA_Design_Table_Model;
9 10 use WPDataAccess\Plugin_Table_Models\WPDA_Publisher_Model;
10 11 use WPDataAccess\Plugin_Table_Models\WPDP_Project_Model;
11 12 use WPDataAccess\Premium\WPDAPRO_Dashboard\WPDAPRO_Dashboard;
@@ -14,9 +15,9 @@
14 15 use WPDataAccess\Utilities\WPDA_Message_Box;
15 16 use WPDataAccess\WPDA;
16 17 use WPDataAccess\Connection\WPDADB;
17 18 use WPDataProjects\WPDP;
18 -use WPDataAccess\Settings\WPDA_Settings_Dashboard;
19 +use WPDataAccess\Settings\WPDA_Settings_Legacy_Dashboard;
19 20 /**
20 21 * Dashboard class
21 22 */
22 23 class WPDA_Dashboard {
@@ -174,8 +175,10 @@
174 175 * @var string|null
175 176 */
176 177 protected $message_type = null;
177 178
179 + private $option_legacy_tools;
180 +
178 181 /**
179 182 * Constructor
180 183 *
181 184 * @param boolean $widget_mode True = allowed to manage dashboards and widgets.
@@ -191,8 +194,9 @@
191 194 // Start with empty array.
192 195 if ( $widget_mode ) {
193 196 update_user_meta( WPDA::get_current_user_id(), self::USER_DASHBOARD, array() );
194 197 }
198 + $this->option_legacy_tools = WPDA::get_option( WPDA::OPTION_PLUGIN_LEGACY_TOOLS );
195 199 }
196 200
197 201 /**
198 202 * Add dashboard
@@ -213,16 +217,14 @@
213 217 */
214 218 public function dashboard() {
215 219 wp_enqueue_style( 'wpdataaccess_dashboard' );
216 220 wp_enqueue_script( 'wpdataaccess_dashboard' );
217 - if ( current_user_can( 'manage_options' ) ) {
221 + if ( WPDA::current_user_is_admin() ) {
218 222 $this->dashboard_default();
219 223 $this->dashboard_mobile();
220 224 }
221 225 if ( isset( $_REQUEST['page'] ) ) {
222 - // phpcs:ignore WordPress.Security.NonceVerification
223 226 switch ( $_REQUEST['page'] ) {
224 - // phpcs:ignore WordPress.Security.NonceVerification
225 227 case 'wpda_dashboard':
226 228 $this->toolbar();
227 229 $this->add_forms();
228 230 $this->tabs();
@@ -231,24 +233,12 @@
231 233 $this->dashboard_js();
232 234 break;
233 235 case WP_Data_Access_Admin::PAGE_MAIN:
234 236 if ( !isset( $_REQUEST['page_action'] ) ) {
235 - // phpcs:ignore WordPress.Security.NonceVerification
236 - if ( !isset( $_REQUEST['table_name'] ) ) {
237 - // phpcs:ignore WordPress.Security.NonceVerification
238 - $this->toolbar_wpda();
239 - } else {
240 - if ( !isset( $_REQUEST['action'] ) || 'new' !== $_REQUEST['action'] && 'edit' !== $_REQUEST['action'] ) {
241 - $this->toolbar_wpda_table();
242 - } else {
243 - $this->toolbar_wpda_row();
244 - }
245 - }
237 + $this->toolbar_wpda();
246 238 } elseif ( 'wpda_backup' === $_REQUEST['page_action'] && (!isset( $_REQUEST['action'] ) || 'remove' === $_REQUEST['action'] || 'update' === $_REQUEST['action'] || 'add' === $_REQUEST['action']) ) {
247 - // phpcs:ignore WordPress.Security.NonceVerification
248 239 $this->toolbar_backup();
249 240 } elseif ( 'wpda_import_csv' === $_REQUEST['page_action'] ) {
250 - // phpcs:ignore WordPress.Security.NonceVerification
251 241 $this->toolbar_import_csv();
252 242 }
253 243 break;
254 244 case WP_Data_Access_Admin::PAGE_APPS:
@@ -253,11 +243,8 @@
253 243 break;
254 244 case WP_Data_Access_Admin::PAGE_APPS:
255 245 $this->toolbar_apps();
256 246 break;
257 - case WP_Data_Access_Admin::PAGE_QUERY_BUILDER:
258 - $this->toolbar_sql();
259 - break;
260 247 case WP_Data_Access_Admin::PAGE_DESIGNER:
261 248 if ( !isset( $_REQUEST['action'] ) || 'new' !== $_REQUEST['action'] && 'edit' !== $_REQUEST['action'] ) {
262 249 $this->toolbar_designer();
263 250 }
@@ -281,8 +268,46 @@
281 268 }
282 269 break;
283 270 }
284 271 }
272 + if ( isset( $_GET['page_iaction'] ) ) {
273 + // Perform interactive action to auto start user selected feature.
274 + ?>
275 + <script>
276 + jQuery(function() {
277 + const iaction = "<?php
278 + // phpcs:disable WordPress.Security.ValidatedSanitizedInput.MissingUnslash
279 + echo esc_attr( sanitize_text_field( $_GET['page_iaction'] ) );
280 + // phpcs:enable WordPress.Security.ValidatedSanitizedInput.MissingUnslash
281 + ?>";
282 + switch (iaction) {
283 + case "create_new_app":
284 + var interval = setInterval(
285 + function() {
286 + if (window.ppActionCreateApp !== undefined) {
287 + window.ppActionCreateApp();
288 + clearInterval(interval);
289 + }
290 + }, 100);
291 + break;
292 + case "wpda_import_sql":
293 + var interval = setInterval(
294 + function() {
295 + if (window.ppActionEnableImport !== undefined) {
296 + window.ppActionEnableImport();
297 + clearInterval(interval);
298 + }
299 + }, 100);
300 + break;
301 + case "manage_databases":
302 + jQuery('#wpda_manage_databases').show();
303 + jQuery('#local_database').focus();
304 + break;
305 + }
306 + });
307 + </script>
308 + <?php
309 + }
285 310 }
286 311
287 312 /**
288 313 * Get correct help url for current page
@@ -289,45 +314,99 @@
289 314 *
290 315 * @return string
291 316 */
292 317 protected function get_help_url() {
293 - $help_root = 'https://wpdataaccess.com/docs/';
318 + $help_url = 'https://docs.wpdataaccess.com/';
294 319 if ( isset( $_REQUEST['page'] ) ) {
295 - // phpcs:ignore WordPress.Security.NonceVerification
296 320 switch ( $_REQUEST['page'] ) {
297 - // phpcs:ignore WordPress.Security.NonceVerification
298 321 case \WP_Data_Access_Admin::PAGE_MAIN:
299 - $help_url = $help_root . 'data-explorer/data-explorer-getting-started/';
322 + $help_url = 'https://docs.explorer.wpdataaccess.com/';
300 323 break;
324 + case \WP_Data_Access_Admin::PAGE_APPS:
325 + $help_url = 'https://docs.rad.wpdataaccess.com/';
326 + break;
301 327 case \WP_Data_Access_Admin::PAGE_QUERY_BUILDER:
302 - $help_url = $help_root . 'query-builder/query-builder-getting-started/';
328 + $help_url = 'https://docs.sql.wpdataaccess.com/';
303 329 break;
304 330 case \WP_Data_Access_Admin::PAGE_DESIGNER:
305 - $help_url = $help_root . 'data-designer/data-designer-getting-started/';
331 + $help_url = 'https://docs.legacy.wpdataaccess.com/docs/data-designer-getting-started/';
306 332 break;
307 333 case \WP_Data_Access_Admin::PAGE_PUBLISHER:
308 - $help_url = $help_root . 'data-tables/data-tables-getting-started/';
334 + $help_url = 'https://docs.legacy.wpdataaccess.com/docs/data-tables-getting-started/';
309 335 break;
310 336 case \WP_Data_Access_Admin::PAGE_DASHBOARD:
311 - $help_url = $help_root . 'dashboards-and-widgets/bi-getting-started/';
337 + $help_url = 'https://docs.legacy.wpdataaccess.com/docs/bi-getting-started/';
312 338 break;
313 339 case \WP_Data_Access_Admin::PAGE_CHARTS:
314 - $help_url = $help_root . 'widgets/chart-widgets/';
340 + $help_url = 'https://docs.legacy.wpdataaccess.com/docs/chart-widgets/';
315 341 break;
316 342 case WPDP::PAGE_MAIN:
317 - $help_url = $help_root . 'data-apps/data-projects/';
343 + $help_url = 'https://docs.legacy.wpdataaccess.com/docs/data-projects/';
318 344 break;
319 345 case WPDP::PAGE_TEMPLATES:
320 - $help_url = $help_root . 'data-apps-templates/project-templates/';
346 + $help_url = 'https://docs.legacy.wpdataaccess.com/docs/project-templates/';
321 347 break;
322 348 case 'wpdataaccess':
323 - $help_url = $help_root . 'plugin-settings/getting-started/';
349 + $current_tab = ( isset( $_REQUEST['tab'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['tab'] ) ) : 'plugin' );
350 + switch ( $current_tab ) {
351 + case 'plugin':
352 + $help_url = 'https://docs.settings.wpdataaccess.com/plugin.html';
353 + break;
354 + case 'pds':
355 + $help_url = 'https://docs.settings.wpdataaccess.com/pds.html';
356 + break;
357 + case 'backend':
358 + $help_url = 'https://docs.settings.wpdataaccess.com/back-end.html';
359 + break;
360 + case 'frontend':
361 + $help_url = 'https://docs.settings.wpdataaccess.com/frond-end.html';
362 + break;
363 + case 'uninstall':
364 + $help_url = 'https://docs.settings.wpdataaccess.com/uninstall.html';
365 + break;
366 + case 'repository':
367 + $help_url = 'https://docs.settings.wpdataaccess.com/repository.html';
368 + break;
369 + case 'mail':
370 + $help_url = 'https://docs.settings.wpdataaccess.com/mail.html';
371 + break;
372 + case 'drives':
373 + $help_url = 'https://docs.settings.wpdataaccess.com/drives.html';
374 + break;
375 + case 'system':
376 + $help_url = 'https://docs.settings.wpdataaccess.com/system-info.html';
377 + break;
378 + case 'legacy':
379 + $vtab = ( isset( $_REQUEST['vtab'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['vtab'] ) ) : 'plugin' );
380 + switch ( $vtab ) {
381 + case 'backend':
382 + $help_url = 'https://docs.settings.wpdataaccess.com/legacy-tools-back-end.html';
383 + break;
384 + case 'frontend':
385 + $help_url = 'https://docs.settings.wpdataaccess.com/legacy-tools-front-end.html';
386 + break;
387 + case 'datatables':
388 + $help_url = 'https://docs.settings.wpdataaccess.com/legacy-tools-data-tables.html';
389 + break;
390 + case 'dataforms':
391 + $help_url = 'https://docs.settings.wpdataaccess.com/legacy-tools-data-forms.html';
392 + break;
393 + case 'dashboard':
394 + $help_url = 'https://docs.settings.wpdataaccess.com/legacy-tools-dashboard.html';
395 + break;
396 + case 'databackup':
397 + $help_url = 'https://docs.settings.wpdataaccess.com/legacy-tools-data-backup.html';
398 + break;
399 + case 'roles':
400 + $help_url = 'https://docs.settings.wpdataaccess.com/legacy-tools-roles.html';
401 + break;
402 + default:
403 + $help_url = 'https://docs.settings.wpdataaccess.com/legacy-tools-plugin.html';
404 + }
405 + break;
406 + }
324 407 break;
325 - default:
326 - $help_url = $help_root . 'getting-started/wp-data-access-getting-started/';
327 408 }
328 - } else {
329 - $help_url = $help_root . 'getting-started/wp-data-access-getting-started/';
330 409 }
331 410 return $help_url;
332 411 }
333 412
@@ -342,90 +421,119 @@
342 421 <div class="wpda-dashboard">
343 422 <div class="wpda-dashboard-group wpda-dashboard-group-administration">
344 423 <div class="icons">
345 424 <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php
346 - echo admin_url( 'admin.php' );
347 - // phpcs:ignore WordPress.Security.EscapeOutput
425 + echo esc_url( admin_url( 'admin.php' ) );
426 + ?>?page=wpda_navi" title="Quick links and frequently asked questions">
427 + <div class="fa-solid fa-house"></div>
428 + <div class="label">Tool Guide</div>
429 + </a>
430 + <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php
431 + echo esc_url( admin_url( 'admin.php' ) );
432 + ?>?page=wpda_apps" title="Data-driven Rapid Application Development">
433 + <div class="fa-solid">
434 + <svg xmlns="http://www.w3.org/2000/svg" height="26px" width="26px" viewBox="4 4 16 16" fill="inherit">
435 + <path d="M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"/>
436 + </svg>
437 + </div>
438 + <div class="label">App Builder</div>
439 + </a>
440 + <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php
441 + echo esc_url( admin_url( 'admin.php' ) );
348 442 ?>?page=wpda" title="Manage local and remote data and databases">
349 443 <div class="fa-solid fa-database"></div>
350 444 <div class="label">Explorer</div>
351 445 </a>
352 446 <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php
353 - echo admin_url( 'admin.php' );
354 - // phpcs:ignore WordPress.Security.EscapeOutput
355 - ?>?page=wpda_query_builder" title="Query builder">
447 + echo esc_url( admin_url( 'admin.php' ) );
448 + ?>?page=wpda_query_builder" title="SQL Query Builder">
356 449 <div class="fa-solid fa-code"></div>
357 450 <div class="label">SQL</div>
358 451 </a>
359 - <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php
360 - echo admin_url( 'admin.php' );
361 - // phpcs:ignore WordPress.Security.EscapeOutput
362 - ?>?page=wpda_designer" title="Create database tables and indexes">
363 - <div class="fa-solid fa-drafting-compass"></div>
364 - <div class="label">Designer</div>
365 - </a>
366 452 </div>
367 - <div class="subject">Data(base) Administration</div>
453 + <div class="subject">Data(base) Administration & App Development</div>
368 454 </div>
369 - <div class="wpda-dashboard-group wpda-dashboard-group-apps">
455 + <div class="wpda-dashboard-group wpda-dashboard-group-projects"
456 + <?php
457 + if ( !$this->option_legacy_tools['tables'][0] && !$this->option_legacy_tools['forms'][0] && !$this->option_legacy_tools['templates'][0] && !$this->option_legacy_tools['designer'][0] && !$this->option_legacy_tools['dashboards'][0] && !$this->option_legacy_tools['charts'][0] ) {
458 + echo 'style="display: none"';
459 + }
460 + ?>
461 + >
370 462 <div class="icons">
371 - <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php
372 - echo admin_url( 'admin.php' );
373 - // phpcs:ignore WordPress.Security.EscapeOutput
374 - ?>?page=wpda_apps" title="App Builder
463 + <a class="wpda-dashboard-item wpda_tooltip_icons"
464 + href="<?php
465 + echo esc_url( admin_url( 'admin.php' ) );
466 + ?>?page=wpda_publisher"
467 + title="OLD Table Builder
375 468
376 -Build data driven Apps with
377 -the new Table and Form Builders">
378 - <div class="fa-solid">
379 - <svg xmlns="http://www.w3.org/2000/svg" height="26px" width="26px" viewBox="4 4 16 16" fill="inherit">
380 - <path d="M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"/>
381 - </svg>
382 - </div>
383 - <div class="label">Apps</div>
384 - </a>
385 - </div>
386 - <div class="subject" style="color: red; font-weight: bold">NEW</div>
387 - </div>
388 - <div class="wpda-dashboard-group wpda-dashboard-group-publisher">
389 - <div class="icons">
390 - <?php
469 +Use App Builder to access the NEW Table Builder
470 +"
471 + <?php
472 + if ( !$this->option_legacy_tools['tables'][0] ) {
473 + echo 'style="display: none"';
474 + }
391 475 ?>
392 - <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php
393 - echo admin_url( 'admin.php' );
394 - // phpcs:ignore WordPress.Security.EscapeOutput
395 - ?>?page=wpda_publisher" title="Table Builder">
476 + >
396 477 <div class="fa-solid fa-table"></div>
397 478 <div class="label">Tables</div>
398 479 </a>
399 - <?php
480 + <a class="wpda-dashboard-item wpda_tooltip_icons"
481 + href="<?php
482 + echo esc_url( admin_url( 'admin.php' ) );
483 + ?>?page=wpda_wpdp"
484 + title="OLD Form Builder
485 +
486 +Use App Builder to access the NEW Form Builder
487 +"
488 + <?php
489 + if ( !$this->option_legacy_tools['forms'][0] ) {
490 + echo 'style="display: none"';
491 + }
400 492 ?>
401 - </div>
402 - <div class="subject">Publishing</div>
403 - </div>
404 - <div class="wpda-dashboard-group wpda-dashboard-group-projects">
405 - <div class="icons">
406 - <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php
407 - echo admin_url( 'admin.php' );
408 - // phpcs:ignore WordPress.Security.EscapeOutput
409 - ?>?page=wpda_wpdp" title="Form Builder">
493 + >
410 494 <div class="fa-solid fa-wand-magic-sparkles"></div>
411 495 <div class="label">Forms</div>
412 496 </a>
413 - <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php
414 - echo admin_url( 'admin.php' );
415 - // phpcs:ignore WordPress.Security.EscapeOutput
416 - ?>?page=wpda_templates" title="Customize forms using templates">
497 + <a class="wpda-dashboard-item wpda_tooltip_icons"
498 + href="<?php
499 + echo esc_url( admin_url( 'admin.php' ) );
500 + ?>?page=wpda_templates"
501 + title="OLD Form Templates
502 +
503 +Customize forms using templates"
504 + <?php
505 + if ( !$this->option_legacy_tools['templates'][0] ) {
506 + echo 'style="display: none"';
507 + }
508 + ?>
509 + >
417 510 <div class="fa-solid fa-desktop"></div>
418 511 <div class="label">Templates</div>
419 512 </a>
513 + <a class="wpda-dashboard-item wpda_tooltip_icons"
514 + href="<?php
515 + echo esc_url( admin_url( 'admin.php' ) );
516 + ?>?page=wpda_designer"
517 + title="Create database tables and indexes"
518 + <?php
519 + if ( !$this->option_legacy_tools['designer'][0] ) {
520 + echo 'style="display: none"';
521 + }
522 + ?>
523 + >
524 + <div class="fa-solid fa-drafting-compass"></div>
525 + <div class="label">Designer</div>
526 + </a>
527 + <?php
528 + ?>
420 529 </div>
421 - <div class="subject">Data Entry</div>
530 + <div class="subject">Legacy Tools</div>
422 531 </div>
423 532 <div class="wpda-dashboard-group wpda-dashboard-group-settings">
424 533 <div class="icons">
425 534 <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php
426 - echo admin_url( 'options-general.php' );
427 - // phpcs:ignore WordPress.Security.EscapeOutput
535 + echo esc_url( admin_url( 'options-general.php' ) );
428 536 ?>?page=wpdataaccess" title="Manage plugin user interface and behavior">
429 537 <div class="fa-solid fa-cog"></div>
430 538 <div class="label">Settings</div>
431 539 </a>
@@ -432,11 +540,12 @@
432 540 <?php
433 541 if ( wpda_freemius()->is_registered() ) {
434 542 ?>
435 543 <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php
436 - echo admin_url( 'admin.php' );
437 - // phpcs:ignore WordPress.Security.EscapeOutput
438 - ?>?page=wpda-account" title="Manage your WP Data Access account">
544 + echo esc_url( admin_url( 'admin.php' ) );
545 + ?>?page=<?php
546 + echo esc_attr( WP_Data_Access_Admin::MAIN_PAGE_SLUG );
547 + ?>-account" title="Manage your WP Data Access account">
439 548 <div class="fa-solid fa-user"></div>
440 549 <div class="label">Account</div>
441 550 </a>
442 551 <?php
@@ -446,23 +555,33 @@
446 555 <div class="fa-solid fa-hand-holding-usd"></div>
447 556 <div class="label">Pricing</div>
448 557 </a>
449 558 <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php
450 - echo admin_url( 'admin.php' );
451 - // phpcs:ignore WordPress.Security.EscapeOutput
452 - ?>?page=wpda-pricing" title="Upgrade your WP Data Access account">
559 + echo esc_url( admin_url( 'admin.php' ) );
560 + ?>?page=<?php
561 + echo esc_attr( WP_Data_Access_Admin::MAIN_PAGE_SLUG );
562 + ?>-pricing" title="Upgrade your WP Data Access account">
453 563 <div class="fa-solid fa-gem"></div>
454 564 <div class="label">Upgrade</div>
455 565 </a>
456 - </div>
566 + <?php
567 + if ( wpda_freemius()->is_free_plan() && !wpda_freemius()->is_trial() && !wpda_freemius()->is_trial_utilized() ) {
568 + ?>
569 + <a class="wpda-dashboard-item wpda_tooltip_icons" href="https://wpdataaccess.com/order/?l=0&b=trial" title="Get your 14-day free trial" target="_blank">
570 + <div class="fa-solid fa-star"></div>
571 + <div class="label">Free Trial</div>
572 + </a>
573 + <?php
574 + }
575 + ?>
576 + </div>
457 577 <div class="subject">Plugin & User Management</div>
458 578 </div>
459 579 <div class="wpda-dashboard-group wpda-dashboard-group-support">
460 580 <div class="icons">
461 581 <a class="wpda-dashboard-item wpda_tooltip_icons" target="_blank" href="<?php
462 - echo $this->get_help_url();
463 - // phpcs:ignore WordPress.Security.EscapeOutput
464 - ?>" title="Online help and documentation">
582 + echo esc_url( $this->get_help_url() );
583 + ?>" title="Context sensitive help">
465 584 <div class="fa-solid fa-question-circle"></div>
466 585 <div class="label">Docs</div>
467 586 </a>
468 587 <a class="wpda-dashboard-item wpda_tooltip_icons" target="_blank" href="https://wordpress.org/support/plugin/wp-data-access/" title="Public support forum">
@@ -470,12 +589,8 @@
470 589 <div class="label">Forum</div>
471 590 </a>
472 591 <?php
473 592 ?>
474 - <a class="wpda-dashboard-item wpda_tooltip_icons" target="_blank" href="https://wpdataaccess.com/docs/getting-started/whats-new/" title="What's new?">
475 - <div class="fa-solid fa-info-circle"></div>
476 - <div class="label">News</div>
477 - </a>
478 593 </div>
479 594 <div class="subject">Help</div>
480 595 </div>
481 596 </div>
@@ -497,22 +612,18 @@
497 612 <div class="wpda_nav_title">WP Data Access</div>
498 613 </div>
499 614 <ul>
500 615 <li class="menu-item"><a href="<?php
501 - echo admin_url( 'admin.php' );
502 - // phpcs:ignore WordPress.Security.EscapeOutput
616 + echo esc_url( admin_url( 'admin.php' ) );
503 617 ?>?page=wpda"><i class="fas fa-database"></i> Explorer</a></li>
504 618 <li class="menu-item"><a href="<?php
505 - echo admin_url( 'admin.php' );
506 - // phpcs:ignore WordPress.Security.EscapeOutput
619 + echo esc_url( admin_url( 'admin.php' ) );
507 620 ?>?page=wpda_query_builder"><i class="fas fa-code"></i> SQL</a></li>
508 621 <li class="menu-item wpda-separator"><a href="<?php
509 - echo admin_url( 'admin.php' );
510 - // phpcs:ignore WordPress.Security.EscapeOutput
622 + echo esc_url( admin_url( 'admin.php' ) );
511 623 ?>?page=wpda_designer"><i class="fas fa-drafting-compass"></i> Designer</a></li>
512 624 <li class="menu-item wpda-separator"><a href="<?php
513 - echo admin_url( 'admin.php' );
514 - // phpcs:ignore WordPress.Security.EscapeOutput
625 + echo esc_url( admin_url( 'admin.php' ) );
515 626 ?>?page=wpda_apps"><span style="display: inline-block; width: 20px"><svg xmlns="http://www.w3.org/2000/svg" height="12px" width="12px" viewBox="4 4 16 16" fill="inherit">
516 627 <path d="M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"/>
517 628 </svg></span> Apps</a></li>
518 629 <?php
@@ -519,32 +630,29 @@
519 630 ?>
520 631 <li class="menu-item <?php
521 632 echo esc_attr( $premium_separator );
522 633 ?>"><a href="<?php
523 - echo admin_url( 'admin.php' );
524 - // phpcs:ignore WordPress.Security.EscapeOutput
634 + echo esc_url( admin_url( 'admin.php' ) );
525 635 ?>?page=wpda_publisher"><i class="fas fa-address-card"></i> Tables</a></li>
526 636 <?php
527 637 ?>
528 638 <li class="menu-item"><a href="<?php
529 - echo admin_url( 'admin.php' );
530 - // phpcs:ignore WordPress.Security.EscapeOutput
639 + echo esc_url( admin_url( 'admin.php' ) );
531 640 ?>?page=wpda_wpdp"><i class="fas fa-magic"></i> Forms</a></li>
532 641 <li class="menu-item wpda-separator"><a href="<?php
533 - echo admin_url( 'admin.php' );
534 - // phpcs:ignore WordPress.Security.EscapeOutput
642 + echo esc_url( admin_url( 'admin.php' ) );
535 643 ?>?page=wpda_templates"><i class="fas fa-desktop"></i> Templates</a></li>
536 644 <li class="menu-item"><a href="<?php
537 - echo admin_url( 'options-general.php' );
538 - // phpcs:ignore WordPress.Security.EscapeOutput
645 + echo esc_url( admin_url( 'options-general.php' ) );
539 646 ?>?page=wpdataaccess"><i class="fas fa-cog"></i> Settings</a></li>
540 647 <?php
541 648 if ( wpda_freemius()->is_registered() ) {
542 649 ?>
543 650 <li class="menu-item"><a href="<?php
544 - echo admin_url( 'admin.php' );
545 - // phpcs:ignore WordPress.Security.EscapeOutput
546 - ?>?page=wpda-account"><i class="fas fa-user"></i> Account</a></li>
651 + echo esc_url( admin_url( 'admin.php' ) );
652 + ?>?page=<?php
653 + echo esc_attr( WP_Data_Access_Admin::MAIN_PAGE_SLUG );
654 + ?>-account"><i class="fas fa-user"></i> Account</a></li>
547 655 <?php
548 656 }
549 657 ?>
550 658 <?php
@@ -551,9 +659,9 @@
551 659 $menufound = false;
552 660 global $submenu;
553 661 if ( isset( $submenu[WPDA::get_option( WP_Data_Access_Admin::PAGE_MAIN )] ) ) {
554 662 foreach ( $submenu[WPDA::get_option( WP_Data_Access_Admin::PAGE_MAIN )] as $pluginmenu ) {
555 - if ( 'wpda-pricing' === $pluginmenu[2] ) {
663 + if ( WP_Data_Access_Admin::MAIN_PAGE_SLUG . '-pricing' === $pluginmenu[2] ) {
556 664 $menufound = true;
557 665 break;
558 666 }
559 667 }
@@ -565,15 +673,16 @@
565 673 <?php
566 674 if ( $menufound ) {
567 675 ?>
568 676 <li class="menu-item wpda-separator"><a href="<?php
569 - echo admin_url( 'admin.php' );
570 - // phpcs:ignore WordPress.Security.EscapeOutput
571 - ?>?page=wpda-pricing"><i class="fas fa-gem"></i> Upgrade</a></li>
677 + echo esc_url( admin_url( 'admin.php' ) );
678 + ?>?page=<?php
679 + echo esc_attr( WP_Data_Access_Admin::MAIN_PAGE_SLUG );
680 + ?>-pricing"><i class="fas fa-gem"></i> Upgrade</a></li>
572 681 <?php
573 682 }
574 683 ?>
575 - <li class="menu-item"><a target="_blank" href="https://wpdataaccess.com/docs/getting-started/overview/"><i class="fas fa-question"></i> Online Documentation</a></li>
684 + <li class="menu-item"><a target="_blank" href="https://docs.wpdataaccess.com/"><i class="fas fa-question"></i> Online Documentation</a></li>
576 685 <li class="menu-item"><a target="_blank" href="https://wordpress.org/support/plugin/wp-data-access/"><i class="fas fa-life-ring"></i> Support Forum</a></li>
577 686 <?php
578 687 ?>
579 688 </ul>
@@ -603,9 +712,9 @@
603 712 <div id="wpda-dashboard-toolbar" class="wpda-dashboard-toolbar" style="display:none">
604 713 <div class="wpda-nowrap">
605 714 <div>
606 715 <?php
607 - if ( current_user_can( 'manage_options' ) ) {
716 + if ( WPDA::current_user_is_admin() ) {
608 717 ?>
609 718 <div>
610 719 <a href="javascript:addPanel()"
611 720 class="wpda-dashboard-item wpda_tooltip"
@@ -685,9 +794,9 @@
685 794 Update to premium to analyse, report and share your data.
686 795 </td>
687 796 <td style="white-space:nowrap">
688 797 <a href="https://wpdataaccess.com/pricing/" target="_blank" class="button button-primary">UPGRADE TO PREMIUM</a>
689 - <a href="https://wpdataaccess.com/docs/dashboards-and-widgets/getting-started/" target="_blank" class="button">READ MORE</a>
798 + <a href="https://docs.legacy.wpdataaccess.com/docs/bi-getting-started/" target="_blank" class="button">READ MORE</a>
690 799 </td>
691 800 </tr>
692 801 </table>
693 802 </div>
@@ -764,9 +873,8 @@
764 873 * @return void
765 874 */
766 875 protected function toolbar_wpda() {
767 876 $schema_name = ( isset( $_REQUEST['wpdaschema_name'] ) ? esc_attr( sanitize_text_field( wp_unslash( $_REQUEST['wpdaschema_name'] ) ) ) : '' );
768 - // phpcs:ignore WordPress.Security.NonceVerification
769 877 ?>
770 878 <form id="wpda_new_design" style="display: none" method="post" action="?page=<?php
771 879 echo esc_attr( WP_Data_Access_Admin::PAGE_DESIGNER );
772 880 ?>">
@@ -771,8 +879,11 @@
771 879 echo esc_attr( WP_Data_Access_Admin::PAGE_DESIGNER );
772 880 ?>">
773 881 <input type="hidden" name="action" value="create_table">
774 882 <input type="hidden" name="caller" value="dataexplorer">
883 + <input type="hidden" name="_wpnonce" value="<?php
884 + echo esc_attr( wp_create_nonce( "wpda-query-" . WPDA_Design_Table_Model::get_base_table_name() . "--" ) );
885 + ?>">
775 886 </form>
776 887 <form id="wpda_goto_backup" style="display: none" method="post" action="?page=<?php
777 888 echo esc_attr( WP_Data_Access_Admin::PAGE_MAIN );
778 889 ?>&page_action=wpda_backup">
@@ -784,10 +895,9 @@
784 895 <div class="wpda-nowrap">
785 896 <div>
786 897 <div>
787 898 <a href="<?php
788 - echo admin_url( 'admin.php' );
789 - // phpcs:ignore WordPress.Security.EscapeOutput
899 + echo esc_url( admin_url( 'admin.php' ) );
790 900 ?>?page=<?php
791 901 echo esc_attr( WP_Data_Access_Admin::PAGE_MAIN );
792 902 ?>&page_action=wpda_global_search"
793 903 class="wpda-dashboard-item wpda_tooltip"
@@ -810,22 +920,21 @@
810 920 </a>
811 921 </div>
812 922 </div><div>
813 923 <div>
814 - <a onclick="jQuery('#upload_file_container_multi').show()"
815 - href="javascript:void(0)"
816 - class="wpda-dashboard-item wpda_tooltip"
817 - title="Import and execute SQL script files"
818 - >
819 - <i class="fas fa-file-code"></i>
820 - <div>
821 - Import SQL files
822 - </div>
823 - </a>
924 + <a onClick="window.ppActionEnableImport();"
925 + href="javascript:void(0)"
926 + class="wpda-dashboard-item wpda_tooltip"
927 + title="Import and execute SQL script files"
928 + >
929 + <i class="fas fa-file-code"></i>
930 + <div>
931 + Import SQL files
932 + </div>
933 + </a>
824 934 </div><div>
825 935 <a href="<?php
826 - echo admin_url( 'admin.php' );
827 - // phpcs:ignore WordPress.Security.EscapeOutput
936 + echo esc_url( admin_url( 'admin.php' ) );
828 937 ?>?page=<?php
829 938 echo esc_attr( WP_Data_Access_Admin::PAGE_MAIN );
830 939 ?>&page_action=wpda_import_csv"
831 940 class="wpda-dashboard-item wpda_tooltip"
@@ -836,77 +945,53 @@
836 945 Import CSV files
837 946 </div>
838 947 </a>
839 948 </div><div>
840 - <a href="javascript:void(0)"
841 - id="wpda_toolbar_icon_go_backup"
842 - class="wpda-dashboard-item wpda_tooltip"
843 - title="Data Backup - unattended exports"
844 - >
845 - <i class="fas fa-file-archive"></i>
846 - <div>
847 - Data Backup
848 - </div>
849 - </a>
850 - </div>
949 + <a onclick="window.ppActionEnableExport();"
950 + href="javascript:void(0)"
951 + class="wpda-dashboard-item wpda_tooltip"
952 + title="Unattended scheduled exports"
953 + >
954 + <i class="fas fa-clock"></i>
955 + <div>
956 + Export
957 + </div>
958 + </a>
959 + </div><?php
960 + $wpda_db_options_activated = get_option( 'wpda_db_options_activated' );
961 + if ( is_array( $wpda_db_options_activated ) && 0 < count( $wpda_db_options_activated ) ) {
962 + // Show old Data Backup feature only if still in use
963 + ?><div>
964 + <a href="javascript:void(0)"
965 + id="wpda_toolbar_icon_go_backup"
966 + class="wpda-dashboard-item wpda_tooltip"
967 + title="Data Backup - unattended exports"
968 + >
969 + <i class="fas fa-file-archive"></i>
970 + <div>
971 + Data Backup
972 + </div>
973 + </a>
974 + </div><?php
975 + }
976 + ?>
851 977 </div><div>
852 - <div>
853 - <a onclick="jQuery('#wpda_db_container').show(); jQuery('#local_database').focus();"
854 - href="javascript:void(0)"
855 - class="wpda-dashboard-item wpda_tooltip"
856 - title="Add remote database or create local database"
857 - >
858 - <i id="wpda_toolbar_icon_add_database" class="fas fa-database"></i>
859 - <div>
860 - Add database
861 - </div>
862 - </a>
863 - </div>
864 - <?php
978 + <div>
979 + <a onclick="jQuery('#wpda_manage_databases').show(); jQuery('#local_database').focus();"
980 + href="javascript:void(0)"
981 + class="wpda-dashboard-item wpda_tooltip"
982 + title="Manage remote database connections and local databases"
983 + >
984 + <i id="wpda_toolbar_icon_add_database" class="fas fa-server"></i>
985 + <div>
986 + Databases
987 + </div>
988 + </a>
989 + </div><?php
865 990 ?>
866 991 </div>
867 992 </div>
868 - <div class="wpda-promotion" style="font-size: 16px">
869 - <?php
870 - $current_version = get_user_meta( WPDA::get_current_user_id(), 'wpda_data_explorer', true );
871 - if ( 'new' !== $current_version ) {
872 - ?>
873 - <a href="?page=<?php
874 - echo esc_attr( WP_Data_Access_Admin::PAGE_MAIN );
875 - ?>&de=new"
876 - style="display: flex; align-items: center; gap: 5px;"
877 - >
878 - <i class="fas fa-toggle-off"></i>
879 - <span>Switch to new Data Explorer</span>
880 - </a>
881 - <?php
882 - } else {
883 - ?>
884 - <span
885 - style="display: flex; align-items: center; gap: 5px; white-space: nowrap;"
886 - >
887 - <a href="?page=<?php
888 - echo esc_attr( WP_Data_Access_Admin::PAGE_MAIN );
889 - ?>&de=old"
890 - style="display: flex; align-items: center; gap: 5px; white-space: nowrap;"
891 - >
892 - <i class="fas fa-toggle-on"></i>
893 - <span>Switch to old Data Explorer</span>
894 - </a>
895 - <span>
896 - <a href="https://wpdataaccess.com/2024/01/26/the-new-data-explorer-wp-data-access-5-4-0/"
897 - target="_blank"
898 - class="wpda_tooltip"
899 - title="Click to read more"
900 - >
901 - <i class="fas fa-circle-info"></i>
902 - </a>
903 - </span>
904 - </span>
905 - <?php
906 - }
907 - ?>
908 - </div>
993 + <div></div>
909 994 <?php
910 995 //$this->get_promotions('wpda');
911 996 ?>
912 997 </div>
@@ -913,111 +998,8 @@
913 998 <?php
914 999 }
915 1000
916 1001 /**
917 - * Data Explorer table page toolbar
918 - *
919 - * @return void
920 - */
921 - protected function toolbar_wpda_table() {
922 - ?>
923 - <form id="wpda_new_row" style="display: none" method="post" action="?page=<?php
924 - echo esc_attr( WP_Data_Access_Admin::PAGE_MAIN );
925 - ?>">
926 - <?php
927 - if ( isset( $_REQUEST['wpdaschema_name'] ) ) {
928 - // phpcs:ignore WordPress.Security.NonceVerification
929 - $schema_name = esc_attr( sanitize_text_field( wp_unslash( $_REQUEST['wpdaschema_name'] ) ) );
930 - // phpcs:ignore WordPress.Security.NonceVerification
931 - echo "<input type='hidden' name='wpdaschema_name' value='{$schema_name}'>";
932 - // phpcs:ignore WordPress.Security.EscapeOutput
933 - }
934 - ?>
935 - <input type="hidden" id="wpda_new_row_table_name" name="table_name" value="">
936 - <input type="hidden" name="action" value="new">
937 - </form>
938 - <div id="wpda-dashboard-toolbar" class="wpda-dashboard-toolbar" style="display:none">
939 - <div class="wpda-nowrap">
940 - <div>
941 - <div>
942 - <a href="javascript:void(0)"
943 - id="wpda_toolbar_icon_add_row"
944 - class="wpda-dashboard-item wpda_tooltip"
945 - title="Add new row to table"
946 - >
947 - <i class="fas fa-plus-circle"></i>
948 - <div>
949 - Add row
950 - </div>
951 - </a>
952 - </div><div>
953 - <a onclick="jQuery('#upload_file_container').show()"
954 - href="javascript:void(0)"
955 - class="wpda-dashboard-item wpda_tooltip"
956 - title="Allows only imports into table authors"
957 - >
958 - <i class="fas fa-code"></i>
959 - <div>
960 - Import rows
961 - </div>
962 - </a>
963 - </div>
964 - </div>
965 - </div>
966 - <?php
967 - $this->get_promotions( 'table' );
968 - ?>
969 - </div>
970 - <?php
971 - }
972 -
973 - /**
974 - * Data Explorer data entry form toolbar
975 - *
976 - * @return void
977 - */
978 - protected function toolbar_wpda_row() {
979 - ?>
980 - <form id="wpda_new_row" style="display: none" method="post" action="?page=<?php
981 - echo esc_attr( WP_Data_Access_Admin::PAGE_MAIN );
982 - ?>">
983 - <?php
984 - if ( isset( $_REQUEST['wpdaschema_name'] ) ) {
985 - // phpcs:ignore WordPress.Security.NonceVerification
986 - $schema_name = esc_attr( sanitize_text_field( wp_unslash( $_REQUEST['wpdaschema_name'] ) ) );
987 - // phpcs:ignore WordPress.Security.NonceVerification
988 - echo "<input type='hidden' name='wpdaschema_name' value='{$schema_name}'>";
989 - // phpcs:ignore WordPress.Security.EscapeOutput
990 - }
991 - ?>
992 - <input type="hidden" id="wpda_new_row_table_name" name="table_name" value="">
993 - <input type="hidden" name="action" value="new">
994 - </form>
995 - <div id="wpda-dashboard-toolbar" class="wpda-dashboard-toolbar" style="display:none">
996 - <div class="wpda-nowrap">
997 - <div>
998 - <div>
999 - <a href="javascript:void(0)"
1000 - id="wpda_toolbar_icon_add_row"
1001 - class="wpda-dashboard-item wpda_tooltip"
1002 - title="Add new row to table"
1003 - >
1004 - <i class="fas fa-plus-circle"></i>
1005 - <div>
1006 - Add row
1007 - </div>
1008 - </a>
1009 - </div>
1010 - </div>
1011 - </div>
1012 - <?php
1013 - $this->get_promotions( 'row' );
1014 - ?>
1015 - </div>
1016 - <?php
1017 - }
1018 -
1019 - /**
1020 1002 * Data Backup toolbar
1021 1003 *
1022 1004 * @return void
1023 1005 */
@@ -1027,8 +1009,11 @@
1027 1009 echo esc_attr( WP_Data_Access_Admin::PAGE_MAIN );
1028 1010 ?>&page_action=wpda_backup">
1029 1011 <input type="hidden" id="wpda_new_backup_wpdaschema_name" name="wpdaschema_name" value="">
1030 1012 <input type="hidden" name="action" value="new">
1013 + <input type="hidden" name="wp_nonce" value="<?php
1014 + echo esc_attr( wp_create_nonce( 'wpda-backup-' . WPDA::get_current_user_login() ) );
1015 + ?>"/>
1031 1016 </form>
1032 1017 <div id="wpda-dashboard-toolbar" class="wpda-dashboard-toolbar" style="display:none">
1033 1018 <div class="wpda-nowrap">
1034 1019 <div>
@@ -1093,31 +1078,67 @@
1093 1078 *
1094 1079 * @return void
1095 1080 */
1096 1081 protected function toolbar_apps() {
1082 + $has_apps = WPDA_App_Model::has_any();
1097 1083 ?>
1098 1084 <div id="wpda-dashboard-toolbar" class="wpda-dashboard-toolbar" style="display:none">
1099 1085 <div class="wpda-nowrap">
1100 1086 <div>
1101 1087 <div>
1102 - <a href="javascript:window.ppAddApp()"
1088 + <a href="javascript:window.ppActionCreateApp()"
1103 1089 class="wpda-dashboard-item wpda_tooltip wpda-create-new-app"
1104 1090 title="Create new app"
1105 1091 >
1106 1092 <i class="fas fa-plus-circle"></i>
1107 1093 <div>
1108 - Create new app
1094 + Create New App
1109 1095 </div>
1110 1096 </a>
1111 - </div>
1097 + </div><div>
1098 + <a href="javascript:window.ppActionRenameDatabase()"
1099 + class="wpda-dashboard-item wpda_tooltip wpda-rename-database"
1100 + title="Rename Database"
1101 + >
1102 + <svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 2 24 24" stroke-linecap="round" stroke-linejoin="round" height="32px" width="32px" xmlns="http://www.w3.org/2000/svg">
1103 + <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
1104 + <path d="M4 6c0 1.657 3.582 3 8 3s8 -1.343 8 -3s-3.582 -3 -8 -3s-8 1.343 -8 3"></path>
1105 + <path d="M4 6v6c0 1.657 3.582 3 8 3c.478 0 .947 -.016 1.402 -.046"></path>
1106 + <path d="M20 12v-6"></path>
1107 + <path d="M4 12v6c0 1.526 3.04 2.786 6.972 2.975"></path>
1108 + <path d="M18.42 15.61a2.1 2.1 0 0 1 2.97 2.97l-3.39 3.42h-3v-3l3.42 -3.39z"></path>
1109 + </svg>
1110 + <div>
1111 + Rename Database
1112 + </div>
1113 + </a>
1114 + </div><?php
1115 + ?>
1112 1116 </div>
1113 1117 </div>
1114 - <div class="wpda-promotion" style="font-size: 16px">
1115 - <span>
1116 - <a href="https://wpdataaccess.com/2024/04/15/the-app-builder-wp-data-access-5-5/"
1118 + <div class="wpda-promotion" style="display: flex; align-items: center; gap: 5px; font-size: 16px;">
1119 + <?php
1120 + if ( !$has_apps ) {
1121 + ?>
1122 + <span>
1123 + <strong>
1124 + New to the App Builder? Watch the Getting Started tutorial! 👉
1125 + </strong>
1126 + </span><?php
1127 + }
1128 + ?><span>
1129 + <a href="https://www.youtube.com/watch?v=j0MJvuMG7k8"
1130 + target="_blank"
1131 + class="wpda_tooltip"
1132 + title="App Builder Getting Started tutorial"
1133 + >
1134 + <i class="fas fab fa-square-youtube"></i>
1135 + </a>
1136 + </span><span>
1137 + <a href="https://docs.rad.wpdataaccess.com/"
1117 1138 target="_blank"
1118 1139 class="wpda_tooltip"
1119 - title="Click to read introduction to apps"
1140 + title="Online App Builder documentation"
1120 1141 >
1121 1142 <i class="fas fa-circle-info"></i>
1122 1143 </a>
1123 1144 </span>
@@ -1129,48 +1150,8 @@
1129 1150 <?php
1130 1151 }
1131 1152
1132 1153 /**
1133 - * Query Builder toolbar
1134 - *
1135 - * @return void
1136 - */
1137 - protected function toolbar_sql() {
1138 - ?>
1139 - <div id="wpda-dashboard-toolbar" class="wpda-dashboard-toolbar" style="display:none">
1140 - <div class="wpda-nowrap">
1141 - <div>
1142 - <div>
1143 - <a href="javascript:tabNew()"
1144 - class="wpda-dashboard-item wpda_tooltip"
1145 - title="Create new query"
1146 - >
1147 - <i class="fas fa-plus-circle"></i>
1148 - <div>
1149 - Create new query
1150 - </div>
1151 - </a>
1152 - </div><div>
1153 - <a href="javascript:openQuery()"
1154 - class="wpda-dashboard-item wpda_tooltip"
1155 - title="Open existing query"
1156 - >
1157 - <i class="fas fa-folder-open"></i>
1158 - <div>
1159 - Open existing query
1160 - </div>
1161 - </a>
1162 - </div>
1163 - </div>
1164 - </div>
1165 - <?php
1166 - $this->get_promotions( 'sql' );
1167 - ?>
1168 - </div>
1169 - <?php
1170 - }
1171 -
1172 - /**
1173 1154 * Data Designer toolbar
1174 1155 *
1175 1156 * @return void
1176 1157 */
@@ -1182,8 +1163,11 @@
1182 1163 <input type="hidden" name="action" value="edit">
1183 1164 <input type="hidden" name="table_name" value="<?php
1184 1165 echo esc_attr( WPDA_Design_Table_Model::get_base_table_name() );
1185 1166 ?>">
1167 + <input type="hidden" name="_wpnonce" value="<?php
1168 + echo esc_attr( wp_create_nonce( "wpda-query-" . WPDA_Design_Table_Model::get_base_table_name() . "--" ) );
1169 + ?>">
1186 1170 </form>
1187 1171 <div id="wpda-dashboard-toolbar" class="wpda-dashboard-toolbar" style="display:none">
1188 1172 <div class="wpda-nowrap">
1189 1173 <div>
@@ -1197,9 +1181,9 @@
1197 1181 Create table design
1198 1182 </div>
1199 1183 </a>
1200 1184 </div><div>
1201 - <a onclick="jQuery('#upload_file_container').show()"
1185 + <a onclick="alert('This feature has been removed. Please use the Data Explorer import feature.')"
1202 1186 href="javascript:void(0)"
1203 1187 class="wpda-dashboard-item wpda_tooltip"
1204 1188 title="Import table designs"
1205 1189 >
@@ -1245,9 +1229,9 @@
1245 1229 Create data table
1246 1230 </div>
1247 1231 </a>
1248 1232 </div><div>
1249 - <a onclick="jQuery('#upload_file_container').show()"
1233 + <a onclick="alert('This feature has been removed. Please use the Data Explorer import feature.')"
1250 1234 href="javascript:void(0)"
1251 1235 class="wpda-dashboard-item wpda_tooltip"
1252 1236 title="Import data tables"
1253 1237 >
@@ -1304,9 +1288,9 @@
1304 1288 Create project
1305 1289 </div>
1306 1290 </a>
1307 1291 </div><div>
1308 - <a onclick="jQuery('#upload_file_container_multi').show()"
1292 + <a onclick="jQuery(alert('This feature has been removed. Please use the Data Explorer import feature.')).show()"
1309 1293 href="javascript:void(0)"
1310 1294 class="wpda-dashboard-item wpda_tooltip"
1311 1295 title="Import projects"
1312 1296 >
@@ -1394,9 +1378,9 @@
1394 1378 </select>
1395 1379 <?php
1396 1380 if ( !class_exists( 'Code_Manager\\Code_Manager_Model' ) || !class_exists( 'WPDataAccess\\Premium\\WPDAPRO_Dashboard\\WPDAPRO_Widget_Project' ) ) {
1397 1381 ?>
1398 - <a href="https://wpdataaccess.com/docs/dashboards-and-widgets/getting-started/" target="_blank">
1382 + <a href="https://docs.legacy.wpdataaccess.com/docs/bi-getting-started/" target="_blank">
1399 1383 <i class="fas fa-question-circle pointer wpda_tooltip"
1400 1384 style="font-size: 170%; vertical-align: middle"
1401 1385 title="Your installation does not support all available widget types! Click to learn how to install more widget types..."></i>
1402 1386 </a>
@@ -1510,9 +1494,9 @@
1510 1494 )</option>
1511 1495 <?php
1512 1496 $rdbs = WPDADB::get_remote_databases();
1513 1497 ksort( $rdbs );
1514 - //phpcs:ignore - 8.1 proof
1498 + // phpcs:ignore -- 8.1 proof
1515 1499 foreach ( $rdbs as $key => $rdb ) {
1516 1500 ?>
1517 1501 <option value="<?php
1518 1502 echo esc_attr( $key );
@@ -1694,9 +1678,9 @@
1694 1678 // Following line requires PHP 7.
1695 1679 // $last_key = array_key_last($this->dashboard_positions[0]); .
1696 1680 $last_key = 1;
1697 1681 if ( is_array( $this->dashboard_positions ) && count( $this->dashboard_positions ) > 0 ) {
1698 - //phpcs:ignore - 8.1 proof
1682 + // phpcs:ignore -- 8.1 proof
1699 1683 foreach ( $this->dashboard_positions[0] as $key => $val ) {
1700 1684 $last_key = $key;
1701 1685 }
1702 1686 }
@@ -1787,14 +1771,14 @@
1787 1771 let wpda_wpnonce_refresh = "<?php
1788 1772 echo esc_attr( wp_create_nonce( WPDA_Widget::WIDGET_REFRESH . WPDA::get_current_user_login() ) );
1789 1773 ?>";
1790 1774 let wpda_ajaxurl = "<?php
1791 - echo admin_url( 'admin-ajax.php' );
1792 - // phpcs:ignore WordPress.Security.EscapeOutput
1775 + echo esc_url( admin_url( 'admin-ajax.php' ) );
1793 1776 ?>";
1794 1777 let wpda_databases = '<?php
1778 + // phpcs:disable WordPress.Security.EscapeOutput
1795 1779 echo $this->get_databases();
1796 - // phpcs:ignore WordPress.Security.EscapeOutput
1780 + // phpcs:enable WordPress.Security.EscapeOutput
1797 1781 ?>';
1798 1782 let wpda_shared_dashboards = <?php
1799 1783 echo json_encode( $this->shared_dashboards );
1800 1784 // phpcs:ignore
@@ -1842,21 +1826,20 @@
1842 1826 public static function save() {
1843 1827 $wp_nonce = ( isset( $_POST['wp_nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['wp_nonce'] ) ) : '' );
1844 1828 if ( !wp_verify_nonce( $wp_nonce, static::DASHBOARD_SAVE . WPDA::get_current_user_login() ) ) {
1845 1829 WPDA::sent_header( 'application/json' );
1846 - echo static::msg( 'ERROR', 'Token expired, please refresh page' );
1847 - // phpcs:ignore WordPress.Security.EscapeOutput
1830 + static::msg( 'ERROR', 'Token expired, please refresh page' );
1848 1831 wp_die();
1849 1832 }
1833 + // phpcs:disable WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
1850 1834 $widgets = ( isset( $_POST['wpda_widgets'] ) ? WPDA::sanitize_text_field_array( $_POST['wpda_widgets'] ) : array() );
1851 - // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
1835 + // phpcs:enable WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
1852 1836 $save = array();
1853 1837 foreach ( $widgets as $widget ) {
1854 1838 $save[$widget['widgetName']] = $widget;
1855 1839 }
1856 1840 update_user_meta( WPDA::get_current_user_id(), self::USER_DASHBOARD, $save );
1857 - echo self::msg( 'SUCCESS', 'Widget succesfully saved' );
1858 - // phpcs:ignore WordPress.Security.EscapeOutput
1841 + self::msg( 'SUCCESS', 'Widget succesfully saved' );
1859 1842 wp_die();
1860 1843 }
1861 1844
1862 1845 /**
@@ -1867,10 +1850,9 @@
1867 1850 public static function get_list() {
1868 1851 $wp_nonce = ( isset( $_POST['wpda_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_POST['wpda_wpnonce'] ) ) : '' );
1869 1852 if ( !wp_verify_nonce( $wp_nonce, WPDA_Widget::WIDGET_REFRESH . WPDA::get_current_user_login() ) ) {
1870 1853 WPDA::sent_header( 'application/json' );
1871 - echo static::msg( 'ERROR', 'Token expired, please refresh page' );
1872 - // phpcs:ignore WordPress.Security.EscapeOutput
1854 + static::msg( 'ERROR', 'Token expired, please refresh page' );
1873 1855 wp_die();
1874 1856 }
1875 1857 // Placeholder: implemented in the premium version.
1876 1858 echo '';
@@ -1885,10 +1867,9 @@
1885 1867 public static function delete_widget() {
1886 1868 $wp_nonce = ( isset( $_POST['wpda_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_POST['wpda_wpnonce'] ) ) : '' );
1887 1869 if ( !wp_verify_nonce( $wp_nonce, self::DASHBOARD_SAVE . WPDA::get_current_user_login() ) ) {
1888 1870 WPDA::sent_header( 'application/json' );
1889 - echo static::msg( 'ERROR', 'Token expired, please refresh page' );
1890 - // phpcs:ignore WordPress.Security.EscapeOutput
1871 + static::msg( 'ERROR', 'Token expired, please refresh page' );
1891 1872 wp_die();
1892 1873 }
1893 1874 // Placeholder: implemented in the premium version.
1894 1875 echo '';
@@ -1903,10 +1884,9 @@
1903 1884 public static function edit_chart() {
1904 1885 $wp_nonce = ( isset( $_POST['wpda_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_POST['wpda_wpnonce'] ) ) : '' );
1905 1886 if ( !wp_verify_nonce( $wp_nonce, WPDA_Widget::WIDGET_REFRESH . WPDA::get_current_user_login() ) ) {
1906 1887 WPDA::sent_header( 'application/json' );
1907 - echo static::msg( 'ERROR', 'Token expired, please refresh page' );
1908 - // phpcs:ignore WordPress.Security.EscapeOutput
1888 + static::msg( 'ERROR', 'Token expired, please refresh page' );
1909 1889 wp_die();
1910 1890 }
1911 1891 // Placeholder: implemented in the premium version.
1912 1892 echo '';
@@ -1921,10 +1901,9 @@
1921 1901 public static function load_widget() {
1922 1902 $wp_nonce = ( isset( $_POST['wpda_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_POST['wpda_wpnonce'] ) ) : '' );
1923 1903 if ( !wp_verify_nonce( $wp_nonce, WPDA_Widget::WIDGET_REFRESH . WPDA::get_current_user_login() ) ) {
1924 1904 WPDA::sent_header( 'application/json' );
1925 - echo static::msg( 'ERROR', 'Token expired, please refresh page' );
1926 - // phpcs:ignore WordPress.Security.EscapeOutput
1905 + static::msg( 'ERROR', 'Token expired, please refresh page' );
1927 1906 wp_die();
1928 1907 }
1929 1908 // Placeholder: implemented in the premium version.
1930 1909 echo '';
@@ -1967,74 +1946,30 @@
1967 1946 * @return false|string
1968 1947 */
1969 1948 public static function msg( $status, $msg ) {
1970 1949 $error = array(
1971 - 'status' => $status,
1950 + 'status' => esc_attr( $status ),
1972 1951 'msg' => $msg,
1973 1952 );
1974 - return json_encode( $error );
1975 - // phpcs:ignore
1953 + echo json_encode( $error );
1954 + // phpcs:ignore WordPress.Security.EscapeOutput
1976 1955 }
1977 1956
1978 1957 private function get_promotions( $tool ) {
1979 1958 switch ( $tool ) {
1980 - case 'csv':
1959 + case 'publisher':
1960 + case 'projects':
1961 + case 'templates':
1962 + case 'charts':
1981 1963 $promotions = array(array(
1982 - 'Use the connection wizards for fully automated CSV synchronization.' => array('https://wpdataaccess.com/docs/remote-data-files/csv-files/', 'fa-lightbulb'),
1964 + 'This tool will be transitioned to the new App Builder. Please migrate on time.' => array(null, 'fa-lightbulb'),
1983 1965 ));
1984 1966 break;
1985 - case 'publisher':
1986 - $promotions = array(
1987 - array(
1988 - 'Change data table color, spacing, border radius and modal popup behaviour.' => array('https://wpdataaccess.com/data-tables-styling/premium-styling/', 'fa-palette'),
1989 - ),
1990 - array(
1991 - 'Reorder data table elements with drag and drop.' => array('https://wpdataaccess.com/docs/data-tables/extension-manager/', 'fa-star'),
1992 - ),
1993 - array(
1994 - 'Add buttons to support CSV, Excel, PDF and SQL downloads.' => array('https://wpdataaccess.com/docs/data-tables/extension-manager/', 'fa-cloud-download'),
1995 - ),
1996 - array(
1997 - 'Add user friendly Search Panes to simplify searching.' => array('https://wpdataaccess.com/docs/data-tables-interactive-filters/search-panes/', 'fa-magic'),
1998 - ),
1999 - array(
2000 - 'Use the Search Builder to add interactive searching.' => array('https://wpdataaccess.com/docs/data-tables-interactive-filters/search-builder/', 'fa-search'),
2001 - ),
2002 - array(
2003 - 'Synchronize your Google Sheets from the Data Explorer.' => array('https://wpdataaccess.com/docs/remote-data-files/public-url/#google-sheets', 'fa-database'),
2004 - )
2005 - );
2006 - break;
2007 - case 'wpda':
2008 - $promotions = array(
2009 - array(
2010 - 'Access your SQL Server tables from the Data Explorer.' => array('https://wpdataaccess.com/docs/remote-database-connections/sql-server/', 'fa-database'),
2011 - ),
2012 - array(
2013 - 'Access your PostgreSQL tables from the Data Explorer.' => array('https://wpdataaccess.com/docs/remote-database-connections/postgresql/', 'fa-database'),
2014 - ),
2015 - array(
2016 - 'Access your Oracle tables from the Data Explorer.' => array('https://wpdataaccess.com/data-explorer/remote-connection-wizard/remote-database-connections/oracle/', 'fa-database'),
2017 - ),
2018 - array(
2019 - 'Access your remote MariaDB | MySQL tables from the Data Explorer.' => array('https://wpdataaccess.com/docs/remote-database-connections/mariadb-mysql/', 'fa-database'),
2020 - ),
2021 - array(
2022 - 'Access your CSV files directly from the Data Explorer.' => array('https://wpdataaccess.com/docs/remote-data-files/csv-files/', 'fa-lightbulb'),
2023 - ),
2024 - array(
2025 - 'Access your MS Access tables from the Data Explorer.' => array('https://wpdataaccess.com/docs/remote-data-files/ms-access/', 'fa-database'),
2026 - ),
2027 - array(
2028 - 'Synchronize your Google Sheets from the Data Explorer.' => array('https://wpdataaccess.com/docs/remote-data-files/public-url/#google-sheets', 'fa-database'),
2029 - )
2030 - );
2031 - break;
2032 1967 default:
2033 1968 $promotions = array();
2034 1969 }
2035 1970 if ( count( $promotions ) > 0 ) {
2036 - //phpcs:ignore - 8.1 proof
1971 + // phpcs:ignore -- 8.1 proof
2037 1972 $promotion_index = random_int( 0, count( $promotions ) - 1 );
2038 1973 $promotion = $promotions[$promotion_index];
2039 1974 $promotion_text = key( $promotion );
2040 1975 $promotion_url = $promotion[$promotion_text][0];
@@ -2046,11 +1981,17 @@
2046 1981 ?>"></i></span>
2047 1982 <?php
2048 1983 echo esc_attr( $promotion_text );
2049 1984 ?>
2050 - <a href="<?php
2051 - echo esc_url( $promotion_url );
2052 - ?>" target="_blank">Read more...</a>
1985 + <?php
1986 + if ( null !== $promotion_url ) {
1987 + ?>
1988 + <a href="<?php
1989 + echo esc_url( $promotion_url );
1990 + ?>" target="_blank">Read more...</a>
1991 + <?php
1992 + }
1993 + ?>
2053 1994 </div>
2054 1995 <?php
2055 1996 }
2056 1997 }
@@ -2055,4 +1996,6 @@
2055 1996 }
2056 1997 }
2057 1998
2058 1999 }
2000 +
2001 +// phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing