Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare release 4.1.2 #772

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
== Changelog ==
= 4.1.2 =
* ENHANCEMENT - added `REST API Endpoint` setting, which useful when WordPress dashboard and frontend website utilize different domain names.
* ENHANCEMENT - extended `Status Info` with the information to help diagnose REST API or AJAX issues.
* COMPATIBILITY - SiteOrigin Widgets Bundle Compatibility replaced with [WP-Stateless - SiteOrigin Widgets Bundle Addon](https://wordpress.org/plugins/wp-stateless-siteorigin-widgets-bundle-addon/).
* COMPATIBILITY - WPForms Compatibility replaced with [WP-Stateless - WPForms Addon](https://wordpress.org/plugins/wp-stateless-wpforms-addon/).
* COMPATIBILITY - Easy Digital Downloads Compatibility replaced with [WP-Stateless - Easy Digital Downloads Addon](* COMPATIBILITY - Easy Digital Downloads Compatibility replaced with [WP-Stateless - Easy Digital Downloads Addon](https://wordpress.org/plugins/wp-stateless-easy-digital-downloads-addon/).
* COMPATIBILITY - LiteSpeed Cache Compatibility replaced with [WP-Stateless - LiteSpeed Cache Addon](https://wordpress.org/plugins/wp-stateless-litespeed-cache-addon/).
* FIX: remove PHP warning on `Status` settings tab.

= 4.1.1 =
* FIX - cache issues during Data Optimization.

Expand Down
10 changes: 10 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
#### 4.1.2
* ENHANCEMENT - added `REST API Endpoint` setting, which useful when WordPress dashboard and frontend website utilize different domain names.
* ENHANCEMENT - extended `Status Info` with the information to help diagnose REST API or AJAX issues.
* COMPATIBILITY - SiteOrigin Widgets Bundle Compatibility replaced with [WP-Stateless - SiteOrigin Widgets Bundle Addon](https://wordpress.org/plugins/wp-stateless-siteorigin-widgets-bundle-addon/).
* COMPATIBILITY - WPForms Compatibility replaced with [WP-Stateless - WPForms Addon](https://wordpress.org/plugins/wp-stateless-wpforms-addon/).
* COMPATIBILITY - Easy Digital Downloads Compatibility replaced with [WP-Stateless - Easy Digital Downloads Addon](https://wordpress.org/plugins/wp-stateless-easy-digital-downloads-addon/).
* COMPATIBILITY - LiteSpeed Cache Compatibility replaced with [WP-Stateless - LiteSpeed Cache Addon](https://wordpress.org/plugins/wp-stateless-litespeed-cache-addon/).
* FIX: PHP warning on `Status` settings tab.


#### 4.1.1
* FIX - cache issues during Data Optimization.

Expand Down
74 changes: 7 additions & 67 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 30 additions & 1 deletion lib/classes/class-bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ public function init() {
// Register meta boxes and fields for media modal page
add_filter('attachment_fields_to_edit', array($this, 'attachment_modal_meta_box_callback'), 11, 2);

// Get the REST API root
add_filter('wp_stateless_rest_api_root', array($this, 'get_rest_api_root'));

/**
* Init hook
*/
Expand Down Expand Up @@ -1265,7 +1268,12 @@ public function admin_init() {
wp_localize_script('wp-stateless', 'stateless_l10n', $this->get_l10n_data());
wp_localize_script('wp-stateless', 'wp_stateless_configs', array(
'WP_DEBUG' => defined('WP_DEBUG') ? WP_DEBUG : false,
'REST_API_TOKEN' => Utility::generate_jwt_token(['user_id' => get_current_user_id()], DAY_IN_SECONDS)
'REST_API_TOKEN' => Utility::generate_jwt_token(['user_id' => get_current_user_id()], DAY_IN_SECONDS),
'api_root' => apply_filters( 'wp_stateless_rest_api_root', '' ),
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'stateless_check_ajax_nonce' => wp_create_nonce('stateless_check_ajax'),
'text_ok' => __('Ok', ud_get_stateless_media()->domain),
'text_fail' => __('Fail', ud_get_stateless_media()->domain),
));

$settings = ud_get_stateless_media()->get('sm');
Expand All @@ -1282,6 +1290,7 @@ public function admin_init() {
wp_localize_script('wp-stateless-batch', 'wp_stateless_batch', array(
'REST_API_TOKEN' => Utility::generate_jwt_token(['user_id' => get_current_user_id()], DAY_IN_SECONDS),
'is_running' => BatchTaskManager::instance()->is_running(),
'api_root' => apply_filters( 'wp_stateless_rest_api_root', '' ),
));
}

Expand Down Expand Up @@ -2079,6 +2088,26 @@ public function is_mode($mode) {
public function get_default_cache_control() {
return Settings::DEFAULT_CACHE_CONTROL;
}

/**
* Override REST API root for headless CMS
*
* @return string
*/
public function get_rest_api_root($rest_api_root) {
$rest_api_root = sanitize_url( get_rest_url() );
$rest_api_root .= 'wp-stateless/v1/';

if ( $this->get('sm.use_api_siteurl') == 'WP_SITEURL' ) {
$home = get_home_url();
$site = get_site_url();

return str_replace( $home, $site, $rest_api_root );
}


return $rest_api_root;
}
}
}
}
20 changes: 0 additions & 20 deletions lib/classes/class-module.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ public function __construct() {
*/
new BuddyPress();

/**
* Support for Easy Digital Downloads
*/
new EDDDownloadMethod();

/**
* Support for Ewww Image Optimizer
*/
Expand All @@ -50,11 +45,6 @@ public function __construct() {
*/
new LearnDash();

/**
* Support for LiteSpeed Cache
*/
new LSCacheWP();

/**
* Support for Polylang Pro
*/
Expand All @@ -70,11 +60,6 @@ public function __construct() {
*/
new SimpleLocalAvatars();

/**
* Support for SiteOrigin Widgets Bundle
*/
new SOWidgetCSS();

/**
* Support for The Events Calendar
*/
Expand All @@ -90,11 +75,6 @@ public function __construct() {
*/
new WPBakeryPageBuilder();

/**
* Support for WPForms
*/
new WPForms();

/**
* Support for Smush
*/
Expand Down
1 change: 1 addition & 0 deletions lib/classes/class-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ final class Settings extends \UDX\Settings {
'status_email_type' => array('', 'true'),
'status_email_address' => array('', ''),
'use_postmeta' => array('WP_STATELESS_POSTMETA', ['false', '']),
'use_api_siteurl' => array('WP_STATELESS_API_SITEURL', ['WP_HOME', '']),
);

private $network_only_settings = array(
Expand Down
145 changes: 0 additions & 145 deletions lib/classes/compatibility/easy-digital-downloads.php

This file was deleted.

Loading