Simple Membership Plugin › Forums › Simple Membership Plugin › SMPError when loading page Mysite/membership-login/membership-profile/
Tagged: error, membership login, membership-profile, SwpmUtils
- This topic has 14 replies, 5 voices, and was last updated 1 year, 8 months ago by
admin.
-
AuthorPosts
-
December 26, 2021 at 6:16 pm #23405
Ralf
ParticipantThe result from loading this standard page Mysite/membership-login/membership-profile/ is:
Warning: Attempt to read property “membership_level” on null in /customers/b/f/0/activeskaters.se/httpd.www/members/wp-content/plugins/simple-membership/classes/class.swpm-utils.php on line 78
Exception thrown
subcript_period parameter must be integer in SwpmUtils::calculate_subscription_period_days methodAll other pages like Mysite/membership-login/xxxxxx and Mysite/xxxxxxx work without any issues or errors.
I run WordPress 5.8.2 and latest plugin version 4.0.8
The PHP version on my host is 7.4Any suggestion as to what could be wrong and what I should do to solve this?
December 28, 2021 at 1:21 am #23406mbrsolution
ModeratorHi, please check the following documentation to make sure the membership-profile page exists in your site.
https://simple-membership-plugin.com/recreating-required-pages-simple-membership-plugin/
Let me know how you go.
Regards.
December 28, 2021 at 10:33 am #23407Ralf
ParticipantThanks for the reply!
I was perhaps not clear regarding the problem. The membership-profile page does exist. If I go to the login page FIRST and THEN to the membership-profile page it works just fine.
If I go a any member restricted page directly, all pages show me the login page first and then, after login, I am redirected to the correct member restricted page. This was the behaviour I had with the memberhip profile page too. This is how I have set up the site for about 2 years ago. But is doesn’t work like that any more for the profile page; for all other restricted pages it does work.
Could it be a PHP-version related problem? My settings at my host (one.com) are the “latest supported version” which is 7.4 at this moment
Any suggestions?December 28, 2021 at 10:57 am #23409Ralf
ParticipantI think I found something…
It could be related to the type of editor I use in the WP admin zone: block- or classic editor. I have used classic for that specific profile page. All other pages are created with the block editor, but not the profile page. When I open the WP page in WP admin mode, and I open it with “block-editor”, I get the same fault:Exception thrown
subcript_period parameter must be integer in SwpmUtils::calculate_subscription_period_days methodWhen I open the WP page in WP admin with the classic editor, it shows just fine.
When I try to switch the page from being a classic-editor page to a blockeditor page (option in settings: “convert to blockeditor”), I get the same error as mentioned above.Anyhow, it seems like a real “plugin / WP problem”! I may not be the only one with this problem?
Any suggestions?December 28, 2021 at 11:58 am #23411mbrsolution
ModeratorHi,
This might be related to the way your theme works. Can you delete the profile page and crate a new profile page following the instructions above but this time use the block editor instead.
Let me know what happens.
Thank you.
December 28, 2021 at 1:54 pm #23412Ralf
ParticipantHi, I created a new (identical in text) page with the block editor, with the same results.
However, as soon as I removed all commands like:[/swpm_protected]
[swpm_protected for=”3-9-11-12″ do_not_show_protected_msg=”1″]
[swpm_show_member_info column=”expiry_date”]the page shows and works as it should.
(P.S. The command [swpm_profile_form] seems to be accepted though when saving in WP without any objections)When I leave the lines in, I cannot save the page as a draft. I get the error message in a red box :
“Uppdatering misslyckades. Svaret är inget giltigt JSON-svar”, which is in English:“Update failed. Response is not a valid JSON-reply” (or something very close to that…)
I use the swmp-protected-command to show different messages on the profile page for different membership levels. This is the only page where this command is used. So the problem doesn’t seem to depend on the type of editor (or perhaps not even on the WP-theme), but the swmp commands.
Any suggestions?December 28, 2021 at 3:15 pm #23414Ralf
ParticipantUpdate: I isolated the sole cause of the error to be the command:
[swpm_show_member_info column=”expiry_date”]
When I remove this command, which I added manually to the profile page (and which worked just fine before!) and leave the other codes in, everything works as it should!
Can this command be checked/changed so it works again?Thanks
December 29, 2021 at 3:51 am #23417mbrsolution
ModeratorHi, I just finished carrying out a test in my dev site and it is working well for me. I am using WordPress 5.8.2, latest plugin version SWPM 4.0.8 and PHP version 7.4.24. I am also running the latest Show Member Info Addon version 1.9.
The following documentation has the latest addon version if you are not running version 1.9 in your site.
https://simple-membership-plugin.com/simple-membership-addon-show-member-info/
Let me know if the information above helps you.
Thank you.
December 29, 2021 at 10:35 am #23418Ralf
ParticipantThis new version 1.9 of the Show Member Info Addon did unfortunately not solve my problem.
The page with the command [swpm_show_member_info column=”expiry_date”] on the profile page works when I first login and then go to the profile page. However, if I am not logged in and click on the link to the profile page, the error appears. This does not happen when I am not logged in and go to any other page in the members only area.
As soon as I remove the line: [swpm_show_member_info column=”expiry_date”]
from the profile page works again….December 29, 2021 at 12:09 pm #23420mbrsolution
ModeratorHi, please try the following troubleshooting steps.
Let me know if the steps above help you.
Thank you.
January 3, 2022 at 12:16 pm #23433Ralf
ParticipantI can’t find any conflicting plugins.
I use other commands from the same plugin, like hiding and showing specific info for different members groups and I also use a command for showing the name of the logged-in user on the webpage, but this specific command doesn’t work…
I can’t solve this. To me it seems like a problem with the specific command
[swpm_show_member_info column=”expiry_date”]
I removed it from the webpage, as it creates a crash of the webpage in which it is used.June 22, 2024 at 8:12 am #28302Ced
ParticipantI got this error on a fresh install of wordpress and plugin.
I got this error because I created a member before creating a subscription.
To solve it I restarted the installation and in the simplemembership menus I started by creating a membership level and then the member by giving him this membership level and I no longer have the error.There’s a bug in the plugin though, because if you have a member without a subscription level, the member’s edit form isn’t displayed in full, so you can’t modify or delete the misconfigured member.
Translated with DeepL.com (free version)
June 23, 2024 at 12:03 am #28303The Assurer
ModeratorThe developer has been notified.
June 27, 2024 at 6:50 am #28316admin
KeymasterThank you. We will add a safeguard to the plugin. If no membership level is configured on the site, it will display an appropriate message to prevent this error.
July 8, 2024 at 1:21 am #28356admin
KeymasterThe new version that we have released should solve this.
-
AuthorPosts
- You must be logged in to reply to this topic.