Skip to content

Commit 9be6586

Browse files
authored
release(minor): new features
- Better lazy loading for background images from page building plugins (Elementor, Otter Blocks, Kadence Blocks, Beaver Builder, Spectra Blocks, Essential Blocks) - Fixes issue with lazy-loading images using "object-size: cover" in CSS, not having the proper position - Added automatic cache clearing support for 4 popular caching plugins (Super Page Cache, Hummingbird, Aruba Hispeed Cache, Cache Enabler) - Updated "View all stats" link from the dashboard widget to go directly to the Optimole dashboard - Clearer messaging for visit limit notifications - Better translation support and consistent casing of "Optimole" throughout - Updated dependencies
2 parents 3f89fa8 + a0fef77 commit 9be6586

29 files changed

+460
-63
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Translations Diff
2+
3+
on:
4+
pull_request_review:
5+
pull_request:
6+
types: [opened, edited, synchronize, ready_for_review]
7+
branches:
8+
- development
9+
- master
10+
11+
jobs:
12+
translation:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Base Branch
16+
uses: actions/checkout@v4
17+
with:
18+
ref: ${{ github.base_ref }}
19+
path: optimole-base
20+
- name: Setup node 16
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 16.x
24+
- name: Build POT for Base Branch
25+
run: |
26+
cd optimole-base
27+
composer install --no-dev --prefer-dist --no-progress --no-suggest
28+
npm ci
29+
npm run build
30+
# TODO: when is merged to master, switch to npm run make-pot
31+
docker run --user root --rm --volume $(pwd):/var/www/html/optimole-wp wordpress:cli bash -c 'php -d memory_limit=512M $(which wp) --version --allow-root && wp i18n make-pot optimole-wp ./optimole-wp/languages/optimole-wp.pot --include=inc,assets/src --allow-root --domain=optimole-wp'
32+
ls languages/
33+
- name: Checkout PR Branch (Head)
34+
uses: actions/checkout@v4
35+
with:
36+
path: optimole-head
37+
- name: Build POT for PR Branch
38+
run: |
39+
cd optimole-head
40+
composer install --no-dev --prefer-dist --no-progress --no-suggest
41+
npm ci
42+
npm run build
43+
npm run make-pot
44+
ls languages/
45+
- name: Compare POT files
46+
uses: Codeinwp/action-i18n-string-reviewer@main
47+
with:
48+
fail-on-changes: 'true'
49+
openrouter-key: ${{ secrets.OPEN_ROUTER_API_KEY }}
50+
openrouter-model: 'google/gemini-2.5-flash'
51+
base-pot-file: 'optimole-base/languages/optimole-wp.pot'
52+
target-pot-file: 'optimole-head/languages/optimole-wp.pot'
53+
github-token: ${{ secrets.BOT_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ assets/build
1313
test-results
1414
tests/assets/filestash
1515
coverage
16+
languages

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ Fix edge cases for auto allowing domain on site migration.
998998

999999
**Documentation**
10001000

1001-
* improve readme description of the OptiMole service ([e020300](https://github.com/Codeinwp/optimole-wp/commit/e020300))
1001+
* improve readme description of the Optimole service ([e020300](https://github.com/Codeinwp/optimole-wp/commit/e020300))
10021002

10031003

10041004

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,12 @@ Discover how to make the most of Optimole with our detailed and user-friendly [d
262262

263263

264264
## Installation ##
265-
The following are the steps to install the OptiMole plugin
265+
The following are the steps to install the Optimole plugin
266266

267267
1. In your WordPress Administration Panels, click on Add New option under Plugins from the menu.
268268
Click on upload at the top.
269-
2. Browse the location and select the OptiMole Plugin and click install now.
270-
3. Go to Media -> OptiMole and follow in the instructions on how to enable the service.
269+
2. Browse the location and select the Optimole Plugin and click install now.
270+
3. Go to Media -> Optimole and follow in the instructions on how to enable the service.
271271

272272
## Frequently Asked Questions ##
273273

assets/src/dashboard/parts/connected/dashboard/LastImages.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const Image = ({
5555
} }
5656
ref={ squareRef }
5757
/>
58-
<p className="optml__bullet w-full h-4">{ getSize() }% { optimoleDashboardApp.strings.latest_images.saved } </p>
58+
<p className="optml__bullet w-full h-4">{ optimoleDashboardApp.strings.latest_images.percentage_saved.replace( '{ratio}', getSize() ) } </p>
5959
</div>
6060
);
6161
};
@@ -136,7 +136,7 @@ const LastImages = () => {
136136

137137
return (
138138
<div>
139-
<h3 className="text-gray-800 text-xl font-semibold mb-5 m-0">{ optimoleDashboardApp.strings.latest_images.last } { optimoleDashboardApp.strings.latest_images.optimized_images }</h3>
139+
<h3 className="text-gray-800 text-xl font-semibold mb-5 m-0">{ optimoleDashboardApp.strings.latest_images.last_optimized_images }</h3>
140140

141141
{ ( isInitialLoading && ! isLoaded ) && (
142142
<div className="flex items-center flex-col py-2">

assets/src/dashboard/parts/connected/settings/Compression.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ const Compression = ({
352352
{ ( sampleImages.id && 0 < sampleImages.original_size ) && (
353353
<div>
354354
{ 0 < getCompressionRatio() ? (
355-
<p className="text-base">{ 100 - getCompressionRatio() }% { optimoleDashboardApp.strings.latest_images.smaller }</p>
355+
<p className="text-base">{ optimoleDashboardApp.strings.latest_images.percentage_smaller.replace( '{ratio}', 100 - getCompressionRatio() ) }</p>
356356
) : (
357357
<p className="text-base">{ optimoleDashboardApp.strings.latest_images.same_size }</p>
358358
) }

assets/src/dashboard/utils/api.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export const connectAccount = ( data, callback = () => {}) => {
153153
sendOnboardingImages();
154154
toggleDashboardSidebarSubmenu( true );
155155

156-
console.log( '%c OptiMole API connection successful.', 'color: #59B278' );
156+
console.log( '%c Optimole API connection successful.', 'color: #59B278' );
157157

158158
} else {
159159
setHasValidKey( false );
@@ -195,7 +195,7 @@ export const disconnectAccount = () => {
195195
sethasDashboardLoaded( false );
196196
setShowDisconnect( false );
197197
toggleDashboardSidebarSubmenu( false );
198-
console.log( '%c Disconnected from OptiMole API.', 'color: #59B278' );
198+
console.log( '%c Disconnected from Optimole API.', 'color: #59B278' );
199199
} else {
200200
console.error( response );
201201
}
@@ -221,7 +221,7 @@ export const selectDomain = ( data, callback = () => {}) => {
221221
setAPIKey( response.data.api_key );
222222
setUserData( response.data );
223223
setAvailableApps( response.data );
224-
console.log( '%c OptiMole API connection successful.', 'color: #59B278' );
224+
console.log( '%c Optimole API connection successful.', 'color: #59B278' );
225225
} else {
226226
setHasValidKey( false );
227227
console.log( '%c Invalid API Key.', 'color: #E7602A' );
@@ -271,7 +271,7 @@ export const requestStatsUpdate = () => {
271271
if ( 'disconnected' === response.code ) {
272272
setIsConnected( false );
273273
sethasDashboardLoaded( false );
274-
console.log( '%c Disconnected from OptiMole API.', 'color: #59B278' );
274+
console.log( '%c Disconnected from Optimole API.', 'color: #59B278' );
275275
}
276276
});
277277
};

assets/src/global.d.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,9 @@ export interface LatestImages {
481481
no_images_found: string
482482
compression: string
483483
loading_latest_images: string
484-
last: string
485-
saved: string
486-
smaller: string
487-
optimized_images: string
484+
last_optimized_images: string
485+
percentage_saved: string
486+
percentage_smaller: string
488487
same_size: string
489488
small_optimization: string
490489
medium_optimization: string

assets/src/widget/components/WidgetFooter.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Icon, external } from '@wordpress/icons';
22

33
export default function WidgetFooter() {
4-
const { i18n, dashboardURL, adminPageURL } = optimoleDashboardWidget;
4+
const { i18n, dashboardURL, dashboardMetricsURL } = optimoleDashboardWidget;
55

66
return (
77
<div className="flex justify-between gap-4 items-center px-4 py-2 bg-gray-50">
@@ -10,8 +10,9 @@ export default function WidgetFooter() {
1010
<span className="text-base font-bold text-gray-800 group-hover:text-dark-blue transition-colors duration-300">Optimole</span>
1111
</a>
1212

13-
<a href={ adminPageURL } className="text-sm text-info font-medium cursor-pointer hover:text-dark-blue no-underline transition-colors duration-300">
13+
<a href={ dashboardMetricsURL } className="text-sm text-info font-medium cursor-pointer hover:text-dark-blue no-underline transition-colors duration-300 flex items-center gap-1">
1414
{ i18n.viewAllStats }
15+
<Icon icon={ external } className="w-5 h-5 fill-current transition-colors duration-300"/>
1516
</a>
1617
</div>
1718
);

composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)