diff --git a/404.php b/404.php index ecc475c..b4b26e0 100644 --- a/404.php +++ b/404.php @@ -1,56 +1,62 @@ - -
-
- -
- - -
-

- - - - - - -
-

-
    - 'count', - 'order' => 'DESC', - 'show_count' => 1, - 'title_li' => '', - 'number' => 10, - ) ); - ?> -
-
- - - ' . sprintf( esc_html__( 'Try looking in the monthly archives. %1$s', 'jason-lite' ), convert_smilies( ':)' ) ) . '

'; - the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=$archive_content" ); - ?> - - - -
-
- -
-
- - \ No newline at end of file +/** + * The template for displaying 404 pages (not found). + * + * @package Jason + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} + +get_header(); ?> + +
+
+ +
+ + +
+

+ + + +
+

+
    + 'count', + 'order' => 'DESC', + 'show_count' => 1, + 'title_li' => '', + 'number' => 10, + ) ); + ?> +
+
+ + ' . sprintf( esc_html__( 'Try looking in the monthly archives. %1$s', 'jason-lite' ), convert_smilies( ':)' ) ) . '

'; + the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=$archive_content" ); + + the_widget( 'WP_Widget_Tag_Cloud' ); ?> + +
+
+ +
+
+ + - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/assets/icons/arrow-right.svg b/assets/icons/arrow-right.svg index d0e4ced..c3da798 100644 --- a/assets/icons/arrow-right.svg +++ b/assets/icons/arrow-right.svg @@ -1,18 +1 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/assets/icons/close-icon-svg.php b/assets/icons/close-icon-svg.php index d999569..14db4da 100644 --- a/assets/icons/close-icon-svg.php +++ b/assets/icons/close-icon-svg.php @@ -1,5 +1,12 @@ - - - - - \ No newline at end of file + diff --git a/assets/icons/cube-pattern.svg b/assets/icons/cube-pattern.svg index 5545be4..8f75039 100644 --- a/assets/icons/cube-pattern.svg +++ b/assets/icons/cube-pattern.svg @@ -1,10 +1 @@ - - - - - - - - - - \ No newline at end of file + diff --git a/assets/icons/menu-bars-svg.php b/assets/icons/menu-bars-svg.php index ec3ab19..c713863 100644 --- a/assets/icons/menu-bars-svg.php +++ b/assets/icons/menu-bars-svg.php @@ -1,7 +1,12 @@ - - - - - - - \ No newline at end of file + diff --git a/assets/icons/search-icon-svg.php b/assets/icons/search-icon-svg.php index 6043db0..1f8aa9e 100644 --- a/assets/icons/search-icon-svg.php +++ b/assets/icons/search-icon-svg.php @@ -1,5 +1,12 @@ - - - - - \ No newline at end of file + diff --git a/assets/icons/sidebar-icon-svg.php b/assets/icons/sidebar-icon-svg.php index b8a5c12..68fc87d 100644 --- a/assets/icons/sidebar-icon-svg.php +++ b/assets/icons/sidebar-icon-svg.php @@ -1,6 +1,12 @@ - - - - - - \ No newline at end of file + diff --git a/assets/icons/submenu-arrow.svg b/assets/icons/submenu-arrow.svg index 85a8835..ae61890 100644 --- a/assets/icons/submenu-arrow.svg +++ b/assets/icons/submenu-arrow.svg @@ -1,14 +1 @@ - - - - - Created with Sketch. - - - - - - - - - \ No newline at end of file + diff --git a/assets/js/jquery.hoverIntent.js b/assets/js/jquery.hoverIntent.js deleted file mode 100644 index 61970ae..0000000 --- a/assets/js/jquery.hoverIntent.js +++ /dev/null @@ -1,115 +0,0 @@ -/*! - * hoverIntent v1.8.1 // 2014.08.11 // jQuery v1.9.1+ - * http://cherne.net/brian/resources/jquery.hoverIntent.html - * - * You may use hoverIntent under the terms of the MIT license. Basically that - * means you are free to use hoverIntent as long as this header is left intact. - * Copyright 2007, 2014 Brian Cherne - */ - -/* hoverIntent is similar to jQuery's built-in "hover" method except that - * instead of firing the handlerIn function immediately, hoverIntent checks - * to see if the user's mouse has slowed down (beneath the sensitivity - * threshold) before firing the event. The handlerOut function is only - * called after a matching handlerIn. - * - * // basic usage ... just like .hover() - * .hoverIntent( handlerIn, handlerOut ) - * .hoverIntent( handlerInOut ) - * - * // basic usage ... with event delegation! - * .hoverIntent( handlerIn, handlerOut, selector ) - * .hoverIntent( handlerInOut, selector ) - * - * // using a basic configuration object - * .hoverIntent( config ) - * - * @param handlerIn function OR configuration object - * @param handlerOut function OR selector for delegation OR undefined - * @param selector selector OR undefined - * @author Brian Cherne - */ -(function($) { - $.fn.hoverIntent = function(handlerIn,handlerOut,selector) { - - // default configuration values - var cfg = { - interval: 100, - sensitivity: 6, - timeout: 0 - }; - - if ( typeof handlerIn === "object" ) { - cfg = $.extend(cfg, handlerIn ); - } else if ($.isFunction(handlerOut)) { - cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } ); - } else { - cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } ); - } - - // instantiate variables - // cX, cY = current X and Y position of mouse, updated by mousemove event - // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval - var cX, cY, pX, pY; - - // A private function for getting mouse position - var track = function(ev) { - cX = ev.pageX; - cY = ev.pageY; - }; - - // A private function for comparing current and previous mouse position - var compare = function(ev,ob) { - ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); - // compare mouse positions to see if they've crossed the threshold - if ( Math.sqrt( (pX-cX)*(pX-cX) + (pY-cY)*(pY-cY) ) < cfg.sensitivity ) { - $(ob).off("mousemove.hoverIntent",track); - // set hoverIntent state to true (so mouseOut can be called) - ob.hoverIntent_s = true; - return cfg.over.apply(ob,[ev]); - } else { - // set previous coordinates for next time - pX = cX; pY = cY; - // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs) - ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval ); - } - }; - - // A private function for delaying the mouseOut function - var delay = function(ev,ob) { - ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); - ob.hoverIntent_s = false; - return cfg.out.apply(ob,[ev]); - }; - - // A private function for handling mouse 'hovering' - var handleHover = function(e) { - // copy objects to be passed into t (required for event object to be passed in IE) - var ev = $.extend({},e); - var ob = this; - - // cancel hoverIntent timer if it exists - if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } - - // if e.type === "mouseenter" - if (e.type === "mouseenter") { - // set "previous" X and Y position based on initial entry point - pX = ev.pageX; pY = ev.pageY; - // update "current" X and Y position based on mousemove - $(ob).on("mousemove.hoverIntent",track); - // start polling interval (self-calling timeout) to compare mouse coordinates over time - if (!ob.hoverIntent_s) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );} - - // else e.type == "mouseleave" - } else { - // unbind expensive mousemove event - $(ob).off("mousemove.hoverIntent",track); - // if hoverIntent state is true, then call the mouseOut function after the specified delay - if (ob.hoverIntent_s) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );} - } - }; - - // listen for mouseenter and mouseleave - return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector); - }; -})(jQuery); \ No newline at end of file diff --git a/assets/scss/style.scss b/assets/scss/style.scss index ee590ed..55ee451 100644 --- a/assets/scss/style.scss +++ b/assets/scss/style.scss @@ -1,21 +1,28 @@ /* Theme Name: Jason Lite -Theme URI: https://demos.pixelgrade.com/jason-lite/ +Theme URI: https://github.com/pixelgrade/jason-lite Author: Pixelgrade Author URI: https://pixelgrade.com/ Description: Jason Lite is a colorful free WordPress theme designed for publishers of all kind. Whether you’re keeping a straightforward journal of your travels or publishing an photo-heavy scrapbook, Jason makes it easy to showcase your latest news, interesting finds, and long-form writing — or to create collection of photos, videos, and quotes. -Version: 1.1.1 +Version: 1.1.2 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: jason-lite Domain Path: /languages/ Tags: custom-menu, editor-style, custom-logo, translation-ready, blog, news Requires at least: 4.9.9 -Tested up to: 5.1.1 -This theme, like WordPress, is licensed under the GPL. -Use it to make something cool, have fun, and share what you've learned with others. +Tested up to: 5.2.2 -Jason Lite is based on Underscores http://underscores.me/, (C) 2012-2016 Automattic, Inc. +Jason Lite WordPress Theme, Copyright (C) 2017-2019, Pixelgrade. +Jason Lite is distributed under the terms of the GNU GPL v2 or later. + +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 2 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html + +Jason Lite is based on Underscores http://underscores.me/, (C) 2012-2018 Automattic, Inc. +Underscores is distributed under the terms of the GNU GPL v2 or later. */ @import "main"; diff --git a/comments.php b/comments.php index add3ddf..bf4e0fe 100644 --- a/comments.php +++ b/comments.php @@ -1,28 +1,32 @@
- +

' . esc_html__( 'Add Yours', 'jason-lite' ) . ''; ?>

- 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> + 1 && get_option( 'page_comments' ) ) { // Are there comments to navigate through? ?> - +
    - + + // If comments are closed and there are comments, let's leave a little note, shall we? + if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) { ?> -

    +

    - + + comment_form(); ?> -
\ No newline at end of file + diff --git a/editor-style.css b/editor-style.css index 84c7d8b..ceadb0b 100644 --- a/editor-style.css +++ b/editor-style.css @@ -602,8 +602,10 @@ figure { @media only screen and (min-width: 870px) { .twocolumn { -webkit-column-count: 2; + -moz-column-count: 2; column-count: 2; -webkit-column-gap: 40px; + -moz-column-gap: 40px; column-gap: 40px; } } .dropcap { diff --git a/footer.php b/footer.php index 420505f..b0db0fe 100644 --- a/footer.php +++ b/footer.php @@ -1,12 +1,15 @@ @@ -15,20 +18,20 @@
| - PixelGrade' ); ?> + Pixelgrade' ); ?>
@@ -36,4 +39,4 @@ - \ No newline at end of file + diff --git a/functions.php b/functions.php index a2bdd59..e368c81 100644 --- a/functions.php +++ b/functions.php @@ -220,8 +220,7 @@ function jasonlite_scripts() { /* Enqueue Jason Custom Scripts */ wp_register_script( 'jasonlite-velocity-js', get_stylesheet_directory_uri() . '/assets/js/velocity.js', array( 'jquery' ), '1.2.2', true ); - wp_register_script( 'jasonlite-hover-intent', get_stylesheet_directory_uri() . '/assets/js/jquery.hoverIntent.js', array( 'jquery' ), '1.8.1', true ); - wp_register_script( 'jasonlite-arianav', get_stylesheet_directory_uri() . '/assets/js/arianavigation.js', array( 'jquery', 'jasonlite-hover-intent' ), '1.0.0', true ); + wp_register_script( 'jasonlite-arianav', get_stylesheet_directory_uri() . '/assets/js/arianavigation.js', array( 'jquery', 'hoverIntent' ), '1.0.0', true ); wp_enqueue_script( 'jasonlite-scripts', get_stylesheet_directory_uri() . '/assets/js/main.js', array( 'jquery', 'jasonlite-velocity-js', 'jasonlite-arianav' ), $theme->get( 'Version' ), true ); @@ -246,17 +245,7 @@ function jasonlite_scripts() { */ require_once get_template_directory() . '/inc/extras.php'; -/** - * Load the required plugins (TGMPA) logic. - */ -require get_template_directory() . '/inc/required-plugins.php'; - /** * Customizer additions. */ require_once get_template_directory() . '/inc/customizer.php'; - -/** - * Admin dashboard logic. - */ -require get_template_directory() . '/inc/admin/admin.php'; diff --git a/gulpfile.js b/gulpfile.js index 4df8523..7df3d99 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -179,7 +179,9 @@ function removeUnneededFiles(done) { '.jscsrc', '.jshintignore', 'browserslist', - 'babel.config.js' + 'babel.config.js', + 'phpcs.xml', + 'inc/admin/scss' ]; files_to_remove.forEach(function (e, k) { diff --git a/header.php b/header.php index 5b103e3..0328843 100644 --- a/header.php +++ b/header.php @@ -7,6 +7,10 @@ * @package Jason */ +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} + ?> > @@ -81,4 +85,4 @@ -
\ No newline at end of file +
diff --git a/home.php b/home.php index 5d44bbc..591f135 100644 --- a/home.php +++ b/home.php @@ -7,23 +7,25 @@ * @package Jason */ +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} + get_header(); ?>
- + - +

- - - - + - - - + endwhile; - + the_posts_navigation(); + } else { - - - + get_template_part( 'template-parts/content', 'none' ); + } ?>
- - \ No newline at end of file + +if ( ! is_active_sidebar( 'sidebar-1' ) ) { + $content_width = 1450; /* pixels */ +} -
-
+get_header(); ?> - +
+
- + + get_template_part( 'template-parts/content', 'attachment' ); - sprintf( esc_html__( 'Published in %s', 'jason-lite' ), '%title' ), - ) - ); ?> + // If comments are open or we have at least one comment, load up the comment template + if ( comments_open() || get_comments_number() ) { + comments_template(); + } - + // The parent post link. + /* translators: used on the attachment page to link to the parent post */ + the_post_navigation( array( + /* translators: used on the attachment page to link to the parent post */ + 'prev_text' => sprintf( esc_html__( 'Published in %s', 'jason-lite' ), '%title' ), + ) + ); + endwhile; ?> -
-
+
+
- - \ No newline at end of file +addHooks(); - } - - public function addHooks() { - - if ( $this->shouldShow() ) { - add_action( 'admin_notices', array( $this, 'outputMarkup' ) ); - add_action( 'admin_enqueue_scripts', array( $this, 'outputCSS' ) ); - add_action( 'admin_enqueue_scripts', array( $this, 'outputJS' ) ); - } - - add_action( 'wp_ajax_pixcare_install_dismiss_admin_notice', array( $this, 'dismiss_notice' ) ); - add_action( 'switch_theme', array( $this, 'cleanup' ) ); - } - - public function shouldShow() { - global $pagenow; - - // If Pixelgrade Care is already installed and activated, nothing to do. - if ( class_exists( 'PixelgradeCare' ) ) { - return false; - } - - // We want to show it only on the themes.php page and in the dashboard. - if ( $pagenow !== 'themes.php' && $pagenow !== 'index.php' ) { - return false; - } - - // We also don't want to show it when viewing the TGMPA results or tables. - if ( ! empty( $_GET['tgmpa-nonce'] ) ) { - return false; - } - - $dismissed = get_theme_mod( 'pixcare_install_notice_dismissed', false ); - // Earlier than a 7 days, we will not show again. - if ( ! empty( $dismissed ) && ( time() - absint( $dismissed ) < DAY_IN_SECONDS * 7 ) ) { - return false; - } - - if ( current_user_can('manage_options') ) { - return true; - } - - return false; - } - - public function outputMarkup() { - $button_text = esc_html__( 'Install the Pixelgrade Care® plugin', '__theme_txtd' ); - // Pixelgrade Care plugin installed, but not activated. - if ( ! class_exists( 'PixelgradeCare' ) && file_exists( WP_PLUGIN_DIR . '/pixelgrade-care/pixelgrade-care.php' ) ) { - $button_text = esc_html__( 'Activate the Pixelgrade Care® plugin', '__theme_txtd' ); - } - - ?> -
- -
    -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
-
- - -
-
-
- parent(); - if ( $parent ) { - $theme = $parent; - } - $screenshot = $theme->get_screenshot(); - if ( $screenshot ) { ?> - Theme screenshot - -
-
-
-

Let\'s make an experience out of it.', '__theme_txtd' ), $theme->get( 'Name' ) ), wp_kses_allowed_html('post') ); ?>

-

-
    -
  • - Recommended plugins to boost your site.', '__theme_txtd' ), wp_kses_allowed_html() ); ?> -
  • -
  • - Starter Content to make your site look like the demo.', '__theme_txtd' ), wp_kses_allowed_html() ); ?> -
  • -
  • - Premium Support to assist you all the way.', '__theme_txtd' ), wp_kses_allowed_html() ); ?> -
  • -
-
- - - -
-
- -
-
- get_parent_theme_file_uri( $this->get_theme_relative_path( __DIR__ ) . 'notice.css' ), false ); - wp_enqueue_style( 'pixcare_notice_css' ); - } - - public function outputJS() { - wp_register_script( 'pixcare_notice_js', $this->get_parent_theme_file_uri( $this->get_theme_relative_path( __DIR__ ) . 'notice.js' ), array( 'jquery') ); - wp_enqueue_script( 'pixcare_notice_js' ); - - $install_url = wp_nonce_url( - add_query_arg( - array( - 'plugin' => urlencode( 'pixelgrade-care' ), - 'tgmpa-install' => 'install-plugin', - ), - admin_url( 'themes.php?page=install-required-plugins' ) - ), - 'tgmpa-install', - 'tgmpa-nonce' - ); - // & is not something that wp.ajax can actually handle - $install_url = str_replace( 'amp;', '', $install_url ); - - $activate_url = wp_nonce_url( - add_query_arg( - array( - 'plugin' => urlencode( 'pixelgrade-care' ), - 'tgmpa-activate' => 'activate-plugin', - ), - admin_url( 'themes.php?page=install-required-plugins' ) - ), - 'tgmpa-activate', - 'tgmpa-nonce' - ); - // & is not something that wp.ajax can actually handle - $activate_url = str_replace( 'amp;', '', $activate_url ); - - $plugin_status = 'missing'; - // Pixelgrade Care plugin installed, but not activated. - if ( class_exists( 'PixelgradeCare' ) ) { - $plugin_status = 'active'; - } elseif ( file_exists( WP_PLUGIN_DIR . '/pixelgrade-care/pixelgrade-care.php' ) ) { - $plugin_status = 'installed'; - } - - wp_localize_script( 'pixcare_notice_js', 'pixcareNotice', array( - 'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ), - 'installUrl' => esc_url_raw( $install_url ), - 'activateUrl' => esc_url_raw( $activate_url ), - 'themesPluginsUrl' => esc_url( admin_url( 'themes.php?page=install-required-plugins' ) ), - 'pixcareSetupUrl' => esc_url( admin_url( 'index.php?page=pixelgrade_care-setup-wizard' ) ), - 'status' => $plugin_status, - 'i18n' => array( - 'btnInstall' => esc_html__( 'Install the Pixelgrade Care® plugin', '__theme_txtd' ), - 'btnInstalling' => esc_html__( 'Installing Pixelgrade Care®...', '__theme_txtd' ), - 'btnActivate' => esc_html__( 'Activate the Pixelgrade Care® plugin', '__theme_txtd' ), - 'btnActivating' => esc_html__( 'Activating Pixelgrade Care®...', '__theme_txtd' ), - 'btnRedirectingToSetup' => esc_html__( 'Opening the Pixelgrade Care® setup...', '__theme_txtd' ), - 'btnError' => esc_html__( 'Please refresh the page 🙏 and try again...', '__theme_txtd' ), - 'installedSuccessfully' => esc_html__( 'Plugin installed successfully.', '__theme_txtd' ), - 'activatedSuccessfully' => esc_html__( 'Plugin activated successfully.', '__theme_txtd' ), - 'redirectingToSetup' => esc_html__( 'Opening the Pixelgrade Care® setup in a couple of seconds.', '__theme_txtd' ), - 'folderAlreadyExists' => esc_html__( 'Plugin destination folder already exists.', '__theme_txtd' ), - 'error' => esc_html__( 'We are truly sorry 😢 Something went wrong and we couldn\'t make sense of it and continue with the plugin setup.', '__theme_txtd' ), - ), - ) ); - } - - /** - * Process ajax call to dismiss notice. - */ - public function dismiss_notice() { - // Check nonce. - check_ajax_referer( 'pixcare_install_dismiss_admin_notice', 'nonce_dismiss' ); - - // Remember the dismissal (time). - set_theme_mod( 'pixcare_install_notice_dismissed', time()); - - // Redirect if this is not an ajax request. - if ( isset( $_POST['pixcare-notice-no-js'] ) ) { - - // Go back to where we came from. - wp_safe_redirect( wp_get_referer() ); - exit(); - } - - wp_die(); - } - - public function cleanup() { - // If the theme is about to be deactivated, we want to clear the notice dismissal so next time it is active, it will show. - set_theme_mod( 'pixcare_install_notice_dismissed', false ); - } - - /** - * Get the relative theme path of a given absolute path. In case the given path is not absolute, it is returned as received. - * - * @param $path string An absolute path. - * - * @return string A path relative to the current theme directory, without ./ in front. - */ - protected function get_theme_relative_path( $path ) { - if ( empty( $path ) ) { - return ''; - } - - $path = str_replace( trailingslashit( get_template_directory() ), '', $path ); - - return trailingslashit( $path ); - } - - /** - * Retrieves the URL of a file in the parent theme. - * - * It will use the new function in WP 4.7, but will fallback to the old way of doing things otherwise. - * - * @param string $file Optional. File to return the URL for in the template directory. - * @return string The URL of the file. - */ - protected function get_parent_theme_file_uri( $file = '' ) { - if ( function_exists( 'get_parent_theme_file_uri' ) ) { - return get_parent_theme_file_uri( $file ); - } else { - $file = ltrim( $file, '/' ); - - if ( empty( $file ) ) { - $url = get_template_directory_uri(); - } else { - $url = get_template_directory_uri() . '/' . $file; - } - - /** - * Filters the URL to a file in the parent theme. - * - * @since 4.7.0 - * - * @param string $url The file URL. - * @param string $file The requested file to search for. - */ - return apply_filters( 'parent_theme_file_uri', $url, $file ); - } - } - - public static function init() { - return self::instance(); - } - - /** - * Main PixelgradeCare_Install_Notice Instance - * - * Ensures only one instance of PixelgradeCare_Install_Notice is loaded or can be loaded. - * - * @static - * - * @return PixelgradeCare_Install_Notice Main PixelgradeCare_Install_Notice instance - */ - public static function instance() { - if ( is_null( self::$_instance ) ) { - self::$_instance = new self(); - } - return self::$_instance; - } // End instance(). - - /** - * Cloning is forbidden. - */ - public function __clone() { - _doing_it_wrong( __FUNCTION__, esc_html( __( 'Cheatin’ huh?', '__theme_txtd' ) ), null ); - } // End __clone(). - - /** - * Unserializing instances of this class is forbidden. - */ - public function __wakeup() { - _doing_it_wrong( __FUNCTION__, esc_html( __( 'Cheatin’ huh?', '__theme_txtd' ) ), null ); - } // End __wakeup(). -} diff --git a/inc/admin/pixcare-notice/notice.css b/inc/admin/pixcare-notice/notice.css deleted file mode 100644 index 0d71a26..0000000 --- a/inc/admin/pixcare-notice/notice.css +++ /dev/null @@ -1,394 +0,0 @@ -.pixcare-notice__container *, .pixcare-notice__container :before, .pixcare-notice__container :after { - -webkit-box-sizing: border-box; - box-sizing: border-box; } - -.pixcare-notice__container[class] { - display: block; - position: relative; - margin-top: 100px; - margin-bottom: 100px; - border-left: 0; - padding-left: 0; - padding-top: 0; - padding-bottom: 0; - font-size: 14px; - line-height: 1.5; - color: #71777c; } - .pixcare-notice__container[class] p { - font: inherit; - padding: 0; } - .pixcare-notice__container[class] h1 { - font-size: 18px; - line-height: 1.32; - padding: 0; } - @media only screen and (min-width: 600px) { - .pixcare-notice__container[class] { - font-size: 16px; } - .pixcare-notice__container[class] h1 { - font-size: 25px; } } - -.pxg-wizard { - position: absolute; - bottom: 100%; - left: 0; - width: 100%; - height: 100px; - margin: 0; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; - font-size: 12px; } - @media only screen and (min-width: 600px) { - .pxg-wizard { - font-size: inherit; } } - -.pxg-wizard__step { - -webkit-box-flex: 1; - -ms-flex: 1 1 auto; - flex: 1 1 auto; - text-align: center; } - @media only screen and (min-width: 600px) { - .pxg-wizard__step { - -webkit-box-flex: 0; - -ms-flex: 0 1 200px; - flex: 0 1 200px; } } - -.pxg-wizard__step--current { - color: #9562C6; } - .pxg-wizard__step--current span { - color: inherit; } - .pxg-wizard__step--current span b { - background-color: currentColor; } - .pxg-wizard__step--current span b:before, .pxg-wizard__step--current span b:after { - color: #FFFFFF; } - .pxg-wizard__step--current .pxg-wizard__progress:after { - color: #CCCCCC; } - -.pxg-wizard__step--done { - color: #9562C6; } - .pxg-wizard__step--done span { - color: inherit; } - .pxg-wizard__step--done span b { - background-color: currentColor; - -webkit-transform: rotate(-135deg); - transform: rotate(-135deg); } - .pxg-wizard__step--done span b:before, .pxg-wizard__step--done span b:after { - content: ""; - position: absolute; - top: 50%; - left: 50%; - display: block; - width: 2px; - height: 9px; - margin-left: -3px; - margin-top: -4px; - background-color: currentColor; } - .pxg-wizard__step--done span b:after { - width: 6px; - height: 2px; } - .pxg-wizard__step--done span b:before, .pxg-wizard__step--done span b:after { - color: #FFFFFF; } - -.pxg-wizard__label { - display: block; } - -.pxg-wizard__progress { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - color: #CCCCCC; - margin-top: 10px; } - .pxg-wizard__progress:before, .pxg-wizard__progress:after { - content: ""; - height: 4px; - background-color: currentColor; - -webkit-box-flex: 1; - -ms-flex-positive: 1; - flex-grow: 1; } - .pxg-wizard__progress b { - display: block; - width: 22px; - height: 22px; - border: 3px solid currentColor; - border-radius: 50%; } - -.pixcare-notice__wrap { - padding-top: 1px; - padding-bottom: 20px; } - .pixcare-notice__wrap > * { - margin-top: 20px; - margin-left: 20px; } - @media only screen and (min-width: 600px) { - .pixcare-notice__wrap { - padding-bottom: 30px; } - .pixcare-notice__wrap > * { - margin-top: 30px; - margin-left: 30px; } } - @media only screen and (min-width: 1000px) { - .pixcare-notice__wrap { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; } } - -.pixcare-notice__media { - -webkit-box-flex: 0; - -ms-flex: 0 1 50%; - flex: 0 1 50%; - -ms-flex-item-align: stretch; - align-self: stretch; - background-color: #F2F4F5; } - .pixcare-notice__media img { - display: block; - max-width: 100%; - margin-left: auto; - margin-right: auto; } - -.pixcare-notice__screenshot { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; - -webkit-box-align: end; - -ms-flex-align: end; - align-items: flex-end; - max-width: 40em; - height: 100%; - margin-left: auto; - margin-right: auto; - padding: 40px 40px 0; } - -.pixcare-notice__body { - -webkit-box-flex: 0; - -ms-flex: 0 1 50%; - flex: 0 1 50%; } - @media only screen and (min-width: 1300px) { - .pixcare-notice__body { - padding-left: 50px; - padding-right: 40px; - max-width: 40em; - margin-right: auto; } } - .pixcare-notice__body li { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - margin-bottom: 15px; } - .pixcare-notice__body li i { - position: relative; - display: block; - -ms-flex-negative: 0; - flex-shrink: 0; - width: 22px; - height: 22px; - margin-right: 10px; - border: 2px solid currentColor; - border-radius: 50%; - font-style: normal; - color: #9562C6; - -webkit-transform: rotate(-135deg); - transform: rotate(-135deg); } - .pixcare-notice__body li i:before, .pixcare-notice__body li i:after { - content: ""; - position: absolute; - top: 50%; - left: 50%; - display: block; - width: 2px; - height: 9px; - margin-left: -3px; - margin-top: -4px; - background-color: currentColor; } - .pixcare-notice__body li i:after { - width: 6px; - height: 2px; } - -.pixcare-notice-button { - background-color: #9562C6; - color: #FFFFFF; - position: relative; - overflow: hidden; - padding: 18px 35px 19px; - margin-top: 20px; - border-radius: 4px; - border: none; - text-align: left; - -webkit-font-smoothing: antialiased; - -webkit-box-shadow: 0 16px 32px rgba(42, 54, 52, 0.1), 0 16px 16px rgba(42, 54, 52, 0.1), 0 8px 8px rgba(42, 54, 52, 0.1), 0 4px 4px rgba(42, 54, 52, 0.1); - box-shadow: 0 16px 32px rgba(42, 54, 52, 0.1), 0 16px 16px rgba(42, 54, 52, 0.1), 0 8px 8px rgba(42, 54, 52, 0.1), 0 4px 4px rgba(42, 54, 52, 0.1); - -webkit-transform: perspective(1px) translateZ(0); - transform: perspective(1px) translateZ(0); - -webkit-transition: all 0.15s ease-out, width 1s cubic-bezier(0.23, 1, 0.32, 1); - transition: all 0.15s ease-out, width 1s cubic-bezier(0.23, 1, 0.32, 1); - outline: none; } - .pixcare-notice-button:hover { - cursor: pointer; - -webkit-transform: scale(1.05) translateY(-3px); - transform: scale(1.05) translateY(-3px); - -webkit-box-shadow: 0 64px 128px rgba(42, 54, 52, 0.1), 0 32px 64px rgba(42, 54, 52, 0.1), 0 16px 32px rgba(42, 54, 52, 0.1), 0 16px 16px rgba(42, 54, 52, 0.1), 0 8px 8px rgba(42, 54, 52, 0.1), 0 4px 4px rgba(42, 54, 52, 0.1); - box-shadow: 0 64px 128px rgba(42, 54, 52, 0.1), 0 32px 64px rgba(42, 54, 52, 0.1), 0 16px 32px rgba(42, 54, 52, 0.1), 0 16px 16px rgba(42, 54, 52, 0.1), 0 8px 8px rgba(42, 54, 52, 0.1), 0 4px 4px rgba(42, 54, 52, 0.1); } - .pixcare-notice-button:active { - -webkit-transform: perspective(1px) translateY(2px) translateZ(0); - transform: perspective(1px) translateY(2px) translateZ(0); - -webkit-transition-duration: .05s; - transition-duration: .05s; - -webkit-box-shadow: none; - box-shadow: none; } - .pixcare-notice-button.state--plugin-installing, .pixcare-notice-button.state--plugin-activating, .pixcare-notice-button.state--plugin-redirecting { - color: #23282d; - border: 0; - background-color: #eee; - background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 75%, transparent 75%, transparent); - background-size: 50px 50px; - -webkit-box-shadow: none; - box-shadow: none; - -webkit-transform: none; - transform: none; - pointer-events: none; - -webkit-animation: progress-bg-anim 2s linear infinite; - animation: progress-bg-anim 2s linear infinite; } - .pixcare-notice-button.state--error { - background-color: #E3004A; } - .pixcare-notice-button:disabled { - cursor: not-allowed; } - -@-webkit-keyframes progress-bg-anim { - 0% { - background-position: 0 0; } - 100% { - background-position: 50px 50px; } } - -@keyframes progress-bg-anim { - 0% { - background-position: 0 0; } - 100% { - background-position: 50px 50px; } } - -.notice { - display: none; } - -.pixcare-notice-button__overlay { - display: block; - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - background: #9562C6; - -webkit-transform: translateX(-100%); - transform: translateX(-100%); - padding: inherit; - overflow: hidden; } - .pixcare-notice-button__overlay, .pixcare-notice-button__overlay .pixcare-notice-button__text { - -webkit-transition: -webkit-transform 15s cubic-bezier(0.23, 1, 0.32, 1); - transition: -webkit-transform 15s cubic-bezier(0.23, 1, 0.32, 1); - transition: transform 15s cubic-bezier(0.23, 1, 0.32, 1); - transition: transform 15s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 15s cubic-bezier(0.23, 1, 0.32, 1); } - .pixcare-notice-button__overlay .pixcare-notice-button__text { - display: block; - color: #FFFFFF; - -webkit-transform: translateX(100%) translate3d(70px, 0, 0); - transform: translateX(100%) translate3d(70px, 0, 0); } - -.state--plugin-installing .pixcare-notice-button__overlay { - -webkit-transform: translateX(-40%); - transform: translateX(-40%); } - .state--plugin-installing .pixcare-notice-button__overlay .pixcare-notice-button__text { - -webkit-transform: translateX(40%) translate3d(28px, 0, 0); - transform: translateX(40%) translate3d(28px, 0, 0); } - -.state--plugin-activating .pixcare-notice-button__overlay { - -webkit-transform: translateX(-10%); - transform: translateX(-10%); } - .state--plugin-activating .pixcare-notice-button__overlay .pixcare-notice-button__text { - -webkit-transform: translateX(10%) translate3d(7px, 0, 0); - transform: translateX(10%) translate3d(7px, 0, 0); } - .state--plugin-activating .pixcare-notice-button__overlay, .state--plugin-activating .pixcare-notice-button__overlay .pixcare-notice-button__text { - -webkit-transition: -webkit-transform 10s cubic-bezier(0.23, 1, 0.32, 1); - transition: -webkit-transform 10s cubic-bezier(0.23, 1, 0.32, 1); - transition: transform 10s cubic-bezier(0.23, 1, 0.32, 1); - transition: transform 10s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 10s cubic-bezier(0.23, 1, 0.32, 1); } - -.state--plugin-redirecting .pixcare-notice-button__overlay { - -webkit-transform: translateX(0); - transform: translateX(0); } - .state--plugin-redirecting .pixcare-notice-button__overlay .pixcare-notice-button__text { - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); } - .state--plugin-redirecting .pixcare-notice-button__overlay, .state--plugin-redirecting .pixcare-notice-button__overlay .pixcare-notice-button__text { - -webkit-transition: -webkit-transform 5s cubic-bezier(0.23, 1, 0.32, 1); - transition: -webkit-transform 5s cubic-bezier(0.23, 1, 0.32, 1); - transition: transform 5s cubic-bezier(0.23, 1, 0.32, 1); - transition: transform 5s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 5s cubic-bezier(0.23, 1, 0.32, 1); } - -.state--plugin-redirecting .pixcare-notice-button__overlay { - -webkit-transform: translateX(0); - transform: translateX(0); } - .state--plugin-redirecting .pixcare-notice-button__overlay .pixcare-notice-button__text { - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); } - .state--plugin-redirecting .pixcare-notice-button__overlay, .state--plugin-redirecting .pixcare-notice-button__overlay .pixcare-notice-button__text { - -webkit-transition: -webkit-transform 5s cubic-bezier(0.23, 1, 0.32, 1); - transition: -webkit-transform 5s cubic-bezier(0.23, 1, 0.32, 1); - transition: transform 5s cubic-bezier(0.23, 1, 0.32, 1); - transition: transform 5s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 5s cubic-bezier(0.23, 1, 0.32, 1); } - -.state--plugin-invalidated[class] { - -webkit-animation: shake 0.8s 0.1s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; - animation: shake 0.8s 0.1s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; } - -.state--plugin-invalidated .pixcare-notice-button__overlay { - -webkit-transform: translateX(0); - transform: translateX(0); - background: #E3004A; } - .state--plugin-invalidated .pixcare-notice-button__overlay .pixcare-notice-button__text { - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); } - .state--plugin-invalidated .pixcare-notice-button__overlay, .state--plugin-invalidated .pixcare-notice-button__overlay .pixcare-notice-button__text { - -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.23, 1, 0.32, 1); - transition: -webkit-transform 0.3s cubic-bezier(0.23, 1, 0.32, 1); - transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1); - transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), -webkit-transform 0.3s cubic-bezier(0.23, 1, 0.32, 1); } - -@-webkit-keyframes shake { - 10%, 90% { - -webkit-transform: translate3d(-1px, 0, 0); - transform: translate3d(-1px, 0, 0); } - 20%, 80% { - -webkit-transform: translate3d(2px, 0, 0); - transform: translate3d(2px, 0, 0); } - 30%, 50%, 70% { - -webkit-transform: translate3d(-4px, 0, 0); - transform: translate3d(-4px, 0, 0); } - 40%, 60% { - -webkit-transform: translate3d(4px, 0, 0); - transform: translate3d(4px, 0, 0); } } - -@keyframes shake { - 10%, 90% { - -webkit-transform: translate3d(-1px, 0, 0); - transform: translate3d(-1px, 0, 0); } - 20%, 80% { - -webkit-transform: translate3d(2px, 0, 0); - transform: translate3d(2px, 0, 0); } - 30%, 50%, 70% { - -webkit-transform: translate3d(-4px, 0, 0); - transform: translate3d(-4px, 0, 0); } - 40%, 60% { - -webkit-transform: translate3d(4px, 0, 0); - transform: translate3d(4px, 0, 0); } } diff --git a/inc/admin/pixcare-notice/notice.js b/inc/admin/pixcare-notice/notice.js deleted file mode 100644 index d177efb..0000000 --- a/inc/admin/pixcare-notice/notice.js +++ /dev/null @@ -1,138 +0,0 @@ -(function ($) { - $(document).ready(function () { - var temp_url = wp.ajax.settings.url, - $noticeContainer = $( '.pixcare-notice__container' ), - $button = $noticeContainer.find( '.js-handle-pixcare' ), - $text = $noticeContainer.find( '.pixcare-notice-button__text' ), - $status = $noticeContainer.find( '.js-plugin-message' ), - buttonBox; - - if ( $button.length ) { - buttonBox = $button[0].getBoundingClientRect(); - $button.css( 'width', buttonBox.right - buttonBox.left ); - } - - $button.on('click', function() { - let installedSuccessfully = -1, - activatedSuccessfully = -1, - activatedAlready = -1, - noActionTaken = -1, - folderAlreadyExists = -1 - - // Put the button in a loading state - $button.css( 'width', $button.parent().width() ); - $button.addClass('state--plugin-installing').prop('disabled', true); - - /* - * We need to determine what to do first, install or activate. - */ - if ( pixcareNotice.status === 'missing' ) { - $text.html(pixcareNotice.i18n.btnInstalling); - wp.ajax.settings.url = pixcareNotice.installUrl; - } else if ( pixcareNotice.status === 'installed' ) { - $text.html(pixcareNotice.i18n.btnActivating); - wp.ajax.settings.url = pixcareNotice.activateUrl; - } - - wp.a11y.speak($text.html()); - - wp.ajax.send({type: 'GET'}).always(function (response) { - installedSuccessfully = -1 - activatedSuccessfully = -1 - activatedAlready = -1 - noActionTaken = -1 - folderAlreadyExists = -1 - - if (typeof response === 'string') { - installedSuccessfully = response.indexOf('

' + pixcareNotice.i18n.installedSuccessfully + '

'); - activatedSuccessfully = response.indexOf('

'); - noActionTaken = response.indexOf('

No action taken.'); - folderAlreadyExists = response.indexOf('

' + pixcareNotice.i18n.folderAlreadyExists + '

'); - } - - if (installedSuccessfully !== -1) { - wp.a11y.speak(pixcareNotice.i18n.installedSuccessfully); - - /* - * We need to activate the plugin - */ - - $text.html(pixcareNotice.i18n.btnActivating); - wp.a11y.speak(pixcareNotice.i18n.btnActivating); - - wp.ajax.settings.url = pixcareNotice.activateUrl; - - $button.removeClass( 'state--plugin-installing' ).addClass( 'state--plugin-activating' ); - - wp.ajax.send({type: 'GET'}).always(function (response) { - activatedSuccessfully = -1 - noActionTaken = -1 - - if (typeof response === 'string') { - activatedSuccessfully = response.indexOf('

'); - noActionTaken = response.indexOf('

No action taken.'); - } - - if (activatedSuccessfully !== -1 || noActionTaken !== -1) { - wp.a11y.speak(pixcareNotice.i18n.activatedSuccessfully); - - $text.html(pixcareNotice.i18n.btnRedirectingToSetup); - wp.a11y.speak(pixcareNotice.i18n.redirectingToSetup); - - $button.removeClass( 'state--plugin-activating' ).addClass( 'state--plugin-redirecting' ); - - setTimeout(function () { - window.location.href = pixcareNotice.pixcareSetupUrl; - }, 2000); - } else { - $button.removeClass( 'state--plugin-activating' ).addClass( 'state--plugin-invalidated' ); - $text.html(pixcareNotice.i18n.btnError); - - $status.html(pixcareNotice.i18n.error); - - wp.a11y.speak(pixcareNotice.i18n.error); - } - - wp.ajax.settings.url = temp_url; - }); - - } else if (folderAlreadyExists !== -1 || activatedSuccessfully !== -1 || noActionTaken !== -1) { - wp.a11y.speak(pixcareNotice.i18n.activatedSuccessfully); - - $text.html(pixcareNotice.i18n.btnRedirectingToSetup); - wp.a11y.speak(pixcareNotice.i18n.redirectingToSetup); - setTimeout(function () { - window.location.href = pixcareNotice.pixcareSetupUrl; - }, 2000); - } else { - $button.removeClass( 'state--plugin-activating' ).addClass( 'state--plugin-invalidated' ); - $text.html(pixcareNotice.i18n.btnError); - - $status.html(pixcareNotice.i18n.error); - - wp.a11y.speak(pixcareNotice.i18n.error); - } - - wp.ajax.settings.url = temp_url; - }); - wp.ajax.settings.url = temp_url; - }) - - // Send ajax on click of dismiss icon - $noticeContainer.on( 'click', '.notice-dismiss', function() { - ajaxDismiss( $(this) ); - }); - - // Send ajax - function ajaxDismiss( dismissElement ) { - $.ajax({ - url: pixcareNotice.ajaxurl, - type: 'post', - data: { - action: 'pixcare_install_dismiss_admin_notice', - nonce_dismiss: $noticeContainer.find('#nonce-pixcare_install-dismiss').val() - } - }) - } - }); -})(jQuery); diff --git a/inc/admin/pixcare-notice/notice.scss b/inc/admin/pixcare-notice/notice.scss deleted file mode 100644 index aa17aaf..0000000 --- a/inc/admin/pixcare-notice/notice.scss +++ /dev/null @@ -1,438 +0,0 @@ -$purple: #9562C6; -$gray: #71777c; -$gray-light: #CCCCCC; - -@mixin pxg-mark { - transform: rotate(-135deg); - - &:before, - &:after { - content: ""; - position: absolute; - top: 50%; - left: 50%; - - display: block; - width: 2px; - height: 9px; - margin-left: -3px; - margin-top: -4px; - background-color: currentColor; - } - - &:after { - width: 6px; - height: 2px; - } -} - -.pixcare-notice__container { - - *, :before, :after { - box-sizing: border-box; - } -} - -.pixcare-notice__container[class] { - display: block; - position: relative; - margin-top: 100px; - margin-bottom: 100px; - border-left: 0; - padding-left: 0; - padding-top: 0; - padding-bottom: 0; - - font-size: 14px; - line-height: 1.5; - color: $gray; - - p { - font: inherit; - padding: 0; - } - - h1 { - font-size: 18px; - line-height: 1.32; - padding: 0; - } - - @media only screen and (min-width: 600px) { - font-size: 16px; - - h1 { - font-size: 25px; - } - } -} - -.pxg-wizard { - position: absolute; - bottom: 100%; - left: 0; - - width: 100%; - height: 100px; - margin: 0; - - display: flex; - align-items: center; - justify-content: center; - - font-size: 12px; - - @media only screen and (min-width: 600px) { - font-size: inherit; - } -} - -.pxg-wizard__step { - flex: 1 1 auto; - text-align: center; - - @media only screen and (min-width: 600px) { - flex: 0 1 200px; - } -} - -.pxg-wizard__step--current { - color: $purple; - - span { - color: inherit; - - b { - background-color: currentColor; - - &:before, - &:after { - color: #FFFFFF; - } - } - } - - .pxg-wizard__progress:after { - color: $gray-light; - } -} - -.pxg-wizard__step--done { - color: $purple; - - span { - color: inherit; - - b { - background-color: currentColor; - @include pxg-mark; - - &:before, - &:after { - color: #FFFFFF; - } - } - } -} - -.pxg-wizard__label { - display: block; -} - -.pxg-wizard__progress { - display: flex; - align-items: center; - color: $gray-light; - margin-top: 10px; - - &:before, - &:after { - content: ""; - height: 4px; - background-color: currentColor; - flex-grow: 1; - } - - b { - display: block; - width: 22px; - height: 22px; - border: 3px solid currentColor; - border-radius: 50%; - } -} - -$pixcare-notice-spacing: 30px; -$pixcare-notice-mobile-spacing: 20px; - -.pixcare-notice__wrap { - padding-top: 1px; - padding-bottom: $pixcare-notice-mobile-spacing; - - > * { - margin-top: $pixcare-notice-mobile-spacing; - margin-left: $pixcare-notice-mobile-spacing; - } - - @media only screen and (min-width: 600px) { - padding-bottom: $pixcare-notice-spacing; - - > * { - margin-top: $pixcare-notice-spacing; - margin-left: $pixcare-notice-spacing; - } - } - - @media only screen and (min-width: 1000px) { - display: flex; - align-items: center; - } -} - -.pixcare-notice__media { - flex: 0 1 50%; - align-self: stretch; - background-color: #F2F4F5; - - img { - display: block; - max-width: 100%; - margin-left: auto; - margin-right: auto; - } -} - -.pixcare-notice__screenshot { - display: flex; - justify-content: center; - align-items: flex-end; - - max-width: 40em; - height: 100%; - - margin-left: auto; - margin-right: auto; - padding: 40px 40px 0; -} - -.pixcare-notice__body { - flex: 0 1 50%; - - @media only screen and (min-width: 1300px) { - padding-left: 50px; - padding-right: 40px; - - max-width: 40em; - margin-right: auto; - } - - li { - display: flex; - align-items: center; - margin-bottom: 15px; - - i { - position: relative; - display: block; - flex-shrink: 0; - - width: 22px; - height: 22px; - margin-right: 10px; - border: 2px solid currentColor; - border-radius: 50%; - - font-style: normal; - color: $purple; - @include pxg-mark; - } - } -} - -.pixcare-notice-button { - background-color: $purple; - color: #FFFFFF; - - position: relative; - overflow: hidden; - - padding: 18px 35px 19px; - margin-top: 20px; - border-radius: 4px; - border: none; - text-align: left; - - -webkit-font-smoothing: antialiased; - - box-shadow: - 0 16px 32px rgba(42, 54, 52, 0.1), - 0 16px 16px rgba(42, 54, 52, 0.1), - 0 8px 8px rgba(42, 54, 52, 0.1), - 0 4px 4px rgba(42, 54, 52, 0.1); - - transform: perspective(1px) translateZ(0); - transition: - all .15s ease-out, - width 1s cubic-bezier(0.230, 1.000, 0.320, 1.000); - outline: none; - - &:hover { - cursor: pointer; - transform: scale(1.05) translateY(-3px); - box-shadow: - 0 64px 128px rgba(42, 54, 52, 0.1), - 0 32px 64px rgba(42, 54, 52, 0.1), - 0 16px 32px rgba(42, 54, 52, 0.1), - 0 16px 16px rgba(42, 54, 52, 0.1), - 0 8px 8px rgba(42, 54, 52, 0.1), - 0 4px 4px rgba(42, 54, 52, 0.1); - } - - &:active { - transform: perspective(1px) translateY(2px) translateZ(0); - transition-duration: .05s; - box-shadow: none; - } - - &.state--plugin-installing, - &.state--plugin-activating, - &.state--plugin-redirecting { - color: #23282d; - border: 0; - background-color: #eee; - background-image: linear-gradient(-45deg, rgba(255, 255, 255, .3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .3) 50%, rgba(255, 255, 255, .3) 75%, transparent 75%, transparent); - background-size: 50px 50px; - box-shadow: none; - transform: none; - pointer-events: none; - animation: progress-bg-anim 2s linear infinite; - } - - &.state--error { - background-color: #E3004A; - } - - &:disabled { - cursor: not-allowed; - } -} - -@keyframes progress-bg-anim { - 0% { - background-position: 0 0 - } - 100% { - background-position: 50px 50px - } -} - -.notice { - display: none; -} - -.pixcare-notice-button__overlay { - display: block; - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - background: $purple; - transform: translateX(-100%); - padding: inherit; - overflow: hidden; - - &, .pixcare-notice-button__text { - transition: transform 15s cubic-bezier(0.230, 1.000, 0.320, 1.000); - } - - .pixcare-notice-button__text { - display: block; - color: #FFFFFF; - transform: translateX(100%) translate3d(70px,0,0); - } -} - -.state--plugin-installing { - - .pixcare-notice-button__overlay { - transform: translateX(-40%); - - .pixcare-notice-button__text { - transform: translateX(40%) translate3d(28px,0,0); - } - } -} - -.state--plugin-activating { - - .pixcare-notice-button__overlay { - transform: translateX(-10%); - - .pixcare-notice-button__text { - transform: translateX(10%) translate3d(7px,0,0); - } - - &, .pixcare-notice-button__text { - transition: transform 10s cubic-bezier(0.230, 1.000, 0.320, 1.000); - } - } -} - -.state--plugin-redirecting { - - .pixcare-notice-button__overlay { - transform: translateX(0); - - .pixcare-notice-button__text { - transform: translate3d(0,0,0); - } - - &, .pixcare-notice-button__text { - transition: transform 5s cubic-bezier(0.230, 1.000, 0.320, 1.000); - } - } -} - -.state--plugin-redirecting { - - .pixcare-notice-button__overlay { - transform: translateX(0); - - .pixcare-notice-button__text { - transform: translate3d(0,0,0); - } - - &, .pixcare-notice-button__text { - transition: transform 5s cubic-bezier(0.230, 1.000, 0.320, 1.000); - } - } -} - -.state--plugin-invalidated { - - &[class] { - animation: shake 0.8s .1s cubic-bezier(.36,.07,.19,.97) both; - } - - .pixcare-notice-button__overlay { - transform: translateX(0); - background: #E3004A; - - .pixcare-notice-button__text { - transform: translate3d(0,0,0); - } - - &, .pixcare-notice-button__text { - transition: transform .3s cubic-bezier(0.230, 1.000, 0.320, 1.000); - } - } - -} - -@keyframes shake { - 10%, 90% { transform: translate3d(-1px, 0, 0); } - 20%, 80% { transform: translate3d(2px, 0, 0); } - 30%, 50%, 70% { transform: translate3d(-4px, 0, 0); } - 40%, 60% { transform: translate3d(4px, 0, 0); } -} \ No newline at end of file diff --git a/inc/admin/scss/admin.scss b/inc/admin/scss/admin.scss deleted file mode 100644 index 6e2167e..0000000 --- a/inc/admin/scss/admin.scss +++ /dev/null @@ -1,27 +0,0 @@ -$label-bg-color: #DE1651; -$label-border-radius: 8px; -$label-font-size: 14px; - -/*Label for Pro Widgets*/ - -[id*="featured-posts-carousel"], -[id*="featured-posts-6cards"], -[id*="featured-posts-list"], -[id*="categories-image-grid"], -[id*="pixelgrade-promo-box"] { - .widget-title h3:before { - content: "pro"; - display: inline-block; - margin-right: 5px; - padding: 4px 12px; - border-radius: $label-border-radius; - - font-size: $label-font-size; - font-weight: 300; - line-height: 1; - text-transform: capitalize; - - background-color: $label-bg-color; - color: #ffffff; - } -} diff --git a/inc/admin/scss/customizer.scss b/inc/admin/scss/customizer.scss index bebba81..8b2c00b 100644 --- a/inc/admin/scss/customizer.scss +++ b/inc/admin/scss/customizer.scss @@ -28,9 +28,9 @@ $button-bg-color: #8E65C0; } /* Styling for buttons */ -#sub-accordion-section-pro__section { +#customize-theme-controls { .upsell-container { - .button-primary { + .button.button-primary { width: 100%; cursor: pointer; transition-duration: .2s; diff --git a/inc/customizer.php b/inc/customizer.php index 938a68a..d27ff04 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -53,7 +53,6 @@ function jasonlite_customize_register( $wp_customize ) { 'type' => 'hidden', ) ); } - add_action( 'customize_register', 'jasonlite_customize_register' ); /** diff --git a/inc/extras.php b/inc/extras.php index 532a6e3..f5d5f6c 100644 --- a/inc/extras.php +++ b/inc/extras.php @@ -26,7 +26,6 @@ function jasonlite_body_classes( $classes ) { return $classes; } - add_filter( 'body_class', 'jasonlite_body_classes' ); /** @@ -170,7 +169,7 @@ class="comment__timestamp"> 'Jason', 'slug' => 'jason', 'id' => 'MA1wM', 'type' => 'theme_wporg', 'digest' => '543d392d648e5904ef4f0c6b32936b8c', ); - - return $ids; +function jasonlite_skip_link_focus_fix() { + // The following is minified via `terser --compress --mangle -- js/skip-link-focus-fix.js`. + ?> + + 'Pixelgrade Care', - 'slug' => 'pixelgrade-care', - 'force_activation' => false, - 'force_deactivation' => false, - 'required' => false, - 'source' => $protocol . '//wupdates.com/api_wupl_version/JxbVe/2v5t1czd3vw4kmb5xqmyxj1kkwmnt9q0463lhj393r5yxtshdyg05jssgd4jglnfx7A2vdxtfdcf78r9r1sm217k4ht3r2g7pkdng5f6tgwyrk23wryA0pjxvs7gwhhb', - 'external_url' => $protocol . '//github.com/pixelgrade/pixelgrade_care', - 'version' => '1.5.0', - 'is_automatic' => false, - ), - ); - - $config = array( - 'domain' => '__theme_txtd', // Text domain - likely want to be the same as your theme. - 'default_path' => '', // Default absolute path to pre-packaged plugins - 'menu' => 'install-required-plugins', // Menu slug - 'has_notices' => true, // Show admin notices or not - 'is_automatic' => false, // Automatically activate plugins after installation or not - 'message' => '', // Message to output right before the plugins table - 'strings' => array( - 'page_title' => esc_html__( 'Install Required Plugins', '__theme_txtd' ), - 'menu_title' => esc_html__( 'Install Plugins', '__theme_txtd' ), - 'installing' => esc_html__( 'Installing Plugin: %s', '__theme_txtd' ), - // %1$s = plugin name - 'oops' => esc_html__( 'Something went wrong with the plugin API.', '__theme_txtd' ), - 'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', '__theme_txtd' ), - // %1$s = plugin name(s) - 'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', '__theme_txtd' ), - // %1$s = plugin name(s) - 'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.', '__theme_txtd' ), - // %1$s = plugin name(s) - 'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', '__theme_txtd' ), - // %1$s = plugin name(s) - 'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.', '__theme_txtd' ), - // %1$s = plugin name(s) - 'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.', '__theme_txtd' ), - // %1$s = plugin name(s) - 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', '__theme_txtd' ), - // %1$s = plugin name(s) - 'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.', '__theme_txtd' ), - // %1$s = plugin name(s) - 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins', '__theme_txtd' ), - 'activate_link' => _n_noop( 'Activate installed plugin', 'Activate installed plugins', '__theme_txtd' ), - 'return' => esc_html__( 'Return to Required Plugins Installer', '__theme_txtd' ), - 'plugin_activated' => esc_html__( 'Plugin activated successfully.', '__theme_txtd' ), - 'complete' => esc_html__( 'All plugins installed and activated successfully. %s', '__theme_txtd' ) - // %1$s = dashboard link - ) - ); - - tgmpa( $plugins, $config ); - -} -add_action( 'tgmpa_register', 'jason_lite_register_required_plugins', 995 ); diff --git a/inc/required-plugins/class-tgm-plugin-activation.php b/inc/required-plugins/class-tgm-plugin-activation.php deleted file mode 100644 index 3ef58b4..0000000 --- a/inc/required-plugins/class-tgm-plugin-activation.php +++ /dev/null @@ -1,3760 +0,0 @@ -wp_version = $GLOBALS['wp_version']; - - // Announce that the class is ready, and pass the object (for advanced use). - do_action_ref_array( 'tgmpa_init', array( $this ) ); - - - - // When the rest of WP has loaded, kick-start the rest of the class. - add_action( 'init', array( $this, 'init' ) ); - } - - /** - * Magic method to (not) set protected properties from outside of this class. - * - * {@internal hackedihack... There is a serious bug in v2.3.2 - 2.3.6 where the `menu` property - * is being assigned rather than tested in a conditional, effectively rendering it useless. - * This 'hack' prevents this from happening.}} - * - * @see https://github.com/TGMPA/TGM-Plugin-Activation/blob/2.3.6/tgm-plugin-activation/class-tgm-plugin-activation.php#L1593 - * - * @since 2.5.2 - * - * @param string $name Name of an inaccessible property. - * @param mixed $value Value to assign to the property. - * @return void Silently fail to set the property when this is tried from outside of this class context. - * (Inside this class context, the __set() method if not used as there is direct access.) - */ - public function __set( $name, $value ) { - return; - } - - /** - * Magic method to get the value of a protected property outside of this class context. - * - * @since 2.5.2 - * - * @param string $name Name of an inaccessible property. - * @return mixed The property value. - */ - public function __get( $name ) { - return $this->{$name}; - } - - /** - * Initialise the interactions between this class and WordPress. - * - * Hooks in three new methods for the class: admin_menu, notices and styles. - * - * @since 2.0.0 - * - * @see TGM_Plugin_Activation::admin_menu() - * @see TGM_Plugin_Activation::notices() - * @see TGM_Plugin_Activation::styles() - */ - public function init() { - /** - * By default TGMPA only loads on the WP back-end and not in an Ajax call. Using this filter - * you can overrule that behaviour. - * - * @since 2.5.0 - * - * @param bool $load Whether or not TGMPA should load. - * Defaults to the return of `is_admin() && ! defined( 'DOING_AJAX' )`. - */ - if ( true !== apply_filters( 'tgmpa_load', ( is_admin() && ! defined( 'DOING_AJAX' ) ) ) ) { - return; - } - - // Load class strings. - $this->strings = array( - 'page_title' => esc_html__( 'Install Required Plugins', '__theme_txtd' ), - 'menu_title' => esc_html__( 'Install Plugins', '__theme_txtd' ), - /* translators: %s: plugin name. */ - 'installing' => esc_html__( 'Installing Plugin: %s', '__theme_txtd' ), - /* translators: %s: plugin name. */ - 'updating' => esc_html__( 'Updating Plugin: %s', '__theme_txtd' ), - 'oops' => esc_html__( 'Something went wrong with the plugin API.', '__theme_txtd' ), - 'notice_can_install_required' => _n_noop( - /* translators: 1: plugin name(s). */ - 'This theme requires the following plugin: %1$s.', - 'This theme requires the following plugins: %1$s.', - '__theme_txtd' - ), - 'notice_can_install_recommended' => _n_noop( - /* translators: 1: plugin name(s). */ - 'This theme recommends the following plugin: %1$s.', - 'This theme recommends the following plugins: %1$s.', - '__theme_txtd' - ), - 'notice_ask_to_update' => _n_noop( - /* translators: 1: plugin name(s). */ - 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', - 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', - '__theme_txtd' - ), - 'notice_ask_to_update_maybe' => _n_noop( - /* translators: 1: plugin name(s). */ - 'There is an update available for: %1$s.', - 'There are updates available for the following plugins: %1$s.', - '__theme_txtd' - ), - 'notice_can_activate_required' => _n_noop( - /* translators: 1: plugin name(s). */ - 'The following required plugin is currently inactive: %1$s.', - 'The following required plugins are currently inactive: %1$s.', - '__theme_txtd' - ), - 'notice_can_activate_recommended' => _n_noop( - /* translators: 1: plugin name(s). */ - 'The following recommended plugin is currently inactive: %1$s.', - 'The following recommended plugins are currently inactive: %1$s.', - '__theme_txtd' - ), - 'install_link' => _n_noop( - 'Begin installing plugin', - 'Begin installing plugins', - '__theme_txtd' - ), - 'update_link' => _n_noop( - 'Begin updating plugin', - 'Begin updating plugins', - '__theme_txtd' - ), - 'activate_link' => _n_noop( - 'Begin activating plugin', - 'Begin activating plugins', - '__theme_txtd' - ), - 'return' => esc_html__( 'Return to Required Plugins Installer', '__theme_txtd' ), - 'dashboard' => esc_html__( 'Return to the Dashboard', '__theme_txtd' ), - 'plugin_activated' => esc_html__( 'Plugin activated successfully.', '__theme_txtd' ), - 'activated_successfully' => esc_html__( 'The following plugin was activated successfully:', '__theme_txtd' ), - /* translators: 1: plugin name. */ - 'plugin_already_active' => esc_html__( 'No action taken. Plugin %1$s was already active.', '__theme_txtd' ), - /* translators: 1: plugin name. */ - 'plugin_needs_higher_version' => esc_html__( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', '__theme_txtd' ), - /* translators: 1: dashboard link. */ - 'complete' => esc_html__( 'All plugins installed and activated successfully. %1$s', '__theme_txtd' ), - 'dismiss' => esc_html__( 'Dismiss this notice', '__theme_txtd' ), - 'notice_cannot_install_activate' => esc_html__( 'There are one or more required or recommended plugins to install, update or activate.', '__theme_txtd' ), - 'contact_admin' => esc_html__( 'Please contact the administrator of this site for help.', '__theme_txtd' ), - ); - - do_action( 'tgmpa_register' ); - - /* After this point, the plugins should be registered and the configuration set. */ - - // Proceed only if we have plugins to handle. - if ( empty( $this->plugins ) || ! is_array( $this->plugins ) ) { - return; - } - - // Set up the menu and notices if we still have outstanding actions. - if ( true !== $this->is_tgmpa_complete() ) { - // Sort the plugins. - array_multisort( $this->sort_order, SORT_ASC, $this->plugins ); - - add_action( 'admin_menu', array( $this, 'admin_menu' ) ); - add_action( 'admin_head', array( $this, 'dismiss' ) ); - - // Prevent the normal links from showing underneath a single install/update page. - add_filter( 'install_plugin_complete_actions', array( $this, 'actions' ) ); - add_filter( 'update_plugin_complete_actions', array( $this, 'actions' ) ); - - if ( $this->has_notices ) { - add_action( 'admin_notices', array( $this, 'notices' ) ); - add_action( 'admin_init', array( $this, 'admin_init' ), 1 ); - add_action( 'admin_enqueue_scripts', array( $this, 'thickbox' ) ); - } - } - - // If needed, filter plugin action links. - add_action( 'load-plugins.php', array( $this, 'add_plugin_action_link_filters' ), 1 ); - - // Make sure things get reset on switch theme. - add_action( 'switch_theme', array( $this, 'flush_plugins_cache' ) ); - - if ( $this->has_notices ) { - add_action( 'switch_theme', array( $this, 'update_dismiss' ) ); - } - - // Setup the force activation hook. - if ( true === $this->has_forced_activation ) { - add_action( 'admin_init', array( $this, 'force_activation' ) ); - } - - // Setup the force deactivation hook. - if ( true === $this->has_forced_deactivation ) { - add_action( 'switch_theme', array( $this, 'force_deactivation' ) ); - } - } - - - - - - - - /** - * Hook in plugin action link filters for the WP native plugins page. - * - * - Prevent activation of plugins which don't meet the minimum version requirements. - * - Prevent deactivation of force-activated plugins. - * - Add update notice if update available. - * - * @since 2.5.0 - */ - public function add_plugin_action_link_filters() { - foreach ( $this->plugins as $slug => $plugin ) { - if ( false === $this->can_plugin_activate( $slug ) ) { - add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_activate' ), 20 ); - } - - if ( true === $plugin['force_activation'] ) { - add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_deactivate' ), 20 ); - } - - if ( false !== $this->does_plugin_require_update( $slug ) ) { - add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_update' ), 20 ); - } - } - } - - /** - * Remove the 'Activate' link on the WP native plugins page if the plugin does not meet the - * minimum version requirements. - * - * @since 2.5.0 - * - * @param array $actions Action links. - * @return array - */ - public function filter_plugin_action_links_activate( $actions ) { - unset( $actions['activate'] ); - - return $actions; - } - - /** - * Remove the 'Deactivate' link on the WP native plugins page if the plugin has been set to force activate. - * - * @since 2.5.0 - * - * @param array $actions Action links. - * @return array - */ - public function filter_plugin_action_links_deactivate( $actions ) { - unset( $actions['deactivate'] ); - - return $actions; - } - - /** - * Add a 'Requires update' link on the WP native plugins page if the plugin does not meet the - * minimum version requirements. - * - * @since 2.5.0 - * - * @param array $actions Action links. - * @return array - */ - public function filter_plugin_action_links_update( $actions ) { - $actions['update'] = sprintf( - '%3$s', - esc_url( $this->get_tgmpa_status_url( 'update' ) ), - esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', '__theme_txtd' ), - esc_html__( 'Update Required', '__theme_txtd' ) - ); - - return $actions; - } - - /** - * Handles calls to show plugin information via links in the notices. - * - * We get the links in the admin notices to point to the TGMPA page, rather - * than the typical plugin-install.php file, so we can prepare everything - * beforehand. - * - * WP does not make it easy to show the plugin information in the thickbox - - * here we have to require a file that includes a function that does the - * main work of displaying it, enqueue some styles, set up some globals and - * finally call that function before exiting. - * - * Down right easy once you know how... - * - * Returns early if not the TGMPA page. - * - * @since 2.1.0 - * - * @global string $tab Used as iframe div class names, helps with styling - * @global string $body_id Used as the iframe body ID, helps with styling - * - * @return null Returns early if not the TGMPA page. - */ - public function admin_init() { - if ( ! $this->is_tgmpa_page() ) { - return; - } - - if ( isset( $_REQUEST['tab'] ) && 'plugin-information' === $_REQUEST['tab'] ) { - // Needed for install_plugin_information(). - require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; - - wp_enqueue_style( 'plugin-install' ); - - global $tab, $body_id; - $body_id = 'plugin-information'; - // @codingStandardsIgnoreStart - $tab = 'plugin-information'; - // @codingStandardsIgnoreEnd - - install_plugin_information(); - - exit; - } - } - - /** - * Enqueue thickbox scripts/styles for plugin info. - * - * Thickbox is not automatically included on all admin pages, so we must - * manually enqueue it for those pages. - * - * Thickbox is only loaded if the user has not dismissed the admin - * notice or if there are any plugins left to install and activate. - * - * @since 2.1.0 - */ - public function thickbox() { - if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) { - add_thickbox(); - } - } - - /** - * Adds submenu page if there are plugin actions to take. - * - * This method adds the submenu page letting users know that a required - * plugin needs to be installed. - * - * This page disappears once the plugin has been installed and activated. - * - * @since 1.0.0 - * - * @see TGM_Plugin_Activation::init() - * @see TGM_Plugin_Activation::install_plugins_page() - * - * @return null Return early if user lacks capability to install a plugin. - */ - public function admin_menu() { - // Make sure privileges are correct to see the page. - if ( ! current_user_can( 'install_plugins' ) ) { - return; - } - - $args = apply_filters( - 'tgmpa_admin_menu_args', - array( - 'parent_slug' => $this->parent_slug, // Parent Menu slug. - 'page_title' => $this->strings['page_title'], // Page title. - 'menu_title' => $this->strings['menu_title'], // Menu title. - 'capability' => $this->capability, // Capability. - 'menu_slug' => $this->menu, // Menu slug. - 'function' => array( $this, 'install_plugins_page' ), // Callback. - ) - ); - - $this->add_admin_menu( $args ); - } - - /** - * Add the menu item. - * - * {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA - * generator on the website.}} - * - * @since 2.5.0 - * - * @param array $args Menu item configuration. - */ - protected function add_admin_menu( array $args ) { - $this->page_hook = add_theme_page( $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] ); - } - - /** - * Echoes plugin installation form. - * - * This method is the callback for the admin_menu method function. - * This displays the admin page and form area where the user can select to install and activate the plugin. - * Aborts early if we're processing a plugin installation action. - * - * @since 1.0.0 - * - * @return null Aborts early if we're processing a plugin installation action. - */ - public function install_plugins_page() { - // Store new instance of plugin table in object. - $plugin_table = new TGMPA_List_Table; - - // Return early if processing a plugin installation action. - if ( ( ( 'tgmpa-bulk-install' === $plugin_table->current_action() || 'tgmpa-bulk-update' === $plugin_table->current_action() ) && $plugin_table->process_bulk_actions() ) || $this->do_plugin_install() ) { - return; - } - - // Force refresh of available plugin information so we'll know about manual updates/deletes. - wp_clean_plugins_cache( false ); - - ?> -

-

- prepare_items(); ?> - - message ) && is_string( $this->message ) ) { - echo wp_kses_post( $this->message ); // WPCS: XSS OK. - } - ?> - views(); ?> - -
- - - display(); ?> -
-
- sanitize_key( urldecode( $_GET['plugin'] ) ); - - if ( ! isset( $this->plugins[ $slug ] ) ) { - return false; - } - - // Was an install or upgrade action link clicked? - if ( ( isset( $_GET['tgmpa-install'] ) && 'install-plugin' === $_GET['tgmpa-install'] ) || ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) ) { - - $install_type = 'install'; - if ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) { - $install_type = 'update'; - } - - check_admin_referer( 'tgmpa-' . $install_type, 'tgmpa-nonce' ); - - // Pass necessary information via URL if WP_Filesystem is needed. - $url = wp_nonce_url( - add_query_arg( - array( - 'plugin' => urlencode( $slug ), - 'tgmpa-' . $install_type => $install_type . '-plugin', - ), - $this->get_tgmpa_url() - ), - 'tgmpa-' . $install_type, - 'tgmpa-nonce' - ); - - $method = ''; // Leave blank so WP_Filesystem can populate it as necessary. - - if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, array() ) ) ) { - return true; - } - - if ( ! WP_Filesystem( $creds ) ) { - request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, array() ); // Setup WP_Filesystem. - return true; - } - - /* If we arrive here, we have the filesystem. */ - - // Prep variables for Plugin_Installer_Skin class. - $extra = array(); - $extra['slug'] = $slug; // Needed for potentially renaming of directory name. - $source = $this->get_download_url( $slug ); - $api = ( 'repo' === $this->plugins[ $slug ]['source_type'] ) ? $this->get_plugins_api( $slug ) : null; - $api = ( false !== $api ) ? $api : null; - - $url = add_query_arg( - array( - 'action' => $install_type . '-plugin', - 'plugin' => urlencode( $slug ), - ), - 'update.php' - ); - - if ( ! class_exists( 'Plugin_Upgrader', false ) ) { - require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; - } - - $title = ( 'update' === $install_type ) ? $this->strings['updating'] : $this->strings['installing']; - $skin_args = array( - 'type' => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload', - 'title' => sprintf( $title, $this->plugins[ $slug ]['name'] ), - 'url' => esc_url_raw( $url ), - 'nonce' => $install_type . '-plugin_' . $slug, - 'plugin' => '', - 'api' => $api, - 'extra' => $extra, - ); - unset( $title ); - - if ( 'update' === $install_type ) { - $skin_args['plugin'] = $this->plugins[ $slug ]['file_path']; - $skin = new Plugin_Upgrader_Skin( $skin_args ); - } else { - $skin = new Plugin_Installer_Skin( $skin_args ); - } - - // Create a new instance of Plugin_Upgrader. - $upgrader = new Plugin_Upgrader( $skin ); - - // Perform the action and install the plugin from the $source urldecode(). - add_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 ); - - if ( 'update' === $install_type ) { - // Inject our info into the update transient. - $to_inject = array( $slug => $this->plugins[ $slug ] ); - $to_inject[ $slug ]['source'] = $source; - $this->inject_update_info( $to_inject ); - - $upgrader->upgrade( $this->plugins[ $slug ]['file_path'] ); - } else { - $upgrader->install( $source ); - } - - remove_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1 ); - - // Make sure we have the correct file path now the plugin is installed/updated. - $this->populate_file_path( $slug ); - - // Only activate plugins if the config option is set to true and the plugin isn't - // already active (upgrade). - if ( $this->is_automatic && ! $this->is_plugin_active( $slug ) ) { - $plugin_activate = $upgrader->plugin_info(); // Grab the plugin info from the Plugin_Upgrader method. - if ( false === $this->activate_single_plugin( $plugin_activate, $slug, true ) ) { - return true; // Finish execution of the function early as we encountered an error. - } - } - - $this->show_tgmpa_version(); - - // Display message based on if all plugins are now active or not. - if ( $this->is_tgmpa_complete() ) { - echo '

', sprintf( esc_html( $this->strings['complete'] ), '' . esc_html__( 'Return to the Dashboard', '__theme_txtd' ) . '' ), '

'; - echo ''; - } else { - echo '

' . esc_html( $this->strings['return'] ) . '

'; - } - - return true; - } elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) { - // Activate action link was clicked. - check_admin_referer( 'tgmpa-activate', 'tgmpa-nonce' ); - - if ( false === $this->activate_single_plugin( $this->plugins[ $slug ]['file_path'], $slug ) ) { - return true; // Finish execution of the function early as we encountered an error. - } - } - - return false; - } - - /** - * Inject information into the 'update_plugins' site transient as WP checks that before running an update. - * - * @since 2.5.0 - * - * @param array $plugins The plugin information for the plugins which are to be updated. - */ - public function inject_update_info( $plugins ) { - $repo_updates = get_site_transient( 'update_plugins' ); - - if ( ! is_object( $repo_updates ) ) { - $repo_updates = new stdClass; - } - - foreach ( $plugins as $slug => $plugin ) { - $file_path = $plugin['file_path']; - - if ( empty( $repo_updates->response[ $file_path ] ) ) { - $repo_updates->response[ $file_path ] = new stdClass; - } - - // We only really need to set package, but let's do all we can in case WP changes something. - $repo_updates->response[ $file_path ]->slug = $slug; - $repo_updates->response[ $file_path ]->plugin = $file_path; - $repo_updates->response[ $file_path ]->new_version = $plugin['version']; - $repo_updates->response[ $file_path ]->package = $plugin['source']; - if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin['external_url'] ) ) { - $repo_updates->response[ $file_path ]->url = $plugin['external_url']; - } - } - - set_site_transient( 'update_plugins', $repo_updates ); - } - - /** - * Adjust the plugin directory name if necessary. - * - * The final destination directory of a plugin is based on the subdirectory name found in the - * (un)zipped source. In some cases - most notably GitHub repository plugin downloads -, this - * subdirectory name is not the same as the expected slug and the plugin will not be recognized - * as installed. This is fixed by adjusting the temporary unzipped source subdirectory name to - * the expected plugin slug. - * - * @since 2.5.0 - * - * @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/. - * @param string $remote_source Path to upgrade/zip-file-name.tmp. - * @param \WP_Upgrader $upgrader Instance of the upgrader which installs the plugin. - * @return string $source - */ - public function maybe_adjust_source_dir( $source, $remote_source, $upgrader ) { - if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS['wp_filesystem'] ) ) { - return $source; - } - - // Check for single file plugins. - $source_files = array_keys( $GLOBALS['wp_filesystem']->dirlist( $remote_source ) ); - if ( 1 === count( $source_files ) && false === $GLOBALS['wp_filesystem']->is_dir( $source ) ) { - return $source; - } - - // Multi-file plugin, let's see if the directory is correctly named. - $desired_slug = ''; - - // Figure out what the slug is supposed to be. - if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options['extra']['slug'] ) ) { - $desired_slug = $upgrader->skin->options['extra']['slug']; - } else { - // Bulk installer contains less info, so fall back on the info registered here. - foreach ( $this->plugins as $slug => $plugin ) { - if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin['name'] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) { - $desired_slug = $slug; - break; - } - } - unset( $slug, $plugin ); - } - - if ( ! empty( $desired_slug ) ) { - $subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) ); - - if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) { - $from_path = untrailingslashit( $source ); - $to_path = trailingslashit( $remote_source ) . $desired_slug; - - if ( true === $GLOBALS['wp_filesystem']->move( $from_path, $to_path ) ) { - return trailingslashit( $to_path ); - } else { - return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', '__theme_txtd' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', '__theme_txtd' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); - } - } elseif ( empty( $subdir_name ) ) { - return new WP_Error( 'packaged_wrong', esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', '__theme_txtd' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', '__theme_txtd' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); - } - } - - return $source; - } - - /** - * Activate a single plugin and send feedback about the result to the screen. - * - * @since 2.5.0 - * - * @param string $file_path Path within wp-plugins/ to main plugin file. - * @param string $slug Plugin slug. - * @param bool $automatic Whether this is an automatic activation after an install. Defaults to false. - * This determines the styling of the output messages. - * @return bool False if an error was encountered, true otherwise. - */ - protected function activate_single_plugin( $file_path, $slug, $automatic = false ) { - if ( $this->can_plugin_activate( $slug ) ) { - $activate = activate_plugin( $file_path ); - - if ( is_wp_error( $activate ) ) { - echo '

