Skip to content

Commit 6031c55

Browse files
authored
Merge pull request #221 from WebberZone/develop
Develop
2 parents 1acbc1e + fb76bc1 commit 6031c55

File tree

156 files changed

+12357
-5558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+12357
-5558
lines changed

.github/workflows/cs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Install PHP
2727
uses: shivammathur/setup-php@v2
2828
with:
29-
php-version: '7.4'
29+
php-version: '8.0'
3030
tools: cs2pr
3131
coverage: none
3232

.github/workflows/unit-tests.yml

Lines changed: 27 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Unit Tests
22

33
on:
4-
# Run on all pushes and on all pull requests.
5-
# Prevent the build from running when there are only irrelevant changes.
64
push:
75
paths-ignore:
86
- '**.md'
@@ -11,7 +9,6 @@ on:
119
paths-ignore:
1210
- '**.md'
1311
- '**.txt'
14-
# Allow manually triggering the workflow.
1512
workflow_dispatch:
1613

1714
jobs:
@@ -21,100 +18,72 @@ jobs:
2118
strategy:
2219
fail-fast: false
2320
matrix:
24-
# Notes regarding supported versions in WP:
25-
# Testing against stable PHP versions with WordPress 6.6+
2621
php: ['7.4', '8.1', '8.2', '8.3']
2722
wp: ['latest']
28-
experimental: [false]
23+
mysql: ['8.0']
2924

3025
include:
31-
# Test against older supported WordPress version
3226
- php: '8.3'
3327
wp: '6.6'
34-
# Experimental builds for upcoming PHP versions
35-
- php: '8.5'
28+
mysql: '8.0'
29+
- php: '8.4'
3630
wp: 'latest'
31+
mysql: '8.0'
3732
experimental: true
38-
- php: '8.4'
33+
- php: '8.5'
3934
wp: 'latest'
35+
mysql: '8.0'
4036
experimental: true
4137

42-
name: "PHP ${{ matrix.php }} - WP ${{ matrix.wp }}"
43-
38+
name: "PHP ${{ matrix.php }} - WP ${{ matrix.wp }} - MySQL ${{ matrix.mysql }}"
4439
continue-on-error: ${{ matrix.experimental == true }}
4540

46-
services:
47-
mysql:
48-
# WP 5.4 is the first WP version which largely supports MySQL 8.0.
49-
# See: https://core.trac.wordpress.org/ticket/49344
50-
# During the setting up of these tests, it became clear that MySQL 8.0
51-
# in combination with PHP < 7.4 is not properly/sufficiently supported
52-
# within WP Core.
53-
# See: https://core.trac.wordpress.org/ticket/52496
54-
image: mysql:${{ ( matrix.wp == 5.3 && '5.6' ) || ( (matrix.wp < 5.4 || matrix.php < 7.4) && '5.7' ) || '8.0' }}
55-
env:
56-
MYSQL_ALLOW_EMPTY_PASSWORD: false
57-
ports:
58-
- 3306:3306
59-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10
60-
6141
steps:
6242
- name: Checkout code
6343
uses: actions/checkout@v4
6444

45+
- name: Setup MySQL
46+
uses: ankane/setup-mysql@v1
47+
with:
48+
mysql-version: ${{ matrix.mysql }}
49+
6550
- name: Install PHP
6651
uses: shivammathur/setup-php@v2
6752
with:
6853
php-version: ${{ matrix.php }}
69-
extensions: mysqli, mysql
54+
extensions: mysqli
7055
coverage: none
7156

72-
# On WP 5.2, PHPUnit 5.x, 6.x and 7.x are supported.
73-
# On PHP >= 8.0, PHPUnit 7.5+ is needed, no matter what.
74-
- name: Determine supported PHPUnit version
75-
id: set_phpunit
57+
- name: Set PHPUnit version
7658
run: |
7759
if [[ "${{ matrix.php }}" > "8.0" ]]; then
7860
echo "PHPUNIT=9.*" >> $GITHUB_ENV
7961
else
8062
echo "PHPUNIT=5.7.*||6.*||7.5.*||8.5.*" >> $GITHUB_ENV
8163
fi
8264
83-
- name: 'Composer: set up PHPUnit'
84-
env:
85-
PHPUNIT: ${{ env.PHPUNIT }}
86-
run: composer require --no-update phpunit/phpunit:"${{ env.PHPUNIT }}"
65+
- name: Set up PHPUnit
66+
run: composer require --no-update phpunit/phpunit:"$PHPUNIT"
8767

88-
# Install dependencies and handle caching in one go.
89-
# @link https://github.com/marketplace/actions/install-composer-dependencies
90-
- name: Install Composer dependencies for PHP < 8.0
68+
- name: Install dependencies for PHP < 8.0
9169
if: ${{ matrix.php < 8.0 }}
92-
uses: "ramsey/composer-install@v2"
70+
uses: ramsey/composer-install@v3
9371

