Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP8 compatibilty #32

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion shoppingfeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ function init() {
\WP_CLI::add_command( 'shopping-feed feed-generation', '\\ShoppingFeed\ShoppingFeedWC\Cli\FeedGeneration' );
}

\add_action( 'plugins_loaded', __NAMESPACE__ . '\\init', 100 );
\add_action( 'init', __NAMESPACE__ . '\\init', 100 );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, why have changed this hook ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

Sorry for the response delay. in fact, activating the plugin triggered an error for us. By modifying the delay in which the callback function launches, this solved the problem.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the error message ? Because this is the right hook :)

2 changes: 1 addition & 1 deletion src/Admin/MarketingBord.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private function __clone() {
/**
* Singleton instance can't be serialized.
*/
private function __wakeup() {
public function __wakeup() {
}

public function display_marketing_bord() {
Expand Down
20 changes: 10 additions & 10 deletions src/Admin/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,10 @@ function () {
function () {
?>
<select name="<?php echo esc_html( sprintf( '%s[product_identifier]', self::SF_FEED_OPTIONS ) ); ?>">
<option value="id" <?php selected( 'id', $this->sf_feed_options['product_identifier'] ? $this->sf_feed_options['product_identifier'] : false ); ?>>
<option value="id" <?php selected( 'id', isset( $this->sf_feed_options['product_identifier'] ) ? $this->sf_feed_options['product_identifier'] : false ); ?>>
<?php esc_html_e( 'Product ID (recommended)', 'shopping-feed' ); ?>
</option>
<option value="sku" <?php selected( 'sku', $this->sf_feed_options['product_identifier'] ? $this->sf_feed_options['product_identifier'] : false ); ?>>
<option value="sku" <?php selected( 'sku', isset( $this->sf_feed_options['product_identifier'] ) ? $this->sf_feed_options['product_identifier'] : false ); ?>>
<?php esc_html_e( 'SKU', 'shopping-feed' ); ?>
</option>
</select>
Expand All @@ -499,10 +499,10 @@ function () {
function () {
?>
<select name="<?php echo esc_html( sprintf( '%s[category_display_mode]', self::SF_FEED_OPTIONS ) ); ?>">
<option value="normal" <?php selected( 'id', $this->sf_feed_options['category_display_mode'] ? $this->sf_feed_options['category_display_mode'] : false ); ?>>
<option value="normal" <?php selected( 'id', isset( $this->sf_feed_options['category_display_mode'] ) ? $this->sf_feed_options['category_display_mode'] : false ); ?>>
<?php esc_html_e( 'Normal', 'shopping-feed' ); ?>
</option>
<option value="breadcrumb" <?php selected( 'breadcrumb', $this->sf_feed_options['category_display_mode'] ? $this->sf_feed_options['category_display_mode'] : false ); ?>>
<option value="breadcrumb" <?php selected( 'breadcrumb', isset( $this->sf_feed_options['category_display_mode'] ) ? $this->sf_feed_options['category_display_mode'] : false ); ?>>
<?php esc_html_e( 'Breadcrumb', 'shopping-feed' ); ?>
</option>
</select>
Expand Down Expand Up @@ -580,7 +580,7 @@ function () use ( $frequencies_options ) {
?>
<option
value="<?php echo esc_html( $frequency ); ?>"
<?php selected( $frequency, $this->sf_feed_options['frequency'] ? $this->sf_feed_options['frequency'] : false ); ?>
<?php selected( $frequency, isset( $this->sf_feed_options['frequency'] ) ? $this->sf_feed_options['frequency'] : false ); ?>
><?php echo esc_html( $name ); ?></option>
<?php
}
Expand All @@ -607,7 +607,7 @@ function () {
?>
<option
value="<?php echo esc_html( $part_size_option ); ?>"
<?php selected( $part_size_option, $this->sf_feed_options['part_size'] ? $this->sf_feed_options['part_size'] : false ); ?>
<?php selected( $part_size_option, isset( $this->sf_feed_options['part_size'] ) ? $this->sf_feed_options['part_size'] : false ); ?>
><?php echo esc_html( $part_size_option ); ?></option>
<?php
}
Expand Down Expand Up @@ -725,9 +725,9 @@ function () {
?>
<select id="retrieval_mode" name="<?php echo esc_html( sprintf( '%s[retrieval_mode]', self::SF_SHIPPING_OPTIONS ) ); ?>">
<option value="ADDONS"
<?php selected( 'ADDONS', $this->sf_shipping_options['retrieval_mode'] ? $this->sf_shipping_options['retrieval_mode'] : false ); ?>>Addons</option>
<?php selected( 'ADDONS', isset( $this->sf_shipping_options['retrieval_mode'] ) ? $this->sf_shipping_options['retrieval_mode'] : false ); ?>>Addons</option>
<option value="METAS"
<?php selected( 'METAS', $this->sf_shipping_options['retrieval_mode'] ? $this->sf_shipping_options['retrieval_mode'] : false ); ?>>Métas</option>
<?php selected( 'METAS', isset( $this->sf_shipping_options['retrieval_mode'] ) ? $this->sf_shipping_options['retrieval_mode'] : false ); ?>>Métas</option>
</select>
<p class="description"
id="tagline-description">
Expand Down Expand Up @@ -890,7 +890,7 @@ function () use ( $frequencies_options ) {
?>
<option
value="<?php echo esc_html( $frequency ); ?>"
<?php selected( $frequency, $this->sf_orders_options['import_frequency'] ? $this->sf_orders_options['import_frequency'] : false ); ?>
<?php selected( $frequency, isset( $this->sf_orders_options['import_frequency'] ) ? $this->sf_orders_options['import_frequency'] : false ); ?>
><?php echo esc_html( $name ); ?></option>
<?php
}
Expand Down Expand Up @@ -927,7 +927,7 @@ function () use ( $wc_order_statuses ) {
?>
<option
value="<?php echo esc_html( $wc_order_statuse ); ?>"
<?php selected( $wc_order_statuse, $this->sf_orders_options['default_status'] ? $this->sf_orders_options['default_status'] : false ); ?>
<?php selected( $wc_order_statuse, isset( $this->sf_orders_options['default_status'] ) ? $this->sf_orders_options['default_status'] : false ); ?>
><?php echo esc_html( $name ); ?></option>
<?php
}
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/Requirements.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private function __clone() {
/**
* Singleton instance can't be serialized.
*/
private function __wakeup() {
public function __wakeup() {
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Feed/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,6 @@ private function __clone() {
/**
* Singleton instance can't be serialized.
*/
private function __wakeup() {
public function __wakeup() {
}
}
2 changes: 1 addition & 1 deletion src/Feed/Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private function __clone() {
/**
* Singleton instance can't be serialized.
*/
private function __wakeup() {
public function __wakeup() {
}

private function __construct() {
Expand Down
2 changes: 1 addition & 1 deletion src/Feed/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private function __clone() {
/**
* Singleton instance can't be serialized.
*/
private function __wakeup() {
public function __wakeup() {
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Orders/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private function __clone() {
/**
* Singleton instance can't be serialized.
*/
private function __wakeup() {
public function __wakeup() {
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Products/Products.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private function __clone() {
/**
* Singleton instance can't be serialized.
*/
private function __wakeup() {
public function __wakeup() {
}

public function get_list_args() {
Expand Down
2 changes: 1 addition & 1 deletion src/ShoppingFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private function __clone() {
/**
* Singleton instance can't be serialized.
*/
private function __wakeup() {
public function __wakeup() {
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/ShoppingFeedHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ private function __clone() {
/**
* Singleton instance can't be serialized.
*/
private function __wakeup() {
public function __wakeup() {
}

/**
Expand Down