Skip to content

Commit

Permalink
Merge pull request #205 from awesomemotive/release/4.7.10
Browse files Browse the repository at this point in the history
`release/4.7.10`
  • Loading branch information
spencerfinnell authored Oct 12, 2023
2 parents 81dc243 + 2c8e451 commit c3bc74a
Show file tree
Hide file tree
Showing 86 changed files with 3,606 additions and 755 deletions.
11 changes: 8 additions & 3 deletions includes/core/abstracts/abstract-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
*/
abstract class Form {

/**
* @since 3.0.0
* @var \WP_Post
*/
public $post;

/**
* Test mode.
*
Expand Down Expand Up @@ -156,7 +162,7 @@ abstract class Form {
* @since 3.0.0
* @var string
*/
public $decimal_separator = '';
public $decimal_separator = '';

/**
* Thousand separator.
Expand Down Expand Up @@ -196,7 +202,7 @@ abstract class Form {
* @since 3.0.0
* @var string
*/
public $item_description = '';
public $item_description = '';

/**
* Stripe Checkout: Image URL (form logo).
Expand Down Expand Up @@ -776,7 +782,6 @@ public function get_stripe_script_variables() {
*
* @since 4.7.0
*
* @param \SimplePay\Core\Abstracts\Form $form The payment form.
* @return bool
*/
abstract public function has_fee_recovery();
Expand Down
10 changes: 10 additions & 0 deletions includes/core/assets/css/admin/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
display: flex;
align-items: center;
margin-bottom: 8px;
position: relative;

.spinner {
float: none;
Expand Down Expand Up @@ -2414,3 +2415,12 @@ body.post-type-simple-pay #wpbody-content {
}
}
}

.simpay-settings-is_upe td {
background: #fff;
border: 1px solid #c3c4c7;
border-left-width: 4px;
border-left-color: #2271b1;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
padding: 12px 18px;
}
2 changes: 1 addition & 1 deletion includes/core/assets/css/simpay-admin.min.css

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions includes/core/class-rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ public function register_routes() {
$controllers = apply_filters( 'simpay_rest_api_controllers', $controllers );

foreach ( $controllers as $controller ) {
$this->$controller = new $controller();
$this->$controller->register_routes();
( new $controller() )->register_routes();
}
}

Expand Down
39 changes: 0 additions & 39 deletions includes/core/functions/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,45 +265,6 @@ function simpay_is_admin_screen() {
return false;
}

/**
* Link with HTML to docs site article & GA campaign values.
*
* @since 3.0.0
* @since 4.4.0 Rename $ga_content to $utm_medium to work with simpay_ga_url().
*
* @param string $text Link text.
* @param string $slug Link slug.
* @param string $utm_medium utm_medium link parameter.
* @param bool $plain If the link should have an icon. Default false.
* @return string
*/
function simpay_docs_link( $text, $slug, $utm_medium, $plain = false ) {

// Articles on docs site currently require a base slug themselves.
$base_url = 'https://wpsimplepay.com/doc/';

// Ensure ending slash is included for consistency.
$url = trailingslashit( $base_url . $slug );

// If $plain is true we want to return ONLY the link, otherwise return the full HTML.
// Add GA campaign params in both cases.
if ( $plain ) {

return simpay_ga_url( $url, $utm_medium, $text );

} else {

$html = '';
$html .= '<div class="simpay-docs-link-wrap">';
$html .= '<a href="' . simpay_ga_url( $url, $utm_medium, $text ) . '" target="_blank" rel="noopener noreferrer">' . esc_html( $text );
$html .= '<span class="dashicons dashicons-editor-help"></span>';
$html .= '</a>';
$html .= '</div>';

return $html;
}
}

