• Resolved saens

    (@saens)


    Hi,
    Since the major refactoring of your plugin I’m getting a null-pointer every now and then.

    2021-04-24T09:42:14+00:00 CRITICAL Uncaught Error: Call to a member function get_applied_coupons() on null in /home/deb/domains/domain.nl/public_html/wp-content/plugins/duracelltomi-google-tag-manager/integration/woocommerce.php:309
    Stack trace:
    #0 /home/deb/domains/domain.nl/public_html/wp-includes/class-wp-hook.php(292): gtm4wp_woocommerce_datalayer_filter_items(Array)
    #1 /home/deb/domains/domain.nl/public_html/wp-includes/plugin.php(212): WP_Hook->apply_filters(Array, Array)
    #2 /home/deb/domains/domain.nl/public_html/wp-content/plugins/duracelltomi-google-tag-manager/public/frontend.php(676): apply_filters('gtm4wp_compile_...', Array)
    #3 /home/deb/domains/domain.nl/public_html/wp-includes/class-wp-hook.php(290): gtm4wp_wp_header_begin()
    #4 /home/deb/domains/domain.nl/public_html/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(NULL, Array)
    #5 /home/deb/domains/domain.nl/public_html/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
    #6 /home/deb/ in /home/deb/domains/domain.nl/public_html/wp-content/plugins/duracelltomi-google-tag-manager/integration/woocommerce.php op de lijn 309
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    Thanks for the report.
    I’ve added some extra checks that should fix this:
    https://github.com/duracelltomi/gtm4wp/commit/06e13323a87c6d7e0d54b1d83962581f30c0165a

    If you can test this on your dev site, I would be grateful for any feedback.
    If you can not patch your live instance, you can disable “Cart content in data layer” option under Integration -> WooCommerce if you do not need this specific feature for any reason (it is not related to ecommerce tracking)

    Thread Starter saens

    (@saens)

    I would test, but I don’t know how to trigger it. It just shows in my logs every now and then. Can’t track it to a real user interacting with the site either, so maybe some bot does something.

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Perhaps it is related to the CLI version of WooCommerce where one can interact with WooCommerce via API calls.

    Do you have any admin user who might use an external tool to manage WooCommerce related tasks?

    Thread Starter saens

    (@saens)

    There’s no access afaik other than wp-admin. XML-RPC is blocked as well.

    Plugin Author Thomas Geiger

    (@duracelltomi)

    In that case I do not know how this happens 🙁

    The patch will go live in the next plugin version (~2-3 weeks from now). Until then, if you see no risk, you can apply the changes on your site and check your logs.

    Thread Starter saens

    (@saens)

    Been digging through the server logs (instead of google analytics).
    Found someone doing some stuff:

    https://mydomain.nl/wp-content/uploads/https://mydomain.nl/wp-json/

    Calling this myself in browser resulted in the error. After applying the patch it no longer shows the error.

    Thanks!

    Hi,

    i had the same error in our error_logs today.
    What i see is that some kind of bot tried different urls and added ‘/wp-json/wp/v2/users/’ to the links. Which all resulted in the error above mentioned.
    Did some testing and adding /wp-json/ to an existing link is enough.
    e.g. https://mysite.com/category/wp-json/ -> 500 …

    Hope this helps.

    Best!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Null pointer every other day’ is closed to new replies.