strangerstudios / pmpro-aweber Goto Github PK
View Code? Open in Web Editor NEWSync your WordPress users and members with AWeber lists.
Home Page: https://www.paidmembershipspro.com/add-ons/pmpro-aweber-integration/
Sync your WordPress users and members with AWeber lists.
Home Page: https://www.paidmembershipspro.com/add-ons/pmpro-aweber-integration/
When i edit Affiliates on AffiliateWP plugin or submit new registration from frontend in affiliate area i get "500 error" first, than i turn debug on and than i get :
Fatal error: Uncaught Error: Class 'AWeberAPI' not found in /home/test.cloudwaysapps.com/zzazfhvsnt/public_html/wp/wp-content/plugins/pmpro-aweber/pmpro-aweber.php:87 Stack trace: #0 /home/test.cloudwaysapps.com/zzazfhvsnt/public_html/wp/wp-content/plugins/pmpro-aweber/pmpro-aweber.php(312): pmproaw_getAccount() #1 /home/test.cloudwaysapps.com/zzazfhvsnt/public_html/wp/wp-includes/plugin.php(525): pmproaw_profile_update(1, Object(WP_User)) #2 /home/test.cloudwaysapps.com/zzazfhvsnt/public_html/wp/wp-includes/user.php(1661): do_action('profile_update', 1, Object(WP_User)) #3 /home/test.cloudwaysapps.com/zzazfhvsnt/public_html/wp/wp-includes/user.php(1761): wp_insert_user(Array) #4 /home/test.cloudwaysapps.com/zzazfhvsnt/public_html/wp/wp-content/plugins/affiliate-wp/includes/class-register.php(263): wp_update_user(Array) #5 /home/test.cloudwaysapps.com/zzazfhvsnt/public_html/wp/wp-content/plugins/affiliate-wp/includes/class-register.php(144): Affiliate_WP_Register->register_ in /home/test.cloudwaysapps.com/zzazfhvsnt/public_html/wp/wp-content/plugins/pmpro-aweber/pmpro-aweber.php on line 87
When i deactivate pmpro-aweber plugin, than it works fine.
NOTE: I am using PHP 7.
Inside pmproaw_init you call AWeberAPI from
/includes/aweber_api/aweber_api.php
if class not exists. AWeberAPI class is in aweber.php,
I solve it now with adding
if(!class_exists("AWeberAPI"))
{
require_once(dirname(__FILE__) . "/includes/aweber_api/aweber_api.php");
}
inside pmproaw_getAccount function in pmpro-aweber.php file, in try block. Please fix this in next update. It looks like pmpro-aweber is not initalized from affiliatewp plugin, that is why i fix this by adding following code.
I get this error when I delete a user & registering a new user.
`
Warning: Illegal string offset 'id' in /var/sites/t/site.com/public_html/wp-content/plugins/pmpro-aweber/pmpro-aweber.php on line 221
Warning: Cannot modify header information - headers already sent by (output started at /var/sites/t/site.com/public_html/wp-content/plugins/pmpro-aweber/pmpro-aweber.php:221) in /var/sites/t/site.com.com/public_html/wp-includes/pluggable.php on line 1228
`
After adding the authorization code given by aweber, and saving the changes from the dashboard I'm shown with the following message.
Fatal error: Class 'AWeberAPI' not found in /home/content/74/6421774/html/testecosistemadigital/wp-content/plugins/pmpro-aweber-master/pmpro-aweber.php on line 555
I'm not sure if I needed to add the API before saving the changes manually or if it supposed to get it from the authorization code that input previously.
Would you let me know how to fix this? Also I am not able to return to the previous configuration of the plugin.
Thanks,
Describe the bug
A client is trying to use this plugin to assign new members to multiple lists in Aweber. However, the member would only ever be added to the first list. Debugging this further we were seeing what appeared to be an OAuth error with a message of:
[message] => Unable to connect to the AWeber API. ()
This didn't seem correct as the auth was working enough to actually create the new subscriber and assign them to the first list as defined in the Addon settings. This was also accompanied by an error in the logs:
[28-Aug-2023 22:44:57 UTC] PHP Warning: Undefined property: OAuthApplication::$error in wp-content/plugins/pmpro-aweber/includes/aweber_api/oauth_application.php on line 481
This got me looking at the code in includes/aweber_api/oauth_application.php... notably line 480 and the if statement itself:
if (!$resp || empty( $resp->body ) ) {
$msg = 'Unable to connect to the AWeber API. (' . $this->error . ')';
$error = array('message' => $msg, 'type' => 'APIUnreachableError',
'documentation_url' => 'https://labs.aweber.com/docs/troubleshooting');
throw new AWeberAPIException($error, $url);
}
The symptoms we are seeing pointed to the 'error' property not existing which it should if in fact there was an error. However, it doesn't exist and we're only getting to that point if the '$resp' variable is empty/false or the 'body' property is empty.
To investigate the status of these variables, I added in some error_log() statements and I got the following information:
Call to makeRequest() with params:
$method => POST
$url => https://api.aweber.com/1.0/accounts/12345/lists/67890/subscribers
$data => Array
(
[ws.op] => create
[email] => [email protected]
[name] =>
[update_existing] => true
[status] => subscribed
)
$oauth: Array
(
[email] => [email protected]
[name] =>
[oauth_consumer_key] => ***HIDDEN***
[oauth_nonce] => ***HIDDEN***
[oauth_signature] => ***HIDDEN***
[oauth_signature_method] => HMAC-SHA1
[oauth_timestamp] => 1693262697
[oauth_token] => ***HIDDEN***
[oauth_version] => 1.0
[status] => subscribed
[update_existing] => true
[ws.op] => create
)
$resp: CurlResponse Object
(
[body] =>
[headers] => Array
(
[Http-Version] => 1.1
[Status-Code] => 201
[Status] => 201 Created
[Date] => Mon, 28 Aug 2023 22:44:57 GMT
[Content-Type] => text/html; charset=UTF-8
[Transfer-Encoding] => chunked
[Connection] => keep-alive
[Location] => https://api.aweber.com/1.0/accounts/12345/lists/67890/subscribers/1234567890
[CF-Cache-Status] => DYNAMIC
[Server] => cloudflare
[CF-RAY] => 7fe014f38e92a6f4-PHX
)
)
The oAuth variables (although hidden in the text above) were all valid (as evidenced by the fact we are getting a valid 201 response from the server). Checking the API docs for the Aweber API, we can see that the response for a Create Subscriber is a 201 response code with an empty body:
Which brings us back to the 'if' block in makeRequest() and the empty 'body' property check... For this particular case, an empty body is NOT an error. It is an expected response. The error handling should actually check the status code of the response not whether or not a body property is empty.
To Reproduce
Steps to reproduce the behavior:
Screenshots
If applicable, please attach a screenshot to make your issue clearer.
Expected behavior
Member is added to multiple lists. The Aweber API library is enhanced to use the status codes rather than an empty 'body' property check.
Isolating the problem (mark completed items with an [x]):
WordPress Environment
WordPress 6.2.2
PHP 8.2.9
Divi 4.22.0
Active Plugins
- Paid Memberships Pro v2.12.2
- Paid Memberships Pro - Affiliates Add On v0.6
- Paid Memberships Pro - AWeber Add On v1.3.3
- User Menus v1.3.2
- User Switching v1.7.0
This Add On needs to be localized.
We send the PMPLEVELID and PMPLEVEL as custom fields in Mailchimp - it would be beneficial to do the same in this Add On.
I know this can be done with a recipe but will also be handy to follow the same behavior.
In the page settings of the plugin, there are listed only the first 100 lists of the Aweber account linked, in order by ID.
In Aweber i have 155 lists and, obviosuly, the lists dedicated at PMPRO are after the firsts 100, so i can't link the membership level with relative list.
Any idea?
Regards, Fabio.
The membership site that I am dealing with has around 30 email lists and 10 membership levels because it has been around for a while. If a user has two memberships and they expire then the PmPro chron expire task takes care of unsubscribing the User.
However, if the Expire Memberships Chron job has more than a total of 2 memberships to expire then this integration produces Rate Limit API errors with the setup listed above. I had to implement my own error messaging in the Catch part of this integration to figure it out. From what I found, this integration loops through all the email lists in the system for some reason making API call(s) in order to unsubscribe a User.
It seems like this is rather inefficient. Perhaps a bulk unsubscribe endpoint would be good. Also, it would be nice if the "Catch" code was implemented by the plugin with a switch to show/log errors to stdout or a file. Now if we update the plugin my painstakingly written error catch code will be wiped out.
The field name is not being imported, what might be happening?
In place of the name in the list on Aweber remains "Unknown Name"
We've had a handful of requests for adding support for tags. This is not currently supported but will be considered for future development.
An alternative workaround, for the time being, is to add a custom field that gets sent with the request for a subscriber which you can then filter/segment your audience list by.
This recipe should do the trick: https://gist.github.com/JarrydLong/5505476b29953c471a8bdbe4ec6f4a60
When moving/upgrading a user to next level, the user is not added to the new level list.
Describe the bug
You are unable to connect to AWeber.
To Reproduce
Steps to reproduce the behavior:
AWeberAPIException:
Type: APIUnreachableError
Msg : Unable to connect to the AWeber API. ()
Docs: https://labs.aweber.com/docs/troubleshooting
Expected behavior
You should be able to connect.
This came up in ticket (ID 507419) and I could replicate.
Isolating the problem:
WordPress Environment
I was looking at the code and I have a doubt on function pmproaw_profile_update
.
When it searches for the subscriber in the lists it does
//find subscriber
$subscribers = $aw_list->subscribers;
$params = array('status' => 'subscribed');
$found_subscribers = $subscribers->find($params);
My question is:
Shouldn't it add the old email address in the $params
array to search for the subscriber (line in the pmproaw_unsubscribe
function)?
I didn't test if it works since I don't want to risk losing my lists.
Multiselect fields can't be unselected after a level/list has been chosen.
It would be better to be able to unselect a list from the 'All Users' setting for the cases where an admin doesn't want all users to be subbed and only for members to be subbed.
Every time that pmproaw_subscribe()
is called, it tries to create a new subscriber in AWeber. If a subscriber with the same email already exists, the call to create a new one fails. This causes a couple of issues:
pmpro_aweber_custom_fields
filter will not have an affect when user changes/renews membership levelThe solution would be to have two branches in that function: one if the subscriber exists in the AWeber list and one if they do not exist.
If they do already exist, we should:
pmproaw_unsubscribe()
)pmpro_aweber_custom_fields
filter does not return emptyIf they do not already exist, we should do what we are currently doing.
I've occasionally been getting unhandled exceptions when processing users. Whenever it happens, I forget to grab the stack tracer, but it looks - after a very quick review - as if function pmproaw_profile_update($user_id, $old_user_data){}
is the only place where you're doing something with the AWeber API and you're not wrapping the activity in a try/catch pair.
After creating a new Membership Level, I wanted to assign it an Aweber list via this add-on. I've done this successfully twice in the past and it worked as expected.
However, this time, this Add On refused to save my change.
Through testing, I discovered that an All Users List must now be selected. Only then can I save changes in this Add On. However, I haven't been using an All Users List until now because my Levels' subscribers are unrelated.
I think this issue was introduced with version 1.3.
If unsubscribe from level change is set to NO, members should remain on their lists when they expire or change their level.
This is not happening, members are getting unsubscribed when they expire.
The version number for the add-on is still v0.2 (in the .php file) even though the readme states the version should be .4.
Hi there,
I was looking forward to use this AWeber-plugin (which is great!). After doing a few tests I noticed that it is not possible to shut of double opt-in - if I use my AWeber account directly, I can do that though. Is there any way to shut it off for that plugin, too? it's important because otherwise I won't be using it in the future, just too much hassle for my subscribers... thanks a lot in advance! regards, Kathrin
Tested with:
PMPro 2.10.2 & 3.0
Aweber 1.3.2
PHP 8.1.9
These errors are present on the Plugins page after activating and the PMPro AWeber settings pages
Deprecated: Return type of AWeberCollection::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_collection.php on line 165
Deprecated: Return type of AWeberCollection::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_collection.php on line 213
Deprecated: Return type of AWeberCollection::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_collection.php on line 163
Deprecated: Return type of AWeberCollection::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_collection.php on line 164
Deprecated: Return type of AWeberCollection::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_collection.php on line 239
Deprecated: Return type of AWeberCollection::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_collection.php on line 247
Deprecated: Return type of AWeberCollection::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_collection.php on line 243
Deprecated: Return type of AWeberCollection::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_collection.php on line 255
Deprecated: Return type of AWeberCollection::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_collection.php on line 251
Deprecated: Return type of AWeberCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_collection.php on line 265
Deprecated: Return type of AWeberEntryDataArray::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_entry_data_array.php on line 22
Deprecated: Return type of AWeberEntryDataArray::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_entry_data_array.php on line 26
Deprecated: Return type of AWeberEntryDataArray::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_entry_data_array.php on line 30
Deprecated: Return type of AWeberEntryDataArray::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_entry_data_array.php on line 36
Deprecated: Return type of AWeberEntryDataArray::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_entry_data_array.php on line 18
Deprecated: Return type of AWeberEntryDataArray::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_entry_data_array.php on line 44
Deprecated: Return type of AWeberEntryDataArray::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_entry_data_array.php on line 52
Deprecated: Return type of AWeberEntryDataArray::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_entry_data_array.php on line 48
Deprecated: Return type of AWeberEntryDataArray::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_entry_data_array.php on line 56
Deprecated: Return type of AWeberEntryDataArray::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-aweber\includes\aweber_api\aweber_entry_data_array.php on line 40
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.