Skip to content

Commit

Permalink
Fix issues with Settings namespace for certain sites. (#325)
Browse files Browse the repository at this point in the history
* Avoid problems with Settings namespace for certain sites.

* Fix CS
  • Loading branch information
pedromcp90 authored Sep 11, 2024
1 parent b5313d5 commit 4064440
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
18 changes: 15 additions & 3 deletions doofinder-for-woocommerce/doofinder-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: DOOFINDER Search and Discovery for WP & WooCommerce
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Version: 2.5.2
* Version: 2.5.3
* Requires at least: 5.6
* Requires PHP: 7.0
* Author: Doofinder
Expand All @@ -16,6 +16,7 @@

use Doofinder\WP\Multilanguage\Multilanguage;
use Doofinder\WP\Admin_Notices;
use Doofinder\WP\Settings;
use WP_Http;

if ( ! defined( 'ABSPATH' ) ) {
Expand All @@ -37,7 +38,7 @@ class Doofinder_For_WordPress {
* @var string
*/

public static $version = '2.5.2';
public static $version = '2.5.3';

/**
* The only instance of Doofinder_For_WordPress
Expand Down Expand Up @@ -439,6 +440,17 @@ function () {
}
);
}

/**
* Method that adds some custom schedules to be used in WP Cron.
*
* @param array $schedules Current WP Schedules as array.
*
* @return array List of previous schedules + DooFinder ones.
*/
public static function add_schedules( $schedules ) {
return Settings::add_schedules( $schedules );
}
}

endif;
Expand All @@ -450,4 +462,4 @@ function () {
add_action( 'plugins_loaded', array( '\Doofinder\WP\Doofinder_For_WordPress', 'instance' ), 0 );
add_action( 'upgrader_process_complete', array( '\Doofinder\WP\Doofinder_For_WordPress', 'upgrader_process_complete' ), 10, 2 );
// Add cron_schedules here to avoid issues with hook order.
add_filter( 'cron_schedules', array( '\Doofinder\WP\Settings', 'add_schedules' ), 100, 1 ); // phpcs:ignore WordPress.WP.CronInterval
add_filter( 'cron_schedules', array( '\Doofinder\WP\Doofinder_For_WordPress', 'add_schedules' ), 100, 1 ); // phpcs:ignore WordPress.WP.CronInterval
7 changes: 5 additions & 2 deletions doofinder-for-woocommerce/readme.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
=== DOOFINDER Search and Discovery for WP & WooCommerce ===
Contributors: Doofinder
Tags: search, autocomplete
Version: 2.5.2
Version: 2.5.3
Requires at least: 5.6
Tested up to: 6.6.1
Requires PHP: 7.0
Stable tag: 2.5.2
Stable tag: 2.5.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -126,6 +126,9 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro

== Changelog ==

= 2.5.3 =
- Fixed issues with Settings namespace.

= 2.5.2 =
- Fixed issue with cron_schedules.

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "doofinder-woocommerce",
"version": "2.5.2",
"version": "2.5.3",
"description": "Integrate Doofinder in your WooCommerce site with (almost) no effort.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 4064440

Please sign in to comment.