' . wp_kses_post( $activate->get_error_message() ) . '

' . - '

' . esc_html( $this->strings['return'] ) . '

'; - - return false; // End it here if there is an error with activation. - } else { - if ( ! $automatic ) { - // Make sure message doesn't display again if bulk activation is performed - // immediately after a single activation. - if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK. - echo '

', esc_html( $this->strings['activated_successfully'] ), ' ', esc_html( $this->plugins[ $slug ]['name'] ), '.

'; - } - } else { - // Simpler message layout for use on the plugin install page. - echo '

', esc_html( $this->strings['plugin_activated'] ), '

'; - } - } - } elseif ( $this->is_plugin_active( $slug ) ) { - // No simpler message format provided as this message should never be encountered - // on the plugin install page. - echo '

', - sprintf( - esc_html( $this->strings['plugin_already_active'] ), - '' . esc_html( $this->plugins[ $slug ]['name'] ) . '' - ), - '

'; - } elseif ( $this->does_plugin_require_update( $slug ) ) { - if ( ! $automatic ) { - // Make sure message doesn't display again if bulk activation is performed - // immediately after a single activation. - if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK. - echo '

', - sprintf( - esc_html( $this->strings['plugin_needs_higher_version'] ), - '' . esc_html( $this->plugins[ $slug ]['name'] ) . '' - ), - '

