Support » Plugin: WebToffee PayPal Express Checkout Payment Gateway for WooCommerce » The plugin doesn’t find wp.media object

  • Resolved Andrea87n

    (@andrea87n)


    Hello there,

    I’m using the last version of your plugin (1.7.0) and the last version of Woocommerce (6.3.1).
    When I click “Add Image” in the logo section, it returns an error on the console which says: “wp.media is undefined”. Actually when I tried to wp.media on the console it doesn’t find it, but if I try to do it on the Media section of WordPress, it does.

    I tried to downgrade Woocommerce version to 5.8.1 and it works fine.

    There has to be some sort of conflict between your plugin and the last version of Woocommerce and I just wanted to point out this problem.

    As reference, I found a workaround about this problem by adding this function:

    function load_media_files() {
    wp_enqueue_media();
    }
    add_action( ‘admin_enqueue_scripts’, ‘load_media_files’ );

    Of course this is not a best practice.

    I’ll be waiting for your answer and I hope this will help the development of your plugin.

    Best regards!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author webtoffee

    (@webtoffee)

    Hi @andrea87n,

    We check this issue in our test environments and were unable to replicate the issue. Can you please share your site health info(Tools>Site haealth>Info>Copy sie info to clipboard) via support?

    Thread Starter Andrea87n

    (@andrea87n)

    Here you go:

    ### wp-core ###

    version: 5.9.2
    site_language: it_IT
    user_language: it_IT
    timezone: Europe/Rome
    permalink: /%postname%
    https_status: true
    multisite: false
    user_registration: 0
    blog_public: 0
    default_comment_status: undefined
    environment_type: production
    user_count: 1
    dotorg_communication: true

    ### wp-paths-sizes ###

    wordpress_path: /var/www/clients/client0/web24/web
    wordpress_size: 53,57 MB (56167773 bytes)
    uploads_path: /var/www/clients/client0/web24/web/wp-content/uploads
    uploads_size: 67,88 MB (71181612 bytes)
    themes_path: /var/www/clients/client0/web24/web/wp-content/themes
    themes_size: 26,77 MB (28070975 bytes)
    plugins_path: /var/www/clients/client0/web24/web/wp-content/plugins
    plugins_size: 105,66 MB (110792167 bytes)
    database_size: 28,30 MB (29671424 bytes)
    total_size: 282,18 MB (295883951 bytes)

    ### wp-active-theme ###

    name: Betheme Child (betheme-child)
    version: 2.0
    author: Muffin group
    author_website: https://muffingroup.com
    parent_theme: Betheme (betheme)
    theme_features: core-block-patterns, editor-style, automatic-feed-links, custom-logo, editor-styles, post-formats, post-thumbnails, title-tag, menus, wc-product-gallery-lightbox, wc-product-gallery-slider, widgets-block-editor, woocommerce, widgets
    theme_path: /var/www/clients/client0/web24/web/wp-content/themes/betheme-child
    auto_update: Disabilitato

    ### wp-parent-theme ###

    name: Betheme (betheme)
    version: 25.1.9.1
    author: Muffin group
    author_website: https://muffingroup.com/
    theme_path: /var/www/clients/client0/web24/web/wp-content/themes/betheme
    auto_update: Disabilitato

    ### wp-themes-inactive (1) ###

    Twenty Twenty-Two: version: 1.0, author: the WordPress team (latest version: 1.1), Aggiornamenti automatici disabilitati

    ### wp-plugins-active (9) ###

    Contact Form 7: version: 5.5.6, author: Takayuki Miyoshi, Aggiornamenti automatici disabilitati
    Maintenance: version: 4.05, author: WebFactory Ltd, Aggiornamenti automatici disabilitati
    PayPal Express Checkout Payment Gateway for WooCommerce ( Basic ): version: 1.7.0, author: WebToffee, Aggiornamenti automatici disabilitati
    Really Simple SSL: version: 5.3.0, author: Really Simple Plugins, Aggiornamenti automatici disabilitati
    WooCommerce: version: 5.8.1, author: Automattic (latest version: 6.3.1), Aggiornamenti automatici disabilitati
    WP All Import – WooCommerce Import Add-On Pro: version: 3.3.0, author: Soflyy, Aggiornamenti automatici disabilitati
    WP All Import Pro: version: 4.7.2, author: Soflyy, Aggiornamenti automatici disabilitati
    WPBakery Page Builder: version: 6.8.0, author: Michael M – WPBakery.com, Aggiornamenti automatici disabilitati
    Yoast Duplicate Post: version: 4.4, author: Enrico Battocchi & Team Yoast, Aggiornamenti automatici disabilitati

    ### wp-plugins-inactive (3) ###

    Google Tag Manager for WordPress: version: 1.14.2, author: Thomas Geiger, Aggiornamenti automatici disabilitati
    PayPal Express Checkout Payment Gateway for WooCommerce ( Basic ): version: 1.6.6, author: WebToffee (latest version: 1.7.0), Aggiornamenti automatici disabilitati
    WooCommerce: version: 6.3.1, author: Automattic, Aggiornamenti automatici disabilitati

    ### wp-media ###

    image_editor: WP_Image_Editor_Imagick
    imagick_module_version: 1690
    imagemagick_version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org
    imagick_version: 3.4.4
    file_uploads: File uploads is turned off
    post_max_size: 8M
    upload_max_filesize: 40M
    max_effective_size: 8 MB
    max_file_uploads: 20
    imagick_limits:
    imagick::RESOURCETYPE_AREA: 122 MB
    imagick::RESOURCETYPE_DISK: 1073741824
    imagick::RESOURCETYPE_FILE: 768
    imagick::RESOURCETYPE_MAP: 512 MB
    imagick::RESOURCETYPE_MEMORY: 256 MB
    imagick::RESOURCETYPE_THREAD: 1
    imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, H, HALD, HDR, HEIC, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
    gd_version: 2.2.5
    gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM
    ghostscript_version: 9.27

    ### wp-server ###

    server_architecture: Linux 4.19.0-12-amd64 x86_64
    httpd_software: Apache
    php_version: 7.3.19-1~deb10u1 64bit
    php_sapi: fpm-fcgi
    max_input_variables: 5000
    time_limit: 120
    memory_limit: 1024M
    max_input_time: 60
    upload_max_filesize: 40M
    php_post_max_size: 8M
    curl_version: 7.64.0 OpenSSL/1.1.1g
    suhosin: false
    imagick_availability: true
    pretty_permalinks: true
    htaccess_extra_rules: true

    ### wp-database ###

    extension: mysqli
    server_version: 10.3.25-MariaDB-0+deb10u1
    client_version: mysqlnd 5.0.12-dev – 20150407 – $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $
    max_allowed_packet: 16777216
    max_connections: 151

    ### wp-constants ###

    WP_HOME: undefined
    WP_SITEURL: undefined
    WP_CONTENT_DIR: /var/www/clients/client0/web24/web/wp-content
    WP_PLUGIN_DIR: /var/www/clients/client0/web24/web/wp-content/plugins
    WP_MEMORY_LIMIT: 1024M
    WP_MAX_MEMORY_LIMIT: 1024M
    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: Non definito
    DB_CHARSET: utf8
    DB_COLLATE: undefined

    ### wp-filesystem ###

    wordpress: writable
    wp-content: writable
    uploads: writable
    plugins: writable
    themes: writable

    Plugin Author webtoffee

    (@webtoffee)

    Hi @andrea87n,

    We checked the issue in our test environment and were unable to replicate the issue. We were able to upload the image to the logo section successfully. It seems like the issue you are facing is site related issue. Please refer to the below article regarding the “wp.media is undefined” issue
    https://thewebtier.com/wordpress/fix-wp-media-is-undefined/

    Thread Starter Andrea87n

    (@andrea87n)

    Hello there,

    yeah I had already tried that solution, I just wanted to understand why it was happening.

    Anyway I will have a look at it again.
    Thank you! 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.