| @@ -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,10 +175,8 @@ | ||
| 174 | 175 | * @var string|null |
| 175 | 176 | */ |
| 176 | 177 | protected $message_type = null; |
| 177 | 178 | |
| 178 | - private $current_version; | |
| 179 | - | |
| 180 | 179 | private $option_legacy_tools; |
| 181 | 180 | |
| 182 | 181 | /** |
| 183 | 182 | * Constructor |
| @@ -191,9 +190,8 @@ | ||
| 191 | 190 | $this->wp_nonce_save = wp_create_nonce( static::DASHBOARD_SAVE . WPDA::get_current_user_login() ); |
| 192 | 191 | // Load Data Tables resources. |
| 193 | 192 | \WPDataAccess\Data_Tables\WPDA_Data_Tables::enqueue_styles_and_script(); |
| 194 | 193 | } |
| 195 | - $this->current_version = get_user_meta( WPDA::get_current_user_id(), 'wpda_data_explorer', true ); | |
| 196 | 194 | // Start with empty array. |
| 197 | 195 | if ( $widget_mode ) { |
| 198 | 196 | update_user_meta( WPDA::get_current_user_id(), self::USER_DASHBOARD, array() ); |
| 199 | 197 | } |
| @@ -224,11 +222,9 @@ | ||
| 224 | 222 | $this->dashboard_default(); |
| 225 | 223 | $this->dashboard_mobile(); |
| 226 | 224 | } |
| 227 | 225 | if ( isset( $_REQUEST['page'] ) ) { |
| 228 | - // phpcs:ignore WordPress.Security.NonceVerification | |
| 229 | 226 | switch ( $_REQUEST['page'] ) { |
| 230 | - // phpcs:ignore WordPress.Security.NonceVerification | |
| 231 | 227 | case 'wpda_dashboard': |
| 232 | 228 | $this->toolbar(); |
| 233 | 229 | $this->add_forms(); |
| 234 | 230 | $this->tabs(); |
| @@ -237,24 +233,12 @@ | ||
| 237 | 233 | $this->dashboard_js(); |
| 238 | 234 | break; |
| 239 | 235 | case WP_Data_Access_Admin::PAGE_MAIN: |
| 240 | 236 | if ( !isset( $_REQUEST['page_action'] ) ) { |
| 241 | - // phpcs:ignore WordPress.Security.NonceVerification | |
| 242 | - if ( !isset( $_REQUEST['table_name'] ) ) { | |
| 243 | - // phpcs:ignore WordPress.Security.NonceVerification | |
| 244 | - $this->toolbar_wpda(); | |
| 245 | - } else { | |
| 246 | - if ( !isset( $_REQUEST['action'] ) || 'new' !== $_REQUEST['action'] && 'edit' !== $_REQUEST['action'] ) { | |
| 247 | - $this->toolbar_wpda_table(); | |
| 248 | - } else { | |
| 249 | - $this->toolbar_wpda_row(); | |
| 250 | - } | |
| 251 | - } | |
| 237 | + $this->toolbar_wpda(); | |
| 252 | 238 | } elseif ( 'wpda_backup' === $_REQUEST['page_action'] && (!isset( $_REQUEST['action'] ) || 'remove' === $_REQUEST['action'] || 'update' === $_REQUEST['action'] || 'add' === $_REQUEST['action']) ) { |
| 253 | - // phpcs:ignore WordPress.Security.NonceVerification | |
| 254 | 239 | $this->toolbar_backup(); |
| 255 | 240 | } elseif ( 'wpda_import_csv' === $_REQUEST['page_action'] ) { |
| 256 | - // phpcs:ignore WordPress.Security.NonceVerification | |
| 257 | 241 | $this->toolbar_import_csv(); |
| 258 | 242 | } |
| 259 | 243 | break; |
| 260 | 244 | case WP_Data_Access_Admin::PAGE_APPS: |
| @@ -259,11 +243,8 @@ | ||
| 259 | 243 | break; |
| 260 | 244 | case WP_Data_Access_Admin::PAGE_APPS: |
| 261 | 245 | $this->toolbar_apps(); |
| 262 | 246 | break; |
| 263 | - case WP_Data_Access_Admin::PAGE_QUERY_BUILDER: | |
| 264 | - $this->toolbar_sql(); | |
| 265 | - break; | |
| 266 | 247 | case WP_Data_Access_Admin::PAGE_DESIGNER: |
| 267 | 248 | if ( !isset( $_REQUEST['action'] ) || 'new' !== $_REQUEST['action'] && 'edit' !== $_REQUEST['action'] ) { |
| 268 | 249 | $this->toolbar_designer(); |
| 269 | 250 | } |
| @@ -293,9 +274,11 @@ | ||
| 293 | 274 | ?> |
| 294 | 275 | <script> |
| 295 | 276 | jQuery(function() { |
| 296 | 277 | const iaction = "<?php |
| 278 | + // phpcs:disable WordPress.Security.ValidatedSanitizedInput.MissingUnslash | |
| 297 | 279 | echo esc_attr( sanitize_text_field( $_GET['page_iaction'] ) ); |
| 280 | + // phpcs:enable WordPress.Security.ValidatedSanitizedInput.MissingUnslash | |
| 298 | 281 | ?>"; |
| 299 | 282 | switch (iaction) { |
| 300 | 283 | case "create_new_app": |
| 301 | 284 | var interval = setInterval( |
| @@ -331,83 +314,99 @@ | ||
| 331 | 314 | * |
| 332 | 315 | * @return string |
| 333 | 316 | */ |
| 334 | 317 | protected function get_help_url() { |
| 335 | - $help_root = 'https://wpdataaccess.com/docs/'; | |
| 318 | + $help_url = 'https://docs.wpdataaccess.com/'; | |
| 336 | 319 | if ( isset( $_REQUEST['page'] ) ) { |
| 337 | - // phpcs:ignore WordPress.Security.NonceVerification | |
| 338 | 320 | switch ( $_REQUEST['page'] ) { |
| 339 | - // phpcs:ignore WordPress.Security.NonceVerification | |
| 340 | 321 | case \WP_Data_Access_Admin::PAGE_MAIN: |
| 341 | - $help_url = $help_root . 'data-explorer/data-explorer-getting-started/'; | |
| 322 | + $help_url = 'https://docs.explorer.wpdataaccess.com/'; | |
| 342 | 323 | break; |
| 324 | + case \WP_Data_Access_Admin::PAGE_APPS: | |
| 325 | + $help_url = 'https://docs.rad.wpdataaccess.com/'; | |
| 326 | + break; | |
| 343 | 327 | case \WP_Data_Access_Admin::PAGE_QUERY_BUILDER: |
| 344 | - $help_url = $help_root . 'sql-query-builder/query-builder-getting-started/'; | |
| 328 | + $help_url = 'https://docs.sql.wpdataaccess.com/'; | |
| 345 | 329 | break; |
| 346 | 330 | case \WP_Data_Access_Admin::PAGE_DESIGNER: |
| 347 | - $help_url = $help_root . 'data-designer/data-designer-getting-started/'; | |
| 331 | + $help_url = 'https://docs.legacy.wpdataaccess.com/docs/data-designer-getting-started/'; | |
| 348 | 332 | break; |
| 349 | 333 | case \WP_Data_Access_Admin::PAGE_PUBLISHER: |
| 350 | - $help_url = $help_root . 'data-tables/data-tables-getting-started/'; | |
| 334 | + $help_url = 'https://docs.legacy.wpdataaccess.com/docs/data-tables-getting-started/'; | |
| 351 | 335 | break; |
| 352 | 336 | case \WP_Data_Access_Admin::PAGE_DASHBOARD: |
| 353 | - $help_url = $help_root . 'dashboards-and-widgets/bi-getting-started/'; | |
| 337 | + $help_url = 'https://docs.legacy.wpdataaccess.com/docs/bi-getting-started/'; | |
| 354 | 338 | break; |
| 355 | 339 | case \WP_Data_Access_Admin::PAGE_CHARTS: |
| 356 | - $help_url = $help_root . 'charts-legacy/chart-widgets/'; | |
| 340 | + $help_url = 'https://docs.legacy.wpdataaccess.com/docs/chart-widgets/'; | |
| 357 | 341 | break; |
| 358 | 342 | case WPDP::PAGE_MAIN: |
| 359 | - $help_url = $help_root . 'data-forms/data-projects/'; | |
| 343 | + $help_url = 'https://docs.legacy.wpdataaccess.com/docs/data-projects/'; | |
| 360 | 344 | break; |
| 361 | 345 | case WPDP::PAGE_TEMPLATES: |
| 362 | - $help_url = $help_root . 'templates/project-templates/'; | |
| 346 | + $help_url = 'https://docs.legacy.wpdataaccess.com/docs/project-templates/'; | |
| 363 | 347 | break; |
| 364 | 348 | case 'wpdataaccess': |
| 365 | 349 | $current_tab = ( isset( $_REQUEST['tab'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['tab'] ) ) : 'plugin' ); |
| 366 | - // phpcs:ignore WordPress.Security.NonceVerification | |
| 367 | 350 | switch ( $current_tab ) { |
| 368 | - case 'backend': | |
| 369 | - $help_url = $help_root . 'plugin-settings/back-end/'; | |
| 351 | + case 'plugin': | |
| 352 | + $help_url = 'https://docs.settings.wpdataaccess.com/plugin.html'; | |
| 370 | 353 | break; |
| 371 | - case 'frontend': | |
| 372 | - $help_url = $help_root . 'plugin-settings/front-end/'; | |
| 373 | - break; | |
| 374 | 354 | case 'pds': |
| 375 | - $help_url = $help_root . 'remote-connection-wizard/start-here/'; | |
| 355 | + $help_url = 'https://docs.settings.wpdataaccess.com/pds.html'; | |
| 376 | 356 | break; |
| 377 | - case 'dashboard': | |
| 378 | - $help_url = $help_root . 'plugin-settings/dashboard/'; | |
| 357 | + case 'backend': | |
| 358 | + $help_url = 'https://docs.settings.wpdataaccess.com/back-end.html'; | |
| 379 | 359 | break; |
| 380 | - case 'datatables': | |
| 381 | - $help_url = $help_root . 'plugin-settings/data-table/'; | |
| 360 | + case 'frontend': | |
| 361 | + $help_url = 'https://docs.settings.wpdataaccess.com/frond-end.html'; | |
| 382 | 362 | break; |
| 383 | - case 'dataforms': | |
| 384 | - $help_url = $help_root . 'plugin-settings/data-form/'; | |
| 385 | - break; | |
| 386 | - case 'databackup': | |
| 387 | - $help_url = $help_root . 'plugin-settings/data-backup/'; | |
| 388 | - break; | |
| 389 | 363 | case 'uninstall': |
| 390 | - $help_url = $help_root . 'plugin-settings/uninstall/'; | |
| 364 | + $help_url = 'https://docs.settings.wpdataaccess.com/uninstall.html'; | |
| 391 | 365 | break; |
| 392 | 366 | case 'repository': |
| 393 | - $help_url = $help_root . 'plugin-settings/manage-repository/'; | |
| 367 | + $help_url = 'https://docs.settings.wpdataaccess.com/repository.html'; | |
| 394 | 368 | break; |
| 395 | - case 'roles': | |
| 396 | - $help_url = $help_root . 'plugin-settings/manage-roles/'; | |
| 369 | + case 'mail': | |
| 370 | + $help_url = 'https://docs.settings.wpdataaccess.com/mail.html'; | |
| 397 | 371 | break; |
| 372 | + case 'drives': | |
| 373 | + $help_url = 'https://docs.settings.wpdataaccess.com/drives.html'; | |
| 374 | + break; | |
| 398 | 375 | case 'system': |
| 399 | - $help_url = $help_root . 'plugin-settings/system-info/'; | |
| 376 | + $help_url = 'https://docs.settings.wpdataaccess.com/system-info.html'; | |
| 400 | 377 | break; |
| 401 | - default: | |
| 402 | - $help_url = $help_root . 'plugin-settings/getting-started/'; | |
| 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; | |
| 403 | 406 | } |
| 404 | 407 | break; |
| 405 | - default: | |
| 406 | - $help_url = $help_root . 'tool-guide/wp-data-access-getting-started/'; | |
| 407 | 408 | } |
| 408 | - } else { | |
| 409 | - $help_url = $help_root . 'tool-guide/wp-data-access-getting-started/'; | |
| 410 | 409 | } |
| 411 | 410 | return $help_url; |
| 412 | 411 | } |
| 413 | 412 | |
| @@ -422,19 +421,16 @@ | ||
| 422 | 421 | <div class="wpda-dashboard"> |
| 423 | 422 | <div class="wpda-dashboard-group wpda-dashboard-group-administration"> |
| 424 | 423 | <div class="icons"> |
| 425 | 424 | <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php |
| 426 | - echo admin_url( 'admin.php' ); | |
| 427 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 425 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 428 | 426 | ?>?page=wpda_navi" title="Quick links and frequently asked questions"> |
| 429 | 427 | <div class="fa-solid fa-house"></div> |
| 430 | 428 | <div class="label">Tool Guide</div> |
| 431 | 429 | </a> |
| 432 | 430 | <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php |
| 433 | - echo admin_url( 'admin.php' ); | |
| 434 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 435 | - ?>?page=wpda_apps" title="Build data-driven Apps with the new | |
| 436 | -Table Builder, Form Builder and Chart Builder"> | |
| 431 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 432 | + ?>?page=wpda_apps" title="Data-driven Rapid Application Development"> | |
| 437 | 433 | <div class="fa-solid"> |
| 438 | 434 | <svg xmlns="http://www.w3.org/2000/svg" height="26px" width="26px" viewBox="4 4 16 16" fill="inherit"> |
| 439 | 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"/> |
| 440 | 436 | </svg> |
| @@ -441,19 +437,15 @@ | ||
| 441 | 437 | </div> |
| 442 | 438 | <div class="label">App Builder</div> |
| 443 | 439 | </a> |
| 444 | 440 | <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php |
| 445 | - echo admin_url( 'admin.php' ); | |
| 446 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 447 | - ?>?page=wpda" title="Data Explorer | |
| 448 | - | |
| 449 | -Manage local and remote data and databases"> | |
| 441 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 442 | + ?>?page=wpda" title="Manage local and remote data and databases"> | |
| 450 | 443 | <div class="fa-solid fa-database"></div> |
| 451 | 444 | <div class="label">Explorer</div> |
| 452 | 445 | </a> |
| 453 | 446 | <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php |
| 454 | - echo admin_url( 'admin.php' ); | |
| 455 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 447 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 456 | 448 | ?>?page=wpda_query_builder" title="SQL Query Builder"> |
| 457 | 449 | <div class="fa-solid fa-code"></div> |
| 458 | 450 | <div class="label">SQL</div> |
| 459 | 451 | </a> |
| @@ -469,10 +461,9 @@ | ||
| 469 | 461 | > |
| 470 | 462 | <div class="icons"> |
| 471 | 463 | <a class="wpda-dashboard-item wpda_tooltip_icons" |
| 472 | 464 | href="<?php |
| 473 | - echo admin_url( 'admin.php' ); | |
| 474 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 465 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 475 | 466 | ?>?page=wpda_publisher" |
| 476 | 467 | title="OLD Table Builder |
| 477 | 468 | |
| 478 | 469 | Use App Builder to access the NEW Table Builder |
| @@ -487,10 +478,9 @@ | ||
| 487 | 478 | <div class="label">Tables</div> |
| 488 | 479 | </a> |
| 489 | 480 | <a class="wpda-dashboard-item wpda_tooltip_icons" |
| 490 | 481 | href="<?php |
| 491 | - echo admin_url( 'admin.php' ); | |
| 492 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 482 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 493 | 483 | ?>?page=wpda_wpdp" |
| 494 | 484 | title="OLD Form Builder |
| 495 | 485 | |
| 496 | 486 | Use App Builder to access the NEW Form Builder |
| @@ -505,10 +495,9 @@ | ||
| 505 | 495 | <div class="label">Forms</div> |
| 506 | 496 | </a> |
| 507 | 497 | <a class="wpda-dashboard-item wpda_tooltip_icons" |
| 508 | 498 | href="<?php |
| 509 | - echo admin_url( 'admin.php' ); | |
| 510 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 499 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 511 | 500 | ?>?page=wpda_templates" |
| 512 | 501 | title="OLD Form Templates |
| 513 | 502 | |
| 514 | 503 | Customize forms using templates" |
| @@ -522,10 +511,9 @@ | ||
| 522 | 511 | <div class="label">Templates</div> |
| 523 | 512 | </a> |
| 524 | 513 | <a class="wpda-dashboard-item wpda_tooltip_icons" |
| 525 | 514 | href="<?php |
| 526 | - echo admin_url( 'admin.php' ); | |
| 527 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 515 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 528 | 516 | ?>?page=wpda_designer" |
| 529 | 517 | title="Create database tables and indexes" |
| 530 | 518 | <?php |
| 531 | 519 | if ( !$this->option_legacy_tools['designer'][0] ) { |
| @@ -543,10 +531,9 @@ | ||
| 543 | 531 | </div> |
| 544 | 532 | <div class="wpda-dashboard-group wpda-dashboard-group-settings"> |
| 545 | 533 | <div class="icons"> |
| 546 | 534 | <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php |
| 547 | - echo admin_url( 'options-general.php' ); | |
| 548 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 535 | + echo esc_url( admin_url( 'options-general.php' ) ); | |
| 549 | 536 | ?>?page=wpdataaccess" title="Manage plugin user interface and behavior"> |
| 550 | 537 | <div class="fa-solid fa-cog"></div> |
| 551 | 538 | <div class="label">Settings</div> |
| 552 | 539 | </a> |
| @@ -553,10 +540,9 @@ | ||
| 553 | 540 | <?php |
| 554 | 541 | if ( wpda_freemius()->is_registered() ) { |
| 555 | 542 | ?> |
| 556 | 543 | <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php |
| 557 | - echo admin_url( 'admin.php' ); | |
| 558 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 544 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 559 | 545 | ?>?page=<?php |
| 560 | 546 | echo esc_attr( WP_Data_Access_Admin::MAIN_PAGE_SLUG ); |
| 561 | 547 | ?>-account" title="Manage your WP Data Access account"> |
| 562 | 548 | <div class="fa-solid fa-user"></div> |
| @@ -569,10 +555,9 @@ | ||
| 569 | 555 | <div class="fa-solid fa-hand-holding-usd"></div> |
| 570 | 556 | <div class="label">Pricing</div> |
| 571 | 557 | </a> |
| 572 | 558 | <a class="wpda-dashboard-item wpda_tooltip_icons" href="<?php |
| 573 | - echo admin_url( 'admin.php' ); | |
| 574 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 559 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 575 | 560 | ?>?page=<?php |
| 576 | 561 | echo esc_attr( WP_Data_Access_Admin::MAIN_PAGE_SLUG ); |
| 577 | 562 | ?>-pricing" title="Upgrade your WP Data Access account"> |
| 578 | 563 | <div class="fa-solid fa-gem"></div> |
| @@ -577,17 +562,26 @@ | ||
| 577 | 562 | ?>-pricing" title="Upgrade your WP Data Access account"> |
| 578 | 563 | <div class="fa-solid fa-gem"></div> |
| 579 | 564 | <div class="label">Upgrade</div> |
| 580 | 565 | </a> |
| 581 | - </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> | |
| 582 | 577 | <div class="subject">Plugin & User Management</div> |
| 583 | 578 | </div> |
| 584 | 579 | <div class="wpda-dashboard-group wpda-dashboard-group-support"> |
| 585 | 580 | <div class="icons"> |
| 586 | 581 | <a class="wpda-dashboard-item wpda_tooltip_icons" target="_blank" href="<?php |
| 587 | - echo $this->get_help_url(); | |
| 588 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 589 | - ?>" title="Online help and documentation"> | |
| 582 | + echo esc_url( $this->get_help_url() ); | |
| 583 | + ?>" title="Context sensitive help"> | |
| 590 | 584 | <div class="fa-solid fa-question-circle"></div> |
| 591 | 585 | <div class="label">Docs</div> |
| 592 | 586 | </a> |
| 593 | 587 | <a class="wpda-dashboard-item wpda_tooltip_icons" target="_blank" href="https://wordpress.org/support/plugin/wp-data-access/" title="Public support forum"> |
| @@ -618,22 +612,18 @@ | ||
| 618 | 612 | <div class="wpda_nav_title">WP Data Access</div> |
| 619 | 613 | </div> |
| 620 | 614 | <ul> |
| 621 | 615 | <li class="menu-item"><a href="<?php |
| 622 | - echo admin_url( 'admin.php' ); | |
| 623 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 616 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 624 | 617 | ?>?page=wpda"><i class="fas fa-database"></i> Explorer</a></li> |
| 625 | 618 | <li class="menu-item"><a href="<?php |
| 626 | - echo admin_url( 'admin.php' ); | |
| 627 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 619 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 628 | 620 | ?>?page=wpda_query_builder"><i class="fas fa-code"></i> SQL</a></li> |
| 629 | 621 | <li class="menu-item wpda-separator"><a href="<?php |
| 630 | - echo admin_url( 'admin.php' ); | |
| 631 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 622 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 632 | 623 | ?>?page=wpda_designer"><i class="fas fa-drafting-compass"></i> Designer</a></li> |
| 633 | 624 | <li class="menu-item wpda-separator"><a href="<?php |
| 634 | - echo admin_url( 'admin.php' ); | |
| 635 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 625 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 636 | 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"> |
| 637 | 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"/> |
| 638 | 628 | </svg></span> Apps</a></li> |
| 639 | 629 | <?php |
| @@ -640,31 +630,26 @@ | ||
| 640 | 630 | ?> |
| 641 | 631 | <li class="menu-item <?php |
| 642 | 632 | echo esc_attr( $premium_separator ); |
| 643 | 633 | ?>"><a href="<?php |
| 644 | - echo admin_url( 'admin.php' ); | |
| 645 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 634 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 646 | 635 | ?>?page=wpda_publisher"><i class="fas fa-address-card"></i> Tables</a></li> |
| 647 | 636 | <?php |
| 648 | 637 | ?> |
| 649 | 638 | <li class="menu-item"><a href="<?php |
| 650 | - echo admin_url( 'admin.php' ); | |
| 651 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 639 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 652 | 640 | ?>?page=wpda_wpdp"><i class="fas fa-magic"></i> Forms</a></li> |
| 653 | 641 | <li class="menu-item wpda-separator"><a href="<?php |
| 654 | - echo admin_url( 'admin.php' ); | |
| 655 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 642 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 656 | 643 | ?>?page=wpda_templates"><i class="fas fa-desktop"></i> Templates</a></li> |
| 657 | 644 | <li class="menu-item"><a href="<?php |
| 658 | - echo admin_url( 'options-general.php' ); | |
| 659 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 645 | + echo esc_url( admin_url( 'options-general.php' ) ); | |
| 660 | 646 | ?>?page=wpdataaccess"><i class="fas fa-cog"></i> Settings</a></li> |
| 661 | 647 | <?php |
| 662 | 648 | if ( wpda_freemius()->is_registered() ) { |
| 663 | 649 | ?> |
| 664 | 650 | <li class="menu-item"><a href="<?php |
| 665 | - echo admin_url( 'admin.php' ); | |
| 666 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 651 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 667 | 652 | ?>?page=<?php |
| 668 | 653 | echo esc_attr( WP_Data_Access_Admin::MAIN_PAGE_SLUG ); |
| 669 | 654 | ?>-account"><i class="fas fa-user"></i> Account</a></li> |
| 670 | 655 | <?php |
| @@ -688,10 +673,9 @@ | ||
| 688 | 673 | <?php |
| 689 | 674 | if ( $menufound ) { |
| 690 | 675 | ?> |
| 691 | 676 | <li class="menu-item wpda-separator"><a href="<?php |
| 692 | - echo admin_url( 'admin.php' ); | |
| 693 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 677 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 694 | 678 | ?>?page=<?php |
| 695 | 679 | echo esc_attr( WP_Data_Access_Admin::MAIN_PAGE_SLUG ); |
| 696 | 680 | ?>-pricing"><i class="fas fa-gem"></i> Upgrade</a></li> |
| 697 | 681 | <?php |
| @@ -696,9 +680,9 @@ | ||
| 696 | 680 | ?>-pricing"><i class="fas fa-gem"></i> Upgrade</a></li> |
| 697 | 681 | <?php |
| 698 | 682 | } |
| 699 | 683 | ?> |
| 700 | - <li class="menu-item"><a target="_blank" href="https://wpdataaccess.com/docs/tool-guide/wp-data-access-getting-started/"><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> | |
| 701 | 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> |
| 702 | 686 | <?php |
| 703 | 687 | ?> |
| 704 | 688 | </ul> |
| @@ -810,9 +794,9 @@ | ||
| 810 | 794 | Update to premium to analyse, report and share your data. |
| 811 | 795 | </td> |
| 812 | 796 | <td style="white-space:nowrap"> |
| 813 | 797 | <a href="https://wpdataaccess.com/pricing/" target="_blank" class="button button-primary">UPGRADE TO PREMIUM</a> |
| 814 | - <a href="https://wpdataaccess.com/docs/dashboards-and-widgets/bi-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> | |
| 815 | 799 | </td> |
| 816 | 800 | </tr> |
| 817 | 801 | </table> |
| 818 | 802 | </div> |
| @@ -889,9 +873,8 @@ | ||
| 889 | 873 | * @return void |
| 890 | 874 | */ |
| 891 | 875 | protected function toolbar_wpda() { |
| 892 | 876 | $schema_name = ( isset( $_REQUEST['wpdaschema_name'] ) ? esc_attr( sanitize_text_field( wp_unslash( $_REQUEST['wpdaschema_name'] ) ) ) : '' ); |
| 893 | - // phpcs:ignore WordPress.Security.NonceVerification | |
| 894 | 877 | ?> |
| 895 | 878 | <form id="wpda_new_design" style="display: none" method="post" action="?page=<?php |
| 896 | 879 | echo esc_attr( WP_Data_Access_Admin::PAGE_DESIGNER ); |
| 897 | 880 | ?>"> |
| @@ -896,8 +879,11 @@ | ||
| 896 | 879 | echo esc_attr( WP_Data_Access_Admin::PAGE_DESIGNER ); |
| 897 | 880 | ?>"> |
| 898 | 881 | <input type="hidden" name="action" value="create_table"> |
| 899 | 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 | + ?>"> | |
| 900 | 886 | </form> |
| 901 | 887 | <form id="wpda_goto_backup" style="display: none" method="post" action="?page=<?php |
| 902 | 888 | echo esc_attr( WP_Data_Access_Admin::PAGE_MAIN ); |
| 903 | 889 | ?>&page_action=wpda_backup"> |
| @@ -909,10 +895,9 @@ | ||
| 909 | 895 | <div class="wpda-nowrap"> |
| 910 | 896 | <div> |
| 911 | 897 | <div> |
| 912 | 898 | <a href="<?php |
| 913 | - echo admin_url( 'admin.php' ); | |
| 914 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 899 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 915 | 900 | ?>?page=<?php |
| 916 | 901 | echo esc_attr( WP_Data_Access_Admin::PAGE_MAIN ); |
| 917 | 902 | ?>&page_action=wpda_global_search" |
| 918 | 903 | class="wpda-dashboard-item wpda_tooltip" |
| @@ -935,41 +920,21 @@ | ||
| 935 | 920 | </a> |
| 936 | 921 | </div> |
| 937 | 922 | </div><div> |
| 938 | 923 | <div> |
| 939 | - <?php | |
| 940 | - if ( 'new' !== $this->current_version ) { | |
| 941 | - ?> | |
| 942 | - <a onclick="jQuery('#upload_file_container_multi').show();" | |
| 943 | - href="javascript:void(0)" | |
| 944 | - class="wpda-dashboard-item wpda_tooltip" | |
| 945 | - title="Import and execute SQL script files" | |
| 946 | - > | |
| 947 | - <i class="fas fa-file-code"></i> | |
| 948 | - <div> | |
| 949 | - Import SQL files | |
| 950 | - </div> | |
| 951 | - </a> | |
| 952 | - <?php | |
| 953 | - } else { | |
| 954 | - ?> | |
| 955 | - <a onClick="window.ppActionEnableImport();" | |
| 956 | - href="javascript:void(0)" | |
| 957 | - class="wpda-dashboard-item wpda_tooltip" | |
| 958 | - title="Import and execute SQL script files" | |
| 959 | - > | |
| 960 | - <i class="fas fa-file-code"></i> | |
| 961 | - <div> | |
| 962 | - Import SQL files | |
| 963 | - </div> | |
| 964 | - </a> | |
| 965 | - <?php | |
| 966 | - } | |
| 967 | - ?> | |
| 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> | |
| 968 | 934 | </div><div> |
| 969 | 935 | <a href="<?php |
| 970 | - echo admin_url( 'admin.php' ); | |
| 971 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 936 | + echo esc_url( admin_url( 'admin.php' ) ); | |
| 972 | 937 | ?>?page=<?php |
| 973 | 938 | echo esc_attr( WP_Data_Access_Admin::PAGE_MAIN ); |
| 974 | 939 | ?>&page_action=wpda_import_csv" |
| 975 | 940 | class="wpda-dashboard-item wpda_tooltip" |
| @@ -980,96 +945,53 @@ | ||
| 980 | 945 | Import CSV files |
| 981 | 946 | </div> |
| 982 | 947 | </a> |
| 983 | 948 | </div><div> |
| 984 | - <a href="javascript:void(0)" | |
| 985 | - id="wpda_toolbar_icon_go_backup" | |
| 986 | - class="wpda-dashboard-item wpda_tooltip" | |
| 987 | - title="Data Backup - unattended exports" | |
| 988 | - > | |
| 989 | - <i class="fas fa-file-archive"></i> | |
| 990 | - <div> | |
| 991 | - Data Backup | |
| 992 | - </div> | |
| 993 | - </a> | |
| 994 | - </div> | |
| 995 | - </div><div> | |
| 996 | - <?php | |
| 997 | - if ( 'new' !== $this->current_version ) { | |
| 998 | - ?> | |
| 999 | - <div> | |
| 1000 | - <a onclick="jQuery('#wpda_db_container').show(); jQuery('#local_database').focus();" | |
| 1001 | - href="javascript:void(0)" | |
| 1002 | - class="wpda-dashboard-item wpda_tooltip" | |
| 1003 | - title="Add remote database or create local database" | |
| 1004 | - > | |
| 1005 | - <i id="wpda_toolbar_icon_add_database" class="fas fa-database"></i> | |
| 1006 | - <div> | |
| 1007 | - Add database | |
| 1008 | - </div> | |
| 1009 | - </a> | |
| 1010 | - </div> | |
| 1011 | - <?php | |
| 1012 | - } else { | |
| 1013 | - ?> | |
| 1014 | - <div> | |
| 1015 | - <a onclick="jQuery('#wpda_manage_databases').show(); jQuery('#local_database').focus();" | |
| 1016 | - href="javascript:void(0)" | |
| 1017 | - class="wpda-dashboard-item wpda_tooltip" | |
| 1018 | - title="Manage remote database connections and local databases" | |
| 1019 | - > | |
| 1020 | - <i id="wpda_toolbar_icon_add_database" class="fas fa-server"></i> | |
| 1021 | - <div> | |
| 1022 | - Databases | |
| 1023 | - </div> | |
| 1024 | - </a> | |
| 1025 | - </div><?php | |
| 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 | |
| 1026 | 975 | } |
| 1027 | 976 | ?> |
| 1028 | - <?php | |
| 977 | + </div><div> | |
| 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 | |
| 1029 | 990 | ?> |
| 1030 | 991 | </div> |
| 1031 | 992 | </div> |
| 1032 | - <div class="wpda-promotion" style="font-size: 16px"> | |
| 1033 | - <?php | |
| 1034 | - if ( 'new' !== $this->current_version ) { | |
| 1035 | - ?> | |
| 1036 | - <a href="?page=<?php | |
| 1037 | - echo esc_attr( WP_Data_Access_Admin::PAGE_MAIN ); | |
| 1038 | - ?>&de=new" | |
| 1039 | - style="display: flex; align-items: center; gap: 5px;" | |
| 1040 | - > | |
| 1041 | - <i class="fas fa-toggle-off"></i> | |
| 1042 | - <span>Switch to new Data Explorer</span> | |
| 1043 | - </a> | |
| 1044 | - <?php | |
| 1045 | - } else { | |
| 1046 | - ?> | |
| 1047 | - <span | |
| 1048 | - style="display: flex; align-items: center; gap: 5px; white-space: nowrap;" | |
| 1049 | - > | |
| 1050 | - <a href="?page=<?php | |
| 1051 | - echo esc_attr( WP_Data_Access_Admin::PAGE_MAIN ); | |
| 1052 | - ?>&de=old" | |
| 1053 | - style="display: flex; align-items: center; gap: 5px; white-space: nowrap;" | |
| 1054 | - > | |
| 1055 | - <i class="fas fa-toggle-on"></i> | |
| 1056 | - <span>Switch to old Data Explorer</span> | |
| 1057 | - </a> | |
| 1058 | - <span> | |
| 1059 | - <a href="https://wpdataaccess.com/2024/01/26/the-new-data-explorer-wp-data-access-5-4-0/" | |
| 1060 | - target="_blank" | |
| 1061 | - class="wpda_tooltip" | |
| 1062 | - title="Click to read more" | |
| 1063 | - > | |
| 1064 | - <i class="fas fa-circle-info"></i> | |
| 1065 | - </a> | |
| 1066 | - </span> | |
| 1067 | - </span> | |
| 1068 | - <?php | |
| 1069 | - } | |
| 1070 | - ?> | |
| 1071 | - </div> | |
| 993 | + <div></div> | |
| 1072 | 994 | <?php |
| 1073 | 995 | //$this->get_promotions('wpda'); |
| 1074 | 996 | ?> |
| 1075 | 997 | </div> |
| @@ -1076,111 +998,8 @@ | ||
| 1076 | 998 | <?php |
| 1077 | 999 | } |
| 1078 | 1000 | |
| 1079 | 1001 | /** |
| 1080 | - * Data Explorer table page toolbar | |
| 1081 | - * | |
| 1082 | - * @return void | |
| 1083 | - */ | |
| 1084 | - protected function toolbar_wpda_table() { | |
| 1085 | - ?> | |
| 1086 | - <form id="wpda_new_row" style="display: none" method="post" action="?page=<?php | |
| 1087 | - echo esc_attr( WP_Data_Access_Admin::PAGE_MAIN ); | |
| 1088 | - ?>"> | |
| 1089 | - <?php | |
| 1090 | - if ( isset( $_REQUEST['wpdaschema_name'] ) ) { | |
| 1091 | - // phpcs:ignore WordPress.Security.NonceVerification | |
| 1092 | - $schema_name = esc_attr( sanitize_text_field( wp_unslash( $_REQUEST['wpdaschema_name'] ) ) ); | |
| 1093 | - // phpcs:ignore WordPress.Security.NonceVerification | |
| 1094 | - echo "<input type='hidden' name='wpdaschema_name' value='{$schema_name}'>"; | |
| 1095 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 1096 | - } | |
| 1097 | - ?> | |
| 1098 | - <input type="hidden" id="wpda_new_row_table_name" name="table_name" value=""> | |
| 1099 | - <input type="hidden" name="action" value="new"> | |
| 1100 | - </form> | |
| 1101 | - <div id="wpda-dashboard-toolbar" class="wpda-dashboard-toolbar" style="display:none"> | |
| 1102 | - <div class="wpda-nowrap"> | |
| 1103 | - <div> | |
| 1104 | - <div> | |
| 1105 | - <a href="javascript:void(0)" | |
| 1106 | - id="wpda_toolbar_icon_add_row" | |
| 1107 | - class="wpda-dashboard-item wpda_tooltip" | |
| 1108 | - title="Add new row to table" | |
| 1109 | - > | |
| 1110 | - <i class="fas fa-plus-circle"></i> | |
| 1111 | - <div> | |
| 1112 | - Add row | |
| 1113 | - </div> | |
| 1114 | - </a> | |
| 1115 | - </div><div> | |
| 1116 | - <a onclick="jQuery('#upload_file_container').show()" | |
| 1117 | - href="javascript:void(0)" | |
| 1118 | - class="wpda-dashboard-item wpda_tooltip" | |
| 1119 | - title="Allows only imports into table authors" | |
| 1120 | - > | |
| 1121 | - <i class="fas fa-code"></i> | |
| 1122 | - <div> | |
| 1123 | - Import rows | |
| 1124 | - </div> | |
| 1125 | - </a> | |
| 1126 | - </div> | |
| 1127 | - </div> | |
| 1128 | - </div> | |
| 1129 | - <?php | |
| 1130 | - $this->get_promotions( 'table' ); | |
| 1131 | - ?> | |
| 1132 | - </div> | |
| 1133 | - <?php | |
| 1134 | - } | |
| 1135 | - | |
| 1136 | - /** | |
| 1137 | - * Data Explorer data entry form toolbar | |
| 1138 | - * | |
| 1139 | - * @return void | |
| 1140 | - */ | |
| 1141 | - protected function toolbar_wpda_row() { | |
| 1142 | - ?> | |
| 1143 | - <form id="wpda_new_row" style="display: none" method="post" action="?page=<?php | |
| 1144 | - echo esc_attr( WP_Data_Access_Admin::PAGE_MAIN ); | |
| 1145 | - ?>"> | |
| 1146 | - <?php | |
| 1147 | - if ( isset( $_REQUEST['wpdaschema_name'] ) ) { | |
| 1148 | - // phpcs:ignore WordPress.Security.NonceVerification | |
| 1149 | - $schema_name = esc_attr( sanitize_text_field( wp_unslash( $_REQUEST['wpdaschema_name'] ) ) ); | |
| 1150 | - // phpcs:ignore WordPress.Security.NonceVerification | |
| 1151 | - echo "<input type='hidden' name='wpdaschema_name' value='{$schema_name}'>"; | |
| 1152 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 1153 | - } | |
| 1154 | - ?> | |
| 1155 | - <input type="hidden" id="wpda_new_row_table_name" name="table_name" value=""> | |
| 1156 | - <input type="hidden" name="action" value="new"> | |
| 1157 | - </form> | |
| 1158 | - <div id="wpda-dashboard-toolbar" class="wpda-dashboard-toolbar" style="display:none"> | |
| 1159 | - <div class="wpda-nowrap"> | |
| 1160 | - <div> | |
| 1161 | - <div> | |
| 1162 | - <a href="javascript:void(0)" | |
| 1163 | - id="wpda_toolbar_icon_add_row" | |
| 1164 | - class="wpda-dashboard-item wpda_tooltip" | |
| 1165 | - title="Add new row to table" | |
| 1166 | - > | |
| 1167 | - <i class="fas fa-plus-circle"></i> | |
| 1168 | - <div> | |
| 1169 | - Add row | |
| 1170 | - </div> | |
| 1171 | - </a> | |
| 1172 | - </div> | |
| 1173 | - </div> | |
| 1174 | - </div> | |
| 1175 | - <?php | |
| 1176 | - $this->get_promotions( 'row' ); | |
| 1177 | - ?> | |
| 1178 | - </div> | |
| 1179 | - <?php | |
| 1180 | - } | |
| 1181 | - | |
| 1182 | - /** | |
| 1183 | 1002 | * Data Backup toolbar |
| 1184 | 1003 | * |
| 1185 | 1004 | * @return void |
| 1186 | 1005 | */ |
| @@ -1259,8 +1078,9 @@ | ||
| 1259 | 1078 | * |
| 1260 | 1079 | * @return void |
| 1261 | 1080 | */ |
| 1262 | 1081 | protected function toolbar_apps() { |
| 1082 | + $has_apps = WPDA_App_Model::has_any(); | |
| 1263 | 1083 | ?> |
| 1264 | 1084 | <div id="wpda-dashboard-toolbar" class="wpda-dashboard-toolbar" style="display:none"> |
| 1265 | 1085 | <div class="wpda-nowrap"> |
| 1266 | 1086 | <div> |
| @@ -1270,9 +1090,9 @@ | ||
| 1270 | 1090 | title="Create new app" |
| 1271 | 1091 | > |
| 1272 | 1092 | <i class="fas fa-plus-circle"></i> |
| 1273 | 1093 | <div> |
| 1274 | - Create new app | |
| 1094 | + Create New App | |
| 1275 | 1095 | </div> |
| 1276 | 1096 | </a> |
| 1277 | 1097 | </div><div> |
| 1278 | 1098 | <a href="javascript:window.ppActionRenameDatabase()" |
| @@ -1290,14 +1110,32 @@ | ||
| 1290 | 1110 | <div> |
| 1291 | 1111 | Rename Database |
| 1292 | 1112 | </div> |
| 1293 | 1113 | </a> |
| 1294 | - </div> | |
| 1114 | + </div><?php | |
| 1115 | + ?> | |
| 1295 | 1116 | </div> |
| 1296 | 1117 | </div> |
| 1297 | - <div class="wpda-promotion" style="font-size: 16px"> | |
| 1298 | - <span> | |
| 1299 | - <a href="https://wpdataaccess.com/docs/app-builder/whats-the-app-builder/" | |
| 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/" | |
| 1300 | 1138 | target="_blank" |
| 1301 | 1139 | class="wpda_tooltip" |
| 1302 | 1140 | title="Online App Builder documentation" |
| 1303 | 1141 | > |
| @@ -1312,48 +1150,8 @@ | ||
| 1312 | 1150 | <?php |
| 1313 | 1151 | } |
| 1314 | 1152 | |
| 1315 | 1153 | /** |
| 1316 | - * Query Builder toolbar | |
| 1317 | - * | |
| 1318 | - * @return void | |
| 1319 | - */ | |
| 1320 | - protected function toolbar_sql() { | |
| 1321 | - ?> | |
| 1322 | - <div id="wpda-dashboard-toolbar" class="wpda-dashboard-toolbar" style="display:none"> | |
| 1323 | - <div class="wpda-nowrap"> | |
| 1324 | - <div> | |
| 1325 | - <div> | |
| 1326 | - <a href="javascript:tabNew()" | |
| 1327 | - class="wpda-dashboard-item wpda_tooltip" | |
| 1328 | - title="Create new query" | |
| 1329 | - > | |
| 1330 | - <i class="fas fa-plus-circle"></i> | |
| 1331 | - <div> | |
| 1332 | - Create new query | |
| 1333 | - </div> | |
| 1334 | - </a> | |
| 1335 | - </div><div> | |
| 1336 | - <a href="javascript:openQuery()" | |
| 1337 | - class="wpda-dashboard-item wpda_tooltip" | |
| 1338 | - title="Open existing query" | |
| 1339 | - > | |
| 1340 | - <i class="fas fa-folder-open"></i> | |
| 1341 | - <div> | |
| 1342 | - Open existing query | |
| 1343 | - </div> | |
| 1344 | - </a> | |
| 1345 | - </div> | |
| 1346 | - </div> | |
| 1347 | - </div> | |
| 1348 | - <?php | |
| 1349 | - $this->get_promotions( 'sql' ); | |
| 1350 | - ?> | |
| 1351 | - </div> | |
| 1352 | - <?php | |
| 1353 | - } | |
| 1354 | - | |
| 1355 | - /** | |
| 1356 | 1154 | * Data Designer toolbar |
| 1357 | 1155 | * |
| 1358 | 1156 | * @return void |
| 1359 | 1157 | */ |
| @@ -1365,8 +1163,11 @@ | ||
| 1365 | 1163 | <input type="hidden" name="action" value="edit"> |
| 1366 | 1164 | <input type="hidden" name="table_name" value="<?php |
| 1367 | 1165 | echo esc_attr( WPDA_Design_Table_Model::get_base_table_name() ); |
| 1368 | 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 | + ?>"> | |
| 1369 | 1170 | </form> |
| 1370 | 1171 | <div id="wpda-dashboard-toolbar" class="wpda-dashboard-toolbar" style="display:none"> |
| 1371 | 1172 | <div class="wpda-nowrap"> |
| 1372 | 1173 | <div> |
| @@ -1380,9 +1181,9 @@ | ||
| 1380 | 1181 | Create table design |
| 1381 | 1182 | </div> |
| 1382 | 1183 | </a> |
| 1383 | 1184 | </div><div> |
| 1384 | - <a onclick="jQuery('#upload_file_container').show()" | |
| 1185 | + <a onclick="alert('This feature has been removed. Please use the Data Explorer import feature.')" | |
| 1385 | 1186 | href="javascript:void(0)" |
| 1386 | 1187 | class="wpda-dashboard-item wpda_tooltip" |
| 1387 | 1188 | title="Import table designs" |
| 1388 | 1189 | > |
| @@ -1428,9 +1229,9 @@ | ||
| 1428 | 1229 | Create data table |
| 1429 | 1230 | </div> |
| 1430 | 1231 | </a> |
| 1431 | 1232 | </div><div> |
| 1432 | - <a onclick="jQuery('#upload_file_container').show()" | |
| 1233 | + <a onclick="alert('This feature has been removed. Please use the Data Explorer import feature.')" | |
| 1433 | 1234 | href="javascript:void(0)" |
| 1434 | 1235 | class="wpda-dashboard-item wpda_tooltip" |
| 1435 | 1236 | title="Import data tables" |
| 1436 | 1237 | > |
| @@ -1487,9 +1288,9 @@ | ||
| 1487 | 1288 | Create project |
| 1488 | 1289 | </div> |
| 1489 | 1290 | </a> |
| 1490 | 1291 | </div><div> |
| 1491 | - <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()" | |
| 1492 | 1293 | href="javascript:void(0)" |
| 1493 | 1294 | class="wpda-dashboard-item wpda_tooltip" |
| 1494 | 1295 | title="Import projects" |
| 1495 | 1296 | > |
| @@ -1577,9 +1378,9 @@ | ||
| 1577 | 1378 | </select> |
| 1578 | 1379 | <?php |
| 1579 | 1380 | if ( !class_exists( 'Code_Manager\\Code_Manager_Model' ) || !class_exists( 'WPDataAccess\\Premium\\WPDAPRO_Dashboard\\WPDAPRO_Widget_Project' ) ) { |
| 1580 | 1381 | ?> |
| 1581 | - <a href="https://wpdataaccess.com/docs/dashboards-and-widgets/bi-getting-started/" target="_blank"> | |
| 1382 | + <a href="https://docs.legacy.wpdataaccess.com/docs/bi-getting-started/" target="_blank"> | |
| 1582 | 1383 | <i class="fas fa-question-circle pointer wpda_tooltip" |
| 1583 | 1384 | style="font-size: 170%; vertical-align: middle" |
| 1584 | 1385 | title="Your installation does not support all available widget types! Click to learn how to install more widget types..."></i> |
| 1585 | 1386 | </a> |
| @@ -1693,9 +1494,9 @@ | ||
| 1693 | 1494 | )</option> |
| 1694 | 1495 | <?php |
| 1695 | 1496 | $rdbs = WPDADB::get_remote_databases(); |
| 1696 | 1497 | ksort( $rdbs ); |
| 1697 | - //phpcs:ignore - 8.1 proof | |
| 1498 | + // phpcs:ignore -- 8.1 proof | |
| 1698 | 1499 | foreach ( $rdbs as $key => $rdb ) { |
| 1699 | 1500 | ?> |
| 1700 | 1501 | <option value="<?php |
| 1701 | 1502 | echo esc_attr( $key ); |
| @@ -1877,9 +1678,9 @@ | ||
| 1877 | 1678 | // Following line requires PHP 7. |
| 1878 | 1679 | // $last_key = array_key_last($this->dashboard_positions[0]); . |
| 1879 | 1680 | $last_key = 1; |
| 1880 | 1681 | if ( is_array( $this->dashboard_positions ) && count( $this->dashboard_positions ) > 0 ) { |
| 1881 | - //phpcs:ignore - 8.1 proof | |
| 1682 | + // phpcs:ignore -- 8.1 proof | |
| 1882 | 1683 | foreach ( $this->dashboard_positions[0] as $key => $val ) { |
| 1883 | 1684 | $last_key = $key; |
| 1884 | 1685 | } |
| 1885 | 1686 | } |
| @@ -1970,14 +1771,14 @@ | ||
| 1970 | 1771 | let wpda_wpnonce_refresh = "<?php |
| 1971 | 1772 | echo esc_attr( wp_create_nonce( WPDA_Widget::WIDGET_REFRESH . WPDA::get_current_user_login() ) ); |
| 1972 | 1773 | ?>"; |
| 1973 | 1774 | let wpda_ajaxurl = "<?php |
| 1974 | - echo admin_url( 'admin-ajax.php' ); | |
| 1975 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 1775 | + echo esc_url( admin_url( 'admin-ajax.php' ) ); | |
| 1976 | 1776 | ?>"; |
| 1977 | 1777 | let wpda_databases = '<?php |
| 1778 | + // phpcs:disable WordPress.Security.EscapeOutput | |
| 1978 | 1779 | echo $this->get_databases(); |
| 1979 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 1780 | + // phpcs:enable WordPress.Security.EscapeOutput | |
| 1980 | 1781 | ?>'; |
| 1981 | 1782 | let wpda_shared_dashboards = <?php |
| 1982 | 1783 | echo json_encode( $this->shared_dashboards ); |
| 1983 | 1784 | // phpcs:ignore |
| @@ -2025,21 +1826,20 @@ | ||
| 2025 | 1826 | public static function save() { |
| 2026 | 1827 | $wp_nonce = ( isset( $_POST['wp_nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['wp_nonce'] ) ) : '' ); |
| 2027 | 1828 | if ( !wp_verify_nonce( $wp_nonce, static::DASHBOARD_SAVE . WPDA::get_current_user_login() ) ) { |
| 2028 | 1829 | WPDA::sent_header( 'application/json' ); |
| 2029 | - echo static::msg( 'ERROR', 'Token expired, please refresh page' ); | |
| 2030 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 1830 | + static::msg( 'ERROR', 'Token expired, please refresh page' ); | |
| 2031 | 1831 | wp_die(); |
| 2032 | 1832 | } |
| 1833 | + // phpcs:disable WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized | |
| 2033 | 1834 | $widgets = ( isset( $_POST['wpda_widgets'] ) ? WPDA::sanitize_text_field_array( $_POST['wpda_widgets'] ) : array() ); |
| 2034 | - // phpcs:ignore WordPress.Security.ValidatedSanitizedInput | |
| 1835 | + // phpcs:enable WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized | |
| 2035 | 1836 | $save = array(); |
| 2036 | 1837 | foreach ( $widgets as $widget ) { |
| 2037 | 1838 | $save[$widget['widgetName']] = $widget; |
| 2038 | 1839 | } |
| 2039 | 1840 | update_user_meta( WPDA::get_current_user_id(), self::USER_DASHBOARD, $save ); |
| 2040 | - echo self::msg( 'SUCCESS', 'Widget succesfully saved' ); | |
| 2041 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 1841 | + self::msg( 'SUCCESS', 'Widget succesfully saved' ); | |
| 2042 | 1842 | wp_die(); |
| 2043 | 1843 | } |
| 2044 | 1844 | |
| 2045 | 1845 | /** |
| @@ -2050,10 +1850,9 @@ | ||
| 2050 | 1850 | public static function get_list() { |
| 2051 | 1851 | $wp_nonce = ( isset( $_POST['wpda_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_POST['wpda_wpnonce'] ) ) : '' ); |
| 2052 | 1852 | if ( !wp_verify_nonce( $wp_nonce, WPDA_Widget::WIDGET_REFRESH . WPDA::get_current_user_login() ) ) { |
| 2053 | 1853 | WPDA::sent_header( 'application/json' ); |
| 2054 | - echo static::msg( 'ERROR', 'Token expired, please refresh page' ); | |
| 2055 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 1854 | + static::msg( 'ERROR', 'Token expired, please refresh page' ); | |
| 2056 | 1855 | wp_die(); |
| 2057 | 1856 | } |
| 2058 | 1857 | // Placeholder: implemented in the premium version. |
| 2059 | 1858 | echo ''; |
| @@ -2068,10 +1867,9 @@ | ||
| 2068 | 1867 | public static function delete_widget() { |
| 2069 | 1868 | $wp_nonce = ( isset( $_POST['wpda_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_POST['wpda_wpnonce'] ) ) : '' ); |
| 2070 | 1869 | if ( !wp_verify_nonce( $wp_nonce, self::DASHBOARD_SAVE . WPDA::get_current_user_login() ) ) { |
| 2071 | 1870 | WPDA::sent_header( 'application/json' ); |
| 2072 | - echo static::msg( 'ERROR', 'Token expired, please refresh page' ); | |
| 2073 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 1871 | + static::msg( 'ERROR', 'Token expired, please refresh page' ); | |
| 2074 | 1872 | wp_die(); |
| 2075 | 1873 | } |
| 2076 | 1874 | // Placeholder: implemented in the premium version. |
| 2077 | 1875 | echo ''; |
| @@ -2086,10 +1884,9 @@ | ||
| 2086 | 1884 | public static function edit_chart() { |
| 2087 | 1885 | $wp_nonce = ( isset( $_POST['wpda_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_POST['wpda_wpnonce'] ) ) : '' ); |
| 2088 | 1886 | if ( !wp_verify_nonce( $wp_nonce, WPDA_Widget::WIDGET_REFRESH . WPDA::get_current_user_login() ) ) { |
| 2089 | 1887 | WPDA::sent_header( 'application/json' ); |
| 2090 | - echo static::msg( 'ERROR', 'Token expired, please refresh page' ); | |
| 2091 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 1888 | + static::msg( 'ERROR', 'Token expired, please refresh page' ); | |
| 2092 | 1889 | wp_die(); |
| 2093 | 1890 | } |
| 2094 | 1891 | // Placeholder: implemented in the premium version. |
| 2095 | 1892 | echo ''; |
| @@ -2104,10 +1901,9 @@ | ||
| 2104 | 1901 | public static function load_widget() { |
| 2105 | 1902 | $wp_nonce = ( isset( $_POST['wpda_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_POST['wpda_wpnonce'] ) ) : '' ); |
| 2106 | 1903 | if ( !wp_verify_nonce( $wp_nonce, WPDA_Widget::WIDGET_REFRESH . WPDA::get_current_user_login() ) ) { |
| 2107 | 1904 | WPDA::sent_header( 'application/json' ); |
| 2108 | - echo static::msg( 'ERROR', 'Token expired, please refresh page' ); | |
| 2109 | - // phpcs:ignore WordPress.Security.EscapeOutput | |
| 1905 | + static::msg( 'ERROR', 'Token expired, please refresh page' ); | |
| 2110 | 1906 | wp_die(); |
| 2111 | 1907 | } |
| 2112 | 1908 | // Placeholder: implemented in the premium version. |
| 2113 | 1909 | echo ''; |
| @@ -2150,13 +1946,13 @@ | ||
| 2150 | 1946 | * @return false|string |
| 2151 | 1947 | */ |
| 2152 | 1948 | public static function msg( $status, $msg ) { |
| 2153 | 1949 | $error = array( |
| 2154 | - 'status' => $status, | |
| 1950 | + 'status' => esc_attr( $status ), | |
| 2155 | 1951 | 'msg' => $msg, |
| 2156 | 1952 | ); |
| 2157 | - return json_encode( $error ); | |
| 2158 | - // phpcs:ignore | |
| 1953 | + echo json_encode( $error ); | |
| 1954 | + // phpcs:ignore WordPress.Security.EscapeOutput | |
| 2159 | 1955 | } |
| 2160 | 1956 | |
| 2161 | 1957 | private function get_promotions( $tool ) { |
| 2162 | 1958 | switch ( $tool ) { |
| @@ -2164,68 +1960,16 @@ | ||
| 2164 | 1960 | case 'projects': |
| 2165 | 1961 | case 'templates': |
| 2166 | 1962 | case 'charts': |
| 2167 | 1963 | $promotions = array(array( |
| 2168 | - 'This tool will transition to the new App Builder. Please migrate on time.' => array(null, 'fa-lightbulb'), | |
| 1964 | + 'This tool will be transitioned to the new App Builder. Please migrate on time.' => array(null, 'fa-lightbulb'), | |
| 2169 | 1965 | )); |
| 2170 | 1966 | break; |
| 2171 | - case 'csv': | |
| 2172 | - $promotions = array(array( | |
| 2173 | - 'Use the connection wizards for automated CSV synchronization.' => array('https://wpdataaccess.com/docs/remote-data-files/csv-files/', 'fa-lightbulb'), | |
| 2174 | - )); | |
| 2175 | - break; | |
| 2176 | - case 'publisher_OLD': | |
| 2177 | - $promotions = array( | |
| 2178 | - array( | |
| 2179 | - 'Change data table color, spacing, border radius and modal popup behaviour.' => array('https://wpdataaccess.com/data-tables-styling/premium-styling/', 'fa-palette'), | |
| 2180 | - ), | |
| 2181 | - array( | |
| 2182 | - 'Reorder data table elements with drag and drop.' => array('https://wpdataaccess.com/docs/data-tables/extension-manager/', 'fa-star'), | |
| 2183 | - ), | |
| 2184 | - array( | |
| 2185 | - 'Add buttons to support CSV, Excel, PDF and SQL downloads.' => array('https://wpdataaccess.com/docs/data-tables/extension-manager/', 'fa-cloud-download'), | |
| 2186 | - ), | |
| 2187 | - array( | |
| 2188 | - 'Add user friendly Search Panes to simplify searching.' => array('https://wpdataaccess.com/docs/data-tables-interactive-filters/search-panes/', 'fa-magic'), | |
| 2189 | - ), | |
| 2190 | - array( | |
| 2191 | - 'Use the Search Builder to add interactive searching.' => array('https://wpdataaccess.com/docs/data-tables-interactive-filters/search-builder/', 'fa-search'), | |
| 2192 | - ), | |
| 2193 | - array( | |
| 2194 | - 'Synchronize your Google Sheets from the Data Explorer.' => array('https://wpdataaccess.com/docs/remote-data-files/public-url/#google-sheets', 'fa-database'), | |
| 2195 | - ) | |
| 2196 | - ); | |
| 2197 | - break; | |
| 2198 | - case 'wpda': | |
| 2199 | - $promotions = array( | |
| 2200 | - array( | |
| 2201 | - 'Access your SQL Server tables from the Data Explorer.' => array('https://wpdataaccess.com/docs/remote-database-connections/sql-server/', 'fa-database'), | |
| 2202 | - ), | |
| 2203 | - array( | |
| 2204 | - 'Access your PostgreSQL tables from the Data Explorer.' => array('https://wpdataaccess.com/docs/remote-database-connections/postgresql/', 'fa-database'), | |
| 2205 | - ), | |
| 2206 | - array( | |
| 2207 | - 'Access your Oracle tables from the Data Explorer.' => array('https://wpdataaccess.com/docs/remote-database-connections/oracle/', 'fa-database'), | |
| 2208 | - ), | |
| 2209 | - array( | |
| 2210 | - 'Access your remote MariaDB | MySQL tables from the Data Explorer.' => array('https://wpdataaccess.com/docs/remote-database-connections/mariadb-mysql/', 'fa-database'), | |
| 2211 | - ), | |
| 2212 | - array( | |
| 2213 | - 'Access your CSV files directly from the Data Explorer.' => array('https://wpdataaccess.com/docs/remote-data-files/csv-files/', 'fa-lightbulb'), | |
| 2214 | - ), | |
| 2215 | - array( | |
| 2216 | - 'Access your MS Access tables from the Data Explorer.' => array('https://wpdataaccess.com/docs/remote-data-files/ms-access/', 'fa-database'), | |
| 2217 | - ), | |
| 2218 | - array( | |
| 2219 | - 'Synchronize your Google Sheets from the Data Explorer.' => array('https://wpdataaccess.com/docs/remote-data-files/public-url/#google-sheets', 'fa-database'), | |
| 2220 | - ) | |
| 2221 | - ); | |
| 2222 | - break; | |
| 2223 | 1967 | default: |
| 2224 | 1968 | $promotions = array(); |
| 2225 | 1969 | } |
| 2226 | 1970 | if ( count( $promotions ) > 0 ) { |
| 2227 | - //phpcs:ignore - 8.1 proof | |
| 1971 | + // phpcs:ignore -- 8.1 proof | |
| 2228 | 1972 | $promotion_index = random_int( 0, count( $promotions ) - 1 ); |
| 2229 | 1973 | $promotion = $promotions[$promotion_index]; |
| 2230 | 1974 | $promotion_text = key( $promotion ); |
| 2231 | 1975 | $promotion_url = $promotion[$promotion_text][0]; |
| @@ -2252,4 +1996,6 @@ | ||
| 2252 | 1996 | } |
| 2253 | 1997 | } |
| 2254 | 1998 | |
| 2255 | 1999 | } |
| 2000 | + | |
| 2001 | +// phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing | |