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

[plugin-information-dialog] Try to fetch data from WP only when the p… #724

Merged
merged 1 commit into from
Jul 22, 2024
Merged
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
14 changes: 12 additions & 2 deletions includes/class-fs-plugin-updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ function pre_set_site_transient_update_plugins_filter( $transient_data ) {

$slug = $this->_fs->get_slug();

if ( $this->_fs->is_org_repo_compliant() && $this->_fs->is_freemium() ) {
if ( $this->can_fetch_data_from_wp_org() ) {
if ( ! isset( $this->_translation_updates ) ) {
$this->_translation_updates = array();

Expand Down Expand Up @@ -908,6 +908,16 @@ static function _fetch_plugin_info_from_repository( $action, $args ) {
return $res;
}

/**
* Returns true if the product can fetch data from WordPress.org.
*
* @author Leo Fajardo (@leorw)
* @since 2.7.4
*/
private function can_fetch_data_from_wp_org() {
return ( $this->_fs->is_org_repo_compliant() && $this->_fs->is_freemium() );
}

/**
* Fetches module translation updates from wordpress.org.
*
Expand Down Expand Up @@ -1092,7 +1102,7 @@ function plugins_api_filter( $data, $action = '', $args = null ) {
}

$plugin_in_repo = false;
if ( ! $is_addon ) {
if ( ! $is_addon && $this->can_fetch_data_from_wp_org() ) {
// Try to fetch info from .org repository.
$data = self::_fetch_plugin_info_from_repository( $action, $args );

Expand Down
2 changes: 1 addition & 1 deletion start.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @var string
*/
$this_sdk_version = '2.7.3.2';
$this_sdk_version = '2.7.3.3';

#region SDK Selection Logic --------------------------------------------------------------------

Expand Down
Loading