/**
* Output the copy/paste shortcode on the forms page.
*
Expand Down
40 changes: 40 additions & 0 deletions includes/core/functions/shared.php
Original file line number Diff line number Diff line change
Expand Up @@ -1904,3 +1904,43 @@ function simpay_is_upe() {
function simpay_list_separator() {
return apply_filters( 'simpay_list_separator', ',' );
}

/**
* Link with HTML to docs site article & GA campaign values.
*
* @since 3.0.0
* @since 4.4.0 Rename $ga_content to $utm_medium to work with simpay_ga_url().
* @since 4.7.10 Available globally (not just admin).
*
* @param string $text Link text.
* @param string $slug Link slug.
* @param string $utm_medium utm_medium link parameter.
* @param bool $plain If the link should have an icon. Default false.
* @return string
*/
function simpay_docs_link( $text, $slug, $utm_medium, $plain = false ) {

// Articles on docs site currently require a base slug themselves.
$base_url = 'https://wpsimplepay.com/doc/';

// Ensure ending slash is included for consistency.
$url = trailingslashit( $base_url . $slug );

// If $plain is true we want to return ONLY the link, otherwise return the full HTML.
// Add GA campaign params in both cases.
if ( $plain ) {

return simpay_ga_url( $url, $utm_medium, $text );

} else {

$html = '';
$html .= '<div class="simpay-docs-link-wrap">';
$html .= '<a href="' . simpay_ga_url( $url, $utm_medium, $text ) . '" target="_blank" rel="noopener noreferrer">' . esc_html( $text );
$html .= '<span class="dashicons dashicons-editor-help"></span>';
$html .= '</a>';
$html .= '</div>';

return $html;
}
}
4 changes: 4 additions & 0 deletions includes/core/recaptcha/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,10 @@ function validate_hcaptcha_order_submit( $request, $form ) {
* @return void
*/
function maybe_add_inbox_notification() {
if ( ! simpay_is_livemode() ) {
return;
}

// Notification Inbox is only available in WP 5.7+.
global $wp_version;

Expand Down
9 changes: 9 additions & 0 deletions includes/core/settings/class-setting-input.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ class Setting_Input extends Setting {
*/
public $step;

/**
* Classes.
*
* @since 4.7.10
* @var array<string>
*/
public $classes;

/**
* Additional input attributes (readonly, disabled, etc)
*
Expand All @@ -90,6 +98,7 @@ class Setting_Input extends Setting {
* @type string $min Setting minimum.
* @type string $max Setting maximum.
* @type string $step Setting step.
* @type array<string> $classes
* }
*/
public function __construct( $args ) {
Expand Down
5 changes: 3 additions & 2 deletions includes/core/settings/class-setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ class Setting {
* Setting toggles.
*
* @since 4.0.0
* @var array
* @var array<string, array<string>>
*/
public $toggles = array();

/**
* Constructs the settings section.
Expand Down Expand Up @@ -130,7 +131,7 @@ public function __construct( $args ) {
'section' => '',
'subsection' => '',
'label' => '',
'schema' => array(),
'schema' => array(),
'priority' => 10,
'output' => null,
'toggles' => array(),
Expand Down
6 changes: 2 additions & 4 deletions includes/core/settings/register-general.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,11 @@ function register_advanced_settings( $settings ) {
: wpautop(
wp_kses(
sprintf(
/* translators: %3$s Opening <a> tag, do not translate. %4$s Closing </a> tag, do not translate. */
/* translators: %1$s Opening <a> tag, do not translate. %2$s Closing </a> tag, do not translate. */
__(
'Enable the new, smarter payment experience. Have questions about opting in or managing customizations? %3$sContact us%4$s',
'Enable the new, smarter payment experience. Have questions about opting in or managing customizations? %1$sContact us%2$s',
'stripe'
),
'<strong>',
'</strong>',
'<a href="' . esc_url( 'https://wpsimplepay.com/my-account/support/?a=I%20have%20questions%20about%20the%20new%20payment%20flow' ) . '" target="_blank" rel="noopener noreferrer" class="simpay-external-link">',
Utils\get_external_link_markup() . '</a>'
),
Expand Down
57 changes: 1 addition & 56 deletions includes/core/utils/abstract-collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @since 3.8.0
* @abstract
*/
abstract class Collection extends \ArrayObject {
abstract class Collection {

/**
* Array of registry items.
Expand Down Expand Up @@ -110,59 +110,4 @@ public function _reset_items() {
}
}

/**
* Determines whether an item exists.
*
* Defined only for compatibility with ArrayAccess, use has_item() directly.
*
* @since 3.8.0
*
* @param string $offset Item ID.
* @return bool True if the item exists, false on failure.
*/
public function offsetExists( $offset ) {
return $this->has_item( $offset );
}

/**
* Retrieves an item by its ID.
*
* Defined only for compatibility with ArrayAccess, use get_item() directly.
*
* @since 3.8.0
*
* @param mixed $offset Item ID.
* @return mixed|false Item attributes if registered, otherwise false.
*/
public function offsetGet( $offset ) {
return $this->get_item( $offset );
}

/**
* Adds/overwrites an item in the registry.
*
* Defined only for compatibility with ArrayAccess, use add_item() directly.
*
* @since 3.8.0
*
* @param string $offset Item ID.
* @param mixed $value Item attributes.
*/
public function offsetSet( $offset, $value ) {
$this->add_item( $offset, $value );
}

/**
* Removes an item from the registry.
*
* Defined only for compatibility with ArrayAccess, use remove_item() directly.
*
* @since 3.8.0
*
* @param string $offset Item ID.
*/
public function offsetUnset( $offset ) {
$this->remove_item( $offset );
}

}
6 changes: 6 additions & 0 deletions includes/core/utils/migrations/class-single-migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
*/
class Single_Migration extends Migration {

/**
* @since 4.7.10
* @var bool
*/
public $automatic;

/**
* Constructs the migration.
*
Expand Down
17 changes: 10 additions & 7 deletions lib/woocommerce/action-scheduler/action-scheduler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
* Description: A robust scheduling library for use in WordPress plugins.
* Author: Automattic
* Author URI: https://automattic.com/
* Version: 3.4.0
* Version: 3.6.2
* License: GPLv3
* Tested up to: 6.3
* Requires at least: 5.2
* Requires PHP: 5.6
*
* Copyright 2019 Automattic, Inc. (https://automattic.com/contact/)
*
Expand All @@ -26,27 +29,27 @@
* @package ActionScheduler
*/

if ( ! function_exists( 'action_scheduler_register_3_dot_4_dot_0' ) && function_exists( 'add_action' ) ) {
if ( ! function_exists( 'action_scheduler_register_3_dot_6_dot_2' ) && function_exists( 'add_action' ) ) { // WRCS: DEFINED_VERSION.

if ( ! class_exists( 'ActionScheduler_Versions', false ) ) {
require_once __DIR__ . '/classes/ActionScheduler_Versions.php';
add_action( 'plugins_loaded', array( 'ActionScheduler_Versions', 'initialize_latest_version' ), 1, 0 );
}

add_action( 'plugins_loaded', 'action_scheduler_register_3_dot_4_dot_0', 0, 0 );
add_action( 'plugins_loaded', 'action_scheduler_register_3_dot_6_dot_2', 0, 0 ); // WRCS: DEFINED_VERSION.

/**
* Registers this version of Action Scheduler.
*/
function action_scheduler_register_3_dot_4_dot_0() {
function action_scheduler_register_3_dot_6_dot_2() { // WRCS: DEFINED_VERSION.
$versions = ActionScheduler_Versions::instance();
$versions->register( '3.4.0', 'action_scheduler_initialize_3_dot_4_dot_0' );
$versions->register( '3.6.2', 'action_scheduler_initialize_3_dot_6_dot_2' ); // WRCS: DEFINED_VERSION.
}

/**
* Initializes this version of Action Scheduler.
*/
function action_scheduler_initialize_3_dot_4_dot_0() {
function action_scheduler_initialize_3_dot_6_dot_2() { // WRCS: DEFINED_VERSION.
// A final safety check is required even here, because historic versions of Action Scheduler
// followed a different pattern (in some unusual cases, we could reach this point and the
// ActionScheduler class is already defined—so we need to guard against that).
Expand All @@ -58,7 +61,7 @@ function action_scheduler_initialize_3_dot_4_dot_0() {

// Support usage in themes - load this version if no plugin has loaded a version yet.
if ( did_action( 'plugins_loaded' ) && ! doing_action( 'plugins_loaded' ) && ! class_exists( 'ActionScheduler', false ) ) {
action_scheduler_initialize_3_dot_4_dot_0();
action_scheduler_initialize_3_dot_6_dot_2(); // WRCS: DEFINED_VERSION.
do_action( 'action_scheduler_pre_theme_init' );
ActionScheduler_Versions::initialize_latest_version();
}
Expand Down
Loading

0 comments on commit c3bc74a

Please sign in to comment.