From 1d6c3ddbfb478084a4725ca1ed1e25d2d7bce51b Mon Sep 17 00:00:00 2001 From: John Date: Mon, 1 Jan 2024 18:16:53 +0100 Subject: [PATCH] Fixes for 3.0.8 (#173) * Ignore multiline validation * Remove donation form * Bump versions --- includes/api/class-route.php | 5 +- package.json | 80 +- readme.txt | 9 +- search-regex.php | 2 +- src/page/options/donation.js | 146 - src/page/options/index.js | 3 - src/page/options/options-form.js | 14 - src/page/options/style.scss | 42 - yarn.lock | 7852 +++++++++++++++++------------- 9 files changed, 4586 insertions(+), 3567 deletions(-) delete mode 100644 src/page/options/donation.js diff --git a/includes/api/class-route.php b/includes/api/class-route.php index a54c14a..945ce46 100644 --- a/includes/api/class-route.php +++ b/includes/api/class-route.php @@ -291,10 +291,7 @@ protected function get_search_replace( $params ) { public function validate_search_flags( $value, \WP_REST_Request $request, $param ) { if ( is_array( $value ) ) { $source = new Search\Flags( $value ); - - if ( count( $source->get_flags() ) === count( $value ) ) { - return true; - } + return true; } return new \WP_Error( 'rest_invalid_param', 'Invalid search flag detected', array( 'status' => 400 ) ); diff --git a/package.json b/package.json index 4d8f181..a0cc8f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "search-regex", - "version": "3.0.7", + "version": "3.0.8", "description": "Adds search and replace functionality across posts, pages, comments, and meta-data, with full regular expression support", "main": "search-regex.php", "sideEffects": true, @@ -38,63 +38,63 @@ }, "homepage": "https://github.com/johngodley/search-regex", "devDependencies": { - "@types/jest": "^29.0.0", - "@types/react": "^18.0.18", - "@types/react-dom": "^18.0.6", - "@types/react-highlight-words": "^0.16.4", - "@types/react-redux": "^7.1.24", - "@wordpress/base-styles": "^4.7.0", - "@wordpress/eslint-plugin": "^13.0.0", - "@wordpress/prettier-config": "^2.0.0", - "@wordpress/scripts": "^24.0.0", - "apidoc": "^0.52.0", - "chai": "^4.3.6", + "@types/jest": "^29.5.11", + "@types/react": "^18.2.46", + "@types/react-dom": "^18.2.18", + "@types/react-highlight-words": "^0.16.7", + "@types/react-redux": "^7.1.33", + "@wordpress/base-styles": "^4.39.0", + "@wordpress/eslint-plugin": "^17.5.0", + "@wordpress/prettier-config": "^3.5.0", + "@wordpress/scripts": "^26.19.0", + "apidoc": "^1.2.0", + "chai": "^5.0.0", "download": "^8.0.0", - "glob-all": "^3.3.0", + "glob-all": "^3.3.1", "gulp": "^4.0.2", - "gulp-deleted": "1.0.0", + "gulp-deleted": "2.0.0", "gulp-po2json": "^1.0.0", "gulp-zip": "^5.1.0", "he": "^1.2.0", - "jest": "^29.0.1", - "jest-environment-jsdom": "^29.0.1", - "mocha": "^10.0.0", - "node-fetch": "2", + "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", + "mocha": "^10.2.0", + "node-fetch": "3", "path": "^0.12.7", - "prettier": "npm:wp-prettier@2.6.2", - "release-it": "^15.4.1", + "prettier": "npm:wp-prettier@3.0.3", + "release-it": "^17.0.1", "request": "^2.88.2", "through": "^2.3.8", "through2": "^4.0.2", - "webpack-shell-plugin-next": "^2.2.2" + "webpack-shell-plugin-next": "^2.3.1" }, "dependencies": { - "@emotion/react": "^11.10.4", - "@redux-devtools/extension": "^3.2.3", - "@wordpress/element": "^4.14.0", - "@wordpress/i18n": "^4.16.0", - "classnames": "^2.3.1", - "date-fns": "^2.29.2", - "deep-equal": "^2.0.5", + "@emotion/react": "^11.11.3", + "@redux-devtools/extension": "^3.3.0", + "@wordpress/element": "^5.25.0", + "@wordpress/i18n": "^4.48.0", + "classnames": "^2.5.1", + "date-fns": "^3.0.6", + "deep-equal": "^2.2.3", "file-saver": "^2.0.5", - "qs": "^6.11.0", - "rc-progress": "^3.4.0", - "rc-util": "^5.23.0", + "qs": "^6.11.2", + "rc-progress": "^3.5.1", + "rc-util": "^5.38.1", "react": "^18.2.0", "react-copy-to-clipboard": "^5.1.0", - "react-datepicker": "^4.8.0", + "react-datepicker": "^4.25.0", "react-delta": "^1.1.2", "react-dom": "^18.2.0", - "react-dropzone": "^14.2.2", - "react-focus-lock": "^2.9.1", - "react-highlight-words": "^0.18.0", - "react-redux": "^8.0.2", - "react-textarea-autosize": "^8.3.4", "redux": "^4.2.0", "redux-thunk": "^2.4.1", - "typescript": "^4.8.2", - "url": "^0.11.0", - "use-debounce": "^8.0.4" + "react-dropzone": "^14.2.3", + "react-focus-lock": "^2.9.6", + "react-highlight-words": "^0.20.0", + "react-redux": "^9.0.4", + "react-textarea-autosize": "^8.5.3", + "typescript": "^5.3.3", + "url": "^0.11.3", + "use-debounce": "^10.0.0" }, "apidoc": { "name": "Search Regex REST API", diff --git a/readme.txt b/readme.txt index 81a4c23..78f4fa2 100644 --- a/readme.txt +++ b/readme.txt @@ -2,9 +2,9 @@ Contributors: johnny5 Donate link: http://searchregex.com/donation/ Tags: search, replace, regex, regular expression, database, post, page -Requires at least: 5.6 -Tested up to: 6.3 -Stable tag: 3.0.7 +Requires at least: 6.0 +Tested up to: 6.4 +Stable tag: 3.0.8 Requires PHP: 5.6 License: GPLv3 @@ -113,6 +113,9 @@ Full documentation can be found on the [Search Regex](http://searchregex.com/) s == Changelog == += 3.0.8 - January 1st 2024 = +* Fix multiline error + = 3.0.7 - September 10th 2023 = * Fix problem saving comment diff --git a/search-regex.php b/search-regex.php index 1f38be4..479ce8b 100644 --- a/search-regex.php +++ b/search-regex.php @@ -3,7 +3,7 @@ Plugin Name: Search Regex Plugin URI: https://searchregex.com/ Description: Adds search and replace functionality across posts, pages, comments, and meta-data, with full regular expression support -Version: 3.0.7 +Version: 3.0.8 Author: John Godley Text Domain: search-regex Domain Path: /locale diff --git a/src/page/options/donation.js b/src/page/options/donation.js deleted file mode 100644 index 7fa9c20..0000000 --- a/src/page/options/donation.js +++ /dev/null @@ -1,146 +0,0 @@ -/** - * External dependencies - */ - -import React from 'react'; -import { __ } from '@wordpress/i18n'; -import PropTypes from 'prop-types'; - -/** - * Internal dependencies - */ -import { Table, TableRow, createInterpolateElement } from '@wp-plugin-components'; -import './style.scss'; - -const MIN = 16; -const MAX = 100; - -class Donation extends React.Component { - static propTypes = { - support: PropTypes.bool.isRequired, - }; - - constructor ( props ) { - super( props ); - - this.onDonate = this.handleDonation.bind( this ); - this.onChange = this.handleChange.bind( this ); - this.onBlur = this.handleBlur.bind( this ); - this.onInput = this.handleInput.bind( this ); - this.state = { - support: props.support, - amount: 20, - }; - } - - handleBlur() { - this.setState( { amount: Math.max( MIN, this.state.amount ) } ); - } - - handleDonation() { - this.setState( { support: false } ); - } - - getReturnUrl() { - return document.location.href + '#thanks'; - } - - handleChange( data ) { - if ( this.state.amount !== data.value ) { - this.setState( { amount: parseInt( data.value, 10 ) } ); - } - } - - handleInput( ev ) { - const value = ev.target.value ? parseInt( ev.target.value, 10 ) : MIN; - - this.setState( { amount: value } ); - } - - getAmountoji( amount ) { - const amounts = [ - [ 100, '😍' ], - [ 80, '😎' ], - [ 60, '😊' ], - [ 40, '😃' ], - [ 20, '😀' ], - [ 10, '🙂' ], - ]; - - for ( let pos = 0; pos < amounts.length; pos++ ) { - if ( amount >= amounts[ pos ][ 0 ] ) { - return amounts[ pos ][ 1 ]; - } - } - - return amounts[ amounts.length - 1 ][ 1 ]; - } - - renderSupported() { - return ( -
- { __( "You've supported this plugin - thank you!" ) }   - { __( "I'd like to support some more." ) } -
- ); - } - - renderUnsupported() { - const marks = { [ MIN ]: '' }; - - for ( let x = 20; x <= MAX; x += 20 ) { - marks[ x ] = ''; - } - - return ( -
-

- { createInterpolateElement( - __( 'Search Regex is free to use - life is wonderful and lovely! It has required a great deal of time and effort to develop and you can help support this development by {{strong}}making a small donation{{/strong}}.', 'search-regex' ), - { - strong: , - } ) } -  { __( 'You get useful software and I get to carry on making it better.', 'search-regex' ) } -

- - - - - - - - - - - - - - - - -
- $ - - { this.getAmountoji( this.state.amount ) } - -
-
- ); - } - - render() { - const { support } = this.state; - - return ( -
- - - { support ? this.renderSupported() : this.renderUnsupported() } - -
-
- ); - } -} - -export default Donation; diff --git a/src/page/options/index.js b/src/page/options/index.js index 1ddda80..1dd3f60 100644 --- a/src/page/options/index.js +++ b/src/page/options/index.js @@ -2,7 +2,6 @@ * External dependencies */ -import React from 'react'; import { connect } from 'react-redux'; import { __ } from '@wordpress/i18n'; @@ -10,14 +9,12 @@ import { __ } from '@wordpress/i18n'; * Internal dependencies */ import OptionsForm from './options-form'; -import Donation from './donation'; function Options( props ) { const { values } = props; return (
-
); diff --git a/src/page/options/options-form.js b/src/page/options/options-form.js index d1b0a28..f2b1a00 100644 --- a/src/page/options/options-form.js +++ b/src/page/options/options-form.js @@ -43,20 +43,6 @@ function OptionsForm( props ) { return (
- - - -