File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,12 @@ abstract class Optml_App_Replacer {
59
59
* @var Optml_Settings $settings
60
60
*/
61
61
public $ settings = null ;
62
+ /**
63
+ * Cached offloading status.
64
+ *
65
+ * @var null|bool Offload status.
66
+ */
67
+ public static $ offload_enabled = null ;
62
68
/**
63
69
* Defines if the dimensions should be limited when images are served.
64
70
*
@@ -356,6 +362,9 @@ function ( $strings = [] ) {
356
362
},
357
363
10
358
364
);
365
+ if ( self ::$ offload_enabled === null ) {
366
+ self ::$ offload_enabled = ( new Optml_Settings () )->is_offload_enabled ();
367
+ }
359
368
}
360
369
361
370
Original file line number Diff line number Diff line change @@ -383,6 +383,9 @@ private function is_dam_url( $url ) {
383
383
private function is_offloaded_url ( $ source_url ) {
384
384
$ attachment_id = 0 ;
385
385
386
+ if ( ! self ::$ offload_enabled ) {
387
+ return 0 ;
388
+ }
386
389
if ( strpos ( $ source_url , Optml_Media_Offload::KEYS ['not_processed_flag ' ] ) !== false ) {
387
390
$ attachment_id = (int ) Optml_Media_Offload::get_attachment_id_from_url ( $ source_url );
388
391
} else {
You can’t perform that action at this time.
0 commit comments