| @@ -12,10 +12,10 @@ | ||
| 12 | 12 | * Should we load the integration logic. |
| 13 | 13 | * |
| 14 | 14 | * @return bool Should we load. |
| 15 | 15 | */ |
| 16 | - function should_load() { | |
| 17 | - include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); | |
| 16 | + public function should_load() { | |
| 17 | + include_once ABSPATH . 'wp-admin/includes/plugin.php'; | |
| 18 | 18 | return is_plugin_active( 'woocommerce/woocommerce.php' ); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
| @@ -24,9 +24,8 @@ | ||
| 24 | 24 | public function register() { |
| 25 | 25 | if ( Optml_Main::instance()->admin->settings->use_lazyload() ) { |
| 26 | 26 | add_filter( 'optml_lazyload_early_flags', [ $this, 'add_lazyload_early_flag' ], PHP_INT_MAX, 1 ); |
| 27 | 27 | } |
| 28 | - | |
| 29 | 28 | } |
| 30 | 29 | /** |
| 31 | 30 | * Add ignore lazyload flag. |
| 32 | 31 | * |
| @@ -57,9 +56,9 @@ | ||
| 57 | 56 | ]; |
| 58 | 57 | $products = new \WP_Query( $query_args ); |
| 59 | 58 | $ids = $products->get_posts(); |
| 60 | 59 | while ( ! empty( $ids ) ) { |
| 61 | - $paged++; | |
| 60 | + ++$paged; | |
| 62 | 61 | $parents = array_merge( $parents, $ids ); |
| 63 | 62 | $query_args['paged'] = $paged; |
| 64 | 63 | $products = new \WP_Query( $query_args ); |
| 65 | 64 | $ids = $products->get_posts(); |