diff --git a/lib/convertkit-api.php b/lib/convertkit-api.php index 350e2b1e2..f3d2b5bdd 100644 --- a/lib/convertkit-api.php +++ b/lib/convertkit-api.php @@ -176,12 +176,11 @@ public function get_resource($url) { } } - // if the markup includes DOCTYPE this is probably a 404 - if ( strpos( $html, 'DOCTYPE html' ) ){ - $this->log('Error: URL (' . $url .') returning page content. ' . $html->save() ); - $this->markup[$url] = $resource = ''; - } else { + // check `status_code` for 200, otherwise log error + if ( '200' == $response['response']['code'] ) { $this->markup[$url] = $resource = $html->save(); + } else { + $this->log('Status Code (' . $response['response']['code'] . ') for URL (' . $url .'): ' . $html->save() ); } } } diff --git a/readme.txt b/readme.txt index 9ae1c3753..112b9685f 100755 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://convertkit.com Tags: email, marketing, embed form, convertkit, capture Requires at least: 3.6 Tested up to: 4.7.3 -Stable tag: 1.4.5 +Stable tag: 1.4.6 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -44,6 +44,10 @@ Yes, for it to work you must first have an account on ConvertKit.com == Changelog == +### 1.4.6 2017-03-29 +* Fix for landing pages not appearing. +* Added code to API to not return status_code 404 content + ### 1.4.5 2017-03-28 * Uncommented logging around api calls. * Do not show 404 page content when shortcode is used with form ID that does not exist diff --git a/wp-convertkit.php b/wp-convertkit.php index 646f09ccd..caed04244 100644 --- a/wp-convertkit.php +++ b/wp-convertkit.php @@ -3,7 +3,7 @@ * Plugin Name: WP ConvertKit * Plugin URI: http://convertkit.com/ * Description: Quickly and easily integrate ConvertKit forms into your site. - * Version: 1.4.5 + * Version: 1.4.6 * Author: ConvertKit * Author URI: http://convertkit.com/ * Text Domain: convertkit @@ -20,7 +20,7 @@ */ class WP_ConvertKit { - const VERSION = '1.4.5'; + const VERSION = '1.4.6'; const POST_META_KEY = '_wp_convertkit_post_meta';