WC_Plugins_Screen_Updates
extends WC_Plugin_Updates
in package
Class WC_Plugins_Screen_Updates
Table of Contents
- VERSION_REQUIRED_HEADER = 'WC requires at least'
- This is the header used by extensions to show requirements.
- VERSION_TESTED_HEADER = 'WC tested up to'
- This is the header used by extensions to show testing.
- $major_untested_plugins : array<string|int, mixed>
- Array of plugins lacking testing with the major version.
- $new_version : string
- The version for the update to WooCommerce.
- $upgrade_notice : string
- The upgrade notice shown inline.
- __construct() : mixed
- Constructor.
- get_untested_plugins() : array<string|int, mixed>
- Get installed plugins that have a tested version lower than the input version.
- in_plugin_update_message() : mixed
- Show plugin changes on the plugins screen. Code adapted from W3 Total Cache.
- plugin_screen_modal_js() : mixed
- JS for the modal window on the plugins screen.
- generic_modal_js() : mixed
- Common JS for initializing and managing thickbox-based modals.
- get_extensions_inline_warning_major() : string
- Get the inline warning notice for major version updates.
- get_extensions_modal_warning() : string
- Get the warning notice for the modal window.
- get_plugins_for_woocommerce() : array<string|int, mixed>
- Get plugins which "maybe" are for WooCommerce.
- get_plugins_with_header() : array<string|int, mixed>
- Get plugins that have a valid value for a specific header.
- get_upgrade_notice() : string
- Get the upgrade notice from WordPress.org.
- parse_update_notice() : string
- Parse update notice from readme file.
Constants
VERSION_REQUIRED_HEADER
This is the header used by extensions to show requirements.
public
string
VERSION_REQUIRED_HEADER
= 'WC requires at least'
VERSION_TESTED_HEADER
This is the header used by extensions to show testing.
public
string
VERSION_TESTED_HEADER
= 'WC tested up to'
Properties
$major_untested_plugins
Array of plugins lacking testing with the major version.
protected
array<string|int, mixed>
$major_untested_plugins
= array()
$new_version
The version for the update to WooCommerce.
protected
string
$new_version
= ''
$upgrade_notice
The upgrade notice shown inline.
protected
string
$upgrade_notice
= ''
Methods
__construct()
Constructor.
public
__construct() : mixed
Return values
mixed —get_untested_plugins()
Get installed plugins that have a tested version lower than the input version.
public
get_untested_plugins(string $new_version, string $release) : array<string|int, mixed>
In case of testing major version compatibility and if current WC version is >= major version part of the $new_version, no plugins are returned, even if they don't explicitly declare compatibility with the $new_version.
Parameters
- $new_version : string
-
WooCommerce version to test against.
- $release : string
-
'major', 'minor', or 'none'.
Return values
array<string|int, mixed> — of plugin info arraysin_plugin_update_message()
Show plugin changes on the plugins screen. Code adapted from W3 Total Cache.
public
in_plugin_update_message(array<string|int, mixed> $args, stdClass $response) : mixed
Parameters
- $args : array<string|int, mixed>
-
Unused parameter.
- $response : stdClass
-
Plugin update response.
Return values
mixed —plugin_screen_modal_js()
JS for the modal window on the plugins screen.
public
plugin_screen_modal_js() : mixed
Return values
mixed —generic_modal_js()
Common JS for initializing and managing thickbox-based modals.
protected
generic_modal_js() : mixed
Return values
mixed —get_extensions_inline_warning_major()
Get the inline warning notice for major version updates.
protected
get_extensions_inline_warning_major() : string
Return values
string —get_extensions_modal_warning()
Get the warning notice for the modal window.
protected
get_extensions_modal_warning() : string
Return values
string —get_plugins_for_woocommerce()
Get plugins which "maybe" are for WooCommerce.
protected
get_plugins_for_woocommerce() : array<string|int, mixed>
Return values
array<string|int, mixed> — of plugin info arraysget_plugins_with_header()
Get plugins that have a valid value for a specific header.
protected
get_plugins_with_header(string $header) : array<string|int, mixed>
Parameters
- $header : string
-
Plugin header to search for.
Return values
array<string|int, mixed> — Array of plugins that contain the searched header.get_upgrade_notice()
Get the upgrade notice from WordPress.org.
protected
get_upgrade_notice(string $version) : string
Parameters
- $version : string
-
WooCommerce new version.
Return values
string —parse_update_notice()
Parse update notice from readme file.
private
parse_update_notice(string $content, string $new_version) : string
Parameters
- $content : string
-
WooCommerce readme file content.
- $new_version : string
-
WooCommerce new version.