Repository navigation
[bug-fix] [admin-menu] Wrapped upgrade menu in a conditional to check for paid plans - fixes #4 - #5
LateButEarly wants to merge 2 commits into
Conversation
… for paid plans - fixes #4
|
Oops, I just noticed this was pulled to master. Let me know if this should be pulled to dev. |
… upgrade link to action links - similar to #4
|
Hey @irkanu, that's our first pull-request - #exciting! Thanks for spending the time to check the code. I'm not sure if you noticed, but the last param of
Let me know if you still think that a pull request is required. |
It appears that `$this->_parent` can contain either an object or a boolean. This should resolve the error by checking that it's an object before attempting to use the method `->is_anonymous()`. It looks like `$this->_parent` is used in other places in this class. Unknown if the `boolean` vs. `object` detail effects any other functionality. Error attempting to be resolved: ``` An error of type E_ERROR was caused in line 23432 of the file wp-content/plugins/pods/vendor/freemius/wordpress-sdk/includes/class-freemius.php. Error message: Uncaught Error: Call to a member function is_anonymous() on bool in wp-content/plugins/pods/vendor/freemius/wordpress-sdk/includes/class-freemius.php:23432 Stack trace: #0 wp-content/plugins/pods/vendor/freemius/wordpress-sdk/includes/class-freemius.php(2051): Freemius->_add_tracking_links() Freemius#1 wp-includes/class-wp-hook.php(303): Freemius->_hook_action_links_and_register_account_hooks('') Freemius#2 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array) Freemius#3 wp-includes/plugin.php(470): WP_Hook->do_action(Array) Freemius#4 wp-admin/admin.php(175): do_action('admin_init') Freemius#5 wp-admin/plugins.php(10): require_once('/home/ekhulnac/...') Freemius#6 {main} ```
I wanted to leave a few notes here:
My conditional checks the _has_paid_plans attribute; however, the conditionals only a few lines above this check using a _has_addons function.
I think these should be consistent throughout the code - for example, maybe we could benefit from having a _has_paid_plans function? I'm not sure how you want to keep that structured, but it was kind of confusing having some internal functions using _has_xyz returning their _has_xyz attribute.
Let me know if I can be of any help. 👍