Skip to content

Commit

Permalink
Closes #6851: 3.17 refactor regression: {wpr_imagedimensions=1} query…
Browse files Browse the repository at this point in the history
… string isnot added to home page while warmup after fresh install (#6853)
  • Loading branch information
jeawhanlee authored Aug 8, 2024
1 parent 83877b4 commit 10b0b65
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion inc/Engine/Activation/Activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use WP_Rocket\ServiceProvider\Options as OptionsServiceProvider;
use WP_Rocket\ThirdParty\Hostings\HostResolver;
use WP_Rocket\ThirdParty\Hostings\ServiceProvider as HostingsServiceProvider;
use WP_Rocket\Event_Management\Event_Manager;

/**
* Plugin activation controller
Expand Down Expand Up @@ -40,7 +41,8 @@ class Activation {
* @return void
*/
public static function activate_plugin() {
$container = new Container();
$container = new Container();
$event_manager = new Event_Manager();

$container->add( 'template_path', WP_ROCKET_PATH . 'views' );
$options_api = new Options( 'wp_rocket_' );
Expand All @@ -53,6 +55,7 @@ public static function activate_plugin() {
$container->addServiceProvider( new LoggerServiceProvider() );
$container->get( 'logger' );
$container->addServiceProvider( new PerformanceHintsActivationServiceProvider() );
$event_manager->add_subscriber( $container->get( 'performance_hints_warmup_subscriber' ) );

$host_type = HostResolver::get_host_service();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace WP_Rocket\Engine\Common\PerformanceHints\Activation;

use WP_Rocket\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
use WP_Rocket\Engine\Common\PerformanceHints\WarmUp\{APIClient, Controller as WarmUpController, Queue};
use WP_Rocket\Engine\Common\PerformanceHints\WarmUp\{APIClient, Controller as WarmUpController, Subscriber as WarmUpSubscriber, Queue};
use WP_Rocket\Engine\Media\AboveTheFold\Context\Context as ATFContext;
use WP_Rocket\Engine\Media\AboveTheFold\Activation\ActivationFactory as ATFActivationFactory;

Expand All @@ -23,6 +23,7 @@ class ServiceProvider extends AbstractServiceProvider {
'performance_hints_warmup_queue',
'performance_hints_warmup_controller',
'performance_hints_activation',
'performance_hints_warmup_subscriber',
'atf_context',
'atf_activation_factory',
];
Expand Down Expand Up @@ -78,6 +79,9 @@ public function register(): void {
]
);

$this->getContainer()->addShared( 'performance_hints_warmup_subscriber', WarmUpSubscriber::class )
->addArgument( $this->getContainer()->get( 'performance_hints_warmup_controller' ) );

$this->getContainer()->add( 'performance_hints_activation', Activation::class )
->addArguments(
[
Expand Down

0 comments on commit 10b0b65

Please sign in to comment.