=== Noop === Contributors: ScreenfeedFr Tags: framework, settings, options Requires at least: 3.3 Tested up to: 4.6 Stable tag: trunk License: GPLv3 License URI: https://www.screenfeed.fr/gpl-v3.txt Added: 2013-08-01 Plugin URI: https://www.screenfeed.fr/blog/ Contributors profile: https://profiles.wordpress.org/greglone/ Noop is a framework to use within other plugins or themes, it does nothing by itself. == Description == Noop's aim is to provide a secure and robust foundation, and also powerful tools, to build great settings pages and manage options. It can be used for a plugin or a theme, and help you with your options pages, options, and post metas. Another thing about Noop, it doesn't use a shiny-custom-awesome-wow layout to build the settings pages, it simply looks like... WordPress. = Translations = * English * French * German = Multisite = Yes! = Multilang = Yes! If the multilingual plugin uses (and modifies) the value of the WordPress locale (which is the best way in my opinion), it will work. For example, the plugins WPML and Polylang do that. Moreover, if the user uses WPML or Polylang, the language switchers are in sync in the settings page. == Installation == 1. Extract the plugin folder from the downloaded ZIP file. 1. Upload the `noop` folder to your `/wp-content/plugins/` directory. 1. Activate the plugin from the "Plugins" page. 1. Noop can also be used as a "Must Use" plugin, but of course, the updater won't work anymore. == Changelog == = 1.1.9 = * 2016/08/15 * Improved compatibility with PHP7. * Updated Leaflet to version 0.7.7. * When possible, use https instead of http in code and comments. = 1.1.8 = * 2016/01/16 * Fix select input in date field and "month year" field. = 1.1.7 = * 2016/01/10 * The updater now uses an https connexion. * Bugfix: version 1.1.6 broke the "Right Now" button in the date field. * JavaScript code quality improvements. * Removed ability to run Noop as a Must-Use plugin: I never used this feature. * Fixed `plugin_path` in `Noop_Post_Metas` class when Noop is symlinked. * Use `NOOP_FILE` constant for `plugin_path` in `Noop` and `Noop_Post_Metas` classes. * Improved Singleton pattern for `Noop_Settings` class. * Improved php code quality/readability. = 1.1.6 = * 2015/12/20 * Fixed the date field inputs order: the translation changed in WP 4.3 (again). * Improved the date field accessibility. * Enhancements about headers in WordPress 4.4. * Code quality improvements. = 1.1.5 = * 2015/09/20 * Updater updated to 1.2. * Page title and section title ready for WP 4.3 and 4.4. * Class `Noop_Settings`: code cleanup, code improvements. = 1.1.4 = * 2015/08/09 * New in `noop_find_item_field()`: added the filters "noop_wp_query_args" and "noop_find_posts_args". * New in `noop_find_item_field()` and `wp_ajax_noop_find_posts()`: "post_status" is not "any" anymore, but "publish" and/or "inherit". * Improvement in `noop_find_item_field()` and `wp_ajax_noop_find_posts()`: added 'ignore_sticky_posts'. * Bugfix: couple of css changes to prevent new WP styles to mess around and add removed styles back. * Bugfix in `Noop_i18n::_wplang()`: "The lost global variable history". * Small code cleanup in `libs/class-noop.php`. = 1.1.3 = * 2015/04/26 * New: German translation. * New: Support for WP 4.2 dismissible notices. * New filter `noop_wp_query_args` for some fields. * Improvement: check date in `implode_date` and return an empty string on fail. * Improvement: better css support for the "Users" table field in metaboxes. * Improvement: detect which field is the first one in the 3 date fields for the id/for attributes. * Improvement: in `Noop_Utils`, use `EXTR_SKIP` in various `extract()`. * Improvement: in the 3 sanitisation methods in the class `Noop_Utils`, also check the value against an empty string. * Improvement: code readability in `noop_find_item_field()` and in the 3 date fields. * Improvement: better i18n by adding some contexts. * Improvement: the plugin updater now supports changes made in WP 4.2. Code readability improvements. * Improvement: the following `Noop_Utils` methods now return `false` instead of an empty string: `absint_no_zero()`, `intval_no_zero()`, `floatval_no_zero()`, `esc_js()`, `sanitize_slug()`, `parse_id_list()`, `parse_slug_list()`, `sanitize_hex()`, `sanitize_date()`, `sanitize_month_year()`, `sanitize_hour_minute()` and `sanitize_twitter_id()`. * Improvement: `Noop_Utils::sanitize_hex()` and `Noop_Utils::sanitize_twitter_id()` now use `esc_html()` instead of `esc_attr()`. * Changed: deprecate `Noop_Fields::ampersand()`, use esc_url() instead. * Bugfix: Polylang support for fields in metaboxes. * Bugfix: default value in the 3 date fields. * Bugfix: use the "new" context for the "User" translation in the "Users" table field. * Bugfix: `$date_arr` was not declared as an array in `Noop_Utils::explode_hour_minute()`. * Bugfix: wrong variable name in `noop_find_item_field`. * Bugfix: limit `wp_ajax_noop_find_posts()` to 100 posts. = 1.1.2 = * 2015/02/24 * New: new public method `Noop_Post_Metas::nonce_fields()`. Useful to print the nonce field for Noop without using a metabox built with Noop. * New: new button "Empty" in the map fields area (guess what, it will empty the map and fields). * New: the map field now uses both Google and OSM for geocoding addresses (with ajax) for better results: first try with Google, and if no results found or non accurate result, then try with OSM. * New: added "Address" in the plugin translations. * Improvement: new filter `noop_find_posts_args` in `wp_ajax_noop_find_posts()`. * Improvement: vertical alignement for label + textarea in multifields. * Improvement: in `Noop_Options::validate_settings()` and `Noop_Options::add_option_to_history()`, don't use date and time formats from blog options. * Improvement: use YUI instead of Packer for `map.min.js`. * Improvement: code readability improved in `Noop_Post_Metas`, `noop_map_field()`, `admin-ajax.inc.php` and `map.js`. * Improvement: code improved in `findposts.js`. * Improvement: code readability improved in `noop_select_user_field()`. * Bugfix: `Noop_Post_Metas::update_metas()` now works properly. * Bugfix: better handling of $post in `Noop_Post_Metas::nonce_fields()`. * Bugfix: CSS improvements for `noop_find_item_field()` with WP 4.0 (some styles were missing since 4.0). * Bugfix: `noop_find_item_field()` needs `media-views` style if the parameter `what` is `posts-thumb`. * Bugfix in `Noop_Post_Metas::fields_autoload()`: for new posts, the default values are now printed in the fields. * Bugfix in `noop_select_user_field()` for the default value. = 1.1.0 = * 2014/09/02 * Improvement: Updated `Noop_i18n::get_default_locale()` for WP 4.0. * Improvement: code readability improved in `Noop_i18n`. = 1.0.9 = * 2014/07/18 * Improvement: Noop supports symlinked plugins/mu-plugins and can be symlinked (yeah, I'm sure you don't care ;)). * Improvement: Use YUI instead of Packer to compress JS files (better run time for quite similar file size). * Bugfix: Fix regression in the "find item" window for WP < 3.9, its position wasn't set nor draggable anymore. And nobody noticed ( ゚Д゚)<!! * Bugfix: `noopAttachMediaBoxL10n.is39` (`findposts.js`) now returns 1 for WP 3.9 as it should. = 1.0.8 = * 2014/06/26 * New: Polylang support in your settings pages. Now the Polylang switcher and the one from Noop are synced. All the filtering functions have been renamed (previously used for WPML only). * Bugfix for WPML support in the settings pages: removed some Warnings and Notices if WPML is activated but not configured yet. * Bugfix: WordPress has removed some translated strings. Add them back with the plugin text domain. Updated `noop_upload_field()`. * Bugfix in `noop_find_item_field()` and `wp_ajax_noop_find_posts()`: added `suppress_filters` (false) parameter in the posts query arguments. * Improvement: added 4 hooks in `wp_ajax_noop_find_posts()` and 2 hooks in `noop_find_item_field()`. * Improvement: for `noop_find_item_field()`, now the select window closes after selection if `multiple` is false. * Improvement: `noop_find_item_field()` now also accepts an array of IDs (previously, only a string comma-separated list of IDs). * Improvement: since WordPress 4.0 seems to make some changes AGAIN in the JavaScript files, it feels more reliable to not use media.js anymore, but my own file instead (script used for the "find posts / find users" window). Also, a custom function `noop_find_posts_div()` is used now: the aim is to get rid of some duplicate IDs (but some of them are still duplicates if the original window is present, because some css styles are needed). * Improvement: small tweak to add a <br/> tag between a textarea and its label (and add a margin between the label and the textarea). * Improvement: min-height for "metaboxable areas" from 100px to 58px. * Code improvement: added lots of parenthesis here and there, according to the new WordPress coding standards. * Small line-height bugfix for select/input/textarea in Firefox 30 (I guess it will be added in WordPress later). * Updated Leaflet to 0.7.3 and Leaflet.zoomslider to 0.6.1. = 1.0.7 = * 2014/04/28 * Hotfix: hook `Noop_Admin::register_settings()` to `admin_init` to avoid a fatal error. = 1.0.6 = * 2014/04/27 * New: Import / Export settings via a file. See the new tab in the Help panel. The name of the file and its content can be filtered. * New: Now we can build "settings" pages with only "action" tabs (no options management). Just don't use the `option_group` parameter. * New hook in `Noop_Settings::settings_page()`: `{$page_name}_tab_form`, that's where you should add your "action" forms. Previously, `{$page_name}_after_form` was used (hook still available). The aim of this change is to allow the use of the "find items" field in "action" forms. * New public method `Noop_Options::has_blog_option()`: tells if something is already saved in the database. * Bugfix in `wp_ajax_noop_find_posts()`: the WordPress version comparison was badly handled (╯°□°)╯︵ ┻━┻ * Bugfix for `Noop_Admin::register_settings()`: previously hooked to `admin_menu`, now to `wp_loaded`. Since `admin_menu` is not triggered in every admin area, `wp_loaded` is a better choice. * CSS fixes. * Some other minor internal changes. * Updated the `.po` and `.mo` files. = 1.0.5 = * 2014/04/16 * Small code improvements in `Noop_Fields`. * Bugfix in `sf_updates_exclude()`: the updater didn't remove Noop from the normal updates sometimes. * Compatibility fixes for the "Find Posts" modal in WP 3.9: updated `wp_ajax_noop_find_posts()` and `settings(.min).js`. * Small bugfix in `noop_find_item_field()`: a php notice on rare occasion. = 1.0.4 = * 2014/02/22 * Split the `Noop::is_settings_page()` method into `$instance->is_instance_settings_page()` and `Noop::is_settings_page()` to avoid a php notice. Changed it in `Noop_Admin::__construct()` && `Noop_Admin::register_menu_and_help()`. If you used Noop in your own plugin or theme, be sure to check your code. * Small improvement in `Noop_Options::add_option_to_history()`: replaced 'mktime()' with `time()`. = 1.0.3 = * 2014/01/24 * Bugfix in `Noop_Settings::get_instance()`: compatibility with php 5.2. * Improvement: don't add *admin-* before the dashboard icon class. = 1.0.2 = * 2014/01/11 * New: a new year :) * New: new value `'posts-thumb'` for the parameter `what` in `noop_find_item_field()`: posts will be displayed (and ordered) as thumbnails (like in `noop_upload_field()`). Only posts with a post thumbnail and image attachments can be used this way. * New: added `Noop_Utils::esc_js()` (like `esc_js()` but unslash the output). * New: added a `$icon16` parameter to `Noop_Fields::section_icon()` and `Noop_Fields::add_section_icon()` to force the "old" icon16 classes. * New: added a function `noop_uninstall()` in `includes.php`. * Improvement: if a mime type is provided in `Noop_Post_Metas::get_metaboxes()` (metabox parameters), the mime type will be checked in `Noop_Post_Metas::save_metas()`. * Small CSS improvements. * Bugfix in `Noop_Post_Metas::__construct()`: init regression. * Bugfix in `Noop_Post_Metas::metabox_form()`: some nonce fields were not printed when running multiple instances of `Noop_Post_Metas`. * Bugfix in `Noop_Post_Metas::get_metas()` when `multiple_metas` is true and the metas does not exist. * Bugfix in JavaScript when open/close metaboxes. = 1.0.1 = * 2013/12/21 * Updater improvements. * Important bugfix in `Noop_Post_Metas::sanitization_functions()`: removed the $post_type parameter in `$this->escape_functions()`. * Init improvements in `Noop_Post_Metas`, changed some actions. * Added an action hook "noop_before_save_metas" in `Noop_Post_Metas::save_metas()`, before dealing with the sent data. * Bugfix in `noop_upload_field()`: added parameter in `wp_enqueue_media()` to avoid to break the library in post edition. * CSS improvements for metaboxes in sidebar. = 1.0 = * 2013/12/16 * After many months, the first stable version is finally out! = TODO = * Build demos and documentation (ehr...). * Release the kraken on github.