Home Page to start fresh. We\'ll do better next time.' ) ) {
- echo get_theme_mod( 'lawyeria_lite_404_content','Oops, I screwed up and you discovered my fatal flaw. Well, we\'re not all perfect, but we try. Can you try this again or maybe visit our Home Page to start fresh. We\'ll do better next time.' );
+ if ( get_theme_mod( 'lawyeria_lite_404_content','Oops, I screwed up and you discovered my fatal flaw. Well, we\'re not all perfect, but we try. Can you try this again or maybe visit our Home Page to start fresh. We\'ll do better next time.', 'lawyeria-lite' ) ) {
+ echo get_theme_mod( 'lawyeria_lite_404_content','Oops, I screwed up and you discovered my fatal flaw. Well, we\'re not all perfect, but we try. Can you try this again or maybe visit our Home Page to start fresh. We\'ll do better next time.', 'lawyeria-lite' );
}
?>
diff --git a/class-tgm-plugin-activation.php b/class-tgm-plugin-activation.php
index 7e9a11e..31a1f7c 100644
--- a/class-tgm-plugin-activation.php
+++ b/class-tgm-plugin-activation.php
@@ -8,22 +8,11 @@
* or theme author for support.
*
* @package TGM-Plugin-Activation
- * @version 2.5.2
+ * @version 2.6.1 for parent theme Lawyeria Lite for publication on WordPress.org
* @link http://tgmpluginactivation.com/
* @author Thomas Griffin, Gary Jones, Juliette Reinders Folmer
* @copyright Copyright (c) 2011, Thomas Griffin
* @license GPL-2.0+
- *
- * @wordpress-plugin
- * Plugin Name: TGM Plugin Activation
- * Plugin URI:
- * Description: Plugin installation and activation for WordPress themes.
- * Version: 2.5.2
- * Author: Thomas Griffin, Gary Jones, Juliette Reinders Folmer
- * Author URI: http://tgmpluginactivation.com/
- * Text Domain: tgmpa
- * Domain Path: /languages/
- * Copyright: 2011, Thomas Griffin
*/
/*
@@ -66,7 +55,7 @@ class TGM_Plugin_Activation {
*
* @const string Version number.
*/
- const TGMPA_VERSION = '2.5.2';
+ const TGMPA_VERSION = '2.6.1';
/**
* Regular expression to test if a URL is a WP plugin repo URL.
@@ -99,7 +88,6 @@ class TGM_Plugin_Activation {
* Holds arrays of plugin details.
*
* @since 1.0.0
- *
* @since 2.5.0 the array has the plugin slug as an associative key.
*
* @var array
@@ -256,9 +244,9 @@ class TGM_Plugin_Activation {
* Adds a reference of this object to $instance, populates default strings,
* does the tgmpa_init action hook, and hooks in the interactions to init.
*
- * @internal This method should be `protected`, but as too many TGMPA implementations
+ * {@internal This method should be `protected`, but as too many TGMPA implementations
* haven't upgraded beyond v2.3.6 yet, this gives backward compatibility issues.
- * Reverted back to public for the time being.
+ * Reverted back to public for the time being.}}
*
* @since 1.0.0
*
@@ -271,6 +259,8 @@ public function __construct() {
// 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' ) );
}
@@ -278,12 +268,14 @@ public function __construct() {
/**
* 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
+ * {@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.
+ * 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.
@@ -296,6 +288,8 @@ public function __set( $name, $value ) {
/**
* 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.
*/
@@ -330,79 +324,77 @@ public function init() {
// Load class strings.
$this->strings = array(
- 'page_title' => __( 'Install Required Plugins', 'tgmpa' ),
- 'menu_title' => __( 'Install Plugins', 'tgmpa' ),
- 'installing' => __( 'Installing Plugin: %s', 'tgmpa' ),
- 'oops' => __( 'Something went wrong with the plugin API.', 'tgmpa' ),
+ 'page_title' => __( 'Install Required Plugins', 'lawyeria-lite' ),
+ 'menu_title' => __( 'Install Plugins', 'lawyeria-lite' ),
+ /* translators: %s: plugin name. */
+ 'installing' => __( 'Installing Plugin: %s', 'lawyeria-lite' ),
+ /* translators: %s: plugin name. */
+ 'updating' => __( 'Updating Plugin: %s', 'lawyeria-lite' ),
+ 'oops' => __( 'Something went wrong with the plugin API.', 'lawyeria-lite' ),
'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.',
- 'tgmpa'
+ 'lawyeria-lite'
),
'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.',
- 'tgmpa'
- ),
- 'notice_cannot_install' => _n_noop(
- 'Sorry, but you do not have the correct permissions to install the %1$s plugin.',
- 'Sorry, but you do not have the correct permissions to install the %1$s plugins.',
- 'tgmpa'
+ 'lawyeria-lite'
),
'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.',
- 'tgmpa'
+ 'lawyeria-lite'
),
'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.',
- 'tgmpa'
- ),
- 'notice_cannot_update' => _n_noop(
- 'Sorry, but you do not have the correct permissions to update the %1$s plugin.',
- 'Sorry, but you do not have the correct permissions to update the %1$s plugins.',
- 'tgmpa'
+ 'lawyeria-lite'
),
'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.',
- 'tgmpa'
+ 'lawyeria-lite'
),
'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.',
- 'tgmpa'
- ),
- 'notice_cannot_activate' => _n_noop(
- 'Sorry, but you do not have the correct permissions to activate the %1$s plugin.',
- 'Sorry, but you do not have the correct permissions to activate the %1$s plugins.',
- 'tgmpa'
+ 'lawyeria-lite'
),
'install_link' => _n_noop(
'Begin installing plugin',
'Begin installing plugins',
- 'tgmpa'
+ 'lawyeria-lite'
),
'update_link' => _n_noop(
'Begin updating plugin',
'Begin updating plugins',
- 'tgmpa'
+ 'lawyeria-lite'
),
'activate_link' => _n_noop(
'Begin activating plugin',
'Begin activating plugins',
- 'tgmpa'
+ 'lawyeria-lite'
),
- 'return' => __( 'Return to Required Plugins Installer', 'tgmpa' ),
- 'dashboard' => __( 'Return to the dashboard', 'tgmpa' ),
- 'plugin_activated' => __( 'Plugin activated successfully.', 'tgmpa' ),
- 'activated_successfully' => __( 'The following plugin was activated successfully:', 'tgmpa' ),
- 'plugin_already_active' => __( 'No action taken. Plugin %1$s was already active.', 'tgmpa' ),
- 'plugin_needs_higher_version' => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'tgmpa' ),
- 'complete' => __( 'All plugins installed and activated successfully. %1$s', 'tgmpa' ),
- 'dismiss' => __( 'Dismiss this notice', 'tgmpa' ),
- 'contact_admin' => __( 'Please contact the administrator of this site for help.', 'tgmpa' ),
+ 'return' => __( 'Return to Required Plugins Installer', 'lawyeria-lite' ),
+ 'dashboard' => __( 'Return to the Dashboard', 'lawyeria-lite' ),
+ 'plugin_activated' => __( 'Plugin activated successfully.', 'lawyeria-lite' ),
+ 'activated_successfully' => __( 'The following plugin was activated successfully:', 'lawyeria-lite' ),
+ /* translators: 1: plugin name. */
+ 'plugin_already_active' => __( 'No action taken. Plugin %1$s was already active.', 'lawyeria-lite' ),
+ /* translators: 1: plugin name. */
+ 'plugin_needs_higher_version' => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'lawyeria-lite' ),
+ /* translators: 1: dashboard link. */
+ 'complete' => __( 'All plugins installed and activated successfully. %1$s', 'lawyeria-lite' ),
+ 'dismiss' => __( 'Dismiss this notice', 'lawyeria-lite' ),
+ 'notice_cannot_install_activate' => __( 'There are one or more required or recommended plugins to install, update or activate.', 'lawyeria-lite' ),
+ 'contact_admin' => __( 'Please contact the administrator of this site for help.', 'lawyeria-lite' ),
);
do_action( 'tgmpa_register' );
@@ -431,10 +423,11 @@ public function init() {
add_action( 'admin_init', array( $this, 'admin_init' ), 1 );
add_action( 'admin_enqueue_scripts', array( $this, 'thickbox' ) );
}
-
- add_action( 'load-plugins.php', array( $this, 'add_plugin_action_link_filters' ), 1 );
}
+ // 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' ) );
@@ -453,9 +446,18 @@ public function init() {
}
}
+
+
+
+
+
+
/**
- * Prevent activation of plugins which don't meet the minimum version requirement from the
- * WP native plugins page.
+ * 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
*/
@@ -517,8 +519,8 @@ 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.', 'tgmpa' ),
- esc_html__( 'Update Required', 'tgmpa' )
+ esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'lawyeria-lite' ),
+ esc_html__( 'Update Required', 'lawyeria-lite' )
);
return $actions;
@@ -626,20 +628,15 @@ public function admin_menu() {
/**
* 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 ) {
- if ( has_filter( 'tgmpa_admin_menu_use_add_theme_page' ) ) {
- _deprecated_function( 'The "tgmpa_admin_menu_use_add_theme_page" filter', '2.5.0', esc_html__( 'Set the parent_slug config variable instead.', 'tgmpa' ) );
- }
-
- if ( 'themes.php' === $this->parent_slug ) {
- $this->page_hook = call_user_func( 'add_theme_page', $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );
- } else {
- $this->page_hook = call_user_func( 'add_theme_page', $args['parent_slug'], $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );
- }
+ $this->page_hook = add_theme_page( $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );
}
/**
@@ -667,7 +664,7 @@ public function install_plugins_page() {
?>
-
+
prepare_items(); ?>
strings['updating'] : $this->strings['installing'];
$skin_args = array(
'type' => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload',
- 'title' => sprintf( $this->strings['installing'], $this->plugins[ $slug ]['name'] ),
+ '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'];
@@ -807,7 +806,7 @@ protected function do_plugin_install() {
$upgrader->install( $source );
}
- remove_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 );
+ 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 );
@@ -825,7 +824,7 @@ protected function do_plugin_install() {
// Display message based on if all plugins are now active or not.
if ( $this->is_tgmpa_complete() ) {
- echo '
',
$color,
$item['available_version']
);
@@ -2419,7 +2530,7 @@ public function column_version( $item ) {
* @since 2.2.0
*/
public function no_items() {
- printf( wp_kses_post( __( 'No plugins to install, update or activate. Return to the Dashboard', 'tgmpa' ) ), esc_url( self_admin_url() ) );
+ echo esc_html__( 'No plugins to install, update or activate.', 'lawyeria-lite' ) . ' ' . esc_html__( 'Return to the Dashboard', 'lawyeria-lite' ) . '';
echo '';
}
@@ -2433,14 +2544,14 @@ public function no_items() {
public function get_columns() {
$columns = array(
'cb' => '',
- 'plugin' => __( 'Plugin', 'tgmpa' ),
- 'source' => __( 'Source', 'tgmpa' ),
- 'type' => __( 'Type', 'tgmpa' ),
+ 'plugin' => __( 'Plugin', 'lawyeria-lite' ),
+ 'source' => __( 'Source', 'lawyeria-lite' ),
+ 'type' => __( 'Type', 'lawyeria-lite' ),
);
if ( 'all' === $this->view_context || 'update' === $this->view_context ) {
- $columns['version'] = __( 'Version', 'tgmpa' );
- $columns['status'] = __( 'Status', 'tgmpa' );
+ $columns['version'] = __( 'Version', 'lawyeria-lite' );
+ $columns['status'] = __( 'Status', 'lawyeria-lite' );
}
return apply_filters( 'tgmpa_table_columns', $columns );
@@ -2488,16 +2599,19 @@ protected function get_row_actions( $item ) {
// Display the 'Install' action link if the plugin is not yet available.
if ( ! $this->tgmpa->is_plugin_installed( $item['slug'] ) ) {
- $actions['install'] = _x( 'Install %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa' );
+ /* translators: %2$s: plugin name in screen reader markup */
+ $actions['install'] = __( 'Install %2$s', 'lawyeria-lite' );
} 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'] ) ) {
- $actions['update'] = _x( 'Update %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa' );
+ /* translators: %2$s: plugin name in screen reader markup */
+ $actions['update'] = __( 'Update %2$s', 'lawyeria-lite' );
}
// Display the 'Activate' action link, but only if the plugin meets the minimum version.
if ( $this->tgmpa->can_plugin_activate( $item['slug'] ) ) {
- $actions['activate'] = _x( 'Activate %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa' );
+ /* translators: %2$s: plugin name in screen reader markup */
+ $actions['activate'] = __( 'Activate %2$s', 'lawyeria-lite' );
}
}
@@ -2516,7 +2630,7 @@ protected function get_row_actions( $item ) {
);
$action_links[ $action ] = sprintf(
- '' . esc_html( $text ) . '',
+ '' . esc_html( $text ) . '', // $text contains the second placeholder.
esc_url( $nonce_url ),
'' . esc_html( $item['sanitized_plugin'] ) . ''
);
@@ -2567,7 +2681,7 @@ public function wp_plugin_update_row( $slug, $item ) {
',
- esc_html__( 'Upgrade message from the plugin author:', 'tgmpa' ),
+ esc_html__( 'Upgrade message from the plugin author:', 'lawyeria-lite' ),
' ', wp_kses_data( $item['upgrade_notice'] ), '
@@ -2600,16 +2714,16 @@ public function get_bulk_actions() {
if ( 'update' !== $this->view_context && 'activate' !== $this->view_context ) {
if ( current_user_can( 'install_plugins' ) ) {
- $actions['tgmpa-bulk-install'] = __( 'Install', 'tgmpa' );
+ $actions['tgmpa-bulk-install'] = __( 'Install', 'lawyeria-lite' );
}
}
if ( 'install' !== $this->view_context ) {
if ( current_user_can( 'update_plugins' ) ) {
- $actions['tgmpa-bulk-update'] = __( 'Update', 'tgmpa' );
+ $actions['tgmpa-bulk-update'] = __( 'Update', 'lawyeria-lite' );
}
if ( current_user_can( 'activate_plugins' ) ) {
- $actions['tgmpa-bulk-activate'] = __( 'Activate', 'tgmpa' );
+ $actions['tgmpa-bulk-activate'] = __( 'Activate', 'lawyeria-lite' );
}
}
@@ -2640,9 +2754,9 @@ public function process_bulk_actions() {
// Did user actually select any plugins to install/update ?
if ( empty( $_POST['plugin'] ) ) {
if ( 'install' === $install_type ) {
- $message = __( 'No plugins were selected to be installed. No action taken.', 'tgmpa' );
+ $message = __( 'No plugins were selected to be installed. No action taken.', 'lawyeria-lite' );
} else {
- $message = __( 'No plugins were selected to be updated. No action taken.', 'tgmpa' );
+ $message = __( 'No plugins were selected to be updated. No action taken.', 'lawyeria-lite' );
}
echo '
', esc_html( $message ), '
';
@@ -2669,8 +2783,13 @@ public function process_bulk_actions() {
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 && ( $this->tgmpa->is_plugin_installed( $slug ) && ( false === $this->tgmpa->does_plugin_have_update( $slug ) || ! $this->tgmpa->can_plugin_update( $slug ) ) ) ) {
+ if ( 'update' === $install_type && false === $this->tgmpa->is_plugin_updatetable( $slug ) ) {
unset( $plugins_to_install[ $key ] );
}
}
@@ -2678,9 +2797,9 @@ public function process_bulk_actions() {
// No need to proceed further if we have no plugins to handle.
if ( empty( $plugins_to_install ) ) {
if ( 'install' === $install_type ) {
- $message = __( 'No plugins are available to be installed at this time.', 'tgmpa' );
+ $message = __( 'No plugins are available to be installed at this time.', 'lawyeria-lite' );
} else {
- $message = __( 'No plugins are available to be updated at this time.', 'tgmpa' );
+ $message = __( 'No plugins are available to be updated at this time.', 'lawyeria-lite' );
}
echo '
', esc_html( $message ), '
';
@@ -2757,8 +2876,9 @@ public function process_bulk_actions() {
);
// Wrap the install process with the appropriate HTML.
- echo '
';
return true;
}
@@ -2785,7 +2905,7 @@ public function process_bulk_actions() {
// 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.', 'tgmpa' ), '
';
+ echo '
', esc_html__( 'No plugins were selected to be activated. No action taken.', 'lawyeria-lite' ), '
';
return false;
}
@@ -2811,7 +2931,7 @@ public function process_bulk_actions() {
// 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.', 'tgmpa' ), '
';
+ echo '
', esc_html__( 'No plugins are available to be activated at this time.', 'lawyeria-lite' ), '
';
return false;
}
@@ -2825,11 +2945,11 @@ public function process_bulk_actions() {
$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', 'tgmpa' ) . ' ' . $last_plugin );
+ $imploded = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'lawyeria-lite' ) . ' ' . $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, 'tgmpa' ) ),
+ esc_html( _n( 'The following plugin was activated successfully:', 'The following plugins were activated successfully:', $count, 'lawyeria-lite' ) ),
$imploded
);
@@ -2898,6 +3018,11 @@ protected function _get_plugin_data_from_name( $name, $data = 'slug' ) {
/**
* 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 {
}
@@ -2906,6 +3031,11 @@ class TGM_Bulk_Installer {
/**
* 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 {
}
@@ -2950,9 +3080,9 @@ function tgmpa_load_bulk_installer() {
*
* @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.
+ * {@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
@@ -3025,8 +3155,8 @@ public function __construct( $skin = null ) {
* @since 2.2.0
*/
public function activate_strings() {
- $this->strings['activation_failed'] = __( 'Plugin activation failed.', 'tgmpa' );
- $this->strings['activation_success'] = __( 'Plugin activated successfully.', 'tgmpa' );
+ $this->strings['activation_failed'] = __( 'Plugin activation failed.', 'lawyeria-lite' );
+ $this->strings['activation_success'] = __( 'Plugin activated successfully.', 'lawyeria-lite' );
}
/**
@@ -3059,17 +3189,19 @@ public function run( $options ) {
*
* @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.
+ * {@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.
+ * 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 string|bool Install confirmation messages on success, false on failure.
+ * @return array|false Install confirmation messages on success, false on failure.
*/
public function bulk_install( $plugins, $args = array() ) {
// [TGMPA + ] Hook auto-activation in.
@@ -3095,16 +3227,17 @@ public function bulk_install( $plugins, $args = array() ) {
$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.
+ /*
+ * 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 ) );
/*
@@ -3136,22 +3269,24 @@ public function bulk_install( $plugins, $args = array() ) {
continue;
}
- // Get the URL to the zip file
+ // 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,
- ),
- ) );
+ $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;
@@ -3274,9 +3409,9 @@ public function auto_activate( $bool ) {
*
* @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.
+ * {@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
*
@@ -3359,23 +3494,30 @@ public function __construct( $args = array() ) {
public function add_strings() {
if ( 'update' === $this->options['install_type'] ) {
parent::add_strings();
- $this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
+ /* translators: 1: plugin name, 2: action number 3: total number of actions. */
+ $this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'lawyeria-lite' );
} else {
- $this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: %2$s.', 'tgmpa' );
- $this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'tgmpa' );
+ /* translators: 1: plugin name, 2: error message. */
+ $this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: %2$s.', 'lawyeria-lite' );
+ /* translators: 1: plugin name. */
+ $this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'lawyeria-lite' );
if ( $this->tgmpa->is_automatic ) {
// Automatic activation strings.
- $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' );
- $this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.', 'tgmpa' ) . ' ' . esc_html__( 'Show Details', 'tgmpa' ) . '' . esc_html__( 'Hide Details', 'tgmpa' ) . '.';
- $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations and activations have been completed.', 'tgmpa' );
- $this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
+ $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'lawyeria-lite' );
+ /* translators: 1: plugin name. */
+ $this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.', 'lawyeria-lite' ) . ' ' . esc_html__( 'Show Details', 'lawyeria-lite' ) . '' . esc_html__( 'Hide Details', 'lawyeria-lite' ) . '.';
+ $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations and activations have been completed.', 'lawyeria-lite' );
+ /* translators: 1: plugin name, 2: action number 3: total number of actions. */
+ $this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'lawyeria-lite' );
} else {
// Default installation strings.
- $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' );
- $this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', 'tgmpa' ) . ' ' . esc_html__( 'Show Details', 'tgmpa' ) . '' . esc_html__( 'Hide Details', 'tgmpa' ) . '.';
- $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations have been completed.', 'tgmpa' );
- $this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
+ $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'lawyeria-lite' );
+ /* translators: 1: plugin name. */
+ $this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', 'lawyeria-lite' ) . ' ' . esc_html__( 'Show Details', 'lawyeria-lite' ) . '' . esc_html__( 'Hide Details', 'lawyeria-lite' ) . '.';
+ $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations have been completed.', 'lawyeria-lite' );
+ /* translators: 1: plugin name, 2: action number 3: total number of actions. */
+ $this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'lawyeria-lite' );
}
}
}
@@ -3435,7 +3577,7 @@ public function bulk_footer() {
echo '';
$update_actions['dashboard'] = sprintf(
esc_html( $this->tgmpa->strings['complete'] ),
- '' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . ''
+ '' . esc_html__( 'Return to the Dashboard', 'lawyeria-lite' ) . ''
);
} else {
$update_actions['tgmpa_page'] = '' . esc_html( $this->tgmpa->strings['return'] ) . '';
@@ -3597,15 +3739,15 @@ protected static function emulate_filter_bool( $value ) {
if ( is_bool( $value ) ) {
return $value;
- } else if ( is_int( $value ) && ( 0 === $value || 1 === $value ) ) {
+ } elseif ( is_int( $value ) && ( 0 === $value || 1 === $value ) ) {
return (bool) $value;
- } else if ( ( is_float( $value ) && ! is_nan( $value ) ) && ( (float) 0 === $value || (float) 1 === $value ) ) {
+ } elseif ( ( is_float( $value ) && ! is_nan( $value ) ) && ( (float) 0 === $value || (float) 1 === $value ) ) {
return (bool) $value;
- } else if ( is_string( $value ) ) {
+ } elseif ( is_string( $value ) ) {
$value = trim( $value );
if ( in_array( $value, $true, true ) ) {
return true;
- } else if ( in_array( $value, $false, true ) ) {
+ } elseif ( in_array( $value, $false, true ) ) {
return false;
} else {
return false;
@@ -3615,4 +3757,4 @@ protected static function emulate_filter_bool( $value ) {
return false;
}
} // End of class TGMPA_Utils
-} // End of class_exists wrapper
\ No newline at end of file
+} // End of class_exists wrapper
diff --git a/functions.php b/functions.php
index 64b90b8..83b456d 100644
--- a/functions.php
+++ b/functions.php
@@ -79,13 +79,13 @@ function lawyeria_lite_slug_fonts_url() {
* supported by Lora, translate this to 'off'. Do not translate
* into your own language.
*/
- $lato = _x( 'on', 'Lato font: on or off', 'zerif-lite' );
+ $lato = _x( 'on', 'Lato font: on or off', 'lawyeria-lite' );
/* Translators: If there are characters in your language that are not
* supported by Open Sans, translate this to 'off'. Do not translate
* into your own language.
*/
- $roboto = _x( 'on', 'Roboto font: on or off', 'zerif-lite' );
+ $roboto = _x( 'on', 'Roboto font: on or off', 'lawyeria-lite' );
if ( 'off' !== $lato || 'off' !== $roboto ) {
$font_families = array();
diff --git a/includes/customizer.php b/includes/customizer.php
index f267a78..4d5e86c 100644
--- a/includes/customizer.php
+++ b/includes/customizer.php
@@ -309,7 +309,7 @@ public function render_content()
/* 404 - Content */
$wp_customize->add_setting( 'lawyeria_lite_404_content' ,
- array('sanitize_callback' => 'lawyeria_lite_sanitize_text', 'default' => __( 'Oops, I screwed up and you discovered my fatal flaw. Well, we\'re not all perfect, but we try. Can you try this again or maybe visit our Home Page to start fresh. We\'ll do better next time.', 'lawyeria-lite' )));
+ array('sanitize_callback' => 'lawyeria_lite_sanitize_text', 'default' => __( 'Oops, I screwed up and you discovered my fatal flaw. Well, we\'re not all perfect, but we try. Can you try this again or maybe visit our Home Page to start fresh. We\'ll do better next time.', 'lawyeria-lite' )));
$wp_customize->add_control( new Example_Customize_Textarea_Control( $wp_customize, 'lawyeria_lite_404_content', array(
'label' => __( '404 - Content', 'lawyeria-lite' ),
'section' => 'lawyeria_lite_404_section',