diff --git a/WordPress/src/main/java/org/wordpress/android/models/JetpackSettingsModel.java b/WordPress/src/main/java/org/wordpress/android/models/JetpackSettingsModel.java index eb632cbb9474..4bbbeb2a3027 100644 --- a/WordPress/src/main/java/org/wordpress/android/models/JetpackSettingsModel.java +++ b/WordPress/src/main/java/org/wordpress/android/models/JetpackSettingsModel.java @@ -19,7 +19,6 @@ public class JetpackSettingsModel { // Modules public boolean serveImagesFromOurServers; public boolean serveStaticFilesFromOurServers; - public boolean lazyLoadImages; public boolean commentLikes; public boolean sharingEnabled = true; public boolean improvedSearch; @@ -47,7 +46,6 @@ public JetpackSettingsModel(final JetpackSettingsModel other) { jetpackProtectAllowlist.addAll(other.jetpackProtectAllowlist); serveImagesFromOurServers = other.serveImagesFromOurServers; serveStaticFilesFromOurServers = other.serveStaticFilesFromOurServers; - lazyLoadImages = other.lazyLoadImages; sharingEnabled = other.sharingEnabled; improvedSearch = other.improvedSearch; adFreeVideoHosting = other.adFreeVideoHosting; @@ -66,7 +64,6 @@ public boolean equals(Object other) { && ssoRequireTwoFactor == otherModel.ssoRequireTwoFactor && serveImagesFromOurServers == otherModel.serveImagesFromOurServers && serveStaticFilesFromOurServers == otherModel.serveStaticFilesFromOurServers - && lazyLoadImages == otherModel.lazyLoadImages && commentLikes == otherModel.commentLikes && sharingEnabled == otherModel.sharingEnabled && improvedSearch == otherModel.improvedSearch diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java b/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java index 8de8cb5d345f..a221775eb652 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java @@ -278,10 +278,6 @@ public class SiteSettingsFragment extends PreferenceFragment private WPSwitchPreference mJpMatchEmailPref; private WPSwitchPreference mJpUseTwoFactorPref; - // Speed up settings - private WPSwitchPreference mLazyLoadImages; - private WPSwitchPreference mLazyLoadImagesNested; - // Jetpack media settings private WPSwitchPreference mAdFreeVideoHosting; private WPSwitchPreference mAdFreeVideoHostingNested; @@ -720,8 +716,6 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { } else if (preference == mJpUseTwoFactorPref) { mJpUseTwoFactorPref.setChecked((Boolean) newValue); mSiteSettings.enableJetpackSsoTwoFactor((Boolean) newValue); - } else if (preference == mLazyLoadImages || preference == mLazyLoadImagesNested) { - setLazyLoadImagesChecked((Boolean) newValue); } else if (preference == mAdFreeVideoHosting || preference == mAdFreeVideoHostingNested) { setAdFreeHostingChecked((Boolean) newValue); } else if (preference == mImprovedSearch) { @@ -1045,9 +1039,6 @@ public void initPreferences() { mServeStaticFilesFromOurServersNested = (WPSwitchPreference) getChangePref(R.string.pref_key_serve_static_files_from_our_servers_nested); - mLazyLoadImages = (WPSwitchPreference) getChangePref(R.string.pref_key_lazy_load_images); - mLazyLoadImagesNested = (WPSwitchPreference) getChangePref(R.string.pref_key_lazy_load_images_nested); - mAdFreeVideoHosting = (WPSwitchPreference) getChangePref(R.string.pref_key_ad_free_video_hosting); mAdFreeVideoHostingNested = (WPSwitchPreference) getChangePref(R.string.pref_key_ad_free_video_hosting_nested); @@ -1499,7 +1490,6 @@ public void setPreferencesFromSiteSettings() { mWeekStartPref.setValue(mSiteSettings.getStartOfWeek()); mWeekStartPref.setSummary(mWeekStartPref.getEntry()); mGutenbergDefaultForNewPosts.setChecked(SiteUtils.isBlockEditorDefaultForNewPost(mSite)); - setLazyLoadImagesChecked(mSiteSettings.isLazyLoadImagesEnabled()); setAdFreeHostingChecked(mSiteSettings.isAdFreeHostingEnabled()); boolean checked = mSiteSettings.isImprovedSearchEnabled() || mSiteSettings.getJetpackSearchEnabled(); mImprovedSearch.setChecked(checked); @@ -1560,12 +1550,6 @@ private void setSiteAcceleratorChecked(boolean checked) { mSiteAcceleratorNested.setChecked(checked); } - private void setLazyLoadImagesChecked(boolean checked) { - mSiteSettings.enableLazyLoadImages(checked); - mLazyLoadImages.setChecked(checked); - mLazyLoadImagesNested.setChecked(checked); - } - private void setAdFreeHostingChecked(boolean checked) { mSiteSettings.enableAdFreeHosting(checked); mAdFreeVideoHosting.setChecked(checked); diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsInterface.java b/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsInterface.java index 7abbf136f9da..45a326e2fbc3 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsInterface.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsInterface.java @@ -701,14 +701,6 @@ boolean isServeStaticFilesFromOurServersEnabled() { return mJpSettings.serveStaticFilesFromOurServers; } - void enableLazyLoadImages(boolean enabled) { - mJpSettings.lazyLoadImages = enabled; - } - - boolean isLazyLoadImagesEnabled() { - return mJpSettings.lazyLoadImages; - } - void enableAdFreeHosting(boolean enabled) { mJpSettings.adFreeVideoHosting = enabled; } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/WPComSiteSettings.java b/WordPress/src/main/java/org/wordpress/android/ui/prefs/WPComSiteSettings.java index 740f576b96b7..0c0fe096605d 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/WPComSiteSettings.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/WPComSiteSettings.java @@ -69,7 +69,6 @@ class WPComSiteSettings extends SiteSettingsInterface { // Jetpack modules private static final String SERVE_IMAGES_FROM_OUR_SERVERS = "photon"; private static final String SERVE_STATIC_FILES_FROM_OUR_SERVERS = "photon-cdn"; - private static final String LAZY_LOAD_IMAGES = "lazy-images"; private static final String SHARING_MODULE = "sharedaddy"; private static final String AD_FREE_VIDEO_HOSTING_MODULE = "videopress"; @@ -135,7 +134,6 @@ public void saveSettings() { if (supportsJetpackSiteAcceleratorSettings(mSite)) { pushServeImagesFromOurServersModuleSettings(); pushServeStaticFilesFromOurServersModuleSettings(); - pushLazyLoadModule(); } pushImprovedSearchModule(); pushAdFreeVideoHostingModule(); @@ -347,9 +345,6 @@ public void onResponse(JSONObject response) { case SERVE_STATIC_FILES_FROM_OUR_SERVERS: mRemoteJpSettings.serveStaticFilesFromOurServers = isActive; break; - case LAZY_LOAD_IMAGES: - mRemoteJpSettings.lazyLoadImages = isActive; - break; case SHARING_MODULE: mRemoteJpSettings.sharingEnabled = isActive; break; @@ -364,7 +359,6 @@ public void onResponse(JSONObject response) { mJpSettings.serveImagesFromOurServers = mRemoteJpSettings.serveImagesFromOurServers; mJpSettings.serveStaticFilesFromOurServers = mRemoteJpSettings.serveStaticFilesFromOurServers; - mJpSettings.lazyLoadImages = mRemoteJpSettings.lazyLoadImages; mJpSettings.sharingEnabled = mRemoteJpSettings.sharingEnabled; mJpSettings.improvedSearch = mRemoteJpSettings.improvedSearch; mJpSettings.adFreeVideoHosting = mRemoteJpSettings.adFreeVideoHosting; @@ -540,31 +534,6 @@ public void onErrorResponse(VolleyError error) { } } - private void pushLazyLoadModule() { - ++mSaveRequestCount; - // The API returns 400 if we try to sync the same value twice so we need to keep it locally. - if (mJpSettings.lazyLoadImages != mRemoteJpSettings.lazyLoadImages) { - final boolean fallbackValue = mRemoteJpSettings.lazyLoadImages; - mRemoteJpSettings.lazyLoadImages = mJpSettings.lazyLoadImages; - WordPress.getRestClientUtilsV1_1().setJetpackModuleSettings( - mSite.getSiteId(), LAZY_LOAD_IMAGES, mJpSettings.lazyLoadImages, new RestRequest.Listener() { - @Override - public void onResponse(JSONObject response) { - AppLog.d(AppLog.T.API, "Jetpack module updated - Lazy load images"); - onSaveResponseReceived(null); - } - }, new RestRequest.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - mRemoteJpSettings.lazyLoadImages = fallbackValue; - error.printStackTrace(); - AppLog.w(AppLog.T.API, "Error updating Jetpack module - Lazy load images: " + error); - onSaveResponseReceived(error); - } - }); - } - } - private void pushImprovedSearchModule() { ++mSaveRequestCount; // The API returns 400 if we try to sync the same value twice so we need to keep it locally. @@ -700,7 +669,7 @@ private void deserializeWpComRestResponse(SiteModel site, JSONObject response) { String remoteGmtOffset = settingsObject.optString(GMT_OFFSET_KEY, ""); // UTC-7 comes back as gmt_offset: -7, UTC+7 as just gmt_offset: 7 without the +, hence adding prefix String remoteGmtTimezone = remoteGmtOffset.startsWith("-") ? "UTC" + remoteGmtOffset : "UTC+" + remoteGmtOffset; - + mRemoteSettings.timezone = !TextUtils.isEmpty(remoteTimezone) ? remoteTimezone : remoteGmtTimezone; mRemoteSettings.postsPerPage = settingsObject.optInt(POSTS_PER_PAGE_KEY, 0); diff --git a/WordPress/src/main/res/values/key_strings.xml b/WordPress/src/main/res/values/key_strings.xml index b9ba660c74b6..3c3326c8cc4e 100644 --- a/WordPress/src/main/res/values/key_strings.xml +++ b/WordPress/src/main/res/values/key_strings.xml @@ -94,9 +94,6 @@ wp_pref_key_homepage wp_pref_key_homepage_settings - - wp_pref_lazy_load_images - wp_pref_lazy_load_images_nested wp_pref_jetpack_performance_settings wp_pref_site_accelerator diff --git a/WordPress/src/main/res/values/strings.xml b/WordPress/src/main/res/values/strings.xml index c796329e15e2..923b38760055 100644 --- a/WordPress/src/main/res/values/strings.xml +++ b/WordPress/src/main/res/values/strings.xml @@ -727,14 +727,10 @@ %s GB %s TB - - Improve your site\'s speed by only loading images visible on the screen. - Site Accelerator On Off - Lazy load images Faster images Faster static files Load pages faster by allowing Jetpack to optimize your images and static files (like CSS and JavaScript). diff --git a/WordPress/src/main/res/xml/site_settings.xml b/WordPress/src/main/res/xml/site_settings.xml index 1fa5f8ed0226..e86f76632c9a 100644 --- a/WordPress/src/main/res/xml/site_settings.xml +++ b/WordPress/src/main/res/xml/site_settings.xml @@ -259,12 +259,6 @@ - - -