Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WooCommerce Memberships compatibility: is_offline was called incorrectly #232

Open
lkraav opened this issue Jan 15, 2020 · 5 comments
Open

Comments

@lkraav
Copy link

lkraav commented Jan 15, 2020

Load front or any other page, get this PHP Notice.

Traceback:

wp-includes/functions.php:4986
    is_offline()
    wp-content/plugins/pwa/wp-includes/general-template.php:109
    wp_hide_admin_bar_offline()
    wp-includes/class-wp-hook.php:288
    do_action_ref_array('parse_query')
    wp-includes/class-wp-query.php:1069
    WP_Query->parse_query()
    wp-includes/class-wp-query.php:1744
    WP_Query->get_posts()
    wp-includes/class-wp-query.php:3413
    WP_Query->query()
    wp-includes/post.php:2039
    get_posts()
    wp-content/plugins/woocommerce-memberships.git/includes/class-wc-memberships-user-memberships.php:322
    WC_Memberships_User_Memberships->get_user_memberships()
    wp-content/plugins/woocommerce-memberships.git/includes/functions/wc-memberships-functions-user-memberships.php:56
    wc_memberships_get_user_memberships()
    wp-content/plugins/woocommerce-memberships.git/includes/functions/wc-memberships-functions-members-area.php:93
    wc_memberships_get_members_area_endpoint()
    wp-content/plugins/woocommerce-memberships.git/includes/frontend/class-wc-memberships-members-area.php:66
    WC_Memberships_Members_Area->__construct()
    wp-content/plugins/woocommerce-freshbooks/vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin.php:759
    SkyVerge\W\P\v\SV_WC_Plugin->load_class()
    wp-content/plugins/woocommerce-memberships.git/includes/frontend/class-wc-memberships-frontend.php:54
    WC_Memberships_Frontend->__construct()
    wp-content/plugins/woocommerce-freshbooks/vendor/skyverge/wc-plugin-framework/woocommerce/class-sv-wc-plugin.php:759
    SkyVerge\W\P\v\SV_WC_Plugin->load_class()
    wp-content/plugins/woocommerce-memberships.git/class-wc-memberships.php:328
    WC_Memberships->frontend_includes()
    wp-content/plugins/woocommerce-memberships.git/class-wc-memberships.php:258
    WC_Memberships->includes()
    wp-content/plugins/woocommerce-memberships.git/class-wc-memberships.php:153
    WC_Memberships->init_plugin()
    wp-includes/class-wp-hook.php:288
    do_action('plugins_loaded')
    wp-settings.php:392

Should we somehow be smarter about when to get involved in parse_query or... 🤔

cc @unfulvio

@unfulvio
Copy link

hey @lkraav could I have a bit more context here, please? Thanks

@lkraav
Copy link
Author

lkraav commented Jan 16, 2020

Could I have a bit more context here.

Oops, I could've indeed mentioned this triggers simply by loading front (or any) page.

@unfulvio
Copy link

hmm I narrowed it down to the Frontend class; if I exclude everything other than that looks ok - seems an interaction with wc_memberships_get_members_area_endpoint() but I'm not sure yet exactly where/how and why

I am unfamiliar with this plugin here. From semver looks like it's still not an official 1.0 and I guess code is going to change until/if it makes it to core. Is there a reason why should it be considered a bug in Memberships or should we prioritize this on our end?

If there's anything we can change in Memberships please open an issue or PR in the repo.

Thanks

@westonruter
Copy link
Collaborator

At what WordPress action does wc_memberships_get_members_area_endpoint() happen at?

Where is the codebase for this plugin?

@unfulvio
Copy link

@westonruter

WooCommerce Memberships is a commercial WooCommerce plugin and the repository at https://github.com/skyverge/woocommerce-memberships has private access (@lkraav and I have access; there's a mirror on the Automattic/WooCommerce org: https://github.com/woocommerce/woocommerce-memberships).

wc_memberships_get_members_area_endpoint() is used in different parts of the plugin to return a query variable to extend the WooCommerce My Account page with a new endpoint. This function is sometimes used to filter query_vars. At init it is also used to call add_rewrite_endpoint().

We did not have reports similar to the one in OP related to other plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants