woocommerce / woocommerce-paypal-payments

https://wordpress.org/plugins/woocommerce-paypal-payments/
GNU General Public License v2.0
62 stars 48 forks source link

Plugin configuration input field - incorrect 'pattern' attribute #1580

Closed mehowmy closed 1 year ago

mehowmy commented 1 year ago

Describe the Bug

There is a problem with one of the input fields in the plugin configuration. The issue is in the "pattern" attrubute of one of the settings input fields. More details below.

To Reproduce

  1. Go to 'admin.php?page=wc-settings&tab=checkout&section=ppcp-gateway'
  2. See error in the console:

Pattern attribute value [a-zA-Z_-]+ is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression: /[a-zA-Z_-]+/v: Invalid character in character class

HTML element that is causing this error: <input type="text" class="input-text " name="ppcp[prefix]" id="ppcp-prefix" placeholder="" value="fbafad-" pattern="[a-zA-Z_-]+" maxlength="15"/>

Expected Behavior

There is no error in the console and I can configure the payment gateway/plugin.

Actual Behavior

The error prevents me from configuring the gateway.

Environment

See site info below.

Additional Details

System status ` ### wp-core ### version: 6.2.2 site_language: en_GB user_language: en_GB timezone: +00:00 permalink: /%postname%/ https_status: true multisite: false user_registration: 0 blog_public: 1 default_comment_status: open environment_type: production user_count: 171 dotorg_communication: true ### wp-paths-sizes ### wordpress_path: /www/wwwroot/[redacted] wordpress_size: loading... uploads_path: /www/wwwroot/[redacted]/wp-content/uploads uploads_size: loading... themes_path: /www/wwwroot/[redacted]/wp-content/themes themes_size: loading... plugins_path: /www/wwwroot/[redacted]k/wp-content/plugins plugins_size: loading... database_size: loading... total_size: loading... ### wp-dropins (1) ### object-cache.php: true ### wp-active-theme ### name: [redacted] ([redacted]) version: 1.0.0 author: [redacted] author_website: [redacted] parent_theme: [redacted] ([redacted]) theme_features: core-block-patterns, widgets, widgets-block-editor, post-thumbnails, automatic-feed-links, title-tag, menus, html5, custom-background, customize-selective-refresh-widgets, custom-logo, custom-header, woocommerce theme_path: /www/wwwroot/[redacted]/wp-content/themes/[redacted] auto_update: Disabled ### wp-parent-theme ### name: [redacted] version: 1.0.0 author: Michał Maj author_website: [redacted] theme_path: /www/wwwroot/[redacted]/wp-content/themes/[redacted] auto_update: Disabled ### wp-themes-inactive (3) ### Flatsome Child: version: 3.0, author: UX Themes, Auto-updates disabled Flatsome: version: 3.14.2, author: UX-Themes, Auto-updates disabled Twenty Twenty-Three: version: 1.0, author: the WordPress team (latest version: 1.1), Auto-updates disabled ### wp-mu-plugins (1) ### installatron_hide_status_test.php: author: (undefined), version: (undefined) ### wp-plugins-active (39) ### Accordion Toggle: version: 1.2.7, author: WPDeveloper, Auto-updates disabled Advanced Custom Fields PRO: version: 6.1.7, author: WP Engine (latest version: 6.1.8), Auto-updates disabled All-in-One WP Migration: version: 7.76, author: ServMask, Auto-updates disabled All-in-One WP Migration Unlimited Extension: version: 2.52, author: ServMask, Auto-updates disabled CartBounty Pro - Save and recover abandoned carts for WooCommerce: version: 9.11, author: Streamline.lv, Auto-updates disabled Contact Form 7: version: 5.7.7, author: Takayuki Miyoshi (latest version: 5.8), Auto-updates disabled Cookie Notice & Compliance for GDPR / CCPA: version: 2.4.9, author: Hu-manity.co, Auto-updates disabled DCO Comment Attachment: version: 2.4.0, author: Denis Yanchevskiy, Auto-updates disabled Disable Admin Notices Individually: version: 1.3.3, author: Creative Motion , Auto-updates disabled Elementor: version: 3.14.1, author: Elementor.com (latest version: 3.15.1), Auto-updates disabled Facebook for WooCommerce: version: 3.0.29, author: Facebook (latest version: 3.0.30), Auto-updates disabled GTM4WP: version: 1.16.2, author: Thomas Geiger, Auto-updates disabled imegamedia Retail Finance: version: 1.2.7, author: imegamedia, Auto-updates disabled Ivory Search: version: 5.5.2, author: Ivory Search, Auto-updates disabled Klarna Order Management for WooCommerce: version: 1.8.1, author: klarna, krokedil, Auto-updates disabled Klarna Payments for WooCommerce: version: 3.1.3, author: krokedil, klarna, automattic, Auto-updates disabled Lazy Load - Optimize Images: version: 2.3.6, author: WP Rocket, Auto-updates disabled LiteSpeed Cache: version: 5.5.1, author: LiteSpeed Technologies, Auto-updates enabled Loco Translate: version: 2.6.4, author: Tim Whitlock, Auto-updates disabled Media Cleaner: version: 6.6.5, author: Jordy Meow, Auto-updates disabled Nextend Social Login: version: 3.1.9, author: Nextendweb, Auto-updates disabled Paid On Results - WooCommerce: version: 3.0.3, author: Paid On Results, Auto-updates disabled Payment Plugins for Stripe WooCommerce: version: 3.3.44, author: Payment Plugins, support@paymentplugins.com (latest version: 3.3.45), Auto-updates disabled Post SMTP: version: 2.5.9, author: Post SMTP, Auto-updates disabled Product page shipping calculator for WooCommerce: version: 1.3.31, author: PI Websolution (latest version: 1.3.34), Auto-updates disabled Redirection: version: 5.3.10, author: John Godley, Auto-updates disabled Safe SVG: version: 2.1.1, author: 10up, Auto-updates disabled Simple Cloudflare Turnstile: version: 1.22.1, author: Elliot Sowersby, RelyWP, Auto-updates disabled Simple Custom Post Order: version: 2.5.6, author: Colorlib, Auto-updates disabled Simple History: version: 4.3.0, author: Pär Thernström, Auto-updates disabled TI WooCommerce Wishlist: version: 2.7.3, author: TemplateInvaders (latest version: 2.7.4), Auto-updates disabled User Role Editor: version: 4.63.3, author: Vladimir Garagulya, Auto-updates disabled WooCommerce: version: 7.9.0, author: Automattic, Auto-updates disabled WooCommerce Checkout Manager: version: 7.2.0, author: QuadLayers, Auto-updates disabled WooCommerce Google Feed Manager: version: 2.39.2, author: Michel Jongbloed (latest version: 2.40.0), Auto-updates disabled WooCommerce PayPal Payments: version: 2.2.0, author: WooCommerce, Auto-updates disabled WPC Smart Compare for WooCommerce: version: 6.1.0, author: WPClever (latest version: 6.1.1), Auto-updates disabled XML Sitemap Generator for Google: version: 4.1.13, author: Auctollo, Auto-updates disabled Yoast SEO: version: 20.12, author: Team Yoast, Auto-updates disabled ### wp-plugins-inactive (5) ### Limit Login Attempts Reloaded: version: 2.25.20, author: Limit Login Attempts Reloaded, Auto-updates enabled Pinterest for WooCommerce: version: 1.3.6, author: WooCommerce, Auto-updates disabled Regenerate Thumbnails: version: 3.1.5, author: Alex Mills (Viper007Bond), Auto-updates disabled Site Kit by Google: version: 1.105.0, author: Google (latest version: 1.106.0), Auto-updates disabled Snap Finance: version: 2.1.3, author: Snap Finance, Auto-updates disabled ### wp-media ### image_editor: WP_Image_Editor_Imagick imagick_module_version: 1802 imagemagick_version: ImageMagick 7.0.10-47 Q16 x86_64 2023-07-08 https://imagemagick.org imagick_version: 3.4.4 file_uploads: File uploads is turned off post_max_size: 8096M upload_max_filesize: 8096M max_effective_size: 8 GB max_file_uploads: 20 imagick_limits: imagick::RESOURCETYPE_AREA: 31 GB imagick::RESOURCETYPE_DISK: 9.2233720368548E+18 imagick::RESOURCETYPE_FILE: 375000 imagick::RESOURCETYPE_MAP: 31 GB imagick::RESOURCETYPE_MEMORY: 16 GB imagick::RESOURCETYPE_THREAD: 1 imagick::RESOURCETYPE_TIME: 9.2233720368548E+18 imagemagick_file_formats: 3FR, 3G2, 3GP, A, AAI, AI, APNG, ART, ARW, ASHLAR, AVI, AVS, B, BGR, BGRA, BGRO, BMP, BMP2, BMP3, BRF, C, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUBE, CUR, CUT, DATA, DCM, DCR, DCRAW, DCX, DDS, DFONT, DNG, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, FARBFELD, FAX, FF, FILE, FITS, FL32, FLV, FRACTAL, FTP, FTS, G, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, JNG, JNX, JPE, JPEG, JPG, JPS, JSON, K, K25, KDC, LABEL, M, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, O, ORA, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PHM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PS, PS2, PS3, PSB, PSD, PTIF, PWP, R, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGB565, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCREENSHOT, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TM2, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMV, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, Y, YAML, YCbCr, YCbCrA, YUV gd_version: bundled (2.1.0 compatible) gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM ghostscript_version: not available ### wp-server ### server_architecture: Linux 3.10.0-1160.92.1.el7.x86_64 x86_64 httpd_software: LiteSpeed php_version: 7.4.33 64bit php_sapi: litespeed max_input_variables: 20000 time_limit: 84400 memory_limit: 8096M max_input_time: 84400 upload_max_filesize: 8096M php_post_max_size: 8096M curl_version: 7.29.0 NSS/3.53.1 suhosin: false imagick_availability: true pretty_permalinks: true htaccess_extra_rules: true ### wp-database ### extension: mysqli server_version: 10.5.6-MariaDB-log client_version: mysqlnd 7.4.33 max_allowed_packet: 1073741824 max_connections: 4000 ### wp-constants ### WP_HOME: undefined WP_SITEURL: undefined WP_CONTENT_DIR: /www/wwwroot/[redacted]/wp-content WP_PLUGIN_DIR: /www/wwwroot/[redacted]/wp-content/plugins WP_MEMORY_LIMIT: 8096M WP_MAX_MEMORY_LIMIT: 8096M WP_DEBUG: false WP_DEBUG_DISPLAY: true WP_DEBUG_LOG: false SCRIPT_DEBUG: false WP_CACHE: false CONCATENATE_SCRIPTS: undefined COMPRESS_SCRIPTS: undefined COMPRESS_CSS: undefined WP_ENVIRONMENT_TYPE: Undefined DB_CHARSET: utf8 DB_COLLATE: undefined ### wp-filesystem ### wordpress: writable wp-content: writable uploads: writable plugins: writable themes: writable mu-plugins: writable `
InpsydeNiklas commented 1 year ago

This console error should not be present anymore with the latest update 2.4.0. It should not have been related to eventual problems with the account connection, though. If any questions or issues remain when using the latest PayPal Payments version, I would like to ask you to reach out to the support team directly for more guidance. Thanks!