Git Product home page Git Product logo

pmpro-aweber's People

Contributors

andrewlimaza avatar dparker1005 avatar eighty20results avatar ermgit avatar femiyb avatar greathmaster avatar ideadude avatar jarrydlong avatar kimcoleman avatar messica avatar pippinsplugins avatar tutorempire avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pmpro-aweber's Issues

Uncaught Error: Class 'AWeberAPI' not found on AfiliateWP regististration?

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.

Illegal string offset 'id'

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
`

Problems on line 555

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,

Incorrect handling of Create Subscriber response in Aweber API

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:

https://api.aweber.com/#tag/Subscribers/paths/~1accounts~1{accountId}~1lists~1{listId}~1subscribers/post

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:

  1. Create a membership level
  2. set up the Aweber Add-on to assign multiple lists to a member when they register
  3. Sign up as a new member using that membership level.
  4. Observe that in Aweber that new subscriber is only subscribed to the first list.

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]):

  • [ x] I have deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro plugin is active.
  • [ x] This bug happens with a default WordPress theme active.
  • [ x] I can reproduce this bug consistently using the steps above.

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 

RESOLVED: Max 100 Aweber's lists

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.

API Rate Limit Errors during Expire Memberships

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.

Name Unknown

The field name is not being imported, what might be happening?
In place of the name in the list on Aweber remains "Unknown Name"

Unable to connect to the AWeber API

Describe the bug
You are unable to connect to AWeber.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Settings > PMPro AWeber Integration Options
  2. Connect to AWeber
  3. See error -

AWeberAPIException:
Type: APIUnreachableError
Msg : Unable to connect to the AWeber API. ()
Docs: https://labs.aweber.com/docs/troubleshooting

Screenshot
image

Expected behavior
You should be able to connect.

This came up in ticket (ID 507419) and I could replicate.

Isolating the problem:

  • I have deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro plugin is active.
  • This bug happens with a default WordPress theme active, or Memberlite.
  • I can reproduce this bug consistently using the steps above.

WordPress Environment

``` Paid Memberships Pro 2.11.2, AWeber Add On 1.3.3, WordPress 6.2.2, PHP 7.4.30 ```

User email Update

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.

Enhancement: Allow Multiselect fields to be unselected

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.

Subscriber update fails in `pmproaw_subscribe()`

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:

  • Users who have been removed from the list from losing a membership level and then regain that membership level will not be added back into list
  • pmpro_aweber_custom_fields filter will not have an affect when user changes/renews membership level

The 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:

  • Get the subscriber object (as in pmproaw_unsubscribe())
  • Set the status to 'subscribed'
  • Update custom fields if pmpro_aweber_custom_fields filter does not return empty
  • Save the subscriber

If they do not already exist, we should do what we are currently doing.

No exception handling in pmproaw_profile_update()

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.

Can't save changes without having chosen an All Users List

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.

double opt-in

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

PHP8 Errors Originating from the AWeber Library

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.