convertkit / convertkit-wordpress Goto Github PK
View Code? Open in Web Editor NEWA WordPress plugin for embedding ConvertKit forms and landing pages into your blog.
License: GNU General Public License v3.0
A WordPress plugin for embedding ConvertKit forms and landing pages into your blog.
License: GNU General Public License v3.0
Update the wp_remote_get headers to include:
"Accept-Encoding: gzip"
ref: https://secure.helpscout.net/conversation/334213931/65453/?folderId=956509
If the customer installs and activates the plugin, but does not have forms created add a link to convertkit.com URL to crate a form.
Use this link:
https://app.convertkit.com/landing_pages/new
There have been several tickets where a customer enters their API credentials, but no forms are displayed.
These are sometimes due to the host blocking the outbound connection. If this is the case plugin needs to display a message like (“Hey, looks like your host is blocking outbound connections… KB article)
Add a way to map categories to forms so that any post in that category would have the form added to it.
reference: https://wordpress.org/support/topic/associate-a-form-with-a-category/
I understand that the modal links are limited to a specific post.
However, it very difficult to prevent the content of that post from appearing on another page within the same Wordpress site (e.g., index, search, category pages). In those cases, clicking the link does absolutely nothing.
This is a very unfortunate user experience. I've hidden much of the links behind "read more" tags, but it's so easy to break.
Page load time is impacted when the API is slow/down. Load these in a different way to not impact the site.
ref: https://secure.helpscout.net/conversation/315662060/55572/?folderId=936326
These two tickets are having issues connecting to the CK API. The API is getting traffic, but the response is null, or garbled.
Research a better way to diagnose the connection to see why the response is not arriving, or is messed up.
https://secure.helpscout.net/conversation/377791705/88232/?folderId=956509
https://secure.helpscout.net/conversation/386510446/91535/?folderId=956509
Add a check for mb_string and show an alert if not found. This is causing a fatal error for hosts/sites without this PHP extension installed:
http://php.net/manual/en/mbstring.installation.php
Better yet, see why this is being used and remove it if not needed.
Reference: https://secure.helpscout.net/conversation/303176059/48220/
Check for an issue when CF7 and CK are enabled and the CF7 form doesn't have a CK form mapped.
ref:
https://secure.helpscout.net/conversation/324770539/60715/?folderId=956509
https://secure.helpscout.net/conversation/323390012/59974/?folderId=956509
"Any chance of getting the WP plugin fully internationalized, so it can be translated with language packs please?"
MultiValueFieldTable::column_default
has an illegal array key type. Either phpdoc is incorrect or function is.
Better yet, remove curl, and use wp_remote_request()
Link to support doc: http://help.convertkit.com/article/99-the-convertkit-wordpress-plugin
Question:
I used the plugin "All in One WP Migration" to migrate a WP install from one site to another. Now my site displays beautiful characters instead of the form:
The plugin isn't able to contact the API:
Also, uninstalling the convertkit plugin doesn't clear it's data. Upon a new install, my API and secret keys were already set up.
A curl command run from the server does retrieve the proper response.
What's changed?
php versions and mysql versions updated - php v 7.0 now.
The plugin's logging features leave much to be desired.
As a temporary fix, I've copied in the html of the sidebar form from the old site. However, I've left the widget below as a demonstration. It would also be nice to have the post-post forms working automatically...
Site admin can set default form for post types (post, page, product, event, etc), and taxonomies.
Currently, we are embedding via the embed_url
returned by the JSON for a particular form. We just underwent a process to update the embeds to display more consistently, adding a version attribute to not break earlier usages.
To use the new embed version, this URL to read the resource could be changed to:
https://forms.convertkit.com/{form_id}.html?api_key={api_key}&v=5
Customer's server can't connect to CK API.
When saving Settings page, no forms show up.
ConvertKitAPI::_get_api_response()
returns WP_Error
and an error message needs to be shown to the Administrator.
[02-Jun-2016 01:23:23 UTC] Response: WP_Error Object
(
[errors] => Array
(
[http_request_failed] => Array
(
[0] => couldn't connect to host
)
)
[error_data] => Array
(
)
)
reference: https://app.intercom.io/a/apps/e4n3xtxz/inbox/conversation/4897489997
The ConvertKit_API::log()
method was changed to use WP_Filesystem()
after the WP Coding standards audit, but this method isn't appending to the log file.
Change this to something else that will meet coding standards, yet append correctly.
Add integration for CF7 in style of Wishlist Member.
reference: https://secure.helpscout.net/conversation/255167797/16425/?folderId=936326
API version: 3
API endpoint: /v3/forms
Steps to recreate
I archived all forms in my CK account and when I opened the CK WP settings page I had a list of all forms in my drop down.
Looking at the array returned from the API there is no indicator that the form is active or archived. Can a status
or state
field be returned so archived forms are not shown in the WP plugin?
[forms] => Array
(
[0] => Array
(
[id] => 23887
[name] => Newsletter Form
[created_at] => 2016-02-10T02:44:21Z
[type] => embed
[url] => https://app.convertkit.com/landing_pages/23887
[embed_js] => https://api.convertkit.com/v3/forms/23887.js?api_key=[redacted]
[embed_url] => https://api.convertkit.com/v3/forms/23887.html?api_key=[redacted]
[title] => Join the newsletter
[description] => <p>Subscribe to get our latest content by email.</p>
[sign_up_button_text] => Subscribe
[success_message] => Success! Now check your email to confirm your subscription.
)
[1] => Array
(
[id] => 24139
[name] => Take My Class
[created_at] => 2016-02-11T04:03:34Z
[type] => embed
[url] => https://app.convertkit.com/landing_pages/24139
[embed_js] => https://api.convertkit.com/v3/forms/24139.js?api_key=[redacted]
[embed_url] => https://api.convertkit.com/v3/forms/24139.html?api_key=[redacted]
[title] => Take My Class
[description] => <p>Subscribe to get our latest content by email.</p>
[sign_up_button_text] => Subscribe
[success_message] => Success! Now check your email to confirm your subscription.
)
[2] => Array
(
[id] => 36594
[name] => Landing Page Class
[created_at] => 2016-03-28T17:17:49Z
[type] => hosted
[url] => https://app.convertkit.com/ancient-cherry-5193/HNIXGGPC
[embed_js] => https://api.convertkit.com/v3/forms/36594.js?api_key=[redacted]
[embed_url] => https://api.convertkit.com/v3/forms/36594.html?api_key=[redacted]
[title] => Join the newsletter
[description] => Subscribe to get our latest content by email.
[sign_up_button_text] => Subscribe
[success_message] => Success! Now check your email to confirm your subscription.
)
The plugin needs a logger to capture:
The shortcode [convertkit]
is used to insert forms in the middle of content on posts/pages with the metabox Form dropdown set to "None".
It would be good to add a shortcode attribute to choose the form to be displayed instead of just using the global default form setting.
ref: https://wordpress.org/support/topic/form-specific-shortcode?replies=2
Currently shortcodes with incorrect form IDs show a 404 (see below).
Update this to not display, or tell admin that form not found.
ref: https://secure.helpscout.net/conversation/313973501/54596/?folderId=956509
I notice that you're building for php 5.3, but not 7.0.
Please fix that?
This is an update to the version in the API call.
We're requesting all forms in the get_form_embed
method, which is called on every page load: https://github.com/ConvertKit/ConvertKit-WordPress/blob/47293186769d87c27da7c2d351e4e767c8f71b95/wp-convertkit.php#L304-L310
Since it won't be showing an error anymore if the form is not available I think we can remove this extra request.
Indent files with tab not spaces. Reference: WP Coding Standards
Update ConvertKitAPI::make_request()
to use wp_remote_request()
insead of curl.
https://github.com/ConvertKit/ConvertKit-WordPress/blob/master/lib/convertkit-api.php#L226
It confuses password managers, and it's not that secret
I need some feedback and guidance on how to handle the use of shortcodes in this plugin to display forms.
These are possible uses of the plugin's shortcode. Both of these uses requires the ConvertKit meta box on that page to have Form set to "None" and Landing Page set to "None" like this:
[convertkit]
shortcode added to a post or page will add the global Default Form to the content. If the Default Form setting is "None" no form is added.form
then the specific form is added to the page. This attribute expects the V2
ID Example: [convertkit form='4835722']
ConvertKitAPI::get_resources()
no form is shown.Version 1.4.1 introduces V3
API calls to the ConvertKitAPI
class. The method ConvertKitAPI::_get_api_responses()
now uses a V3
endpoint.
id
that would be the V3
form_id
.[convertkit id='23887']
form
attribute. To maintain backwards compatibility for any customers using the form
attribute the API should keep a V2
endpoint call for getting the form markup.[convertkit]
Display global form using a V3
form_id.[convertkit form='99999999']
Display specific form using a V2
ID.[convertkit id='99999']
Display specific form using a V3
form_id.WP_ConvertKit::get_form_embed()
needs some refactoring to handle these cases and it's where I'm getting hung up.In ConvertKitAPI::_get_api_response()
and any other place wp_remote_get()
is used, check response [status_code]
and if not 200 log error and don't return [body]
.
This is a better fix than b47af9e
If a customer has more than 10 CF7 forms only the first 10 show on the CK mapping page.
This is caused by the WP_Query
in ConvertKit_Settings_ContactForm7::get_cf7_forms()
using the default posts_per_page
option.
ref: https://secure.helpscout.net/conversation/395371766/95616/?folderId=956509
ConvertKit_API::get_resource() call is sometimes returning zipped content in the body:
[body] => �W[o�6�~N~�� �PD�smc'��a��
ŀ���P��xdq�D��ri���CR�IGN�!�����;7��+UH�i�dq�TZwj9�S�@�Y!�;���k�l������{�6�W�tw}r��\͝���+��HQ#�uR�f��
Add check for this and inflate if needed.
If we are upgrading from <1.4.0 we should convert the default form id to the new api v3 form id.
We'll add a method in the api to deal with that.
Several customers have reported that they will add a form in ConvertKit, then go to their WP site and look for it on the settings page.
The settings page uses a transient for the API call so it might take up to 5 minutes for the form to refresh.
Either:
Cleanup findings from PHP CS scan.
Remove ConvertKitAPI::form_unsubscribe()
since V3 of the API does not support it.
Currently _get_api_response
is being called every page load in dashboard. Refactor to not load during reister_widgets
, or use transient.
Remove use of extract()
from WP_ConvertKit::get_form_embed()
.
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.