From f42685f2e29f01b465c7c72cb06dc0b9d0ff543f Mon Sep 17 00:00:00 2001 From: Stoil Dobrev Date: Mon, 3 Jun 2024 13:36:35 +0300 Subject: [PATCH 01/15] init --- .gitignore | 48 +- admin-notices-manager.php | 8 +- .../jeremyHixon-RationalOptionPages/LICENSE | 21 - .../jeremyHixon-RationalOptionPages/README.md | 339 ------- .../RationalOptionPages.php | 898 ------------------ phpcs.xml | 28 - vendor/autoload.php | 7 - vendor/composer/ClassLoader.php | 572 ----------- vendor/composer/InstalledVersions.php | 350 ------- vendor/composer/LICENSE | 21 - vendor/composer/autoload_classmap.php | 10 - vendor/composer/autoload_namespaces.php | 9 - vendor/composer/autoload_psr4.php | 10 - vendor/composer/autoload_real.php | 78 -- vendor/composer/autoload_static.php | 40 - vendor/composer/installed.json | 45 - vendor/composer/installed.php | 32 - vendor/index.php | 4 - 18 files changed, 44 insertions(+), 2476 deletions(-) delete mode 100644 includes/vendor/jeremyHixon-RationalOptionPages/LICENSE delete mode 100644 includes/vendor/jeremyHixon-RationalOptionPages/README.md delete mode 100644 includes/vendor/jeremyHixon-RationalOptionPages/RationalOptionPages.php delete mode 100644 phpcs.xml delete mode 100644 vendor/autoload.php delete mode 100644 vendor/composer/ClassLoader.php delete mode 100644 vendor/composer/InstalledVersions.php delete mode 100644 vendor/composer/LICENSE delete mode 100644 vendor/composer/autoload_classmap.php delete mode 100644 vendor/composer/autoload_namespaces.php delete mode 100644 vendor/composer/autoload_psr4.php delete mode 100644 vendor/composer/autoload_real.php delete mode 100644 vendor/composer/autoload_static.php delete mode 100644 vendor/composer/installed.json delete mode 100644 vendor/composer/installed.php delete mode 100644 vendor/index.php diff --git a/.gitignore b/.gitignore index ab3e617..a56aa14 100644 --- a/.gitignore +++ b/.gitignore @@ -42,14 +42,6 @@ Thumbs.db **/.sass-cache/* **/.map -# Composer # -########## -!assets/js/vendor/ -wpcs/ -vendor -!vendor/composer -!vendor/*.php - # Bower # ########## assets/bower_components/* @@ -72,3 +64,43 @@ assets/bower_components/* ########## assets/img/.DS_Store .vscode/ + +node_modules +bower_components +release +third-party/* +vendor/* +builds/* +php-scoper/vendor/* +dist/* +.idea +*.log + +# Editors +*.esproj +*.tmproj +*.tmproject +tmtags +.*.sw[a-z] +*.un~ +Session.vim +*.swp + +# Mac OSX +.DS_Store +._* +.Spotlight-V100 +.Trashes + +# Windows +Thumbs.db +Desktop.ini +.vscode/launch.json + +/tests/_support/_generated/ +/.wp-install/ +/.env + +/testing/ + +composer\.lock diff --git a/admin-notices-manager.php b/admin-notices-manager.php index 2ce6f55..39ff7d7 100644 --- a/admin-notices-manager.php +++ b/admin-notices-manager.php @@ -36,8 +36,8 @@ // Useful global constants. if ( ! defined( 'ADMIN_NOTICES_MANAGER_VERSION' ) ) { define( 'ADMIN_NOTICES_MANAGER_VERSION', '1.4.0' ); - define( 'ADMIN_NOTICES_MANAGER_URL', plugin_dir_url( __FILE__ ) ); - define( 'ADMIN_NOTICES_MANAGER_PATH', plugin_dir_path( __FILE__ ) ); + define( 'ADMIN_NOTICES_MANAGER_URL', \plugin_dir_url( __FILE__ ) ); + define( 'ADMIN_NOTICES_MANAGER_PATH', \plugin_dir_path( __FILE__ ) ); define( 'ADMIN_NOTICES_MANAGER_INC', ADMIN_NOTICES_MANAGER_PATH . 'includes/' ); } @@ -45,8 +45,8 @@ require_once ADMIN_NOTICES_MANAGER_INC . 'functions/core.php'; // Activation/Deactivation. -register_activation_hook( __FILE__, '\AdminNoticesManager\Core\activate' ); -register_deactivation_hook( __FILE__, '\AdminNoticesManager\Core\deactivate' ); +\register_activation_hook( __FILE__, '\AdminNoticesManager\Core\activate' ); +\register_deactivation_hook( __FILE__, '\AdminNoticesManager\Core\deactivate' ); // Require Composer autoloader if it exists. if ( file_exists( ADMIN_NOTICES_MANAGER_PATH . '/vendor/autoload.php' ) ) { diff --git a/includes/vendor/jeremyHixon-RationalOptionPages/LICENSE b/includes/vendor/jeremyHixon-RationalOptionPages/LICENSE deleted file mode 100644 index a64e3ba..0000000 --- a/includes/vendor/jeremyHixon-RationalOptionPages/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Jeremy - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/includes/vendor/jeremyHixon-RationalOptionPages/README.md b/includes/vendor/jeremyHixon-RationalOptionPages/README.md deleted file mode 100644 index bddd6f1..0000000 --- a/includes/vendor/jeremyHixon-RationalOptionPages/README.md +++ /dev/null @@ -1,339 +0,0 @@ -# RationalOptionPages - -A PHP class for building WordPress Option Pages. Uses multi-dimensional associative arrays to try and make the process of adding option pages a little easier to map out and use. - -## Table of Contents - -1. [Installation](#installation) -2. [Usage](#usage) - 1. [Pages](#pages) - 2. [Subpages](#subpages) - 3. [Fields](#fields) -3. [Retrieving Data](#retrieving-data) -4. [To Do](#to-do) - -## Installation - -* Download or clone the repo -* Include `RationalOptionPages.php` in your file -* Instantiate the class with your array of pages - -```php -if ( !class_exists( 'RationalOptionPages' ) ) { - require_once('RationalOptionPages.php'); -} -$pages = array( - 'sample-page' => array( - 'page_title' => __( 'Sample Page', 'sample-domain' ), - ), -); -$option_page = new RationalOptionPages( $pages ); -``` -### Note: - -If you installed this previously and the class is already being instantiated somewhere else you will get fatal errors. You can avoid this by either renaming the class or by wrapping the `require_once()` in a `if ( !class_exists() )` conditional. - -## Usage - -### Pages - -Pages are added in a key/value syntax where the value is an array of parameters for the page itself. - -#### Parameters - -Based on [WordPress' `add_menu_page()` function](https://developer.wordpress.org/reference/functions/add_menu_page/). - -* `page_title` - The text string for the title of the page __Required__. -* `menu_title` - The text string for the menu item itself. Defaults to `page_title`. -* `capability` - The permissions required to access this page. Defaults to `manage_options`. -* `menu_slug` - The "slug" of the menu item. Defaults to a "slugified" version of the `page_title`. -* `icon_url` - The URL of the menu icon. [WordPress' Dashicons are available](https://developer.wordpress.org/resource/dashicons). Defaults to `false`, renders "dashicons-admin-generic". -* `position` - The position where the menu item appears, from 1 to 99. Defaults to `null`, last. - -If your page title is more than 2 words I recommend using the `menu_title` parameter to avoid wrapping. The default `capability` should work for most plugins and themes as only the admin would typically make higher level changes like these. - -### Subpages - -Subpages are differentiated by the `parent_slug` parameter. They can be added either at the top level of the pages array submitted to the class or under a `subpages` key within another, top-level page parameter array. - -#### Parameters - -Based on [WordPress' `add_submenu_page()` function](https://developer.wordpress.org/reference/functions/add_submenu_page/). - -* `parent_slug` - The `menu_slug` of the parent page. [WordPress has several top-level menu items](https://codex.wordpress.org/Administration_Menus#Using_add_submenu_page). __Required__ (unless added via the `subpages` key method). -* `page_title` - The text string for the title of the page. __Required__. -* `menu_title` - The text string for the menu item itself. Defaults to `page_title`. -* `capability` - The permissions required to access this page. Defaults to `manage_options`. -* `menu_slug` - The "slug" of the menu item. Defaults to a "slugified" version of the `page_title`. - -#### Example - -```php -require_once('RationalOptionPages.php'); -$pages = array( - 'sample-page' => array( - 'page_title' => __( 'Sample Page', 'sample-domain' ), - // via the subpages key - 'subpages' => array( - 'sub-page-one' => array( - 'page_title' => __( 'Sub Page One', 'sample-domain' ), - ), - ), - ), - // via the pages array itself - 'sub-page-two' => array( - 'parent_slug' => 'sample_page', - 'page_title' => __( 'Sub Page Two', 'sample-domain' ), - ), - // sub page of the "Appearance" menu item - 'sub-theme' => array( - 'parent_slug' => 'themes.php', - 'page_title' => __( 'Sub Theme', 'sample-domain' ), - ), -); -$option_page = new RationalOptionPages( $pages ); -``` - -### Sections - -Sections are added via a `sections` key in the page parameter arrays. - -#### Parameters - -Based on [WordPress' `add_settings_section()` function](https://developer.wordpress.org/reference/functions/add_settings_section/). - -* `title` - The title of the section. __Required__. -* `id` - The ID of the section. -* `callback` - An optional parameter for generating custom, section content. __Requires `custom` parameter be set to `true`__. -* `custom` - A boolean option that indicates you want to use a custom callback. Defaults to `false`. -* `text` - An option parameter for adding HTML text under the section title. -* `include` - An option parameter that calls PHP's `include()` under the section title. __Use absolute path__. - -#### Example - -```php -require_once('RationalOptionPages.php'); -$pages = array( - 'sample-page' => array( - 'page_title' => __( 'Sample Page', 'sample-domain' ), - 'sections' => array( - 'section-one' => array( - 'title' => __( 'Section One', 'sample-domain' ), - 'text' => '

' . __( 'Some HTML text to describe the section', 'sample-domain' ) . '

', - 'include' => plugin_dir_path( __FILE__ ) . '/your-include.php', - ), - 'section-two' => array( - 'title' => __( 'Section Two', 'sample-domain' ), - 'custom' => true, - 'callback' => 'custom_section_callback_function', - ), - ), - ), -); -$option_page = new RationalOptionPages( $pages ); -``` - -### Fields - -Fields are added via a `fields` key in the section parameter array. - -#### Parameters - -Based on [WordPress' `add_settings_field()` function](https://developer.wordpress.org/reference/functions/add_settings_field/). - -* `title` - The title/label of the field. __Required__. -* `id` - The ID of the field. -* `callback` - An optional parameter for generating custom, field content. __Requires `custom` parameter be set to `true`__. -* `custom` - A boolean option that indicates you want to use a custom callback. Defaults to `false`. -* `type` - The type of field to use. [Most input types are available](http://www.w3schools.com/html/html_form_input_types.asp) as well as `select`, `textarea`, `wp_editor` and `media` (instead of `file` input type). -* `text` - Help text for most input types. Label for `checkbox`. -* `title_attr` - The "title" attribute of the input (if available). -* `choices` - Associative array of options for radio groups and select elements. __Required for `radio` and `select` types__. -* `placeholder` - The placeholder attribute of the input (if available). -* `value` - The default value of the input. -* `checked` - A boolean for the default state of the `checkbox` type. Defaults to `false`. -* `attributes` - Associative array of additional attributes for the input element. - * Input - `autocomplete, autofocus, disabled, list, max, maxlength, min, pattern, readonly, required, size and step` - * Select - `multiple, size` - * Textarea - `cols, rows and wrap` -* `sanitize` - A boolean that indicates whether or not the field's value should be sanitized. Defaults to `false`, and doesn't apply to checkboxes. - -#### Examples - -The most basic of inputs. - -```php -require_once('RationalOptionPages.php'); -$pages = array( - 'sample-page' => array( - 'page_title' => __( 'Sample Page', 'sample-domain' ), - 'sections' => array( - 'section-one' => array( - 'title' => __( 'Section One', 'sample-domain' ), - 'fields' => array( - 'default' => array( - 'title' => __( 'Default', 'sample-domain' ), - ), - ), - ), - ), - ), -); -$option_page = new RationalOptionPages( $pages ); -``` - -Almost everything. - -```php -require_once('RationalOptionPages.php'); -$pages = array( - 'sample-page' => array( - 'page_title' => __( 'Sample Page', 'sample-domain' ), - 'sections' => array( - 'section-one' => array( - 'title' => __( 'Standard Inputs', 'sample-domain' ), - 'fields' => array( - 'default' => array( - 'title' => __( 'Default (text)', 'sample-domain' ), - 'text' => __( 'Text attributes are used as help text for most input types.' ), - ), - 'date' => array( - 'title' => __( 'Date', 'sample-domain' ), - 'type' => 'date', - 'value' => 'now', - ), - 'datetime' => array( - 'title' => __( 'Datetime-Local', 'sample-domain' ), - 'type' => 'datetime-local', - 'value' => 'now', - ), - 'datetime-local' => array( - 'title' => __( 'Datetime-Local', 'sample-domain' ), - 'type' => 'datetime-local', - 'value' => 'now', - ), - 'email' => array( - 'title' => __( 'Email', 'sample-domain' ), - 'type' => 'email', - 'placeholder' => 'email.address@domain.com', - ), - 'month' => array( - 'title' => __( 'Month', 'sample-domain' ), - 'type' => 'month', - 'value' => 'now', - ), - 'number' => array( - 'title' => __( 'Number', 'sample-domain' ), - 'type' => 'number', - 'value' => 42, - ), - 'password' => array( - 'title' => __( 'Password', 'sample-domain' ), - 'type' => 'password', - ), - 'search' => array( - 'title' => __( 'Search', 'sample-domain' ), - 'type' => 'search', - 'placeholder' => __( 'Keywords or terms…', 'sample-domain' ), - ), - 'tel' => array( - 'title' => __( 'Telephone', 'sample-domain' ), - 'type' => 'tel', - 'placeholder' => '(555) 555-5555', - ), - 'time' => array( - 'title' => __( 'Time', 'sample-domain' ), - 'type' => 'time', - 'value' => 'now', - ), - 'url' => array( - 'title' => __( 'URL', 'sample-domain' ), - 'type' => 'url', - 'placeholder' => 'http://jeremyhixon.com', - ), - 'week' => array( - 'title' => __( 'Week', 'sample-domain' ), - 'type' => 'week', - 'value' => 'now', - ), - ), - ), - 'section-two' => array( - 'title' => __( 'Non-standard Input', 'sample-domain' ), - 'fields' => array( - 'checkbox' => array( - 'title' => __( 'Checkbox', 'sample-domain' ), - 'type' => 'checkbox', - 'text' => __( 'Text attributes are used as labels for checkboxes' ), - ), - 'color' => array( - 'title' => __( 'Color', 'sample-domain' ), - 'type' => 'color', - 'value' => '#cc0000', - ), - 'media' => array( - 'title' => __( 'Media', 'sample-domain' ), - 'type' => 'media', - 'value' => 'http://your-domain.com/wp-content/uploads/2016/01/sample.jpg', - ), - 'radio' => array( - 'title' => __( 'Radio', 'sample-domain' ), - 'type' => 'radio', - 'value' => 'option-two', - 'choices' => array( - 'option-one' => __( 'Option One', 'sample-domain' ), - 'option-two' => __( 'Option Two', 'sample-domain' ), - ), - ), - 'range' => array( - 'title' => __( 'Range', 'sample-domain' ), - 'type' => 'range', - 'value' => 75, - ), - 'select' => array( - 'title' => __( 'Select', 'sample-domain' ), - 'type' => 'select', - 'value' => 'option-two', - 'choices' => array( - 'option-one' => __( 'Option One', 'sample-domain' ), - 'option-two' => __( 'Option Two', 'sample-domain' ), - ), - ), - 'textarea' => array( - 'title' => __( 'Textarea', 'sample-domain' ), - 'type' => 'textarea', - 'value' => 'Pellentesque consectetur volutpat lectus, ac molestie lorem molestie nec. Vestibulum in auctor massa. Vivamus convallis nunc quis lacus maximus, non ultricies risus gravida. Praesent ac diam imperdiet, volutpat nisi sed, semper eros. In nec orci hendrerit, laoreet nunc eu, semper magna. Curabitur eu lorem a enim sodales consequat. Vestibulum eros nunc, congue sed blandit in, maximus eu tellus.', - ), - 'wp_editor' => array( - 'title' => __( 'WP Editor', 'sample-domain' ), - 'type' => 'wp_editor', - 'value' => 'Pellentesque consectetur volutpat lectus, ac molestie lorem molestie nec. Vestibulum in auctor massa. Vivamus convallis nunc quis lacus maximus, non ultricies risus gravida. Praesent ac diam imperdiet, volutpat nisi sed, semper eros. In nec orci hendrerit, laoreet nunc eu, semper magna. Curabitur eu lorem a enim sodales consequat. Vestibulum eros nunc, congue sed blandit in, maximus eu tellus.', - ), - ), - ), - ), - ), -); -$option_page = new RationalOptionPages( $pages ); -``` - -## Retrieving Data - -Each page stores it's fields in an entry in the database. The key is the array key for your page. - -Using the example above as a reference: - -```php -// Get all options for the page -$options = get_option( 'sample-page', array() ); - -// Each field id is a key in the options array -$date = $options['date']; -$tel = $options['telephone']; -``` - -If you let the class generate the field IDs then they will be "slugified" versions of the `title` parameter. For example; a field with the title of "Website Address" will have an ID of "website_address". You can also see this key by inspecting the input and looking at the input's `name` attribute. Within the square (`[]`) brackets. - -## To Do - -* Add `text` and `include` parameters to pages. diff --git a/includes/vendor/jeremyHixon-RationalOptionPages/RationalOptionPages.php b/includes/vendor/jeremyHixon-RationalOptionPages/RationalOptionPages.php deleted file mode 100644 index d8e8f77..0000000 --- a/includes/vendor/jeremyHixon-RationalOptionPages/RationalOptionPages.php +++ /dev/null @@ -1,898 +0,0 @@ - - * @copyright Copyright (c) 2016 - * @link http://jeremyhixon.com - * @version 1.0.0 - */ -class RationalOptionPages { - /* ========================================================================== - Vars - ========================================================================== */ - protected $attributes = array( - 'input' => array( - 'autocomplete' => false, - 'autofocus' => false, - 'disabled' => false, - 'list' => false, - 'max' => false, - 'maxlength' => false, - 'min' => false, - 'pattern' => false, - 'readonly' => false, - 'required' => false, - 'size' => false, - 'step' => false, - ), - 'select' => array( - 'multiple' => false, - 'size' => 4, - ), - 'textarea' => array( - 'cols' => 20, - 'rows' => 2, - 'wrap' => 'soft', - ), - ); - protected $defaults = array( - 'add_menu_page' => array( - 'page_title' => 'Option Page', - 'menu_title' => 'Option Page', - 'capability' => 'manage_options', - 'menu_slug' => 'option_page', - 'callback' => false, - 'icon_url' => false, - 'position' => null, - ), - 'add_settings_field' => array( - 'id' => 'settings_field', - 'title' => 'Settings Field', - 'callback' => false, - 'page' => 'option_page', - 'section' => 'settings_section', - 'args' => false, - ), - 'add_settings_section' => array( - 'id' => 'settings_section', - 'title' => 'Settings Section', - 'callback' => false, - 'page' => 'option_page', - ), - 'add_submenu_page' => array( - 'parent_slug' => 'option_page', - 'page_title' => 'Sub Option Page', - 'menu_title' => 'Sub Option Page', - 'capability' => 'manage_options', - 'menu_slug' => 'sub_option_page', - 'callback' => false, - ), - ); - protected $errors; - protected $fields = array( - 'checkbox' => array( - 'checked' => false, - 'value' => 'on', - ), - 'text' => array( - 'class' => 'regular-text', - 'placeholder' => '', - 'value' => false, - ), - 'textarea' => array( - 'class' => 'large-text', - 'placeholder' => '', - 'rows' => 10, - 'value' => false, - ), - 'wp_editor' => array( - 'wpautop' => true, - 'media_buttons' => true, - 'textarea_rows' => 'default', - 'tabindex' => false, - 'editor_css' => false, - 'editor_class' => '', - 'editor_height' => false, - 'teeny' => false, - 'dfw' => false, - 'tinymce' => true, - 'quicktags' => true, - 'drag_drop_upload' => false, - ), - ); - protected $media_script = false; - protected $notices; - protected $options; - protected $pages = array(); - protected $subpages = array(); - protected $points; - - /* ========================================================================== - Magic methods - ========================================================================== */ - /** - * Catches unknown method calls - * - * @param string $method The method being requested - * @param array $arguments Array of arguments passed to the method - */ - public function __call( $method, $arguments ) { - $request = explode( '|', $method ); - $source = $request[0]; - $page_key = !empty( $request[1] ) ? $request[1] : false; - $section_key = !empty( $request[2] ) ? $request[2] : false; - $field_key = !empty( $request[3] ) ? $request[3] : false; - - switch ( $source ) { - case 'add_menu_page': - case 'add_submenu_page': - $this->build_menu_page( $page_key ); - break; - case 'add_settings_section': - $this->build_settings_section( $page_key, $section_key ); - break; - case 'add_settings_field': - $this->build_settings_field( $page_key, $section_key, $field_key ); - break; - case 'register_setting': - return $this->sanitize_setting( $page_key, $arguments[0] ); - default: - $this->submit_notice( $method ); - } - } - - /** - * Class construct method. Configures class and hooks into WordPress. - * - * @param array $pages Array of option pages - */ - public function __construct( $pages = array() ) { - foreach ( $pages as $page_key => $page_params ) { - $this->pages[ $page_key ] = $this->validate_page( $page_key, $page_params ); - } - $this->pages = array_merge( $this->pages, $this->subpages ); - - add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); - add_action( 'admin_head', array( $this, 'admin_head' ) ); - add_action( 'admin_init', array( $this, 'admin_init' ) ); - add_action( 'admin_menu', array( $this, 'admin_menu' ) ); - add_action( 'admin_notices', array( $this, 'admin_notices' ) ); - } - - /* ========================================================================== - WordPress hooks - ========================================================================== */ - /** - * Action: admin_enqueue_scripts - * Conditionally queue's up jQuery and the media uploader script - */ - public function admin_enqueue_scripts() { - if ( $this->media_script ) { - wp_enqueue_script( 'jquery' ); - wp_enqueue_media(); - } - } - - /** - * Action: admin_head - * Conditionally adds the script to manage media uploads - */ - public function admin_head() { - if ( $this->media_script ) { - ?> - pages as $page_key => $page_params ) { - // Finalize sanitize - if ( empty( $page_params['custom'] ) && !is_array( $page_params['sanitize'] ) ) { - $page_params['sanitize'] = array( $this, $page_params['sanitize'] ); - } - - register_setting( - $page_key, - $page_key, - $page_params['sanitize'] - ); - - if ( !empty( $page_params['sections'] ) ) { - foreach ( $page_params['sections'] as $section_key => $section_params ) { - // Sort and trim the array for the function - $sort_order = array_keys( $this->defaults['add_settings_section'] ); - $params = $this->sort_array( $section_params, $sort_order ); - $params = array_slice( $params, 0, count( $this->defaults['add_settings_section'] ) ); - - // Finalize callback - if ( empty( $params['custom'] ) && !is_array( $params['callback'] ) ) { - $params['callback'] = array( $this, $params['callback'] ); - } - - call_user_func_array( 'add_settings_section', array_values( $params ) ); - - if ( !empty( $section_params['fields'] ) ) { - foreach ( $section_params['fields'] as $field_key => $field_params ) { - // Check for "media" type for adding script - if ( !$this->media_script && $field_params['type'] === 'media' ) { - $this->media_script = true; - } - - // Sort and trim the array for the function - $sort_order = array_keys( $this->defaults['add_settings_field'] ); - $params = $this->sort_array( $field_params, $sort_order ); - $params = array_slice( $params, 0, count( $this->defaults['add_settings_field'] ) ); - - // Add label wrapper on title - if ( - !in_array( $field_params['type'], array( 'radio' ) ) && - ( empty( $field_params['no_label'] ) || $field_params['no_label'] === false ) - ) { - $params['title'] = ""; - } - - // Finalize callback - if ( empty( $params['custom'] ) && !is_array( $params['callback'] ) ) { - $params['callback'] = array( $this, $params['callback'] ); - } - - call_user_func_array( 'add_settings_field', array_values( $params ) ); - } - } - } - } - } - } - - /** - * Action: admin_menu. Adding the option pages to the admin menu. - */ - public function admin_menu() { - $all_pages = array_merge( $this->pages, $this->subpages ); - - foreach ( $all_pages as $page ) { - // Sort and trim the array for the function - $sort_order = array_keys( $this->defaults[ $page['function'] ] ); - $params = $this->sort_array( $page, $sort_order ); - $params = array_slice( $params, 0, count( $this->defaults[ $page['function'] ] ) ); - - // Finalize callback - $params['callback'] = array( $this, $params['callback'] ); - - - call_user_func_array( $page['function'], array_values( $params ) ); - } - } - - /** - * Action: admin_notices. Spitting out notices when needed. - */ - public function admin_notices() { - // notice-error, notice-warning, notice-success, or notice-info. - if ( !empty( $this->errors ) ) { - foreach ( $this->errors as $error ) { - echo $error; - } - } - if ( !empty( $this->notices ) ) { - foreach ( $this->notices as $notice ) { - echo $notice; - } - } - - // update point in array for future reference - $this->points['admin_notices'] = true; - } - - /* ========================================================================== - Helpers - ========================================================================== */ - public function add_page( $page_key, $page_params ) { - $this->pages[ $page_key ] = $this->validate_page( $page_key, $page_params ); - } - - /** - * Builds the menu page - * - * @param string $page_key The array key of the page needing built - */ - protected function build_menu_page( $page_key ) { - $page = $this->pages[ $page_key ]; - $this->options = get_option( $page_key, array() ); - settings_errors(); - ?>
-

' . $page['text'] . '

'; - } - if ( !empty( $page['sections'] ) ) { - ?>
has_fields( $page ) ) { - submit_button(); - } - ?>
pages[ $page_key ]; - $section = $page['sections'][ $section_key ]; - $field = $section['fields'][ $field_key ]; - - if ( isset( $field['value'] ) && $field['type'] !== 'checkbox' ) { - $field['value'] = !empty( $this->options[ $field['id'] ] ) ? $this->options[ $field['id'] ] : $field['value']; - } - - // Additional attributes - if ( !empty( $field['attributes'] ) ) { - $attributes = array(); - foreach ( $field['attributes'] as $attribute => $value ) { - if ( !empty( $value ) ) { - $attributes[] = "{$attribute}='{$value}'"; - } - } - } - - // Sanitize field values, unless 'sanitize' was set to false for this field. - if ( ( !isset( $field['sanitize'] ) || $field['sanitize'] ) && $field['type'] !== 'wp_editor' ) { - if (!empty($field['attributes']) && isset($field['attributes']['multiple']) && $field['attributes']['multiple']) { - for ( $i = 0; $i < count( $field['value'] ); $i++ ) { - $field['value'][ $i ] = strip_tags($field['value'][ $i ]); // Removes HTML tags - $field['value'][ $i ] = esc_attr($field['value'][ $i ]); // Escapes field for HTML attributes - } - } else { - $field['value'] = strip_tags($field['value']); // Removes HTML tags - $field['value'] = esc_attr($field['value']); // Escapes field for HTML attributes - } - } - - if ( array_key_exists( '_callback', $field ) ) { - call_user_func( $field['_callback'], $field, $page_key, $section_key, $field_key, $this ); - return; - } - - switch ( $field['type'] ) { - case 'checkbox': - $checked = $field['checked'] ? 'checked' : ''; - if ( isset( $this->options[ $field['id'] ] ) ) { - $checked = checked( $field['value'], $this->options[ $field['id'] ], false ); - } - printf( - '', - $checked, // checked - !empty( $field['class'] ) ? "class='{$field['class']}'" : '', // class - $field['id'], // id - "{$page_key}[{$field['id']}]", // name - $field['title_attr'], // title - $field['value'], // value - !empty( $field['text'] ) ? $field['text'] : '' // text - ); - break; - case 'media': - $upload_button = sprintf( - '' - ); - printf( - '%s%s', - !empty( $field['class'] ) ? "class='{$field['class']}'" : '', // class - $field['id'], // id - "{$page_key}[{$field['id']}]", // name - ! empty( $field['placeholder'] ) ? 'placeholder="' . $field['placeholder'] . '"' : '', // placeholder - $field['title_attr'], // title - $field['value'], // value - !empty( $attributes ) ? implode( ' ', $attributes ) : '', // additional attributes - $upload_button, // upload button - ! empty( $field['text'] ) ? '

' . $field['text'] . '

' : '' // text - ); - break; - case 'radio': - echo '
' . $field['title'] . ''; - $c = 0; - foreach ( $field['choices'] as $value => $label ) { - $checked = $value === $field['value'] ? 'checked' : ''; - if ( isset( $this->options[ $field['id'] ] ) ) { - $checked = $value === $this->options[ $field['id'] ] ? 'checked' : ''; - } - printf( - '%s', - $checked, // checked - !empty( $field['class'] ) ? "class='{$field['class']}'" : '', // class - $field['id'], // id - "{$page_key}[{$field['id']}]", // name - $label, // title - $value, // value - $label, // label - $c < count( $field['choices'] ) - 1 ? '
' : '' // line-break - ); - $c++; - } - echo '
'; - break; - case 'select': - if (!empty($field['attributes']) && isset($field['attributes']['multiple']) && $field['attributes']['multiple']) { - $field_tag_name = "{$page_key}[{$field['id']}][]"; - $field_name = "{$field['id']}[]"; - } - else { - $field_tag_name = "{$page_key}[{$field['id']}]"; - $field_name = "{$field['id']}"; - } - printf( - ''; - break; - case 'textarea': - printf( - '%s', - !empty( $field['class'] ) ? "class='{$field['class']}'" : '', // class - $field['id'], // id - "{$page_key}[{$field['id']}]", // name - !empty( $field['placeholder'] ) ? 'placeholder="'.$field['placeholder'].'"' : '', // placeholder - !empty( $field['rows'] ) ? "rows='{$field['rows']}'" : '', // rows - !empty( $field['cols'] ) ? "cols='{$field['cols']}'" : '', // cols - !empty( $field['wrap'] ) ? "wrap='{$field['wrap']}'" : '', // wrap - $field['title_attr'], // title - $field['value'], // value - ! empty( $field['text'] ) ? '

' . $field['text'] . '

' : '' // text - ); - break; - case 'wp_editor': - $field['textarea_name'] = "{$page_key}[{$field['id']}]"; - wp_editor( isset( $field['value'] ) ? $field['value'] : '', $field['id'], array( - 'textarea_name' => $field['textarea_name'], - ) ); - echo ! empty( $field['text'] ) ? '

' . $field['text'] . '

' : ''; - break; - default: - printf( - '%s', - !empty( $field['class'] ) ? "class='{$field['class']}'" : '', // class - $field['id'], // id - "{$page_key}[{$field['id']}]", // name - ! empty( $field['placeholder'] ) ? 'placeholder="' . $field['placeholder'] . '"' : '', // placeholder - $field['title_attr'], // title - $field['type'], // type - $field['value'], // value - !empty( $attributes ) ? implode( ' ', $attributes ) : '', // additional attributes - ! empty( $field['text'] ) ? '

' . $field['text'] . '

