$template_files List of template file paths.
+ */
+ $template_files = apply_filters(
+ '__unstable__simpay_payment_form_templates',
+ $template_files
+ );
+
if ( false === $template_files ) {
return array();
}
diff --git a/includes/core/post-types/simple-pay/edit-form-automations.php b/includes/core/post-types/simple-pay/edit-form-automations.php
new file mode 100644
index 00000000..e724e6ab
--- /dev/null
+++ b/includes/core/post-types/simple-pay/edit-form-automations.php
@@ -0,0 +1,165 @@
+>
+ */
+function get_automator_integrations() {
+ $upload_dir = wp_upload_dir();
+ $cache_dir = trailingslashit( $upload_dir['basedir'] );
+ $cache_file = $cache_dir . 'wpsp-uncanny-automator-integrations.json';
+
+ if ( ! file_exists( $cache_file ) ) {
+ return array();
+ }
+
+ $cache_file_contents = file_get_contents( $cache_file );
+
+ if ( false === $cache_file_contents ) {
+ return array();
+ }
+
+ $integrations = json_decode( $cache_file_contents, true );
+
+ if ( ! is_array( $integrations ) ) {
+ return array();
+ }
+
+ // Remove WP Simple Pay. We will create our own direct recipe link.
+ unset( $integrations['WPSIMPLEPAY'] );
+
+ shuffle( $integrations );
+
+ return $integrations;
+}
+
+/**
+ * Adds content for the "Automations" tab.
+ *
+ * @since 4.7.8
+ *
+ * @return void
+ */
+function add_automations() {
+ $integrations = get_automator_integrations();
+ $has_plugin = defined( 'AUTOMATOR_BASE_FILE' );
+
+ // If Uncanny Automator is active, link to the new automation screen.
+ // Otherwise link to the plugin installation page to auto install.
+ $url = $has_plugin
+ ? add_query_arg( 'post_type', 'uo-recipe', admin_url( 'post-new.php' ) )
+ : wp_nonce_url(
+ add_query_arg(
+ array(
+ 'action' => 'install-plugin',
+ 'plugin' => 'uncanny-automator',
+ ),
+ admin_url( 'update.php' )
+ ),
+ 'install-plugin_uncanny-automator'
+ );
+
+ // If the free version is installed, link to the pro upgrade page.
+ $cta_url = $url;
+
+ $cta_text = $has_plugin
+ ? __( 'Automate this Payment Form', 'stripe' )
+ : wp_kses(
+ sprintf(
+ /* translators: %1$s Opening HTML, do not translate. %2$s Closing HTML, do not translate. */
+ __( 'Start Automating for %1$sFree!%2$s', 'stripe' ),
+ '',
+ ''
+ ),
+ array(
+ 'strong' => array(),
+ 'u' => array(),
+ )
+ );
+ ?>
+
+
+
+
ID );
+ do_action(
+ 'simpay_form_settings_automations_panel',
+ $post->ID
+ );
?>
@@ -418,48 +404,56 @@ class="simpay-panel-hidden array(
- 'label' => esc_html__( 'General', 'stripe' ),
- 'target' => 'form-display-options-settings-panel',
- 'icon' => '',
- ),
- 'payment_options' => array(
- 'label' => esc_html__( 'Payment', 'stripe' ),
- 'target' => 'payment-options-settings-panel',
- 'icon' => '',
- ),
+ $tabs = array();
+
+ // Icons: https://heroicons.com/
+ // Mini.
+
+ $tabs['form_display_options'] = array(
+ 'label' => esc_html__( 'General', 'stripe' ),
+ 'target' => 'form-display-options-settings-panel',
+ 'icon' => '',
+ );
+
+ $tabs['payment_options'] = array(
+ 'label' => esc_html__( 'Payment', 'stripe' ),
+ 'target' => 'payment-options-settings-panel',
+ 'icon' => '',
);
$tabs['form_display'] = array(
'label' => esc_html__( 'Form Fields', 'stripe' ),
'target' => 'custom-form-fields-settings-panel',
- 'icon' => '',
+ 'icon' => '',
);
$tabs['purchase_restrictions'] = array(
'label' => esc_html__( 'Purchase Restrictions', 'stripe' ),
'target' => 'purchase-restrictions-settings-panel',
- 'icon' => '',
+ 'icon' => '',
);
- if ( has_action( 'simpay_form_settings_meta_subscription_display_panel' ) ) {
- $tabs['subscription_options'] = array(
- 'label' => esc_html__( 'Subscription Options', 'stripe' ),
- 'target' => 'subscription-options-settings-panel',
- );
- }
-
$tabs['stripe_checkout'] = array(
'label' => esc_html__( 'Stripe Checkout', 'stripe' ),
'target' => 'stripe-checkout-settings-panel',
- 'icon' => '',
+ 'icon' => '',
);
$tabs['payment_page'] = array(
'label' => esc_html__( 'Payment Page', 'stripe' ),
'target' => 'payment-page-settings-panel',
- 'icon' => '',
+ 'icon' => '',
+ );
+
+ $tabs['automations'] = array(
+ 'label' => wp_kses(
+ __( 'Automations New!', 'stripe' ),
+ array(
+ 'span' => array(),
+ )
+ ),
+ 'target' => 'automations-settings-panel',
+ 'icon' => '',
);
/**
@@ -501,7 +495,7 @@ function settings_tabs( $post ) {
$html = (
'' .
$icon .
- '' . esc_html( $tab['label'] ) . '' .
+ '' . $tab['label'] . '' . // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
''
);
@@ -544,6 +538,7 @@ function settings_tabs( $post ) {
'path' => array(
'fill' => true,
'fill-rule' => true,
+ 'fill-opacity' => true,
'd' => true,
'transform' => true,
'stroke' => true,
@@ -551,6 +546,9 @@ function settings_tabs( $post ) {
'stroke-linecap' => true,
'stroke-linejoin' => true,
),
+ 'g' => array(
+ 'fill' => true,
+ ),
'polygon' => array(
'fill' => true,
'fill-rule' => true,
diff --git a/package.json b/package.json
index 414763f9..12d64a78 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "wp-simple-pay-lite",
"title": "WP Simple Pay Lite for Stripe",
"description": "Add high conversion Stripe Checkout forms to your WordPress site and start accepting payments in minutes. **Lite Version**",
- "version": "4.7.7.3",
+ "version": "4.7.8",
"license": "GPL-2.0-or-later",
"homepage": "https://wpsimplepay.com/",
"repository": {
diff --git a/readme.txt b/readme.txt
index 788b8f8f..66390de8 100644
--- a/readme.txt
+++ b/readme.txt
@@ -3,7 +3,7 @@ Contributors: wpsimplepay, pderksen, spencerfinnell, adamjlea, mordauk, cklosows
Tags: stripe, stripe checkout, stripe payments, credit card payments, stripe gateway
Requires at least: 5.2
Tested up to: 6.2
-Stable tag: 4.7.7.3
+Stable tag: 4.7.8
Requires PHP: 5.6
License: GPLv2 or later
@@ -283,10 +283,15 @@ No. WP Simple Pay is a standalone Stripe payments plugin and does not integrate
== Changelog ==
+= Stripe Payment Forms v4.7.8 - August 2, 2023 =
+
+* New: Add "Automations" tab to the form builder.
+* Fix: Ensure at least one payment method is active when updating a payment form.
+
= Stripe Payment Forms v4.7.7.3 - July 25, 2023 =
-* Stripe Tax - update for general availability.
-* Lite Connect - improve connection process.
+* New: Stripe Tax - update for general availability.
+* Fix: Lite Connect - improve connection process.
= Stripe Payment Forms v4.7.7 - June 28, 2023 =
@@ -296,7 +301,3 @@ No. WP Simple Pay is a standalone Stripe payments plugin and does not integrate
* New: Add support for Alipay, FPX, Giropay, iDEAL, and Przelewy24 Stripe payments.
* Fix: Do not set additional fees when Stripe account country is based in Mexico.
-
-= Stripe Payment Forms v4.7.3.1 - March 31, 2023 =
-
-* Fix: Check that `jddayofweek()` is available before use.
diff --git a/src/Admin/FormBuilder/AutomatorIntegrationsImporter.php b/src/Admin/FormBuilder/AutomatorIntegrationsImporter.php
new file mode 100644
index 00000000..955053de
--- /dev/null
+++ b/src/Admin/FormBuilder/AutomatorIntegrationsImporter.php
@@ -0,0 +1,140 @@
+api_endpoint_url = $api_endpoint_url;
+ $this->scheduler = $scheduler;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_subscribed_events() {
+ return array(
+ 'init' => 'schedule_import',
+ '__unstable_simpay_import_uncanny_automator_integrations' => 'import',
+ );
+ }
+
+ /**
+ * Schedules importing help docs every two days.
+ *
+ * @since 4.7.8
+ *
+ * @return void
+ */
+ public function schedule_import() {
+ // Run an initial import.
+ /** @var bool $imported */
+ $imported = get_option( 'simpay_automator_integrations_imported', false );
+
+ if ( ! $imported ) {
+ update_option( 'simpay_automator_integrations_imported', true );
+
+ $this->import();
+ }
+
+ // Schedule recurring imports.
+ $this->scheduler->schedule_recurring(
+ time(),
+ ( WEEK_IN_SECONDS * 2 ), // every two weeks.
+ '__unstable_simpay_import_uncanny_automator_integrations'
+ );
+ }
+
+ /**
+ * Imports documentation articles to local JSON file.
+ *
+ * @return void
+ */
+ public function import() {
+ $request = wp_remote_get(
+ $this->api_endpoint_url,
+ array(
+ 'timeout' => 15,
+ 'sslverify' => false,
+ )
+ );
+
+ if ( is_wp_error( $request ) ) {
+ return;
+ }
+
+ $response = wp_remote_retrieve_body( $request );
+ $docs = ! empty( $response )
+ ? json_decode( $response, true )
+ : array();
+
+ // JSON could not be decoded.
+ if ( ! is_array( $docs ) ) {
+ return;
+ }
+
+ $cache_dir = $this->get_cache_dir();
+ $cache_file = $cache_dir . 'wpsp-uncanny-automator-integrations.json';
+
+ // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_file_put_contents
+ file_put_contents( $cache_file, $response );
+ }
+
+ /**
+ * Returns the path to the cache directory.
+ *
+ * @since 4.7.8
+ *
+ * @return string
+ */
+ private function get_cache_dir() {
+ $upload_dir = wp_upload_dir();
+
+ return trailingslashit( $upload_dir['basedir'] );
+ }
+
+}
diff --git a/src/Admin/FormBuilder/FormBuilderServiceProvider.php b/src/Admin/FormBuilder/FormBuilderServiceProvider.php
index ad1267d1..e0283a0e 100644
--- a/src/Admin/FormBuilder/FormBuilderServiceProvider.php
+++ b/src/Admin/FormBuilder/FormBuilderServiceProvider.php
@@ -35,6 +35,7 @@ public function get_subscribers() {
'form-builder-license-check',
'form-builder-template-explorer',
'form-builder-custom-field-subscriber',
+ 'form-builder-automator-integrations-importer'
);
}
@@ -61,6 +62,14 @@ public function register() {
'form-builder-custom-field-subscriber',
CustomFieldSubscriber::class
);
+
+ // Uncanny Automator integrations importer for the "Automations" tab.
+ $container->share(
+ 'form-builder-automator-integrations-importer',
+ AutomatorIntegrationsImporter::class
+ )
+ ->withArgument( 'https://integrations.automatorplugin.com/list.json' )
+ ->withArgument( $container->get( 'scheduler' ) );
}
}
diff --git a/stripe-checkout.php b/stripe-checkout.php
index b6cf3918..54698ffa 100644
--- a/stripe-checkout.php
+++ b/stripe-checkout.php
@@ -5,7 +5,7 @@
* Description: Add high conversion Stripe payment forms to your WordPress site in minutes.
* Author: WP Simple Pay
* Author URI: https://wpsimplepay.com
- * Version: 4.7.7.3
+ * Version: 4.7.8
* Text Domain: stripe
* Domain Path: /languages
*/
@@ -54,7 +54,7 @@
//
// Lite/Pro-specific.
//
- define( 'SIMPLE_PAY_VERSION', '4.7.7.3' );
+ define( 'SIMPLE_PAY_VERSION', '4.7.8' );
if ( ! defined( 'SIMPLE_PAY_PLUGIN_NAME' ) ) {
define( 'SIMPLE_PAY_PLUGIN_NAME', 'WP Simple Pay Lite' );
diff --git a/vendor/autoload.php b/vendor/autoload.php
index 883f540f..0b4c8ea0 100644
--- a/vendor/autoload.php
+++ b/vendor/autoload.php
@@ -22,4 +22,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
-return ComposerAutoloaderInitd49183aca8f216b2a80e0a17210caccb::getLoader();
+return ComposerAutoloaderIniteb29d04b90459890ff9fba984c3fa047::getLoader();
diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php
index 74475530..8a89c62d 100644
--- a/vendor/composer/autoload_real.php
+++ b/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
-class ComposerAutoloaderInitd49183aca8f216b2a80e0a17210caccb
+class ComposerAutoloaderIniteb29d04b90459890ff9fba984c3fa047
{
private static $loader;
@@ -22,12 +22,12 @@ public static function getLoader()
return self::$loader;
}
- spl_autoload_register(array('ComposerAutoloaderInitd49183aca8f216b2a80e0a17210caccb', 'loadClassLoader'), true, true);
+ spl_autoload_register(array('ComposerAutoloaderIniteb29d04b90459890ff9fba984c3fa047', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
- spl_autoload_unregister(array('ComposerAutoloaderInitd49183aca8f216b2a80e0a17210caccb', 'loadClassLoader'));
+ spl_autoload_unregister(array('ComposerAutoloaderIniteb29d04b90459890ff9fba984c3fa047', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
- call_user_func(\Composer\Autoload\ComposerStaticInitd49183aca8f216b2a80e0a17210caccb::getInitializer($loader));
+ call_user_func(\Composer\Autoload\ComposerStaticIniteb29d04b90459890ff9fba984c3fa047::getInitializer($loader));
$loader->register(true);
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php
index f0e08fe2..277074d0 100644
--- a/vendor/composer/autoload_static.php
+++ b/vendor/composer/autoload_static.php
@@ -4,7 +4,7 @@
namespace Composer\Autoload;
-class ComposerStaticInitd49183aca8f216b2a80e0a17210caccb
+class ComposerStaticIniteb29d04b90459890ff9fba984c3fa047
{
public static $prefixLengthsPsr4 = array (
'S' =>
@@ -37,9 +37,9 @@ class ComposerStaticInitd49183aca8f216b2a80e0a17210caccb
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
- $loader->prefixLengthsPsr4 = ComposerStaticInitd49183aca8f216b2a80e0a17210caccb::$prefixLengthsPsr4;
- $loader->prefixDirsPsr4 = ComposerStaticInitd49183aca8f216b2a80e0a17210caccb::$prefixDirsPsr4;
- $loader->classMap = ComposerStaticInitd49183aca8f216b2a80e0a17210caccb::$classMap;
+ $loader->prefixLengthsPsr4 = ComposerStaticIniteb29d04b90459890ff9fba984c3fa047::$prefixLengthsPsr4;
+ $loader->prefixDirsPsr4 = ComposerStaticIniteb29d04b90459890ff9fba984c3fa047::$prefixDirsPsr4;
+ $loader->classMap = ComposerStaticIniteb29d04b90459890ff9fba984c3fa047::$classMap;
}, null, ClassLoader::class);
}
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
index fbd41f74..666349fa 100644
--- a/vendor/composer/installed.php
+++ b/vendor/composer/installed.php
@@ -3,7 +3,7 @@
'name' => 'wpsimplepay/wp-simple-pay-pro-3',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
- 'reference' => 'cb346d7ca8c65774f696cdfc1d9a67b5006ea855',
+ 'reference' => 'b4e82a90605ba3c4cf7319c72d8df6663b6f29b9',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -103,7 +103,7 @@
'wpsimplepay/wp-simple-pay-pro-3' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
- 'reference' => 'cb346d7ca8c65774f696cdfc1d9a67b5006ea855',
+ 'reference' => 'b4e82a90605ba3c4cf7319c72d8df6663b6f29b9',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),