10up / ElasticPress

A fast and flexible search and query engine for WordPress.
https://elasticpress.io
GNU General Public License v2.0
1.25k stars 311 forks source link

BUG: Notice with ElasticPress Related Posts on Widgets admin page #2940

Closed chief1983 closed 2 years ago

chief1983 commented 2 years ago

Describe the bug When ElasticPress is the only plugin enabled and the Related Posts indexing option is enabled (even when switched to the standard Genesis theme and not our own internal edited version) and I visit Appearance -> Widgets (/wp-admin/widgets.php), it generates a notice:

Notice: Function wp_enqueue_script() was called incorrectly. "wp-editor" script should not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-widgets). Please see [Debugging in WordPress](https://wordpress.org/support/article/debugging-in-wordpress/) for more information. (This message was added in version 5.8.0.) in /var/www/html/public/wp/wp-includes/functions.php on line 5831

Steps to Reproduce

  1. Activate ElasticPress (all other plugins can be disabled)
  2. Disable all ElasticPress features except Related Posts
  3. Go to /wp-admin/widgets.php
  4. See the notice rendered on the page or in the PHP logs, depending on server configuration

Expected behavior No notices generated on the widgets page.

Screenshots Not really applicable

Environment information

version: 6.0.1 site_language: en_US user_language: en_US timezone: America/Chicago permalink: /%category%/%post_id%/%postname%/ https_status: true multisite: false user_registration: 0 blog_public: 1 default_comment_status: undefined environment_type: development user_count: 91 dotorg_communication: true

wp-paths-sizes

wordpress_path: /var/www/html/public/wp wordpress_size: 47.20 MB (49498011 bytes) uploads_path: /var/www/html/public/wp-content/uploads uploads_size: 0.00 B (0 bytes) themes_path: /var/www/html/public/wp-content/themes themes_size: 130.56 MB (136903655 bytes) plugins_path: /var/www/html/public/wp-content/plugins plugins_size: 339.01 MB (355481137 bytes) database_size: 97.69 MB (102432768 bytes) total_size: 614.47 MB (644315571 bytes)

wp-active-theme

name: Genesis (genesis) version: 3.3.3 author: StudioPress author_website: https://www.studiopress.com/ parent_theme: none theme_features: core-block-patterns, menus, post-thumbnails, title-tag, automatic-feed-links, body-open, genesis-inpost-layouts, genesis-archive-layouts, genesis-admin-menu, genesis-seo-settings-menu, genesis-import-export-menu, genesis-readme-menu, genesis-customizer-theme-settings, genesis-customizer-seo-settings, genesis-auto-updates, genesis-breadcrumbs, genesis-menus, genesis-structural-wraps, html5, genesis-accessibility, widgets, widgets-block-editor theme_path: /var/www/html/public/wp-content/themes/genesis

wp-themes-inactive (1)

Kabazi: version: 1.0.0, author: Kabazi

wp-mu-plugins (2)

Bedrock Autoloader: version: 1.0.3, author: Roots Register Theme Directory: version: 1.0.0, author: Roots

wp-plugins-active (1)

ElasticPress: version: 4.2.2, author: 10up

wp-plugins-inactive (28)

ACF to REST API: version: 3.3.3, author: Aires Gonçalves Ads.txt Manager: version: 1.3.0, author: 10up (latest version: 1.4.0) Advanced Custom Fields: version: 5.12.2, author: Delicious Brains (latest version: 5.12.3) Ajax Load More: version: 5.5.2, author: Darren Cooney (latest version: 5.5.3) Cloudflare: version: 4.8.3, author: Cloudflare, Inc. (latest version: 4.11.0) Co-Authors Plus: version: 3.4.92, author: Mohammad Jangda, Daniel Bachhuber, Automattic (latest version: 3.5.2) Convert to Blocks: version: 1.0.2, author: 10up (latest version: 1.1.0) Debug Bar: version: 1.1.2, author: wordpressdotorg (latest version: 1.1.3) Debug Bar ElasticPress: version: 2.1.0, author: 10up (latest version: 2.1.1) Genesis Custom Blocks Pro: version: 1.5.0, author: Genesis Custom Blocks Pro Genesis Visual Hook Guide: version: 1.0.0, author: Christopher Cochran Object Cache Pro: version: 1.14.5, author: Rhubarb Group oEmbed Plus: version: 1.6, author: Ayesh Karunaratne Optimize Database after Deleting Revisions: version: 5.0.110, author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands Quantcast Choice: version: 2.0.4, author: Quantcast Query Monitor: version: 3.8.2, author: John Blackbourn (latest version: 3.9.0) Quillt ARB Plugin: author: (undefined), version: 1.0.0 Quillt Network Plugin: author: (undefined), version: 2.0.0 Redirection: version: 5.2.3, author: John Godley (latest version: 5.3.2) S3 Uploads: version: 3.0.3, author: Human Made Limited Shutterstock: version: 1.3.11, author: Shutterstock (latest version: 1.3.12) Site Kit by Google: version: 1.72.0, author: Google (latest version: 1.80.0) StockPack – Stock images in WordPress: version: 3.3.2, author: Derikon Development (latest version: 3.3.3) Toggle: author: (undefined), version: 1.0.0 WP Crontrol: version: 1.12.0, author: John Blackbourn & crontributors (latest version: 1.14.0) WP Mail SMTP Pro: version: 3.3.0, author: WPForms Yoast Duplicate Post: version: 4.4, author: Enrico Battocchi & Team Yoast (latest version: 4.5) Yoast SEO: version: 18.5.1, author: Team Yoast (latest version: 19.5.1)

wp-media

image_editor: WP_Image_Editor_Imagick imagick_module_version: 1808 imagemagick_version: ImageMagick 7.1.0-16 Q16-HDRI aarch64 2021-11-21 https://imagemagick.org imagick_version: 3.7.0 file_uploads: File uploads is turned off post_max_size: 81M upload_max_filesize: 80M max_effective_size: 80 MB max_file_uploads: 20 imagick_limits: imagick::RESOURCETYPE_AREA: 23 GB imagick::RESOURCETYPE_DISK: 9.2233720368548E+18 imagick::RESOURCETYPE_FILE: 786432 imagick::RESOURCETYPE_MAP: 23 GB imagick::RESOURCETYPE_MEMORY: 12 GB imagick::RESOURCETYPE_THREAD: 1 imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, ASHLAR, AVI, AVIF, AVS, BGR, BGRA, BGRO, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUBE, CUR, CUT, DATA, DCM, DCR, DCRAW, DCX, DDS, DFONT, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, FARBFELD, FAX, FF, FILE, FITS, FL32, FLV, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, JNG, JNX, JPE, JPEG, JPG, JPS, JSON, K25, KDC, KERNEL, LABEL, 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, 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, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGB565, RGBA, RGBO, RGF, RLA, RLE, RMF, RSVG, RW2, SCR, 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, YAML, YCbCr, YCbCrA, YUV gd_version: bundled (2.1.0 compatible) gd_formats: GIF, JPEG, PNG, BMP ghostscript_version: 9.55.0

wp-server

server_architecture: Linux 5.10.104-linuxkit aarch64 httpd_software: nginx/1.19.4 php_version: 7.4.28 64bit php_sapi: fpm-fcgi max_input_variables: 1000 time_limit: 60 memory_limit: 256M max_input_time: 60 upload_max_filesize: 80M php_post_max_size: 81M curl_version: 7.80.0 OpenSSL/1.1.1n suhosin: false imagick_availability: true pretty_permalinks: true

wp-database

extension: mysqli server_version: 10.6.7-MariaDB-1:10.6.7+maria~focal client_version: mysqlnd 7.4.28 max_allowed_packet: 16777216 max_connections: 151

wp-constants

WP_HOME: https://local.kabazi.com WP_SITEURL: https://local.kabazi.com/wp WP_CONTENT_DIR: /var/www/html/public/wp-content WP_PLUGIN_DIR: /var/www/html/public/wp-content/plugins WP_MEMORY_LIMIT: 40M WP_MAX_MEMORY_LIMIT: 256M WP_DEBUG: true WP_DEBUG_DISPLAY: true WP_DEBUG_LOG: false SCRIPT_DEBUG: true WP_CACHE: false CONCATENATE_SCRIPTS: undefined COMPRESS_SCRIPTS: undefined COMPRESS_CSS: undefined WP_ENVIRONMENT_TYPE: development DB_CHARSET: utf8mb4 DB_COLLATE: undefined

wp-filesystem

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

genesis

theme_version: 3.3.3 db_version: 3301 upgrade: 1 blog_cat_num: 12 content_archive: full image_size: genesis-singular-images image_alignment: aligncenter posts_nav: numeric site_layout: content-sidebar show_featured_image_post: true show_featured_image_social: true

`

Additional context

JakePT commented 2 years ago

Hi @chief1983, thanks for taking the time to file an issue. I am unable to replicate this issue however, and it would be quite unusual if ElasticPress was responsible as we don't enqueue wp-editor at all, let alone as part of the Related Posts feature.

Can you let me know if you installed the plugin from wordpress.org or if you're installing from GitHub?

Also, I noticed that you've tried switching between themes but that both themes were based on Genesis. Does the error still appear when using one of the default "Twenty ..." themes?

JakePT commented 2 years ago

Hi @chief1983, a quick update. It looks like we are in fact enqueuing wp-editor in the release version of ElasticPress. Good catch. Thankfully this has already been fixed in the development branch which is why I couldn't find it. So I can let you know that this issue will be fixed in the next release.

chief1983 commented 2 years ago

Thanks for the follow-up, look forward to the fix.