' : '' // text - ); - } - } - - /** - * Builds the settings sections - * - * @param string $page_key The array key of the page - * @param type $section_key The array key of the section - */ - protected function build_settings_section( $page_key, $section_key ) { - $page = $this->pages[ $page_key ]; - $section = $page['sections'][ $section_key ]; - - echo !empty( $section['text'] ) ? $section['text'] : ''; - - if ( !empty( $section['include'] ) ) { - include $section['include']; - } - } - - /** - * Determines if the option page has fields or not - * - * @param array $page The page array - * - * @return boolean True if fields are found, false otherwise - */ - protected function has_fields( $page ) { - if ( !empty( $page['sections'] ) ) { - foreach ( $page['sections'] as $section ) { - if ( !empty( $section['fields'] ) ) { - return true; - } - } - } - return false; - } - - /** - * Cleans up the option page submissions before submitting to the DB - * - * @param string $page_key The array key of the page - * - * @return array The sanitized post input - */ - protected function sanitize_setting( $page_key, $input ) { - $page = $this->pages[ $page_key ]; - - if ( !empty( $page['sections'] ) ) { - foreach ( $page['sections'] as $section ) { - if ( !empty( $section['fields'] ) ) { - foreach ( $section['fields'] as $field ) { - if ( isset( $field['sanitize'] ) && !$field['sanitize'] ) { - continue; - } - switch ( $field['type'] ) { - case 'select': - if ( !empty($input[$field['id']]) && !empty($input['attributes']['multiple']) ) { - $input[ $field['id'] ] = $input[ $field['id'] ]; - } - break; - case 'checkbox': - if ( empty( $input[ $field['id'] ] ) ) { - $input[ $field['id'] ] = false; - } - break; - case 'wp_editor': - $input[ $field['id'] ] = wp_kses_post( $input[ $field['id'] ] ); - break; - default: - // Sanitize by default; skip if this field's 'sanitize' setting is false. - $input[ $field['id'] ] = sanitize_text_field( $input[ $field['id'] ] ); - } - } - } - } - } - - return $input; - } - - /** - * Converts human-readable strings into more machine-friendly formats - * - * @param string $text String to be formatted - * @param string $separator The character that fills in spaces - * - * @return string Formatted text - */ - protected function slugify( $text, $separator = '_' ) { - $text = preg_replace( '~[^\\pL\d]+~u', $separator, $text ); - $text = trim( $text, $separator ); - $text = iconv( 'utf-8', 'windows-1251//TRANSLIT', $text ); - $text = strtolower( $text ); - $text = preg_replace( '~[^-\w]+~', '', $text ); - if ( empty( $text ) ) { - return 'n-a'; - } - return $text; - } - - /** - * Sorts one array using a second as a guide - * - * @param array $array Array to be sorted - * @param array $order_array Guide array - * - * @return array Sorted array - */ - protected function sort_array( $array, $order_array ) { - $ordered = array(); - foreach ( $order_array as $key ) { - if ( array_key_exists( $key, $array ) ) { - $ordered[ $key ] = $array[ $key ]; - unset( $array[ $key ] ); - } - } - return $ordered + $array; - } - - /** - * Conditionally outputs an error in WordPress admin - * - * @param string $error The error to be output - */ - public function submit_error( $error ) { - $error = sprintf( - '

%s

', - is_array( $error ) || is_object( $error ) ? '
' . htmlspecialchars( print_r( $error, true ) ) . '
' : $error - ); - if ( empty( $this->points['admin_notices'] ) ) { - $this->errors[] = $error; - } else { - echo $error; - } - } - - /** - * Conditionally outputs a notice in WordPress admin - * - * @param string $notice The text to be output - */ - public function submit_notice( $notice ) { - $notice = sprintf( - '

%s

', - is_array( $notice ) || is_object( $notice ) ? '
' . htmlspecialchars( print_r( $notice, true ) ) . '
' : $notice - ); - if ( empty( $this->points['admin_notices'] ) ) { - $this->notices[] = $notice; - } else { - echo $notice; - } - } - - /** - * Validates the field data submitted to the class - * - * @param array $field Field array - * @param string $page_key Array key of the associated page - * @param string $section_key Array key of the associated section - * @param string $field_key Array key of the field - * @param string $page ID of the associated page - * @param type $section ID of the associated section - * - * @return array The validated field array - */ - protected function validate_field( $field, $page_key, $section_key, $field_key, $page, $section ) { - // Label - if ( empty( $field['title'] ) ) { - $this->submit_error( 'Field parameter "title" is required' ); - } - - // ID - if ( empty( $field['id'] ) ) { - $field['id'] = $this->slugify( $field['title'] ); - } - - // Callback - if ( ! empty( $field['callback'] ) ) { - $field['_callback'] = $field['callback']; - } - - $field['callback'] = "add_settings_field|{$page_key}|{$section_key}|{$field_key}"; - - // Page - $field['page'] = $page; - - // Section - $field['section'] = $section; - - // Type - $field['type'] = empty( $field['type'] ) ? 'text' : $field['type']; - - // Title attribute - $field['title_attr'] = empty( $field['title_attr'] ) ? $field['title'] : $field['title_attr']; - - // Choices - if ( empty( $field['choices'] ) && in_array( $field['type'], array( 'radio', 'select' ) ) ) { - $this->submit_error( 'Field parameter "choices" is required for the "radio" and "select" type' ); - } - - // Other attributes - if ( !empty( $field['attributes'] ) ) { - switch ( $field['type'] ) { - case 'select': - case 'textarea': - $field['attributes'] = wp_parse_args( $field['attributes'], $this->attributes[ $field['type'] ] ); - break; - default: - $field['attributes'] = wp_parse_args( $field['attributes'], $this->attributes['input'] ); - } - } - - // Making sure we haven't missed anything - switch ( $field['type'] ) { - case 'checkbox': - $field = wp_parse_args( $field, $this->fields['checkbox'] ); - break; - case 'color': - case 'radio': - case 'range': - break; - case 'date': - $field['value'] = date( 'Y-m-d', strtotime( $field['value'] ) ); - $field = wp_parse_args( $field, $this->fields['text'] ); - break; - case 'datetime': - case 'datetime-local': - $field['value'] = date( 'Y-m-d\TH:i:s', strtotime( $field['value'] ) ); - $field = wp_parse_args( $field, $this->fields['text'] ); - break; - case 'month': - $field['value'] = date( 'Y-m', strtotime( $field['value'] ) ); - $field = wp_parse_args( $field, $this->fields['text'] ); - break; - case 'textarea': - $field = wp_parse_args( $field, $this->fields[ $field['type'] ] ); - break; - case 'time': - $field['value'] = date( 'H:i:s', strtotime( $field['value'] ) ); - $field = wp_parse_args( $field, $this->fields['text'] ); - break; - case 'week': - $field['value'] = date( 'Y-\WW', strtotime( $field['value'] ) ); - $field = wp_parse_args( $field, $this->fields['text'] ); - break; - case 'wp_editor': - $field = wp_parse_args( $field, $this->fields['wp_editor'] ); - break; - default: - $field = wp_parse_args( $field, $this->fields['text'] ); - } - - return $field; - } - - /** - * Validates the information submitted to the class - * - * @param string $page_key Array key of the page. - * @param array $page_params Array of page parameters. - * @param string $parent_slug Menu slug of the parent page if there is one. - * - * @return array Validated array of page parameters. - */ - protected function validate_page( $page_key, $page_params, $parent_slug = false ) { - // Page title - if ( empty( $page_params['page_title'] ) ) { - $this->submit_error( 'Page parameter "page_title" is required' ); - } - - // Menu title - if ( empty( $page_params['menu_title'] ) ) { - $page_params['menu_title'] = $page_params['page_title']; - } - - // Menu slug - if ( empty( $page_params['menu_slug'] ) ) { - // Basing it off the page title because it's likely to be more unique than the menu title - $page_params['menu_slug'] = $this->slugify( $page_params['page_title'] ); - } - - // Menu or submenu item? - if ( empty( $page_params['parent_slug'] ) && !$parent_slug ) { - $page_params['function'] = 'add_menu_page'; - } else { - $page_params['function'] = 'add_submenu_page'; - $page_params['parent_slug'] = $parent_slug ? $parent_slug : $page_params['parent_slug']; - } - - // Callback - $page_params['callback'] = "{$page_params['function']}|{$page_key}"; - - // Sanitize - $page_params['sanitize'] = empty( $page_params['sanitize'] ) ? "register_setting|{$page_key}" : $page_params['sanitize']; - - // Make sure we haven't missed anything - $page_params = wp_parse_args( $page_params, $this->defaults[ $page_params['function'] ] ); - - // Subpages? - if ( !empty( $page_params['subpages'] ) ) { - foreach ( $page_params['subpages'] as $subpage_key => $subpage ) { - $this->subpages[ $subpage_key ] = $this->validate_page( $subpage_key, $subpage, $page_params['menu_slug'] ); - } - unset( $page_params['subpages'] ); - } - - // Sections? - if ( !empty( $page_params['sections'] ) ) { - foreach ( $page_params['sections'] as $section_key => $section_params ) { - $page_params['sections'][ $section_key ] = $this->validate_section( $section_params, $page_key, $section_key, $page_params['menu_slug'] ); - } - } - - return $page_params; - } - - /** - * Validates the section data submitted to the class - * - * @param array $section Section array - * @param string $page_key Array key of the associated page - * @param string $section_key Array key of the associated page - * @param string $page ID of the associated page - * - * @return array Validated section array - */ - protected function validate_section( $section, $page_key, $section_key, $page ) { - // Title - if ( empty( $section['title'] ) ) { - $this->submit_error( 'Section parameter "title" is required' ); - } - - // ID - if ( empty( $section['id'] ) ) { - $section['id'] = $this->slugify( $section['title'] ); - } - - // Callback - $section['callback'] = empty( $section['callback'] ) ? "add_settings_section|{$page_key}|{$section_key}" : $section['callback']; - - // Page - $section['page'] = $page; - - // Fields? - if ( !empty( $section['fields'] ) ) { - foreach ( $section['fields'] as $field_key => $field_params ) { - $section['fields'][ $field_key ] = $this->validate_field( $field_params, $page_key, $section_key, $field_key, $page, $section['id'] ); - } - } - - return $section; - } - - /** - * Getter for the option values. - * - * @return mixed - */ - public function get_options() { - return $this->options; - } -} diff --git a/phpcs.xml b/phpcs.xml deleted file mode 100644 index 6908914..0000000 --- a/phpcs.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - WP White Security PHPCS extended. - - .github/* - */node_modules/* - */tests/* - */vendor/* - */index.php - - - - - - - - - - - - - - - - - - - diff --git a/vendor/autoload.php b/vendor/autoload.php deleted file mode 100644 index 36b2a29..0000000 --- a/vendor/autoload.php +++ /dev/null @@ -1,7 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @see https://www.php-fig.org/psr/psr-0/ - * @see https://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - /** @var ?string */ - private $vendorDir; - - // PSR-4 - /** - * @var array[] - * @psalm-var array> - */ - private $prefixLengthsPsr4 = array(); - /** - * @var array[] - * @psalm-var array> - */ - private $prefixDirsPsr4 = array(); - /** - * @var array[] - * @psalm-var array - */ - private $fallbackDirsPsr4 = array(); - - // PSR-0 - /** - * @var array[] - * @psalm-var array> - */ - private $prefixesPsr0 = array(); - /** - * @var array[] - * @psalm-var array - */ - private $fallbackDirsPsr0 = array(); - - /** @var bool */ - private $useIncludePath = false; - - /** - * @var string[] - * @psalm-var array - */ - private $classMap = array(); - - /** @var bool */ - private $classMapAuthoritative = false; - - /** - * @var bool[] - * @psalm-var array - */ - private $missingClasses = array(); - - /** @var ?string */ - private $apcuPrefix; - - /** - * @var self[] - */ - private static $registeredLoaders = array(); - - /** - * @param ?string $vendorDir - */ - public function __construct($vendorDir = null) - { - $this->vendorDir = $vendorDir; - } - - /** - * @return string[] - */ - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); - } - - return array(); - } - - /** - * @return array[] - * @psalm-return array> - */ - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - /** - * @return array[] - * @psalm-return array - */ - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - /** - * @return array[] - * @psalm-return array - */ - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - /** - * @return string[] Array of classname => path - * @psalm-return array - */ - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param string[] $classMap Class to filename map - * @psalm-param array $classMap - * - * @return void - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - * - * @return void - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories - * - * @return void - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - * - * @return void - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - * - * @return void - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - * - * @return void - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - * - * @return void - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - - if (null === $this->vendorDir) { - return; - } - - if ($prepend) { - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; - } else { - unset(self::$registeredLoaders[$this->vendorDir]); - self::$registeredLoaders[$this->vendorDir] = $this; - } - } - - /** - * Unregisters this instance as an autoloader. - * - * @return void - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - - if (null !== $this->vendorDir) { - unset(self::$registeredLoaders[$this->vendorDir]); - } - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return true|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - - return null; - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. - * - * @return self[] - */ - public static function getRegisteredLoaders() - { - return self::$registeredLoaders; - } - - /** - * @param string $class - * @param string $ext - * @return string|false - */ - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath . '\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - * @private - */ -function includeFile($file) -{ - include $file; -} diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php deleted file mode 100644 index d50e0c9..0000000 --- a/vendor/composer/InstalledVersions.php +++ /dev/null @@ -1,350 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer; - -use Composer\Autoload\ClassLoader; -use Composer\Semver\VersionParser; - -/** - * This class is copied in every Composer installed project and available to all - * - * See also https://getcomposer.org/doc/07-runtime.md#installed-versions - * - * To require its presence, you can require `composer-runtime-api ^2.0` - */ -class InstalledVersions -{ - /** - * @var mixed[]|null - * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null - */ - private static $installed; - - /** - * @var bool|null - */ - private static $canGetVendors; - - /** - * @var array[] - * @psalm-var array}> - */ - private static $installedByVendor = array(); - - /** - * Returns a list of all package names which are present, either by being installed, replaced or provided - * - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackages() - { - $packages = array(); - foreach (self::getInstalled() as $installed) { - $packages[] = array_keys($installed['versions']); - } - - if (1 === \count($packages)) { - return $packages[0]; - } - - return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); - } - - /** - * Returns a list of all package names with a specific type e.g. 'library' - * - * @param string $type - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackagesByType($type) - { - $packagesByType = array(); - - foreach (self::getInstalled() as $installed) { - foreach ($installed['versions'] as $name => $package) { - if (isset($package['type']) && $package['type'] === $type) { - $packagesByType[] = $name; - } - } - } - - return $packagesByType; - } - - /** - * Checks whether the given package is installed - * - * This also returns true if the package name is provided or replaced by another package - * - * @param string $packageName - * @param bool $includeDevRequirements - * @return bool - */ - public static function isInstalled($packageName, $includeDevRequirements = true) - { - foreach (self::getInstalled() as $installed) { - if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); - } - } - - return false; - } - - /** - * Checks whether the given package satisfies a version constraint - * - * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: - * - * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') - * - * @param VersionParser $parser Install composer/semver to have access to this class and functionality - * @param string $packageName - * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package - * @return bool - */ - public static function satisfies(VersionParser $parser, $packageName, $constraint) - { - $constraint = $parser->parseConstraints($constraint); - $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - - return $provided->matches($constraint); - } - - /** - * Returns a version constraint representing all the range(s) which are installed for a given package - * - * It is easier to use this via isInstalled() with the $constraint argument if you need to check - * whether a given version of a package is installed, and not just whether it exists - * - * @param string $packageName - * @return string Version constraint usable with composer/semver - */ - public static function getVersionRanges($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - $ranges = array(); - if (isset($installed['versions'][$packageName]['pretty_version'])) { - $ranges[] = $installed['versions'][$packageName]['pretty_version']; - } - if (array_key_exists('aliases', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); - } - if (array_key_exists('replaced', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); - } - if (array_key_exists('provided', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); - } - - return implode(' || ', $ranges); - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['version'])) { - return null; - } - - return $installed['versions'][$packageName]['version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getPrettyVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['pretty_version'])) { - return null; - } - - return $installed['versions'][$packageName]['pretty_version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference - */ - public static function getReference($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['reference'])) { - return null; - } - - return $installed['versions'][$packageName]['reference']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. - */ - public static function getInstallPath($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} - */ - public static function getRootPackage() - { - $installed = self::getInstalled(); - - return $installed[0]['root']; - } - - /** - * Returns the raw installed.php data for custom implementations - * - * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. - * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} - */ - public static function getRawData() - { - @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = include __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - - return self::$installed; - } - - /** - * Returns the raw data of all installed.php which are currently loaded for custom implementations - * - * @return array[] - * @psalm-return list}> - */ - public static function getAllRawData() - { - return self::getInstalled(); - } - - /** - * Lets you reload the static array from another file - * - * This is only useful for complex integrations in which a project needs to use - * this class but then also needs to execute another project's autoloader in process, - * and wants to ensure both projects have access to their version of installed.php. - * - * A typical case would be PHPUnit, where it would need to make sure it reads all - * the data it needs from this class, then call reload() with - * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure - * the project in which it runs can then also use this class safely, without - * interference between PHPUnit's dependencies and the project's dependencies. - * - * @param array[] $data A vendor/composer/installed.php data set - * @return void - * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data - */ - public static function reload($data) - { - self::$installed = $data; - self::$installedByVendor = array(); - } - - /** - * @return array[] - * @psalm-return list}> - */ - private static function getInstalled() - { - if (null === self::$canGetVendors) { - self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); - } - - $installed = array(); - - if (self::$canGetVendors) { - foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { - if (isset(self::$installedByVendor[$vendorDir])) { - $installed[] = self::$installedByVendor[$vendorDir]; - } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { - self::$installed = $installed[count($installed) - 1]; - } - } - } - } - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - $installed[] = self::$installed; - - return $installed; - } -} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE deleted file mode 100644 index f27399a..0000000 --- a/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php deleted file mode 100644 index b26f1b1..0000000 --- a/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,10 +0,0 @@ - $vendorDir . '/composer/InstalledVersions.php', -); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php deleted file mode 100644 index b7fc012..0000000 --- a/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,9 +0,0 @@ - array($baseDir . '/includes/classes'), -); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php deleted file mode 100644 index 577e4b7..0000000 --- a/vendor/composer/autoload_real.php +++ /dev/null @@ -1,78 +0,0 @@ -= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInit304e4e1b4bd9c34ebc34bb32b0515839::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } - - $loader->register(true); - - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit304e4e1b4bd9c34ebc34bb32b0515839::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire304e4e1b4bd9c34ebc34bb32b0515839($fileIdentifier, $file); - } - - return $loader; - } -} - -/** - * @param string $fileIdentifier - * @param string $file - * @return void - */ -function composerRequire304e4e1b4bd9c34ebc34bb32b0515839($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } -} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php deleted file mode 100644 index 2c28421..0000000 --- a/vendor/composer/autoload_static.php +++ /dev/null @@ -1,40 +0,0 @@ - __DIR__ . '/..' . '/wpwhitesecurity/select2-wpwhitesecurity/load.php', - ); - - public static $prefixLengthsPsr4 = array ( - 'A' => - array ( - 'AdminNoticesManager\\' => 20, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'AdminNoticesManager\\' => - array ( - 0 => __DIR__ . '/../..' . '/includes/classes', - ), - ); - - public static $classMap = array ( - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit304e4e1b4bd9c34ebc34bb32b0515839::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit304e4e1b4bd9c34ebc34bb32b0515839::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit304e4e1b4bd9c34ebc34bb32b0515839::$classMap; - - }, null, ClassLoader::class); - } -} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json deleted file mode 100644 index 27fdbe1..0000000 --- a/vendor/composer/installed.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "packages": [ - { - "name": "wpwhitesecurity/select2-wpwhitesecurity", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/wpwhitesecurity/select2-wpwhitesecurity.git", - "reference": "514af981e0f3af5d7ebd9f683c5c779c47183ee8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wpwhitesecurity/select2-wpwhitesecurity/zipball/514af981e0f3af5d7ebd9f683c5c779c47183ee8", - "reference": "514af981e0f3af5d7ebd9f683c5c779c47183ee8", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "time": "2022-02-23T07:43:19+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "load.php" - ] - }, - "authors": [ - { - "name": "WP White Security", - "email": "info@wpwhitesecurity.com" - } - ], - "description": "Select2 integration library for WordPress", - "support": { - "source": "https://github.com/wpwhitesecurity/select2-wpwhitesecurity/tree/v1.0.1", - "issues": "https://github.com/wpwhitesecurity/select2-wpwhitesecurity/issues" - }, - "install-path": "../wpwhitesecurity/select2-wpwhitesecurity" - } - ], - "dev": false, - "dev-package-names": [] -} diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php deleted file mode 100644 index 0fea603..0000000 --- a/vendor/composer/installed.php +++ /dev/null @@ -1,32 +0,0 @@ - array( - 'pretty_version' => 'dev-develop', - 'version' => 'dev-develop', - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'reference' => '1a06b0953b9551507b6845dbb59d9db6eb55a4f0', - 'name' => 'wpwhitesecurity/admin-notices-manager', - 'dev' => false, - ), - 'versions' => array( - 'wpwhitesecurity/admin-notices-manager' => array( - 'pretty_version' => 'dev-develop', - 'version' => 'dev-develop', - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'reference' => '1a06b0953b9551507b6845dbb59d9db6eb55a4f0', - 'dev_requirement' => false, - ), - 'wpwhitesecurity/select2-wpwhitesecurity' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../wpwhitesecurity/select2-wpwhitesecurity', - 'aliases' => array(), - 'reference' => '514af981e0f3af5d7ebd9f683c5c779c47183ee8', - 'dev_requirement' => false, - ), - ), -); diff --git a/vendor/index.php b/vendor/index.php deleted file mode 100644 index e94d9a4..0000000 --- a/vendor/index.php +++ /dev/null @@ -1,4 +0,0 @@ - Date: Mon, 3 Jun 2024 13:39:33 +0300 Subject: [PATCH 02/15] composer --- .gitignore | 2 +- composer.json | 5 - composer.lock | 2445 ------------------------------------------------- 3 files changed, 1 insertion(+), 2451 deletions(-) delete mode 100644 composer.lock diff --git a/.gitignore b/.gitignore index a56aa14..f77d569 100644 --- a/.gitignore +++ b/.gitignore @@ -103,4 +103,4 @@ Desktop.ini /testing/ -composer\.lock +composer\.lock \ No newline at end of file diff --git a/composer.json b/composer.json index 3d33417..27c5559 100644 --- a/composer.json +++ b/composer.json @@ -22,11 +22,6 @@ "AdminNoticesManager\\": "includes/classes/" } }, - "require-dev": { - "phpunit/phpunit": "^8.2", - "10up/wp_mock": "dev-master", - "10up/phpcs-composer": "dev-master" - }, "scripts": { "lint": "phpcs .", "lint-fix": "phpcbf ." diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 36455f4..0000000 --- a/composer.lock +++ /dev/null @@ -1,2445 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "eb68aaf29ae3f797c320784efaceb058", - "packages": [ - { - "name": "wpwhitesecurity/select2-wpwhitesecurity", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/wpwhitesecurity/select2-wpwhitesecurity.git", - "reference": "514af981e0f3af5d7ebd9f683c5c779c47183ee8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wpwhitesecurity/select2-wpwhitesecurity/zipball/514af981e0f3af5d7ebd9f683c5c779c47183ee8", - "reference": "514af981e0f3af5d7ebd9f683c5c779c47183ee8", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "type": "library", - "autoload": { - "files": [ - "load.php" - ] - }, - "authors": [ - { - "name": "WP White Security", - "email": "info@wpwhitesecurity.com" - } - ], - "description": "Select2 integration library for WordPress", - "support": { - "source": "https://github.com/wpwhitesecurity/select2-wpwhitesecurity/tree/v1.0.1", - "issues": "https://github.com/wpwhitesecurity/select2-wpwhitesecurity/issues" - }, - "time": "2022-02-23T07:43:19+00:00" - } - ], - "packages-dev": [ - { - "name": "10up/phpcs-composer", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/10up/phpcs-composer.git", - "reference": "2f5c3608bc03fe1ca65acf462dd7b5008f6829a0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/10up/phpcs-composer/zipball/2f5c3608bc03fe1ca65acf462dd7b5008f6829a0", - "reference": "2f5c3608bc03fe1ca65acf462dd7b5008f6829a0", - "shasum": "" - }, - "require": { - "dealerdirect/phpcodesniffer-composer-installer": "*", - "phpcompatibility/phpcompatibility-wp": "^2", - "squizlabs/php_codesniffer": "^3.4.0", - "wp-coding-standards/wpcs": "*" - }, - "default-branch": true, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ephraim Gregor", - "email": "ephraim.gregor@10up.com" - } - ], - "support": { - "issues": "https://github.com/10up/phpcs-composer/issues", - "source": "https://github.com/10up/phpcs-composer/tree/master" - }, - "time": "2021-01-08T03:03:06+00:00" - }, - { - "name": "10up/wp_mock", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/10up/wp_mock.git", - "reference": "05ee446f9b479447acfe3e016c03bc45f84114a7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/10up/wp_mock/zipball/05ee446f9b479447acfe3e016c03bc45f84114a7", - "reference": "05ee446f9b479447acfe3e016c03bc45f84114a7", - "shasum": "" - }, - "require": { - "antecedent/patchwork": "^2.1", - "mockery/mockery": "^1.0", - "php": ">=7.1", - "phpunit/phpunit": ">=7.0" - }, - "require-dev": { - "behat/behat": "^3.0", - "php-coveralls/php-coveralls": "^2.1", - "sebastian/comparator": ">=1.2.3" - }, - "default-branch": true, - "type": "library", - "autoload": { - "psr-4": { - "WP_Mock\\": "./php/WP_Mock" - }, - "classmap": [ - "php/WP_Mock.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "description": "A mocking library to take the pain out of unit testing for WordPress", - "support": { - "issues": "https://github.com/10up/wp_mock/issues", - "source": "https://github.com/10up/wp_mock/tree/master" - }, - "time": "2020-07-15T03:36:07+00:00" - }, - { - "name": "antecedent/patchwork", - "version": "2.1.21", - "source": { - "type": "git", - "url": "https://github.com/antecedent/patchwork.git", - "reference": "25c1fa0cd9a6e6d0d13863d8df8f050b6733f16d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/antecedent/patchwork/zipball/25c1fa0cd9a6e6d0d13863d8df8f050b6733f16d", - "reference": "25c1fa0cd9a6e6d0d13863d8df8f050b6733f16d", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": ">=4" - }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ignas Rudaitis", - "email": "ignas.rudaitis@gmail.com" - } - ], - "description": "Method redefinition (monkey-patching) functionality for PHP.", - "homepage": "http://patchwork2.org/", - "keywords": [ - "aop", - "aspect", - "interception", - "monkeypatching", - "redefinition", - "runkit", - "testing" - ], - "support": { - "issues": "https://github.com/antecedent/patchwork/issues", - "source": "https://github.com/antecedent/patchwork/tree/2.1.21" - }, - "time": "2022-02-07T07:28:34+00:00" - }, - { - "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.2", - "source": { - "type": "git", - "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" - }, - "require-dev": { - "composer/composer": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0" - }, - "type": "composer-plugin", - "extra": { - "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" - }, - "autoload": { - "psr-4": { - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" - }, - { - "name": "Contributors", - "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" - } - ], - "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", - "keywords": [ - "PHPCodeSniffer", - "PHP_CodeSniffer", - "code quality", - "codesniffer", - "composer", - "installer", - "phpcbf", - "phpcs", - "plugin", - "qa", - "quality", - "standard", - "standards", - "style guide", - "stylecheck", - "tests" - ], - "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" - }, - "time": "2022-02-04T12:51:07+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^8.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2020-11-10T18:47:58+00:00" - }, - { - "name": "hamcrest/hamcrest-php", - "version": "v2.0.1", - "source": { - "type": "git", - "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", - "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", - "shasum": "" - }, - "require": { - "php": "^5.3|^7.0|^8.0" - }, - "replace": { - "cordoval/hamcrest-php": "*", - "davedevelopment/hamcrest-php": "*", - "kodova/hamcrest-php": "*" - }, - "require-dev": { - "phpunit/php-file-iterator": "^1.4 || ^2.0", - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "autoload": { - "classmap": [ - "hamcrest" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "This is the PHP port of Hamcrest Matchers", - "keywords": [ - "test" - ], - "support": { - "issues": "https://github.com/hamcrest/hamcrest-php/issues", - "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" - }, - "time": "2020-07-09T08:09:16+00:00" - }, - { - "name": "mockery/mockery", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/mockery/mockery.git", - "reference": "c10a5f6e06fc2470ab1822fa13fa2a7380f8fbac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/c10a5f6e06fc2470ab1822fa13fa2a7380f8fbac", - "reference": "c10a5f6e06fc2470ab1822fa13fa2a7380f8fbac", - "shasum": "" - }, - "require": { - "hamcrest/hamcrest-php": "^2.0.1", - "lib-pcre": ">=7.0", - "php": "^7.3 || ^8.0" - }, - "conflict": { - "phpunit/phpunit": "<8.0" - }, - "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "psr-0": { - "Mockery": "library/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Dave Marshall", - "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" - } - ], - "description": "Mockery is a simple yet flexible PHP mock object framework", - "homepage": "https://github.com/mockery/mockery", - "keywords": [ - "BDD", - "TDD", - "library", - "mock", - "mock objects", - "mockery", - "stub", - "test", - "test double", - "testing" - ], - "support": { - "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.5.0" - }, - "time": "2022-01-20T13:18:17+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.10.2", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2020-11-13T09:40:50+00:00" - }, - { - "name": "phar-io/manifest", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" - }, - "time": "2021-07-20T11:28:43+00:00" - }, - { - "name": "phar-io/version", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.2.1" - }, - "time": "2022-02-21T01:04:05+00:00" - }, - { - "name": "phpcompatibility/php-compatibility", - "version": "9.3.5", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" - }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "homepage": "https://github.com/wimg", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" - } - ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", - "keywords": [ - "compatibility", - "phpcs", - "standards" - ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" - }, - "time": "2019-12-27T09:44:58+00:00" - }, - { - "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.1", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "ddabec839cc003651f2ce695c938686d1086cf43" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/ddabec839cc003651f2ce695c938686d1086cf43", - "reference": "ddabec839cc003651f2ce695c938686d1086cf43", - "shasum": "" - }, - "require": { - "phpcompatibility/php-compatibility": "^9.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7", - "paragonie/random_compat": "dev-master", - "paragonie/sodium_compat": "dev-master" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "lead" - } - ], - "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", - "homepage": "http://phpcompatibility.com/", - "keywords": [ - "compatibility", - "paragonie", - "phpcs", - "polyfill", - "standards" - ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" - }, - "time": "2021-02-15T10:24:51+00:00" - }, - { - "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.3", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "d55de55f88697b9cdb94bccf04f14eb3b11cf308" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/d55de55f88697b9cdb94bccf04f14eb3b11cf308", - "reference": "d55de55f88697b9cdb94bccf04f14eb3b11cf308", - "shasum": "" - }, - "require": { - "phpcompatibility/php-compatibility": "^9.0", - "phpcompatibility/phpcompatibility-paragonie": "^1.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "lead" - } - ], - "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", - "homepage": "http://phpcompatibility.com/", - "keywords": [ - "compatibility", - "phpcs", - "standards", - "wordpress" - ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" - }, - "time": "2021-12-30T16:37:40+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.6.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706", - "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0" - }, - "time": "2022-01-04T19:58:01+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.15.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" - }, - "time": "2021-12-08T12:19:24+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "7.0.15", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "819f92bba8b001d4363065928088de22f25a3a48" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/819f92bba8b001d4363065928088de22f25a3a48", - "reference": "819f92bba8b001d4363065928088de22f25a3a48", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": ">=7.2", - "phpunit/php-file-iterator": "^2.0.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.1.3 || ^4.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^4.2.2", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1.3" - }, - "require-dev": { - "phpunit/phpunit": "^8.2.2" - }, - "suggest": { - "ext-xdebug": "^2.7.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.15" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-07-26T12:20:09+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-12-02T12:42:26+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" - }, - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "2.1.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T08:20:02+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/a853a0e183b9db7eed023d7933a858fa1c8d25a3", - "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.3 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "abandoned": true, - "time": "2020-08-04T08:28:15+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "8.5.23", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "efb20ff3623b9d09bf190a68fdfe574538a8d496" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/efb20ff3623b9d09bf190a68fdfe574538a8d496", - "reference": "efb20ff3623b9d09bf190a68fdfe574538a8d496", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.3.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.0", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.2", - "phpspec/prophecy": "^1.10.3", - "phpunit/php-code-coverage": "^7.0.12", - "phpunit/php-file-iterator": "^2.0.4", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1.2", - "sebastian/comparator": "^3.0.2", - "sebastian/diff": "^3.0.2", - "sebastian/environment": "^4.2.3", - "sebastian/exporter": "^3.1.2", - "sebastian/global-state": "^3.0.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0.1", - "sebastian/type": "^1.1.3", - "sebastian/version": "^2.0.1" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0.0" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "8.5-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.23" - }, - "funding": [ - { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-01-21T05:50:34+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T08:15:22+00:00" - }, - { - "name": "sebastian/comparator", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1071dfcef776a57013124ff35e1fc41ccd294758", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T08:04:30+00:00" - }, - { - "name": "sebastian/diff", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:59:04+00:00" - }, - { - "name": "sebastian/environment", - "version": "4.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/4.2.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:53:42+00:00" - }, - { - "name": "sebastian/exporter", - "version": "3.1.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-11-11T13:51:24+00:00" - }, - { - "name": "sebastian/global-state", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "de036ec91d55d2a9e0db2ba975b512cdb1c23921" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/de036ec91d55d2a9e0db2ba975b512cdb1c23921", - "reference": "de036ec91d55d2a9e0db2ba975b512cdb1c23921", - "shasum": "" - }, - "require": { - "php": ">=7.2", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^8.0" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-02-10T06:55:38+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "3.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:40:27+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:37:18+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "3.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:34:24+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:30:19+00:00" - }, - { - "name": "sebastian/type", - "version": "1.1.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0150cfbc4495ed2df3872fb31b26781e4e077eb4", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/1.1.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:25:11+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/master" - }, - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.6.2", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards" - ], - "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" - }, - "time": "2021-12-12T21:44:58+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.24.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "30885182c981ab175d4d034db0f6f469898070ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", - "reference": "30885182c981ab175d4d034db0f6f469898070ab", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-10-20T20:35:02+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2021-07-28T10:34:58+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.10.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.10.0" - }, - "time": "2021-03-09T10:59:23+00:00" - }, - { - "name": "wp-coding-standards/wpcs", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "7da1894633f168fe244afc6de00d141f27517b62" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", - "reference": "7da1894633f168fe244afc6de00d141f27517b62", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.3.1" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", - "phpcompatibility/php-compatibility": "^9.0", - "phpcsstandards/phpcsdevtools": "^1.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Contributors", - "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" - } - ], - "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", - "keywords": [ - "phpcs", - "standards", - "wordpress" - ], - "support": { - "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", - "source": "https://github.com/WordPress/WordPress-Coding-Standards", - "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" - }, - "time": "2020-05-13T23:57:56+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": { - "10up/wp_mock": 20, - "10up/phpcs-composer": 20 - }, - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=7.0" - }, - "platform-dev": [], - "plugin-api-version": "2.2.0" -} From 95ec81d271d43d0918f908bf4464410e145cd5e2 Mon Sep 17 00:00:00 2001 From: Stoil Dobrev Date: Mon, 3 Jun 2024 17:07:22 +0300 Subject: [PATCH 03/15] updates --- .github/run-tests | 17 + .github/workflows/free-repo-sync.yml | 73 ++ .github/workflows/test.yml | 33 + .gitpod-vscode/launch.json | 45 + .gitpod-vscode/settings.json | 59 ++ .gitpod.yml | 40 + .gitpod/.gitpod.dockerfile | 5 + .gitpod/.init.sh | 62 ++ .gitpod/create-multi-sites.php | 35 + .gitpod/mysqld.cnf | 78 ++ admin-notices-manager.php | 14 +- composer.json | 5 +- includes/classes/Notices.php | 142 --- includes/classes/Pointer.php | 70 -- includes/classes/PointersManager.php | 169 ---- includes/classes/Settings.php | 358 ------- includes/classes/class-notices.php | 153 +++ includes/classes/class-pointer-manager.php | 184 ++++ includes/classes/class-pointer.php | 80 ++ .../classes/class-rational-option-pages.php | 899 ++++++++++++++++++ includes/classes/class-settings.php | 360 +++++++ includes/functions/core.php | 6 +- 22 files changed, 2140 insertions(+), 747 deletions(-) create mode 100755 .github/run-tests create mode 100755 .github/workflows/free-repo-sync.yml create mode 100755 .github/workflows/test.yml create mode 100755 .gitpod-vscode/launch.json create mode 100755 .gitpod-vscode/settings.json create mode 100755 .gitpod.yml create mode 100755 .gitpod/.gitpod.dockerfile create mode 100755 .gitpod/.init.sh create mode 100755 .gitpod/create-multi-sites.php create mode 100755 .gitpod/mysqld.cnf delete mode 100644 includes/classes/Notices.php delete mode 100644 includes/classes/Pointer.php delete mode 100644 includes/classes/PointersManager.php delete mode 100644 includes/classes/Settings.php create mode 100644 includes/classes/class-notices.php create mode 100644 includes/classes/class-pointer-manager.php create mode 100644 includes/classes/class-pointer.php create mode 100644 includes/classes/class-rational-option-pages.php create mode 100644 includes/classes/class-settings.php diff --git a/.github/run-tests b/.github/run-tests new file mode 100755 index 0000000..342c08c --- /dev/null +++ b/.github/run-tests @@ -0,0 +1,17 @@ +#!/bin/sh + +set -eu + +cp .env.github .env + +export PATH="$(pwd)/vendor/bin:$PATH" + +composer run vendor-install +composer install +composer wp-install + +if [ "$(wp-install --status)" = "full" ]; then + wp-install --serve & +fi + +composer test diff --git a/.github/workflows/free-repo-sync.yml b/.github/workflows/free-repo-sync.yml new file mode 100755 index 0000000..e4c3604 --- /dev/null +++ b/.github/workflows/free-repo-sync.yml @@ -0,0 +1,73 @@ +# This is a basic workflow that is manually triggered + +name: Free repo sync + +# Controls when the action will run. Workflow runs when manually triggered using the UI +# or API. +on: + workflow_dispatch: + # Inputs the workflow accepts. + inputs: + free_pat: + # Friendly description to be shown in the UI instead of 'name' + description: 'Personal access token for the free plugin repository' + # Default value if no value is explicitly provided + default: '' + # Input has to be provided for the workflow to run + required: true + source_branch: + description: 'Source branch' + default: 'develop' + required: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "greet" + sync: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Runs a single command using the runners shell + - name: Check out the premium plugin repository + uses: actions/checkout@v2 + with: + path: premium + ref: ${{ github.event.inputs.source_branch }} + - name: Check out the free plugin repository + uses: actions/checkout@v2 + with: + path: free + ref: develop + repository: WPWhiteSecurity/wp-2fa + - name: Setup node.js + uses: actions/setup-node@v1 + with: + node-version: '14.x' + - name: Install node dependencies + run: rm -rf node_modules; rm package-lock.json; rm TESTS.MD; npm cache clear --force; npm install; npm run vendor:install; npm run prod -- + working-directory: premium + - name: Convert premium plugin to free version + run: npm run-script convert:free + working-directory: premium + - name: Remove premium translation files and other premium only files + run: rm -Rf extensions freemius languages + working-directory: premium + - name: Substitute Year in code + run: gulp substitute-year + working-directory: premium + - name: Generate POT file for the free edition + run: gulp translate + working-directory: premium + - name: Sync changes from premium to free plugin in action workspace + # third-party is also excluded as it currently does not seem to be working + run: rsync -arvz --delete --exclude "/third-party" --exclude "/node_modules" --exclude "/.git" --exclude "/.github" --exclude "/*.json" --exclude "/*.js" --exclude "/*.md" --exclude "/*.sh" --exclude "/readme.txt" --exclude "/docker" --exclude "codeception*.yml" premium/ free + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + with: + title: 'Automated sync from the premium version of the plugin' + commit-message: '[create-pull-request] automated changes sync' + path: free + token: ${{ github.event.inputs.free_pat }} + branch-suffix: random diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100755 index 0000000..6bc1176 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,33 @@ +name: Run tests + +on: [push, pull_request] + +jobs: + test: + services: + mariadb: + image: mariadb + ports: + - 3306:3306 + env: + MYSQL_ROOT_PASSWORD: root + # Ensure docker waits for mariadb to start + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + + - uses: actions/cache@v1 + id: cache-composer + with: + path: ~/.composer/cache + key: ${{ runner.os }}-composer + + - uses: actions/cache@v1 + id: cache-wp-cli + with: + path: ~/.wp-cli/cache + key: ${{ runner.os }}-wp-cli + + - name: Run tests + run: .github/run-tests diff --git a/.gitpod-vscode/launch.json b/.gitpod-vscode/launch.json new file mode 100755 index 0000000..6621313 --- /dev/null +++ b/.gitpod-vscode/launch.json @@ -0,0 +1,45 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Listen for Xdebug", + "type": "php", + "request": "launch", + "port": 9001 + }, + { + "name": "Launch currently open script", + "type": "php", + "request": "launch", + "program": "${file}", + "cwd": "${fileDirname}", + "port": 0, + "runtimeArgs": [ + "-dxdebug.start_with_request=yes" + ], + "env": { + "XDEBUG_MODE": "debug,develop", + "XDEBUG_CONFIG": "client_port=${port}" + } + }, + { + "name": "Launch Built-in web server", + "type": "php", + "request": "launch", + "runtimeArgs": [ + "-dxdebug.mode=debug", + "-dxdebug.start_with_request=yes", + "-S", + "localhost:0" + ], + "program": "", + "cwd": "${workspaceRoot}", + "port": 9001, + "serverReadyAction": { + "pattern": "Development Server \\(http://localhost:([0-9]+)\\) started", + "uriFormat": "http://localhost:%s", + "action": "openExternally" + } + } + ] +} \ No newline at end of file diff --git a/.gitpod-vscode/settings.json b/.gitpod-vscode/settings.json new file mode 100755 index 0000000..a7f61aa --- /dev/null +++ b/.gitpod-vscode/settings.json @@ -0,0 +1,59 @@ +{ + "editor.detectIndentation": true, + "editor.renderWhitespace": "all", + "editor.formatOnPaste": false, + "editor.formatOnSave": false, + "blockman.n01LineHeight": 23, + "blockman.n02EachCharFrameWidth": 9.321, + "blockman.n23AnalyzeSquareBrackets": true, + "phpsab.fixerEnable": true, + "phpsab.snifferEnable": true, + "phpsab.snifferMode": "onSave", + "phpsab.snifferTypeDelay": 250, + "phpsab.snifferShowSources": true, + "phpsab.executablePathCS": "/usr/local/bin/phpcs", + "phpsab.executablePathCBF": "/usr/local/bin/phpcbf", + "phpsab.standard": "WordPressOrg,WordPress-ExtraOrg,WordPress-DocsOrg", + /* WordPress-Extra,WordPress,,WordPress-Docs */ + "phpsab.debug": false, + "phpsab.allowedAutoRulesets": [ + ".phpcs.xml", + ".phpcs.xml.dist", + "phpcs.xml", + "phpcs.xml.dist", + "phpcs.ruleset.xml", + "ruleset.xml" + ], + "phpmd.rules": "codesize,design,unusedcode,naming", + "namespaceResolver.autoImportOnSave": true, + "phpResolver.phpLogFile": "/var/www/html-multi/wp-content/debug.log", + "phpResolver.phpLogFilePathRemote": "", + "phpResolver.phpLogFilePathLocal": "", + "phpResolver.phpBeautifierCommand": "/usr/bin/phpcbf", + "phpResolver.phpSnifferCommand": "/usr/bin/phpcs", + "phpResolver.phpStandards": "WordPress,WordPress-Extra,WordPress-Docs", + "php-docblocker.returnGap": true, + "php-docblocker.qualifyClassNames": true, + "php-docblocker.extra": [ + "", + "@since latest" + ], + "workbench.colorCustomizations": { + "editor.lineHighlightBackground": "#1073cf2d", + "editor.lineHighlightBorder": "#9fced11f" + }, + "editor.wordWrap": "on", + "editor.guides.indentation": true, + "editor.inlayHints.enabled": "on", + "editor.guides.bracketPairs": true, + "editor.guides.bracketPairsHorizontal": true, + "intelephense.completion.fullyQualifyGlobalConstantsAndFunctions": true, + "php.suggest.basic": false, + "php.validate.enable": false, + "[php]": { + "editor.defaultFormatter": "StoilDobreff.php-resolver" + }, + "cSpell.words": [ + "phpcs" + ], +} diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100755 index 0000000..b48001b --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,40 @@ +image: + file: .gitpod/.gitpod.dockerfile + +ports: + - port: 8080 + onOpen: open-preview + - port: 3306 + onOpen: ignore + - port: 8025 + onOpen: ignore + - port: 1025 + onOpen: ignore + - port: 9000 + onOpen: ignore + +tasks: + - name: Some init + command: | + sudo service mysql start + sudo service php8.3-fpm start + sudo service nginx start + sudo mailhog /dev/null & disown + /bin/bash .gitpod/.init.sh + +vscode: + extensions: + - eamodio.gitlens + - felixfbecker.php-debug + - sleistner.vscode-fileutils + - streetsidesoftware.code-spell-checker + - mrmlnc.vscode-duplicate + - usernamehw.errorlens + - RobertOstermann.inline-parameters-extended + - zaaack.markdown-editor + - neilbrayfield.php-docblocker + - felixfbecker.php-pack + - bmewburn.vscode-intelephense-client + - StoilDobreff.php-resolver + - ms-vscode.sublime-keybindings + - sdras.night-owl diff --git a/.gitpod/.gitpod.dockerfile b/.gitpod/.gitpod.dockerfile new file mode 100755 index 0000000..0d3f5fb --- /dev/null +++ b/.gitpod/.gitpod.dockerfile @@ -0,0 +1,5 @@ +# Gitpod docker image for WordPress | https://github.com/sdobreff/docker-bb-ci +# License: MIT (c) 2023 +# Version: 1.0 + +FROM sdobreff/gitpod:latest diff --git a/.gitpod/.init.sh b/.gitpod/.init.sh new file mode 100755 index 0000000..86b44ef --- /dev/null +++ b/.gitpod/.init.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +sudo service mysql stop +sudo mv /var/lib/mysql/ /workspace/ +sudo cp .gitpod/mysqld.cnf /etc/mysql/mysql.conf.d/mysql.cnf +sudo service mysql start + +export REPO_NAME=$(basename $GITPOD_REPO_ROOT) + +sudo ln -s $GITPOD_REPO_ROOT /var/www/html/wp-content/plugins +sudo chown gitpod:gitpod /var/www/html/wp-content/plugins/$REPO_NAME + +sudo ln -s $GITPOD_REPO_ROOT /var/www/html-multi/wp-content/plugins +sudo chown gitpod:gitpod /var/www/html-multi/wp-content/plugins/$REPO_NAME + +sudo ln -s $GITPOD_REPO_ROOT/.gitpod-vscode /var/www/html/.vscode +sudo chown gitpod:gitpod /var/www/html/.vscode + +sudo ln -s $GITPOD_REPO_ROOT/.gitpod-vscode /var/www/html-multi/.vscode +sudo chown gitpod:gitpod /var/www/html-multi/.vscode + +sudo mv /var/www/html/wp-content/plugins/ /workspace/ +sudo rm -rf /var/www/html/wp-content/plugins/ +sudo mv /var/www/html-multi/wp-content/plugins/ /workspace/plugins-multi/ +sudo rm -rf /var/www/html-multi/wp-content/plugins/ +sudo mv /var/www/html/wp-content/uploads/ /workspace/ +sudo rm -rf /var/www/html/wp-content/uploads/ +sudo mv /var/www/html-multi/wp-content/uploads/ /workspace/uploads-multi/ +sudo rm -rf /var/www/html-multi/wp-content/uploads/ +sudo ln -s /workspace/plugins /var/www/html/wp-content +sudo ln -s /workspace/plugins-multi /var/www/html-multi/wp-content/plugins +sudo ln -s /workspace/uploads /var/www/html/wp-content +sudo ln -s /workspace/uploads-multi /var/www/html-multi/wp-content/uploads + +cp -a .gdrive $HOME/.gdrive + +FLAG="$GITPOD_REPO_ROOT/bin/install-dependencies.sh" + +# search the flag file +if [ -f $FLAG ]; then + /bin/bash $FLAG +fi + +FLAG="$GITPOD_REPO_ROOT/bin/set-assets.sh" + +# search the flag file +if [ -f $FLAG ]; then + /bin/bash $FLAG +fi + +sudo adduser gitpod www-data +sudo chown gitpod:www-data /var/www -R +sudo chmod g+rw /var/www -R + +sudo mysql -u root wordpress-multi -e "update gitpod_site set domain='81-$HOSTNAME.$GITPOD_WORKSPACE_CLUSTER_HOST' where id=1"; +sudo mysql -u root wordpress-multi -e "update gitpod_blogs set domain='81-$HOSTNAME.$GITPOD_WORKSPACE_CLUSTER_HOST' where blog_id=1"; +sudo mysql -u root wordpress-multi -e "update gitpod_options set option_value='https://81-$HOSTNAME.$GITPOD_WORKSPACE_CLUSTER_HOST/' where option_name='siteurl'"; +sudo mysql -u root wordpress-multi -e "update gitpod_options set option_value='https://81-$HOSTNAME.$GITPOD_WORKSPACE_CLUSTER_HOST/' where option_name='home'"; + +cp .pre-commit .git/hooks/pre-commit + +sudo crontab /usr/local/crons diff --git a/.gitpod/create-multi-sites.php b/.gitpod/create-multi-sites.php new file mode 100755 index 0000000..8d689df --- /dev/null +++ b/.gitpod/create-multi-sites.php @@ -0,0 +1,35 @@ + 1 ) ); + echo "New blog with ID = $blog_id"; +} + diff --git a/.gitpod/mysqld.cnf b/.gitpod/mysqld.cnf new file mode 100755 index 0000000..5af5109 --- /dev/null +++ b/.gitpod/mysqld.cnf @@ -0,0 +1,78 @@ +# +# The MySQL database server configuration file. +# +# One can use all long options that the program supports. +# Run program with --help to get a list of available options and with +# --print-defaults to see which it would actually understand and use. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +# Here is entries for some specific programs +# The following values assume you have at least 32M ram + +[mysqld] +# +# * Basic Settings +# +user = mysql +# pid-file = /var/run/mysqld/mysqld.pid +# socket = /var/run/mysqld/mysqld.sock +# port = 3306 +datadir = /workspace/mysql + + +# If MySQL is running as a replication slave, this should be +# changed. Ref https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_tmpdir +# tmpdir = /tmp +# +# Instead of skip-networking the default is now to listen only on +# localhost which is more compatible and is not less secure. +bind-address = 127.0.0.1 +mysqlx-bind-address = 127.0.0.1 +# +# * Fine Tuning +# +key_buffer_size = 16M +# max_allowed_packet = 64M +# thread_stack = 256K + +# thread_cache_size = -1 + +# This replaces the startup script and checks MyISAM tables if needed +# the first time they are touched +myisam-recover-options = BACKUP + +# max_connections = 151 + +# table_open_cache = 4000 + +# +# * Logging and Replication +# +# Both location gets rotated by the cronjob. +# +# Log all queries +# Be aware that this log type is a performance killer. +# general_log_file = /var/log/mysql/query.log +# general_log = 1 +# +# Error log - should be very few entries. +# +log_error = /var/log/mysql/error.log +# +# Here you can see queries with especially long duration +# slow_query_log = 1 +# slow_query_log_file = /var/log/mysql/mysql-slow.log +# long_query_time = 2 +# log-queries-not-using-indexes +# +# The following can be used as easy to replay backup logs or for replication. +# note: if you are setting up a replication slave, see README.Debian about +# other settings you may need to change. +# server-id = 1 +# log_bin = /var/log/mysql/mysql-bin.log +# binlog_expire_logs_seconds = 2592000 +max_binlog_size = 100M +# binlog_do_db = include_database_name +# binlog_ignore_db = include_database_name diff --git a/admin-notices-manager.php b/admin-notices-manager.php index 39ff7d7..4f83965 100644 --- a/admin-notices-manager.php +++ b/admin-notices-manager.php @@ -15,6 +15,11 @@ * @package AdminNoticesManager */ +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + + /* Admin Notices Manager Copyright(c) 2022 WP White Security (email : info@wpwhitesecurity.com) @@ -41,6 +46,11 @@ define( 'ADMIN_NOTICES_MANAGER_INC', ADMIN_NOTICES_MANAGER_PATH . 'includes/' ); } +// Require Composer autoloader if it exists. +if ( file_exists( ADMIN_NOTICES_MANAGER_PATH . '/vendor/autoload.php' ) ) { + require_once ADMIN_NOTICES_MANAGER_PATH . 'vendor/autoload.php'; +} + // Include files. require_once ADMIN_NOTICES_MANAGER_INC . 'functions/core.php'; @@ -48,10 +58,6 @@ \register_activation_hook( __FILE__, '\AdminNoticesManager\Core\activate' ); \register_deactivation_hook( __FILE__, '\AdminNoticesManager\Core\deactivate' ); -// Require Composer autoloader if it exists. -if ( file_exists( ADMIN_NOTICES_MANAGER_PATH . '/vendor/autoload.php' ) ) { - require_once ADMIN_NOTICES_MANAGER_PATH . 'vendor/autoload.php'; -} // Bootstrap. AdminNoticesManager\Core\setup(); diff --git a/composer.json b/composer.json index 27c5559..068a02c 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,10 @@ "autoload": { "psr-4": { "AdminNoticesManager\\": "includes/classes/" - } + }, + "classmap": [ + "includes/classes/" + ] }, "scripts": { "lint": "phpcs .", diff --git a/includes/classes/Notices.php b/includes/classes/Notices.php deleted file mode 100644 index 2c8975a..0000000 --- a/includes/classes/Notices.php +++ /dev/null @@ -1,142 +0,0 @@ -'; - } - - /** - * Prints the beginning of wrapper element after all notices. - */ - public function finish_output_capturing() { - echo ''; - } - - /** - * Adds menu item showing number of notifications. - * - * @param \WP_Admin_Bar $admin_bar WordPress admin bar. - */ - public function add_item_in_admin_bar( $admin_bar ) { - $admin_bar->add_menu( - array( - 'id' => 'anm_notification_count', - 'title' => esc_html__( 'No admin notices', 'admin-notices-manager' ), - 'href' => '#', - 'parent' => 'top-secondary', - ) - ); - } - - /** - * Handles AJAX requests for logging the notices. - * - * @return false|void - */ - public function log_notices() { - - // If we have a nonce posted, check it. - if ( wp_doing_ajax() && isset( $_POST['_nonce'] ) ) { - $nonce_check = wp_verify_nonce( sanitize_text_field( $_POST['_nonce'] ), 'anm-ajax-nonce' ); // phpcs:ignore - if ( ! $nonce_check ) { - return false; - } - } - - if ( isset( $_POST['notices'] ) && ( ! empty( $_POST['notices'] && is_array( $_POST['notices'] ) ) ) ) { - $currently_held_options = get_option( 'anm-notices', array() ); - $hidden_forever = get_option( 'anm-hidden-notices', array() ); - $hashed_notices = array(); - $details = array(); - $format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' ); - - foreach ( $_POST['notices'] as $index => $notice ) { // phpcs:ignore - $hash = wp_hash( $notice ); - - $current_time = current_time( 'timestamp' ); // phpcs:ignore - $hashed_notices[ $hash ] = $current_time; - $details[ $index ] = array( $hash, date_i18n( $format, $current_time ) ); // phpcs:ignore - - // Do we already know about this notice? - if ( isset( $currently_held_options[ $hash ] ) ) { - $hashed_notices[ $hash ] = $currently_held_options[ $hash ]; - $details[ $index ] = array( $hash, date_i18n( $format, $currently_held_options[ $hash ] ) ); - } - - if ( in_array( $hash, $hidden_forever, true ) ) { - $details[ $index ] = 'do-not-display'; - } - } - - update_option( 'anm-notices', $hashed_notices ); - - wp_send_json_success( $details ); - } - - } - - /** - * Handles AJAX requests for hiding a notice forever. - * - * @return false|void - */ - public function hide_notice_forever() { - - // If we have a nonce posted, check it. - if ( wp_doing_ajax() && isset( $_POST['_nonce'] ) ) { - $nonce_check = wp_verify_nonce( sanitize_text_field( $_POST['_nonce'] ), 'anm-ajax-nonce' ); // phpcs:ignore - if ( ! $nonce_check ) { - return false; - } - } - - if ( isset( $_POST['notice_hash'] ) ) { - $currently_held_options = get_option( 'anm-hidden-notices', array() ); - array_push( $currently_held_options, $_POST['notice_hash'] ); // phpcs:ignore - update_option( 'anm-hidden-notices', $currently_held_options ); - wp_send_json_success(); - } - } -} diff --git a/includes/classes/Pointer.php b/includes/classes/Pointer.php deleted file mode 100644 index c968373..0000000 --- a/includes/classes/Pointer.php +++ /dev/null @@ -1,70 +0,0 @@ -add_pointer( - array( - 'id' => $initial_prompt_pointer_id, - 'target' => '#wp-admin-bar-anm_notification_count', - 'options' => array( - 'content' => sprintf( - '

%s

%s

', - esc_html__( 'Admin Notices Manager', 'admin-notices-manager' ), - esc_html__( 'From now onward, all the admin notices will be displayed here.', 'admin-notices-manager' ) - ), - 'position' => array( - 'edge' => 'top', - 'align' => 'center', - ), - 'pointerClass' => 'wp-pointer anm-pointer', - ), - ) - ); - - $manager->add_pointer( - array( - 'id' => 'anm_settings_prompt', - 'target' => '#menu-settings', - 'options' => array( - 'content' => sprintf( - '

%s

%s

', - esc_html__( 'Configure the Admin Notices Manager', 'admin-notices-manager' ), - esc_html__( 'Configure how the plugin handles different types of admin notices from the Settings > Admin Notices menu item.', 'admin-notices-manager' ) - ), - 'position' => array( - 'edge' => 'left', - 'align' => 'center', - ), - ), - ) - ); - } -} diff --git a/includes/classes/PointersManager.php b/includes/classes/PointersManager.php deleted file mode 100644 index 596dcfc..0000000 --- a/includes/classes/PointersManager.php +++ /dev/null @@ -1,169 +0,0 @@ -plugin_prefix = $plugin_prefix; - add_action( 'admin_enqueue_scripts', array( $this, 'load_pointers' ), 1000 ); - add_action( 'wp_ajax_wpws_dismiss_wp_pointer', array( $this, 'dismiss_wp_pointer' ) ); - } - - /** - * Ajax request handler to dismiss pointers. - * - * @since 3.2.4 - */ - public function dismiss_wp_pointer() { - $pointer = sanitize_text_field( wp_unslash( $_POST['pointer'] ) ); // phpcs:ignore - if ( sanitize_key( $pointer ) !== $pointer ) { - wp_die( 0 ); - } - - $dismissed = array_filter( explode( ',', (string) get_option( 'wpws-dismissed-pointers', '' ) ) ); - if ( self::is_dismissed( $pointer ) ) { - wp_die( 0 ); - } - - $dismissed[] = $pointer; - - update_option( 'wpws-dismissed-pointers', implode( ',', $dismissed ), false ); - wp_die( 1 ); - } - - /** - * Checks if a pointer is already dismissed. - * - * @param string $pointer_id Pointer identifier. - * - * @return bool True if the pointer is already dismissed. False otherwise. - * @since 1.1.0 - */ - public static function is_dismissed( $pointer_id ) { - $dismissed = array_filter( explode( ',', (string) get_option( 'wpws-dismissed-pointers', '' ) ) ); - - return in_array( $pointer_id, $dismissed, true ); - } - - /** - * Add a pointer to the list. - * - * @param array $pointer Pointer data. - * - * @return false|void - */ - public function add_pointer( $pointer ) { - - if ( - empty( $pointer ) - || empty( $pointer['id'] ) - || empty( $pointer['target'] ) - || empty( $pointer['options'] ) - ) { - return false; - } - - if ( ! $this->pointers || ! is_array( $this->pointers ) ) { - $this->pointers = array(); - } - - $this->pointers[ $pointer['id'] ] = $pointer; - } - - /** - * Load Pointers. - * - * @param string $hook_suffix - Current hook suffix. - * - * @since 1.0.0 - */ - public function load_pointers( $hook_suffix ) { - // Don't run on WP < 3.3. - if ( get_bloginfo( 'version' ) < '3.3' ) { - return; - } - - $valid_pointers = array(); - - // Check that current user should see the pointers. - $eligible_user_id = intval( get_option( 'anm-plugin-installed-by-user-id', 1 ) ); - if ( 0 === $eligible_user_id ) { - $eligible_user_id = 1; - } - - $current_user_id = get_current_user_id(); - if ( 0 === $current_user_id || $current_user_id !== $eligible_user_id ) { - return; - } - - // Check pointers and remove dismissed ones. - if ( empty( $this->pointers ) ) { - return; - } - - foreach ( $this->pointers as $pointer_id => $pointer ) { - - // Don't display if already dismissed. - if ( self::is_dismissed( $pointer_id ) ) { - return; - } - - $pointer['pointer_id'] = $pointer['id']; - unset( $pointer['id'] ); - - // Add the pointer to $valid_pointers array. - $valid_pointers[] = $pointer; - } - - // No valid pointers? Stop here. - if ( empty( $valid_pointers ) ) { - return; - } - - // Add pointers style to queue. - wp_enqueue_style( 'wp-pointer' ); - - // Add pointers script to queue. Add custom script. - $script_handle = $this->plugin_prefix . '_pointer'; - wp_enqueue_script( - $script_handle, - script_url( 'pointer', 'admin' ), - array( 'wp-pointer' ), - ADMIN_NOTICES_MANAGER_VERSION, - true - ); - - // Add pointer options to script. - wp_localize_script( $script_handle, 'wpws_pointers', $valid_pointers ); - } -} diff --git a/includes/classes/Settings.php b/includes/classes/Settings.php deleted file mode 100644 index 0f5a7c3..0000000 --- a/includes/classes/Settings.php +++ /dev/null @@ -1,358 +0,0 @@ - esc_html__( 'Hide from the WordPress dashboard and show them in the plugin\'s popup', 'admin-notices-manager' ), - 'hide' => esc_html__( 'Hide them completely (do not show in the WordPress dashboard or in the plugin\'s popup)', 'admin-notices-manager' ), - 'leave' => esc_html__( 'Do not do anything (they will appear on the WordPress dashboard as per usual)', 'admin-notices-manager' ), - ); - - $system_notices_options = $notice_handling_options; - unset( $system_notices_options['hide'] ); - - $standard_notices = array( - 'success' => esc_html__( 'Success level notices', 'admin-notices-manager' ), - 'error' => esc_html__( 'Error level notices', 'admin-notices-manager' ), - 'warning' => esc_html__( 'Warning level notices', 'admin-notices-manager' ), - 'info' => esc_html__( 'Information level notices', 'admin-notices-manager' ), - ); - - $standard_notices_section_fields = array(); - foreach ( $standard_notices as $notice_type => $notice_field_title ) { - $field_name = $notice_type . '-notices'; - $standard_notices_section_fields[ $field_name ] = array( - 'title' => $notice_field_title, - 'type' => 'radio', - 'value' => array_key_exists( $field_name, $options ) ? $options[ $field_name ] : 'popup-only', - 'choices' => $notice_handling_options, - ); - } - - $popup_style_options = array( - 'slide-in' => esc_html__( 'Slide in from the right', 'admin-notices-manager' ), - 'popup' => esc_html__( 'Popup', 'admin-notices-manager' ), - ); - - $pages = array( - self::$option_name => array( - 'menu_title' => esc_html__( 'Admin Notices', 'admin-notices-manager' ), - 'parent_slug' => 'options-general.php', - 'page_title' => esc_html__( 'Admin notices settings', 'admin-notices-manager' ), - 'text' => 'Use the settings in this page to configure how the plugin should handle different types of admin notices. Refer to the introduction to admin notices for a detailed explanation about the different types of admin notices available in WordPress.', - 'sections' => array( - 'standard-notices' => array( - 'title' => esc_html__( 'Standard admin notices', 'admin-notices-manager' ), - 'fields' => $standard_notices_section_fields, - ), - 'non-standard-notices' => array( - 'title' => esc_html__( 'Non-Standard admin notices', 'admin-notices-manager' ), - 'text' => esc_html__( 'These type of admin notices are typically created by third party plugins and themes and do not have any severity level. Use the below settings to configure how the plugin should handle these type of admin notices.', 'admin-notices-manager' ), - 'fields' => array( - 'no-level-notices' => array( - 'title' => esc_html__( 'No level notices', 'admin-notices-manager' ), - 'type' => 'radio', - 'value' => array_key_exists( 'no-level-notices', $options ) ? $options['no-level-notices'] : 'popup-only', - 'choices' => $notice_handling_options, - ), - 'exceptions' => array( - 'title' => esc_html__( 'CSS selector', 'admin-notices-manager' ), - 'type' => 'text', - 'value' => array_key_exists( 'exceptions-css-selector', $options ) ? $options['exceptions-css-selector'] : '', - 'text' => esc_html__( 'Plugin will ignore all notices matching this CSS selector. Use jQuery compatible CSS selector. You can specify multiple selectors and comma separate them.', 'admin-notices-manager' ), - ), - ), - ), - 'system-notices' => array( - 'title' => esc_html__( 'WordPress system admin notices', 'admin-notices-manager' ), - 'text' => esc_html__( 'These type of admin notices are used by WordPress to advise you about the status of specific actions, for example to confirm that the changed settings were saved, or that a plugin was successfully installed. It is recommended to let these admin notices appear in the WordPress dashboard.', 'admin-notices-manager' ), - 'fields' => array( - 'system-level-notices' => array( - 'title' => esc_html__( 'WordPress system admin notices', 'admin-notices-manager' ), - 'type' => 'radio', - 'value' => array_key_exists( 'system-level-notices', $options ) ? $options['system-level-notices'] : 'leave', - 'choices' => $system_notices_options, - ), - ), - ), - 'user-visibility' => array( - 'title' => esc_html__( 'Hiding notifications', 'admin-notices-manager' ), - 'text' => esc_html__( 'Plugin can hide the notifications from specific users or display them only to certain selected users. Use the below settings to configure this behaviour.', 'admin-notices-manager' ), - 'fields' => array( - 'user-visibility' => array( - 'title' => esc_html__( 'Visibility', 'admin-notices-manager' ), - 'type' => 'radio', - 'custom' => true, - 'callback' => array( $this, 'render_user_visibility_field' ), - 'value' => array_key_exists( 'user-visibility', $options ) ? $options['user-visibility'] : 'all', - 'choices' => array( - 'all' => esc_html__( 'Hide notifications from all users', 'admin-notices-manager' ), - 'hide-for-selected' => esc_html__( 'Hide notifications only from these users', 'admin-notices-manager' ), - 'show-for-selected' => esc_html__( 'Hide notifications to all users but not these', 'admin-notices-manager' ), - ), - 'sanitize' => false, // Stops default sanitization. It would break the data. - ), - ), - ), - 'styling' => array( - 'title' => esc_html__( 'Admin notices popup styling', 'admin-notices-manager' ), - 'text' => esc_html__( 'How do you want ANM to look?', 'admin-notices-manager' ), - 'fields' => array( - 'popup-style' => array( - 'title' => esc_html__( 'Popup style', 'admin-notices-manager' ), - 'type' => 'radio', - 'value' => array_key_exists( 'popup-style', $options ) ? $options['popup-style'] : 'slide-in', - 'choices' => $popup_style_options, - ), - 'slide_in_background' => array( - 'title' => esc_html__( 'Slide in background colour', 'admin-notices-manager' ), - 'type' => 'color', - 'value' => array_key_exists( 'popup-style', $options ) ? $options['popup-style'] : '#1d2327', - ), - ), - ), - 'purge' => array( - 'title' => esc_html__( 'Restore hidden admin notices', 'admin-notices-manager' ), - 'text' => esc_html__( 'Reset the current list of hidden admin notices from the database so they are displayed again.', 'admin-notices-manager' ), - 'fields' => array( - 'purge_now' => array( - 'title' => esc_html__( 'Reset list now', 'admin-notices-manager' ), - 'type' => 'text', - 'value' => '', - 'custom' => true, - 'callback' => array( $this, 'render_purge_field' ), - 'text' => '', - 'sanitize' => false, - ), - ), - ), - ), - ), - ); - - new \RationalOptionPages( $pages ); - } - - /** - * Retrieve plugin settings. - * - * @return array - */ - public static function get_settings() { - return wp_parse_args( - get_option( self::$option_name, array() ), - array( - 'success_level_notices' => 'popup-only', - 'error_level_notices' => 'popup-only', - 'warning_level_notices' => 'popup-only', - 'information_level_notices' => 'popup-only', - 'no_level_notices' => 'popup-only', - 'wordpress_system_admin_notices' => 'leave', - 'popup_style' => 'slide-in', - 'slide_in_background' => '#1d2327', - 'css_selector' => '', - 'visibility' => array( 'choice' => 'all' ), - ) - ); - } - - /** - * Checks if hiding of notices is allowed according to the plugin settings. - * - * @return bool True if notices' hiding is allowed for current user. - * - * @since latest - */ - public static function notice_hiding_allowed_for_current_user() { - if ( ! is_user_logged_in() ) { - return false; - } - - // phpcs:disable WordPress.PHP.StrictInArray - $settings = self::get_settings(); - if ( ! array_key_exists( 'visibility', $settings ) || ! array_key_exists( 'choice', $settings['visibility'] ) ) { - return true; - } - - if ( 'all' === $settings['visibility']['choice'] ) { - return true; - } - - if ( 'hide-for-selected' === $settings['visibility']['choice'] - && array_key_exists( 'hide-users', $settings['visibility'] ) - && is_array( $settings['visibility']['hide-users'] ) - && ! in_array( get_current_user_id(), $settings['visibility']['hide-users'] ) ) { - return false; - } - - if ( 'show-for-selected' === $settings['visibility']['choice'] - && array_key_exists( 'show-users', $settings['visibility'] ) - && is_array( $settings['visibility']['show-users'] ) - && in_array( get_current_user_id(), $settings['visibility']['show-users'] ) ) { - return false; - } - - return true; - } - - /** - * Renders custom user visibility field(s). - * - * @param array $field Field data. - * @param string $page_key Settings page key. - * @param string $section_key Settings section key. - * @param string $field_key Field key. - * @param RationalOptionPages $option_pages Rational option pages object. - * - * @since latest - * - * phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped - */ - public function render_user_visibility_field( $field, $page_key, $section_key, $field_key, $option_pages ) { - if ( ! class_exists( '\S24WP' ) ) { - return; - } - - echo '
' . $field['title'] . ''; - - $options = $option_pages->get_options(); - $field['value'] = isset( $options[ $field['id'] ]['choice'] ) ? $options[ $field['id'] ]['choice'] : 'all'; - - $counter = 0; - foreach ( $field['choices'] as $value => $label ) { - $checked = 0 === strlen( $value ) || $value === $field['value']; - if ( isset( $this->options[ $field['id'] ] ) ) { - $checked = $value === $this->options[ $field['id'] ]; - } - - if ( is_null( $field['value'] ) && 'all' === $value ) { - $checked = true; - } - - $field_name = "{$page_key}[{$field['id']}]"; - printf( - '', - checked( $checked, true, false ), - ! empty( $field['class'] ) ? "class='{$field['class']}'" : '', - $field['id'] . '-' . $value, - $field_name . '[choice]', - $label, - $value, - $label - ); - - echo '
'; - - if ( 'all' === $value ) { - continue; - } - - if ( 'hide-for-selected' === $value ) { - \S24WP::insert( - $this->build_user_select_params( - $options, - $field_name, - $field, - $checked, - 'hide-users' - ) - ); - } elseif ( 'show-for-selected' === $value ) { - \S24WP::insert( - $this->build_user_select_params( - $options, - $field_name, - $field, - $checked, - 'show-users' - ) - ); - } - - echo $counter < count( $field['choices'] ) - 1 ? '
' : ''; - $counter ++; - } - echo '
'; - } - - /** - * Renders custom user visibility field(s). - * - * @param array $field Field data. - * @param string $page_key Settings page key. - * @param string $section_key Settings section key. - * @param string $field_key Field key. - * @param RationalOptionPages $option_pages Rational option pages object. - * - * @since latest - * - * phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped - */ - public function render_purge_field( $field, $page_key, $section_key, $field_key, $option_pages ) { - $nonce = wp_create_nonce( 'anm_purgce_notices_nonce' ); - echo '' . esc_html__( 'Reset', 'admin-notices-manager' ) . ' ' . esc_html__( 'Notices restored', 'admin-notices-manager' ) . ''; - } - - /** - * Builds an array of parameters for the user selection form control. - * - * @param array $options Fields options. - * @param string $field_name Field name. - * @param array $field Field data. - * @param bool $checked True if the field is checked. - * @param mixes $option_value Option value. - * - * @return array - * - * @since latest. - */ - private function build_user_select_params( $options, $field_name, $field, $checked, $option_value ) { - $result = array( - 'placeholder' => esc_html__( 'select user(s)', 'admin-notices-manager' ), - 'name' => $field_name . '[' . $option_value . '][]', - 'width' => 500, - 'data-type' => 'user', - 'multiple' => true, - 'extra_js_callback' => function ( $element_id ) { - echo 'window.anm_settings.append_select2_events( s2 );'; - }, - ); - - if ( $checked ) { - $result['selected'] = $options[ $field['id'] ][ $option_value ]; - } - - return $result; - } -} diff --git a/includes/classes/class-notices.php b/includes/classes/class-notices.php new file mode 100644 index 0000000..165a47a --- /dev/null +++ b/includes/classes/class-notices.php @@ -0,0 +1,153 @@ +'; + } + + /** + * Prints the beginning of wrapper element after all notices. + * + * @since 1.0.0 + */ + public static function finish_output_capturing() { + echo ''; + } + + /** + * Adds menu item showing number of notifications. + * + * @param \WP_Admin_Bar $admin_bar WordPress admin bar. + * + * @since 1.0.0 + */ + public static function add_item_in_admin_bar( $admin_bar ) { + $admin_bar->add_menu( + array( + 'id' => 'anm_notification_count', + 'title' => esc_html__( 'No admin notices', 'admin-notices-manager' ), + 'href' => '#', + 'parent' => 'top-secondary', + ) + ); + } + + /** + * Handles AJAX requests for logging the notices. + * + * @return false|void + * + * @since 1.0.0 + */ + public static function log_notices() { + // If we have a nonce posted, check it. + if ( \wp_doing_ajax() && isset( $_POST['_nonce'] ) ) { + $nonce_check = \wp_verify_nonce( \sanitize_text_field( \wp_unslash( $_POST['_nonce'] ) ), 'anm-ajax-nonce' ); + if ( ! $nonce_check ) { + return false; + } + } + + if ( isset( $_POST['notices'] ) && ( ! empty( $_POST['notices'] && is_array( $_POST['notices'] ) ) ) ) { + $currently_held_options = \get_option( 'anm-notices', array() ); + $hidden_forever = \get_option( 'anm-hidden-notices', array() ); + $hashed_notices = array(); + $details = array(); + $format = \get_option( 'date_format' ) . ' ' . \get_option( 'time_format' ); + + foreach ( $_POST['notices'] as $index => $notice ) { + $hash = \wp_hash( $notice ); + + $current_time = \current_time( 'timestamp' ); + $hashed_notices[ $hash ] = $current_time; + $details[ $index ] = array( $hash, date_i18n( $format, $current_time ) ); + + // Do we already know about this notice? + if ( isset( $currently_held_options[ $hash ] ) ) { + $hashed_notices[ $hash ] = $currently_held_options[ $hash ]; + $details[ $index ] = array( $hash, date_i18n( $format, $currently_held_options[ $hash ] ) ); + } + + if ( in_array( $hash, $hidden_forever, true ) ) { + $details[ $index ] = 'do-not-display'; + } + } + + \update_option( 'anm-notices', $hashed_notices ); + + \wp_send_json_success( $details ); + } + } + + /** + * Handles AJAX requests for hiding a notice forever. + * + * @return false|void + * + * @since 1.0.0 + */ + public static function hide_notice_forever() { + // If we have a nonce posted, check it. + if ( \wp_doing_ajax() && isset( $_POST['_nonce'] ) ) { + $nonce_check = \wp_verify_nonce( \sanitize_text_field( \wp_unslash( $_POST['_nonce'] ) ), 'anm-ajax-nonce' ); + if ( ! $nonce_check ) { + return false; + } + } + + if ( isset( $_POST['notice_hash'] ) ) { + $currently_held_options = \get_option( 'anm-hidden-notices', array() ); + array_push( $currently_held_options, $_POST['notice_hash'] ); + \update_option( 'anm-hidden-notices', $currently_held_options ); + \wp_send_json_success(); + } + } + } +} diff --git a/includes/classes/class-pointer-manager.php b/includes/classes/class-pointer-manager.php new file mode 100644 index 0000000..6872a3c --- /dev/null +++ b/includes/classes/class-pointer-manager.php @@ -0,0 +1,184 @@ + $pointer ) { + + // Don't display if already dismissed. + if ( self::is_dismissed( $pointer_id ) ) { + return; + } + + $pointer['pointer_id'] = $pointer['id']; + unset( $pointer['id'] ); + + // Add the pointer to $valid_pointers array. + $valid_pointers[] = $pointer; + } + + // No valid pointers? Stop here. + if ( empty( $valid_pointers ) ) { + return; + } + + // Add pointers style to queue. + \wp_enqueue_style( 'wp-pointer' ); + + // Add pointers script to queue. Add custom script. + $script_handle = self::$plugin_prefix . '_pointer'; + \wp_enqueue_script( + $script_handle, + script_url( 'pointer', 'admin' ), + array( 'wp-pointer' ), + ADMIN_NOTICES_MANAGER_VERSION, + true + ); + + // Add pointer options to script. + \wp_localize_script( $script_handle, 'wpws_pointers', $valid_pointers ); + } + } +} diff --git a/includes/classes/class-pointer.php b/includes/classes/class-pointer.php new file mode 100644 index 0000000..4b339f3 --- /dev/null +++ b/includes/classes/class-pointer.php @@ -0,0 +1,80 @@ + $initial_prompt_pointer_id, + 'target' => '#wp-admin-bar-anm_notification_count', + 'options' => array( + 'content' => sprintf( + '

%s

%s

', + esc_html__( 'Admin Notices Manager', 'admin-notices-manager' ), + esc_html__( 'From now onward, all the admin notices will be displayed here.', 'admin-notices-manager' ) + ), + 'position' => array( + 'edge' => 'top', + 'align' => 'center', + ), + 'pointerClass' => 'wp-pointer anm-pointer', + ), + ) + ); + + Pointers_Manager::add_pointer( + array( + 'id' => 'anm_settings_prompt', + 'target' => '#menu-settings', + 'options' => array( + 'content' => sprintf( + '

%s

%s

', + esc_html__( 'Configure the Admin Notices Manager', 'admin-notices-manager' ), + esc_html__( 'Configure how the plugin handles different types of admin notices from the Settings > Admin Notices menu item.', 'admin-notices-manager' ) + ), + 'position' => array( + 'edge' => 'left', + 'align' => 'center', + ), + ), + ) + ); + } + } +} diff --git a/includes/classes/class-rational-option-pages.php b/includes/classes/class-rational-option-pages.php new file mode 100644 index 0000000..e1dd37d --- /dev/null +++ b/includes/classes/class-rational-option-pages.php @@ -0,0 +1,899 @@ + + * @copyright Copyright (c) 2016 + * @link http://jeremyhixon.com + * @version 1.0.1 + */ + +namespace AdminNoticesManager; + +class Rational_Option_Pages { + /* ========================================================================== + Vars + ========================================================================== */ + protected $attributes = array( + 'input' => array( + 'autocomplete' => false, + 'autofocus' => false, + 'disabled' => false, + 'list' => false, + 'max' => false, + 'maxlength' => false, + 'min' => false, + 'pattern' => false, + 'readonly' => false, + 'required' => false, + 'size' => false, + 'step' => false, + ), + 'select' => array( + 'multiple' => false, + 'size' => 4, + ), + 'textarea' => array( + 'cols' => 20, + 'rows' => 2, + 'wrap' => 'soft', + ), +); +protected $defaults = array( + 'add_menu_page' => array( + 'page_title' => 'Option Page', + 'menu_title' => 'Option Page', + 'capability' => 'manage_options', + 'menu_slug' => 'option_page', + 'callback' => false, + 'icon_url' => false, + 'position' => null, + ), + 'add_settings_field' => array( + 'id' => 'settings_field', + 'title' => 'Settings Field', + 'callback' => false, + 'page' => 'option_page', + 'section' => 'settings_section', + 'args' => false, + ), + 'add_settings_section' => array( + 'id' => 'settings_section', + 'title' => 'Settings Section', + 'callback' => false, + 'page' => 'option_page', + ), + 'add_submenu_page' => array( + 'parent_slug' => 'option_page', + 'page_title' => 'Sub Option Page', + 'menu_title' => 'Sub Option Page', + 'capability' => 'manage_options', + 'menu_slug' => 'sub_option_page', + 'callback' => false, + ), +); +protected $errors; +protected $fields = array( + 'checkbox' => array( + 'checked' => false, + 'value' => 'on', + ), + 'text' => array( + 'class' => 'regular-text', + 'placeholder' => '', + 'value' => false, + ), + 'textarea' => array( + 'class' => 'large-text', + 'placeholder' => '', + 'rows' => 10, + 'value' => false, + ), + 'wp_editor' => array( + 'wpautop' => true, + 'media_buttons' => true, + 'textarea_rows' => 'default', + 'tabindex' => false, + 'editor_css' => false, + 'editor_class' => '', + 'editor_height' => false, + 'teeny' => false, + 'dfw' => false, + 'tinymce' => true, + 'quicktags' => true, + 'drag_drop_upload' => false, + ), +); +protected $media_script = false; +protected $notices; +protected $options; +protected $pages = array(); +protected $subpages = array(); +protected $points; + +/* ========================================================================== + Magic methods + ========================================================================== */ +/** + * Catches unknown method calls + * + * @param string $method The method being requested + * @param array $arguments Array of arguments passed to the method + */ +public function __call( $method, $arguments ) { + $request = explode( '|', $method ); + $source = $request[0]; + $page_key = !empty( $request[1] ) ? $request[1] : false; + $section_key = !empty( $request[2] ) ? $request[2] : false; + $field_key = !empty( $request[3] ) ? $request[3] : false; + + switch ( $source ) { + case 'add_menu_page': + case 'add_submenu_page': + $this->build_menu_page( $page_key ); + break; + case 'add_settings_section': + $this->build_settings_section( $page_key, $section_key ); + break; + case 'add_settings_field': + $this->build_settings_field( $page_key, $section_key, $field_key ); + break; + case 'register_setting': + return $this->sanitize_setting( $page_key, $arguments[0] ); + default: + $this->submit_notice( $method ); + } +} + +/** + * Class construct method. Configures class and hooks into WordPress. + * + * @param array $pages Array of option pages + */ +public function __construct( $pages = array() ) { + foreach ( $pages as $page_key => $page_params ) { + $this->pages[ $page_key ] = $this->validate_page( $page_key, $page_params ); + } + $this->pages = array_merge( $this->pages, $this->subpages ); + + add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); + add_action( 'admin_head', array( $this, 'admin_head' ) ); + add_action( 'admin_init', array( $this, 'admin_init' ) ); + add_action( 'admin_menu', array( $this, 'admin_menu' ) ); + add_action( 'admin_notices', array( $this, 'admin_notices' ) ); +} + +/* ========================================================================== + WordPress hooks + ========================================================================== */ +/** + * Action: admin_enqueue_scripts + * Conditionally queue's up jQuery and the media uploader script + */ +public function admin_enqueue_scripts() { + if ( $this->media_script ) { + wp_enqueue_script( 'jquery' ); + wp_enqueue_media(); + } +} + +/** + * Action: admin_head + * Conditionally adds the script to manage media uploads + */ +public function admin_head() { + if ( $this->media_script ) { + ?> + pages as $page_key => $page_params ) { + // Finalize sanitize + if ( empty( $page_params['custom'] ) && !is_array( $page_params['sanitize'] ) ) { + $page_params['sanitize'] = array( $this, $page_params['sanitize'] ); + } + + register_setting( + $page_key, + $page_key, + $page_params['sanitize'] + ); + + if ( !empty( $page_params['sections'] ) ) { + foreach ( $page_params['sections'] as $section_key => $section_params ) { + // Sort and trim the array for the function + $sort_order = array_keys( $this->defaults['add_settings_section'] ); + $params = $this->sort_array( $section_params, $sort_order ); + $params = array_slice( $params, 0, count( $this->defaults['add_settings_section'] ) ); + + // Finalize callback + if ( empty( $params['custom'] ) && !is_array( $params['callback'] ) ) { + $params['callback'] = array( $this, $params['callback'] ); + } + + call_user_func_array( 'add_settings_section', array_values( $params ) ); + + if ( !empty( $section_params['fields'] ) ) { + foreach ( $section_params['fields'] as $field_key => $field_params ) { + // Check for "media" type for adding script + if ( !$this->media_script && $field_params['type'] === 'media' ) { + $this->media_script = true; + } + + // Sort and trim the array for the function + $sort_order = array_keys( $this->defaults['add_settings_field'] ); + $params = $this->sort_array( $field_params, $sort_order ); + $params = array_slice( $params, 0, count( $this->defaults['add_settings_field'] ) ); + + // Add label wrapper on title + if ( + !in_array( $field_params['type'], array( 'radio' ) ) && + ( empty( $field_params['no_label'] ) || $field_params['no_label'] === false ) + ) { + $params['title'] = ""; + } + + // Finalize callback + if ( empty( $params['custom'] ) && !is_array( $params['callback'] ) ) { + $params['callback'] = array( $this, $params['callback'] ); + } + + call_user_func_array( 'add_settings_field', array_values( $params ) ); + } + } + } + } + } +} + +/** + * Action: admin_menu. Adding the option pages to the admin menu. + */ +public function admin_menu() { + $all_pages = array_merge( $this->pages, $this->subpages ); + + foreach ( $all_pages as $page ) { + // Sort and trim the array for the function + $sort_order = array_keys( $this->defaults[ $page['function'] ] ); + $params = $this->sort_array( $page, $sort_order ); + $params = array_slice( $params, 0, count( $this->defaults[ $page['function'] ] ) ); + + // Finalize callback + $params['callback'] = array( $this, $params['callback'] ); + + + call_user_func_array( $page['function'], array_values( $params ) ); + } +} + +/** + * Action: admin_notices. Spitting out notices when needed. + */ +public function admin_notices() { + // notice-error, notice-warning, notice-success, or notice-info. + if ( !empty( $this->errors ) ) { + foreach ( $this->errors as $error ) { + echo $error; + } + } + if ( !empty( $this->notices ) ) { + foreach ( $this->notices as $notice ) { + echo $notice; + } + } + + // update point in array for future reference + $this->points['admin_notices'] = true; +} + +/* ========================================================================== + Helpers + ========================================================================== */ +public function add_page( $page_key, $page_params ) { + $this->pages[ $page_key ] = $this->validate_page( $page_key, $page_params ); +} + +/** + * Builds the menu page + * + * @param string $page_key The array key of the page needing built + */ +protected function build_menu_page( $page_key ) { + $page = $this->pages[ $page_key ]; + $this->options = get_option( $page_key, array() ); + settings_errors(); + ?>
+

' . $page['text'] . '

'; + } + if ( !empty( $page['sections'] ) ) { + ?>
has_fields( $page ) ) { + submit_button(); + } + ?>
pages[ $page_key ]; + $section = $page['sections'][ $section_key ]; + $field = $section['fields'][ $field_key ]; + + if ( isset( $field['value'] ) && $field['type'] !== 'checkbox' ) { + $field['value'] = !empty( $this->options[ $field['id'] ] ) ? $this->options[ $field['id'] ] : $field['value']; + } + + // Additional attributes + if ( !empty( $field['attributes'] ) ) { + $attributes = array(); + foreach ( $field['attributes'] as $attribute => $value ) { + if ( !empty( $value ) ) { + $attributes[] = "{$attribute}='{$value}'"; + } + } + } + + // Sanitize field values, unless 'sanitize' was set to false for this field. + if ( ( !isset( $field['sanitize'] ) || $field['sanitize'] ) && $field['type'] !== 'wp_editor' ) { + if (!empty($field['attributes']) && isset($field['attributes']['multiple']) && $field['attributes']['multiple']) { + for ( $i = 0; $i < count( $field['value'] ); $i++ ) { + $field['value'][ $i ] = strip_tags($field['value'][ $i ]); // Removes HTML tags + $field['value'][ $i ] = esc_attr($field['value'][ $i ]); // Escapes field for HTML attributes + } + } else { + $field['value'] = strip_tags($field['value']); // Removes HTML tags + $field['value'] = esc_attr($field['value']); // Escapes field for HTML attributes + } + } + + if ( array_key_exists( '_callback', $field ) ) { + call_user_func( $field['_callback'], $field, $page_key, $section_key, $field_key, $this ); + return; + } + + switch ( $field['type'] ) { + case 'checkbox': + $checked = $field['checked'] ? 'checked' : ''; + if ( isset( $this->options[ $field['id'] ] ) ) { + $checked = checked( $field['value'], $this->options[ $field['id'] ], false ); + } + printf( + '', + $checked, // checked + !empty( $field['class'] ) ? "class='{$field['class']}'" : '', // class + $field['id'], // id + "{$page_key}[{$field['id']}]", // name + $field['title_attr'], // title + $field['value'], // value + !empty( $field['text'] ) ? $field['text'] : '' // text + ); + break; + case 'media': + $upload_button = sprintf( + '' + ); + printf( + '%s%s', + !empty( $field['class'] ) ? "class='{$field['class']}'" : '', // class + $field['id'], // id + "{$page_key}[{$field['id']}]", // name + ! empty( $field['placeholder'] ) ? 'placeholder="' . $field['placeholder'] . '"' : '', // placeholder + $field['title_attr'], // title + $field['value'], // value + !empty( $attributes ) ? implode( ' ', $attributes ) : '', // additional attributes + $upload_button, // upload button + ! empty( $field['text'] ) ? '

' . $field['text'] . '

' : '' // text + ); + break; + case 'radio': + echo '
' . $field['title'] . ''; + $c = 0; + foreach ( $field['choices'] as $value => $label ) { + $checked = $value === $field['value'] ? 'checked' : ''; + if ( isset( $this->options[ $field['id'] ] ) ) { + $checked = $value === $this->options[ $field['id'] ] ? 'checked' : ''; + } + printf( + '%s', + $checked, // checked + !empty( $field['class'] ) ? "class='{$field['class']}'" : '', // class + $field['id'], // id + "{$page_key}[{$field['id']}]", // name + $label, // title + $value, // value + $label, // label + $c < count( $field['choices'] ) - 1 ? '
' : '' // line-break + ); + $c++; + } + echo '
'; + break; + case 'select': + if (!empty($field['attributes']) && isset($field['attributes']['multiple']) && $field['attributes']['multiple']) { + $field_tag_name = "{$page_key}[{$field['id']}][]"; + $field_name = "{$field['id']}[]"; + } + else { + $field_tag_name = "{$page_key}[{$field['id']}]"; + $field_name = "{$field['id']}"; + } + printf( + ''; + break; + case 'textarea': + printf( + '%s', + !empty( $field['class'] ) ? "class='{$field['class']}'" : '', // class + $field['id'], // id + "{$page_key}[{$field['id']}]", // name + !empty( $field['placeholder'] ) ? 'placeholder="'.$field['placeholder'].'"' : '', // placeholder + !empty( $field['rows'] ) ? "rows='{$field['rows']}'" : '', // rows + !empty( $field['cols'] ) ? "cols='{$field['cols']}'" : '', // cols + !empty( $field['wrap'] ) ? "wrap='{$field['wrap']}'" : '', // wrap + $field['title_attr'], // title + $field['value'], // value + ! empty( $field['text'] ) ? '

' . $field['text'] . '

' : '' // text + ); + break; + case 'wp_editor': + $field['textarea_name'] = "{$page_key}[{$field['id']}]"; + wp_editor( isset( $field['value'] ) ? $field['value'] : '', $field['id'], array( + 'textarea_name' => $field['textarea_name'], + ) ); + echo ! empty( $field['text'] ) ? '

' . $field['text'] . '

' : ''; + break; + default: + printf( + '%s', + !empty( $field['class'] ) ? "class='{$field['class']}'" : '', // class + $field['id'], // id + "{$page_key}[{$field['id']}]", // name + ! empty( $field['placeholder'] ) ? 'placeholder="' . $field['placeholder'] . '"' : '', // placeholder + $field['title_attr'], // title + $field['type'], // type + $field['value'], // value + !empty( $attributes ) ? implode( ' ', $attributes ) : '', // additional attributes + ! empty( $field['text'] ) ? '

' . $field['text'] . '

' : '' // text + ); + } +} + +/** + * Builds the settings sections + * + * @param string $page_key The array key of the page + * @param type $section_key The array key of the section + */ +protected function build_settings_section( $page_key, $section_key ) { + $page = $this->pages[ $page_key ]; + $section = $page['sections'][ $section_key ]; + + echo !empty( $section['text'] ) ? $section['text'] : ''; + + if ( !empty( $section['include'] ) ) { + include $section['include']; + } +} + +/** + * Determines if the option page has fields or not + * + * @param array $page The page array + * + * @return boolean True if fields are found, false otherwise + */ +protected function has_fields( $page ) { + if ( !empty( $page['sections'] ) ) { + foreach ( $page['sections'] as $section ) { + if ( !empty( $section['fields'] ) ) { + return true; + } + } + } + return false; +} + +/** + * Cleans up the option page submissions before submitting to the DB + * + * @param string $page_key The array key of the page + * + * @return array The sanitized post input + */ +protected function sanitize_setting( $page_key, $input ) { + $page = $this->pages[ $page_key ]; + + if ( !empty( $page['sections'] ) ) { + foreach ( $page['sections'] as $section ) { + if ( !empty( $section['fields'] ) ) { + foreach ( $section['fields'] as $field ) { + if ( isset( $field['sanitize'] ) && !$field['sanitize'] ) { + continue; + } + switch ( $field['type'] ) { + case 'select': + if ( !empty($input[$field['id']]) && !empty($input['attributes']['multiple']) ) { + $input[ $field['id'] ] = $input[ $field['id'] ]; + } + break; + case 'checkbox': + if ( empty( $input[ $field['id'] ] ) ) { + $input[ $field['id'] ] = false; + } + break; + case 'wp_editor': + $input[ $field['id'] ] = wp_kses_post( $input[ $field['id'] ] ); + break; + default: + // Sanitize by default; skip if this field's 'sanitize' setting is false. + $input[ $field['id'] ] = sanitize_text_field( $input[ $field['id'] ] ); + } + } + } + } + } + + return $input; +} + +/** + * Converts human-readable strings into more machine-friendly formats + * + * @param string $text String to be formatted + * @param string $separator The character that fills in spaces + * + * @return string Formatted text + */ +protected function slugify( $text, $separator = '_' ) { + $text = preg_replace( '~[^\\pL\d]+~u', $separator, $text ); + $text = trim( $text, $separator ); + $text = iconv( 'utf-8', 'windows-1251//TRANSLIT', $text ); + $text = strtolower( $text ); + $text = preg_replace( '~[^-\w]+~', '', $text ); + if ( empty( $text ) ) { + return 'n-a'; + } + return $text; +} + +/** + * Sorts one array using a second as a guide + * + * @param array $array Array to be sorted + * @param array $order_array Guide array + * + * @return array Sorted array + */ +protected function sort_array( $array, $order_array ) { + $ordered = array(); + foreach ( $order_array as $key ) { + if ( array_key_exists( $key, $array ) ) { + $ordered[ $key ] = $array[ $key ]; + unset( $array[ $key ] ); + } + } + return $ordered + $array; +} + +/** + * Conditionally outputs an error in WordPress admin + * + * @param string $error The error to be output + */ +public function submit_error( $error ) { + $error = sprintf( + '

%s

', + is_array( $error ) || is_object( $error ) ? '
' . htmlspecialchars( print_r( $error, true ) ) . '
' : $error + ); + if ( empty( $this->points['admin_notices'] ) ) { + $this->errors[] = $error; + } else { + echo $error; + } +} + +/** + * Conditionally outputs a notice in WordPress admin + * + * @param string $notice The text to be output + */ +public function submit_notice( $notice ) { + $notice = sprintf( + '

%s

', + is_array( $notice ) || is_object( $notice ) ? '
' . htmlspecialchars( print_r( $notice, true ) ) . '
' : $notice + ); + if ( empty( $this->points['admin_notices'] ) ) { + $this->notices[] = $notice; + } else { + echo $notice; + } +} + +/** + * Validates the field data submitted to the class + * + * @param array $field Field array + * @param string $page_key Array key of the associated page + * @param string $section_key Array key of the associated section + * @param string $field_key Array key of the field + * @param string $page ID of the associated page + * @param type $section ID of the associated section + * + * @return array The validated field array + */ +protected function validate_field( $field, $page_key, $section_key, $field_key, $page, $section ) { + // Label + if ( empty( $field['title'] ) ) { + $this->submit_error( 'Field parameter "title" is required' ); + } + + // ID + if ( empty( $field['id'] ) ) { + $field['id'] = $this->slugify( $field['title'] ); + } + + // Callback + if ( ! empty( $field['callback'] ) ) { + $field['_callback'] = $field['callback']; + } + + $field['callback'] = "add_settings_field|{$page_key}|{$section_key}|{$field_key}"; + + // Page + $field['page'] = $page; + + // Section + $field['section'] = $section; + + // Type + $field['type'] = empty( $field['type'] ) ? 'text' : $field['type']; + + // Title attribute + $field['title_attr'] = empty( $field['title_attr'] ) ? $field['title'] : $field['title_attr']; + + // Choices + if ( empty( $field['choices'] ) && in_array( $field['type'], array( 'radio', 'select' ) ) ) { + $this->submit_error( 'Field parameter "choices" is required for the "radio" and "select" type' ); + } + + // Other attributes + if ( !empty( $field['attributes'] ) ) { + switch ( $field['type'] ) { + case 'select': + case 'textarea': + $field['attributes'] = wp_parse_args( $field['attributes'], $this->attributes[ $field['type'] ] ); + break; + default: + $field['attributes'] = wp_parse_args( $field['attributes'], $this->attributes['input'] ); + } + } + + // Making sure we haven't missed anything + switch ( $field['type'] ) { + case 'checkbox': + $field = wp_parse_args( $field, $this->fields['checkbox'] ); + break; + case 'color': + case 'radio': + case 'range': + break; + case 'date': + $field['value'] = date( 'Y-m-d', strtotime( $field['value'] ) ); + $field = wp_parse_args( $field, $this->fields['text'] ); + break; + case 'datetime': + case 'datetime-local': + $field['value'] = date( 'Y-m-d\TH:i:s', strtotime( $field['value'] ) ); + $field = wp_parse_args( $field, $this->fields['text'] ); + break; + case 'month': + $field['value'] = date( 'Y-m', strtotime( $field['value'] ) ); + $field = wp_parse_args( $field, $this->fields['text'] ); + break; + case 'textarea': + $field = wp_parse_args( $field, $this->fields[ $field['type'] ] ); + break; + case 'time': + $field['value'] = date( 'H:i:s', strtotime( $field['value'] ) ); + $field = wp_parse_args( $field, $this->fields['text'] ); + break; + case 'week': + $field['value'] = date( 'Y-\WW', strtotime( $field['value'] ) ); + $field = wp_parse_args( $field, $this->fields['text'] ); + break; + case 'wp_editor': + $field = wp_parse_args( $field, $this->fields['wp_editor'] ); + break; + default: + $field = wp_parse_args( $field, $this->fields['text'] ); + } + + return $field; +} + +/** + * Validates the information submitted to the class + * + * @param string $page_key Array key of the page. + * @param array $page_params Array of page parameters. + * @param string $parent_slug Menu slug of the parent page if there is one. + * + * @return array Validated array of page parameters. + */ +protected function validate_page( $page_key, $page_params, $parent_slug = false ) { + // Page title + if ( empty( $page_params['page_title'] ) ) { + $this->submit_error( 'Page parameter "page_title" is required' ); + } + + // Menu title + if ( empty( $page_params['menu_title'] ) ) { + $page_params['menu_title'] = $page_params['page_title']; + } + + // Menu slug + if ( empty( $page_params['menu_slug'] ) ) { + // Basing it off the page title because it's likely to be more unique than the menu title + $page_params['menu_slug'] = $this->slugify( $page_params['page_title'] ); + } + + // Menu or submenu item? + if ( empty( $page_params['parent_slug'] ) && !$parent_slug ) { + $page_params['function'] = 'add_menu_page'; + } else { + $page_params['function'] = 'add_submenu_page'; + $page_params['parent_slug'] = $parent_slug ? $parent_slug : $page_params['parent_slug']; + } + + // Callback + $page_params['callback'] = "{$page_params['function']}|{$page_key}"; + + // Sanitize + $page_params['sanitize'] = empty( $page_params['sanitize'] ) ? "register_setting|{$page_key}" : $page_params['sanitize']; + + // Make sure we haven't missed anything + $page_params = wp_parse_args( $page_params, $this->defaults[ $page_params['function'] ] ); + + // Subpages? + if ( !empty( $page_params['subpages'] ) ) { + foreach ( $page_params['subpages'] as $subpage_key => $subpage ) { + $this->subpages[ $subpage_key ] = $this->validate_page( $subpage_key, $subpage, $page_params['menu_slug'] ); + } + unset( $page_params['subpages'] ); + } + + // Sections? + if ( !empty( $page_params['sections'] ) ) { + foreach ( $page_params['sections'] as $section_key => $section_params ) { + $page_params['sections'][ $section_key ] = $this->validate_section( $section_params, $page_key, $section_key, $page_params['menu_slug'] ); + } + } + + return $page_params; +} + +/** + * Validates the section data submitted to the class + * + * @param array $section Section array + * @param string $page_key Array key of the associated page + * @param string $section_key Array key of the associated page + * @param string $page ID of the associated page + * + * @return array Validated section array + */ +protected function validate_section( $section, $page_key, $section_key, $page ) { + // Title + if ( empty( $section['title'] ) ) { + $this->submit_error( 'Section parameter "title" is required' ); + } + + // ID + if ( empty( $section['id'] ) ) { + $section['id'] = $this->slugify( $section['title'] ); + } + + // Callback + $section['callback'] = empty( $section['callback'] ) ? "add_settings_section|{$page_key}|{$section_key}" : $section['callback']; + + // Page + $section['page'] = $page; + + // Fields? + if ( !empty( $section['fields'] ) ) { + foreach ( $section['fields'] as $field_key => $field_params ) { + $section['fields'][ $field_key ] = $this->validate_field( $field_params, $page_key, $section_key, $field_key, $page, $section['id'] ); + } + } + + return $section; +} + +/** + * Getter for the option values. + * + * @return mixed + */ +public function get_options() { + return $this->options; +} +} \ No newline at end of file diff --git a/includes/classes/class-settings.php b/includes/classes/class-settings.php new file mode 100644 index 0000000..34b14e9 --- /dev/null +++ b/includes/classes/class-settings.php @@ -0,0 +1,360 @@ + esc_html__( 'Hide from the WordPress dashboard and show them in the plugin\'s popup', 'admin-notices-manager' ), + 'hide' => esc_html__( 'Hide them completely (do not show in the WordPress dashboard or in the plugin\'s popup)', 'admin-notices-manager' ), + 'leave' => esc_html__( 'Do not do anything (they will appear on the WordPress dashboard as per usual)', 'admin-notices-manager' ), + ); + + $system_notices_options = $notice_handling_options; + unset( $system_notices_options['hide'] ); + + $standard_notices = array( + 'success' => esc_html__( 'Success level notices', 'admin-notices-manager' ), + 'error' => esc_html__( 'Error level notices', 'admin-notices-manager' ), + 'warning' => esc_html__( 'Warning level notices', 'admin-notices-manager' ), + 'info' => esc_html__( 'Information level notices', 'admin-notices-manager' ), + ); + + $standard_notices_section_fields = array(); + foreach ( $standard_notices as $notice_type => $notice_field_title ) { + $field_name = $notice_type . '-notices'; + $standard_notices_section_fields[ $field_name ] = array( + 'title' => $notice_field_title, + 'type' => 'radio', + 'value' => array_key_exists( $field_name, $options ) ? $options[ $field_name ] : 'popup-only', + 'choices' => $notice_handling_options, + ); + } + + $popup_style_options = array( + 'slide-in' => esc_html__( 'Slide in from the right', 'admin-notices-manager' ), + 'popup' => esc_html__( 'Popup', 'admin-notices-manager' ), + ); + + $pages = array( + self::$option_name => array( + 'menu_title' => esc_html__( 'Admin Notices', 'admin-notices-manager' ), + 'parent_slug' => 'options-general.php', + 'page_title' => esc_html__( 'Admin notices settings', 'admin-notices-manager' ), + 'text' => 'Use the settings in this page to configure how the plugin should handle different types of admin notices. Refer to the introduction to admin notices for a detailed explanation about the different types of admin notices available in WordPress.', + 'sections' => array( + 'standard-notices' => array( + 'title' => esc_html__( 'Standard admin notices', 'admin-notices-manager' ), + 'fields' => $standard_notices_section_fields, + ), + 'non-standard-notices' => array( + 'title' => esc_html__( 'Non-Standard admin notices', 'admin-notices-manager' ), + 'text' => esc_html__( 'These type of admin notices are typically created by third party plugins and themes and do not have any severity level. Use the below settings to configure how the plugin should handle these type of admin notices.', 'admin-notices-manager' ), + 'fields' => array( + 'no-level-notices' => array( + 'title' => esc_html__( 'No level notices', 'admin-notices-manager' ), + 'type' => 'radio', + 'value' => array_key_exists( 'no-level-notices', $options ) ? $options['no-level-notices'] : 'popup-only', + 'choices' => $notice_handling_options, + ), + 'exceptions' => array( + 'title' => esc_html__( 'CSS selector', 'admin-notices-manager' ), + 'type' => 'text', + 'value' => array_key_exists( 'exceptions-css-selector', $options ) ? $options['exceptions-css-selector'] : '', + 'text' => esc_html__( 'Plugin will ignore all notices matching this CSS selector. Use jQuery compatible CSS selector. You can specify multiple selectors and comma separate them.', 'admin-notices-manager' ), + ), + ), + ), + 'system-notices' => array( + 'title' => esc_html__( 'WordPress system admin notices', 'admin-notices-manager' ), + 'text' => esc_html__( 'These type of admin notices are used by WordPress to advise you about the status of specific actions, for example to confirm that the changed settings were saved, or that a plugin was successfully installed. It is recommended to let these admin notices appear in the WordPress dashboard.', 'admin-notices-manager' ), + 'fields' => array( + 'system-level-notices' => array( + 'title' => esc_html__( 'WordPress system admin notices', 'admin-notices-manager' ), + 'type' => 'radio', + 'value' => array_key_exists( 'system-level-notices', $options ) ? $options['system-level-notices'] : 'leave', + 'choices' => $system_notices_options, + ), + ), + ), + 'user-visibility' => array( + 'title' => esc_html__( 'Hiding notifications', 'admin-notices-manager' ), + 'text' => esc_html__( 'Plugin can hide the notifications from specific users or display them only to certain selected users. Use the below settings to configure this behaviour.', 'admin-notices-manager' ), + 'fields' => array( + 'user-visibility' => array( + 'title' => esc_html__( 'Visibility', 'admin-notices-manager' ), + 'type' => 'radio', + 'custom' => true, + 'callback' => array( $this, 'render_user_visibility_field' ), + 'value' => array_key_exists( 'user-visibility', $options ) ? $options['user-visibility'] : 'all', + 'choices' => array( + 'all' => esc_html__( 'Hide notifications from all users', 'admin-notices-manager' ), + 'hide-for-selected' => esc_html__( 'Hide notifications only from these users', 'admin-notices-manager' ), + 'show-for-selected' => esc_html__( 'Hide notifications to all users but not these', 'admin-notices-manager' ), + ), + 'sanitize' => false, // Stops default sanitization. It would break the data. + ), + ), + ), + 'styling' => array( + 'title' => esc_html__( 'Admin notices popup styling', 'admin-notices-manager' ), + 'text' => esc_html__( 'How do you want ANM to look?', 'admin-notices-manager' ), + 'fields' => array( + 'popup-style' => array( + 'title' => esc_html__( 'Popup style', 'admin-notices-manager' ), + 'type' => 'radio', + 'value' => array_key_exists( 'popup-style', $options ) ? $options['popup-style'] : 'slide-in', + 'choices' => $popup_style_options, + ), + 'slide_in_background' => array( + 'title' => esc_html__( 'Slide in background colour', 'admin-notices-manager' ), + 'type' => 'color', + 'value' => array_key_exists( 'popup-style', $options ) ? $options['popup-style'] : '#1d2327', + ), + ), + ), + 'purge' => array( + 'title' => esc_html__( 'Restore hidden admin notices', 'admin-notices-manager' ), + 'text' => esc_html__( 'Reset the current list of hidden admin notices from the database so they are displayed again.', 'admin-notices-manager' ), + 'fields' => array( + 'purge_now' => array( + 'title' => esc_html__( 'Reset list now', 'admin-notices-manager' ), + 'type' => 'text', + 'value' => '', + 'custom' => true, + 'callback' => array( $this, 'render_purge_field' ), + 'text' => '', + 'sanitize' => false, + ), + ), + ), + ), + ), + ); + + new Rational_Option_Pages( $pages ); + } + + /** + * Retrieve plugin settings. + * + * @return array + */ + public static function get_settings() { + return wp_parse_args( + get_option( self::$option_name, array() ), + array( + 'success_level_notices' => 'popup-only', + 'error_level_notices' => 'popup-only', + 'warning_level_notices' => 'popup-only', + 'information_level_notices' => 'popup-only', + 'no_level_notices' => 'popup-only', + 'wordpress_system_admin_notices' => 'leave', + 'popup_style' => 'slide-in', + 'slide_in_background' => '#1d2327', + 'css_selector' => '', + 'visibility' => array( 'choice' => 'all' ), + ) + ); + } + + /** + * Checks if hiding of notices is allowed according to the plugin settings. + * + * @return bool True if notices' hiding is allowed for current user. + * + * @since latest + */ + public static function notice_hiding_allowed_for_current_user() { + if ( ! is_user_logged_in() ) { + return false; + } + + // phpcs:disable WordPress.PHP.StrictInArray + $settings = self::get_settings(); + if ( ! array_key_exists( 'visibility', $settings ) || ! array_key_exists( 'choice', $settings['visibility'] ) ) { + return true; + } + + if ( 'all' === $settings['visibility']['choice'] ) { + return true; + } + + if ( 'hide-for-selected' === $settings['visibility']['choice'] + && array_key_exists( 'hide-users', $settings['visibility'] ) + && is_array( $settings['visibility']['hide-users'] ) + && ! in_array( get_current_user_id(), $settings['visibility']['hide-users'] ) ) { + return false; + } + + if ( 'show-for-selected' === $settings['visibility']['choice'] + && array_key_exists( 'show-users', $settings['visibility'] ) + && is_array( $settings['visibility']['show-users'] ) + && in_array( get_current_user_id(), $settings['visibility']['show-users'] ) ) { + return false; + } + + return true; + } + + /** + * Renders custom user visibility field(s). + * + * @param array $field Field data. + * @param string $page_key Settings page key. + * @param string $section_key Settings section key. + * @param string $field_key Field key. + * @param RationalOptionPages $option_pages Rational option pages object. + * + * @since latest + * + * phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped + */ + public function render_user_visibility_field( $field, $page_key = '', $section_key = '', $field_key = '', $option_pages = '' ) { + if ( ! class_exists( '\S24WP' ) ) { + return; + } + + echo '
' . $field['title'] . ''; + + $options = $option_pages->get_options(); + $field['value'] = isset( $options[ $field['id'] ]['choice'] ) ? $options[ $field['id'] ]['choice'] : 'all'; + + $counter = 0; + foreach ( $field['choices'] as $value => $label ) { + $checked = 0 === strlen( $value ) || $value === $field['value']; + if ( isset( $this->options[ $field['id'] ] ) ) { + $checked = $value === $this->options[ $field['id'] ]; + } + + if ( is_null( $field['value'] ) && 'all' === $value ) { + $checked = true; + } + + $field_name = "{$page_key}[{$field['id']}]"; + printf( + '', + checked( $checked, true, false ), + ! empty( $field['class'] ) ? "class='{$field['class']}'" : '', + $field['id'] . '-' . $value, + $field_name . '[choice]', + $label, + $value, + $label + ); + + echo '
'; + + if ( 'all' === $value ) { + continue; + } + + if ( 'hide-for-selected' === $value ) { + \S24WP::insert( + $this->build_user_select_params( + $options, + $field_name, + $field, + $checked, + 'hide-users' + ) + ); + } elseif ( 'show-for-selected' === $value ) { + \S24WP::insert( + $this->build_user_select_params( + $options, + $field_name, + $field, + $checked, + 'show-users' + ) + ); + } + + echo $counter < count( $field['choices'] ) - 1 ? '
' : ''; + ++$counter; + } + echo '
'; + } + + /** + * Renders custom user visibility field(s). + * + * @param array $field Field data. + * @param string $page_key Settings page key. + * @param string $section_key Settings section key. + * @param string $field_key Field key. + * @param RationalOptionPages $option_pages Rational option pages object. + * + * @since latest + * + * phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped + */ + public function render_purge_field( $field, $page_key, $section_key, $field_key, $option_pages ) { + $nonce = wp_create_nonce( 'anm_purgce_notices_nonce' ); + echo '' . esc_html__( 'Reset', 'admin-notices-manager' ) . ' ' . esc_html__( 'Notices restored', 'admin-notices-manager' ) . ''; + } + + /** + * Builds an array of parameters for the user selection form control. + * + * @param array $options Fields options. + * @param string $field_name Field name. + * @param array $field Field data. + * @param bool $checked True if the field is checked. + * @param mixes $option_value Option value. + * + * @return array + * + * @since latest. + */ + private function build_user_select_params( $options, $field_name, $field, $checked, $option_value ) { + $result = array( + 'placeholder' => esc_html__( 'select user(s)', 'admin-notices-manager' ), + 'name' => $field_name . '[' . $option_value . '][]', + 'width' => 500, + 'data-type' => 'user', + 'multiple' => true, + 'extra_js_callback' => function ( $element_id ) { + echo 'window.anm_settings.append_select2_events( s2 );'; + }, + ); + + if ( $checked ) { + $result['selected'] = $options[ $field['id'] ][ $option_value ]; + } + + return $result; + } + } +} diff --git a/includes/functions/core.php b/includes/functions/core.php index f2f0f4f..0316ecd 100644 --- a/includes/functions/core.php +++ b/includes/functions/core.php @@ -11,7 +11,6 @@ use AdminNoticesManager\Notices; use AdminNoticesManager\Pointer; use AdminNoticesManager\Settings; -use \WP_Error as WP_Error; /** * Default setup routine @@ -60,8 +59,9 @@ function init() { // Check if the notices can be hidden for the currently logged-in user. $notice_hiding_allowed = Settings::notice_hiding_allowed_for_current_user(); - new Notices( $notice_hiding_allowed ); - new Pointer(); + Notices::init( $notice_hiding_allowed ); + Pointer::init(); + new Settings(); } From b2720f04730221edb833ad63398c0d6af3e8a918 Mon Sep 17 00:00:00 2001 From: sdobreff Date: Mon, 3 Jun 2024 14:33:46 +0000 Subject: [PATCH 04/15] 3rd party lib moved --- includes/classes/{ => vendor}/class-rational-option-pages.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/classes/{ => vendor}/class-rational-option-pages.php (100%) diff --git a/includes/classes/class-rational-option-pages.php b/includes/classes/vendor/class-rational-option-pages.php similarity index 100% rename from includes/classes/class-rational-option-pages.php rename to includes/classes/vendor/class-rational-option-pages.php From 3083105dce49c91f903bb7b0793c6b2b66111ac8 Mon Sep 17 00:00:00 2001 From: sdobreff Date: Tue, 4 Jun 2024 10:19:58 +0300 Subject: [PATCH 05/15] switched versions of select2 (#98) --- .editorconfig | 0 .eslintignore | 0 .eslintrc.js | 0 .github/workflows/wpcs.yml | 0 .gitignore | 0 .gitpod/.init.sh | 2 + .vscode/launch.json | 0 README.md | 0 admin-notices-manager.php | 4 +- assets/dist/js/notices.js | 0 assets/dist/js/notices.min.js | 0 assets/dist/js/pointer.js | 0 assets/dist/js/pointer.min.js | 0 assets/dist/js/settings.js | 0 assets/dist/js/settings.min.js | 0 assets/index.php | 0 assets/js/admin/notices.js | 0 assets/js/admin/pointer.js | 35 -- assets/js/admin/settings.js | 0 composer.json | 3 +- config/webpack.config.common.js | 0 config/webpack.config.dev.js | 0 config/webpack.config.prod.js | 0 config/webpack.settings.js | 0 gulpfile.babel.js | 0 includes/classes/.gitkeep | 0 includes/classes/class-notices.php | 0 includes/classes/class-pointer-manager.php | 184 ------- includes/classes/class-pointer.php | 80 ---- includes/classes/class-pointers.php | 187 ++++++++ includes/classes/class-settings.php | 36 +- .../vendor/Select2/assets/css/select2.min.css | 1 + .../Select2/assets/css/wp-overrides.css | 47 ++ .../vendor/Select2/assets/js/i18n/af.js | 3 + .../vendor/Select2/assets/js/i18n/ar.js | 3 + .../vendor/Select2/assets/js/i18n/az.js | 3 + .../vendor/Select2/assets/js/i18n/bg.js | 3 + .../vendor/Select2/assets/js/i18n/bn.js | 3 + .../vendor/Select2/assets/js/i18n/bs.js | 3 + .../vendor/Select2/assets/js/i18n/build.txt | 236 +++++++++ .../vendor/Select2/assets/js/i18n/ca.js | 3 + .../vendor/Select2/assets/js/i18n/cs.js | 3 + .../vendor/Select2/assets/js/i18n/da.js | 3 + .../vendor/Select2/assets/js/i18n/de.js | 3 + .../vendor/Select2/assets/js/i18n/dsb.js | 3 + .../vendor/Select2/assets/js/i18n/el.js | 3 + .../vendor/Select2/assets/js/i18n/en.js | 3 + .../vendor/Select2/assets/js/i18n/es.js | 3 + .../vendor/Select2/assets/js/i18n/et.js | 3 + .../vendor/Select2/assets/js/i18n/eu.js | 3 + .../vendor/Select2/assets/js/i18n/fa.js | 3 + .../vendor/Select2/assets/js/i18n/fi.js | 3 + .../vendor/Select2/assets/js/i18n/fr.js | 3 + .../vendor/Select2/assets/js/i18n/gl.js | 3 + .../vendor/Select2/assets/js/i18n/he.js | 3 + .../vendor/Select2/assets/js/i18n/hi.js | 3 + .../vendor/Select2/assets/js/i18n/hr.js | 3 + .../vendor/Select2/assets/js/i18n/hsb.js | 3 + .../vendor/Select2/assets/js/i18n/hu.js | 3 + .../vendor/Select2/assets/js/i18n/hy.js | 3 + .../vendor/Select2/assets/js/i18n/id.js | 3 + .../vendor/Select2/assets/js/i18n/is.js | 3 + .../vendor/Select2/assets/js/i18n/it.js | 3 + .../vendor/Select2/assets/js/i18n/ja.js | 3 + .../vendor/Select2/assets/js/i18n/ka.js | 3 + .../vendor/Select2/assets/js/i18n/km.js | 3 + .../vendor/Select2/assets/js/i18n/ko.js | 3 + .../vendor/Select2/assets/js/i18n/lt.js | 3 + .../vendor/Select2/assets/js/i18n/lv.js | 3 + .../vendor/Select2/assets/js/i18n/mk.js | 3 + .../vendor/Select2/assets/js/i18n/ms.js | 3 + .../vendor/Select2/assets/js/i18n/nb.js | 3 + .../vendor/Select2/assets/js/i18n/ne.js | 3 + .../vendor/Select2/assets/js/i18n/nl.js | 3 + .../vendor/Select2/assets/js/i18n/pl.js | 3 + .../vendor/Select2/assets/js/i18n/ps.js | 3 + .../vendor/Select2/assets/js/i18n/pt-BR.js | 3 + .../vendor/Select2/assets/js/i18n/pt.js | 3 + .../vendor/Select2/assets/js/i18n/ro.js | 3 + .../vendor/Select2/assets/js/i18n/ru.js | 3 + .../vendor/Select2/assets/js/i18n/sk.js | 3 + .../vendor/Select2/assets/js/i18n/sl.js | 3 + .../vendor/Select2/assets/js/i18n/sq.js | 3 + .../vendor/Select2/assets/js/i18n/sr-Cyrl.js | 3 + .../vendor/Select2/assets/js/i18n/sr.js | 3 + .../vendor/Select2/assets/js/i18n/sv.js | 3 + .../vendor/Select2/assets/js/i18n/th.js | 3 + .../vendor/Select2/assets/js/i18n/tk.js | 3 + .../vendor/Select2/assets/js/i18n/tr.js | 3 + .../vendor/Select2/assets/js/i18n/uk.js | 3 + .../vendor/Select2/assets/js/i18n/vi.js | 3 + .../vendor/Select2/assets/js/i18n/zh-CN.js | 3 + .../vendor/Select2/assets/js/i18n/zh-TW.js | 3 + .../Select2/assets/js/select2.full.min.js | 2 + .../vendor/Select2/class-select2-wpws.php | 450 ++++++++++++++++++ .../vendor/class-rational-option-pages.php | 0 includes/functions/core.php | 23 +- includes/index.php | 0 index.php | 0 languages/admin-notices-manager-sk_SK.mo | Bin languages/admin-notices-manager-sk_SK.po | 0 languages/admin-notices-manager.pot | 0 languages/index.php | 0 package-lock.json | 0 package.json | 0 phpunit.xml | 0 readme.txt | 0 tests/bootstrap.php | 0 tests/js/.gitkeep | 0 tests/phpunit/test-tools/Core_Tests.php | 0 tests/phpunit/test-tools/TestCase.php | 0 uninstall.php | 0 wpgulp.config.js | 0 113 files changed, 1140 insertions(+), 327 deletions(-) mode change 100644 => 100755 .editorconfig mode change 100644 => 100755 .eslintignore mode change 100644 => 100755 .eslintrc.js mode change 100644 => 100755 .github/workflows/wpcs.yml mode change 100644 => 100755 .gitignore mode change 100644 => 100755 .vscode/launch.json mode change 100644 => 100755 README.md mode change 100644 => 100755 admin-notices-manager.php mode change 100644 => 100755 assets/dist/js/notices.js mode change 100644 => 100755 assets/dist/js/notices.min.js mode change 100644 => 100755 assets/dist/js/pointer.js mode change 100644 => 100755 assets/dist/js/pointer.min.js mode change 100644 => 100755 assets/dist/js/settings.js mode change 100644 => 100755 assets/dist/js/settings.min.js mode change 100644 => 100755 assets/index.php mode change 100644 => 100755 assets/js/admin/notices.js delete mode 100644 assets/js/admin/pointer.js mode change 100644 => 100755 assets/js/admin/settings.js mode change 100644 => 100755 composer.json mode change 100644 => 100755 config/webpack.config.common.js mode change 100644 => 100755 config/webpack.config.dev.js mode change 100644 => 100755 config/webpack.config.prod.js mode change 100644 => 100755 config/webpack.settings.js mode change 100644 => 100755 gulpfile.babel.js mode change 100644 => 100755 includes/classes/.gitkeep mode change 100644 => 100755 includes/classes/class-notices.php delete mode 100644 includes/classes/class-pointer-manager.php delete mode 100644 includes/classes/class-pointer.php create mode 100755 includes/classes/class-pointers.php mode change 100644 => 100755 includes/classes/class-settings.php create mode 100755 includes/classes/vendor/Select2/assets/css/select2.min.css create mode 100755 includes/classes/vendor/Select2/assets/css/wp-overrides.css create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/af.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/ar.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/az.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/bg.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/bn.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/bs.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/build.txt create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/ca.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/cs.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/da.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/de.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/dsb.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/el.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/en.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/es.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/et.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/eu.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/fa.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/fi.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/fr.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/gl.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/he.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/hi.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/hr.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/hsb.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/hu.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/hy.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/id.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/is.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/it.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/ja.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/ka.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/km.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/ko.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/lt.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/lv.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/mk.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/ms.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/nb.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/ne.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/nl.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/pl.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/ps.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/pt-BR.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/pt.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/ro.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/ru.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/sk.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/sl.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/sq.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/sr-Cyrl.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/sr.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/sv.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/th.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/tk.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/tr.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/uk.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/vi.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/zh-CN.js create mode 100755 includes/classes/vendor/Select2/assets/js/i18n/zh-TW.js create mode 100755 includes/classes/vendor/Select2/assets/js/select2.full.min.js create mode 100755 includes/classes/vendor/Select2/class-select2-wpws.php mode change 100644 => 100755 includes/classes/vendor/class-rational-option-pages.php mode change 100644 => 100755 includes/functions/core.php mode change 100644 => 100755 includes/index.php mode change 100644 => 100755 index.php mode change 100644 => 100755 languages/admin-notices-manager-sk_SK.mo mode change 100644 => 100755 languages/admin-notices-manager-sk_SK.po mode change 100644 => 100755 languages/admin-notices-manager.pot mode change 100644 => 100755 languages/index.php mode change 100644 => 100755 package-lock.json mode change 100644 => 100755 package.json mode change 100644 => 100755 phpunit.xml mode change 100644 => 100755 readme.txt mode change 100644 => 100755 tests/bootstrap.php mode change 100644 => 100755 tests/js/.gitkeep mode change 100644 => 100755 tests/phpunit/test-tools/Core_Tests.php mode change 100644 => 100755 tests/phpunit/test-tools/TestCase.php mode change 100644 => 100755 uninstall.php mode change 100644 => 100755 wpgulp.config.js diff --git a/.editorconfig b/.editorconfig old mode 100644 new mode 100755 diff --git a/.eslintignore b/.eslintignore old mode 100644 new mode 100755 diff --git a/.eslintrc.js b/.eslintrc.js old mode 100644 new mode 100755 diff --git a/.github/workflows/wpcs.yml b/.github/workflows/wpcs.yml old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.gitpod/.init.sh b/.gitpod/.init.sh index 86b44ef..8e84ed3 100755 --- a/.gitpod/.init.sh +++ b/.gitpod/.init.sh @@ -39,6 +39,8 @@ FLAG="$GITPOD_REPO_ROOT/bin/install-dependencies.sh" # search the flag file if [ -f $FLAG ]; then /bin/bash $FLAG +else + composer update --no-dev fi FLAG="$GITPOD_REPO_ROOT/bin/set-assets.sh" diff --git a/.vscode/launch.json b/.vscode/launch.json old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/admin-notices-manager.php b/admin-notices-manager.php old mode 100644 new mode 100755 index 4f83965..779c96a --- a/admin-notices-manager.php +++ b/admin-notices-manager.php @@ -5,7 +5,7 @@ * Description: Better manage admin notices & never miss an important WordPress and developer message. * Author: WP White Security * Author URI: https://www.wpwhitesecurity.com/ - * Version: 1.4.0 + * Version: 1.6.0 * Text Domain: admin-notices-manager * Domain Path: /languages * Requires at least: 5.0 @@ -40,7 +40,7 @@ // Useful global constants. if ( ! defined( 'ADMIN_NOTICES_MANAGER_VERSION' ) ) { - define( 'ADMIN_NOTICES_MANAGER_VERSION', '1.4.0' ); + define( 'ADMIN_NOTICES_MANAGER_VERSION', '1.6.0' ); define( 'ADMIN_NOTICES_MANAGER_URL', \plugin_dir_url( __FILE__ ) ); define( 'ADMIN_NOTICES_MANAGER_PATH', \plugin_dir_path( __FILE__ ) ); define( 'ADMIN_NOTICES_MANAGER_INC', ADMIN_NOTICES_MANAGER_PATH . 'includes/' ); diff --git a/assets/dist/js/notices.js b/assets/dist/js/notices.js old mode 100644 new mode 100755 diff --git a/assets/dist/js/notices.min.js b/assets/dist/js/notices.min.js old mode 100644 new mode 100755 diff --git a/assets/dist/js/pointer.js b/assets/dist/js/pointer.js old mode 100644 new mode 100755 diff --git a/assets/dist/js/pointer.min.js b/assets/dist/js/pointer.min.js old mode 100644 new mode 100755 diff --git a/assets/dist/js/settings.js b/assets/dist/js/settings.js old mode 100644 new mode 100755 diff --git a/assets/dist/js/settings.min.js b/assets/dist/js/settings.min.js old mode 100644 new mode 100755 diff --git a/assets/index.php b/assets/index.php old mode 100644 new mode 100755 diff --git a/assets/js/admin/notices.js b/assets/js/admin/notices.js old mode 100644 new mode 100755 diff --git a/assets/js/admin/pointer.js b/assets/js/admin/pointer.js deleted file mode 100644 index c1f9e7b..0000000 --- a/assets/js/admin/pointer.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Pointer helper. - * - * @since 1.0.0 - */ -jQuery(document).ready(function ($) { - function open_pointer (i) { - if (wpws_pointers[i]) { - const pointer = wpws_pointers[i] - let options = $.extend(pointer.options, { - close: function () { - $.post(ajaxurl, { - pointer: pointer.pointer_id, - action: 'wpws_dismiss_wp_pointer' - }) - - // open next pointer if available - open_pointer(i + 1) - } - }) - - // open the pointer - const pp = $(pointer.target).first().pointer(options) - $('html, body').animate({ // scroll page to pointer - scrollTop: pp.offset().top - 30 - }, 300, function () { // when scroll complete - let $widget = pp.pointer('widget') - pp.pointer('open') - }) - } - } - - // open the first pointer - open_pointer(0) -}) diff --git a/assets/js/admin/settings.js b/assets/js/admin/settings.js old mode 100644 new mode 100755 diff --git a/composer.json b/composer.json old mode 100644 new mode 100755 index 068a02c..4dedfb6 --- a/composer.json +++ b/composer.json @@ -14,8 +14,7 @@ } ], "require": { - "php": ">=7.0", - "wpwhitesecurity/select2-wpwhitesecurity": "v1.0.1" + "php": ">=7.0" }, "autoload": { "psr-4": { diff --git a/config/webpack.config.common.js b/config/webpack.config.common.js old mode 100644 new mode 100755 diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js old mode 100644 new mode 100755 diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js old mode 100644 new mode 100755 diff --git a/config/webpack.settings.js b/config/webpack.settings.js old mode 100644 new mode 100755 diff --git a/gulpfile.babel.js b/gulpfile.babel.js old mode 100644 new mode 100755 diff --git a/includes/classes/.gitkeep b/includes/classes/.gitkeep old mode 100644 new mode 100755 diff --git a/includes/classes/class-notices.php b/includes/classes/class-notices.php old mode 100644 new mode 100755 diff --git a/includes/classes/class-pointer-manager.php b/includes/classes/class-pointer-manager.php deleted file mode 100644 index 6872a3c..0000000 --- a/includes/classes/class-pointer-manager.php +++ /dev/null @@ -1,184 +0,0 @@ - $pointer ) { - - // Don't display if already dismissed. - if ( self::is_dismissed( $pointer_id ) ) { - return; - } - - $pointer['pointer_id'] = $pointer['id']; - unset( $pointer['id'] ); - - // Add the pointer to $valid_pointers array. - $valid_pointers[] = $pointer; - } - - // No valid pointers? Stop here. - if ( empty( $valid_pointers ) ) { - return; - } - - // Add pointers style to queue. - \wp_enqueue_style( 'wp-pointer' ); - - // Add pointers script to queue. Add custom script. - $script_handle = self::$plugin_prefix . '_pointer'; - \wp_enqueue_script( - $script_handle, - script_url( 'pointer', 'admin' ), - array( 'wp-pointer' ), - ADMIN_NOTICES_MANAGER_VERSION, - true - ); - - // Add pointer options to script. - \wp_localize_script( $script_handle, 'wpws_pointers', $valid_pointers ); - } - } -} diff --git a/includes/classes/class-pointer.php b/includes/classes/class-pointer.php deleted file mode 100644 index 4b339f3..0000000 --- a/includes/classes/class-pointer.php +++ /dev/null @@ -1,80 +0,0 @@ - $initial_prompt_pointer_id, - 'target' => '#wp-admin-bar-anm_notification_count', - 'options' => array( - 'content' => sprintf( - '

%s

%s

', - esc_html__( 'Admin Notices Manager', 'admin-notices-manager' ), - esc_html__( 'From now onward, all the admin notices will be displayed here.', 'admin-notices-manager' ) - ), - 'position' => array( - 'edge' => 'top', - 'align' => 'center', - ), - 'pointerClass' => 'wp-pointer anm-pointer', - ), - ) - ); - - Pointers_Manager::add_pointer( - array( - 'id' => 'anm_settings_prompt', - 'target' => '#menu-settings', - 'options' => array( - 'content' => sprintf( - '

%s

%s

', - esc_html__( 'Configure the Admin Notices Manager', 'admin-notices-manager' ), - esc_html__( 'Configure how the plugin handles different types of admin notices from the Settings > Admin Notices menu item.', 'admin-notices-manager' ) - ), - 'position' => array( - 'edge' => 'left', - 'align' => 'center', - ), - ), - ) - ); - } - } -} diff --git a/includes/classes/class-pointers.php b/includes/classes/class-pointers.php new file mode 100755 index 0000000..0c95ab7 --- /dev/null +++ b/includes/classes/class-pointers.php @@ -0,0 +1,187 @@ + + + esc_html__( 'Visibility', 'admin-notices-manager' ), 'type' => 'radio', 'custom' => true, - 'callback' => array( $this, 'render_user_visibility_field' ), + 'callback' => array( __CLASS__, 'render_user_visibility_field' ), 'value' => array_key_exists( 'user-visibility', $options ) ? $options['user-visibility'] : 'all', 'choices' => array( 'all' => esc_html__( 'Hide notifications from all users', 'admin-notices-manager' ), @@ -152,7 +162,7 @@ public function __construct() { 'type' => 'text', 'value' => '', 'custom' => true, - 'callback' => array( $this, 'render_purge_field' ), + 'callback' => array( __CLASS__, 'render_purge_field' ), 'text' => '', 'sanitize' => false, ), @@ -240,8 +250,8 @@ public static function notice_hiding_allowed_for_current_user() { * * phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped */ - public function render_user_visibility_field( $field, $page_key = '', $section_key = '', $field_key = '', $option_pages = '' ) { - if ( ! class_exists( '\S24WP' ) ) { + public static function render_user_visibility_field( $field, $page_key = '', $section_key = '', $field_key = '', $option_pages = '' ) { + if ( ! class_exists( Select2_WPWS::class, false ) ) { return; } @@ -253,8 +263,8 @@ public function render_user_visibility_field( $field, $page_key = '', $section_k $counter = 0; foreach ( $field['choices'] as $value => $label ) { $checked = 0 === strlen( $value ) || $value === $field['value']; - if ( isset( $this->options[ $field['id'] ] ) ) { - $checked = $value === $this->options[ $field['id'] ]; + if ( isset( self::$options[ $field['id'] ] ) ) { + $checked = $value === self::$options[ $field['id'] ]; } if ( is_null( $field['value'] ) && 'all' === $value ) { @@ -280,8 +290,8 @@ public function render_user_visibility_field( $field, $page_key = '', $section_k } if ( 'hide-for-selected' === $value ) { - \S24WP::insert( - $this->build_user_select_params( + Select2_WPWS::insert( + self::build_user_select_params( $options, $field_name, $field, @@ -290,8 +300,8 @@ public function render_user_visibility_field( $field, $page_key = '', $section_k ) ); } elseif ( 'show-for-selected' === $value ) { - \S24WP::insert( - $this->build_user_select_params( + Select2_WPWS::insert( + self::build_user_select_params( $options, $field_name, $field, @@ -320,7 +330,7 @@ public function render_user_visibility_field( $field, $page_key = '', $section_k * * phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped */ - public function render_purge_field( $field, $page_key, $section_key, $field_key, $option_pages ) { + public static function render_purge_field( $field, $page_key, $section_key, $field_key, $option_pages ) { $nonce = wp_create_nonce( 'anm_purgce_notices_nonce' ); echo '' . esc_html__( 'Reset', 'admin-notices-manager' ) . ' ' . esc_html__( 'Notices restored', 'admin-notices-manager' ) . ''; } @@ -338,7 +348,7 @@ public function render_purge_field( $field, $page_key, $section_key, $field_key, * * @since latest. */ - private function build_user_select_params( $options, $field_name, $field, $checked, $option_value ) { + private static function build_user_select_params( $options, $field_name, $field, $checked, $option_value ) { $result = array( 'placeholder' => esc_html__( 'select user(s)', 'admin-notices-manager' ), 'name' => $field_name . '[' . $option_value . '][]', diff --git a/includes/classes/vendor/Select2/assets/css/select2.min.css b/includes/classes/vendor/Select2/assets/css/select2.min.css new file mode 100755 index 0000000..7c18ad5 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/css/select2.min.css @@ -0,0 +1 @@ +.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px;padding:1px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb} diff --git a/includes/classes/vendor/Select2/assets/css/wp-overrides.css b/includes/classes/vendor/Select2/assets/css/wp-overrides.css new file mode 100755 index 0000000..107b626 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/css/wp-overrides.css @@ -0,0 +1,47 @@ +.select2-container--default .select2-selection.s24wp-wrapper .select2-selection__rendered { + padding: 5px 4px 0 5px !important; + display: block !important; +} + +.select2-container--default .select2-selection.s24wp-wrapper .select2-selection__choice { + margin-top: 0 !important; + margin-bottom: 4px !important; + padding: 5px 5px 5px 23px !important; + position: relative !important; +} + +.select2-container--default .select2-selection.s24wp-wrapper .select2-search--inline:not(:only-child) { + margin-bottom: 0px !important; + margin-top: -4px !important; +} + +.select2-container--default .select2-selection.s24wp-wrapper .select2-search--inline:only-child { + margin-top: 0 !important; + margin-bottom: 4px !important; +} + +.select2-container--default .select2-selection.s24wp-wrapper .select2-search--inline:only-child .select2-search__field { + margin-top: 0 !important; +} + +.select2-container--default .select2-selection.s24wp-wrapper .select2-selection__choice__remove { + background-color: transparent !important; + border: none !important; + border-right: 1px solid #aaa !important; + border-top-left-radius: 4px !important; + border-bottom-left-radius: 4px !important; + color: #999 !important; + cursor: pointer !important; + font-size: 1em !important; + font-weight: 700 !important; + padding: 5px 4px !important; + position: absolute !important; + left: 0 !important; + top: 0 !important; +} + +.select2-container--default .select2-selection.s24wp-wrapper .select2-selection__choice__remove:hover { + background-color: #f1f1f1 !important; + color: #333 !important; + outline: none !important; +} diff --git a/includes/classes/vendor/Select2/assets/js/i18n/af.js b/includes/classes/vendor/Select2/assets/js/i18n/af.js new file mode 100755 index 0000000..32e5ac7 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/af.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/af",[],function(){return{errorLoading:function(){return"Die resultate kon nie gelaai word nie."},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Verwyders asseblief "+n+" character";return 1!=n&&(r+="s"),r},inputTooShort:function(e){return"Voer asseblief "+(e.minimum-e.input.length)+" of meer karakters"},loadingMore:function(){return"Meer resultate word gelaai…"},maximumSelected:function(e){var n="Kies asseblief net "+e.maximum+" item";return 1!=e.maximum&&(n+="s"),n},noResults:function(){return"Geen resultate gevind"},searching:function(){return"Besig…"},removeAllItems:function(){return"Verwyder alle items"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/ar.js b/includes/classes/vendor/Select2/assets/js/i18n/ar.js new file mode 100755 index 0000000..64e1caa --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/ar.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ar",[],function(){return{errorLoading:function(){return"لا يمكن تحميل النتائج"},inputTooLong:function(n){return"الرجاء حذف "+(n.input.length-n.maximum)+" عناصر"},inputTooShort:function(n){return"الرجاء إضافة "+(n.minimum-n.input.length)+" عناصر"},loadingMore:function(){return"جاري تحميل نتائج إضافية..."},maximumSelected:function(n){return"تستطيع إختيار "+n.maximum+" بنود فقط"},noResults:function(){return"لم يتم العثور على أي نتائج"},searching:function(){return"جاري البحث…"},removeAllItems:function(){return"قم بإزالة كل العناصر"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/az.js b/includes/classes/vendor/Select2/assets/js/i18n/az.js new file mode 100755 index 0000000..1d52c26 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/az.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/az",[],function(){return{inputTooLong:function(n){return n.input.length-n.maximum+" simvol silin"},inputTooShort:function(n){return n.minimum-n.input.length+" simvol daxil edin"},loadingMore:function(){return"Daha çox nəticə yüklənir…"},maximumSelected:function(n){return"Sadəcə "+n.maximum+" element seçə bilərsiniz"},noResults:function(){return"Nəticə tapılmadı"},searching:function(){return"Axtarılır…"},removeAllItems:function(){return"Bütün elementləri sil"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/bg.js b/includes/classes/vendor/Select2/assets/js/i18n/bg.js new file mode 100755 index 0000000..73b730a --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/bg.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/bg",[],function(){return{inputTooLong:function(n){var e=n.input.length-n.maximum,u="Моля въведете с "+e+" по-малко символ";return e>1&&(u+="a"),u},inputTooShort:function(n){var e=n.minimum-n.input.length,u="Моля въведете още "+e+" символ";return e>1&&(u+="a"),u},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(n){var e="Можете да направите до "+n.maximum+" ";return n.maximum>1?e+="избора":e+="избор",e},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"},removeAllItems:function(){return"Премахнете всички елементи"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/bn.js b/includes/classes/vendor/Select2/assets/js/i18n/bn.js new file mode 100755 index 0000000..2d17b9d --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/bn.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/bn",[],function(){return{errorLoading:function(){return"ফলাফলগুলি লোড করা যায়নি।"},inputTooLong:function(n){var e=n.input.length-n.maximum,u="অনুগ্রহ করে "+e+" টি অক্ষর মুছে দিন।";return 1!=e&&(u="অনুগ্রহ করে "+e+" টি অক্ষর মুছে দিন।"),u},inputTooShort:function(n){return n.minimum-n.input.length+" টি অক্ষর অথবা অধিক অক্ষর লিখুন।"},loadingMore:function(){return"আরো ফলাফল লোড হচ্ছে ..."},maximumSelected:function(n){var e=n.maximum+" টি আইটেম নির্বাচন করতে পারবেন।";return 1!=n.maximum&&(e=n.maximum+" টি আইটেম নির্বাচন করতে পারবেন।"),e},noResults:function(){return"কোন ফলাফল পাওয়া যায়নি।"},searching:function(){return"অনুসন্ধান করা হচ্ছে ..."}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/bs.js b/includes/classes/vendor/Select2/assets/js/i18n/bs.js new file mode 100755 index 0000000..46b084d --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/bs.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/bs",[],function(){function e(e,n,r,t){return e%10==1&&e%100!=11?n:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?r:t}return{errorLoading:function(){return"Preuzimanje nije uspijelo."},inputTooLong:function(n){var r=n.input.length-n.maximum,t="Obrišite "+r+" simbol";return t+=e(r,"","a","a")},inputTooShort:function(n){var r=n.minimum-n.input.length,t="Ukucajte bar još "+r+" simbol";return t+=e(r,"","a","a")},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(n){var r="Možete izabrati samo "+n.maximum+" stavk";return r+=e(n.maximum,"u","e","i")},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"},removeAllItems:function(){return"Uklonite sve stavke"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/build.txt b/includes/classes/vendor/Select2/assets/js/i18n/build.txt new file mode 100755 index 0000000..8f319f2 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/build.txt @@ -0,0 +1,236 @@ + +af.js +---------------- +af.js + +ar.js +---------------- +ar.js + +az.js +---------------- +az.js + +bg.js +---------------- +bg.js + +bn.js +---------------- +bn.js + +bs.js +---------------- +bs.js + +ca.js +---------------- +ca.js + +cs.js +---------------- +cs.js + +da.js +---------------- +da.js + +de.js +---------------- +de.js + +dsb.js +---------------- +dsb.js + +el.js +---------------- +el.js + +en.js +---------------- +en.js + +es.js +---------------- +es.js + +et.js +---------------- +et.js + +eu.js +---------------- +eu.js + +fa.js +---------------- +fa.js + +fi.js +---------------- +fi.js + +fr.js +---------------- +fr.js + +gl.js +---------------- +gl.js + +he.js +---------------- +he.js + +hi.js +---------------- +hi.js + +hr.js +---------------- +hr.js + +hsb.js +---------------- +hsb.js + +hu.js +---------------- +hu.js + +hy.js +---------------- +hy.js + +id.js +---------------- +id.js + +is.js +---------------- +is.js + +it.js +---------------- +it.js + +ja.js +---------------- +ja.js + +ka.js +---------------- +ka.js + +km.js +---------------- +km.js + +ko.js +---------------- +ko.js + +lt.js +---------------- +lt.js + +lv.js +---------------- +lv.js + +mk.js +---------------- +mk.js + +ms.js +---------------- +ms.js + +nb.js +---------------- +nb.js + +ne.js +---------------- +ne.js + +nl.js +---------------- +nl.js + +pl.js +---------------- +pl.js + +ps.js +---------------- +ps.js + +pt-BR.js +---------------- +pt-BR.js + +pt.js +---------------- +pt.js + +ro.js +---------------- +ro.js + +ru.js +---------------- +ru.js + +sk.js +---------------- +sk.js + +sl.js +---------------- +sl.js + +sq.js +---------------- +sq.js + +sr-Cyrl.js +---------------- +sr-Cyrl.js + +sr.js +---------------- +sr.js + +sv.js +---------------- +sv.js + +th.js +---------------- +th.js + +tk.js +---------------- +tk.js + +tr.js +---------------- +tr.js + +uk.js +---------------- +uk.js + +vi.js +---------------- +vi.js + +zh-CN.js +---------------- +zh-CN.js + +zh-TW.js +---------------- +zh-TW.js diff --git a/includes/classes/vendor/Select2/assets/js/i18n/ca.js b/includes/classes/vendor/Select2/assets/js/i18n/ca.js new file mode 100755 index 0000000..82dbbb7 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/ca.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Si us plau, elimina "+n+" car";return r+=1==n?"àcter":"àcters"},inputTooShort:function(e){var n=e.minimum-e.input.length,r="Si us plau, introdueix "+n+" car";return r+=1==n?"àcter":"àcters"},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var n="Només es pot seleccionar "+e.maximum+" element";return 1!=e.maximum&&(n+="s"),n},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"},removeAllItems:function(){return"Treu tots els elements"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/cs.js b/includes/classes/vendor/Select2/assets/js/i18n/cs.js new file mode 100755 index 0000000..7116d6c --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/cs.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/cs",[],function(){function e(e,n){switch(e){case 2:return n?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(n){var t=n.input.length-n.maximum;return 1==t?"Prosím, zadejte o jeden znak méně.":t<=4?"Prosím, zadejte o "+e(t,!0)+" znaky méně.":"Prosím, zadejte o "+t+" znaků méně."},inputTooShort:function(n){var t=n.minimum-n.input.length;return 1==t?"Prosím, zadejte ještě jeden znak.":t<=4?"Prosím, zadejte ještě další "+e(t,!0)+" znaky.":"Prosím, zadejte ještě dalších "+t+" znaků."},loadingMore:function(){return"Načítají se další výsledky…"},maximumSelected:function(n){var t=n.maximum;return 1==t?"Můžete zvolit jen jednu položku.":t<=4?"Můžete zvolit maximálně "+e(t,!1)+" položky.":"Můžete zvolit maximálně "+t+" položek."},noResults:function(){return"Nenalezeny žádné položky."},searching:function(){return"Vyhledávání…"},removeAllItems:function(){return"Odstraňte všechny položky"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/da.js b/includes/classes/vendor/Select2/assets/js/i18n/da.js new file mode 100755 index 0000000..cda32c3 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/da.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){return"Angiv venligst "+(e.input.length-e.maximum)+" tegn mindre"},inputTooShort:function(e){return"Angiv venligst "+(e.minimum-e.input.length)+" tegn mere"},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var n="Du kan kun vælge "+e.maximum+" emne";return 1!=e.maximum&&(n+="r"),n},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"},removeAllItems:function(){return"Fjern alle elementer"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/de.js b/includes/classes/vendor/Select2/assets/js/i18n/de.js new file mode 100755 index 0000000..c2e61e5 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/de.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/de",[],function(){return{errorLoading:function(){return"Die Ergebnisse konnten nicht geladen werden."},inputTooLong:function(e){return"Bitte "+(e.input.length-e.maximum)+" Zeichen weniger eingeben"},inputTooShort:function(e){return"Bitte "+(e.minimum-e.input.length)+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var n="Sie können nur "+e.maximum+" Element";return 1!=e.maximum&&(n+="e"),n+=" auswählen"},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"},removeAllItems:function(){return"Entferne alle Elemente"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/dsb.js b/includes/classes/vendor/Select2/assets/js/i18n/dsb.js new file mode 100755 index 0000000..02f283a --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/dsb.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/dsb",[],function(){var n=["znamuško","znamušce","znamuška","znamuškow"],e=["zapisk","zapiska","zapiski","zapiskow"],u=function(n,e){return 1===n?e[0]:2===n?e[1]:n>2&&n<=4?e[2]:n>=5?e[3]:void 0};return{errorLoading:function(){return"Wuslědki njejsu se dali zacytaś."},inputTooLong:function(e){var a=e.input.length-e.maximum;return"Pšosym lašuj "+a+" "+u(a,n)},inputTooShort:function(e){var a=e.minimum-e.input.length;return"Pšosym zapódaj nanejmjenjej "+a+" "+u(a,n)},loadingMore:function(){return"Dalšne wuslědki se zacytaju…"},maximumSelected:function(n){return"Móžoš jano "+n.maximum+" "+u(n.maximum,e)+"wubraś."},noResults:function(){return"Žedne wuslědki namakane"},searching:function(){return"Pyta se…"},removeAllItems:function(){return"Remove all items"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/el.js b/includes/classes/vendor/Select2/assets/js/i18n/el.js new file mode 100755 index 0000000..d4922a1 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/el.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/el",[],function(){return{errorLoading:function(){return"Τα αποτελέσματα δεν μπόρεσαν να φορτώσουν."},inputTooLong:function(n){var e=n.input.length-n.maximum,u="Παρακαλώ διαγράψτε "+e+" χαρακτήρ";return 1==e&&(u+="α"),1!=e&&(u+="ες"),u},inputTooShort:function(n){return"Παρακαλώ συμπληρώστε "+(n.minimum-n.input.length)+" ή περισσότερους χαρακτήρες"},loadingMore:function(){return"Φόρτωση περισσότερων αποτελεσμάτων…"},maximumSelected:function(n){var e="Μπορείτε να επιλέξετε μόνο "+n.maximum+" επιλογ";return 1==n.maximum&&(e+="ή"),1!=n.maximum&&(e+="ές"),e},noResults:function(){return"Δεν βρέθηκαν αποτελέσματα"},searching:function(){return"Αναζήτηση…"},removeAllItems:function(){return"Καταργήστε όλα τα στοιχεία"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/en.js b/includes/classes/vendor/Select2/assets/js/i18n/en.js new file mode 100755 index 0000000..3b19285 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/en.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Please delete "+n+" character";return 1!=n&&(r+="s"),r},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var n="You can only select "+e.maximum+" item";return 1!=e.maximum&&(n+="s"),n},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/es.js b/includes/classes/vendor/Select2/assets/js/i18n/es.js new file mode 100755 index 0000000..68afd6d --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/es.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"No se pudieron cargar los resultados"},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Por favor, elimine "+n+" car";return r+=1==n?"ácter":"acteres"},inputTooShort:function(e){var n=e.minimum-e.input.length,r="Por favor, introduzca "+n+" car";return r+=1==n?"ácter":"acteres"},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var n="Sólo puede seleccionar "+e.maximum+" elemento";return 1!=e.maximum&&(n+="s"),n},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Eliminar todos los elementos"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/et.js b/includes/classes/vendor/Select2/assets/js/i18n/et.js new file mode 100755 index 0000000..070b61a --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/et.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var n=e.input.length-e.maximum,t="Sisesta "+n+" täht";return 1!=n&&(t+="e"),t+=" vähem"},inputTooShort:function(e){var n=e.minimum-e.input.length,t="Sisesta "+n+" täht";return 1!=n&&(t+="e"),t+=" rohkem"},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var n="Saad vaid "+e.maximum+" tulemus";return 1==e.maximum?n+="e":n+="t",n+=" valida"},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"},removeAllItems:function(){return"Eemalda kõik esemed"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/eu.js b/includes/classes/vendor/Select2/assets/js/i18n/eu.js new file mode 100755 index 0000000..90d5e73 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/eu.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return n+=1==t?"karaktere bat":t+" karaktere",n+=" gutxiago"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return n+=1==t?"karaktere bat":t+" karaktere",n+=" gehiago"},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return 1===e.maximum?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"},removeAllItems:function(){return"Kendu elementu guztiak"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/fa.js b/includes/classes/vendor/Select2/assets/js/i18n/fa.js new file mode 100755 index 0000000..e1ffdbe --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/fa.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(n){return"لطفاً "+(n.input.length-n.maximum)+" کاراکتر را حذف نمایید"},inputTooShort:function(n){return"لطفاً تعداد "+(n.minimum-n.input.length)+" کاراکتر یا بیشتر وارد نمایید"},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(n){return"شما تنها می‌توانید "+n.maximum+" آیتم را انتخاب نمایید"},noResults:function(){return"هیچ نتیجه‌ای یافت نشد"},searching:function(){return"در حال جستجو..."},removeAllItems:function(){return"همه موارد را حذف کنید"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/fi.js b/includes/classes/vendor/Select2/assets/js/i18n/fi.js new file mode 100755 index 0000000..ffed124 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/fi.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/fi",[],function(){return{errorLoading:function(){return"Tuloksia ei saatu ladattua."},inputTooLong:function(n){return"Ole hyvä ja anna "+(n.input.length-n.maximum)+" merkkiä vähemmän"},inputTooShort:function(n){return"Ole hyvä ja anna "+(n.minimum-n.input.length)+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(n){return"Voit valita ainoastaan "+n.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){return"Haetaan…"},removeAllItems:function(){return"Poista kaikki kohteet"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/fr.js b/includes/classes/vendor/Select2/assets/js/i18n/fr.js new file mode 100755 index 0000000..dd02f97 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/fr.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(e){var n=e.input.length-e.maximum;return"Supprimez "+n+" caractère"+(n>1?"s":"")},inputTooShort:function(e){var n=e.minimum-e.input.length;return"Saisissez au moins "+n+" caractère"+(n>1?"s":"")},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){return"Vous pouvez seulement sélectionner "+e.maximum+" élément"+(e.maximum>1?"s":"")},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"},removeAllItems:function(){return"Supprimer tous les éléments"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/gl.js b/includes/classes/vendor/Select2/assets/js/i18n/gl.js new file mode 100755 index 0000000..208a005 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/gl.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/gl",[],function(){return{errorLoading:function(){return"Non foi posíbel cargar os resultados."},inputTooLong:function(e){var n=e.input.length-e.maximum;return 1===n?"Elimine un carácter":"Elimine "+n+" caracteres"},inputTooShort:function(e){var n=e.minimum-e.input.length;return 1===n?"Engada un carácter":"Engada "+n+" caracteres"},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){return 1===e.maximum?"Só pode seleccionar un elemento":"Só pode seleccionar "+e.maximum+" elementos"},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Elimina todos os elementos"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/he.js b/includes/classes/vendor/Select2/assets/js/i18n/he.js new file mode 100755 index 0000000..25a8805 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/he.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"שגיאה בטעינת התוצאות"},inputTooLong:function(n){var e=n.input.length-n.maximum,r="נא למחוק ";return r+=1===e?"תו אחד":e+" תווים"},inputTooShort:function(n){var e=n.minimum-n.input.length,r="נא להכניס ";return r+=1===e?"תו אחד":e+" תווים",r+=" או יותר"},loadingMore:function(){return"טוען תוצאות נוספות…"},maximumSelected:function(n){var e="באפשרותך לבחור עד ";return 1===n.maximum?e+="פריט אחד":e+=n.maximum+" פריטים",e},noResults:function(){return"לא נמצאו תוצאות"},searching:function(){return"מחפש…"},removeAllItems:function(){return"הסר את כל הפריטים"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/hi.js b/includes/classes/vendor/Select2/assets/js/i18n/hi.js new file mode 100755 index 0000000..f3ed798 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/hi.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(n){var e=n.input.length-n.maximum,r=e+" अक्षर को हटा दें";return e>1&&(r=e+" अक्षरों को हटा दें "),r},inputTooShort:function(n){return"कृपया "+(n.minimum-n.input.length)+" या अधिक अक्षर दर्ज करें"},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(n){return"आप केवल "+n.maximum+" आइटम का चयन कर सकते हैं"},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."},removeAllItems:function(){return"सभी वस्तुओं को हटा दें"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/hr.js b/includes/classes/vendor/Select2/assets/js/i18n/hr.js new file mode 100755 index 0000000..cb3268d --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/hr.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/hr",[],function(){function n(n){var e=" "+n+" znak";return n%10<5&&n%10>0&&(n%100<5||n%100>19)?n%10>1&&(e+="a"):e+="ova",e}return{errorLoading:function(){return"Preuzimanje nije uspjelo."},inputTooLong:function(e){return"Unesite "+n(e.input.length-e.maximum)},inputTooShort:function(e){return"Unesite još "+n(e.minimum-e.input.length)},loadingMore:function(){return"Učitavanje rezultata…"},maximumSelected:function(n){return"Maksimalan broj odabranih stavki je "+n.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"},removeAllItems:function(){return"Ukloni sve stavke"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/hsb.js b/includes/classes/vendor/Select2/assets/js/i18n/hsb.js new file mode 100755 index 0000000..3d5bf09 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/hsb.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/hsb",[],function(){var n=["znamješko","znamješce","znamješka","znamješkow"],e=["zapisk","zapiskaj","zapiski","zapiskow"],u=function(n,e){return 1===n?e[0]:2===n?e[1]:n>2&&n<=4?e[2]:n>=5?e[3]:void 0};return{errorLoading:function(){return"Wuslědki njedachu so začitać."},inputTooLong:function(e){var a=e.input.length-e.maximum;return"Prošu zhašej "+a+" "+u(a,n)},inputTooShort:function(e){var a=e.minimum-e.input.length;return"Prošu zapodaj znajmjeńša "+a+" "+u(a,n)},loadingMore:function(){return"Dalše wuslědki so začitaja…"},maximumSelected:function(n){return"Móžeš jenož "+n.maximum+" "+u(n.maximum,e)+"wubrać"},noResults:function(){return"Žane wuslědki namakane"},searching:function(){return"Pyta so…"},removeAllItems:function(){return"Remove all items"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/hu.js b/includes/classes/vendor/Select2/assets/js/i18n/hu.js new file mode 100755 index 0000000..4893aa2 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/hu.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/hu",[],function(){return{errorLoading:function(){return"Az eredmények betöltése nem sikerült."},inputTooLong:function(e){return"Túl hosszú. "+(e.input.length-e.maximum)+" karakterrel több, mint kellene."},inputTooShort:function(e){return"Túl rövid. Még "+(e.minimum-e.input.length)+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"},removeAllItems:function(){return"Távolítson el minden elemet"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/hy.js b/includes/classes/vendor/Select2/assets/js/i18n/hy.js new file mode 100755 index 0000000..8230007 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/hy.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/hy",[],function(){return{errorLoading:function(){return"Արդյունքները հնարավոր չէ բեռնել։"},inputTooLong:function(n){return"Խնդրում ենք հեռացնել "+(n.input.length-n.maximum)+" նշան"},inputTooShort:function(n){return"Խնդրում ենք մուտքագրել "+(n.minimum-n.input.length)+" կամ ավել նշաններ"},loadingMore:function(){return"Բեռնվում են նոր արդյունքներ․․․"},maximumSelected:function(n){return"Դուք կարող եք ընտրել առավելագույնը "+n.maximum+" կետ"},noResults:function(){return"Արդյունքներ չեն գտնվել"},searching:function(){return"Որոնում․․․"},removeAllItems:function(){return"Հեռացնել բոլոր տարրերը"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/id.js b/includes/classes/vendor/Select2/assets/js/i18n/id.js new file mode 100755 index 0000000..4a0b3bf --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/id.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(n){return"Hapuskan "+(n.input.length-n.maximum)+" huruf"},inputTooShort:function(n){return"Masukkan "+(n.minimum-n.input.length)+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(n){return"Anda hanya dapat memilih "+n.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"},removeAllItems:function(){return"Hapus semua item"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/is.js b/includes/classes/vendor/Select2/assets/js/i18n/is.js new file mode 100755 index 0000000..cca5bbe --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/is.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/is",[],function(){return{inputTooLong:function(n){var t=n.input.length-n.maximum,e="Vinsamlegast styttið texta um "+t+" staf";return t<=1?e:e+"i"},inputTooShort:function(n){var t=n.minimum-n.input.length,e="Vinsamlegast skrifið "+t+" staf";return t>1&&(e+="i"),e+=" í viðbót"},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(n){return"Þú getur aðeins valið "+n.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"},removeAllItems:function(){return"Fjarlægðu öll atriði"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/it.js b/includes/classes/vendor/Select2/assets/js/i18n/it.js new file mode 100755 index 0000000..507c7d9 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/it.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var n=e.input.length-e.maximum,t="Per favore cancella "+n+" caratter";return t+=1!==n?"i":"e"},inputTooShort:function(e){return"Per favore inserisci "+(e.minimum-e.input.length)+" o più caratteri"},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var n="Puoi selezionare solo "+e.maximum+" element";return 1!==e.maximum?n+="i":n+="o",n},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"},removeAllItems:function(){return"Rimuovi tutti gli oggetti"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/ja.js b/includes/classes/vendor/Select2/assets/js/i18n/ja.js new file mode 100755 index 0000000..451025e --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/ja.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ja",[],function(){return{errorLoading:function(){return"結果が読み込まれませんでした"},inputTooLong:function(n){return n.input.length-n.maximum+" 文字を削除してください"},inputTooShort:function(n){return"少なくとも "+(n.minimum-n.input.length)+" 文字を入力してください"},loadingMore:function(){return"読み込み中…"},maximumSelected:function(n){return n.maximum+" 件しか選択できません"},noResults:function(){return"対象が見つかりません"},searching:function(){return"検索しています…"},removeAllItems:function(){return"すべてのアイテムを削除"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/ka.js b/includes/classes/vendor/Select2/assets/js/i18n/ka.js new file mode 100755 index 0000000..60c593b --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/ka.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ka",[],function(){return{errorLoading:function(){return"მონაცემების ჩატვირთვა შეუძლებელია."},inputTooLong:function(n){return"გთხოვთ აკრიფეთ "+(n.input.length-n.maximum)+" სიმბოლოთი ნაკლები"},inputTooShort:function(n){return"გთხოვთ აკრიფეთ "+(n.minimum-n.input.length)+" სიმბოლო ან მეტი"},loadingMore:function(){return"მონაცემების ჩატვირთვა…"},maximumSelected:function(n){return"თქვენ შეგიძლიათ აირჩიოთ არაუმეტეს "+n.maximum+" ელემენტი"},noResults:function(){return"რეზულტატი არ მოიძებნა"},searching:function(){return"ძიება…"},removeAllItems:function(){return"ამოიღე ყველა ელემენტი"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/km.js b/includes/classes/vendor/Select2/assets/js/i18n/km.js new file mode 100755 index 0000000..4dca94f --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/km.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/km",[],function(){return{errorLoading:function(){return"មិនអាចទាញយកទិន្នន័យ"},inputTooLong:function(n){return"សូមលុបចេញ "+(n.input.length-n.maximum)+" អក្សរ"},inputTooShort:function(n){return"សូមបញ្ចូល"+(n.minimum-n.input.length)+" អក្សរ រឺ ច្រើនជាងនេះ"},loadingMore:function(){return"កំពុងទាញយកទិន្នន័យបន្ថែម..."},maximumSelected:function(n){return"អ្នកអាចជ្រើសរើសបានតែ "+n.maximum+" ជម្រើសប៉ុណ្ណោះ"},noResults:function(){return"មិនមានលទ្ធផល"},searching:function(){return"កំពុងស្វែងរក..."},removeAllItems:function(){return"លុបធាតុទាំងអស់"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/ko.js b/includes/classes/vendor/Select2/assets/js/i18n/ko.js new file mode 100755 index 0000000..f2880fb --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/ko.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(n){return"너무 깁니다. "+(n.input.length-n.maximum)+" 글자 지워주세요."},inputTooShort:function(n){return"너무 짧습니다. "+(n.minimum-n.input.length)+" 글자 더 입력해주세요."},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(n){return"최대 "+n.maximum+"개까지만 선택 가능합니다."},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"},removeAllItems:function(){return"모든 항목 삭제"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/lt.js b/includes/classes/vendor/Select2/assets/js/i18n/lt.js new file mode 100755 index 0000000..f6a4215 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/lt.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/lt",[],function(){function n(n,e,i,t){return n%10==1&&(n%100<11||n%100>19)?e:n%10>=2&&n%10<=9&&(n%100<11||n%100>19)?i:t}return{inputTooLong:function(e){var i=e.input.length-e.maximum,t="Pašalinkite "+i+" simbol";return t+=n(i,"į","ius","ių")},inputTooShort:function(e){var i=e.minimum-e.input.length,t="Įrašykite dar "+i+" simbol";return t+=n(i,"į","ius","ių")},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(e){var i="Jūs galite pasirinkti tik "+e.maximum+" element";return i+=n(e.maximum,"ą","us","ų")},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"Ieškoma…"},removeAllItems:function(){return"Pašalinti visus elementus"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/lv.js b/includes/classes/vendor/Select2/assets/js/i18n/lv.js new file mode 100755 index 0000000..806dc5c --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/lv.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/lv",[],function(){function e(e,n,u,i){return 11===e?n:e%10==1?u:i}return{inputTooLong:function(n){var u=n.input.length-n.maximum,i="Lūdzu ievadiet par "+u;return(i+=" simbol"+e(u,"iem","u","iem"))+" mazāk"},inputTooShort:function(n){var u=n.minimum-n.input.length,i="Lūdzu ievadiet vēl "+u;return i+=" simbol"+e(u,"us","u","us")},loadingMore:function(){return"Datu ielāde…"},maximumSelected:function(n){var u="Jūs varat izvēlēties ne vairāk kā "+n.maximum;return u+=" element"+e(n.maximum,"us","u","us")},noResults:function(){return"Sakritību nav"},searching:function(){return"Meklēšana…"},removeAllItems:function(){return"Noņemt visus vienumus"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/mk.js b/includes/classes/vendor/Select2/assets/js/i18n/mk.js new file mode 100755 index 0000000..cb7b84a --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/mk.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/mk",[],function(){return{inputTooLong:function(n){var e=(n.input.length,n.maximum,"Ве молиме внесете "+n.maximum+" помалку карактер");return 1!==n.maximum&&(e+="и"),e},inputTooShort:function(n){var e=(n.minimum,n.input.length,"Ве молиме внесете уште "+n.maximum+" карактер");return 1!==n.maximum&&(e+="и"),e},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(n){var e="Можете да изберете само "+n.maximum+" ставк";return 1===n.maximum?e+="а":e+="и",e},noResults:function(){return"Нема пронајдено совпаѓања"},searching:function(){return"Пребарување…"},removeAllItems:function(){return"Отстрани ги сите предмети"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/ms.js b/includes/classes/vendor/Select2/assets/js/i18n/ms.js new file mode 100755 index 0000000..6bd7eaa --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/ms.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong:function(n){return"Sila hapuskan "+(n.input.length-n.maximum)+" aksara"},inputTooShort:function(n){return"Sila masukkan "+(n.minimum-n.input.length)+" atau lebih aksara"},loadingMore:function(){return"Sedang memuatkan keputusan…"},maximumSelected:function(n){return"Anda hanya boleh memilih "+n.maximum+" pilihan"},noResults:function(){return"Tiada padanan yang ditemui"},searching:function(){return"Mencari…"},removeAllItems:function(){return"Keluarkan semua item"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/nb.js b/includes/classes/vendor/Select2/assets/js/i18n/nb.js new file mode 100755 index 0000000..25d89c6 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/nb.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/nb",[],function(){return{errorLoading:function(){return"Kunne ikke hente resultater."},inputTooLong:function(e){return"Vennligst fjern "+(e.input.length-e.maximum)+" tegn"},inputTooShort:function(e){return"Vennligst skriv inn "+(e.minimum-e.input.length)+" tegn til"},loadingMore:function(){return"Laster flere resultater…"},maximumSelected:function(e){return"Du kan velge maks "+e.maximum+" elementer"},noResults:function(){return"Ingen treff"},searching:function(){return"Søker…"},removeAllItems:function(){return"Fjern alle elementer"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/ne.js b/includes/classes/vendor/Select2/assets/js/i18n/ne.js new file mode 100755 index 0000000..1c39f67 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/ne.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ne",[],function(){return{errorLoading:function(){return"नतिजाहरु देखाउन सकिएन।"},inputTooLong:function(n){var e=n.input.length-n.maximum,u="कृपया "+e+" अक्षर मेटाउनुहोस्।";return 1!=e&&(u+="कृपया "+e+" अक्षरहरु मेटाउनुहोस्।"),u},inputTooShort:function(n){return"कृपया बाँकी रहेका "+(n.minimum-n.input.length)+" वा अरु धेरै अक्षरहरु भर्नुहोस्।"},loadingMore:function(){return"अरु नतिजाहरु भरिँदैछन् …"},maximumSelected:function(n){var e="तँपाई "+n.maximum+" वस्तु मात्र छान्न पाउँनुहुन्छ।";return 1!=n.maximum&&(e="तँपाई "+n.maximum+" वस्तुहरु मात्र छान्न पाउँनुहुन्छ।"),e},noResults:function(){return"कुनै पनि नतिजा भेटिएन।"},searching:function(){return"खोजि हुँदैछ…"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/nl.js b/includes/classes/vendor/Select2/assets/js/i18n/nl.js new file mode 100755 index 0000000..2b74058 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/nl.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(e){return"Gelieve "+(e.input.length-e.maximum)+" karakters te verwijderen"},inputTooShort:function(e){return"Gelieve "+(e.minimum-e.input.length)+" of meer karakters in te voeren"},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(e){var n=1==e.maximum?"kan":"kunnen",r="Er "+n+" maar "+e.maximum+" item";return 1!=e.maximum&&(r+="s"),r+=" worden geselecteerd"},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"},removeAllItems:function(){return"Verwijder alle items"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/pl.js b/includes/classes/vendor/Select2/assets/js/i18n/pl.js new file mode 100755 index 0000000..4ca5748 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/pl.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/pl",[],function(){var n=["znak","znaki","znaków"],e=["element","elementy","elementów"],r=function(n,e){return 1===n?e[0]:n>1&&n<=4?e[1]:n>=5?e[2]:void 0};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Usuń "+t+" "+r(t,n)},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Podaj przynajmniej "+t+" "+r(t,n)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(n){return"Możesz zaznaczyć tylko "+n.maximum+" "+r(n.maximum,e)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"},removeAllItems:function(){return"Usuń wszystkie przedmioty"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/ps.js b/includes/classes/vendor/Select2/assets/js/i18n/ps.js new file mode 100755 index 0000000..9b008e4 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/ps.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ps",[],function(){return{errorLoading:function(){return"پايلي نه سي ترلاسه کېدای"},inputTooLong:function(n){var e=n.input.length-n.maximum,r="د مهربانۍ لمخي "+e+" توری ړنګ کړئ";return 1!=e&&(r=r.replace("توری","توري")),r},inputTooShort:function(n){return"لږ تر لږه "+(n.minimum-n.input.length)+" يا ډېر توري وليکئ"},loadingMore:function(){return"نوري پايلي ترلاسه کيږي..."},maximumSelected:function(n){var e="تاسو يوازي "+n.maximum+" قلم په نښه کولای سی";return 1!=n.maximum&&(e=e.replace("قلم","قلمونه")),e},noResults:function(){return"پايلي و نه موندل سوې"},searching:function(){return"لټول کيږي..."},removeAllItems:function(){return"ټول توکي لرې کړئ"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/pt-BR.js b/includes/classes/vendor/Select2/assets/js/i18n/pt-BR.js new file mode 100755 index 0000000..c991e25 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/pt-BR.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Apague "+n+" caracter";return 1!=n&&(r+="es"),r},inputTooShort:function(e){return"Digite "+(e.minimum-e.input.length)+" ou mais caracteres"},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var n="Você só pode selecionar "+e.maximum+" ite";return 1==e.maximum?n+="m":n+="ns",n},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Remover todos os itens"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/pt.js b/includes/classes/vendor/Select2/assets/js/i18n/pt.js new file mode 100755 index 0000000..b5da1a6 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/pt.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var r=e.input.length-e.maximum,n="Por favor apague "+r+" ";return n+=1!=r?"caracteres":"caractere"},inputTooShort:function(e){return"Introduza "+(e.minimum-e.input.length)+" ou mais caracteres"},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var r="Apenas pode seleccionar "+e.maximum+" ";return r+=1!=e.maximum?"itens":"item"},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"},removeAllItems:function(){return"Remover todos os itens"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/ro.js b/includes/classes/vendor/Select2/assets/js/i18n/ro.js new file mode 100755 index 0000000..1ba7b40 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/ro.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/ro",[],function(){return{errorLoading:function(){return"Rezultatele nu au putut fi incărcate."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vă rugăm să ștergeți"+t+" caracter";return 1!==t&&(n+="e"),n},inputTooShort:function(e){return"Vă rugăm să introduceți "+(e.minimum-e.input.length)+" sau mai multe caractere"},loadingMore:function(){return"Se încarcă mai multe rezultate…"},maximumSelected:function(e){var t="Aveți voie să selectați cel mult "+e.maximum;return t+=" element",1!==e.maximum&&(t+="e"),t},noResults:function(){return"Nu au fost găsite rezultate"},searching:function(){return"Căutare…"},removeAllItems:function(){return"Eliminați toate elementele"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/ru.js b/includes/classes/vendor/Select2/assets/js/i18n/ru.js new file mode 100755 index 0000000..63a7d66 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/ru.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ru",[],function(){function n(n,e,r,u){return n%10<5&&n%10>0&&n%100<5||n%100>20?n%10>1?r:e:u}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(e){var r=e.input.length-e.maximum,u="Пожалуйста, введите на "+r+" символ";return u+=n(r,"","a","ов"),u+=" меньше"},inputTooShort:function(e){var r=e.minimum-e.input.length,u="Пожалуйста, введите ещё хотя бы "+r+" символ";return u+=n(r,"","a","ов")},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(e){var r="Вы можете выбрать не более "+e.maximum+" элемент";return r+=n(e.maximum,"","a","ов")},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"},removeAllItems:function(){return"Удалить все элементы"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/sk.js b/includes/classes/vendor/Select2/assets/js/i18n/sk.js new file mode 100755 index 0000000..5049528 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/sk.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{errorLoading:function(){return"Výsledky sa nepodarilo načítať."},inputTooLong:function(n){var t=n.input.length-n.maximum;return 1==t?"Prosím, zadajte o jeden znak menej":t>=2&&t<=4?"Prosím, zadajte o "+e[t](!0)+" znaky menej":"Prosím, zadajte o "+t+" znakov menej"},inputTooShort:function(n){var t=n.minimum-n.input.length;return 1==t?"Prosím, zadajte ešte jeden znak":t<=4?"Prosím, zadajte ešte ďalšie "+e[t](!0)+" znaky":"Prosím, zadajte ešte ďalších "+t+" znakov"},loadingMore:function(){return"Načítanie ďalších výsledkov…"},maximumSelected:function(n){return 1==n.maximum?"Môžete zvoliť len jednu položku":n.maximum>=2&&n.maximum<=4?"Môžete zvoliť najviac "+e[n.maximum](!1)+" položky":"Môžete zvoliť najviac "+n.maximum+" položiek"},noResults:function(){return"Nenašli sa žiadne položky"},searching:function(){return"Vyhľadávanie…"},removeAllItems:function(){return"Odstráňte všetky položky"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/sl.js b/includes/classes/vendor/Select2/assets/js/i18n/sl.js new file mode 100755 index 0000000..4d0b7d3 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/sl.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/sl",[],function(){return{errorLoading:function(){return"Zadetkov iskanja ni bilo mogoče naložiti."},inputTooLong:function(e){var n=e.input.length-e.maximum,t="Prosim zbrišite "+n+" znak";return 2==n?t+="a":1!=n&&(t+="e"),t},inputTooShort:function(e){var n=e.minimum-e.input.length,t="Prosim vpišite še "+n+" znak";return 2==n?t+="a":1!=n&&(t+="e"),t},loadingMore:function(){return"Nalagam več zadetkov…"},maximumSelected:function(e){var n="Označite lahko največ "+e.maximum+" predmet";return 2==e.maximum?n+="a":1!=e.maximum&&(n+="e"),n},noResults:function(){return"Ni zadetkov."},searching:function(){return"Iščem…"},removeAllItems:function(){return"Odstranite vse elemente"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/sq.js b/includes/classes/vendor/Select2/assets/js/i18n/sq.js new file mode 100755 index 0000000..5916202 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/sq.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/sq",[],function(){return{errorLoading:function(){return"Rezultatet nuk mund të ngarkoheshin."},inputTooLong:function(e){var n=e.input.length-e.maximum,t="Të lutem fshi "+n+" karakter";return 1!=n&&(t+="e"),t},inputTooShort:function(e){return"Të lutem shkruaj "+(e.minimum-e.input.length)+" ose më shumë karaktere"},loadingMore:function(){return"Duke ngarkuar më shumë rezultate…"},maximumSelected:function(e){var n="Mund të zgjedhësh vetëm "+e.maximum+" element";return 1!=e.maximum&&(n+="e"),n},noResults:function(){return"Nuk u gjet asnjë rezultat"},searching:function(){return"Duke kërkuar…"},removeAllItems:function(){return"Hiq të gjitha sendet"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/sr-Cyrl.js b/includes/classes/vendor/Select2/assets/js/i18n/sr-Cyrl.js new file mode 100755 index 0000000..ce13ce8 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/sr-Cyrl.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/sr-Cyrl",[],function(){function n(n,e,r,u){return n%10==1&&n%100!=11?e:n%10>=2&&n%10<=4&&(n%100<12||n%100>14)?r:u}return{errorLoading:function(){return"Преузимање није успело."},inputTooLong:function(e){var r=e.input.length-e.maximum,u="Обришите "+r+" симбол";return u+=n(r,"","а","а")},inputTooShort:function(e){var r=e.minimum-e.input.length,u="Укуцајте бар још "+r+" симбол";return u+=n(r,"","а","а")},loadingMore:function(){return"Преузимање још резултата…"},maximumSelected:function(e){var r="Можете изабрати само "+e.maximum+" ставк";return r+=n(e.maximum,"у","е","и")},noResults:function(){return"Ништа није пронађено"},searching:function(){return"Претрага…"},removeAllItems:function(){return"Уклоните све ставке"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/sr.js b/includes/classes/vendor/Select2/assets/js/i18n/sr.js new file mode 100755 index 0000000..dd407a0 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/sr.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/sr",[],function(){function n(n,e,r,t){return n%10==1&&n%100!=11?e:n%10>=2&&n%10<=4&&(n%100<12||n%100>14)?r:t}return{errorLoading:function(){return"Preuzimanje nije uspelo."},inputTooLong:function(e){var r=e.input.length-e.maximum,t="Obrišite "+r+" simbol";return t+=n(r,"","a","a")},inputTooShort:function(e){var r=e.minimum-e.input.length,t="Ukucajte bar još "+r+" simbol";return t+=n(r,"","a","a")},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(e){var r="Možete izabrati samo "+e.maximum+" stavk";return r+=n(e.maximum,"u","e","i")},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"},removeAllItems:function(){return"Уклоните све ставке"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/sv.js b/includes/classes/vendor/Select2/assets/js/i18n/sv.js new file mode 100755 index 0000000..1bc8724 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/sv.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(n){return"Vänligen sudda ut "+(n.input.length-n.maximum)+" tecken"},inputTooShort:function(n){return"Vänligen skriv in "+(n.minimum-n.input.length)+" eller fler tecken"},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(n){return"Du kan max välja "+n.maximum+" element"},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"},removeAllItems:function(){return"Ta bort alla objekt"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/th.js b/includes/classes/vendor/Select2/assets/js/i18n/th.js new file mode 100755 index 0000000..63eab71 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/th.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/th",[],function(){return{errorLoading:function(){return"ไม่สามารถค้นข้อมูลได้"},inputTooLong:function(n){return"โปรดลบออก "+(n.input.length-n.maximum)+" ตัวอักษร"},inputTooShort:function(n){return"โปรดพิมพ์เพิ่มอีก "+(n.minimum-n.input.length)+" ตัวอักษร"},loadingMore:function(){return"กำลังค้นข้อมูลเพิ่ม…"},maximumSelected:function(n){return"คุณสามารถเลือกได้ไม่เกิน "+n.maximum+" รายการ"},noResults:function(){return"ไม่พบข้อมูล"},searching:function(){return"กำลังค้นข้อมูล…"},removeAllItems:function(){return"ลบรายการทั้งหมด"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/tk.js b/includes/classes/vendor/Select2/assets/js/i18n/tk.js new file mode 100755 index 0000000..30255ff --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/tk.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/tk",[],function(){return{errorLoading:function(){return"Netije ýüklenmedi."},inputTooLong:function(e){return e.input.length-e.maximum+" harp bozuň."},inputTooShort:function(e){return"Ýene-de iň az "+(e.minimum-e.input.length)+" harp ýazyň."},loadingMore:function(){return"Köpräk netije görkezilýär…"},maximumSelected:function(e){return"Diňe "+e.maximum+" sanysyny saýlaň."},noResults:function(){return"Netije tapylmady."},searching:function(){return"Gözlenýär…"},removeAllItems:function(){return"Remove all items"}}}),e.define,e.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/tr.js b/includes/classes/vendor/Select2/assets/js/i18n/tr.js new file mode 100755 index 0000000..fc4c0bf --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/tr.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/tr",[],function(){return{errorLoading:function(){return"Sonuç yüklenemedi"},inputTooLong:function(n){return n.input.length-n.maximum+" karakter daha girmelisiniz"},inputTooShort:function(n){return"En az "+(n.minimum-n.input.length)+" karakter daha girmelisiniz"},loadingMore:function(){return"Daha fazla…"},maximumSelected:function(n){return"Sadece "+n.maximum+" seçim yapabilirsiniz"},noResults:function(){return"Sonuç bulunamadı"},searching:function(){return"Aranıyor…"},removeAllItems:function(){return"Tüm öğeleri kaldır"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/uk.js b/includes/classes/vendor/Select2/assets/js/i18n/uk.js new file mode 100755 index 0000000..63697e3 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/uk.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/uk",[],function(){function n(n,e,u,r){return n%100>10&&n%100<15?r:n%10==1?e:n%10>1&&n%10<5?u:r}return{errorLoading:function(){return"Неможливо завантажити результати"},inputTooLong:function(e){return"Будь ласка, видаліть "+(e.input.length-e.maximum)+" "+n(e.maximum,"літеру","літери","літер")},inputTooShort:function(n){return"Будь ласка, введіть "+(n.minimum-n.input.length)+" або більше літер"},loadingMore:function(){return"Завантаження інших результатів…"},maximumSelected:function(e){return"Ви можете вибрати лише "+e.maximum+" "+n(e.maximum,"пункт","пункти","пунктів")},noResults:function(){return"Нічого не знайдено"},searching:function(){return"Пошук…"},removeAllItems:function(){return"Видалити всі елементи"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/vi.js b/includes/classes/vendor/Select2/assets/js/i18n/vi.js new file mode 100755 index 0000000..24f3bc2 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/vi.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/vi",[],function(){return{inputTooLong:function(n){return"Vui lòng xóa bớt "+(n.input.length-n.maximum)+" ký tự"},inputTooShort:function(n){return"Vui lòng nhập thêm từ "+(n.minimum-n.input.length)+" ký tự trở lên"},loadingMore:function(){return"Đang lấy thêm kết quả…"},maximumSelected:function(n){return"Chỉ có thể chọn được "+n.maximum+" lựa chọn"},noResults:function(){return"Không tìm thấy kết quả"},searching:function(){return"Đang tìm…"},removeAllItems:function(){return"Xóa tất cả các mục"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/zh-CN.js b/includes/classes/vendor/Select2/assets/js/i18n/zh-CN.js new file mode 100755 index 0000000..2c5649d --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/zh-CN.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(n){return"请删除"+(n.input.length-n.maximum)+"个字符"},inputTooShort:function(n){return"请再输入至少"+(n.minimum-n.input.length)+"个字符"},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(n){return"最多只能选择"+n.maximum+"个项目"},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"},removeAllItems:function(){return"删除所有项目"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/i18n/zh-TW.js b/includes/classes/vendor/Select2/assets/js/i18n/zh-TW.js new file mode 100755 index 0000000..570a566 --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/i18n/zh-TW.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ + +!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(n){return"請刪掉"+(n.input.length-n.maximum)+"個字元"},inputTooShort:function(n){return"請再輸入"+(n.minimum-n.input.length)+"個字元"},loadingMore:function(){return"載入中…"},maximumSelected:function(n){return"你只能選擇最多"+n.maximum+"項"},noResults:function(){return"沒有找到相符的項目"},searching:function(){return"搜尋中…"},removeAllItems:function(){return"刪除所有項目"}}}),n.define,n.require}(); \ No newline at end of file diff --git a/includes/classes/vendor/Select2/assets/js/select2.full.min.js b/includes/classes/vendor/Select2/assets/js/select2.full.min.js new file mode 100755 index 0000000..683301d --- /dev/null +++ b/includes/classes/vendor/Select2/assets/js/select2.full.min.js @@ -0,0 +1,2 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ +!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(d){var e=function(){if(d&&d.fn&&d.fn.select2&&d.fn.select2.amd)var e=d.fn.select2.amd;var t,n,i,h,o,s,f,g,m,v,y,_,r,a,w,l;function b(e,t){return r.call(e,t)}function c(e,t){var n,i,r,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&w.test(e[s])&&(e[s]=e[s].replace(w,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},r.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},r.__cache={};var n=0;return r.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},r.StoreData=function(e,t,n){var i=r.GetUniqueElementId(e);r.__cache[i]||(r.__cache[i]={}),r.__cache[i][t]=n},r.GetData=function(e,t){var n=r.GetUniqueElementId(e);return t?r.__cache[n]&&null!=r.__cache[n][t]?r.__cache[n][t]:o(e).data(t):r.__cache[n]},r.RemoveData=function(e){var t=r.GetUniqueElementId(e);null!=r.__cache[t]&&delete r.__cache[t],e.removeAttribute("data-select2-id")},r}),e.define("select2/results",["jquery","./utils"],function(h,f){function i(e,t,n){this.$element=e,this.data=n,this.options=t,i.__super__.constructor.call(this)}return f.Extend(i,f.Observable),i.prototype.render=function(){var e=h('
    ');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h(''),i=this.options.get("translations").get(e.message);n.append(t(i(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n",{class:"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},i.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var i=n-1;0===e.length&&(i=0);var r=t.eq(i);r.trigger("mouseenter");var o=l.$results.offset().top,s=r.offset().top,a=l.$results.scrollTop()+(s-o);0===i?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var i=t.eq(n);i.trigger("mouseenter");var r=l.$results.offset().top+l.$results.outerHeight(!1),o=i.offset().top+i.outerHeight(!1),s=l.$results.scrollTop()+o-r;0===n?l.$results.scrollTop(0):rthis.$results.outerHeight()||o<0)&&this.$results.scrollTop(r)}},i.prototype.template=function(e,t){var n=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),r=n(e,t);null==r?t.style.display="none":"string"==typeof r?t.innerHTML=i(r):h(t).append(r)},i}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,i,r){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return i.Extend(o,i.Observable),o.prototype.render=function(){var e=n('');return this._tabindex=0,null!=i.GetData(this.$element[0],"old-tabindex")?this._tabindex=i.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,i=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===r.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",i),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&i.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html(''),e},r.prototype.bind=function(t,e){var n=this;r.__super__.bind.apply(this,arguments);var i=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},r.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return e("")},r.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i);var r=t.title||t.text;r?n.attr("title",r):n.removeAttr("title")}else this.clear()},r}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(r,e,l){function n(e,t){n.__super__.constructor.apply(this,arguments)}return l.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('
      '),e},n.prototype.bind=function(e,t){var i=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){i.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!i.isDisabled()){var t=r(this).parent(),n=l.GetData(t[0],"data");i.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return r('
    • ×
    • ')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n×');a.StoreData(i[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(i)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(i,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=i('');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),t.on("open",function(){i.$search.attr("aria-controls",r),i.$search.trigger("focus")}),t.on("close",function(){i.$search.val(""),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.trigger("focus")}),t.on("enable",function(){i.$search.prop("disabled",!1),i._transferTabIndex()}),t.on("disable",function(){i.$search.prop("disabled",!0)}),t.on("focus",function(e){i.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){i.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){i._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===i.$search.val()){var t=i.$searchContainer.prev(".select2-selection__choice");if(0this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(){i._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var i=this;this._checkIfMaximumSelected(function(){e.call(i,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var i=this;this.current(function(e){var t=null!=e?e.length:0;0=i.maximumSelectionLength?i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):n&&n()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o('');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){i.handleSearch(e)}),t.on("open",function(){i.$search.attr("tabindex",0),i.$search.attr("aria-controls",r),i.$search.trigger("focus"),window.setTimeout(function(){i.$search.trigger("focus")},0)}),t.on("close",function(){i.$search.attr("tabindex",-1),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.val(""),i.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||i.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;0<=i;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",function(e){i.lastParams=e,i.loading=!0}),t.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('
    • '),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),i._bindContainerResultHandlers(t)}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f(""),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,i="scroll.select2."+t.id,r="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(i,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(i+" "+r+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,i="resize.select2."+t.id,r="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+i+" "+r)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),i=null,r=this.$container.offset();r.bottom=r.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=r.top,o.bottom=r.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=ar.bottom+s,d={left:r.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};(f.contains(document.body,p[0])||p[0].isConnected)&&(h=p.offset()),d.top-=h.top,d.left-=h.left,t||n||(i="below"),u||!c||t?!c&&u&&t&&(i="below"):i="above",("above"==i||t&&"below"!==i)&&(d.top=o.top-h.top-s),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,i=0;i');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("select2/compat/utils",["jquery"],function(s){return{syncCssClasses:function(e,t,n){var i,r,o=[];(i=s.trim(e.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0===this.indexOf("select2-")&&o.push(this)}),(i=s.trim(t.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(r=n(this))&&o.push(r)}),e.attr("class",o.join(" "))}}}),e.define("select2/compat/containerCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("containerCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptContainerCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}var o=this.options.get("containerCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/dropdownCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("dropdownCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptDropdownCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}var o=this.options.get("dropdownCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/initSelection",["jquery"],function(i){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return e.prototype.current=function(e,t){var n=this;this._isInitialized?e.call(this,t):this.initSelection.call(null,this.$element,function(e){n._isInitialized=!0,i.isArray(e)||(e=[e]),t(e)})},e}),e.define("select2/compat/inputData",["jquery","../utils"],function(s,i){function e(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `'; + echo ''; + } + + /** + * Enqueues necessary JS scripts and stylesheets. + * + * @since 4.5.1 + * @since 5.0.0 - this method is no longer private. + */ + public static function enqueue_scripts() { + if ( self::$scripts_queued ) { + return; + } + + wp_enqueue_style( + 'wpw-select2', + self::$base_url . '/assets/css/select2.min.css', + array(), + '4.0.13' + ); + + wp_enqueue_style( + 'wpw-select2-overrides', + self::$base_url . '/assets/css/wp-overrides.css', + array( 'wpw-select2' ), + '4.0.13' + ); + + wp_enqueue_script( + 'wpw-select2', + self::$base_url . '/assets/js/select2.full.min.js', + array( 'jquery' ), + '4.0.13', + true + ); + + self::$scripts_queued = true; + } + + /** + * Alters WordPress query to search only by post title. + * + * @param string $where SQL WHERE statement. + * @param WP_Query $wp_query WordPress query object. + * + * @return string + * + * @since 4.5.1 + */ + public static function search_post_title( $where, $wp_query ) { + $search_term = $wp_query->get( 'search_post_title' ); + if ( $search_term ) { + global $wpdb; + $where .= ' AND ' . $wpdb->posts . '.post_title LIKE \'%' . $wpdb->esc_like( $search_term ) . '%\''; + } + + return $where; + } + } +} diff --git a/includes/classes/vendor/class-rational-option-pages.php b/includes/classes/vendor/class-rational-option-pages.php old mode 100644 new mode 100755 diff --git a/includes/functions/core.php b/includes/functions/core.php old mode 100644 new mode 100755 index 0316ecd..47892c4 --- a/includes/functions/core.php +++ b/includes/functions/core.php @@ -9,8 +9,9 @@ namespace AdminNoticesManager\Core; use AdminNoticesManager\Notices; -use AdminNoticesManager\Pointer; +use AdminNoticesManager\Pointers; use AdminNoticesManager\Settings; +use AdminNoticesManager\Select2_WPWS; /** * Default setup routine @@ -22,14 +23,14 @@ function setup() { return __NAMESPACE__ . "\\$function"; }; - add_action( 'init', $n( 'i18n' ) ); - add_action( 'init', $n( 'init' ) ); - add_action( 'admin_enqueue_scripts', $n( 'admin_scripts' ) ); - add_action( 'admin_enqueue_scripts', $n( 'admin_styles' ) ); + \add_action( 'init', $n( 'i18n' ) ); + \add_action( 'init', $n( 'init' ) ); + \add_action( 'admin_enqueue_scripts', $n( 'admin_scripts' ) ); + \add_action( 'admin_enqueue_scripts', $n( 'admin_styles' ) ); - add_action( 'wp_ajax_anm_purge_notices', $n( 'purge_notices' ) ); + \add_action( 'wp_ajax_anm_purge_notices', $n( 'purge_notices' ) ); - do_action( 'admin_notices_manager_loaded' ); + \do_action( 'admin_notices_manager_loaded' ); } /** @@ -52,17 +53,17 @@ function init() { if ( is_admin() ) { - if ( class_exists( '\S24WP' ) ) { - \S24WP::init( ADMIN_NOTICES_MANAGER_URL . 'vendor/wpwhitesecurity/select2-wpwhitesecurity' ); + if ( class_exists( Select2_WPWS::class ) ) { + Select2_WPWS::init( ADMIN_NOTICES_MANAGER_URL . 'includes/classes/vendor/Select2' ); } // Check if the notices can be hidden for the currently logged-in user. $notice_hiding_allowed = Settings::notice_hiding_allowed_for_current_user(); Notices::init( $notice_hiding_allowed ); - Pointer::init(); + Pointers::init(); - new Settings(); + Settings::init(); } do_action( 'admin_notices_manager_init' ); diff --git a/includes/index.php b/includes/index.php old mode 100644 new mode 100755 diff --git a/index.php b/index.php old mode 100644 new mode 100755 diff --git a/languages/admin-notices-manager-sk_SK.mo b/languages/admin-notices-manager-sk_SK.mo old mode 100644 new mode 100755 diff --git a/languages/admin-notices-manager-sk_SK.po b/languages/admin-notices-manager-sk_SK.po old mode 100644 new mode 100755 diff --git a/languages/admin-notices-manager.pot b/languages/admin-notices-manager.pot old mode 100644 new mode 100755 diff --git a/languages/index.php b/languages/index.php old mode 100644 new mode 100755 diff --git a/package-lock.json b/package-lock.json old mode 100644 new mode 100755 diff --git a/package.json b/package.json old mode 100644 new mode 100755 diff --git a/phpunit.xml b/phpunit.xml old mode 100644 new mode 100755 diff --git a/readme.txt b/readme.txt old mode 100644 new mode 100755 diff --git a/tests/bootstrap.php b/tests/bootstrap.php old mode 100644 new mode 100755 diff --git a/tests/js/.gitkeep b/tests/js/.gitkeep old mode 100644 new mode 100755 diff --git a/tests/phpunit/test-tools/Core_Tests.php b/tests/phpunit/test-tools/Core_Tests.php old mode 100644 new mode 100755 diff --git a/tests/phpunit/test-tools/TestCase.php b/tests/phpunit/test-tools/TestCase.php old mode 100644 new mode 100755 diff --git a/uninstall.php b/uninstall.php old mode 100644 new mode 100755 diff --git a/wpgulp.config.js b/wpgulp.config.js old mode 100644 new mode 100755 From 71f7b1d713dbaab782d319797f65a424bd58f104 Mon Sep 17 00:00:00 2001 From: sdobreff Date: Tue, 4 Jun 2024 12:26:56 +0300 Subject: [PATCH 06/15] Version and license updated (#100) --- admin-notices-manager.php | 4 +- license.txt | 701 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 703 insertions(+), 2 deletions(-) create mode 100644 license.txt diff --git a/admin-notices-manager.php b/admin-notices-manager.php index 779c96a..e3bc61d 100755 --- a/admin-notices-manager.php +++ b/admin-notices-manager.php @@ -5,7 +5,7 @@ * Description: Better manage admin notices & never miss an important WordPress and developer message. * Author: WP White Security * Author URI: https://www.wpwhitesecurity.com/ - * Version: 1.6.0 + * Version: 1.5.0 * Text Domain: admin-notices-manager * Domain Path: /languages * Requires at least: 5.0 @@ -40,7 +40,7 @@ // Useful global constants. if ( ! defined( 'ADMIN_NOTICES_MANAGER_VERSION' ) ) { - define( 'ADMIN_NOTICES_MANAGER_VERSION', '1.6.0' ); + define( 'ADMIN_NOTICES_MANAGER_VERSION', '1.5.0' ); define( 'ADMIN_NOTICES_MANAGER_URL', \plugin_dir_url( __FILE__ ) ); define( 'ADMIN_NOTICES_MANAGER_PATH', \plugin_dir_path( __FILE__ ) ); define( 'ADMIN_NOTICES_MANAGER_INC', ADMIN_NOTICES_MANAGER_PATH . 'includes/' ); diff --git a/license.txt b/license.txt new file mode 100644 index 0000000..e2e6856 --- /dev/null +++ b/license.txt @@ -0,0 +1,701 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + 18. Additional terms in accordance with Section 7. + + In accordance with Section 7 of this License, the following additional +terms apply: + + a) You are prohibited from misrepresenting the the origin of the + covered work. Modified versions of the covered work must be clearly + marked as being different from the original version of the covered + work; + + b) Unless expressly agreed otherwise, you are not allowed to use the + names of the author(s) or any of its licensors for publicity or + marketing purposes; + + c) Unless expressly agreed otherwise, you do not receive any rights + with respect to trademark law, trade name law or comparable laws + whatsoever. Unless expressly agreed otherwise, you are not entitled to + use any trade name, trademark, service mark or similar belonging to the + author(s) or its licensors for any purpose. + + d) In the event you choose to convey the covered work or modified + versions thereof, you are required to indemnify and hold harmless the + author(s) and its licensors against any costs resulting from any + contractual assumptions of liability of the author(s) or its licensors + with regard to the covered work agreed on or implied by you. + + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. From 41834b8b3b5dda268e5e34e6d650655be28535c8 Mon Sep 17 00:00:00 2001 From: sdobreff Date: Tue, 4 Jun 2024 12:32:16 +0300 Subject: [PATCH 07/15] Changed to melapress (#101) --- admin-notices-manager.php | 8 ++++---- composer.json | 10 ++-------- package.json | 2 +- readme.txt | 4 ++-- wpgulp.config.js | 4 ++-- 5 files changed, 11 insertions(+), 17 deletions(-) diff --git a/admin-notices-manager.php b/admin-notices-manager.php index e3bc61d..2cfa70c 100755 --- a/admin-notices-manager.php +++ b/admin-notices-manager.php @@ -1,10 +1,10 @@ ', // Last translator Email ID. - team: 'WP White Security ', // Team's Email ID. + lastTranslator: 'Melapress ', // Last translator Email ID. + team: 'Melapress ', // Team's Email ID. // Browsers you care about for autoprefixing. Browserlist https://github.com/ai/browserslist // The following list is set as per WordPress requirements. Though, Feel free to change. From ec2ba09a900de1c00c299d611a3d88f35826f7c3 Mon Sep 17 00:00:00 2001 From: sdobreff Date: Tue, 4 Jun 2024 12:47:31 +0300 Subject: [PATCH 08/15] Settings link in plugin (#102) --- admin-notices-manager.php | 2 +- includes/classes/class-settings.php | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/admin-notices-manager.php b/admin-notices-manager.php index 2cfa70c..e1e900d 100755 --- a/admin-notices-manager.php +++ b/admin-notices-manager.php @@ -19,7 +19,6 @@ exit; } - /* Admin Notices Manager Copyright(c) 2022 Melapress (email : info@melapress.com) @@ -44,6 +43,7 @@ define( 'ADMIN_NOTICES_MANAGER_URL', \plugin_dir_url( __FILE__ ) ); define( 'ADMIN_NOTICES_MANAGER_PATH', \plugin_dir_path( __FILE__ ) ); define( 'ADMIN_NOTICES_MANAGER_INC', ADMIN_NOTICES_MANAGER_PATH . 'includes/' ); + define( 'ADMIN_NOTICES_BASENAME', \plugin_basename( __FILE__ ) ); } // Require Composer autoloader if it exists. diff --git a/includes/classes/class-settings.php b/includes/classes/class-settings.php index 79cb23f..ff11100 100755 --- a/includes/classes/class-settings.php +++ b/includes/classes/class-settings.php @@ -42,6 +42,8 @@ class Settings { */ public static function init() { + \add_filter( 'plugin_action_links', array( __CLASS__, 'add_settings_link' ), 10, 2 ); + $options = self::get_settings(); $notice_handling_options = array( @@ -335,6 +337,32 @@ public static function render_purge_field( $field, $page_key, $section_key, $fie echo '' . esc_html__( 'Reset', 'admin-notices-manager' ) . ' ' . esc_html__( 'Notices restored', 'admin-notices-manager' ) . ''; } + /** + * Add Settings link to plugin list + * + * Add a Settings link to the options listed against this plugin + * + * @param array $links Current links. + * @param string $file File in use. + * + * @return string Links, now with settings added. + * + * @since 1.5.0 + */ + public static function add_settings_link( $links, $file ) { + + if ( ADMIN_NOTICES_BASENAME === $file ) { + $settings_link = '' . __( 'Settings', 'admin-notices-manager' ) . ''; + array_unshift( $links, $settings_link ); + } + + return $links; + } /** * Builds an array of parameters for the user selection form control. * From 06ca08c7861d13548c3cd566dc6a9a3c8c0ba885 Mon Sep 17 00:00:00 2001 From: sdobreff Date: Tue, 4 Jun 2024 10:05:05 +0000 Subject: [PATCH 09/15] build script --- bin/create-builds.sh | 150 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100755 bin/create-builds.sh diff --git a/bin/create-builds.sh b/bin/create-builds.sh new file mode 100755 index 0000000..ea77744 --- /dev/null +++ b/bin/create-builds.sh @@ -0,0 +1,150 @@ +#!/usr/bin/env bash + +noGdrive=0 +doPremium=0 +doFree=0 +doNofs=0 +doNotDelete=0 +syncFree=0 +syncNofs=0 + +premiumDir="wp-security-audit-log-premium" +freeDir="admin-notices-manager" +noFSDir="wp-security-audit-log-premium-nofs" + +rootDir=$(printf "%q\n" "$(pwd)") + +rm -rf builds/ +mkdir builds + +# Free version start +freeVersion() { + mkdir builds/$freeDir + eval cd "$rootDir" + + rsync -arv --exclude=.github \ + --exclude "third-party/freemius" \ + --exclude=node_modules \ + --exclude=config \ + --exclude=vendor \ + --exclude=extensions \ + --exclude=builds \ + --exclude=testing \ + --exclude=tests \ + --exclude=docker \ + --exclude=.git \ + --exclude=wsal-nofs-license.php \ + --exclude "/*.js" \ + --exclude "/*.md" \ + --exclude "/*.sh" \ + --exclude "/*.xml*" \ + . builds/$freeDir/; + + cd builds/$freeDir + + rm -rf classes/Helpers/Assets.php + rm -rf classes/Sensors/Request.php + rm -rf nofs/lib/class-wsal-freemius.php + mv nofs/lib/class-wsal-freemius-free.php nofs/lib/class-wsal-freemius.php + + # mkdir extensions + + # ./bin/randomize-autoloader.sh + # ./bin/install-dependencies.sh + # ./bin/remove-premium.sh + # ./bin/remove-nofs.sh + # ./bin/set-assets.sh + # ./bin/latestversion.sh + # ./bin/latestversion-readme.sh + # ./bin/plugin-name-substitution.sh + # ./bin/make-pot.sh + # ./bin/substitute-year.sh + # ./bin/set-free-version.sh + + rm -rf bin php-scoper scoper.inc.php third-party/woocommerce + rm -rf assets/css/ + rm -rf babel.config.js + rm -rf composer.* + rm -rf php-scoper/ + rm -rf phpunit.xml + rm -rf README.md + rm -rf scoper.inc.php + rm -rf webpack*.js + rm -rf .* + rm -rf TESTS.MD + rm -rf codeception.dist.yml + rm -rf *.js + rm -rf *.json + rm -rf third-party/*.json + rm -rf third-party/vendor/bin + rm -rf css/jquery-ui + rm -rf bin/ + rm -rf nofs/nofs.php + rm -rf nofs/licensing.php + rm -rf nofs/lib/WSAL_Plugin_Updater.php + rm -rf third-party/*.json + rm -rf "third-party/freemius" + rm -rf mysqld.cnf + + rm -rf extensions/ + rm -rf css/dist/css + rm -rf css/dist/images + rm -rf css/dist/js + rm -rf *.phar + + rm composer + + cd ../ + year=$(date +%Y) + month=$(date +%m) + day=$(date +%d) + + zip -r $year$month$day-$freeDir.zip $freeDir/* -x "**/.*" + + if [ $doNotDelete == 0 ] + then + rm -rf $freeDir/ + fi + + eval cd "$rootDir" +} +# Free version end + +helpFunction() +{ + echo "" + echo "Usage: $0 -g -h -p -f -n -d -s -o" + echo -e "\t-g Upload the builds to the GDrive" + echo -e "\t-h This help screeen" + echo -e "\t-p Build the premium only" + echo -e "\t-f Build the free only" + echo -e "\t-n Build the NOFS only" + echo -e "\t-d Do not delete the prepared directories after the build(s) are complete" + echo -e "\t-s Create new branch in free repo with last version (branch name is 'YYYYmmdd-sync')" + echo -e "\t-o Create new branch in NOFS repo with last version (branch name is 'YYYYmmdd-sync')" + exit 1 # Exit script after printing help +} + +while getopts "hgfpndso" opt +do + case "$opt" in + g ) noGdrive=$((noGdrive+1)) ;; + h ) helpFunction ;; + p ) doPremium=$((doPremium+1)) ;; + f ) doFree=$((doFree+1)) ;; + n ) doNofs=$((doNofs+1)) ;; + d ) doNotDelete=$((doNotDelete+1)) ;; + s ) syncFree=$((syncFree+1)) ;; + o ) syncNofs=$((syncNofs+1)) ;; + esac +done + +if [ $doFree != 0 ] +then + freeVersion +fi + +if [ $doPremium == 0 ] && [ $doFree == 0 ] && [ $doNofs == 0 ] && [ $syncFree == 0 ] && [ $syncNofs == 0 ] +then + freeVersion +fi \ No newline at end of file From 562625bd6362d21d41fc32f8eed9abb6e0a42ad4 Mon Sep 17 00:00:00 2001 From: sdobreff Date: Tue, 4 Jun 2024 14:09:55 +0300 Subject: [PATCH 10/15] Error notices fixes (#104) --- assets/dist/js/notices.js | 4 ++++ assets/dist/js/notices.min.js | 1 - bin/create-builds.sh | 2 ++ includes/classes/class-settings.php | 4 ++-- includes/functions/core.php | 2 ++ 5 files changed, 10 insertions(+), 3 deletions(-) delete mode 100755 assets/dist/js/notices.min.js diff --git a/assets/dist/js/notices.js b/assets/dist/js/notices.js index e57279d..4c64f20 100755 --- a/assets/dist/js/notices.js +++ b/assets/dist/js/notices.js @@ -82,6 +82,10 @@ return 'error'; } + if (jqNotice.hasClass('error')) { + return 'error'; + } + if (jqNotice.hasClass('notice-info') || jqNotice.hasClass('notice-information')) { return 'information'; } diff --git a/assets/dist/js/notices.min.js b/assets/dist/js/notices.min.js deleted file mode 100755 index ee04821..0000000 --- a/assets/dist/js/notices.min.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";!function(l,e){({container:null,counter_link:null,migration_delay:100,migration_interval:null,migration_start:0,migration_limit:5e3,popup_delay:50,popup_interval:null,popup_start:0,popup_limit:1e3,removal_interval:null,system_messages:[],init:function(){for(var e,n=this,t=this,i='
      ',a=("popup"==anm_i18n.settings.popup_style?(l("body").append('"),this.container=l("#anm-container")):(e=34,0
      '+i+"
      "),this.container=l("#anm-slide-in-content")),this.counter_link=l("#wp-admin-bar-anm_notification_count"),this.initTriggers(),this.migration_start=(new Date).getTime(),this.migration_interval=setInterval(function(){n.transferNotices()},this.migration_delay),0),o=setInterval(function(){3===(a+=1)&&t.CheckAndStoreNotices(),4===a&&clearInterval(o)},150),r=anm_i18n.system_messages.length,s=0;sthis.migration_limit&&(clearInterval(this.migration_interval),this.migration_interval=null,this.CheckAndStoreNotices(),0<(e=l(".anm-notices-wrapper")).children(this.getIgnoreSelector()).length&&(e.children().not(this.getIgnoreSelector()).remove(),e.show()))},getIgnoreSelector:function(){var e='.hidden, .hide-if-js, .update-message, [aria-hidden="true"]';return 0'+e+" "+n+"",this.counter_link.attr("data-popup-title",n),this.counter_link.find("a").append(e),this.counter_link.addClass("has-data"))},adjustModalHeight:function(){l("#TB_ajaxContent").css({width:"100%",height:l("#TB_window").height()-l("#TB_title").outerHeight()-22+"px",padding:"2px 0px 20px 0px"}),this.popup_interval&&(new Date).getTime()-this.popup_start>this.popup_limit&&(clearInterval(this.popup_interval),this.popup_interval=null)},checkNoticeRemoval:function(){var e;l("#TB_ajaxContent").height()?(e=l("#TB_ajaxContent").find(".notice").not(":hidden").length,this.getCurrentCounterValue()!==e&&this.updateCounterBubble(e)):this.removal_interval&&clearInterval(this.removal_interval)},CheckAndStoreNotices:function(){var n=jQuery(this.container).find(".notice"),t=[],i=this;n.each(function(e,n){jQuery(n).find(".anm-notice-timestap").remove();n=n.outerHTML;t[e]=n}),jQuery.ajax({type:"POST",dataType:"json",url:anm_i18n.ajaxurl,data:{action:"anm_log_notices",_wpnonce:anm_i18n.nonce,notices:t},complete:function(e){i.appendTimeDate(n,e.responseJSON.data),l(".anm-notification-counter").addClass("display")}})},appendTimeDate:function(e,i){var a=this;e.each(function(e,n){var t;"do-not-display"==i[e]?(jQuery(n).remove(),t=a.getCurrentCounterValue(),a.updateCounterBubble(t-1)):(t='
      '+anm_i18n.date_time_preamble+i[e][1]+'Hide notice forever
      ',jQuery(n).find(".anm-notice-timestap").length||jQuery(t).appendTo(n))})},initTriggers:function(){var a=this;this.counter_link.click(function(){return a.popup_interval&&(clearInterval(a.popup_interval),a.popup_interval=null),0==a.getCurrentCounterValue()||("popup"==anm_i18n.settings.popup_style?tb_show(a.counter_link.attr("data-popup-title"),"#TB_inline?inlineId=anm-container"):l("#anm-container-slide-in").addClass("show"),a.popup_start=(new Date).getTime(),a.popup_interval=setInterval(function(){a.adjustModalHeight.call(a)},a.popup_delay),a.removal_interval&&clearInterval(a.removal_interval),a.removal_interval=setInterval(function(){a.checkNoticeRemoval.call(a)},a.popup_delay)),!1}),l(e).resize(function(){"popup"==anm_i18n.settings.popup_style&&a.adjustModalHeight.call(a)}),"slide-in"==anm_i18n.settings.popup_style&&l(document).on("click","body *",function(e){l(e.target).is("#anm-container-slide-in a")||l(e.target).is("#anm-container-slide-in")||l("#anm-container-slide-in").removeClass("show")}),jQuery(document).on("click","[data-hide-notice-forever]",function(e){e.preventDefault();var e=jQuery(this).attr("data-hide-notice-forever"),n=jQuery(this).closest(".notice"),t=l(".anm-notification-counter span.count").text(),i=a;jQuery.ajax({type:"POST",dataType:"json",url:anm_i18n.ajaxurl,data:{action:"anm_hide_notice_forever",_wpnonce:anm_i18n.nonce,notice_hash:e},complete:function(e){n.slideUp(),i.updateCounterBubble(t-1)}})})}}).init()}(jQuery,window); diff --git a/bin/create-builds.sh b/bin/create-builds.sh index ea77744..eb4605b 100755 --- a/bin/create-builds.sh +++ b/bin/create-builds.sh @@ -60,6 +60,8 @@ freeVersion() { # ./bin/make-pot.sh # ./bin/substitute-year.sh # ./bin/set-free-version.sh + + composer update --no-dev rm -rf bin php-scoper scoper.inc.php third-party/woocommerce rm -rf assets/css/ diff --git a/includes/classes/class-settings.php b/includes/classes/class-settings.php index ff11100..dbd812e 100755 --- a/includes/classes/class-settings.php +++ b/includes/classes/class-settings.php @@ -183,8 +183,8 @@ public static function init() { * @return array */ public static function get_settings() { - return wp_parse_args( - get_option( self::$option_name, array() ), + return \wp_parse_args( + \get_option( self::$option_name, array() ), array( 'success_level_notices' => 'popup-only', 'error_level_notices' => 'popup-only', diff --git a/includes/functions/core.php b/includes/functions/core.php index 47892c4..2cadb1a 100755 --- a/includes/functions/core.php +++ b/includes/functions/core.php @@ -195,6 +195,8 @@ function admin_scripts() { esc_html__( 'User removed from this site.' ), esc_html__( "You can't remove the current user." ), esc_html__( 'Other users have been removed.' ), + esc_html__( 'Please enter a nickname.' ), + esc_html__( 'Please enter an email address.' ), // Themes. esc_html__( 'The active theme is broken. Reverting to the default theme.' ), From 139c299251e49ec72deef2d3d84d7c1007d8f36d Mon Sep 17 00:00:00 2001 From: sdobreff Date: Tue, 4 Jun 2024 11:15:13 +0000 Subject: [PATCH 11/15] build --- bin/create-builds.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/create-builds.sh b/bin/create-builds.sh index eb4605b..c17efbc 100755 --- a/bin/create-builds.sh +++ b/bin/create-builds.sh @@ -26,7 +26,6 @@ freeVersion() { --exclude "third-party/freemius" \ --exclude=node_modules \ --exclude=config \ - --exclude=vendor \ --exclude=extensions \ --exclude=builds \ --exclude=testing \ @@ -47,6 +46,8 @@ freeVersion() { rm -rf nofs/lib/class-wsal-freemius.php mv nofs/lib/class-wsal-freemius-free.php nofs/lib/class-wsal-freemius.php + rm -rf vendor/ + # mkdir extensions # ./bin/randomize-autoloader.sh From 8d3e6df3a19e3c5c96cdc303ab00c4697fffc7b1 Mon Sep 17 00:00:00 2001 From: sdobreff Date: Tue, 4 Jun 2024 14:27:29 +0300 Subject: [PATCH 12/15] deprecations removed (#107) --- includes/functions/core.php | 42 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/includes/functions/core.php b/includes/functions/core.php index 2cadb1a..9ac401e 100755 --- a/includes/functions/core.php +++ b/includes/functions/core.php @@ -89,7 +89,6 @@ function activate() { * @return void */ function deactivate() { - } @@ -113,11 +112,10 @@ function get_enqueue_contexts() { function script_url( $script, $context ) { if ( ! in_array( $context, get_enqueue_contexts(), true ) ) { - return new WP_Error( 'invalid_enqueue_context', 'Invalid $context specified in AdminNoticesManager script loader.' ); + return new \WP_Error( 'invalid_enqueue_context', 'Invalid $context specified in AdminNoticesManager script loader.' ); } - return ADMIN_NOTICES_MANAGER_URL . "assets/dist/js/${script}.js"; - + return ADMIN_NOTICES_MANAGER_URL . 'assets/dist/js/' . $script . '.js'; } /** @@ -131,11 +129,10 @@ function script_url( $script, $context ) { function style_url( $stylesheet, $context ) { if ( ! in_array( $context, get_enqueue_contexts(), true ) ) { - return new WP_Error( 'invalid_enqueue_context', 'Invalid $context specified in AdminNoticesManager stylesheet loader.' ); + return new \WP_Error( 'invalid_enqueue_context', 'Invalid $context specified in AdminNoticesManager stylesheet loader.' ); } - return ADMIN_NOTICES_MANAGER_URL . "assets/dist/css/${stylesheet}.css"; - + return ADMIN_NOTICES_MANAGER_URL . 'assets/dist/css/' . $stylesheet . '.css'; } /** @@ -218,11 +215,14 @@ function admin_scripts() { // Settings. esc_html__( 'Settings saved.' ), esc_html__( 'Permalink structure updated.' ), - esc_html__( 'You should update your %s file now.' ), // phpcs:ignore - esc_html__( 'Permalink structure updated. Remove write access on %s file now!' ), // phpcs:ignore + // translators: file name. + esc_html__( 'You should update your %s file now.' ), + // translators: file name. + esc_html__( 'Permalink structure updated. Remove write access on %s file now!' ), esc_html__( 'Privacy Policy page updated successfully.' ), esc_html__( 'The currently selected Privacy Policy page does not exist. Please create or select a new page.' ), - esc_html__( 'The currently selected Privacy Policy page is in the Trash. Please create or select a new Privacy Policy page or restore the current page.' ), // phpcs:ignore + // translators: file name. + esc_html__( 'The currently selected Privacy Policy page is in the Trash. Please create or select a new Privacy Policy page or restore the current page.' ), // Multisite. esc_html__( 'Sites removed from spam.' ), @@ -279,13 +279,13 @@ function admin_scripts() { ); foreach ( $plural_system_messages as $message ) { - array_push( $system_messages, _n( $message[0], $message[1], 0 ) ); // phpcs:ignore - array_push( $system_messages, _n( $message[0], $message[1], 1 ) ); // phpcs:ignore - array_push( $system_messages, _n( $message[0], $message[1], 2 ) ); // phpcs:ignore - array_push( $system_messages, _n( $message[0], $message[1], 5 ) ); // phpcs:ignore + array_push( $system_messages, _n( $message[0], $message[1], 0 ) ); // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralSingle, WordPress.WP.I18n.NonSingularStringLiteralPlural + array_push( $system_messages, _n( $message[0], $message[1], 1 ) ); // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralSingle, WordPress.WP.I18n.NonSingularStringLiteralPlural + array_push( $system_messages, _n( $message[0], $message[1], 2 ) ); // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralSingle, WordPress.WP.I18n.NonSingularStringLiteralPlural + array_push( $system_messages, _n( $message[0], $message[1], 5 ) ); // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralSingle, WordPress.WP.I18n.NonSingularStringLiteralPlural } - wp_localize_script( + \wp_localize_script( 'admin_notices_manager_notices', 'anm_i18n', array( @@ -303,10 +303,9 @@ function admin_scripts() { 'admin_notices_manager_settings', 'anm_settings', array( - 'ajaxurl' => admin_url( 'admin-ajax.php' ), + 'ajaxurl' => admin_url( 'admin-ajax.php' ), ) ); - } /** @@ -322,7 +321,6 @@ function admin_styles() { array(), ADMIN_NOTICES_MANAGER_VERSION ); - } /** @@ -331,9 +329,9 @@ function admin_styles() { * @return void */ function purge_notices() { - if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'anm_purgce_notices_nonce' ) ) { + if ( ! isset( $_REQUEST['nonce'] ) || ! \wp_verify_nonce( \sanitize_text_field( \wp_unslash( $_REQUEST['nonce'] ), 'anm_purgce_notices_nonce' ) ) ) { exit; - } - update_option( 'anm-hidden-notices', array() ); - wp_send_json_success(); + } + \update_option( 'anm-hidden-notices', array() ); + \wp_send_json_success(); } From 58f22353f52fca7247e111417449c5bdf320cbd6 Mon Sep 17 00:00:00 2001 From: sdobreff Date: Tue, 4 Jun 2024 14:45:30 +0300 Subject: [PATCH 13/15] logic fix (#108) --- includes/classes/class-settings.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/classes/class-settings.php b/includes/classes/class-settings.php index dbd812e..088fd76 100755 --- a/includes/classes/class-settings.php +++ b/includes/classes/class-settings.php @@ -212,7 +212,6 @@ public static function notice_hiding_allowed_for_current_user() { return false; } - // phpcs:disable WordPress.PHP.StrictInArray $settings = self::get_settings(); if ( ! array_key_exists( 'visibility', $settings ) || ! array_key_exists( 'choice', $settings['visibility'] ) ) { return true; @@ -225,14 +224,14 @@ public static function notice_hiding_allowed_for_current_user() { if ( 'hide-for-selected' === $settings['visibility']['choice'] && array_key_exists( 'hide-users', $settings['visibility'] ) && is_array( $settings['visibility']['hide-users'] ) - && ! in_array( get_current_user_id(), $settings['visibility']['hide-users'] ) ) { + && in_array( get_current_user_id(), $settings['visibility']['hide-users'] ) ) { return false; } if ( 'show-for-selected' === $settings['visibility']['choice'] && array_key_exists( 'show-users', $settings['visibility'] ) && is_array( $settings['visibility']['show-users'] ) - && in_array( get_current_user_id(), $settings['visibility']['show-users'] ) ) { + && ! in_array( get_current_user_id(), $settings['visibility']['show-users'] ) ) { return false; } From 9293bbf49c8d5019236e0095917558834d0263b2 Mon Sep 17 00:00:00 2001 From: sdobreff Date: Tue, 4 Jun 2024 13:21:01 +0000 Subject: [PATCH 14/15] settings fix --- includes/classes/class-settings.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/classes/class-settings.php b/includes/classes/class-settings.php index 088fd76..39ecd52 100755 --- a/includes/classes/class-settings.php +++ b/includes/classes/class-settings.php @@ -355,13 +355,14 @@ public static function add_settings_link( $links, $file ) { array( 'page' => 'admin_notices_settings', ), - \network_admin_url( 'options-general.php' ) + \admin_url( 'options-general.php' ) ) . '">' . __( 'Settings', 'admin-notices-manager' ) . ''; array_unshift( $links, $settings_link ); } return $links; } + /** * Builds an array of parameters for the user selection form control. * From 936bfd2eb9f3d8a10bfd9194b07a89196d692d08 Mon Sep 17 00:00:00 2001 From: sdobreff Date: Tue, 4 Jun 2024 14:16:17 +0000 Subject: [PATCH 15/15] version update --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 2092ca2..813595d 100755 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ License URI: https://www.gnu.org/licenses/gpl.html Tags: admin notices, hide admin notices, manage admin notices, notices, dashboard notices Requires at least: 5.0 Tested up to: 6.1.1 -Stable tag: 1.4.0 +Stable tag: 1.5.0 Requires PHP: 7.2.0 Better manage admin notices & never miss important developer messages!