Skip to content

Commit

Permalink
Merge branch 'develop' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
2ndkauboy committed Nov 8, 2024
2 parents ef87eea + 12fcbd9 commit c490dd9
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 8 deletions.
10 changes: 10 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.lock
composer.json
composer.lock
.distignore
.git
.gitattributes
.github
.gitignore
phpcs.xml
.wordpress-org
36 changes: 36 additions & 0 deletions .github/workflows/wordpress-plugin-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Plugin Check
on:
pull_request:
push:
branches:
- develop
release:
types: [ published ]

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Composer install
uses: shivammathur/setup-php@v2
with:
php-version: latest
coverage: none
tools: wp-cli

- name: Install latest version of dist-archive-command
run: wp package install wp-cli/dist-archive-command:@stable

- name: Build plugin
run: |
wp dist-archive . ./${{ github.event.repository.name }}.zip
mkdir tmp-build
unzip ${{ github.event.repository.name }}.zip -d tmp-build
- name: Run plugin check
uses: wordpress/plugin-check-action@v1
with:
build-dir: ./tmp-build/${{ github.event.repository.name }}
21 changes: 18 additions & 3 deletions .github/workflows/wordpress-plugin-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,27 @@ on:

jobs:
tag:
name: New tag
name: New release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Checkout code
uses: actions/checkout@v2

- name: WordPress Plugin Deploy
id: deploy
uses: 10up/action-wordpress-plugin-deploy@stable
with:
generate-zip: true
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}

- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.deploy.outputs.zip-path }}
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip
12 changes: 11 additions & 1 deletion js/unique-title-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,17 @@ jQuery( document ).ready(
jQuery( '#unique-title-message' ).remove();

if ( 'error' === data.status || ! unique_title_checker.only_unique_error ) {
jQuery( '#post' ).before( '<div id="unique-title-message" class="' + data.status + '"><p>' + data.message + '</p></div>' );
jQuery( '#post' ).before(
jQuery(
'<div>',
{
id: 'unique-title-message',
class: data.status
}
).append(
jQuery( '<p>' ).text( data.message )
)
);
}
}
);
Expand Down
1 change: 1 addition & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<config name="minimum_supported_wp_version" value="5.7"/>

<rule ref="WordPress">
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<!-- As we use PHP 5.4+ now, we can use the short array syntax -->
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />
</rule>
Expand Down
8 changes: 6 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
=== Unique Title Checker ===
Contributors: Kau-Boy
Tags: title, seo, duplicate title, unique title
Tested up to: 6.6
Stable tag: 1.8.0
Tested up to: 6.7
Stable tag: 1.9.0
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0

Expand Down Expand Up @@ -49,6 +49,10 @@ Yes, you can simply use the filter `unique_title_checker_only_unique_error` with

== Changelog ==

= 1.9.0 =
* Improve JavaScript code security
* Time invested for this release: 60min

= 1.8.0 =
* Fix post title input selection for iframed Block Editor
* Time invested for this release: 60min
Expand Down
8 changes: 6 additions & 2 deletions unique-title-checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: Unique Title Checker
* Plugin URI: https://github.com/2ndkauboy/unique-title-checker
* Description: Checks if the title of a post, page or custom post type is unique and warn the editor if not
* Version: 1.8.0
* Version: 1.9.0
* Author: Bernhard Kau
* Author URI: http://kau-boys.de
* Text Domain: unique-title-checker
Expand Down Expand Up @@ -194,7 +194,11 @@ public function unique_title_check() {
/**
* Show an initial warning, if the title of a saved post is not unique
*
* @phpcs:disable WordPressVIPMinimum.Hooks.AlwaysReturnInFilter
*
* @wp-hook admin_notices
*
* @return void
*/
public function uniqueness_admin_notice() {
global $post, $pagenow;
Expand All @@ -211,7 +215,7 @@ public function uniqueness_admin_notice() {

// Build the necessary args for the initial uniqueness check.
$args = array(
'post__not_in' => array( $post->ID ),
'post__not_in' => array( $post->ID ), // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in
'post_type' => $post->post_type,
'post_title' => $post->post_title,
);
Expand Down

0 comments on commit c490dd9

Please sign in to comment.