94-
# For the PHP 8.0 and above, we need to install with ignore platform reqs as not all dependencies allow it yet.
95-
- name: Install Composer dependencies for PHP >= 8.0
72+
- name: Install dependencies for PHP >= 8.0
9673
if: ${{ matrix.php >= 8.0 }}
97-
uses: "ramsey/composer-install@v2"
74+
uses: ramsey/composer-install@v3
9875
with:
9976
composer-options: --ignore-platform-reqs
10077

101-
- name: Install Subversion
102-
run: sudo apt-get install subversion
103-
104-
- name: Set up WordPress
105-
run: phpunit/install.sh wordpress_test root '' 127.0.0.1:3306 ${{ matrix.wp }}
106-
107-
- name: Tool versions
78+
- name: Set up WordPress test environment
10879
run: |
109-
php --version
110-
composer --version
111-
./vendor/bin/phpunit --version
112-
which ./vendor/bin/phpunit
80+
sudo apt-get install -y subversion
81+
bash phpunit/install.sh wordpress_test root '' 127.0.0.1:3306 ${{ matrix.wp }}
11382
114-
- name: Run the unit tests - single site
115-
run: ./vendor/bin/phpunit
83+
- name: Run tests (single site)
84+
run: vendor/bin/phpunit
11685

117-
- name: Run the unit tests - multisite
86+
- name: Run tests (multisite)
11887
env:
11988
WP_MULTISITE: 1
120-
run: ./vendor/bin/phpunit
89+
run: vendor/bin/phpunit

