Changeset 3399367
- Timestamp:
- 11/20/2025 04:35:05 AM (4 months ago)
- Location:
- convertkit-membermouse
- Files:
-
- 8 edited
- 1 copied
-
tags/1.3.5 (copied) (copied from convertkit-membermouse/trunk)
-
tags/1.3.5/convertkit-membermouse.php (modified) (2 diffs)
-
tags/1.3.5/languages/convertkit-mm.pot (modified) (2 diffs)
-
tags/1.3.5/readme.txt (modified) (2 diffs)
-
tags/1.3.5/vendor/convertkit/convertkit-wordpress-libraries/src/class-convertkit-api-v4.php (modified) (5 diffs)
-
trunk/convertkit-membermouse.php (modified) (2 diffs)
-
trunk/languages/convertkit-mm.pot (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/vendor/convertkit/convertkit-wordpress-libraries/src/class-convertkit-api-v4.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
convertkit-membermouse/tags/1.3.5/convertkit-membermouse.php
r3369643 r3399367 16 16 * Plugin URI: http://www.kit.com 17 17 * Description: This plugin integrates Kit with MemberMouse. 18 * Version: 1.3. 418 * Version: 1.3.5 19 19 * Author: Kit 20 20 * Author URI: https://kit.com … … 35 35 define( 'CONVERTKIT_MM_URL', plugin_dir_url( __FILE__ ) ); 36 36 define( 'CONVERTKIT_MM_PATH', plugin_dir_path( __FILE__ ) ); 37 define( 'CONVERTKIT_MM_VERSION', '1.3. 4' );37 define( 'CONVERTKIT_MM_VERSION', '1.3.5' ); 38 38 define( 'CONVERTKIT_MM_OAUTH_CLIENT_ID', 'U4aHnnj_QgRrZOdtWUJ6vtpulZSloLKn-7e551T-Exw' ); 39 39 define( 'CONVERTKIT_MM_OAUTH_CLIENT_REDIRECT_URI', 'https://app.kit.com/wordpress/redirect' ); -
convertkit-membermouse/tags/1.3.5/languages/convertkit-mm.pot
r3369643 r3399367 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Kit (formerly ConvertKit) for MemberMouse 1.3. 4\n"5 "Project-Id-Version: Kit (formerly ConvertKit) for MemberMouse 1.3.5\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/convertkit-membermouse\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025- 09-29T02:50:58+00:00\n"12 "POT-Creation-Date: 2025-11-20T03:48:43+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" -
convertkit-membermouse/tags/1.3.5/readme.txt
r3369643 r3399367 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.1 8 Stable tag: 1.3. 48 Stable tag: 1.3.5 9 9 License: GPLv3 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 40 40 41 41 == Changelog == 42 43 ### 1.3.5 2025-11-20 44 * Updated: Use WordPress Libraries 2.1.1 42 45 43 46 ### 1.3.4 2025-09-29 -
convertkit-membermouse/tags/1.3.5/vendor/convertkit/convertkit-wordpress-libraries/src/class-convertkit-api-v4.php
r3369643 r3399367 378 378 if ( is_wp_error( $result ) ) { 379 379 $this->log( 'API: Error: ' . $result->get_error_message() ); 380 381 /** 382 * Perform any actions when obtaining an access token fails. 383 * 384 * @since 2.1.1 385 * 386 * @param WP_Error $result Error from API. 387 * @param string $client_id OAuth Client ID. 388 */ 389 do_action( 'convertkit_api_get_access_token_error', $result, $this->client_id ); 390 380 391 return $result; 381 392 } … … 415 426 if ( is_wp_error( $result ) ) { 416 427 $this->log( 'API: Error: ' . $result->get_error_message() ); 428 429 /** 430 * Perform any actions when refreshing an expired access token fails. 431 * 432 * @since 2.1.1 433 * 434 * @param WP_Error $result Error from API. 435 * @param string $client_id OAuth Client ID. 436 */ 437 do_action( 'convertkit_api_refresh_token_error', $result, $this->client_id ); 438 417 439 return $result; 418 440 } … … 1433 1455 // Return the API error message as a WP_Error if the HTTP response code is a 4xx code. 1434 1456 if ( $http_response_code >= 400 ) { 1457 1435 1458 // Define the error message. 1436 1459 $error = $this->get_error_message_string( $response ); … … 1439 1462 1440 1463 switch ( $http_response_code ) { 1441 // If the HTTP response code is 401, and the error matches 'The access token expired', refresh the access token now1442 // and re-attempt the request.1443 1464 case 401: 1444 if ( $error !== 'The access token expired' ) { 1445 break; 1465 switch ( $error ) { 1466 case 'The access token expired': 1467 // Attempt to refresh the access token. 1468 $result = $this->refresh_token(); 1469 1470 // If an error occured, bail. 1471 if ( is_wp_error( $result ) ) { 1472 return $result; 1473 } 1474 1475 // Attempt the request again, now we have a new access token. 1476 return $this->request( $endpoint, $method, $params, false ); 1477 1478 case 'The access token is invalid': 1479 $error = new WP_Error( 1480 'convertkit_api_error', 1481 $error, 1482 $http_response_code 1483 ); 1484 1485 /** 1486 * Perform any actions when an invalid access token was used. 1487 * 1488 * @since 2.1.1 1489 * 1490 * @param WP_Error $error WP_Error object. 1491 * @param string $client_id OAuth Client ID. 1492 */ 1493 do_action( 'convertkit_api_access_token_invalid', $error, $this->client_id ); 1494 1495 // Return error. 1496 return $error; 1497 1498 default: 1499 return new WP_Error( 1500 'convertkit_api_error', 1501 $error, 1502 $http_response_code 1503 ); 1446 1504 } 1447 1505 1448 // Don't automatically refresh the expired access token if we're not on a production environment.1449 // This prevents the same ConvertKit account used on both a staging and production site from1450 // reaching a race condition where the staging site refreshes the token first, resulting in1451 // the production site unable to later refresh its same expired access token.1452 if ( ! $this->is_production_site() ) {1453 break;1454 }1455 1456 // Refresh the access token.1457 $result = $this->refresh_token();1458 1459 // If an error occured, bail.1460 if ( is_wp_error( $result ) ) {1461 return $result;1462 }1463 1464 // Attempt the request again, now we have a new access token.1465 return $this->request( $endpoint, $method, $params, false );1466 1467 // If a rate limit was hit, maybe try again.1468 1506 case 429: 1469 1507 // If retry on rate limit hit is disabled, return a WP_Error. … … 1489 1527 1490 1528 return $response; 1491 1492 }1493 1494 /**1495 * Helper method to determine the WordPress environment type, checking1496 * if the wp_get_environment_type() function exists in WordPress (versions1497 * older than WordPress 5.5 won't have this function).1498 *1499 * @since 2.0.21500 *1501 * @return bool1502 */1503 private function is_production_site() {1504 1505 // If the WordPress wp_get_environment_type() function isn't available,1506 // assume this is a production site.1507 if ( ! function_exists( 'wp_get_environment_type' ) ) {1508 return true;1509 }1510 1511 return ( wp_get_environment_type() === 'production' );1512 1529 1513 1530 } -
convertkit-membermouse/trunk/convertkit-membermouse.php
r3369643 r3399367 16 16 * Plugin URI: http://www.kit.com 17 17 * Description: This plugin integrates Kit with MemberMouse. 18 * Version: 1.3. 418 * Version: 1.3.5 19 19 * Author: Kit 20 20 * Author URI: https://kit.com … … 35 35 define( 'CONVERTKIT_MM_URL', plugin_dir_url( __FILE__ ) ); 36 36 define( 'CONVERTKIT_MM_PATH', plugin_dir_path( __FILE__ ) ); 37 define( 'CONVERTKIT_MM_VERSION', '1.3. 4' );37 define( 'CONVERTKIT_MM_VERSION', '1.3.5' ); 38 38 define( 'CONVERTKIT_MM_OAUTH_CLIENT_ID', 'U4aHnnj_QgRrZOdtWUJ6vtpulZSloLKn-7e551T-Exw' ); 39 39 define( 'CONVERTKIT_MM_OAUTH_CLIENT_REDIRECT_URI', 'https://app.kit.com/wordpress/redirect' ); -
convertkit-membermouse/trunk/languages/convertkit-mm.pot
r3369643 r3399367 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Kit (formerly ConvertKit) for MemberMouse 1.3. 4\n"5 "Project-Id-Version: Kit (formerly ConvertKit) for MemberMouse 1.3.5\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/convertkit-membermouse\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025- 09-29T02:50:58+00:00\n"12 "POT-Creation-Date: 2025-11-20T03:48:43+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" -
convertkit-membermouse/trunk/readme.txt
r3369643 r3399367 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.1 8 Stable tag: 1.3. 48 Stable tag: 1.3.5 9 9 License: GPLv3 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 40 40 41 41 == Changelog == 42 43 ### 1.3.5 2025-11-20 44 * Updated: Use WordPress Libraries 2.1.1 42 45 43 46 ### 1.3.4 2025-09-29 -
convertkit-membermouse/trunk/vendor/convertkit/convertkit-wordpress-libraries/src/class-convertkit-api-v4.php
r3369643 r3399367 378 378 if ( is_wp_error( $result ) ) { 379 379 $this->log( 'API: Error: ' . $result->get_error_message() ); 380 381 /** 382 * Perform any actions when obtaining an access token fails. 383 * 384 * @since 2.1.1 385 * 386 * @param WP_Error $result Error from API. 387 * @param string $client_id OAuth Client ID. 388 */ 389 do_action( 'convertkit_api_get_access_token_error', $result, $this->client_id ); 390 380 391 return $result; 381 392 } … … 415 426 if ( is_wp_error( $result ) ) { 416 427 $this->log( 'API: Error: ' . $result->get_error_message() ); 428 429 /** 430 * Perform any actions when refreshing an expired access token fails. 431 * 432 * @since 2.1.1 433 * 434 * @param WP_Error $result Error from API. 435 * @param string $client_id OAuth Client ID. 436 */ 437 do_action( 'convertkit_api_refresh_token_error', $result, $this->client_id ); 438 417 439 return $result; 418 440 } … … 1433 1455 // Return the API error message as a WP_Error if the HTTP response code is a 4xx code. 1434 1456 if ( $http_response_code >= 400 ) { 1457 1435 1458 // Define the error message. 1436 1459 $error = $this->get_error_message_string( $response ); … … 1439 1462 1440 1463 switch ( $http_response_code ) { 1441 // If the HTTP response code is 401, and the error matches 'The access token expired', refresh the access token now1442 // and re-attempt the request.1443 1464 case 401: 1444 if ( $error !== 'The access token expired' ) { 1445 break; 1465 switch ( $error ) { 1466 case 'The access token expired': 1467 // Attempt to refresh the access token. 1468 $result = $this->refresh_token(); 1469 1470 // If an error occured, bail. 1471 if ( is_wp_error( $result ) ) { 1472 return $result; 1473 } 1474 1475 // Attempt the request again, now we have a new access token. 1476 return $this->request( $endpoint, $method, $params, false ); 1477 1478 case 'The access token is invalid': 1479 $error = new WP_Error( 1480 'convertkit_api_error', 1481 $error, 1482 $http_response_code 1483 ); 1484 1485 /** 1486 * Perform any actions when an invalid access token was used. 1487 * 1488 * @since 2.1.1 1489 * 1490 * @param WP_Error $error WP_Error object. 1491 * @param string $client_id OAuth Client ID. 1492 */ 1493 do_action( 'convertkit_api_access_token_invalid', $error, $this->client_id ); 1494 1495 // Return error. 1496 return $error; 1497 1498 default: 1499 return new WP_Error( 1500 'convertkit_api_error', 1501 $error, 1502 $http_response_code 1503 ); 1446 1504 } 1447 1505 1448 // Don't automatically refresh the expired access token if we're not on a production environment.1449 // This prevents the same ConvertKit account used on both a staging and production site from1450 // reaching a race condition where the staging site refreshes the token first, resulting in1451 // the production site unable to later refresh its same expired access token.1452 if ( ! $this->is_production_site() ) {1453 break;1454 }1455 1456 // Refresh the access token.1457 $result = $this->refresh_token();1458 1459 // If an error occured, bail.1460 if ( is_wp_error( $result ) ) {1461 return $result;1462 }1463 1464 // Attempt the request again, now we have a new access token.1465 return $this->request( $endpoint, $method, $params, false );1466 1467 // If a rate limit was hit, maybe try again.1468 1506 case 429: 1469 1507 // If retry on rate limit hit is disabled, return a WP_Error. … … 1489 1527 1490 1528 return $response; 1491 1492 }1493 1494 /**1495 * Helper method to determine the WordPress environment type, checking1496 * if the wp_get_environment_type() function exists in WordPress (versions1497 * older than WordPress 5.5 won't have this function).1498 *1499 * @since 2.0.21500 *1501 * @return bool1502 */1503 private function is_production_site() {1504 1505 // If the WordPress wp_get_environment_type() function isn't available,1506 // assume this is a production site.1507 if ( ! function_exists( 'wp_get_environment_type' ) ) {1508 return true;1509 }1510 1511 return ( wp_get_environment_type() === 'production' );1512 1529 1513 1530 }
Note: See TracChangeset
for help on using the changeset viewer.