'; - } - } else { - // Simpler message layout for use on the plugin install page. - echo '

', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[ $slug ]['name'] ) ), '

'; - } - } - - return true; - } - - /** - * Echoes required plugin notice. - * - * Outputs a message telling users that a specific plugin is required for - * their theme. If appropriate, it includes a link to the form page where - * users can install and activate the plugin. - * - * Returns early if we're on the Install page. - * - * @since 1.0.0 - * - * @global object $current_screen - * - * @return null Returns early if we're on the Install page. - */ - public function notices() { - // Remove nag on the install page / Return early if the nag message has been dismissed or user < author. - if ( ( $this->is_tgmpa_page() || $this->is_core_update_page() ) || get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) || ! current_user_can( apply_filters( 'tgmpa_show_admin_notice_capability', 'publish_posts' ) ) ) { - return; - } - - // Store for the plugin slugs by message type. - $message = array(); - - // Initialize counters used to determine plurality of action link texts. - $install_link_count = 0; - $update_link_count = 0; - $activate_link_count = 0; - $total_required_action_count = 0; - - foreach ( $this->plugins as $slug => $plugin ) { - if ( $this->is_plugin_active( $slug ) && false === $this->does_plugin_have_update( $slug ) ) { - continue; - } - - if ( ! $this->is_plugin_installed( $slug ) ) { - if ( current_user_can( 'install_plugins' ) ) { - $install_link_count++; - - if ( true === $plugin['required'] ) { - $message['notice_can_install_required'][] = $slug; - } else { - $message['notice_can_install_recommended'][] = $slug; - } - } - if ( true === $plugin['required'] ) { - $total_required_action_count++; - } - } else { - if ( ! $this->is_plugin_active( $slug ) && $this->can_plugin_activate( $slug ) ) { - if ( current_user_can( 'activate_plugins' ) ) { - $activate_link_count++; - - if ( true === $plugin['required'] ) { - $message['notice_can_activate_required'][] = $slug; - } else { - $message['notice_can_activate_recommended'][] = $slug; - } - } - if ( true === $plugin['required'] ) { - $total_required_action_count++; - } - } - - if ( $this->does_plugin_require_update( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) { - - if ( current_user_can( 'update_plugins' ) ) { - $update_link_count++; - - if ( $this->does_plugin_require_update( $slug ) ) { - $message['notice_ask_to_update'][] = $slug; - } elseif ( false !== $this->does_plugin_have_update( $slug ) ) { - $message['notice_ask_to_update_maybe'][] = $slug; - } - } - if ( true === $plugin['required'] ) { - $total_required_action_count++; - } - } - } - } - unset( $slug, $plugin ); - - // If we have notices to display, we move forward. - if ( ! empty( $message ) || $total_required_action_count > 0 ) { - krsort( $message ); // Sort messages. - $rendered = ''; - - // As add_settings_error() wraps the final message in a

