Forum Replies Created

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter Preliot

    (@preliot)

    @mattmary Thanks for your efforts. With your suggestion i’ve traced the issue elsewhere (WooCommerce) and posted the issue here: WooCommerce sql syntax error.

    Thread Starter Preliot

    (@preliot)

    Last part tells the story where the call orginates (see topic start for better view).
    Any insight would be appreciated.

    Thread Starter Preliot

    (@preliot)

    Hello @mattmary,

    Unfortunatly there’s no stacktrace, but this is the complete log message:

    [07-May-2022 10:29:10 UTC] WordPress databasefout You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')))  AND ((wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' ...' at line 3 bij query SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  LEFT  JOIN wp_icl_translations wpml_translations
    							ON wp_posts.ID = wpml_translations.element_id
    								AND wpml_translations.element_type = CONCAT('post_', wp_posts.post_type)  WHERE 1=1  AND ((()))  AND ((wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled')) OR (wp_posts.post_type = 'page' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled')) OR (wp_posts.post_type = 'attachment' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled')) OR (wp_posts.post_type = 'product' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled')) OR (wp_posts.post_type = 'aiovg_videos' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled')) OR (wp_posts.post_type = 'news' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled')) OR (wp_posts.post_type = 'custom_type' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled'))) AND ( ( ( wpml_translations.language_code = 'nl' OR 0 ) AND wp_posts.post_type  IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation','acf-field-group','product','product_variation','aiovg_videos','news' )  ) OR wp_posts.post_type  NOT  IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation','acf-field-group','product','product_variation','aiovg_videos','news' )  )  ORDER BY wp_posts.post_date DESC LIMIT 0, 10 gemaakt door require('wp-blog-header.php'), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
    [07-May-2022 10:29:10 UTC] WordPress databasefout You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')))  AND ((wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' ...' at line 3 bij query SELECT   wp_posts.* FROM wp_posts  LEFT  JOIN wp_icl_translations wpml_translations
    							ON wp_posts.ID = wpml_translations.element_id
    								AND wpml_translations.element_type = CONCAT('post_', wp_posts.post_type)  WHERE 1=1  AND ((()))  AND ((wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled')) OR (wp_posts.post_type = 'page' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled')) OR (wp_posts.post_type = 'attachment' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled')) OR (wp_posts.post_type = 'product' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled')) OR (wp_posts.post_type = 'aiovg_videos' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled')) OR (wp_posts.post_type = 'news' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled')) OR (wp_posts.post_type = 'custom_type' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled'))) AND ( ( ( wpml_translations.language_code = 'nl' OR 0 ) AND wp_posts.post_type  IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation','acf-field-group','product','product_variation','aiovg_videos','news' )  ) OR wp_posts.post_type  NOT  IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation','acf-field-group','product','product_variation','aiovg_videos','news' )  )  ORDER BY wp_posts.post_date DESC  gemaakt door require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/<theme>/search.php'), get_footer, locate_template, load_template, require_once('/themes/<theme>/footer-without-newsletter.php'), get_template_part, locate_template, load_template, require('/themes/<theme>/partials/footer/footer-end.php'), wp_footer, do_action('wp_footer'), WP_Hook->do_action, WP_Hook->apply_filters, WpMatomo\TrackingCode->add_javascript_code, WpMatomo\TrackingCode\TrackingCodeGenerator->get_tracking_code, WpMatomo\TrackingCode\TrackingCodeGenerator->apply_search_changes, WP_Query->__construct, WP_Query->query, WP_Query->get_posts
    • This reply was modified 2 years, 6 months ago by Preliot.
    • This reply was modified 2 years, 6 months ago by Jan Dembowski.
    Thread Starter Preliot

    (@preliot)

    Hello Mat,

    The stacktrace starts in my footer with the wp footer hook which triggers add_javascript_code, which in turns starts this issue.

    But where should ik look? ACF? MariaDB? something else?

    • This reply was modified 2 years, 6 months ago by Preliot.
    Plugin Author Preliot

    (@preliot)

    Does this mean there are no issues when using the plugin with http?

    Plugin Author Preliot

    (@preliot)

    Let’s take a step back and make sure all the requirements are met. It’s easier to help you when everything is clear:

    1) Which WordPress version are you using?
    2) Did you install version 5.4.1 of this plugin?
    3) Does you nginx contain the pagespeed and fastcgi module?
    4) FastCGI ‘purge all’ only works when you install the latest patch.

    If i’m reading this correctly, pagespeed is working now and fastcgi doesn’t? Assuming that’s the case, does a single purge work (f.e. purging a single url on the settings page) and the purge all fails? If that’s the case, please install the latest fastcgi module/patch.

    Concerning the WP_DEBUG / CACHOLONG_CACHE_DEBUG_HTTP_API_REQUEST combination, you are right. This is a (small) bug, which will be fixed in the next release. For now just use the combination to debug your issue.

    Plugin Author Preliot

    (@preliot)

    We’ve just released a new version of Cache control by Cacholong. There’s no need anymore for the CC_NGINX_FASTCGI_CACHE_PATH parameter. Could you download the lateste version and try again?

    Your log output suggests both caches are purged. If purging the pagespeed cache still fails with the most recent plugin, you can debug the purge request:

    wp-config.php

    define('CACHOLONG_CACHE_DEBUG_HTTP_API_REQUEST', true);

    • This reply was modified 3 years, 4 months ago by Preliot.
    Thread Starter Preliot

    (@preliot)

    @tsteur I’m impressed by the speed! Thanks!

    No longer “miles” of debug.log, i’m looking forward to it ??

    Thread Starter Preliot

    (@preliot)

    For my project(s) i always enable WP_DEBUG & WP_DEBUG_LOG to catch all possible errors before users complain about them. The most simplest solution i see is to create a seperate constant for logging, something like MATOMO_DEBUG.

    Or if you prefer to be on the safe side, first check the existince and value of MATOMO_DEBUG and then fallback to WP_DEBUG. ??

    To answer your questions: I’ve checked the codebase and see about 83 calls to $this->logger->log. The ones that pop up often in my debug.log are the once mentioned.
    They originate at:

    Trackingcode.php

    method add_javascript_code()

    line 93
    line 100

    method add_noscript_code()

    line 131

    Thank you for your work on this excellent plugin!

    • This reply was modified 4 years, 1 month ago by Preliot.

    My fix:

    php
    if(!$se_options || !$se_meta || $se_meta['version'] !== SE_VERSION) {
    

    I think this is enough, but if you want to be on the safe side it would be:

    php
    if(!$se_options || !$se_meta || !array_key_exists('version', $se_meta) ||  $se_meta['version'] !== SE_VERSION)
    

    Because isset doesn’t check if array key exists.

    • This reply was modified 4 years, 7 months ago by Preliot.
    • This reply was modified 4 years, 7 months ago by Preliot. Reason: Code formatting

    Fix (on your own risk). If you see an error, please comment here:

    //$search_terms = array_filter(array_map( create_function( '$a', 'return trim($a, "\\"\'\\n\\r ");' ), $matches[0] ));
    
    //Custom improvement
    $search_terms = array_filter(array_map( function($a) 
    {
        return trim($a, "\"'\n\r "); 
    }, $matches[0] ));
    Thread Starter Preliot

    (@preliot)

    Your extra checks revealed the issue: Now the message says something about a site id of zero.

    Quickfix: Save the settings of WP-Matamoto again by clicking the ‘Save’ button.

    Tested my website with PHP 7.2 and also saw the same issue. This function is used in one place:

    search-everything.php > line 236

    
    $search_terms = array_filter(array_map( create_function( '$a', 'return trim($a, "\\"\'\\n\\r ");' ), $matches[0] ));
    

    Perhaps use an anonymous function?

    • This reply was modified 5 years, 8 months ago by Preliot.
    • This reply was modified 5 years, 8 months ago by Preliot.
    Thread Starter Preliot

    (@preliot)

    @ipstenu answered my question with an e-mail:
    ————————————–

    No.

    A plugin has to work and do SOMETHING on its own. You’ve described a library, which is not permitted.

    I recommend a tool like gulp or grunt to aid your development process when using libraries.

    Thread Starter Preliot

    (@preliot)

    Jacob: sent a mail, thanks for the address!

    • This reply was modified 6 years, 8 months ago by Preliot.
Viewing 15 replies - 1 through 15 (of 15 total)