Skip to content

Commit 7ea6529

Browse files
committed
feat: sync from pro version and update for 2026
- Update files from better-search-pro (excluding .git and load-freemius.php) - Remove @fs_premium_only annotations and Update URI - Remove Freemius premium initialization blocks - Delete includes/pro/ directory - Update copyright year to 2026 - Update i18n files (better-search-en_US.pot/po/mo) - Fix package names (remove -free suffix) - Apply PHPCS formatting fixes - Clean up plugin metadata for free version
1 parent b44b406 commit 7ea6529

21 files changed

Lines changed: 1377 additions & 1237 deletions

.github/workflows/zipitup.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,16 @@ jobs:
2323
steps:
2424
- name: Checkout code
2525
uses: actions/checkout@v4
26+
2627
- name: Build project
2728
run: |
2829
mkdir build
30+
2931
- name: Create artifact
3032
uses: montudor/action-zip@v1
3133
with:
32-
args: zip -X -r build/${{ github.event.repository.name }}.zip . -x *.git* node_modules/\* .* "*/\.*" CODE_OF_CONDUCT.md CONTRIBUTING.md ISSUE_TEMPLATE.md PULL_REQUEST_TEMPLATE.md *.dist *.yml *.neon composer.* package.json dev-helpers** build** wporg-assets** phpunit**
34+
args: zip -X -r build/${{ github.event.repository.name }}.zip . -x *.git* node_modules/\* .* "*/\.*" "*/.git*" "*/.DS_Store" CODE_OF_CONDUCT.md CONTRIBUTING.md ISSUE_TEMPLATE.md PULL_REQUEST_TEMPLATE.md *.dist *.yml *.neon composer.* package.json package-lock.json dev-helpers** build** wporg-assets** docs/\* phpunit** phpstan-bootstrap.php
35+
3336
- name: Upload artifact
3437
uses: actions/upload-artifact@v4
3538
with:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
# Lock files
1010
package-lock.json
11-
composer.lock
11+
composer.lock