.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: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1-
node_modules
1+
# Ignore entire vendor except Freemius
2+
/vendor/*
3+
!/vendor/freemius/
4+
5+
# Tooling
6+
/phpcompat-tools/
7+
/node_modules/
8+
9+
# Lock files
210
package-lock.json
311
composer.lock

README.md

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
[![Required PHP](https://img.shields.io/wordpress/plugin/required-php/contextual-related-posts?style=flat-square)](https://wordpress.org/plugins/contextual-related-posts/)
99
[![Active installs](https://img.shields.io/wordpress/plugin/installs/contextual-related-posts?style=flat-square)](https://wordpress.org/plugins/contextual-related-posts/)
1010

11-
__Requires:__ 6.3
11+
__Requires:__ 6.6
1212

13-
__Tested up to:__ 6.8
13+
__Tested up to:__ 6.9
1414

1515
__Requires PHP:__ 7.4
1616

@@ -26,7 +26,7 @@ Keep visitors on your site longer with intelligent, fast-loading contextually re
2626

2727
### Key features
2828

29-
* __Activate and Forget__: Activate the plugin. Contextual Related Posts automatically displays related posts on your site and feed after the content. There is no need to edit any template files.
29+
* __Activate and Forget__: Activate the plugin. Contextual Related Posts automatically displays related posts on your site and in your feed after the content. There is no need to edit any template files.
3030
* __Custom Control with Manual Install__: Want placement control? You have multiple options available:
3131
* __Gutenberg / Block Editor support__: You can easily add a "Related Posts [CRP]" block to any post or page with its options and settings.
3232
* __Widgets__: Add related posts to any widgetized theme area, such as the sidebar or footer. You can configure the widget options to suit your needs.
@@ -50,6 +50,14 @@ Additional features include:
5050
* __Customizable output__: Display post excerpts in the related posts list. Customize the HTML tags and attributes used to display the output.
5151
* __Extendable code__: Many filters and actions allow developers to easily add features, modify outputs, or integrate with other plugins.
5252

53+
### MySQL FULLTEXT indices
54+
55+
On activation, the plugin creates three MySQL FULLTEXT indices (or indexes), which are leveraged to find the related posts. [Learn more about how the algorithm works](https://webberzone.com/support/knowledgebase/contextual-related-posts-algorithm/).
56+
57+
If you're running a multisite installation, an index is created for each blog upon activation. These indices occupy space in your MySQL database but are essential for running the plugin.
58+
59+
Two options on the settings page allow you to remove these indices when deactivating or deleting the plugin. The latter is true by default.
60+
5361
### 💼 Features Exclusive to CRP Pro
5462

5563
[CRP Pro](https://webberzone.com/plugins/contextual-related-posts/pro/) supercharges your related posts with advanced customization, better performance, and powerful content strategy tools.
@@ -58,12 +66,36 @@ Additional features include:
5866

5967
* [Efficient Content Storage and Indexing](https://webberzone.com/support/knowledgebase/efficient-content-storage-and-indexing/): Speed up your site with optimized custom tables and efficient database indices for lightning-fast queries.
6068
* [Cache Setting](https://webberzone.com/support/knowledgebase/caching-in-contextual-related-posts/): Fine-tune your performance with configurable cache times from 1 hour to 1 year.
69+
* [Server Load Threshold](https://webberzone.com/support/knowledgebase/server-load-threshold-setting-in-contextual-related-posts-pro/): Prevent CRP from running queries when the database is under heavy load.
70+
* [Bot Protection](https://webberzone.com/support/knowledgebase/contextual-related-posts-bot-protection/): Skip CRP processing for known bots and crawlers using an extensible signature list, saving server resources.
6171

6272
#### 🎯 Smarter Content Matching
6373

6474
* [Advanced Algorithm](https://webberzone.com/support/knowledgebase/contextual-related-posts-algorithm/): Control exactly how relevant content is found by adjusting weights for title, content, and excerpt.
6575
* [Taxonomy Weight System](https://webberzone.com/support/knowledgebase/contextual-related-posts-algorithm/#weighting-categories-tags-and-taxonomies): Refine your matches with precise taxonomy weighting for perfect content relationships.
6676

77+
#### 🛒 WooCommerce Integration
78+
79+
* __Related Products for WooCommerce__: Seamlessly integrate with WooCommerce to show related products.
80+
* __Product Matching & Filtering__: Index SKUs and attributes, filter by stock status, and use category-based recommendations with native WooCommerce styling.
81+
* __Display Customization__: Toggle prices, ratings, and choose to replace or complement WooCommerce's related products.
82+
83+
[📖 WooCommerce Related Products Documentation](https://webberzone.com/support/knowledgebase/woocommerce-related-products/)
84+
85+
### WP-CLI Support
86+
87+
Contextual Related Posts Pro includes comprehensive WP-CLI commands for advanced management and automation. Perfect for developers, agencies, and site administrators who need powerful command-line tools.
88+
89+
__Key WP-CLI Features:__
90+
91+
* __Database Management__: Migrate post meta, check index status, and manage database operations
92+
* __Cache Control__: Clear, warm, enable/disable cache with multisite support
93+
* __Custom Table Operations__: Sync content and manage FULLTEXT indexes for optimal performance
94+
* __Content Processing__: Reprocess posts and manage related content in bulk
95+
* __Multisite Ready__: All commands support `--network` flag for multisite installations
96+
97+
[📖 Complete CLI Documentation](https://webberzone.com/support/knowledgebase/contextual-related-posts-wp-cli/)
98+
6799
#### 🎨 Advanced Design & Display Options
68100

69101
* [Block Editor Integration](https://webberzone.com/support/knowledgebase/contextual-related-posts-blocks/): Create beautiful layouts with the Query Loop Block and ready-to-use block patterns including Grid, Image with Title, and more.
@@ -75,14 +107,6 @@ Additional features include:
75107
* [Cornerstone Posts](https://webberzone.com/support/knowledgebase/cornerstone-posts-in-contextual-related-posts/): Guide visitors to your most important content by featuring key articles in your related posts lists.
76108
* [Additional Metabox Settings](https://webberzone.com/support/knowledgebase/contextual-related-posts-metabox/): Control related content at the individual post level for perfect content relationships.
77109

78-
### MySQL FULLTEXT indices
79-
80-
On activation, the plugin creates three MySQL FULLTEXT indices (or indexes), which are leveraged to find the related posts. [Learn more about how the algorithm works](https://webberzone.com/support/knowledgebase/contextual-related-posts-algorithm/).
81-
82-
If you're running a multisite installation, an index is created for each blog upon activation. These indices occupy space in your MySQL database but are essential for running the plugin.
83-
84-
Two options on the settings page allow you to remove these indices when deactivating or deleting the plugin. The latter is true by default.
85-
86110
### GDPR
87111

88112
Contextual Related Posts doesn’t collect personal data or send information to external services — making it GDPR-friendly by default.
@@ -95,6 +119,13 @@ Love Contextual Related Posts? Help keep it alive!
95119

96120
You can [donate](https://wzn.io/donate-crp) or upgrade to [CRP Pro](https://webberzone.com/plugins/contextual-related-posts/pro/) — both help support development and support.
97121

122+
### Contribute
123+
124+
Contextual Related Posts is also available on [Github](https://github.com/WebberZone/contextual-related-posts).
125+
So, if you've got some cool feature you'd like to implement into the plugin or a bug you've been able to fix, consider forking the project and sending me a pull request.
126+
127+
Bug reports are [welcomed on Github](https://github.com/WebberZone/contextual-related-posts/issues). Please note Github is _not_ a support forum, and issues that aren't suitably qualified as bugs will be closed.
128+
98129
### Translations
99130

100131
Contextual Related Posts is available for [translation directly on WordPress.org](https://translate.wordpress.org/projects/wp-plugins/contextual-related-posts). Check out the official [Translator Handbook](https://make.wordpress.org/polyglots/handbook/rosetta/theme-plugin-directories/) to contribute.

0 commit comments

Comments
 (0)