Skip to content

Commit

Permalink
Fix Paste event interception when custom fields are not enabled becau…
Browse files Browse the repository at this point in the history
…se Editor is loaded in an iframe
  • Loading branch information
webaxones committed Jul 21, 2024
1 parent d925f9d commit dacf046
Show file tree
Hide file tree
Showing 19 changed files with 2,969 additions and 496 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@ node_modules/
.vscode/*
.wp-env.json

# PHPCS configuration file
phpcs.xml

# Mac files
.DS_Store
2 changes: 1 addition & 1 deletion build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-components', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-i18n', 'wp-notices', 'wp-plugins'), 'version' => '2291d62ab83f3f59c1f5');
<?php return array('dependencies' => array('react', 'wp-components', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-i18n', 'wp-notices', 'wp-plugins'), 'version' => 'bcd6cb4e252b3d42baa6');
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

116 changes: 116 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
== Changelog ==

This file contains only old changelog. See readme.txt for newer versions.

= 1.5.8 =
* Add rule for fraction symbols

= 1.5.7 =
* Fix for last rule

= 1.5.6 =
* Fix for version number

= 1.5.5 =
* Add rule to replace curly quotes with french quotes for fr_FR & fr_BE because Google Doc transforms double quotes into curved quotes, but does not offer French quotes

= 1.5.4 =
* Sort settings by categories in sidebar
* Add some rules for symbols
* Fix settings saving that was broken in last version

= 1.5.3 =
* Fix missing stable tag

= 1.5.2 =
* Fix missing autoload vendor

= 1.5.1 =
* Fix for forgotten PHP locale rules update
* Adds GitHub Action for deploy
* Adds blueprint for WordPress Playground

= 1.5.0 =
* Fix SVN problem

= 1.4.9 =
* Fix requires PHP tag

= 1.4.8 =
* Code refactoring
* Adds first level of support for German and Romanian locales

= 1.4.7 =
* Fix a regex parsing bug for quotes on pasted text (no need to use / character with template literals)
* Fix a compatibility problem with Otter block by removing the e.preventDefault from the paste event detection (blocked copy/paste content within blocks like embed, HTML...)
* Fix PHP bug with currentUser authCallBack that prevented to save User Settings
* Upgrade @wordpress/scripts to 27.8.0 and @wordpress/compose to 6.34.0
* Updated for WordPress 6.5.2

= 1.4.5 =
* Fix a regex parsing bug on link insertion because the fetched content had changed and contained the HTML tags
* Fix the processing of capital letters at the beginning of a sentence which did not take into account question marks, exclamation marks and ellipsis
* Removes CODE, PRE, KBD tags and their content from scanned content

= 1.4.4 =
* Fix composer package check

= 1.4.3 =
* Fix version number

= 1.4.2 =
* Plugin requires PHP: 7.4 or higher

= 1.4.1 =
* Plugin stops supporting an End of life version of PHP: Requires PHP: 8.0 or higher

= 1.4.0 =
* Code goes to OOP

= 1.3.1 =
* Spelling corrections

= 1.3.0 =
* New correction added: "First sentence letter not capitalized"
* Cancellation management: Ctrl+Z or Cmd+Z right after a correction disables the correction for the next keystroke
* Code improvements

= 1.2.2 =
* Replace multiple components with one

= 1.2.1 =
* Fix: remove concat from getAllInnersFromParents

= 1.2.0 =
* New corrections added: "Two hyphens", "Ordinal number suffix", "No breaking space after", "No non-breaking space after", "No breaking space after"
* Autocorrect is now also done on innerBlocks like list items, on the fly as well as copy-paste

= 1.1.1 =
* Remove special characters from readme since they are transformed on wp org

= 1.1.0 =
* Locales management: English and French for now. Rules are automatically selected but can be modified by an admin
* Replacement of notices with self-hiding snackbars
* Code improvements
* Replacement of screenshots with animated gifs to show the process even if it is discreet.

= 1.0.4 =
* Finally fixed the translation bug: it was an extra slash to plugin_dir_path

= 1.0.3 =
* Next try to fix translations by adding wp_set_script_translations

= 1.0.2 =
* Fixed translation problem and replace get_locale with current active locale

= 1.0.1 =
* Implementation of the preparation for the management of the different locales
* Added more currencies to regex
* Changed PHP min requirements for PHP 7.3 or higher and open by default both settings panels
* Improved texts with the help of Vlad Timotei, aka @vlad-timotei aka aka Baby Yoda
* Improved the banner and fix bad help message for non breaking/breaking spaces toggle control

= 1.0.0 =

* Plugin initial commit. Let's write =^.^=

46 changes: 23 additions & 23 deletions consistency.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?php
/**
* Plugin Name: Consistency
* Plugin URI: https://www.webaxones.com
* Description: Fixes typographical consistency
* Version: 1.5.9
* Requires at least: 6.1
* Requires PHP: 7.4
* Author: Loïc Antignac
* License: GPL-3.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: consistency
*/