and as the final message can't be - // filtered, using

's in our html would render invalid html output. - $line_template = '%s' . "\n"; - - if ( ! current_user_can( 'activate_plugins' ) && ! current_user_can( 'install_plugins' ) && ! current_user_can( 'update_plugins' ) ) { - $rendered = esc_html( $this->strings['notice_cannot_install_activate'] ) . ' ' . esc_html( $this->strings['contact_admin'] ); - $rendered .= $this->create_user_action_links_for_notice( 0, 0, 0, $line_template ); - } else { - - // If dismissable is false and a message is set, output it now. - if ( ! $this->dismissable && ! empty( $this->dismiss_msg ) ) { - $rendered .= sprintf( $line_template, wp_kses_post( $this->dismiss_msg ) ); - } - - // Render the individual message lines for the notice. - foreach ( $message as $type => $plugin_group ) { - $linked_plugins = array(); - - // Get the external info link for a plugin if one is available. - foreach ( $plugin_group as $plugin_slug ) { - $linked_plugins[] = $this->get_info_link( $plugin_slug ); - } - unset( $plugin_slug ); - - $count = count( $plugin_group ); - $linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins ); - $last_plugin = array_pop( $linked_plugins ); // Pop off last name to prep for readability. - $imploded = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', '__theme_txtd' ) . ' ' . $last_plugin ); - - $rendered .= sprintf( - $line_template, - sprintf( - translate_nooped_plural( $this->strings[ $type ], $count, '__theme_txtd' ), - $imploded, - $count - ) - ); - - } - unset( $type, $plugin_group, $linked_plugins, $count, $last_plugin, $imploded ); - - $rendered .= $this->create_user_action_links_for_notice( $install_link_count, $update_link_count, $activate_link_count, $line_template ); - } - - // Register the nag messages and prepare them to be processed. - add_settings_error( 'tgmpa', 'tgmpa', $rendered, $this->get_admin_notice_class() ); - } - - // Admin options pages already output settings_errors, so this is to avoid duplication. - if ( 'options-general' !== $GLOBALS['current_screen']->parent_base ) { - $this->display_settings_errors(); - } - } - - /** - * Generate the user action links for the admin notice. - * - * @since 2.6.0 - * - * @param int $install_count Number of plugins to install. - * @param int $update_count Number of plugins to update. - * @param int $activate_count Number of plugins to activate. - * @param int $line_template Template for the HTML tag to output a line. - * @return string Action links. - */ - protected function create_user_action_links_for_notice( $install_count, $update_count, $activate_count, $line_template ) { - // Setup action links. - $action_links = array( - 'install' => '', - 'update' => '', - 'activate' => '', - 'dismiss' => $this->dismissable ? '' . esc_html( $this->strings['dismiss'] ) . '' : '', - ); - - $link_template = '%1$s'; - - if ( current_user_can( 'install_plugins' ) ) { - if ( $install_count > 0 ) { - $action_links['install'] = sprintf( - $link_template, - translate_nooped_plural( $this->strings['install_link'], $install_count, '__theme_txtd' ), - esc_url( $this->get_tgmpa_status_url( 'install' ) ) - ); - } - if ( $update_count > 0 ) { - $action_links['update'] = sprintf( - $link_template, - translate_nooped_plural( $this->strings['update_link'], $update_count, '__theme_txtd' ), - esc_url( $this->get_tgmpa_status_url( 'update' ) ) - ); - } - } - - if ( current_user_can( 'activate_plugins' ) && $activate_count > 0 ) { - $action_links['activate'] = sprintf( - $link_template, - translate_nooped_plural( $this->strings['activate_link'], $activate_count, '__theme_txtd' ), - esc_url( $this->get_tgmpa_status_url( 'activate' ) ) - ); - } - - $action_links = apply_filters( 'tgmpa_notice_action_links', $action_links ); - - $action_links = array_filter( (array) $action_links ); // Remove any empty array items. - - if ( ! empty( $action_links ) ) { - $action_links = sprintf( $line_template, implode( ' | ', $action_links ) ); - return apply_filters( 'tgmpa_notice_rendered_action_links', $action_links ); - } else { - return ''; - } - } - - /** - * Get admin notice class. - * - * Work around all the changes to the various admin notice classes between WP 4.4 and 3.7 - * (lowest supported version by TGMPA). - * - * @since 2.6.0 - * - * @return string - */ - protected function get_admin_notice_class() { - if ( ! empty( $this->strings['nag_type'] ) ) { - return sanitize_html_class( strtolower( $this->strings['nag_type'] ) ); - } else { - if ( version_compare( $this->wp_version, '4.2', '>=' ) ) { - return 'notice-warning'; - } elseif ( version_compare( $this->wp_version, '4.1', '>=' ) ) { - return 'notice'; - } else { - return 'updated'; - } - } - } - - /** - * Display settings errors and remove those which have been displayed to avoid duplicate messages showing - * - * @since 2.5.0 - */ - protected function display_settings_errors() { - global $wp_settings_errors; - - settings_errors( 'tgmpa' ); - - foreach ( (array) $wp_settings_errors as $key => $details ) { - if ( 'tgmpa' === $details['setting'] ) { - unset( $wp_settings_errors[ $key ] ); - break; - } - } - } - - /** - * Register dismissal of admin notices. - * - * Acts on the dismiss link in the admin nag messages. - * If clicked, the admin notice disappears and will no longer be visible to this user. - * - * @since 2.1.0 - */ - public function dismiss() { - if ( isset( $_GET['tgmpa-dismiss'] ) && check_admin_referer( 'tgmpa-dismiss-' . get_current_user_id() ) ) { - update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, 1 ); - } - } - - /** - * Add individual plugin to our collection of plugins. - * - * If the required keys are not set or the plugin has already - * been registered, the plugin is not added. - * - * @since 2.0.0 - * - * @param array|null $plugin Array of plugin arguments or null if invalid argument. - * @return null Return early if incorrect argument. - */ - public function register( $plugin ) { - if ( empty( $plugin['slug'] ) || empty( $plugin['name'] ) ) { - return; - } - - if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) { - return; - } - - $defaults = array( - 'name' => '', // String - 'slug' => '', // String - 'source' => 'repo', // String - 'required' => false, // Boolean - 'version' => '', // String - 'force_activation' => false, // Boolean - 'force_deactivation' => false, // Boolean - 'external_url' => '', // String - 'is_callable' => '', // String|Array. - ); - - // Prepare the received data. - $plugin = wp_parse_args( $plugin, $defaults ); - - // Standardize the received slug. - $plugin['slug'] = $this->sanitize_key( $plugin['slug'] ); - - // Forgive users for using string versions of booleans or floats for version number. - $plugin['version'] = (string) $plugin['version']; - $plugin['source'] = empty( $plugin['source'] ) ? 'repo' : $plugin['source']; - $plugin['required'] = TGMPA_Utils::validate_bool( $plugin['required'] ); - $plugin['force_activation'] = TGMPA_Utils::validate_bool( $plugin['force_activation'] ); - $plugin['force_deactivation'] = TGMPA_Utils::validate_bool( $plugin['force_deactivation'] ); - - // Enrich the received data. - $plugin['file_path'] = $this->_get_plugin_basename_from_slug( $plugin['slug'] ); - $plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] ); - - // Set the class properties. - $this->plugins[ $plugin['slug'] ] = $plugin; - $this->sort_order[ $plugin['slug'] ] = $plugin['name']; - - // Should we add the force activation hook ? - if ( true === $plugin['force_activation'] ) { - $this->has_forced_activation = true; - } - - // Should we add the force deactivation hook ? - if ( true === $plugin['force_deactivation'] ) { - $this->has_forced_deactivation = true; - } - } - - /** - * Determine what type of source the plugin comes from. - * - * @since 2.5.0 - * - * @param string $source The source of the plugin as provided, either empty (= WP repo), a file path - * (= bundled) or an external URL. - * @return string 'repo', 'external', or 'bundled' - */ - protected function get_plugin_source_type( $source ) { - if ( 'repo' === $source || preg_match( self::WP_REPO_REGEX, $source ) ) { - return 'repo'; - } elseif ( preg_match( self::IS_URL_REGEX, $source ) ) { - return 'external'; - } else { - return 'bundled'; - } - } - - /** - * Sanitizes a string key. - * - * Near duplicate of WP Core `sanitize_key()`. The difference is that uppercase characters *are* - * allowed, so as not to break upgrade paths from non-standard bundled plugins using uppercase - * characters in the plugin directory path/slug. Silly them. - * - * @see https://developer.wordpress.org/reference/hooks/sanitize_key/ - * - * @since 2.5.0 - * - * @param string $key String key. - * @return string Sanitized key - */ - public function sanitize_key( $key ) { - $raw_key = $key; - $key = preg_replace( '`[^A-Za-z0-9_-]`', '', $key ); - - /** - * Filter a sanitized key string. - * - * @since 2.5.0 - * - * @param string $key Sanitized key. - * @param string $raw_key The key prior to sanitization. - */ - return apply_filters( 'tgmpa_sanitize_key', $key, $raw_key ); - } - - /** - * Amend default configuration settings. - * - * @since 2.0.0 - * - * @param array $config Array of config options to pass as class properties. - */ - public function config( $config ) { - $keys = array( - 'id', - 'default_path', - 'has_notices', - 'dismissable', - 'dismiss_msg', - 'menu', - 'parent_slug', - 'capability', - 'is_automatic', - 'message', - 'strings', - ); - - foreach ( $keys as $key ) { - if ( isset( $config[ $key ] ) ) { - if ( is_array( $config[ $key ] ) ) { - $this->$key = array_merge( $this->$key, $config[ $key ] ); - } else { - $this->$key = $config[ $key ]; - } - } - } - } - - /** - * Amend action link after plugin installation. - * - * @since 2.0.0 - * - * @param array $install_actions Existing array of actions. - * @return false|array Amended array of actions. - */ - public function actions( $install_actions ) { - // Remove action links on the TGMPA install page. - if ( $this->is_tgmpa_page() ) { - return false; - } - - return $install_actions; - } - - /** - * Flushes the plugins cache on theme switch to prevent stale entries - * from remaining in the plugin table. - * - * @since 2.4.0 - * - * @param bool $clear_update_cache Optional. Whether to clear the Plugin updates cache. - * Parameter added in v2.5.0. - */ - public function flush_plugins_cache( $clear_update_cache = true ) { - wp_clean_plugins_cache( $clear_update_cache ); - } - - /** - * Set file_path key for each installed plugin. - * - * @since 2.1.0 - * - * @param string $plugin_slug Optional. If set, only (re-)populates the file path for that specific plugin. - * Parameter added in v2.5.0. - */ - public function populate_file_path( $plugin_slug = '' ) { - if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) { - $this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug ); - } else { - // Add file_path key for all plugins. - foreach ( $this->plugins as $slug => $values ) { - $this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug ); - } - } - } - - /** - * Helper function to extract the file path of the plugin file from the - * plugin slug, if the plugin is installed. - * - * @since 2.0.0 - * - * @param string $slug Plugin slug (typically folder name) as provided by the developer. - * @return string Either file path for plugin if installed, or just the plugin slug. - */ - protected function _get_plugin_basename_from_slug( $slug ) { - $keys = array_keys( $this->get_plugins() ); - - foreach ( $keys as $key ) { - if ( preg_match( '|^' . $slug . '/|', $key ) ) { - return $key; - } - } - - return $slug; - } - - /** - * Retrieve plugin data, given the plugin name. - * - * Loops through the registered plugins looking for $name. If it finds it, - * it returns the $data from that plugin. Otherwise, returns false. - * - * @since 2.1.0 - * - * @param string $name Name of the plugin, as it was registered. - * @param string $data Optional. Array key of plugin data to return. Default is slug. - * @return string|boolean Plugin slug if found, false otherwise. - */ - public function _get_plugin_data_from_name( $name, $data = 'slug' ) { - foreach ( $this->plugins as $values ) { - if ( $name === $values['name'] && isset( $values[ $data ] ) ) { - return $values[ $data ]; - } - } - - return false; - } - - /** - * Retrieve the download URL for a package. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return string Plugin download URL or path to local file or empty string if undetermined. - */ - public function get_download_url( $slug ) { - $dl_source = ''; - - switch ( $this->plugins[ $slug ]['source_type'] ) { - case 'repo': - return $this->get_wp_repo_download_url( $slug ); - case 'external': - return $this->plugins[ $slug ]['source']; - case 'bundled': - return $this->default_path . $this->plugins[ $slug ]['source']; - } - - return $dl_source; // Should never happen. - } - - /** - * Retrieve the download URL for a WP repo package. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return string Plugin download URL. - */ - protected function get_wp_repo_download_url( $slug ) { - $source = ''; - $api = $this->get_plugins_api( $slug ); - - if ( false !== $api && isset( $api->download_link ) ) { - $source = $api->download_link; - } - - return $source; - } - - /** - * Try to grab information from WordPress API. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return object Plugins_api response object on success, WP_Error on failure. - */ - protected function get_plugins_api( $slug ) { - static $api = array(); // Cache received responses. - - if ( ! isset( $api[ $slug ] ) ) { - if ( ! function_exists( 'plugins_api' ) ) { - require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; - } - - $response = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) ); - - $api[ $slug ] = false; - - if ( is_wp_error( $response ) ) { - wp_die( esc_html( $this->strings['oops'] ) ); - } else { - $api[ $slug ] = $response; - } - } - - return $api[ $slug ]; - } - - /** - * Retrieve a link to a plugin information page. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return string Fully formed html link to a plugin information page if available - * or the plugin name if not. - */ - public function get_info_link( $slug ) { - if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ]['external_url'] ) ) { - $link = sprintf( - '%2$s', - esc_url( $this->plugins[ $slug ]['external_url'] ), - esc_html( $this->plugins[ $slug ]['name'] ) - ); - } elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) { - $url = add_query_arg( - array( - 'tab' => 'plugin-information', - 'plugin' => urlencode( $slug ), - 'TB_iframe' => 'true', - 'width' => '640', - 'height' => '500', - ), - self_admin_url( 'plugin-install.php' ) - ); - - $link = sprintf( - '%2$s', - esc_url( $url ), - esc_html( $this->plugins[ $slug ]['name'] ) - ); - } else { - $link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink. - } - - return $link; - } - - /** - * Determine if we're on the TGMPA Install page. - * - * @since 2.1.0 - * - * @return boolean True when on the TGMPA page, false otherwise. - */ - protected function is_tgmpa_page() { - return isset( $_GET['page'] ) && $this->menu === $_GET['page']; - } - - /** - * Determine if we're on a WP Core installation/upgrade page. - * - * @since 2.6.0 - * - * @return boolean True when on a WP Core installation/upgrade page, false otherwise. - */ - protected function is_core_update_page() { - // Current screen is not always available, most notably on the customizer screen. - if ( ! function_exists( 'get_current_screen' ) ) { - return false; - } - - $screen = get_current_screen(); - - if ( 'update-core' === $screen->base ) { - // Core update screen. - return true; - } elseif ( 'plugins' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok. - // Plugins bulk update screen. - return true; - } elseif ( 'update' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok. - // Individual updates (ajax call). - return true; - } - - return false; - } - - /** - * Retrieve the URL to the TGMPA Install page. - * - * I.e. depending on the config settings passed something along the lines of: - * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins - * - * @since 2.5.0 - * - * @return string Properly encoded URL (not escaped). - */ - public function get_tgmpa_url() { - static $url; - - if ( ! isset( $url ) ) { - $parent = $this->parent_slug; - if ( false === strpos( $parent, '.php' ) ) { - $parent = 'admin.php'; - } - $url = add_query_arg( - array( - 'page' => urlencode( $this->menu ), - ), - self_admin_url( $parent ) - ); - } - - return $url; - } - - /** - * Retrieve the URL to the TGMPA Install page for a specific plugin status (view). - * - * I.e. depending on the config settings passed something along the lines of: - * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins&plugin_status=install - * - * @since 2.5.0 - * - * @param string $status Plugin status - either 'install', 'update' or 'activate'. - * @return string Properly encoded URL (not escaped). - */ - public function get_tgmpa_status_url( $status ) { - return add_query_arg( - array( - 'plugin_status' => urlencode( $status ), - ), - $this->get_tgmpa_url() - ); - } - - /** - * Determine whether there are open actions for plugins registered with TGMPA. - * - * @since 2.5.0 - * - * @return bool True if complete, i.e. no outstanding actions. False otherwise. - */ - public function is_tgmpa_complete() { - $complete = true; - foreach ( $this->plugins as $slug => $plugin ) { - if ( ! $this->is_plugin_active( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) { - $complete = false; - break; - } - } - - return $complete; - } - - /** - * Check if a plugin is installed. Does not take must-use plugins into account. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return bool True if installed, false otherwise. - */ - public function is_plugin_installed( $slug ) { - $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). - - return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) ); - } - - /** - * Check if a plugin is active. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return bool True if active, false otherwise. - */ - public function is_plugin_active( $slug ) { - return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) ); - } - - /** - * Check if a plugin can be updated, i.e. if we have information on the minimum WP version required - * available, check whether the current install meets them. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return bool True if OK to update, false otherwise. - */ - public function can_plugin_update( $slug ) { - // We currently can't get reliable info on non-WP-repo plugins - issue #380. - if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { - return true; - } - - $api = $this->get_plugins_api( $slug ); - - if ( false !== $api && isset( $api->requires ) ) { - return version_compare( $this->wp_version, $api->requires, '>=' ); - } - - // No usable info received from the plugins API, presume we can update. - return true; - } - - /** - * Check to see if the plugin is 'updatetable', i.e. installed, with an update available - * and no WP version requirements blocking it. - * - * @since 2.6.0 - * - * @param string $slug Plugin slug. - * @return bool True if OK to proceed with update, false otherwise. - */ - public function is_plugin_updatetable( $slug ) { - if ( ! $this->is_plugin_installed( $slug ) ) { - return false; - } else { - return ( false !== $this->does_plugin_have_update( $slug ) && $this->can_plugin_update( $slug ) ); - } - } - - /** - * Check if a plugin can be activated, i.e. is not currently active and meets the minimum - * plugin version requirements set in TGMPA (if any). - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return bool True if OK to activate, false otherwise. - */ - public function can_plugin_activate( $slug ) { - return ( ! $this->is_plugin_active( $slug ) && ! $this->does_plugin_require_update( $slug ) ); - } - - /** - * Retrieve the version number of an installed plugin. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return string Version number as string or an empty string if the plugin is not installed - * or version unknown (plugins which don't comply with the plugin header standard). - */ - public function get_installed_version( $slug ) { - $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). - - if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) { - return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version']; - } - - return ''; - } - - /** - * Check whether a plugin complies with the minimum version requirements. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return bool True when a plugin needs to be updated, otherwise false. - */ - public function does_plugin_require_update( $slug ) { - $installed_version = $this->get_installed_version( $slug ); - $minimum_version = $this->plugins[ $slug ]['version']; - - return version_compare( $minimum_version, $installed_version, '>' ); - } - - /** - * Check whether there is an update available for a plugin. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return false|string Version number string of the available update or false if no update available. - */ - public function does_plugin_have_update( $slug ) { - // Presume bundled and external plugins will point to a package which meets the minimum required version. - if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { - if ( $this->does_plugin_require_update( $slug ) ) { - return $this->plugins[ $slug ]['version']; - } - - return false; - } - - $repo_updates = get_site_transient( 'update_plugins' ); - - if ( isset( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version ) ) { - return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version; - } - - return false; - } - - /** - * Retrieve potential upgrade notice for a plugin. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return string The upgrade notice or an empty string if no message was available or provided. - */ - public function get_upgrade_notice( $slug ) { - // We currently can't get reliable info on non-WP-repo plugins - issue #380. - if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { - return ''; - } - - $repo_updates = get_site_transient( 'update_plugins' ); - - if ( ! empty( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice ) ) { - return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice; - } - - return ''; - } - - /** - * Wrapper around the core WP get_plugins function, making sure it's actually available. - * - * @since 2.5.0 - * - * @param string $plugin_folder Optional. Relative path to single plugin folder. - * @return array Array of installed plugins with plugin information. - */ - public function get_plugins( $plugin_folder = '' ) { - if ( ! function_exists( 'get_plugins' ) ) { - require_once ABSPATH . 'wp-admin/includes/plugin.php'; - } - - return get_plugins( $plugin_folder ); - } - - /** - * Delete dismissable nag option when theme is switched. - * - * This ensures that the user(s) is/are again reminded via nag of required - * and/or recommended plugins if they re-activate the theme. - * - * @since 2.1.1 - */ - public function update_dismiss() { - delete_metadata( 'user', null, 'tgmpa_dismissed_notice_' . $this->id, null, true ); - } - - /** - * Forces plugin activation if the parameter 'force_activation' is - * set to true. - * - * This allows theme authors to specify certain plugins that must be - * active at all times while using the current theme. - * - * Please take special care when using this parameter as it has the - * potential to be harmful if not used correctly. Setting this parameter - * to true will not allow the specified plugin to be deactivated unless - * the user switches themes. - * - * @since 2.2.0 - */ - public function force_activation() { - foreach ( $this->plugins as $slug => $plugin ) { - if ( true === $plugin['force_activation'] ) { - if ( ! $this->is_plugin_installed( $slug ) ) { - // Oops, plugin isn't there so iterate to next condition. - continue; - } elseif ( $this->can_plugin_activate( $slug ) ) { - // There we go, activate the plugin. - activate_plugin( $plugin['file_path'] ); - } - } - } - } - - /** - * Forces plugin deactivation if the parameter 'force_deactivation' - * is set to true and adds the plugin to the 'recently active' plugins list. - * - * This allows theme authors to specify certain plugins that must be - * deactivated upon switching from the current theme to another. - * - * Please take special care when using this parameter as it has the - * potential to be harmful if not used correctly. - * - * @since 2.2.0 - */ - public function force_deactivation() { - $deactivated = array(); - - foreach ( $this->plugins as $slug => $plugin ) { - /* - * Only proceed forward if the parameter is set to true and plugin is active - * as a 'normal' (not must-use) plugin. - */ - if ( true === $plugin['force_deactivation'] && is_plugin_active( $plugin['file_path'] ) ) { - deactivate_plugins( $plugin['file_path'] ); - $deactivated[ $plugin['file_path'] ] = time(); - } - } - - if ( ! empty( $deactivated ) ) { - update_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ) ); - } - } - - /** - * Echo the current TGMPA version number to the page. - * - * @since 2.5.0 - */ - public function show_tgmpa_version() { - echo '

