• Resolved Jim Reekes

    (@reekes)


    Just when I thought it was ready to go…

    Testing pages to see if they’re getting tracked, I find this in the console.

    POST https://mydomain.com/wp-json/wordpress-popular-posts/v2/views/330029 400 (Bad Request)

    That seems to be triggered by this line I found in a cached JS file created by the Debloat plugin.

    I find WordPressPopularPosts = function() is in one of its cached files. Within that file is var ajax = function(method, url, params, callback, additional_headers). The last line of that function is:

    xhr.send("POST" == method ? args : null)

    That seems to be throwing the server error.

    This all stops when I disable an optimization plugin, Debloat. For both Optimize and Delay of JS, I’ve added wpp-js and wpp.min.js in its Exclude Scripts options. So I would have thought that’s all that was needed.

    I’m on SiteGround, and even added the sgo_javascript_combine_exclude_ids filter. Is this still needed? I thought I saw that code in WPP’s defaults.

    I confirmed the settings in Debloat, and flushed all caches. I thought it was working, but then after a few tries I get the same error.

    I’ve read 401 Unauthorized on api calls and it may be related, but this is getting over my head.

    There must be something I can do to keep Debloat from interfereing with WPP.

    Performance Nag: Inactive
    Log Limit: Yes, keep data for 180 days
    Log Views From: Visitors only
    Data Caching: Yes, 1 minute
    Data Sampling: No
    External object cache: No
    WPP_CACHE_VIEWS: No

    System Info
    PHP version: 8.2.24

    PHP extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dba, dom, enchant, hash, fileinfo, filter, ftp, gd, gettext, gmp, json, iconv, SPL, intl, session, mbstring, standard, mysqlnd, pcntl, exif, mysqli, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, random, readline, Reflection, imap, shmop, SimpleXML, soap, sockets, sodium, sysvmsg, sysvsem, tidy, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, cgi-fcgi, memcached, Zend OPcache

    AVIF support: Yes
    WebP support: Yes
    Database version: 8.0.36-28
    InnoDB availability: DEFAULT
    WordPress version: 6.6.2
    Multisite: No

    Active plugins: Ad Inserter 2.7.36, Admin and Site Enhancements (ASE) 7.4.4, Advanced Editor Tools 5.9.2, Antispam Bee 2.11.6, Astra Pro 4.8.1, CM Tooltip Glossary Pro+ 4.3.7, Content Views 4.0, Content Views Pro 7.0, CookieYes | GDPR Cookie Consent 3.2.6, Custom Post Type Widgets 1.5.2, Debloat 1.2.8, Health Check & Troubleshooting 1.7.1, List Custom Taxonomy Widget 4.2, Redirection 5.5.0, Security Optimizer 1.5.5, Spectra 2.15.3, Speed Optimizer 7.6.6, Stackable - Gutenberg Blocks 3.13.6, SyntaxHighlighter Evolved 3.7.0, Table of Contents Plus 2408, TaxoPress Pro 3.25.1, WordPress Popular Posts 7.0.1, WordPress Popular Posts Sortable Columns 1.0.2, WP-Optimize - Clean, Compress, Cache 3.6.0, WPCode Lite 2.2.2, WP Crontrol 1.17.0, WPForms Lite 1.9.1.1, WP RSS Aggregator 4.23.12, WP RSS Aggregator - Feed to Post 3.16.3, WP RSS Aggregator - Full Text RSS Feeds 1.4.1, WP RSS Aggregator - Keyword Filtering 1.8, Yoast SEO 23.5

    Theme: Astra Child (1.0.1) by Brainstorm Force
    • This topic was modified 1 month, 3 weeks ago by Jim Reekes.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    That seems to be throwing the server error.

    That line of code is fine. All it does is send the actual POST request.

    This all stops when I disable an optimization plugin, Debloat.

    Well then, I guess we have our culprit ??

    I tried that Debloat plugin and was able to reproduce the problem. It’s the “Minify Javascript” option what breaks the script.

    From what I see it doesn’t seem that the “Exclude Scripts” from the JS Optimization section applies to the minification option, only to the defer-script functionality (but why? It doesn’t make sense, it’s confusing – at least then provide another “exclude” field to exclude scripts from the minification option…)

    Disabling the “Minify Javascript” option fixes the issue, but then your site won’t serve minified JS files. At least not with Debloat that is.

    So:

    • Reach out to Debloat’s support team and see if there’s a way to exclude certain scripts from being minified (although their support team doesn’t seem to be very active…); or
    • Use a different optimization plugin (eg. Autoptimize, W3 Total Cache, WP Super Cache, etc.)

    If you decide for option #2, here’s some general rules I usually follow when picking a plugin:

    1. It has some overall good reviews (generally I pick plugins that have at least 4 out of 5 stars, anything less than that I usually avoid); and
    2. It’s compatible with recent versions of WordPress; and (but not least)
    3. It’s being actively supported by its developer(s) (a dead forum is usually not a great sign, there’s a good chance that you’ll be on your own if/when something breaks.)

    Good luck! ??

    If you have any other questions please let me know.

    Thread Starter Jim Reekes

    (@reekes)

    From what I see it doesn’t seem that the “Exclude Scripts” from the JS Optimization section applies to the minification option, only to the defer-script functionality (but why? It doesn’t make sense, it’s confusing – at least then provide another “exclude” field to exclude scripts from the minification option…)

    Yeah, that’s what I ended up thinking, but couldn’t believe it’s true.

    I spent months going thru Autoptimize and others. I could’t get the performance improvements Google’s ranking was expecting. I asked SiteGround to help, and they installed Debloat and configured it. The performance was (finally) greatly improved.

    It’s also broke GDPR cookie managment, which is a royal pain to begin with. That’s yet another piece of code that doesn’t want to be cached, and yet without caching it’s really slowing down page loading.

    [smashing head on desk]

    • This reply was modified 1 month, 3 weeks ago by Jim Reekes.
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.