defined( 'ABSPATH' ) || exit;

use Webaxones\Consistency\Plugin;

if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
}

Plugin::run();
<?php
/**
* Plugin Name: Consistency
* Plugin URI: https://www.webaxones.com
* Description: Fixes typographical consistency
* Version: 1.6.0
* Requires at least: 6.1
* Requires PHP: 7.4
* Author: Loïc Antignac
* License: GPL-3.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: consistency
*/

defined( 'ABSPATH' ) || exit;

use Webaxones\Consistency\Plugin;

if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
}

Plugin::run();
4 changes: 3 additions & 1 deletion includes/Config/LocalizedRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class LocalizedRules
public static array $list = [
'quote' => [ 'fr-FR', 'fr-BE', 'en-US', 'en-AU', 'en-CA', 'en-NZ', 'en-ZA', 'en-GB' ],
'2hyphens' => [ 'fr-FR', 'fr-BE', 'en-US', 'en-AU', 'en-CA', 'en-NZ', 'en-ZA', 'en-GB', 'de-DE', 'de-AT', 'de-CH', 'ro-RO' ],
'3hyphens' => [ 'fr-FR', 'fr-BE', 'en-US', 'en-AU', 'en-CA', 'en-NZ', 'en-ZA', 'en-GB', 'de-DE', 'de-AT', 'de-CH', 'ro-RO' ],
'4hyphens' => [ 'fr-FR', 'fr-BE', 'en-US', 'en-AU', 'en-CA', 'en-NZ', 'en-ZA', 'en-GB', 'de-DE', 'de-AT', 'de-CH', 'ro-RO' ],
'ordinalNumberSuffix' => [ 'fr-FR', 'fr-BE', 'en-US', 'en-AU', 'en-CA', 'en-NZ', 'en-ZA', 'en-GB' ],
'regularToCurlyQuotes' => [ 'en-US', 'en-AU', 'en-CA', 'en-NZ', 'en-ZA', 'en-GB' ],
'regularToGermanQuotes' => [ 'de-DE', 'de-AT', 'ro-RO' ],
Expand All @@ -38,4 +40,4 @@ class LocalizedRules
'fractions' => [ 'fr-FR', 'fr-BE', 'en-US', 'en-AU', 'en-CA', 'en-NZ', 'en-ZA', 'en-GB', 'de-DE', 'de-AT', 'de-CH', 'ro-RO' ],
'percentages' => [ 'fr-FR', 'fr-BE', 'en-US', 'en-AU', 'en-CA', 'en-NZ', 'en-ZA', 'en-GB', 'de-DE', 'de-AT', 'de-CH', 'ro-RO' ],
];
}
}
2 changes: 1 addition & 1 deletion includes/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Plugin
*/
protected static function setConstants(): void
{
defined( __NAMESPACE__ . '\VERSION' ) || define( __NAMESPACE__ . '\VERSION', '1.5.9' );
defined( __NAMESPACE__ . '\VERSION' ) || define( __NAMESPACE__ . '\VERSION', '1.6.0' );
defined( __NAMESPACE__ . '\PLUGIN_URL' ) || define( __NAMESPACE__ . '\PLUGIN_URL', plugin_dir_url( __DIR__ ) );
defined( __NAMESPACE__ . '\PLUGIN_PATH' ) || define( __NAMESPACE__ . '\PLUGIN_PATH', plugin_dir_path( __DIR__ ) );
defined( __NAMESPACE__ . '\OPTION_GROUP' ) || define( __NAMESPACE__ . '\OPTION_GROUP', 'consistency_plugin' );
Expand Down
Loading

0 comments on commit dacf046

Please sign in to comment.