includes/admin/class-admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ public function admin_enqueue_scripts() {
278278
* @since 3.3.0
279279
*/
280280
public static function display_admin_sidebar() {
281-
require_once BETTER_SEARCH_PLUGIN_DIR . 'includes/admin/settings/sidebar.php';
281+
require_once BETTER_SEARCH_PLUGIN_DIR . 'includes/admin/sidebar.php';
282282
}
283283

284284
/**

includes/admin/class-dashboard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function render_page() {
157157
<div id="postbox-container-1" class="postbox-container">
158158

159159
<div id="side-sortables" class="meta-box-sortables ui-sortable">
160-
<?php include_once 'settings/sidebar.php'; ?>
160+
<?php include_once 'sidebar.php'; ?>
161161
</div><!-- /#side-sortables -->
162162

163163
</div><!-- /#postbox-container-1 -->

includes/admin/class-tools-page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ public function render_page() {
356356
<div id="postbox-container-1" class="postbox-container">
357357

358358
<div id="side-sortables" class="meta-box-sortables ui-sortable">
359-
<?php include_once 'settings/sidebar.php'; ?>
359+
<?php include_once 'sidebar.php'; ?>
360360
</div><!-- /#side-sortables -->
361361

362362
</div><!-- /#postbox-container-1 -->

includes/admin/class-upgrader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function render_page() {
128128
<div id="postbox-container-1" class="postbox-container">
129129

130130
<div id="side-sortables" class="meta-box-sortables ui-sortable">
131-
<?php include_once 'settings/sidebar.php'; ?>
131+
<?php include_once 'sidebar.php'; ?>
132132
</div><!-- /#side-sortables -->
133133

134134
</div><!-- /#postbox-container-1 -->

includes/admin/settings/class-metabox-api.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22
/**
3-
* Metabox API class.
3+
* Class to display and save a Metabox.
44
*
5-
* @package WebberZone\Better_Search\Admin\Settings
5+
* @package WebberZone\Better_Search
66
*/
77

88
namespace WebberZone\Better_Search\Admin\Settings;

includes/admin/settings/class-settings-api.php

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<?php
22
/**
3-
* Settings API class.
3+
* Settings API.
44
*
5-
* @package WebberZone\Better_Search\Admin\Settings
5+
* Functions to register, read, write and update settings.
6+
* Portions of this code have been inspired by Easy Digital Downloads, WordPress Settings Sandbox, WordPress Settings API class, etc.
7+
*
8+
* @package WebberZone\Better_Search
69
*/
710

811
namespace WebberZone\Better_Search\Admin\Settings;
@@ -24,7 +27,7 @@ class Settings_API {
2427
*
2528
* @var string
2629
*/
27-
public const VERSION = '2.7.1';
30+
public const VERSION = '2.7.2';
2831

2932
/**
3033
* Settings Key.
@@ -542,14 +545,16 @@ public function admin_enqueue_scripts( $hook ) {
542545
);
543546

544547
if ( $hook === $this->settings_page ) {
545-
$this->enqueue_scripts_styles();
548+
self::enqueue_scripts_styles( $this->prefix );
546549
}
547550
}
548551

549552
/**
550553
* Enqueues all scripts, styles, settings, and templates necessary to use the Settings API.
554+
*
555+
* @param string $prefix Prefix which is used for creating the unique filters and actions.
551556
*/
552-
public function enqueue_scripts_styles() {
557+
public static function enqueue_scripts_styles( $prefix ) {
553558

554559
wp_enqueue_style( 'wp-color-picker' );
555560

@@ -569,28 +574,28 @@ public function enqueue_scripts_styles() {
569574
)
570575
);
571576

572-
wp_enqueue_script( 'wz-' . $this->prefix . '-admin' );
573-
wp_enqueue_script( 'wz-' . $this->prefix . '-codemirror' );
574-
wp_enqueue_script( 'wz-' . $this->prefix . '-taxonomy-suggest' );
575-
wp_enqueue_script( 'wz-' . $this->prefix . '-media-selector' );
577+
wp_enqueue_script( 'wz-' . $prefix . '-admin' );
578+
wp_enqueue_script( 'wz-' . $prefix . '-codemirror' );
579+
wp_enqueue_script( 'wz-' . $prefix . '-taxonomy-suggest' );
580+
wp_enqueue_script( 'wz-' . $prefix . '-media-selector' );
576581

577582
// Enqueue Tom Select.
578-
wp_enqueue_style( 'wz-' . $this->prefix . '-tom-select' );
579-
wp_enqueue_script( 'wz-' . $this->prefix . '-tom-select' );
583+
wp_enqueue_style( 'wz-' . $prefix . '-tom-select' );
584+
wp_enqueue_script( 'wz-' . $prefix . '-tom-select' );
580585

581586
// Localize Tom Select settings.
582587
wp_localize_script(
583-
'wz-' . $this->prefix . '-tom-select-init',
588+
'wz-' . $prefix . '-tom-select-init',
584589
'WZTomSelectSettings',
585590
array(
586-
'action' => $this->prefix . '_taxonomy_search_tom_select',
587-
'nonce' => wp_create_nonce( $this->prefix . '_taxonomy_search_tom_select' ),
591+
'action' => $prefix . '_taxonomy_search_tom_select',
592+
'nonce' => wp_create_nonce( $prefix . '_taxonomy_search_tom_select' ),
588593
'endpoint' => 'forms',
589594
)
590595
);
591-
wp_enqueue_script( 'wz-' . $this->prefix . '-tom-select-init' );
596+
wp_enqueue_script( 'wz-' . $prefix . '-tom-select-init' );
592597

593-
wp_enqueue_style( 'wz-' . $this->prefix . '-admin' );
598+
wp_enqueue_style( 'wz-' . $prefix . '-admin' );
594599
}
595600

596601
/**

includes/admin/settings/class-settings-form.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?php
22
/**
3-
* Settings Form class.
3+
* Generates the settings form.
4+
*
5+
* @link https://webberzone.com
46
*
5-
* @package WebberZone\Better_Search\Admin\Settings
7+
* @package WebberZone\Better_Search
68
*/
79

810
namespace WebberZone\Better_Search\Admin\Settings;

includes/admin/settings/class-settings-sanitize.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?php
22
/**
3-
* Settings Sanitize class.
3+
* Functions to sanitize settings.
44
*
5-
* @package WebberZone\Better_Search\Admin\Settings
5+
* @link https://webberzone.com
6+
*
7+
* @package WebberZone\Better_Search
68
*/
79

810
namespace WebberZone\Better_Search\Admin\Settings;
@@ -178,7 +180,7 @@ public function sanitize_textarea_field( $value ) {
178180
*
179181
* @param array $allowedtags Allowed tags array.
180182
*/
181-
$allowedtags = apply_filters( 'wz_sanitize_allowed_tags', $allowedtags );
183+
$allowedtags = apply_filters( $this->prefix . '_sanitize_allowed_tags', $allowedtags );
182184

183185
return wp_kses( wp_unslash( $value ), $allowedtags );
184186
}

0 commit comments

Comments
 (0)