', - esc_html( - sprintf( - /* translators: %s: version number */ - esc_html__( 'TGMPA v%s', '__theme_txtd' ), - self::TGMPA_VERSION - ) - ), - '

'; - } - - /** - * Returns the singleton instance of the class. - * - * @since 2.4.0 - * - * @return \TGM_Plugin_Activation The TGM_Plugin_Activation object. - */ - public static function get_instance() { - if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) { - self::$instance = new self(); - } - - return self::$instance; - } - } - - if ( ! function_exists( 'load_tgm_plugin_activation' ) ) { - /** - * Ensure only one instance of the class is ever invoked. - * - * @since 2.5.0 - */ - function load_tgm_plugin_activation() { - $GLOBALS['tgmpa'] = TGM_Plugin_Activation::get_instance(); - } - } - - if ( did_action( 'plugins_loaded' ) ) { - load_tgm_plugin_activation(); - } else { - add_action( 'plugins_loaded', 'load_tgm_plugin_activation' ); - } -} - -if ( ! function_exists( 'tgmpa' ) ) { - /** - * Helper function to register a collection of required plugins. - * - * @since 2.0.0 - * @api - * - * @param array $plugins An array of plugin arrays. - * @param array $config Optional. An array of configuration values. - */ - function tgmpa( $plugins, $config = array() ) { - $instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); - - foreach ( $plugins as $plugin ) { - call_user_func( array( $instance, 'register' ), $plugin ); - } - - if ( ! empty( $config ) && is_array( $config ) ) { - // Send out notices for deprecated arguments passed. - if ( isset( $config['notices'] ) ) { - _deprecated_argument( __FUNCTION__, '2.2.0', 'The `notices` config parameter was renamed to `has_notices` in TGMPA 2.2.0. Please adjust your configuration.' ); - if ( ! isset( $config['has_notices'] ) ) { - $config['has_notices'] = $config['notices']; - } - } - - if ( isset( $config['parent_menu_slug'] ) ) { - _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_menu_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' ); - } - if ( isset( $config['parent_url_slug'] ) ) { - _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_url_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' ); - } - - call_user_func( array( $instance, 'config' ), $config ); - } - } -} - -/** - * WP_List_Table isn't always available. If it isn't available, - * we load it here. - * - * @since 2.2.0 - */ -if ( ! class_exists( 'WP_List_Table' ) ) { - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; -} - -if ( ! class_exists( 'TGMPA_List_Table' ) ) { - - /** - * List table class for handling plugins. - * - * Extends the WP_List_Table class to provide a future-compatible - * way of listing out all required/recommended plugins. - * - * Gives users an interface similar to the Plugin Administration - * area with similar (albeit stripped down) capabilities. - * - * This class also allows for the bulk install of plugins. - * - * @since 2.2.0 - * - * @package TGM-Plugin-Activation - * @author Thomas Griffin - * @author Gary Jones - */ - class TGMPA_List_Table extends WP_List_Table { - /** - * TGMPA instance. - * - * @since 2.5.0 - * - * @var object - */ - protected $tgmpa; - - /** - * The currently chosen view. - * - * @since 2.5.0 - * - * @var string One of: 'all', 'install', 'update', 'activate' - */ - public $view_context = 'all'; - - /** - * The plugin counts for the various views. - * - * @since 2.5.0 - * - * @var array - */ - protected $view_totals = array( - 'all' => 0, - 'install' => 0, - 'update' => 0, - 'activate' => 0, - ); - - /** - * References parent constructor and sets defaults for class. - * - * @since 2.2.0 - */ - public function __construct() { - $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); - - parent::__construct( - array( - 'singular' => 'plugin', - 'plural' => 'plugins', - 'ajax' => false, - ) - ); - - if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'install', 'update', 'activate' ), true ) ) { - $this->view_context = sanitize_key( $_REQUEST['plugin_status'] ); - } - - add_filter( 'tgmpa_table_data_items', array( $this, 'sort_table_items' ) ); - } - - /** - * Get a list of CSS classes for the tag. - * - * Overruled to prevent the 'plural' argument from being added. - * - * @since 2.5.0 - * - * @return array CSS classnames. - */ - public function get_table_classes() { - return array( 'widefat', 'fixed' ); - } - - /** - * Gathers and renames all of our plugin information to be used by WP_List_Table to create our table. - * - * @since 2.2.0 - * - * @return array $table_data Information for use in table. - */ - protected function _gather_plugin_data() { - // Load thickbox for plugin links. - $this->tgmpa->admin_init(); - $this->tgmpa->thickbox(); - - // Categorize the plugins which have open actions. - $plugins = $this->categorize_plugins_to_views(); - - // Set the counts for the view links. - $this->set_view_totals( $plugins ); - - // Prep variables for use and grab list of all installed plugins. - $table_data = array(); - $i = 0; - - // Redirect to the 'all' view if no plugins were found for the selected view context. - if ( empty( $plugins[ $this->view_context ] ) ) { - $this->view_context = 'all'; - } - - foreach ( $plugins[ $this->view_context ] as $slug => $plugin ) { - $table_data[ $i ]['sanitized_plugin'] = $plugin['name']; - $table_data[ $i ]['slug'] = $slug; - $table_data[ $i ]['plugin'] = '' . $this->tgmpa->get_info_link( $slug ) . ''; - $table_data[ $i ]['source'] = $this->get_plugin_source_type_text( $plugin['source_type'] ); - $table_data[ $i ]['type'] = $this->get_plugin_advise_type_text( $plugin['required'] ); - $table_data[ $i ]['status'] = $this->get_plugin_status_text( $slug ); - $table_data[ $i ]['installed_version'] = $this->tgmpa->get_installed_version( $slug ); - $table_data[ $i ]['minimum_version'] = $plugin['version']; - $table_data[ $i ]['available_version'] = $this->tgmpa->does_plugin_have_update( $slug ); - - // Prep the upgrade notice info. - $upgrade_notice = $this->tgmpa->get_upgrade_notice( $slug ); - if ( ! empty( $upgrade_notice ) ) { - $table_data[ $i ]['upgrade_notice'] = $upgrade_notice; - - add_action( "tgmpa_after_plugin_row_{$slug}", array( $this, 'wp_plugin_update_row' ), 10, 2 ); - } - - $table_data[ $i ] = apply_filters( 'tgmpa_table_data_item', $table_data[ $i ], $plugin ); - - $i++; - } - - return $table_data; - } - - /** - * Categorize the plugins which have open actions into views for the TGMPA page. - * - * @since 2.5.0 - */ - protected function categorize_plugins_to_views() { - $plugins = array( - 'all' => array(), // Meaning: all plugins which still have open actions. - 'install' => array(), - 'update' => array(), - 'activate' => array(), - ); - - foreach ( $this->tgmpa->plugins as $slug => $plugin ) { - if ( $this->tgmpa->is_plugin_active( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) { - // No need to display plugins if they are installed, up-to-date and active. - continue; - } else { - $plugins['all'][ $slug ] = $plugin; - - if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) { - $plugins['install'][ $slug ] = $plugin; - } else { - if ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) { - $plugins['update'][ $slug ] = $plugin; - } - - if ( $this->tgmpa->can_plugin_activate( $slug ) ) { - $plugins['activate'][ $slug ] = $plugin; - } - } - } - } - - return $plugins; - } - - /** - * Set the counts for the view links. - * - * @since 2.5.0 - * - * @param array $plugins Plugins order by view. - */ - protected function set_view_totals( $plugins ) { - foreach ( $plugins as $type => $list ) { - $this->view_totals[ $type ] = count( $list ); - } - } - - /** - * Get the plugin required/recommended text string. - * - * @since 2.5.0 - * - * @param string $required Plugin required setting. - * @return string - */ - protected function get_plugin_advise_type_text( $required ) { - if ( true === $required ) { - return esc_html__( 'Required', '__theme_txtd' ); - } - - return esc_html__( 'Recommended', '__theme_txtd' ); - } - - /** - * Get the plugin source type text string. - * - * @since 2.5.0 - * - * @param string $type Plugin type. - * @return string - */ - protected function get_plugin_source_type_text( $type ) { - $string = ''; - - switch ( $type ) { - case 'repo': - $string = esc_html__( 'WordPress Repository', '__theme_txtd' ); - break; - case 'external': - $string = esc_html__( 'External Source', '__theme_txtd' ); - break; - case 'bundled': - $string = esc_html__( 'Pre-Packaged', '__theme_txtd' ); - break; - } - - return $string; - } - - /** - * Determine the plugin status message. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return string - */ - protected function get_plugin_status_text( $slug ) { - if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) { - return esc_html__( 'Not Installed', '__theme_txtd' ); - } - - if ( ! $this->tgmpa->is_plugin_active( $slug ) ) { - $install_status = esc_html__( 'Installed But Not Activated', '__theme_txtd' ); - } else { - $install_status = esc_html__( 'Active', '__theme_txtd' ); - } - - $update_status = ''; - - if ( $this->tgmpa->does_plugin_require_update( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) { - $update_status = esc_html__( 'Required Update not Available', '__theme_txtd' ); - - } elseif ( $this->tgmpa->does_plugin_require_update( $slug ) ) { - $update_status = esc_html__( 'Requires Update', '__theme_txtd' ); - - } elseif ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) { - $update_status = esc_html__( 'Update recommended', '__theme_txtd' ); - } - - if ( '' === $update_status ) { - return $install_status; - } - - return sprintf( - /* translators: 1: install status, 2: update status */ - esc_html_x( '%1$s, %2$s', 'Install/Update Status', '__theme_txtd' ), - $install_status, - $update_status - ); - } - - /** - * Sort plugins by Required/Recommended type and by alphabetical plugin name within each type. - * - * @since 2.5.0 - * - * @param array $items Prepared table items. - * @return array Sorted table items. - */ - public function sort_table_items( $items ) { - $type = array(); - $name = array(); - - foreach ( $items as $i => $plugin ) { - $type[ $i ] = $plugin['type']; // Required / recommended. - $name[ $i ] = $plugin['sanitized_plugin']; - } - - array_multisort( $type, SORT_DESC, $name, SORT_ASC, $items ); - - return $items; - } - - /** - * Get an associative array ( id => link ) of the views available on this table. - * - * @since 2.5.0 - * - * @return array - */ - public function get_views() { - $status_links = array(); - - foreach ( $this->view_totals as $type => $count ) { - if ( $count < 1 ) { - continue; - } - - switch ( $type ) { - case 'all': - /* translators: 1: number of plugins. */ - $text = _nx( 'All (%s)', 'All (%s)', $count, 'plugins', '__theme_txtd' ); - break; - case 'install': - /* translators: 1: number of plugins. */ - $text = _n( 'To Install (%s)', 'To Install (%s)', $count, '__theme_txtd' ); - break; - case 'update': - /* translators: 1: number of plugins. */ - $text = _n( 'Update Available (%s)', 'Update Available (%s)', $count, '__theme_txtd' ); - break; - case 'activate': - /* translators: 1: number of plugins. */ - $text = _n( 'To Activate (%s)', 'To Activate (%s)', $count, '__theme_txtd' ); - break; - default: - $text = ''; - break; - } - - if ( ! empty( $text ) ) { - - $status_links[ $type ] = sprintf( - '%s', - esc_url( $this->tgmpa->get_tgmpa_status_url( $type ) ), - ( $type === $this->view_context ) ? ' class="current"' : '', - wp_kses_post( sprintf( $text, number_format_i18n( $count ) ) ) - ); - } - } - - return $status_links; - } - - /** - * Create default columns to display important plugin information - * like type, action and status. - * - * @since 2.2.0 - * - * @param array $item Array of item data. - * @param string $column_name The name of the column. - * @return string - */ - public function column_default( $item, $column_name ) { - return $item[ $column_name ]; - } - - /** - * Required for bulk installing. - * - * Adds a checkbox for each plugin. - * - * @since 2.2.0 - * - * @param array $item Array of item data. - * @return string The input checkbox with all necessary info. - */ - public function column_cb( $item ) { - return sprintf( - '', - esc_attr( $this->_args['singular'] ), - esc_attr( $item['slug'] ), - esc_attr( $item['sanitized_plugin'] ) - ); - } - - /** - * Create default title column along with the action links. - * - * @since 2.2.0 - * - * @param array $item Array of item data. - * @return string The plugin name and action links. - */ - public function column_plugin( $item ) { - return sprintf( - '%1$s %2$s', - $item['plugin'], - $this->row_actions( $this->get_row_actions( $item ), true ) - ); - } - - /** - * Create version information column. - * - * @since 2.5.0 - * - * @param array $item Array of item data. - * @return string HTML-formatted version information. - */ - public function column_version( $item ) { - $output = array(); - - if ( $this->tgmpa->is_plugin_installed( $item['slug'] ) ) { - $installed = ! empty( $item['installed_version'] ) ? $item['installed_version'] : esc_html_x( 'unknown', 'as in: "version nr unknown"', '__theme_txtd' ); - - $color = ''; - if ( ! empty( $item['minimum_version'] ) && $this->tgmpa->does_plugin_require_update( $item['slug'] ) ) { - $color = ' color: #ff0000; font-weight: bold;'; - } - - $output[] = sprintf( - '

%2$s' . esc_html__( 'Installed version:', '__theme_txtd' ) . '

', - $color, - $installed - ); - } - - if ( ! empty( $item['minimum_version'] ) ) { - $output[] = sprintf( - '

%1$s' . esc_html__( 'Minimum required version:', '__theme_txtd' ) . '

', - $item['minimum_version'] - ); - } - - if ( ! empty( $item['available_version'] ) ) { - $color = ''; - if ( ! empty( $item['minimum_version'] ) && version_compare( $item['available_version'], $item['minimum_version'], '>=' ) ) { - $color = ' color: #71C671; font-weight: bold;'; - } - - $output[] = sprintf( - '

%2$s' . esc_html__( 'Available version:', '__theme_txtd' ) . '

', - $color, - $item['available_version'] - ); - } - - if ( empty( $output ) ) { - return ' '; // Let's not break the table layout. - } else { - return implode( "\n", $output ); - } - } - - /** - * Sets default message within the plugins table if no plugins - * are left for interaction. - * - * Hides the menu item to prevent the user from clicking and - * getting a permissions error. - * - * @since 2.2.0 - */ - public function no_items() { - echo esc_html__( 'No plugins to install, update or activate.', '__theme_txtd' ) . ' ' . esc_html__( 'Return to the Dashboard', '__theme_txtd' ) . ''; - echo ''; - } - - /** - * Output all the column information within the table. - * - * @since 2.2.0 - * - * @return array $columns The column names. - */ - public function get_columns() { - $columns = array( - 'cb' => '', - 'plugin' => esc_html__( 'Plugin', '__theme_txtd' ), - 'source' => esc_html__( 'Source', '__theme_txtd' ), - 'type' => esc_html__( 'Type', '__theme_txtd' ), - ); - - if ( 'all' === $this->view_context || 'update' === $this->view_context ) { - $columns['version'] = esc_html__( 'Version', '__theme_txtd' ); - $columns['status'] = esc_html__( 'Status', '__theme_txtd' ); - } - - return apply_filters( 'tgmpa_table_columns', $columns ); - } - - /** - * Get name of default primary column - * - * @since 2.5.0 / WP 4.3+ compatibility - * @access protected - * - * @return string - */ - protected function get_default_primary_column_name() { - return 'plugin'; - } - - /** - * Get the name of the primary column. - * - * @since 2.5.0 / WP 4.3+ compatibility - * @access protected - * - * @return string The name of the primary column. - */ - protected function get_primary_column_name() { - if ( method_exists( 'WP_List_Table', 'get_primary_column_name' ) ) { - return parent::get_primary_column_name(); - } else { - return $this->get_default_primary_column_name(); - } - } - - /** - * Get the actions which are relevant for a specific plugin row. - * - * @since 2.5.0 - * - * @param array $item Array of item data. - * @return array Array with relevant action links. - */ - protected function get_row_actions( $item ) { - $actions = array(); - $action_links = array(); - - // Display the 'Install' action link if the plugin is not yet available. - if ( ! $this->tgmpa->is_plugin_installed( $item['slug'] ) ) { - /* translators: %2$s: plugin name in screen reader markup */ - $actions['install'] = esc_html__( 'Install %2$s', '__theme_txtd' ); - } else { - // Display the 'Update' action link if an update is available and WP complies with plugin minimum. - if ( false !== $this->tgmpa->does_plugin_have_update( $item['slug'] ) && $this->tgmpa->can_plugin_update( $item['slug'] ) ) { - /* translators: %2$s: plugin name in screen reader markup */ - $actions['update'] = esc_html__( 'Update %2$s', '__theme_txtd' ); - } - - // Display the 'Activate' action link, but only if the plugin meets the minimum version. - if ( $this->tgmpa->can_plugin_activate( $item['slug'] ) ) { - /* translators: %2$s: plugin name in screen reader markup */ - $actions['activate'] = esc_html__( 'Activate %2$s', '__theme_txtd' ); - } - } - - // Create the actual links. - foreach ( $actions as $action => $text ) { - $nonce_url = wp_nonce_url( - add_query_arg( - array( - 'plugin' => urlencode( $item['slug'] ), - 'tgmpa-' . $action => $action . '-plugin', - ), - $this->tgmpa->get_tgmpa_url() - ), - 'tgmpa-' . $action, - 'tgmpa-nonce' - ); - - $action_links[ $action ] = sprintf( - '' . esc_html( $text ) . '', // $text contains the second placeholder. - esc_url( $nonce_url ), - '' . esc_html( $item['sanitized_plugin'] ) . '' - ); - } - - $prefix = ( defined( 'WP_NETWORK_ADMIN' ) && WP_NETWORK_ADMIN ) ? 'network_admin_' : ''; - return apply_filters( "tgmpa_{$prefix}plugin_action_links", array_filter( $action_links ), $item['slug'], $item, $this->view_context ); - } - - /** - * Generates content for a single row of the table. - * - * @since 2.5.0 - * - * @param object $item The current item. - */ - public function single_row( $item ) { - parent::single_row( $item ); - - /** - * Fires after each specific row in the TGMPA Plugins list table. - * - * The dynamic portion of the hook name, `$item['slug']`, refers to the slug - * for the plugin. - * - * @since 2.5.0 - */ - do_action( "tgmpa_after_plugin_row_{$item['slug']}", $item['slug'], $item, $this->view_context ); - } - - /** - * Show the upgrade notice below a plugin row if there is one. - * - * @since 2.5.0 - * - * @see /wp-admin/includes/update.php - * - * @param string $slug Plugin slug. - * @param array $item The information available in this table row. - * @return null Return early if upgrade notice is empty. - */ - public function wp_plugin_update_row( $slug, $item ) { - if ( empty( $item['upgrade_notice'] ) ) { - return; - } - - echo ' - - - '; - } - - /** - * Extra controls to be displayed between bulk actions and pagination. - * - * @since 2.5.0 - * - * @param string $which 'top' or 'bottom' table navigation. - */ - public function extra_tablenav( $which ) { - if ( 'bottom' === $which ) { - $this->tgmpa->show_tgmpa_version(); - } - } - - /** - * Defines the bulk actions for handling registered plugins. - * - * @since 2.2.0 - * - * @return array $actions The bulk actions for the plugin install table. - */ - public function get_bulk_actions() { - - $actions = array(); - - if ( 'update' !== $this->view_context && 'activate' !== $this->view_context ) { - if ( current_user_can( 'install_plugins' ) ) { - $actions['tgmpa-bulk-install'] = esc_html__( 'Install', '__theme_txtd' ); - } - } - - if ( 'install' !== $this->view_context ) { - if ( current_user_can( 'update_plugins' ) ) { - $actions['tgmpa-bulk-update'] = esc_html__( 'Update', '__theme_txtd' ); - } - if ( current_user_can( 'activate_plugins' ) ) { - $actions['tgmpa-bulk-activate'] = esc_html__( 'Activate', '__theme_txtd' ); - } - } - - return $actions; - } - - /** - * Processes bulk installation and activation actions. - * - * The bulk installation process looks for the $_POST information and passes that - * through if a user has to use WP_Filesystem to enter their credentials. - * - * @since 2.2.0 - */ - public function process_bulk_actions() { - // Bulk installation process. - if ( 'tgmpa-bulk-install' === $this->current_action() || 'tgmpa-bulk-update' === $this->current_action() ) { - - check_admin_referer( 'bulk-' . $this->_args['plural'] ); - - $install_type = 'install'; - if ( 'tgmpa-bulk-update' === $this->current_action() ) { - $install_type = 'update'; - } - - $plugins_to_install = array(); - - // Did user actually select any plugins to install/update ? - if ( empty( $_POST['plugin'] ) ) { - if ( 'install' === $install_type ) { - $message = esc_html__( 'No plugins were selected to be installed. No action taken.', '__theme_txtd' ); - } else { - $message = esc_html__( 'No plugins were selected to be updated. No action taken.', '__theme_txtd' ); - } - - echo '

', esc_html( $message ), '

'; - - return false; - } - - if ( is_array( $_POST['plugin'] ) ) { - $plugins_to_install = (array) $_POST['plugin']; - } elseif ( is_string( $_POST['plugin'] ) ) { - // Received via Filesystem page - un-flatten array (WP bug #19643). - $plugins_to_install = explode( ',', $_POST['plugin'] ); - } - - // Sanitize the received input. - $plugins_to_install = array_map( 'urldecode', $plugins_to_install ); - $plugins_to_install = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins_to_install ); - - // Validate the received input. - foreach ( $plugins_to_install as $key => $slug ) { - // Check if the plugin was registered with TGMPA and remove if not. - if ( ! isset( $this->tgmpa->plugins[ $slug ] ) ) { - unset( $plugins_to_install[ $key ] ); - continue; - } - - // For install: make sure this is a plugin we *can* install and not one already installed. - if ( 'install' === $install_type && true === $this->tgmpa->is_plugin_installed( $slug ) ) { - unset( $plugins_to_install[ $key ] ); - } - - // For updates: make sure this is a plugin we *can* update (update available and WP version ok). - if ( 'update' === $install_type && false === $this->tgmpa->is_plugin_updatetable( $slug ) ) { - unset( $plugins_to_install[ $key ] ); - } - } - - // No need to proceed further if we have no plugins to handle. - if ( empty( $plugins_to_install ) ) { - if ( 'install' === $install_type ) { - $message = esc_html__( 'No plugins are available to be installed at this time.', '__theme_txtd' ); - } else { - $message = esc_html__( 'No plugins are available to be updated at this time.', '__theme_txtd' ); - } - - echo '

', esc_html( $message ), '

'; - - return false; - } - - // Pass all necessary information if WP_Filesystem is needed. - $url = wp_nonce_url( - $this->tgmpa->get_tgmpa_url(), - 'bulk-' . $this->_args['plural'] - ); - - // Give validated data back to $_POST which is the only place the filesystem looks for extra fields. - $_POST['plugin'] = implode( ',', $plugins_to_install ); // Work around for WP bug #19643. - - $method = ''; // Leave blank so WP_Filesystem can populate it as necessary. - $fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem. - - if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, $fields ) ) ) { - return true; // Stop the normal page form from displaying, credential request form will be shown. - } - - // Now we have some credentials, setup WP_Filesystem. - if ( ! WP_Filesystem( $creds ) ) { - // Our credentials were no good, ask the user for them again. - request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields ); - - return true; - } - - /* If we arrive here, we have the filesystem */ - - // Store all information in arrays since we are processing a bulk installation. - $names = array(); - $sources = array(); // Needed for installs. - $file_paths = array(); // Needed for upgrades. - $to_inject = array(); // Information to inject into the update_plugins transient. - - // Prepare the data for validated plugins for the install/upgrade. - foreach ( $plugins_to_install as $slug ) { - $name = $this->tgmpa->plugins[ $slug ]['name']; - $source = $this->tgmpa->get_download_url( $slug ); - - if ( ! empty( $name ) && ! empty( $source ) ) { - $names[] = $name; - - switch ( $install_type ) { - - case 'install': - $sources[] = $source; - break; - - case 'update': - $file_paths[] = $this->tgmpa->plugins[ $slug ]['file_path']; - $to_inject[ $slug ] = $this->tgmpa->plugins[ $slug ]; - $to_inject[ $slug ]['source'] = $source; - break; - } - } - } - unset( $slug, $name, $source ); - - // Create a new instance of TGMPA_Bulk_Installer. - $installer = new TGMPA_Bulk_Installer( - new TGMPA_Bulk_Installer_Skin( - array( - 'url' => esc_url_raw( $this->tgmpa->get_tgmpa_url() ), - 'nonce' => 'bulk-' . $this->_args['plural'], - 'names' => $names, - 'install_type' => $install_type, - ) - ) - ); - - // Wrap the install process with the appropriate HTML. - echo '
', - '

', esc_html( get_admin_page_title() ), '

-
'; - - // Process the bulk installation submissions. - add_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1, 3 ); - - if ( 'tgmpa-bulk-update' === $this->current_action() ) { - // Inject our info into the update transient. - $this->tgmpa->inject_update_info( $to_inject ); - - $installer->bulk_upgrade( $file_paths ); - } else { - $installer->bulk_install( $sources ); - } - - remove_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1 ); - - echo '
'; - - return true; - } - - // Bulk activation process. - if ( 'tgmpa-bulk-activate' === $this->current_action() ) { - check_admin_referer( 'bulk-' . $this->_args['plural'] ); - - // Did user actually select any plugins to activate ? - if ( empty( $_POST['plugin'] ) ) { - echo '

', esc_html__( 'No plugins were selected to be activated. No action taken.', '__theme_txtd' ), '

'; - - return false; - } - - // Grab plugin data from $_POST. - $plugins = array(); - if ( isset( $_POST['plugin'] ) ) { - $plugins = array_map( 'urldecode', (array) $_POST['plugin'] ); - $plugins = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins ); - } - - $plugins_to_activate = array(); - $plugin_names = array(); - - // Grab the file paths for the selected & inactive plugins from the registration array. - foreach ( $plugins as $slug ) { - if ( $this->tgmpa->can_plugin_activate( $slug ) ) { - $plugins_to_activate[] = $this->tgmpa->plugins[ $slug ]['file_path']; - $plugin_names[] = $this->tgmpa->plugins[ $slug ]['name']; - } - } - unset( $slug ); - - // Return early if there are no plugins to activate. - if ( empty( $plugins_to_activate ) ) { - echo '

', esc_html__( 'No plugins are available to be activated at this time.', '__theme_txtd' ), '

'; - - return false; - } - - // Now we are good to go - let's start activating plugins. - $activate = activate_plugins( $plugins_to_activate ); - - if ( is_wp_error( $activate ) ) { - echo '

', wp_kses_post( $activate->get_error_message() ), '

'; - } else { - $count = count( $plugin_names ); // Count so we can use _n function. - $plugin_names = array_map( array( 'TGMPA_Utils', 'wrap_in_strong' ), $plugin_names ); - $last_plugin = array_pop( $plugin_names ); // Pop off last name to prep for readability. - $imploded = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', '__theme_txtd' ) . ' ' . $last_plugin ); - - printf( // WPCS: xss ok. - '

%1$s %2$s.

', - esc_html( _n( 'The following plugin was activated successfully:', 'The following plugins were activated successfully:', $count, '__theme_txtd' ) ), - $imploded - ); - - // Update recently activated plugins option. - $recent = (array) get_option( 'recently_activated' ); - foreach ( $plugins_to_activate as $plugin => $time ) { - if ( isset( $recent[ $plugin ] ) ) { - unset( $recent[ $plugin ] ); - } - } - update_option( 'recently_activated', $recent ); - } - - unset( $_POST ); // Reset the $_POST variable in case user wants to perform one action after another. - - return true; - } - - return false; - } - - /** - * Prepares all of our information to be outputted into a usable table. - * - * @since 2.2.0 - */ - public function prepare_items() { - $columns = $this->get_columns(); // Get all necessary column information. - $hidden = array(); // No columns to hide, but we must set as an array. - $sortable = array(); // No reason to make sortable columns. - $primary = $this->get_primary_column_name(); // Column which has the row actions. - $this->_column_headers = array( $columns, $hidden, $sortable, $primary ); // Get all necessary column headers. - - // Process our bulk activations here. - if ( 'tgmpa-bulk-activate' === $this->current_action() ) { - $this->process_bulk_actions(); - } - - // Store all of our plugin data into $items array so WP_List_Table can use it. - $this->items = apply_filters( 'tgmpa_table_data_items', $this->_gather_plugin_data() ); - } - - /* *********** DEPRECATED METHODS *********** */ - - /** - * Retrieve plugin data, given the plugin name. - * - * @since 2.2.0 - * @deprecated 2.5.0 use {@see TGM_Plugin_Activation::_get_plugin_data_from_name()} instead. - * @see TGM_Plugin_Activation::_get_plugin_data_from_name() - * - * @param string $name Name of the plugin, as it was registered. - * @param string $data Optional. Array key of plugin data to return. Default is slug. - * @return string|boolean Plugin slug if found, false otherwise. - */ - protected function _get_plugin_data_from_name( $name, $data = 'slug' ) { - _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'TGM_Plugin_Activation::_get_plugin_data_from_name()' ); - - return $this->tgmpa->_get_plugin_data_from_name( $name, $data ); - } - } -} - - -if ( ! class_exists( 'TGM_Bulk_Installer' ) ) { - - /** - * Hack: Prevent TGMPA v2.4.1- bulk installer class from being loaded if 2.4.1- is loaded after 2.5+. - * - * @since 2.5.2 - * - * {@internal The TGMPA_Bulk_Installer class was originally called TGM_Bulk_Installer. - * For more information, see that class.}} - */ - class TGM_Bulk_Installer { - } -} -if ( ! class_exists( 'TGM_Bulk_Installer_Skin' ) ) { - - /** - * Hack: Prevent TGMPA v2.4.1- bulk installer skin class from being loaded if 2.4.1- is loaded after 2.5+. - * - * @since 2.5.2 - * - * {@internal The TGMPA_Bulk_Installer_Skin class was originally called TGM_Bulk_Installer_Skin. - * For more information, see that class.}} - */ - class TGM_Bulk_Installer_Skin { - } -} - -/** - * The WP_Upgrader file isn't always available. If it isn't available, - * we load it here. - * - * We check to make sure no action or activation keys are set so that WordPress - * does not try to re-include the class when processing upgrades or installs outside - * of the class. - * - * @since 2.2.0 - */ -add_action( 'admin_init', 'tgmpa_load_bulk_installer' ); -if ( ! function_exists( 'tgmpa_load_bulk_installer' ) ) { - /** - * Load bulk installer - */ - function tgmpa_load_bulk_installer() { - // Silently fail if 2.5+ is loaded *after* an older version. - if ( ! isset( $GLOBALS['tgmpa'] ) ) { - return; - } - - // Get TGMPA class instance. - $tgmpa_instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); - - if ( isset( $_GET['page'] ) && $tgmpa_instance->menu === $_GET['page'] ) { - if ( ! class_exists( 'Plugin_Upgrader', false ) ) { - require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; - } - - if ( ! class_exists( 'TGMPA_Bulk_Installer' ) ) { - - /** - * Installer class to handle bulk plugin installations. - * - * Extends WP_Upgrader and customizes to suit the installation of multiple - * plugins. - * - * @since 2.2.0 - * - * {@internal Since 2.5.0 the class is an extension of Plugin_Upgrader rather than WP_Upgrader.}} - * {@internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer to TGMPA_Bulk_Installer. - * This was done to prevent backward compatibility issues with v2.3.6.}} - * - * @package TGM-Plugin-Activation - * @author Thomas Griffin - * @author Gary Jones - */ - class TGMPA_Bulk_Installer extends Plugin_Upgrader { - /** - * Holds result of bulk plugin installation. - * - * @since 2.2.0 - * - * @var string - */ - public $result; - - /** - * Flag to check if bulk installation is occurring or not. - * - * @since 2.2.0 - * - * @var boolean - */ - public $bulk = false; - - /** - * TGMPA instance - * - * @since 2.5.0 - * - * @var object - */ - protected $tgmpa; - - /** - * Whether or not the destination directory needs to be cleared ( = on update). - * - * @since 2.5.0 - * - * @var bool - */ - protected $clear_destination = false; - - /** - * References parent constructor and sets defaults for class. - * - * @since 2.2.0 - * - * @param \Bulk_Upgrader_Skin|null $skin Installer skin. - */ - public function __construct( $skin = null ) { - // Get TGMPA class instance. - $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); - - parent::__construct( $skin ); - - if ( isset( $this->skin->options['install_type'] ) && 'update' === $this->skin->options['install_type'] ) { - $this->clear_destination = true; - } - - if ( $this->tgmpa->is_automatic ) { - $this->activate_strings(); - } - - add_action( 'upgrader_process_complete', array( $this->tgmpa, 'populate_file_path' ) ); - } - - /** - * Sets the correct activation strings for the installer skin to use. - * - * @since 2.2.0 - */ - public function activate_strings() { - $this->strings['activation_failed'] = esc_html__( 'Plugin activation failed.', '__theme_txtd' ); - $this->strings['activation_success'] = esc_html__( 'Plugin activated successfully.', '__theme_txtd' ); - } - - /** - * Performs the actual installation of each plugin. - * - * @since 2.2.0 - * - * @see WP_Upgrader::run() - * - * @param array $options The installation config options. - * @return null|array Return early if error, array of installation data on success. - */ - public function run( $options ) { - $result = parent::run( $options ); - - // Reset the strings in case we changed one during automatic activation. - if ( $this->tgmpa->is_automatic ) { - if ( 'update' === $this->skin->options['install_type'] ) { - $this->upgrade_strings(); - } else { - $this->install_strings(); - } - } - - return $result; - } - - /** - * Processes the bulk installation of plugins. - * - * @since 2.2.0 - * - * {@internal This is basically a near identical copy of the WP Core - * Plugin_Upgrader::bulk_upgrade() method, with minor adjustments to deal with - * new installs instead of upgrades. - * For ease of future synchronizations, the adjustments are clearly commented, but no other - * comments are added. Code style has been made to comply.}} - * - * @see Plugin_Upgrader::bulk_upgrade() - * @see https://core.trac.wordpress.org/browser/tags/4.2.1/src/wp-admin/includes/class-wp-upgrader.php#L838 - * (@internal Last synced: Dec 31st 2015 against https://core.trac.wordpress.org/browser/trunk?rev=36134}} - * - * @param array $plugins The plugin sources needed for installation. - * @param array $args Arbitrary passed extra arguments. - * @return array|false Install confirmation messages on success, false on failure. - */ - public function bulk_install( $plugins, $args = array() ) { - // [TGMPA + ] Hook auto-activation in. - add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); - - $defaults = array( - 'clear_update_cache' => true, - ); - $parsed_args = wp_parse_args( $args, $defaults ); - - $this->init(); - $this->bulk = true; - - $this->install_strings(); // [TGMPA + ] adjusted. - - /* [TGMPA - ] $current = get_site_transient( 'update_plugins' ); */ - - /* [TGMPA - ] add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); */ - - $this->skin->header(); - - // Connect to the Filesystem first. - $res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) ); - if ( ! $res ) { - $this->skin->footer(); - return false; - } - - $this->skin->bulk_header(); - - /* - * Only start maintenance mode if: - * - running Multisite and there are one or more plugins specified, OR - * - a plugin with an update available is currently active. - * @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible. - */ - $maintenance = ( is_multisite() && ! empty( $plugins ) ); - - /* - [TGMPA - ] - foreach ( $plugins as $plugin ) - $maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin] ) ); - */ - if ( $maintenance ) { - $this->maintenance_mode( true ); - } - - $results = array(); - - $this->update_count = count( $plugins ); - $this->update_current = 0; - foreach ( $plugins as $plugin ) { - $this->update_current++; - - /* - [TGMPA - ] - $this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true); - - if ( !isset( $current->response[ $plugin ] ) ) { - $this->skin->set_result('up_to_date'); - $this->skin->before(); - $this->skin->feedback('up_to_date'); - $this->skin->after(); - $results[$plugin] = true; - continue; - } - - // Get the URL to the zip file. - $r = $current->response[ $plugin ]; - - $this->skin->plugin_active = is_plugin_active($plugin); - */ - - $result = $this->run( - array( - 'package' => $plugin, // [TGMPA + ] adjusted. - 'destination' => WP_PLUGIN_DIR, - 'clear_destination' => false, // [TGMPA + ] adjusted. - 'clear_working' => true, - 'is_multi' => true, - 'hook_extra' => array( - 'plugin' => $plugin, - ), - ) - ); - - $results[ $plugin ] = $this->result; - - // Prevent credentials auth screen from displaying multiple times. - if ( false === $result ) { - break; - } - } //end foreach $plugins - - $this->maintenance_mode( false ); - - /** - * Fires when the bulk upgrader process is complete. - * - * @since WP 3.6.0 / TGMPA 2.5.0 - * - * @param Plugin_Upgrader $this Plugin_Upgrader instance. In other contexts, $this, might - * be a Theme_Upgrader or Core_Upgrade instance. - * @param array $data { - * Array of bulk item update data. - * - * @type string $action Type of action. Default 'update'. - * @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'. - * @type bool $bulk Whether the update process is a bulk update. Default true. - * @type array $packages Array of plugin, theme, or core packages to update. - * } - */ - do_action( 'upgrader_process_complete', $this, array( - 'action' => 'install', // [TGMPA + ] adjusted. - 'type' => 'plugin', - 'bulk' => true, - 'plugins' => $plugins, - ) ); - - $this->skin->bulk_footer(); - - $this->skin->footer(); - - // Cleanup our hooks, in case something else does a upgrade on this connection. - /* [TGMPA - ] remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); */ - - // [TGMPA + ] Remove our auto-activation hook. - remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); - - // Force refresh of plugin update information. - wp_clean_plugins_cache( $parsed_args['clear_update_cache'] ); - - return $results; - } - - /** - * Handle a bulk upgrade request. - * - * @since 2.5.0 - * - * @see Plugin_Upgrader::bulk_upgrade() - * - * @param array $plugins The local WP file_path's of the plugins which should be upgraded. - * @param array $args Arbitrary passed extra arguments. - * @return string|bool Install confirmation messages on success, false on failure. - */ - public function bulk_upgrade( $plugins, $args = array() ) { - - add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); - - $result = parent::bulk_upgrade( $plugins, $args ); - - remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); - - return $result; - } - - /** - * Abuse a filter to auto-activate plugins after installation. - * - * Hooked into the 'upgrader_post_install' filter hook. - * - * @since 2.5.0 - * - * @param bool $bool The value we need to give back (true). - * @return bool - */ - public function auto_activate( $bool ) { - // Only process the activation of installed plugins if the automatic flag is set to true. - if ( $this->tgmpa->is_automatic ) { - // Flush plugins cache so the headers of the newly installed plugins will be read correctly. - wp_clean_plugins_cache(); - - // Get the installed plugin file. - $plugin_info = $this->plugin_info(); - - // Don't try to activate on upgrade of active plugin as WP will do this already. - if ( ! is_plugin_active( $plugin_info ) ) { - $activate = activate_plugin( $plugin_info ); - - // Adjust the success string based on the activation result. - $this->strings['process_success'] = $this->strings['process_success'] . "
\n"; - - if ( is_wp_error( $activate ) ) { - $this->skin->error( $activate ); - $this->strings['process_success'] .= $this->strings['activation_failed']; - } else { - $this->strings['process_success'] .= $this->strings['activation_success']; - } - } - } - - return $bool; - } - } - } - - if ( ! class_exists( 'TGMPA_Bulk_Installer_Skin' ) ) { - - /** - * Installer skin to set strings for the bulk plugin installations.. - * - * Extends Bulk_Upgrader_Skin and customizes to suit the installation of multiple - * plugins. - * - * @since 2.2.0 - * - * {@internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer_Skin to - * TGMPA_Bulk_Installer_Skin. - * This was done to prevent backward compatibility issues with v2.3.6.}} - * - * @see https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-upgrader-skins.php - * - * @package TGM-Plugin-Activation - * @author Thomas Griffin - * @author Gary Jones - */ - class TGMPA_Bulk_Installer_Skin extends Bulk_Upgrader_Skin { - /** - * Holds plugin info for each individual plugin installation. - * - * @since 2.2.0 - * - * @var array - */ - public $plugin_info = array(); - - /** - * Holds names of plugins that are undergoing bulk installations. - * - * @since 2.2.0 - * - * @var array - */ - public $plugin_names = array(); - - /** - * Integer to use for iteration through each plugin installation. - * - * @since 2.2.0 - * - * @var integer - */ - public $i = 0; - - /** - * TGMPA instance - * - * @since 2.5.0 - * - * @var object - */ - protected $tgmpa; - - /** - * Constructor. Parses default args with new ones and extracts them for use. - * - * @since 2.2.0 - * - * @param array $args Arguments to pass for use within the class. - */ - public function __construct( $args = array() ) { - // Get TGMPA class instance. - $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); - - // Parse default and new args. - $defaults = array( - 'url' => '', - 'nonce' => '', - 'names' => array(), - 'install_type' => 'install', - ); - $args = wp_parse_args( $args, $defaults ); - - // Set plugin names to $this->plugin_names property. - $this->plugin_names = $args['names']; - - // Extract the new args. - parent::__construct( $args ); - } - - /** - * Sets install skin strings for each individual plugin. - * - * Checks to see if the automatic activation flag is set and uses the - * the proper strings accordingly. - * - * @since 2.2.0 - */ - public function add_strings() { - if ( 'update' === $this->options['install_type'] ) { - parent::add_strings(); - /* translators: 1: plugin name, 2: action number 3: total number of actions. */ - $this->upgrader->strings['skin_before_update_header'] = esc_html__( 'Updating Plugin %1$s (%2$d/%3$d)', '__theme_txtd' ); - } else { - /* translators: 1: plugin name, 2: error message. */ - $this->upgrader->strings['skin_update_failed_error'] = wp_kses( __( 'An error occurred while installing %1$s: %2$s.', '__theme_txtd' ), wp_kses_allowed_html() ); - /* translators: 1: plugin name. */ - $this->upgrader->strings['skin_update_failed'] = esc_html__( 'The installation of %1$s failed.', '__theme_txtd' ); - - if ( $this->tgmpa->is_automatic ) { - // Automatic activation strings. - $this->upgrader->strings['skin_upgrade_start'] = esc_html__( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', '__theme_txtd' ); - /* translators: 1: plugin name. */ - $this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed and activated successfully.', '__theme_txtd' ) . ' ' . esc_html__( 'Show Details', '__theme_txtd' ) . '.'; - $this->upgrader->strings['skin_upgrade_end'] = esc_html__( 'All installations and activations have been completed.', '__theme_txtd' ); - /* translators: 1: plugin name, 2: action number 3: total number of actions. */ - $this->upgrader->strings['skin_before_update_header'] = esc_html__( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', '__theme_txtd' ); - } else { - // Default installation strings. - $this->upgrader->strings['skin_upgrade_start'] = esc_html__( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', '__theme_txtd' ); - /* translators: 1: plugin name. */ - $this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', '__theme_txtd' ) . ' ' . esc_html__( 'Show Details', '__theme_txtd' ) . '.'; - $this->upgrader->strings['skin_upgrade_end'] = esc_html__( 'All installations have been completed.', '__theme_txtd' ); - /* translators: 1: plugin name, 2: action number 3: total number of actions. */ - $this->upgrader->strings['skin_before_update_header'] = esc_html__( 'Installing Plugin %1$s (%2$d/%3$d)', '__theme_txtd' ); - } - } - } - - /** - * Outputs the header strings and necessary JS before each plugin installation. - * - * @since 2.2.0 - * - * @param string $title Unused in this implementation. - */ - public function before( $title = '' ) { - if ( empty( $title ) ) { - $title = esc_html( $this->plugin_names[ $this->i ] ); - } - parent::before( $title ); - } - - /** - * Outputs the footer strings and necessary JS after each plugin installation. - * - * Checks for any errors and outputs them if they exist, else output - * success strings. - * - * @since 2.2.0 - * - * @param string $title Unused in this implementation. - */ - public function after( $title = '' ) { - if ( empty( $title ) ) { - $title = esc_html( $this->plugin_names[ $this->i ] ); - } - parent::after( $title ); - - $this->i++; - } - - /** - * Outputs links after bulk plugin installation is complete. - * - * @since 2.2.0 - */ - public function bulk_footer() { - // Serve up the string to say installations (and possibly activations) are complete. - parent::bulk_footer(); - - // Flush plugins cache so we can make sure that the installed plugins list is always up to date. - wp_clean_plugins_cache(); - - $this->tgmpa->show_tgmpa_version(); - - // Display message based on if all plugins are now active or not. - $update_actions = array(); - - if ( $this->tgmpa->is_tgmpa_complete() ) { - // All plugins are active, so we display the complete string and hide the menu to protect users. - echo ''; - $update_actions['dashboard'] = sprintf( - esc_html( $this->tgmpa->strings['complete'] ), - '' . esc_html__( 'Return to the Dashboard', '__theme_txtd' ) . '' - ); - } else { - $update_actions['tgmpa_page'] = '' . esc_html( $this->tgmpa->strings['return'] ) . ''; - } - - /** - * Filter the list of action links available following bulk plugin installs/updates. - * - * @since 2.5.0 - * - * @param array $update_actions Array of plugin action links. - * @param array $plugin_info Array of information for the last-handled plugin. - */ - $update_actions = apply_filters( 'tgmpa_update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info ); - - if ( ! empty( $update_actions ) ) { - $this->feedback( implode( ' | ', (array) $update_actions ) ); - } - } - - /* *********** DEPRECATED METHODS *********** */ - - /** - * Flush header output buffer. - * - * @since 2.2.0 - * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead - * @see Bulk_Upgrader_Skin::flush_output() - */ - public function before_flush_output() { - _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' ); - $this->flush_output(); - } - - /** - * Flush footer output buffer and iterate $this->i to make sure the - * installation strings reference the correct plugin. - * - * @since 2.2.0 - * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead - * @see Bulk_Upgrader_Skin::flush_output() - */ - public function after_flush_output() { - _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' ); - $this->flush_output(); - $this->i++; - } - } - } - } - } -} - -if ( ! class_exists( 'TGMPA_Utils' ) ) { - - /** - * Generic utilities for TGMPA. - * - * All methods are static, poor-dev name-spacing class wrapper. - * - * Class was called TGM_Utils in 2.5.0 but renamed TGMPA_Utils in 2.5.1 as this was conflicting with Soliloquy. - * - * @since 2.5.0 - * - * @package TGM-Plugin-Activation - * @author Juliette Reinders Folmer - */ - class TGMPA_Utils { - /** - * Whether the PHP filter extension is enabled. - * - * @see http://php.net/book.filter - * - * @since 2.5.0 - * - * @static - * - * @var bool $has_filters True is the extension is enabled. - */ - public static $has_filters; - - /** - * Wrap an arbitrary string in tags. Meant to be used in combination with array_map(). - * - * @since 2.5.0 - * - * @static - * - * @param string $string Text to be wrapped. - * @return string - */ - public static function wrap_in_em( $string ) { - return '' . wp_kses_post( $string ) . ''; - } - - /** - * Wrap an arbitrary string in tags. Meant to be used in combination with array_map(). - * - * @since 2.5.0 - * - * @static - * - * @param string $string Text to be wrapped. - * @return string - */ - public static function wrap_in_strong( $string ) { - return '' . wp_kses_post( $string ) . ''; - } - - /** - * Helper function: Validate a value as boolean - * - * @since 2.5.0 - * - * @static - * - * @param mixed $value Arbitrary value. - * @return bool - */ - public static function validate_bool( $value ) { - if ( ! isset( self::$has_filters ) ) { - self::$has_filters = extension_loaded( 'filter' ); - } - - if ( self::$has_filters ) { - return filter_var( $value, FILTER_VALIDATE_BOOLEAN ); - } else { - return self::emulate_filter_bool( $value ); - } - } - - /** - * Helper function: Cast a value to bool - * - * @since 2.5.0 - * - * @static - * - * @param mixed $value Value to cast. - * @return bool - */ - protected static function emulate_filter_bool( $value ) { - // @codingStandardsIgnoreStart - static $true = array( - '1', - 'true', 'True', 'TRUE', - 'y', 'Y', - 'yes', 'Yes', 'YES', - 'on', 'On', 'ON', - ); - static $false = array( - '0', - 'false', 'False', 'FALSE', - 'n', 'N', - 'no', 'No', 'NO', - 'off', 'Off', 'OFF', - ); - // @codingStandardsIgnoreEnd - - if ( is_bool( $value ) ) { - return $value; - } elseif ( is_int( $value ) && ( 0 === $value || 1 === $value ) ) { - return (bool) $value; - } elseif ( ( is_float( $value ) && ! is_nan( $value ) ) && ( (float) 0 === $value || (float) 1 === $value ) ) { - return (bool) $value; - } elseif ( is_string( $value ) ) { - $value = trim( $value ); - if ( in_array( $value, $true, true ) ) { - return true; - } elseif ( in_array( $value, $false, true ) ) { - return false; - } else { - return false; - } - } - - return false; - } - } // End of class TGMPA_Utils -} // End of class_exists wrapper diff --git a/inc/required-plugins/languages/tgmpa.pot b/inc/required-plugins/languages/tgmpa.pot deleted file mode 100644 index d7e1e09..0000000 --- a/inc/required-plugins/languages/tgmpa.pot +++ /dev/null @@ -1,467 +0,0 @@ -#, fuzzy -msgid "" -msgstr "" -"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" -"Project-Id-Version: TGM Plugin Activation\n" -"POT-Creation-Date: 2016-05-19 02:57+0200\n" -"PO-Revision-Date: 2016-01-04 11:07+0100\n" -"Last-Translator: Juliette Reinders Folmer \n" -"Language-Team: TGMPA\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.8.7\n" -"X-Poedit-Basepath: ..\n" -"X-Poedit-WPHeader: class-tgm-plugin-activation.php\n" -"X-Poedit-SourceCharset: UTF-8\n" -"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" -"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;" -"_nx_noop:3c,1,2;__ngettext_noop:1,2\n" -"X-Poedit-SearchPath-0: .\n" -"X-Poedit-SearchPathExcluded-0: *.js\n" -"X-Poedit-SearchPathExcluded-1: example.php\n" - -#: class-tgm-plugin-activation.php:334 -msgid "Install Required Plugins" -msgstr "" - -#: class-tgm-plugin-activation.php:335 -msgid "Install Plugins" -msgstr "" - -#. translators: %s: plugin name. -#: class-tgm-plugin-activation.php:337 -#, php-format -msgid "Installing Plugin: %s" -msgstr "" - -#. translators: %s: plugin name. -#: class-tgm-plugin-activation.php:339 -#, php-format -msgid "Updating Plugin: %s" -msgstr "" - -#: class-tgm-plugin-activation.php:340 -msgid "Something went wrong with the plugin API." -msgstr "" - -#. translators: 1: plugin name(s). -#: class-tgm-plugin-activation.php:343 -#, php-format -msgid "This theme requires the following plugin: %1$s." -msgid_plural "This theme requires the following plugins: %1$s." -msgstr[0] "" -msgstr[1] "" - -#. translators: 1: plugin name(s). -#: class-tgm-plugin-activation.php:349 -#, php-format -msgid "This theme recommends the following plugin: %1$s." -msgid_plural "This theme recommends the following plugins: %1$s." -msgstr[0] "" -msgstr[1] "" - -#. translators: 1: plugin name(s). -#: class-tgm-plugin-activation.php:355 -#, php-format -msgid "" -"The following plugin needs to be updated to its latest version to ensure " -"maximum compatibility with this theme: %1$s." -msgid_plural "" -"The following plugins need to be updated to their latest version to ensure " -"maximum compatibility with this theme: %1$s." -msgstr[0] "" -msgstr[1] "" - -#. translators: 1: plugin name(s). -#: class-tgm-plugin-activation.php:361 -#, php-format -msgid "There is an update available for: %1$s." -msgid_plural "There are updates available for the following plugins: %1$s." -msgstr[0] "" -msgstr[1] "" - -#. translators: 1: plugin name(s). -#: class-tgm-plugin-activation.php:367 -#, php-format -msgid "The following required plugin is currently inactive: %1$s." -msgid_plural "The following required plugins are currently inactive: %1$s." -msgstr[0] "" -msgstr[1] "" - -#. translators: 1: plugin name(s). -#: class-tgm-plugin-activation.php:373 -#, php-format -msgid "The following recommended plugin is currently inactive: %1$s." -msgid_plural "The following recommended plugins are currently inactive: %1$s." -msgstr[0] "" -msgstr[1] "" - -#: class-tgm-plugin-activation.php:378 -msgid "Begin installing plugin" -msgid_plural "Begin installing plugins" -msgstr[0] "" -msgstr[1] "" - -#: class-tgm-plugin-activation.php:383 -msgid "Begin updating plugin" -msgid_plural "Begin updating plugins" -msgstr[0] "" -msgstr[1] "" - -#: class-tgm-plugin-activation.php:388 -msgid "Begin activating plugin" -msgid_plural "Begin activating plugins" -msgstr[0] "" -msgstr[1] "" - -#: class-tgm-plugin-activation.php:392 -msgid "Return to Required Plugins Installer" -msgstr "" - -#: class-tgm-plugin-activation.php:393 class-tgm-plugin-activation.php:920 -#: class-tgm-plugin-activation.php:2626 class-tgm-plugin-activation.php:3673 -msgid "Return to the Dashboard" -msgstr "" - -#: class-tgm-plugin-activation.php:394 class-tgm-plugin-activation.php:3252 -msgid "Plugin activated successfully." -msgstr "" - -#: class-tgm-plugin-activation.php:395 class-tgm-plugin-activation.php:3045 -msgid "The following plugin was activated successfully:" -msgid_plural "The following plugins were activated successfully:" -msgstr[0] "" -msgstr[1] "" - -#. translators: 1: plugin name. -#: class-tgm-plugin-activation.php:397 -#, php-format -msgid "No action taken. Plugin %1$s was already active." -msgstr "" - -#. translators: 1: plugin name. -#: class-tgm-plugin-activation.php:399 -#, php-format -msgid "" -"Plugin not activated. A higher version of %s is needed for this theme. " -"Please update the plugin." -msgstr "" - -#. translators: 1: dashboard link. -#: class-tgm-plugin-activation.php:401 -#, php-format -msgid "All plugins installed and activated successfully. %1$s" -msgstr "" - -#: class-tgm-plugin-activation.php:402 -msgid "Dismiss this notice" -msgstr "" - -#: class-tgm-plugin-activation.php:403 -msgid "" -"There are one or more required or recommended plugins to install, update or " -"activate." -msgstr "" - -#: class-tgm-plugin-activation.php:404 -msgid "Please contact the administrator of this site for help." -msgstr "" - -#: class-tgm-plugin-activation.php:607 -msgid "This plugin needs to be updated to be compatible with your theme." -msgstr "" - -#: class-tgm-plugin-activation.php:608 -msgid "Update Required" -msgstr "" - -#: class-tgm-plugin-activation.php:725 -msgid "Set the parent_slug config variable instead." -msgstr "" - -#: class-tgm-plugin-activation.php:1027 -msgid "" -"The remote plugin package does not contain a folder with the desired slug " -"and renaming did not work." -msgstr "" - -#: class-tgm-plugin-activation.php:1027 class-tgm-plugin-activation.php:1030 -msgid "" -"Please contact the plugin provider and ask them to package their plugin " -"according to the WordPress guidelines." -msgstr "" - -#: class-tgm-plugin-activation.php:1030 -msgid "" -"The remote plugin package consists of more than one file, but the files are " -"not packaged in a folder." -msgstr "" - -#: class-tgm-plugin-activation.php:1214 class-tgm-plugin-activation.php:3041 -msgctxt "plugin A *and* plugin B" -msgid "and" -msgstr "" - -#. translators: %s: version number -#: class-tgm-plugin-activation.php:2075 -#, php-format -msgid "TGMPA v%s" -msgstr "" - -#: class-tgm-plugin-activation.php:2366 -msgid "Required" -msgstr "" - -#: class-tgm-plugin-activation.php:2369 -msgid "Recommended" -msgstr "" - -#: class-tgm-plugin-activation.php:2385 -msgid "WordPress Repository" -msgstr "" - -#: class-tgm-plugin-activation.php:2388 -msgid "External Source" -msgstr "" - -#: class-tgm-plugin-activation.php:2391 -msgid "Pre-Packaged" -msgstr "" - -#: class-tgm-plugin-activation.php:2408 -msgid "Not Installed" -msgstr "" - -#: class-tgm-plugin-activation.php:2412 -msgid "Installed But Not Activated" -msgstr "" - -#: class-tgm-plugin-activation.php:2414 -msgid "Active" -msgstr "" - -#: class-tgm-plugin-activation.php:2420 -msgid "Required Update not Available" -msgstr "" - -#: class-tgm-plugin-activation.php:2423 -msgid "Requires Update" -msgstr "" - -#: class-tgm-plugin-activation.php:2426 -msgid "Update recommended" -msgstr "" - -#. translators: 1: install status, 2: update status -#: class-tgm-plugin-activation.php:2435 -#, php-format -msgctxt "Install/Update Status" -msgid "%1$s, %2$s" -msgstr "" - -#. translators: 1: number of plugins. -#: class-tgm-plugin-activation.php:2481 -#, php-format -msgctxt "plugins" -msgid "All (%s)" -msgid_plural "All (%s)" -msgstr[0] "" -msgstr[1] "" - -#. translators: 1: number of plugins. -#: class-tgm-plugin-activation.php:2485 -#, php-format -msgid "To Install (%s)" -msgid_plural "To Install (%s)" -msgstr[0] "" -msgstr[1] "" - -#. translators: 1: number of plugins. -#: class-tgm-plugin-activation.php:2489 -#, php-format -msgid "Update Available (%s)" -msgid_plural "Update Available (%s)" -msgstr[0] "" -msgstr[1] "" - -#. translators: 1: number of plugins. -#: class-tgm-plugin-activation.php:2493 -#, php-format -msgid "To Activate (%s)" -msgid_plural "To Activate (%s)" -msgstr[0] "" -msgstr[1] "" - -#: class-tgm-plugin-activation.php:2575 -msgctxt "as in: \"version nr unknown\"" -msgid "unknown" -msgstr "" - -#: class-tgm-plugin-activation.php:2583 -msgid "Installed version:" -msgstr "" - -#: class-tgm-plugin-activation.php:2591 -msgid "Minimum required version:" -msgstr "" - -#: class-tgm-plugin-activation.php:2603 -msgid "Available version:" -msgstr "" - -#: class-tgm-plugin-activation.php:2626 -msgid "No plugins to install, update or activate." -msgstr "" - -#: class-tgm-plugin-activation.php:2640 -msgid "Plugin" -msgstr "" - -#: class-tgm-plugin-activation.php:2641 -msgid "Source" -msgstr "" - -#: class-tgm-plugin-activation.php:2642 -msgid "Type" -msgstr "" - -#: class-tgm-plugin-activation.php:2646 -msgid "Version" -msgstr "" - -#: class-tgm-plugin-activation.php:2647 -msgid "Status" -msgstr "" - -#. translators: %2$s: plugin name in screen reader markup -#: class-tgm-plugin-activation.php:2696 -#, php-format -msgid "Install %2$s" -msgstr "" - -#. translators: %2$s: plugin name in screen reader markup -#: class-tgm-plugin-activation.php:2701 -#, php-format -msgid "Update %2$s" -msgstr "" - -#. translators: %2$s: plugin name in screen reader markup -#: class-tgm-plugin-activation.php:2707 -#, php-format -msgid "Activate %2$s" -msgstr "" - -#: class-tgm-plugin-activation.php:2777 -msgid "Upgrade message from the plugin author:" -msgstr "" - -#: class-tgm-plugin-activation.php:2810 -msgid "Install" -msgstr "" - -#: class-tgm-plugin-activation.php:2816 -msgid "Update" -msgstr "" - -#: class-tgm-plugin-activation.php:2819 -msgid "Activate" -msgstr "" - -#: class-tgm-plugin-activation.php:2850 -msgid "No plugins were selected to be installed. No action taken." -msgstr "" - -#: class-tgm-plugin-activation.php:2852 -msgid "No plugins were selected to be updated. No action taken." -msgstr "" - -#: class-tgm-plugin-activation.php:2893 -msgid "No plugins are available to be installed at this time." -msgstr "" - -#: class-tgm-plugin-activation.php:2895 -msgid "No plugins are available to be updated at this time." -msgstr "" - -#: class-tgm-plugin-activation.php:3001 -msgid "No plugins were selected to be activated. No action taken." -msgstr "" - -#: class-tgm-plugin-activation.php:3027 -msgid "No plugins are available to be activated at this time." -msgstr "" - -#: class-tgm-plugin-activation.php:3251 -msgid "Plugin activation failed." -msgstr "" - -#. translators: 1: plugin name, 2: action number 3: total number of actions. -#: class-tgm-plugin-activation.php:3591 -#, php-format -msgid "Updating Plugin %1$s (%2$d/%3$d)" -msgstr "" - -#. translators: 1: plugin name, 2: error message. -#: class-tgm-plugin-activation.php:3594 -#, php-format -msgid "An error occurred while installing %1$s: %2$s." -msgstr "" - -#. translators: 1: plugin name. -#: class-tgm-plugin-activation.php:3596 -#, php-format -msgid "The installation of %1$s failed." -msgstr "" - -#: class-tgm-plugin-activation.php:3600 -msgid "" -"The installation and activation process is starting. This process may take a " -"while on some hosts, so please be patient." -msgstr "" - -#. translators: 1: plugin name. -#: class-tgm-plugin-activation.php:3602 -#, php-format -msgid "%1$s installed and activated successfully." -msgstr "" - -#: class-tgm-plugin-activation.php:3602 class-tgm-plugin-activation.php:3610 -msgid "Show Details" -msgstr "" - -#: class-tgm-plugin-activation.php:3602 class-tgm-plugin-activation.php:3610 -msgid "Hide Details" -msgstr "" - -#: class-tgm-plugin-activation.php:3603 -msgid "All installations and activations have been completed." -msgstr "" - -#. translators: 1: plugin name, 2: action number 3: total number of actions. -#: class-tgm-plugin-activation.php:3605 -#, php-format -msgid "Installing and Activating Plugin %1$s (%2$d/%3$d)" -msgstr "" - -#: class-tgm-plugin-activation.php:3608 -msgid "" -"The installation process is starting. This process may take a while on some " -"hosts, so please be patient." -msgstr "" - -#. translators: 1: plugin name. -#: class-tgm-plugin-activation.php:3610 -#, php-format -msgid "%1$s installed successfully." -msgstr "" - -#: class-tgm-plugin-activation.php:3611 -msgid "All installations have been completed." -msgstr "" - -#. translators: 1: plugin name, 2: action number 3: total number of actions. -#: class-tgm-plugin-activation.php:3613 -#, php-format -msgid "Installing Plugin %1$s (%2$d/%3$d)" -msgstr "" diff --git a/inc/template-tags.php b/inc/template-tags.php index 33202f0..35899e4 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -27,14 +27,14 @@ function jason_posted_on() { '' . $time_string . '' ); - echo '' . $posted_on . ''; // WPCS: XSS OK. + echo '' . $posted_on . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped if ( 'post' == get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( esc_html__( ', ', 'jason-lite' ) ); if ( $categories_list && jason_categorized_blog() ) { /* translators: %1$s for categories */ - printf( '' . esc_html__( '%1$s ', 'jason-lite' ) . '', $categories_list ); // WPCS: XSS OK. + printf( '' . esc_html__( '%1$s ', 'jason-lite' ) . '', $categories_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } @@ -71,14 +71,14 @@ function jason_archive_posted_on() { '' . $time_string . '' ); - echo '' . $posted_on . ''; // WPCS: XSS OK. + echo '' . $posted_on . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped if ( 'post' == get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( esc_html__( ', ', 'jason-lite' ) ); if ( $categories_list && jason_categorized_blog() ) { /* translators: %s post category */ - printf( '' . esc_html__( '%1$s ', 'jason-lite' ) . '', $categories_list ); // WPCS: XSS OK. + printf( '' . esc_html__( '%1$s ', 'jason-lite' ) . '', $categories_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } @@ -125,7 +125,6 @@ function jason_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'jason_categories' ); } - add_action( 'edit_category', 'jason_category_transient_flusher' ); add_action( 'save_post', 'jason_category_transient_flusher' ); @@ -218,7 +217,7 @@ function jason_site_title_classes( $classes ) { $classes = array_map( 'esc_attr', $classes ); // Separates classes with a single space, collates classes for site branding - echo 'class="' . join( ' ', $classes ) . '"'; + echo 'class="' . esc_attr( join( ' ', $classes ) ) . '"'; } endif; @@ -255,7 +254,8 @@ function jason_post_views( $post_ID = null ) { if ( ! empty( $result[0] ) && ! empty( $result[0]['views'] ) ) { $views = $result[0]['views']; - printf( // WPCS: XSS OK. + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + printf( /* translators: %1$s %2$s for number of views */ '' . _nx( '%1$s view', '%2$s views', $views, 'post views', 'jason-lite' ) . '', number_format_i18n( $views ) @@ -328,4 +328,4 @@ function jason_tags_dropdown() { +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} -
-
+get_header(); ?> - +
+
- + - ', '
' ); ?> + - + ', '
' ); - - + get_template_part('template-parts/archive-filters'); - + while ( have_posts() ) : the_post(); - + /* + * Include the template for the archive layout + * If you want to override this in a child theme, then include a file + * called content-archive.php located in the template-parts directory + * and that will be used instead. + */ + get_template_part( 'template-parts/content-archive' ); - + endwhile; - + the_posts_navigation(); - + } else { + get_template_part( 'template-parts/content', 'none' ); + } ?> - + + - - - - - \ No newline at end of file + -1, + is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1, + is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1; + + if ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) { + window.addEventListener( 'hashchange', function() { + var id = location.hash.substring( 1 ), + element; + + if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { + return; + } + + element = document.getElementById( id ); + + if ( element ) { + if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { + element.tabIndex = -1; + } + + element.focus(); + } + }, false ); + } +})(); diff --git a/inc/required-plugins/LICENSE.md b/license.txt similarity index 62% rename from inc/required-plugins/LICENSE.md rename to license.txt index 23cb790..f4685f8 100644 --- a/inc/required-plugins/LICENSE.md +++ b/license.txt @@ -1,65 +1,66 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110, USA - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble - The licenses for most software are designed to take away your + The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to +the GNU Library General Public License instead.) You can apply it to your programs, too. - When we speak of free software, we are referring to freedom, not + 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 this service 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 make restrictions that forbid + To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. - For example, if you distribute copies of such a program, whether + For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. 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. - We protect your rights with two steps: (1) copyright the software, and + We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. - Also, for each author's protection and ours, we want to make certain + Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. - Finally, any free program is threatened constantly by software + Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. - The precise terms and conditions for copying, distribution and + The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - 0. This License applies to any program or other work which contains + 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" @@ -76,7 +77,7 @@ is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. - 1. You may copy and distribute verbatim copies of the Program's + 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the @@ -87,29 +88,29 @@ along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - 2. You may modify your copy or copies of the Program or any portion + 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, @@ -120,7 +121,6 @@ distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. - Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or @@ -131,26 +131,26 @@ with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. - 3. You may copy and distribute the Program (or a work based on it, + 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source @@ -169,7 +169,7 @@ access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - 4. You may not copy, modify, sublicense, or distribute the Program + 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. @@ -177,7 +177,7 @@ However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. - 5. You are not required to accept this License, since you have not + 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by @@ -186,7 +186,7 @@ Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. - 6. Each time you redistribute the Program (or any work based on the + 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further @@ -194,7 +194,7 @@ restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. - 7. If, as a consequence of a court judgment or allegation of patent + 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not @@ -226,7 +226,7 @@ impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - 8. If the distribution and/or use of the Program is restricted in + 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding @@ -234,7 +234,7 @@ those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. - 9. The Free Software Foundation may publish revised and/or new versions + 9. The Free Software Foundation may publish revised and/or new versions of the 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. @@ -247,7 +247,7 @@ Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. - 10. If you wish to incorporate parts of the Program into other free + 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes @@ -255,9 +255,9 @@ make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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 @@ -267,7 +267,7 @@ 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. - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING @@ -277,63 +277,5 @@ 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. - 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 -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {description} - Copyright (C) {year} {fullname} - - 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 2 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, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision 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, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - {signature of Ty Coon}, 1 April 1989 - Ty Coon, President of Vice + END OF TERMS AND CONDITIONS -This 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. diff --git a/package-lock.json b/package-lock.json index 6982bb5..26db959 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "patch-lite", + "name": "jason-lite", "requires": true, "lockfileVersion": 1, "dependencies": { @@ -34,6 +34,35 @@ "through2": "^2.0.3" } }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", + "dev": true + }, + "@types/glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", + "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", + "dev": true, + "requires": { + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "@types/node": { + "version": "12.0.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.10.tgz", + "integrity": "sha512-LcsGbPomWsad6wmMNv7nBLw7YYYyfdYcz6xryKYQhx89c3XXan+8Q6AJ43G5XDIaklaVkK3mE4fCb0SBvMiPSQ==", + "dev": true + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -325,21 +354,21 @@ "dev": true }, "async-done": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.1.tgz", - "integrity": "sha512-R1BaUeJ4PMoLNJuk+0tLJgjmEqVsdN118+Z8O+alhnQDQgy0kmD5Mqi0DNEmMx2LM0Ed5yekKu+ZXYvIHceicg==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", + "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", "dev": true, "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.2", - "process-nextick-args": "^1.0.7", + "process-nextick-args": "^2.0.0", "stream-exhaust": "^1.0.1" } }, "async-each": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.2.tgz", - "integrity": "sha512-6xrbvN0MOBKSJDdonmSSz2OwFSgxRaVtBDes26mj9KIGtDo+g9xosFRSC+i1gQh2oAN/tQ62AI/pGZGQjVOiRg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", "dev": true }, "async-foreach": { @@ -370,16 +399,17 @@ "dev": true }, "autoprefixer": { - "version": "9.5.1", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.5.1.tgz", - "integrity": "sha512-KJSzkStUl3wP0D5sdMlP82Q52JLy5+atf2MHAre48+ckWkXgixmfHyWmA77wFDy6jTHU6mIgXv6hAQ2mf1PjJQ==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.6.0.tgz", + "integrity": "sha512-kuip9YilBqhirhHEGHaBTZKXL//xxGnzvsD0FtBQa6z+A69qZD6s/BAX9VzDF1i9VKDquTJDQaPLSEhOnL6FvQ==", "dev": true, "requires": { - "browserslist": "^4.5.4", - "caniuse-lite": "^1.0.30000957", + "browserslist": "^4.6.1", + "caniuse-lite": "^1.0.30000971", + "chalk": "^2.4.2", "normalize-range": "^0.1.2", "num2fraction": "^1.2.2", - "postcss": "^7.0.14", + "postcss": "^7.0.16", "postcss-value-parser": "^3.3.1" } }, @@ -570,14 +600,14 @@ } }, "browserslist": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.5.4.tgz", - "integrity": "sha512-rAjx494LMjqKnMPhFkuLmLp8JWEX0o8ADTGeAbOqaF+XCvYLreZrG5uVjnPBlAQ8REZK4pzXGvp0bWgrFtKaag==", + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.6.3.tgz", + "integrity": "sha512-CNBqTCq22RKM8wKJNowcqihHJ4SkI8CGeK7KOR9tPboXUuS5Zk5lQgzzTbs4oxD8x+6HUshZUa2OyNI9lR93bQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30000955", - "electron-to-chromium": "^1.3.122", - "node-releases": "^1.1.13" + "caniuse-lite": "^1.0.30000975", + "electron-to-chromium": "^1.3.164", + "node-releases": "^1.1.23" } }, "buffer-equal": { @@ -646,9 +676,9 @@ } }, "caniuse-lite": { - "version": "1.0.30000957", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000957.tgz", - "integrity": "sha512-8wxNrjAzyiHcLXN/iunskqQnJquQQ6VX8JHfW5kLgAPRSiSuKZiNfmIkP5j7jgyXqAQBSoXyJxfnbCFS0ThSiQ==", + "version": "1.0.30000977", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000977.tgz", + "integrity": "sha512-RTXL32vdfAc2g9aoDL6vnBzbOO/3sM+T+YX4m7W9iFZnl3qIz7WYoZZpcZpALud8xq4+N56rnruX/NQy9HQu6A==", "dev": true }, "caseless": { @@ -686,9 +716,9 @@ "dev": true }, "chokidar": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.5.tgz", - "integrity": "sha512-i0TprVWp+Kj4WRPtInjexJ8Q+BqTE909VpH8xVhXrJkoc5QC8VO9TryGOqTr+2hljzc1sC62t22h5tZePodM/A==", + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz", + "integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==", "dev": true, "requires": { "anymatch": "^2.0.0", @@ -869,9 +899,9 @@ "dev": true }, "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "dev": true }, "concat-map": { @@ -1158,11 +1188,12 @@ } }, "del": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/del/-/del-4.1.0.tgz", - "integrity": "sha512-C4kvKNlYrwXhKxz97BuohF8YoGgQ23Xm9lvoHmgT7JaPGprSEjk3+XFled74Yt/x0ZABUHg2D67covzAPUKx5Q==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz", + "integrity": "sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ==", "dev": true, "requires": { + "@types/glob": "^7.1.1", "globby": "^6.1.0", "is-path-cwd": "^2.0.0", "is-path-in-cwd": "^2.0.0", @@ -1287,9 +1318,9 @@ } }, "electron-to-chromium": { - "version": "1.3.124", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.124.tgz", - "integrity": "sha512-glecGr/kFdfeXUHOHAWvGcXrxNU+1wSO/t5B23tT1dtlvYB26GY8aHzZSWD7HqhqC800Lr+w/hQul6C5AF542w==", + "version": "1.3.173", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.173.tgz", + "integrity": "sha512-weH16m8as+4Fy4XJxrn/nFXsIqB7zkxERhvj/5YX2HE4HB8MCu98Wsef4E3mu0krIT27ic0bGsr+TvqYrUn6Qg==", "dev": true }, "end-of-stream": { @@ -1430,57 +1461,6 @@ } } }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "dev": true, - "requires": { - "fill-range": "^2.1.0" - }, - "dependencies": { - "fill-range": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", - "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", - "dev": true, - "requires": { - "is-number": "^2.1.0", - "isobject": "^2.0.0", - "randomatic": "^3.0.0", - "repeat-element": "^1.1.2", - "repeat-string": "^1.5.2" - } - }, - "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "expand-tilde": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", @@ -1641,12 +1621,6 @@ "escape-string-regexp": "^1.0.5" } }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true - }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -1711,9 +1685,9 @@ } }, "fined": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/fined/-/fined-1.1.1.tgz", - "integrity": "sha512-jQp949ZmEbiYHk3gkbdtpJ0G1+kgtLQBNdP5edFP7Fh+WAYceLQz6yO1SBj72Xkg8GVyTB3bBzAYrHJVh5Xd5g==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", + "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", "dev": true, "requires": { "expand-tilde": "^2.0.2", @@ -1786,12 +1760,6 @@ "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", "dev": true }, - "fs-exists-sync": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", - "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=", - "dev": true - }, "fs-mkdirp-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", @@ -1809,14 +1777,14 @@ "dev": true }, "fsevents": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz", - "integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", + "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", "dev": true, "optional": true, "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" }, "dependencies": { "abbrev": { @@ -1894,12 +1862,12 @@ "optional": true }, "debug": { - "version": "2.6.9", + "version": "4.1.1", "bundled": true, "dev": true, "optional": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "deep-extend": { @@ -2070,24 +2038,24 @@ } }, "ms": { - "version": "2.0.0", + "version": "2.1.1", "bundled": true, "dev": true, "optional": true }, "needle": { - "version": "2.2.4", + "version": "2.3.0", "bundled": true, "dev": true, "optional": true, "requires": { - "debug": "^2.1.2", + "debug": "^4.1.0", "iconv-lite": "^0.4.4", "sax": "^1.2.4" } }, "node-pre-gyp": { - "version": "0.10.3", + "version": "0.12.0", "bundled": true, "dev": true, "optional": true, @@ -2115,13 +2083,13 @@ } }, "npm-bundled": { - "version": "1.0.5", + "version": "1.0.6", "bundled": true, "dev": true, "optional": true }, "npm-packlist": { - "version": "1.2.0", + "version": "1.4.1", "bundled": true, "dev": true, "optional": true, @@ -2260,7 +2228,7 @@ "optional": true }, "semver": { - "version": "5.6.0", + "version": "5.7.0", "bundled": true, "dev": true, "optional": true @@ -2357,9 +2325,9 @@ } }, "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", - "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -2440,42 +2408,6 @@ "path-is-absolute": "^1.0.0" } }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "requires": { - "glob-parent": "^2.0.0", - "is-glob": "^2.0.0" - }, - "dependencies": { - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "^2.0.0" - } - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - } - } - }, "glob-parent": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", @@ -2607,21 +2539,21 @@ "dev": true }, "gulp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.0.tgz", - "integrity": "sha1-lXZsYB2t5Kd+0+eyttwDiBtZY2Y=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", + "integrity": "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==", "dev": true, "requires": { - "glob-watcher": "^5.0.0", - "gulp-cli": "^2.0.0", - "undertaker": "^1.0.0", + "glob-watcher": "^5.0.3", + "gulp-cli": "^2.2.0", + "undertaker": "^1.2.1", "vinyl-fs": "^3.0.0" }, "dependencies": { "gulp-cli": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.1.0.tgz", - "integrity": "sha512-txzgdFVlEPShBZus6JJyGyKJoBVDq6Do0ZQgIgx5RAsmhNVTDjymmOxpQvo3c20m66FldilS68ZXj2Q9w5dKbA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.2.0.tgz", + "integrity": "sha512-rGs3bVYHdyJpLqR0TUBnlcZ1O5O++Zs4bA0ajm+zr3WFCfiSLjGwoCBqFs18wzN+ZxahT9DkOK5nDf26iDsWjA==", "dev": true, "requires": { "ansi-colors": "^1.0.1", @@ -2647,17 +2579,28 @@ } }, "gulp-autoprefixer": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/gulp-autoprefixer/-/gulp-autoprefixer-6.0.0.tgz", - "integrity": "sha512-MyLymXKVGTVBx/okQSBqmdhwhyqi3igBmZBwgpZp0GRbY1LY8VctOTLzwkQ18bZKJkSDnOKR5u32TMY9wSYdqQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/gulp-autoprefixer/-/gulp-autoprefixer-6.1.0.tgz", + "integrity": "sha512-Ti/BUFe+ekhbDJfspZIMiOsOvw51KhI9EncsDfK7NaxjqRm+v4xS9v99kPxEoiDavpWqQWvG8Y6xT1mMlB3aXA==", "dev": true, "requires": { - "autoprefixer": "^9.1.3", + "autoprefixer": "^9.5.1", "fancy-log": "^1.3.2", "plugin-error": "^1.0.1", "postcss": "^7.0.2", - "through2": "^2.0.0", - "vinyl-sourcemaps-apply": "^0.2.0" + "through2": "^3.0.1", + "vinyl-sourcemaps-apply": "^0.2.1" + }, + "dependencies": { + "through2": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", + "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", + "dev": true, + "requires": { + "readable-stream": "2 || 3" + } + } } }, "gulp-beautify": { @@ -2962,176 +2905,25 @@ } }, "gulp-load-plugins": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/gulp-load-plugins/-/gulp-load-plugins-1.5.0.tgz", - "integrity": "sha1-TEGffldk2aDjMGG6uWGPgbc9QXE=", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/gulp-load-plugins/-/gulp-load-plugins-1.6.0.tgz", + "integrity": "sha512-HlCODki0WHJvQIgAsJYOTkyo0c7TsDCetvfhrdGz9JYPL6A4mFRMGmKfoi6JmXjA/vvzg+fkT91c9FBh7rnkyg==", "dev": true, "requires": { "array-unique": "^0.2.1", "fancy-log": "^1.2.0", - "findup-sync": "^0.4.0", + "findup-sync": "^3.0.0", "gulplog": "^1.0.0", "has-gulplog": "^0.1.0", - "micromatch": "^2.3.8", + "micromatch": "^3.1.10", "resolve": "^1.1.7" }, "dependencies": { - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1" - } - }, "array-unique": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", "dev": true - }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, - "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" - } - }, - "detect-file": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-0.1.0.tgz", - "integrity": "sha1-STXe39lIhkjgBrASlWbpOGcR6mM=", - "dev": true, - "requires": { - "fs-exists-sync": "^0.1.0" - } - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "^0.1.0" - } - }, - "expand-tilde": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-1.2.2.tgz", - "integrity": "sha1-C4HrqJflo9MdHD0QL48BRB5VlEk=", - "dev": true, - "requires": { - "os-homedir": "^1.0.1" - } - }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "findup-sync": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.4.3.tgz", - "integrity": "sha1-QAQ5Kee8YK3wt/SCfExudaDeyhI=", - "dev": true, - "requires": { - "detect-file": "^0.1.0", - "is-glob": "^2.0.1", - "micromatch": "^2.3.7", - "resolve-dir": "^0.1.0" - } - }, - "global-modules": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz", - "integrity": "sha1-6lo77ULG1s6ZWk+KEmm12uIjgo0=", - "dev": true, - "requires": { - "global-prefix": "^0.1.4", - "is-windows": "^0.2.0" - } - }, - "global-prefix": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.5.tgz", - "integrity": "sha1-jTvGuNo8qBEqFg2NSW/wRiv+948=", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.0", - "ini": "^1.3.4", - "is-windows": "^0.2.0", - "which": "^1.2.12" - } - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "is-windows": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz", - "integrity": "sha1-3hqm1j6indJIc3tp8f+LgALSEIw=", - "dev": true - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" - } - }, - "resolve-dir": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-0.1.1.tgz", - "integrity": "sha1-shklmlYC+sXFxJatiUpujMQwJh4=", - "dev": true, - "requires": { - "expand-tilde": "^1.2.2", - "global-modules": "^0.2.3" - } } } }, @@ -3332,14 +3124,14 @@ } }, "gulp-rtlcss": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/gulp-rtlcss/-/gulp-rtlcss-1.3.0.tgz", - "integrity": "sha512-xh9vuxDc5+5C583jJwy/F6nd6wdtz8YnjderfwjDWr4UPq0fzK3w9Yv03SPkAJlUFUz6Y/7Sli7h54PbJZ2X+A==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/gulp-rtlcss/-/gulp-rtlcss-1.4.0.tgz", + "integrity": "sha512-66UmUSacTzdV3L0KcsdwzExEu1+dTfNlq3emUZGgHPLgUaCrsZUgZwjsgKjPwkYJUZOucLpjOxAkB37k+H80Kw==", "dev": true, "requires": { "plugin-error": "^1.0.1", "rtlcss": "^2.4.0", - "through2": "^2.0.3", + "through2": "^2.0.5", "vinyl-sourcemaps-apply": "^0.2.1" } }, @@ -3916,21 +3708,6 @@ } } }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "requires": { - "is-primitive": "^2.0.0" - } - }, "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", @@ -3997,27 +3774,27 @@ } }, "is-path-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.0.0.tgz", - "integrity": "sha512-m5dHHzpOXEiv18JEORttBO64UgTEypx99vCxQLjbBvGhOJxnTNglYoFXxwo6AbsQb79sqqycQEHv2hWkHZAijA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.1.0.tgz", + "integrity": "sha512-Sc5j3/YnM8tDeyCsVeKlm/0p95075DyLmDEIkSgQ7mXkrOX+uTCtmQFm0CYzVyJwcCCmO3k8qfJt17SxQwB5Zw==", "dev": true }, "is-path-in-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-2.0.0.tgz", - "integrity": "sha512-6Vz5Gc9s/sDA3JBVu0FzWufm8xaBsqy1zn8Q6gmvGP6nSDMw78aS4poBNeatWjaRpTpxxLn1WOndAiOlk+qY8A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz", + "integrity": "sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ==", "dev": true, "requires": { - "is-path-inside": "^1.0.0" + "is-path-inside": "^2.1.0" } }, "is-path-inside": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", - "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-2.1.0.tgz", + "integrity": "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==", "dev": true, "requires": { - "path-is-inside": "^1.0.1" + "path-is-inside": "^1.0.2" } }, "is-plain-object": { @@ -4029,18 +3806,6 @@ "isobject": "^3.0.1" } }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true - }, "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", @@ -4818,12 +4583,6 @@ } } }, - "math-random": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", - "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==", - "dev": true - }, "memoizee": { "version": "0.4.14", "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.14.tgz", @@ -4924,9 +4683,9 @@ "dev": true }, "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", "dev": true, "requires": { "for-in": "^1.0.2", @@ -5062,9 +4821,9 @@ } }, "node-releases": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.13.tgz", - "integrity": "sha512-fKZGviSXR6YvVPyc011NHuJDSD8gFQvLPmc2d2V3BS4gr52ycyQ1Xzs7a8B+Ax3Ni/W+5h1h4SqmzeoA8WZRmA==", + "version": "1.1.23", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.23.tgz", + "integrity": "sha512-uq1iL79YjfYC0WXoHbC/z28q/9pOl8kSHaXdWmAAc8No+bDwqkZbzIJz55g/MUsPgSGm9LZ7QSUbzTcH5tz47w==", "dev": true, "requires": { "semver": "^5.3.0" @@ -5305,27 +5064,6 @@ "make-iterator": "^1.0.0" } }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, - "requires": { - "for-own": "^0.1.4", - "is-extendable": "^0.1.1" - }, - "dependencies": { - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "^1.0.1" - } - } - } - }, "object.pick": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", @@ -5420,35 +5158,6 @@ "path-root": "^0.1.1" } }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, - "requires": { - "glob-base": "^0.3.0", - "is-dotfile": "^1.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.0" - }, - "dependencies": { - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - } - } - }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -5598,9 +5307,9 @@ "dev": true }, "postcss": { - "version": "7.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.14.tgz", - "integrity": "sha512-NsbD6XUUMZvBxtQAJuWDJeeC4QFsmWsfozWxCJPWf3M55K9iu2iMDaKqyoOdTJ1R4usBXuxlVFAIo8rZPQD4Bg==", + "version": "7.0.17", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.17.tgz", + "integrity": "sha512-546ZowA+KZ3OasvQZHsbuEpysvwTZNGJv9EfyCQdsIDltPSWHAeTQ5fQy/Npi2ZDtLI3zs7Ps/p6wThErhm9fQ==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -5622,12 +5331,6 @@ "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", "dev": true }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, "pretty-hrtime": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", @@ -5635,9 +5338,9 @@ "dev": true }, "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, "proto-list": { @@ -5691,25 +5394,6 @@ "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", "dev": true }, - "randomatic": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", - "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", - "dev": true, - "requires": { - "is-number": "^4.0.0", - "kind-of": "^6.0.0", - "math-random": "^1.0.1" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - } - } - }, "raw-body": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.1.7.tgz", @@ -5802,15 +5486,6 @@ "strip-indent": "^1.0.1" } }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "^0.1.3" - } - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -6151,9 +5826,9 @@ "dev": true }, "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -6538,13 +6213,13 @@ } }, "tar": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", + "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", "dev": true, "requires": { "block-stream": "*", - "fstream": "^1.0.2", + "fstream": "^1.0.12", "inherits": "2" } }, @@ -6781,38 +6456,15 @@ "dev": true }, "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "dev": true, "requires": { "arr-union": "^3.1.0", "get-value": "^2.0.6", "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } + "set-value": "^2.0.1" } }, "unique-stream": { @@ -6905,9 +6557,9 @@ "dev": true }, "v8flags": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.2.tgz", - "integrity": "sha512-MtivA7GF24yMPte9Rp/BWGCYQNaUj86zeYxV/x2RRJMKagImbbv3u8iJC57lNhWLPcGLJmHcHmFWkNsplbbLWw==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz", + "integrity": "sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==", "dev": true, "requires": { "homedir-polyfill": "^1.0.1" diff --git a/package.json b/package.json index 9d2f544..1254d1e 100644 --- a/package.json +++ b/package.json @@ -1,21 +1,21 @@ { - "name": "patch-lite", + "name": "jason-lite", "devDependencies": { - "del": "^4.1.0", - "gulp": "^4.0.0", - "gulp-autoprefixer": "^6.0.0", + "del": "^4.1.1", + "gulp": "^4.0.2", + "gulp-autoprefixer": "^6.1.0", "gulp-beautify": "^3.0.0", "gulp-combine-media-queries": "*", "gulp-concat": "*", "gulp-exec": "^3.0.2", "gulp-livereload": "^4.0.1", - "gulp-load-plugins": "^1.5.0", + "gulp-load-plugins": "^1.6.0", "gulp-notify": "^3.2.0", "gulp-prompt": "^1.2.0", "gulp-rename": "^1.4.0", "gulp-replace": "^1.0.0", "gulp-rsync": "0.0.8", - "gulp-rtlcss": "^1.3.0", + "gulp-rtlcss": "^1.4.0", "gulp-sass": "^4.0.2", "gulp-sourcemaps": "^2.6.5", "gulp-util": "^3.0.8" diff --git a/page.php b/page.php index 5917309..fa30a59 100644 --- a/page.php +++ b/page.php @@ -10,25 +10,28 @@ * @package Jason */ +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} + get_header(); ?>
- + + get_template_part( 'template-parts/content', 'page' ); - - - + } + endwhile; ?>
- - \ No newline at end of file + Themes and click the Add New button. +2. Click Upload and Choose File, then select the theme's .zip file. Click Install Now. +3. Click Activate to use your new theme right away. + == Changelog == += 1.1.2 = +* Cleanup and security improvements. + = 1.1.1 = * Minor styling fixes in the admin area. @@ -34,8 +41,10 @@ Jason Lite is a colorful free WordPress theme designed for publishers of all kin Unless otherwise specified, all the theme files, scripts and images are licensed under GNU General Public License. -* Images: images by SplitShire (https://pixabay.com/en/users/SplitShire-364019/) — [Source](https://pixabay.com/en/photographer-tourist-snapshot-407068/), ileukers (https://pixabay.com/en/users/ileukers-2987340/) — [Source](https://pixabay.com/en/oldtimer-convertible-red-1544342/). +* Norwester font (c) October 14, 2013, [Jamie Wilson](jamiewilson.io), licensed under [SIL Open Font License v1.1](http://scripts.sil.org/OFL) +* Libre Caslon font Copyright (c) 2012, [Pablo Impallari](www.impallari.com|impallari@gmail.com), [Rodrigo Fuenzalida](www.rfuenzalida.com|hello@rfuenzalida.com), with Reserved Font Name Libre Caslon, licensed under [SIL Open Font License v1.1](http://scripts.sil.org/OFL) +* Font Awesome: font by Fonticons, Inc. (https://fontawesome.com/), licensed under [SIL OFL 1.1](https://fontawesome.com/license/free), CSS released under the [MIT License](http://opensource.org/licenses/mit-license.html). -* hoverintent.js: script by Brian Cherne (https://briancherne.github.io/jquery-hoverIntent/), licensed under the [MIT License](http://opensource.org/licenses/mit-license.html). +* Images: images by SplitShire (https://pixabay.com/en/users/SplitShire-364019/) — [Source](https://pixabay.com/en/photographer-tourist-snapshot-407068/), ileukers (https://pixabay.com/en/users/ileukers-2987340/) — [Source](https://pixabay.com/en/oldtimer-convertible-red-1544342/). * VelocityJS: script by Julian Shapiro (http://julian.com/research/velocity/), licensed under the [MIT License](http://opensource.org/licenses/mit-license.html). diff --git a/search-overlay.php b/search-overlay.php index 700ff24..2af7539 100644 --- a/search-overlay.php +++ b/search-overlay.php @@ -4,6 +4,10 @@ * * @package Jason */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} ?>
-
', - esc_html__( 'Upgrade message from the plugin author:', '__theme_txtd' ), - ' ', wp_kses_data( $item['upgrade_notice'] ), ' -
-