Completed
Pull Request — master (#116)
by
unknown
03:02
created
admin/includes/class-tgm-plugin-activation.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1887,7 +1887,7 @@  discard block
 block discarded – undo
1887 1887
 		 *
1888 1888
 		 * @since 2.4.0
1889 1889
 		 *
1890
-		 * @return object The TGM_Plugin_Activation object.
1890
+		 * @return TGM_Plugin_Activation The TGM_Plugin_Activation object.
1891 1891
 		 */
1892 1892
 		public static function get_instance() {
1893 1893
 			if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {
@@ -2044,7 +2044,7 @@  discard block
 block discarded – undo
2044 2044
 		 *
2045 2045
 		 * @since 2.5.0
2046 2046
 		 *
2047
-		 * @return array CSS classnames.
2047
+		 * @return string[] CSS classnames.
2048 2048
 		 */
2049 2049
 		public function get_table_classes() {
2050 2050
 			return array( 'widefat', 'fixed' );
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1322,13 +1322,13 @@
 block discarded – undo
1322 1322
 			$key     = preg_replace( '`[^A-Za-z0-9_-]`', '', $key );
1323 1323
 
1324 1324
 			/**
1325
-			* Filter a sanitized key string.
1326
-			*
1327
-			* @since 3.0.0
1328
-			*
1329
-			* @param string $key     Sanitized key.
1330
-			* @param string $raw_key The key prior to sanitization.
1331
-			*/
1325
+			 * Filter a sanitized key string.
1326
+			 *
1327
+			 * @since 3.0.0
1328
+			 *
1329
+			 * @param string $key     Sanitized key.
1330
+			 * @param string $raw_key The key prior to sanitization.
1331
+			 */
1332 1332
 			return apply_filters( 'tgmpa_sanitize_key', $key, $raw_key );
1333 1333
 		}
1334 1334
 
Please login to merge, or discard this patch.
Spacing   +713 added lines, -713 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
44 44
 */
45 45
 
46
-if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
46
+if (!class_exists('TGM_Plugin_Activation')) {
47 47
 
48 48
 	/**
49 49
 	 * Automatic plugin installation and activation library.
@@ -269,10 +269,10 @@  discard block
 block discarded – undo
269 269
 			$this->wp_version = $GLOBALS['wp_version'];
270 270
 
271 271
 			// Announce that the class is ready, and pass the object (for advanced use).
272
-			do_action_ref_array( 'tgmpa_init', array( $this ) );
272
+			do_action_ref_array('tgmpa_init', array($this));
273 273
 
274 274
 			// When the rest of WP has loaded, kick-start the rest of the class.
275
-			add_action( 'init', array( $this, 'init' ) );
275
+			add_action('init', array($this, 'init'));
276 276
 		}
277 277
 
278 278
 		/**
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 		 * @return void  Silently fail to set the property when this is tried from outside of this class context.
290 290
 		 *               (Inside this class context, the __set() method if not used as there is direct access.)
291 291
 		 */
292
-		public function __set( $name, $value ) {
292
+		public function __set($name, $value) {
293 293
 			return;
294 294
 		}
295 295
 
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 		 * @param string $name Name of an inaccessible property.
300 300
 		 * @return mixed The property value.
301 301
 		 */
302
-		public function __get( $name ) {
302
+		public function __get($name) {
303 303
 			return $this->{$name};
304 304
 		}
305 305
 
@@ -324,16 +324,16 @@  discard block
 block discarded – undo
324 324
 			 * @param bool $load Whether or not TGMPA should load.
325 325
 			 *                   Defaults to the return of `is_admin() && ! defined( 'DOING_AJAX' )`.
326 326
 			 */
327
-			if ( true !== apply_filters( 'tgmpa_load', ( is_admin() && ! defined( 'DOING_AJAX' ) ) ) ) {
327
+			if (true !== apply_filters('tgmpa_load', (is_admin() && !defined('DOING_AJAX')))) {
328 328
 				return;
329 329
 			}
330 330
 
331 331
 			// Load class strings.
332 332
 			$this->strings = array(
333
-				'page_title'                      => __( 'Install Required Plugins', 'tgmpa' ),
334
-				'menu_title'                      => __( 'Install Plugins', 'tgmpa' ),
335
-				'installing'                      => __( 'Installing Plugin: %s', 'tgmpa' ),
336
-				'oops'                            => __( 'Something went wrong with the plugin API.', 'tgmpa' ),
333
+				'page_title'                      => __('Install Required Plugins', 'tgmpa'),
334
+				'menu_title'                      => __('Install Plugins', 'tgmpa'),
335
+				'installing'                      => __('Installing Plugin: %s', 'tgmpa'),
336
+				'oops'                            => __('Something went wrong with the plugin API.', 'tgmpa'),
337 337
 				'notice_can_install_required'     => _n_noop(
338 338
 					'This theme requires the following plugin: %1$s.',
339 339
 					'This theme requires the following plugins: %1$s.',
@@ -394,62 +394,62 @@  discard block
 block discarded – undo
394 394
 					'Begin activating plugins',
395 395
 					'tgmpa'
396 396
 				),
397
-				'return'                          => __( 'Return to Required Plugins Installer', 'tgmpa' ),
398
-				'dashboard'                       => __( 'Return to the dashboard', 'tgmpa' ),
399
-				'plugin_activated'                => __( 'Plugin activated successfully.', 'tgmpa' ),
400
-				'activated_successfully'          => __( 'The following plugin was activated successfully:', 'tgmpa' ),
401
-				'plugin_already_active'           => __( 'No action taken. Plugin %1$s was already active.', 'tgmpa' ),
402
-				'plugin_needs_higher_version'     => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'tgmpa' ),
403
-				'complete'                        => __( 'All plugins installed and activated successfully. %1$s', 'tgmpa' ),
404
-				'dismiss'                         => __( 'Dismiss this notice', 'tgmpa' ),
405
-				'contact_admin'                   => __( 'Please contact the administrator of this site for help.', 'tgmpa' ),
397
+				'return'                          => __('Return to Required Plugins Installer', 'tgmpa'),
398
+				'dashboard'                       => __('Return to the dashboard', 'tgmpa'),
399
+				'plugin_activated'                => __('Plugin activated successfully.', 'tgmpa'),
400
+				'activated_successfully'          => __('The following plugin was activated successfully:', 'tgmpa'),
401
+				'plugin_already_active'           => __('No action taken. Plugin %1$s was already active.', 'tgmpa'),
402
+				'plugin_needs_higher_version'     => __('Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'tgmpa'),
403
+				'complete'                        => __('All plugins installed and activated successfully. %1$s', 'tgmpa'),
404
+				'dismiss'                         => __('Dismiss this notice', 'tgmpa'),
405
+				'contact_admin'                   => __('Please contact the administrator of this site for help.', 'tgmpa'),
406 406
 			);
407 407
 
408
-			do_action( 'tgmpa_register' );
408
+			do_action('tgmpa_register');
409 409
 
410 410
 			/* After this point, the plugins should be registered and the configuration set. */
411 411
 
412 412
 			// Proceed only if we have plugins to handle.
413
-			if ( empty( $this->plugins ) || ! is_array( $this->plugins ) ) {
413
+			if (empty($this->plugins) || !is_array($this->plugins)) {
414 414
 				return;
415 415
 			}
416 416
 
417 417
 			// Set up the menu and notices if we still have outstanding actions.
418
-			if ( true !== $this->is_tgmpa_complete() ) {
418
+			if (true !== $this->is_tgmpa_complete()) {
419 419
 				// Sort the plugins.
420
-				array_multisort( $this->sort_order, SORT_ASC, $this->plugins );
420
+				array_multisort($this->sort_order, SORT_ASC, $this->plugins);
421 421
 
422
-				add_action( 'admin_menu', array( $this, 'admin_menu' ) );
423
-				add_action( 'admin_head', array( $this, 'dismiss' ) );
422
+				add_action('admin_menu', array($this, 'admin_menu'));
423
+				add_action('admin_head', array($this, 'dismiss'));
424 424
 
425 425
 				// Prevent the normal links from showing underneath a single install/update page.
426
-				add_filter( 'install_plugin_complete_actions', array( $this, 'actions' ) );
427
-				add_filter( 'update_plugin_complete_actions', array( $this, 'actions' ) );
426
+				add_filter('install_plugin_complete_actions', array($this, 'actions'));
427
+				add_filter('update_plugin_complete_actions', array($this, 'actions'));
428 428
 
429
-				if ( $this->has_notices ) {
430
-					add_action( 'admin_notices', array( $this, 'notices' ) );
431
-					add_action( 'admin_init', array( $this, 'admin_init' ), 1 );
432
-					add_action( 'admin_enqueue_scripts', array( $this, 'thickbox' ) );
429
+				if ($this->has_notices) {
430
+					add_action('admin_notices', array($this, 'notices'));
431
+					add_action('admin_init', array($this, 'admin_init'), 1);
432
+					add_action('admin_enqueue_scripts', array($this, 'thickbox'));
433 433
 				}
434 434
 
435
-				add_action( 'load-plugins.php', array( $this, 'add_plugin_action_link_filters' ), 1 );
435
+				add_action('load-plugins.php', array($this, 'add_plugin_action_link_filters'), 1);
436 436
 			}
437 437
 
438 438
 			// Make sure things get reset on switch theme.
439
-			add_action( 'switch_theme', array( $this, 'flush_plugins_cache' ) );
439
+			add_action('switch_theme', array($this, 'flush_plugins_cache'));
440 440
 
441
-			if ( $this->has_notices ) {
442
-				add_action( 'switch_theme', array( $this, 'update_dismiss' ) );
441
+			if ($this->has_notices) {
442
+				add_action('switch_theme', array($this, 'update_dismiss'));
443 443
 			}
444 444
 
445 445
 			// Setup the force activation hook.
446
-			if ( true === $this->has_forced_activation ) {
447
-				add_action( 'admin_init', array( $this, 'force_activation' ) );
446
+			if (true === $this->has_forced_activation) {
447
+				add_action('admin_init', array($this, 'force_activation'));
448 448
 			}
449 449
 
450 450
 			// Setup the force deactivation hook.
451
-			if ( true === $this->has_forced_deactivation ) {
452
-				add_action( 'switch_theme', array( $this, 'force_deactivation' ) );
451
+			if (true === $this->has_forced_deactivation) {
452
+				add_action('switch_theme', array($this, 'force_deactivation'));
453 453
 			}
454 454
 		}
455 455
 
@@ -460,17 +460,17 @@  discard block
 block discarded – undo
460 460
 		 * @since 2.5.0
461 461
 		 */
462 462
 		public function add_plugin_action_link_filters() {
463
-			foreach ( $this->plugins as $slug => $plugin ) {
464
-				if ( false === $this->can_plugin_activate( $slug ) ) {
465
-					add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_activate' ), 20 );
463
+			foreach ($this->plugins as $slug => $plugin) {
464
+				if (false === $this->can_plugin_activate($slug)) {
465
+					add_filter('plugin_action_links_'.$plugin['file_path'], array($this, 'filter_plugin_action_links_activate'), 20);
466 466
 				}
467 467
 
468
-				if ( true === $plugin['force_activation'] ) {
469
-					add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_deactivate' ), 20 );
468
+				if (true === $plugin['force_activation']) {
469
+					add_filter('plugin_action_links_'.$plugin['file_path'], array($this, 'filter_plugin_action_links_deactivate'), 20);
470 470
 				}
471 471
 
472
-				if ( false !== $this->does_plugin_require_update( $slug ) ) {
473
-					add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_update' ), 20 );
472
+				if (false !== $this->does_plugin_require_update($slug)) {
473
+					add_filter('plugin_action_links_'.$plugin['file_path'], array($this, 'filter_plugin_action_links_update'), 20);
474 474
 				}
475 475
 			}
476 476
 		}
@@ -484,8 +484,8 @@  discard block
 block discarded – undo
484 484
 		 * @param array $actions Action links.
485 485
 		 * @return array
486 486
 		 */
487
-		public function filter_plugin_action_links_activate( $actions ) {
488
-			unset( $actions['activate'] );
487
+		public function filter_plugin_action_links_activate($actions) {
488
+			unset($actions['activate']);
489 489
 
490 490
 			return $actions;
491 491
 		}
@@ -498,8 +498,8 @@  discard block
 block discarded – undo
498 498
 		 * @param array $actions Action links.
499 499
 		 * @return array
500 500
 		 */
501
-		public function filter_plugin_action_links_deactivate( $actions ) {
502
-			unset( $actions['deactivate'] );
501
+		public function filter_plugin_action_links_deactivate($actions) {
502
+			unset($actions['deactivate']);
503 503
 
504 504
 			return $actions;
505 505
 		}
@@ -513,12 +513,12 @@  discard block
 block discarded – undo
513 513
 		 * @param array $actions Action links.
514 514
 		 * @return array
515 515
 		 */
516
-		public function filter_plugin_action_links_update( $actions ) {
516
+		public function filter_plugin_action_links_update($actions) {
517 517
 			$actions['update'] = sprintf(
518 518
 				'<a href="%1$s" title="%2$s" class="edit">%3$s</a>',
519
-				esc_url( $this->get_tgmpa_status_url( 'update' ) ),
520
-				esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'tgmpa' ),
521
-				esc_html__( 'Update Required', 'tgmpa' )
519
+				esc_url($this->get_tgmpa_status_url('update')),
520
+				esc_attr__('This plugin needs to be updated to be compatible with your theme.', 'tgmpa'),
521
+				esc_html__('Update Required', 'tgmpa')
522 522
 			);
523 523
 
524 524
 			return $actions;
@@ -548,15 +548,15 @@  discard block
 block discarded – undo
548 548
 		 * @return null Returns early if not the TGMPA page.
549 549
 		 */
550 550
 		public function admin_init() {
551
-			if ( ! $this->is_tgmpa_page() ) {
551
+			if (!$this->is_tgmpa_page()) {
552 552
 				return;
553 553
 			}
554 554
 
555
-			if ( isset( $_REQUEST['tab'] ) && 'plugin-information' === $_REQUEST['tab'] ) {
555
+			if (isset($_REQUEST['tab']) && 'plugin-information' === $_REQUEST['tab']) {
556 556
 				// Needed for install_plugin_information().
557
-				require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
557
+				require_once ABSPATH.'wp-admin/includes/plugin-install.php';
558 558
 
559
-				wp_enqueue_style( 'plugin-install' );
559
+				wp_enqueue_style('plugin-install');
560 560
 
561 561
 				global $tab, $body_id;
562 562
 				$body_id = 'plugin-information';
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 		 * @since 2.1.0
583 583
 		 */
584 584
 		public function thickbox() {
585
-			if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) {
585
+			if (!get_user_meta(get_current_user_id(), 'tgmpa_dismissed_notice_'.$this->id, true)) {
586 586
 				add_thickbox();
587 587
 			}
588 588
 		}
@@ -604,23 +604,23 @@  discard block
 block discarded – undo
604 604
 		 */
605 605
 		public function admin_menu() {
606 606
 			// Make sure privileges are correct to see the page.
607
-			if ( ! current_user_can( 'install_plugins' ) ) {
607
+			if (!current_user_can('install_plugins')) {
608 608
 				return;
609 609
 			}
610 610
 
611 611
 			$args = apply_filters(
612 612
 				'tgmpa_admin_menu_args',
613 613
 				array(
614
-					'parent_slug' => $this->parent_slug,                     // Parent Menu slug.
615
-					'page_title'  => $this->strings['page_title'],           // Page title.
616
-					'menu_title'  => $this->strings['menu_title'],           // Menu title.
617
-					'capability'  => $this->capability,                      // Capability.
618
-					'menu_slug'   => $this->menu,                            // Menu slug.
619
-					'function'    => array( $this, 'install_plugins_page' ), // Callback.
614
+					'parent_slug' => $this->parent_slug, // Parent Menu slug.
615
+					'page_title'  => $this->strings['page_title'], // Page title.
616
+					'menu_title'  => $this->strings['menu_title'], // Menu title.
617
+					'capability'  => $this->capability, // Capability.
618
+					'menu_slug'   => $this->menu, // Menu slug.
619
+					'function'    => array($this, 'install_plugins_page'), // Callback.
620 620
 				)
621 621
 			);
622 622
 
623
-			$this->add_admin_menu( $args );
623
+			$this->add_admin_menu($args);
624 624
 		}
625 625
 
626 626
 		/**
@@ -630,15 +630,15 @@  discard block
 block discarded – undo
630 630
 		 *
631 631
 		 * @param array $args Menu item configuration.
632 632
 		 */
633
-		protected function add_admin_menu( array $args ) {
634
-			if ( has_filter( 'tgmpa_admin_menu_use_add_theme_page' ) ) {
635
-				_deprecated_function( 'The "tgmpa_admin_menu_use_add_theme_page" filter', '2.5.0', esc_html__( 'Set the parent_slug config variable instead.', 'tgmpa' ) );
633
+		protected function add_admin_menu(array $args) {
634
+			if (has_filter('tgmpa_admin_menu_use_add_theme_page')) {
635
+				_deprecated_function('The "tgmpa_admin_menu_use_add_theme_page" filter', '2.5.0', esc_html__('Set the parent_slug config variable instead.', 'tgmpa'));
636 636
 			}
637 637
 
638
-			if ( 'themes.php' === $this->parent_slug ) {
639
-				$this->page_hook = call_user_func( 'add_theme_page', $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );
638
+			if ('themes.php' === $this->parent_slug) {
639
+				$this->page_hook = call_user_func('add_theme_page', $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function']);
640 640
 			} else {
641
-				$this->page_hook = call_user_func( 'add_submenu_page', $args['parent_slug'], $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );
641
+				$this->page_hook = call_user_func('add_submenu_page', $args['parent_slug'], $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function']);
642 642
 			}
643 643
 		}
644 644
 
@@ -658,28 +658,28 @@  discard block
 block discarded – undo
658 658
 			$plugin_table = new TGMPA_List_Table;
659 659
 
660 660
 			// Return early if processing a plugin installation action.
661
-			if ( ( ( 'tgmpa-bulk-install' === $plugin_table->current_action() || 'tgmpa-bulk-update' === $plugin_table->current_action() ) && $plugin_table->process_bulk_actions() ) || $this->do_plugin_install() ) {
661
+			if ((('tgmpa-bulk-install' === $plugin_table->current_action() || 'tgmpa-bulk-update' === $plugin_table->current_action()) && $plugin_table->process_bulk_actions()) || $this->do_plugin_install()) {
662 662
 				return;
663 663
 			}
664 664
 
665 665
 			// Force refresh of available plugin information so we'll know about manual updates/deletes.
666
-			wp_clean_plugins_cache( false );
666
+			wp_clean_plugins_cache(false);
667 667
 
668 668
 			?>
669 669
 			<div class="tgmpa wrap">
670
-				<h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
670
+				<h2><?php echo esc_html(get_admin_page_title()); ?></h2>
671 671
 				<?php $plugin_table->prepare_items(); ?>
672 672
 
673 673
 				<?php
674
-				if ( ! empty( $this->message ) && is_string( $this->message ) ) {
675
-					echo wp_kses_post( $this->message );
674
+				if (!empty($this->message) && is_string($this->message)) {
675
+					echo wp_kses_post($this->message);
676 676
 				}
677 677
 				?>
678 678
 				<?php $plugin_table->views(); ?>
679 679
 
680 680
 				<form id="tgmpa-plugins" action="" method="post">
681
-					<input type="hidden" name="tgmpa-page" value="<?php echo esc_attr( $this->menu ); ?>" />
682
-					<input type="hidden" name="plugin_status" value="<?php echo esc_attr( $plugin_table->view_context ); ?>" />
681
+					<input type="hidden" name="tgmpa-page" value="<?php echo esc_attr($this->menu); ?>" />
682
+					<input type="hidden" name="plugin_status" value="<?php echo esc_attr($plugin_table->view_context); ?>" />
683 683
 					<?php $plugin_table->display(); ?>
684 684
 				</form>
685 685
 			</div>
@@ -707,48 +707,48 @@  discard block
 block discarded – undo
707 707
 		 * @return boolean True on success, false on failure.
708 708
 		 */
709 709
 		protected function do_plugin_install() {
710
-			if ( empty( $_GET['plugin'] ) ) {
710
+			if (empty($_GET['plugin'])) {
711 711
 				return false;
712 712
 			}
713 713
 
714 714
 			// All plugin information will be stored in an array for processing.
715
-			$slug = $this->sanitize_key( urldecode( $_GET['plugin'] ) );
715
+			$slug = $this->sanitize_key(urldecode($_GET['plugin']));
716 716
 
717
-			if ( ! isset( $this->plugins[ $slug ] ) ) {
717
+			if (!isset($this->plugins[$slug])) {
718 718
 				return false;
719 719
 			}
720 720
 
721 721
 			// Was an install or upgrade action link clicked?
722
-			if ( ( isset( $_GET['tgmpa-install'] ) && 'install-plugin' === $_GET['tgmpa-install'] ) || ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) ) {
722
+			if ((isset($_GET['tgmpa-install']) && 'install-plugin' === $_GET['tgmpa-install']) || (isset($_GET['tgmpa-update']) && 'update-plugin' === $_GET['tgmpa-update'])) {
723 723
 
724 724
 				$install_type = 'install';
725
-				if ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) {
725
+				if (isset($_GET['tgmpa-update']) && 'update-plugin' === $_GET['tgmpa-update']) {
726 726
 					$install_type = 'update';
727 727
 				}
728 728
 
729
-				check_admin_referer( 'tgmpa-' . $install_type, 'tgmpa-nonce' );
729
+				check_admin_referer('tgmpa-'.$install_type, 'tgmpa-nonce');
730 730
 
731 731
 				// Pass necessary information via URL if WP_Filesystem is needed.
732 732
 				$url = wp_nonce_url(
733 733
 					add_query_arg(
734 734
 						array(
735
-							'plugin'                 => urlencode( $slug ),
736
-							'tgmpa-' . $install_type => $install_type . '-plugin',
735
+							'plugin'                 => urlencode($slug),
736
+							'tgmpa-'.$install_type => $install_type.'-plugin',
737 737
 						),
738 738
 						$this->get_tgmpa_url()
739 739
 					),
740
-					'tgmpa-' . $install_type,
740
+					'tgmpa-'.$install_type,
741 741
 					'tgmpa-nonce'
742 742
 				);
743 743
 
744 744
 				$method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
745 745
 
746
-				if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, array() ) ) ) {
746
+				if (false === ($creds = request_filesystem_credentials(esc_url_raw($url), $method, false, false, array()))) {
747 747
 					return true;
748 748
 				}
749 749
 
750
-				if ( ! WP_Filesystem( $creds ) ) {
751
-					request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, array() ); // Setup WP_Filesystem.
750
+				if (!WP_Filesystem($creds)) {
751
+					request_filesystem_credentials(esc_url_raw($url), $method, true, false, array()); // Setup WP_Filesystem.
752 752
 					return true;
753 753
 				}
754 754
 
@@ -757,66 +757,66 @@  discard block
 block discarded – undo
757 757
 				// Prep variables for Plugin_Installer_Skin class.
758 758
 				$extra         = array();
759 759
 				$extra['slug'] = $slug; // Needed for potentially renaming of directory name.
760
-				$source        = $this->get_download_url( $slug );
761
-				$api           = ( 'repo' === $this->plugins[ $slug ]['source_type'] ) ? $this->get_plugins_api( $slug ) : null;
762
-				$api           = ( false !== $api ) ? $api : null;
760
+				$source        = $this->get_download_url($slug);
761
+				$api           = ('repo' === $this->plugins[$slug]['source_type']) ? $this->get_plugins_api($slug) : null;
762
+				$api           = (false !== $api) ? $api : null;
763 763
 
764 764
 				$url = add_query_arg(
765 765
 					array(
766
-						'action' => $install_type . '-plugin',
767
-						'plugin' => urlencode( $slug ),
766
+						'action' => $install_type.'-plugin',
767
+						'plugin' => urlencode($slug),
768 768
 					),
769 769
 					'update.php'
770 770
 				);
771 771
 
772
-				if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
773
-					require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
772
+				if (!class_exists('Plugin_Upgrader', false)) {
773
+					require_once ABSPATH.'wp-admin/includes/class-wp-upgrader.php';
774 774
 				}
775 775
 
776 776
 				$skin_args = array(
777
-					'type'   => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload',
778
-					'title'  => sprintf( $this->strings['installing'], $this->plugins[ $slug ]['name'] ),
779
-					'url'    => esc_url_raw( $url ),
780
-					'nonce'  => $install_type . '-plugin_' . $slug,
777
+					'type'   => ('bundled' !== $this->plugins[$slug]['source_type']) ? 'web' : 'upload',
778
+					'title'  => sprintf($this->strings['installing'], $this->plugins[$slug]['name']),
779
+					'url'    => esc_url_raw($url),
780
+					'nonce'  => $install_type.'-plugin_'.$slug,
781 781
 					'plugin' => '',
782 782
 					'api'    => $api,
783 783
 					'extra'  => $extra,
784 784
 				);
785 785
 
786
-				if ( 'update' === $install_type ) {
787
-					$skin_args['plugin'] = $this->plugins[ $slug ]['file_path'];
788
-					$skin                = new Plugin_Upgrader_Skin( $skin_args );
786
+				if ('update' === $install_type) {
787
+					$skin_args['plugin'] = $this->plugins[$slug]['file_path'];
788
+					$skin                = new Plugin_Upgrader_Skin($skin_args);
789 789
 				} else {
790
-					$skin = new Plugin_Installer_Skin( $skin_args );
790
+					$skin = new Plugin_Installer_Skin($skin_args);
791 791
 				}
792 792
 
793 793
 				// Create a new instance of Plugin_Upgrader.
794
-				$upgrader = new Plugin_Upgrader( $skin );
794
+				$upgrader = new Plugin_Upgrader($skin);
795 795
 
796 796
 				// Perform the action and install the plugin from the $source urldecode().
797
-				add_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 );
797
+				add_filter('upgrader_source_selection', array($this, 'maybe_adjust_source_dir'), 1, 3);
798 798
 
799
-				if ( 'update' === $install_type ) {
799
+				if ('update' === $install_type) {
800 800
 					// Inject our info into the update transient.
801
-					$to_inject                    = array( $slug => $this->plugins[ $slug ] );
802
-					$to_inject[ $slug ]['source'] = $source;
803
-					$this->inject_update_info( $to_inject );
801
+					$to_inject                    = array($slug => $this->plugins[$slug]);
802
+					$to_inject[$slug]['source'] = $source;
803
+					$this->inject_update_info($to_inject);
804 804
 
805
-					$upgrader->upgrade( $this->plugins[ $slug ]['file_path'] );
805
+					$upgrader->upgrade($this->plugins[$slug]['file_path']);
806 806
 				} else {
807
-					$upgrader->install( $source );
807
+					$upgrader->install($source);
808 808
 				}
809 809
 
810
-				remove_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 );
810
+				remove_filter('upgrader_source_selection', array($this, 'maybe_adjust_source_dir'), 1, 3);
811 811
 
812 812
 				// Make sure we have the correct file path now the plugin is installed/updated.
813
-				$this->populate_file_path( $slug );
813
+				$this->populate_file_path($slug);
814 814
 
815 815
 				// Only activate plugins if the config option is set to true and the plugin isn't
816 816
 				// already active (upgrade).
817
-				if ( $this->is_automatic && ! $this->is_plugin_active( $slug ) ) {
817
+				if ($this->is_automatic && !$this->is_plugin_active($slug)) {
818 818
 					$plugin_activate = $upgrader->plugin_info(); // Grab the plugin info from the Plugin_Upgrader method.
819
-					if ( false === $this->activate_single_plugin( $plugin_activate, $slug, true ) ) {
819
+					if (false === $this->activate_single_plugin($plugin_activate, $slug, true)) {
820 820
 						return true; // Finish execution of the function early as we encountered an error.
821 821
 					}
822 822
 				}
@@ -824,19 +824,19 @@  discard block
 block discarded – undo
824 824
 				$this->show_tgmpa_version();
825 825
 
826 826
 				// Display message based on if all plugins are now active or not.
827
-				if ( $this->is_tgmpa_complete() ) {
828
-					echo '<p>', sprintf( esc_html( $this->strings['complete'] ), '<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . '</a>' ), '</p>';
827
+				if ($this->is_tgmpa_complete()) {
828
+					echo '<p>', sprintf(esc_html($this->strings['complete']), '<a href="'.esc_url(self_admin_url()).'">'.esc_html__('Return to the Dashboard', 'tgmpa').'</a>'), '</p>';
829 829
 					echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
830 830
 				} else {
831
-					echo '<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';
831
+					echo '<p><a href="', esc_url($this->get_tgmpa_url()), '" target="_parent">', esc_html($this->strings['return']), '</a></p>';
832 832
 				}
833 833
 
834 834
 				return true;
835
-			} elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) {
835
+			} elseif (isset($this->plugins[$slug]['file_path'], $_GET['tgmpa-activate']) && 'activate-plugin' === $_GET['tgmpa-activate']) {
836 836
 				// Activate action link was clicked.
837
-				check_admin_referer( 'tgmpa-activate', 'tgmpa-nonce' );
837
+				check_admin_referer('tgmpa-activate', 'tgmpa-nonce');
838 838
 
839
-				if ( false === $this->activate_single_plugin( $this->plugins[ $slug ]['file_path'], $slug ) ) {
839
+				if (false === $this->activate_single_plugin($this->plugins[$slug]['file_path'], $slug)) {
840 840
 					return true; // Finish execution of the function early as we encountered an error.
841 841
 				}
842 842
 			}
@@ -851,31 +851,31 @@  discard block
 block discarded – undo
851 851
 		 *
852 852
 		 * @param array $plugins The plugin information for the plugins which are to be updated.
853 853
 		 */
854
-		public function inject_update_info( $plugins ) {
855
-			$repo_updates = get_site_transient( 'update_plugins' );
854
+		public function inject_update_info($plugins) {
855
+			$repo_updates = get_site_transient('update_plugins');
856 856
 
857
-			if ( ! is_object( $repo_updates ) ) {
857
+			if (!is_object($repo_updates)) {
858 858
 				$repo_updates = new stdClass;
859 859
 			}
860 860
 
861
-			foreach ( $plugins as $slug => $plugin ) {
861
+			foreach ($plugins as $slug => $plugin) {
862 862
 				$file_path = $plugin['file_path'];
863 863
 
864
-				if ( empty( $repo_updates->response[ $file_path ] ) ) {
865
-					$repo_updates->response[ $file_path ] = new stdClass;
864
+				if (empty($repo_updates->response[$file_path])) {
865
+					$repo_updates->response[$file_path] = new stdClass;
866 866
 				}
867 867
 
868 868
 				// We only really need to set package, but let's do all we can in case WP changes something.
869
-				$repo_updates->response[ $file_path ]->slug        = $slug;
870
-				$repo_updates->response[ $file_path ]->plugin      = $file_path;
871
-				$repo_updates->response[ $file_path ]->new_version = $plugin['version'];
872
-				$repo_updates->response[ $file_path ]->package     = $plugin['source'];
873
-				if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin['external_url'] ) ) {
874
-					$repo_updates->response[ $file_path ]->url = $plugin['external_url'];
869
+				$repo_updates->response[$file_path]->slug        = $slug;
870
+				$repo_updates->response[$file_path]->plugin      = $file_path;
871
+				$repo_updates->response[$file_path]->new_version = $plugin['version'];
872
+				$repo_updates->response[$file_path]->package     = $plugin['source'];
873
+				if (empty($repo_updates->response[$file_path]->url) && !empty($plugin['external_url'])) {
874
+					$repo_updates->response[$file_path]->url = $plugin['external_url'];
875 875
 				}
876 876
 			}
877 877
 
878
-			set_site_transient( 'update_plugins', $repo_updates );
878
+			set_site_transient('update_plugins', $repo_updates);
879 879
 		}
880 880
 
881 881
 		/**
@@ -894,14 +894,14 @@  discard block
 block discarded – undo
894 894
 		 * @param \WP_Upgrader $upgrader      Instance of the upgrader which installs the plugin.
895 895
 		 * @return string $source
896 896
 		 */
897
-		public function maybe_adjust_source_dir( $source, $remote_source, $upgrader ) {
898
-			if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS['wp_filesystem'] ) ) {
897
+		public function maybe_adjust_source_dir($source, $remote_source, $upgrader) {
898
+			if (!$this->is_tgmpa_page() || !is_object($GLOBALS['wp_filesystem'])) {
899 899
 				return $source;
900 900
 			}
901 901
 
902 902
 			// Check for single file plugins.
903
-			$source_files = array_keys( $GLOBALS['wp_filesystem']->dirlist( $remote_source ) );
904
-			if ( 1 === count( $source_files ) && false === $GLOBALS['wp_filesystem']->is_dir( $source ) ) {
903
+			$source_files = array_keys($GLOBALS['wp_filesystem']->dirlist($remote_source));
904
+			if (1 === count($source_files) && false === $GLOBALS['wp_filesystem']->is_dir($source)) {
905 905
 				return $source;
906 906
 			}
907 907
 
@@ -909,33 +909,33 @@  discard block
 block discarded – undo
909 909
 			$desired_slug = '';
910 910
 
911 911
 			// Figure out what the slug is supposed to be.
912
-			if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options['extra']['slug'] ) ) {
912
+			if (false === $upgrader->bulk && !empty($upgrader->skin->options['extra']['slug'])) {
913 913
 				$desired_slug = $upgrader->skin->options['extra']['slug'];
914 914
 			} else {
915 915
 				// Bulk installer contains less info, so fall back on the info registered here.
916
-				foreach ( $this->plugins as $slug => $plugin ) {
917
-					if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin['name'] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) {
916
+				foreach ($this->plugins as $slug => $plugin) {
917
+					if (!empty($upgrader->skin->plugin_names[$upgrader->skin->i]) && $plugin['name'] === $upgrader->skin->plugin_names[$upgrader->skin->i]) {
918 918
 						$desired_slug = $slug;
919 919
 						break;
920 920
 					}
921 921
 				}
922
-				unset( $slug, $plugin );
922
+				unset($slug, $plugin);
923 923
 			}
924 924
 
925
-			if ( ! empty( $desired_slug ) ) {
926
-				$subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) );
925
+			if (!empty($desired_slug)) {
926
+				$subdir_name = untrailingslashit(str_replace(trailingslashit($remote_source), '', $source));
927 927
 
928
-				if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) {
929
-					$from = untrailingslashit( $source );
930
-					$to   = trailingslashit( $remote_source ) . $desired_slug;
928
+				if (!empty($subdir_name) && $subdir_name !== $desired_slug) {
929
+					$from = untrailingslashit($source);
930
+					$to   = trailingslashit($remote_source).$desired_slug;
931 931
 
932
-					if ( true === $GLOBALS['wp_filesystem']->move( $from, $to ) ) {
933
-						return trailingslashit( $to );
932
+					if (true === $GLOBALS['wp_filesystem']->move($from, $to)) {
933
+						return trailingslashit($to);
934 934
 					} else {
935
-						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.', 'tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
935
+						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.', 'tgmpa').' '.esc_html__('Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa'), array('found' => $subdir_name, 'expected' => $desired_slug));
936 936
 					}
937
-				} elseif ( empty( $subdir_name ) ) {
938
-					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.', 'tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
937
+				} elseif (empty($subdir_name)) {
938
+					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.', 'tgmpa').' '.esc_html__('Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa'), array('found' => $subdir_name, 'expected' => $desired_slug));
939 939
 				}
940 940
 			}
941 941
 
@@ -953,51 +953,51 @@  discard block
 block discarded – undo
953 953
 		 *                          This determines the styling of the output messages.
954 954
 		 * @return bool False if an error was encountered, true otherwise.
955 955
 		 */
956
-		protected function activate_single_plugin( $file_path, $slug, $automatic = false ) {
957
-			if ( $this->can_plugin_activate( $slug ) ) {
958
-				$activate = activate_plugin( $file_path );
956
+		protected function activate_single_plugin($file_path, $slug, $automatic = false) {
957
+			if ($this->can_plugin_activate($slug)) {
958
+				$activate = activate_plugin($file_path);
959 959
 
960
-				if ( is_wp_error( $activate ) ) {
961
-					echo '<div id="message" class="error"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>',
962
-						'<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';
960
+				if (is_wp_error($activate)) {
961
+					echo '<div id="message" class="error"><p>', wp_kses_post($activate->get_error_message()), '</p></div>',
962
+						'<p><a href="', esc_url($this->get_tgmpa_url()), '" target="_parent">', esc_html($this->strings['return']), '</a></p>';
963 963
 
964 964
 					return false; // End it here if there is an error with activation.
965 965
 				} else {
966
-					if ( ! $automatic ) {
966
+					if (!$automatic) {
967 967
 						// Make sure message doesn't display again if bulk activation is performed
968 968
 						// immediately after a single activation.
969
-						if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
970
-							echo '<div id="message" class="updated"><p>', esc_html( $this->strings['activated_successfully'] ), ' <strong>', esc_html( $this->plugins[ $slug ]['name'] ), '.</strong></p></div>';
969
+						if (!isset($_POST['action'])) { // WPCS: CSRF OK.
970
+							echo '<div id="message" class="updated"><p>', esc_html($this->strings['activated_successfully']), ' <strong>', esc_html($this->plugins[$slug]['name']), '.</strong></p></div>';
971 971
 						}
972 972
 					} else {
973 973
 						// Simpler message layout for use on the plugin install page.
974
-						echo '<p>', esc_html( $this->strings['plugin_activated'] ), '</p>';
974
+						echo '<p>', esc_html($this->strings['plugin_activated']), '</p>';
975 975
 					}
976 976
 				}
977
-			} elseif ( $this->is_plugin_active( $slug ) ) {
977
+			} elseif ($this->is_plugin_active($slug)) {
978 978
 				// No simpler message format provided as this message should never be encountered
979 979
 				// on the plugin install page.
980 980
 				echo '<div id="message" class="error"><p>',
981 981
 					sprintf(
982
-						esc_html( $this->strings['plugin_already_active'] ),
983
-						'<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'
982
+						esc_html($this->strings['plugin_already_active']),
983
+						'<strong>'.esc_html($this->plugins[$slug]['name']).'</strong>'
984 984
 					),
985 985
 					'</p></div>';
986
-			} elseif ( $this->does_plugin_require_update( $slug ) ) {
987
-				if ( ! $automatic ) {
986
+			} elseif ($this->does_plugin_require_update($slug)) {
987
+				if (!$automatic) {
988 988
 					// Make sure message doesn't display again if bulk activation is performed
989 989
 					// immediately after a single activation.
990
-					if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
990
+					if (!isset($_POST['action'])) { // WPCS: CSRF OK.
991 991
 						echo '<div id="message" class="error"><p>',
992 992
 							sprintf(
993
-								esc_html( $this->strings['plugin_needs_higher_version'] ),
994
-								'<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'
993
+								esc_html($this->strings['plugin_needs_higher_version']),
994
+								'<strong>'.esc_html($this->plugins[$slug]['name']).'</strong>'
995 995
 							),
996 996
 							'</p></div>';
997 997
 					}
998 998
 				} else {
999 999
 					// Simpler message layout for use on the plugin install page.
1000
-					echo '<p>', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[ $slug ]['name'] ) ), '</p>';
1000
+					echo '<p>', sprintf(esc_html($this->strings['plugin_needs_higher_version']), esc_html($this->plugins[$slug]['name'])), '</p>';
1001 1001
 				}
1002 1002
 			}
1003 1003
 
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
 		 */
1022 1022
 		public function notices() {
1023 1023
 			// Remove nag on the install page / Return early if the nag message has been dismissed.
1024
-			if ( $this->is_tgmpa_page() || get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) {
1024
+			if ($this->is_tgmpa_page() || get_user_meta(get_current_user_id(), 'tgmpa_dismissed_notice_'.$this->id, true)) {
1025 1025
 				return;
1026 1026
 			}
1027 1027
 
@@ -1033,16 +1033,16 @@  discard block
 block discarded – undo
1033 1033
 			$update_link_count   = 0;
1034 1034
 			$activate_link_count = 0;
1035 1035
 
1036
-			foreach ( $this->plugins as $slug => $plugin ) {
1037
-				if ( $this->is_plugin_active( $slug ) && false === $this->does_plugin_have_update( $slug ) ) {
1036
+			foreach ($this->plugins as $slug => $plugin) {
1037
+				if ($this->is_plugin_active($slug) && false === $this->does_plugin_have_update($slug)) {
1038 1038
 					continue;
1039 1039
 				}
1040 1040
 
1041
-				if ( ! $this->is_plugin_installed( $slug ) ) {
1042
-					if ( current_user_can( 'install_plugins' ) ) {
1041
+				if (!$this->is_plugin_installed($slug)) {
1042
+					if (current_user_can('install_plugins')) {
1043 1043
 						$install_link_count++;
1044 1044
 
1045
-						if ( true === $plugin['required'] ) {
1045
+						if (true === $plugin['required']) {
1046 1046
 							$message['notice_can_install_required'][] = $slug;
1047 1047
 						} else {
1048 1048
 							$message['notice_can_install_recommended'][] = $slug;
@@ -1052,11 +1052,11 @@  discard block
 block discarded – undo
1052 1052
 						$message['notice_cannot_install'][] = $slug;
1053 1053
 					}
1054 1054
 				} else {
1055
-					if ( ! $this->is_plugin_active( $slug ) && $this->can_plugin_activate( $slug ) ) {
1056
-						if ( current_user_can( 'activate_plugins' ) ) {
1055
+					if (!$this->is_plugin_active($slug) && $this->can_plugin_activate($slug)) {
1056
+						if (current_user_can('activate_plugins')) {
1057 1057
 							$activate_link_count++;
1058 1058
 
1059
-							if ( true === $plugin['required'] ) {
1059
+							if (true === $plugin['required']) {
1060 1060
 								$message['notice_can_activate_required'][] = $slug;
1061 1061
 							} else {
1062 1062
 								$message['notice_can_activate_recommended'][] = $slug;
@@ -1067,14 +1067,14 @@  discard block
 block discarded – undo
1067 1067
 						}
1068 1068
 					}
1069 1069
 
1070
-					if ( $this->does_plugin_require_update( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) {
1070
+					if ($this->does_plugin_require_update($slug) || false !== $this->does_plugin_have_update($slug)) {
1071 1071
 
1072
-						if ( current_user_can( 'install_plugins' ) ) {
1072
+						if (current_user_can('install_plugins')) {
1073 1073
 							$update_link_count++;
1074 1074
 
1075
-							if ( $this->does_plugin_require_update( $slug ) ) {
1075
+							if ($this->does_plugin_require_update($slug)) {
1076 1076
 								$message['notice_ask_to_update'][] = $slug;
1077
-							} elseif ( false !== $this->does_plugin_have_update( $slug ) ) {
1077
+							} elseif (false !== $this->does_plugin_have_update($slug)) {
1078 1078
 								$message['notice_ask_to_update_maybe'][] = $slug;
1079 1079
 							}
1080 1080
 						} else {
@@ -1084,107 +1084,107 @@  discard block
 block discarded – undo
1084 1084
 					}
1085 1085
 				}
1086 1086
 			}
1087
-			unset( $slug, $plugin );
1087
+			unset($slug, $plugin);
1088 1088
 
1089 1089
 			// If we have notices to display, we move forward.
1090
-			if ( ! empty( $message ) ) {
1091
-				krsort( $message ); // Sort messages.
1090
+			if (!empty($message)) {
1091
+				krsort($message); // Sort messages.
1092 1092
 				$rendered = '';
1093 1093
 
1094 1094
 				// As add_settings_error() wraps the final message in a <p> and as the final message can't be
1095 1095
 				// filtered, using <p>'s in our html would render invalid html output.
1096
-				$line_template = '<span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;">%s</span>' . "\n";
1096
+				$line_template = '<span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;">%s</span>'."\n";
1097 1097
 
1098 1098
 				// If dismissable is false and a message is set, output it now.
1099
-				if ( ! $this->dismissable && ! empty( $this->dismiss_msg ) ) {
1100
-					$rendered .= sprintf( $line_template, wp_kses_post( $this->dismiss_msg ) );
1099
+				if (!$this->dismissable && !empty($this->dismiss_msg)) {
1100
+					$rendered .= sprintf($line_template, wp_kses_post($this->dismiss_msg));
1101 1101
 				}
1102 1102
 
1103 1103
 				// Render the individual message lines for the notice.
1104
-				foreach ( $message as $type => $plugin_group ) {
1104
+				foreach ($message as $type => $plugin_group) {
1105 1105
 					$linked_plugins = array();
1106 1106
 
1107 1107
 					// Get the external info link for a plugin if one is available.
1108
-					foreach ( $plugin_group as $plugin_slug ) {
1109
-						$linked_plugins[] = $this->get_info_link( $plugin_slug );
1108
+					foreach ($plugin_group as $plugin_slug) {
1109
+						$linked_plugins[] = $this->get_info_link($plugin_slug);
1110 1110
 					}
1111
-					unset( $plugin_slug );
1111
+					unset($plugin_slug);
1112 1112
 
1113
-					$count          = count( $plugin_group );
1114
-					$linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins );
1115
-					$last_plugin    = array_pop( $linked_plugins ); // Pop off last name to prep for readability.
1116
-					$imploded       = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ) . ' ' . $last_plugin );
1113
+					$count          = count($plugin_group);
1114
+					$linked_plugins = array_map(array('TGMPA_Utils', 'wrap_in_em'), $linked_plugins);
1115
+					$last_plugin    = array_pop($linked_plugins); // Pop off last name to prep for readability.
1116
+					$imploded       = empty($linked_plugins) ? $last_plugin : (implode(', ', $linked_plugins).' '.esc_html_x('and', 'plugin A *and* plugin B', 'tgmpa').' '.$last_plugin);
1117 1117
 
1118 1118
 					$rendered .= sprintf(
1119 1119
 						$line_template,
1120 1120
 						sprintf(
1121
-							translate_nooped_plural( $this->strings[ $type ], $count, 'tgmpa' ),
1121
+							translate_nooped_plural($this->strings[$type], $count, 'tgmpa'),
1122 1122
 							$imploded,
1123 1123
 							$count
1124 1124
 						)
1125 1125
 					);
1126 1126
 
1127
-					if ( 0 === strpos( $type, 'notice_cannot' ) ) {
1127
+					if (0 === strpos($type, 'notice_cannot')) {
1128 1128
 						$rendered .= $this->strings['contact_admin'];
1129 1129
 					}
1130 1130
 				}
1131
-				unset( $type, $plugin_group, $linked_plugins, $count, $last_plugin, $imploded );
1131
+				unset($type, $plugin_group, $linked_plugins, $count, $last_plugin, $imploded);
1132 1132
 
1133 1133
 				// Setup action links.
1134 1134
 				$action_links = array(
1135 1135
 					'install'  => '',
1136 1136
 					'update'   => '',
1137 1137
 					'activate' => '',
1138
-					'dismiss'  => $this->dismissable ? '<a href="' . esc_url( add_query_arg( 'tgmpa-dismiss', 'dismiss_admin_notices' ) ) . '" class="dismiss-notice" target="_parent">' . esc_html( $this->strings['dismiss'] ) . '</a>' : '',
1138
+					'dismiss'  => $this->dismissable ? '<a href="'.esc_url(add_query_arg('tgmpa-dismiss', 'dismiss_admin_notices')).'" class="dismiss-notice" target="_parent">'.esc_html($this->strings['dismiss']).'</a>' : '',
1139 1139
 				);
1140 1140
 
1141 1141
 				$link_template = '<a href="%2$s">%1$s</a>';
1142 1142
 
1143
-				if ( current_user_can( 'install_plugins' ) ) {
1144
-					if ( $install_link_count > 0 ) {
1143
+				if (current_user_can('install_plugins')) {
1144
+					if ($install_link_count > 0) {
1145 1145
 						$action_links['install'] = sprintf(
1146 1146
 							$link_template,
1147
-							translate_nooped_plural( $this->strings['install_link'], $install_link_count, 'tgmpa' ),
1148
-							esc_url( $this->get_tgmpa_status_url( 'install' ) )
1147
+							translate_nooped_plural($this->strings['install_link'], $install_link_count, 'tgmpa'),
1148
+							esc_url($this->get_tgmpa_status_url('install'))
1149 1149
 						);
1150 1150
 					}
1151
-					if ( $update_link_count > 0 ) {
1151
+					if ($update_link_count > 0) {
1152 1152
 						$action_links['update'] = sprintf(
1153 1153
 							$link_template,
1154
-							translate_nooped_plural( $this->strings['update_link'], $update_link_count, 'tgmpa' ),
1155
-							esc_url( $this->get_tgmpa_status_url( 'update' ) )
1154
+							translate_nooped_plural($this->strings['update_link'], $update_link_count, 'tgmpa'),
1155
+							esc_url($this->get_tgmpa_status_url('update'))
1156 1156
 						);
1157 1157
 					}
1158 1158
 				}
1159 1159
 
1160
-				if ( current_user_can( 'activate_plugins' ) && $activate_link_count > 0 ) {
1160
+				if (current_user_can('activate_plugins') && $activate_link_count > 0) {
1161 1161
 					$action_links['activate'] = sprintf(
1162 1162
 						$link_template,
1163
-						translate_nooped_plural( $this->strings['activate_link'], $activate_link_count, 'tgmpa' ),
1164
-						esc_url( $this->get_tgmpa_status_url( 'activate' ) )
1163
+						translate_nooped_plural($this->strings['activate_link'], $activate_link_count, 'tgmpa'),
1164
+						esc_url($this->get_tgmpa_status_url('activate'))
1165 1165
 					);
1166 1166
 				}
1167 1167
 
1168
-				$action_links = apply_filters( 'tgmpa_notice_action_links', $action_links );
1168
+				$action_links = apply_filters('tgmpa_notice_action_links', $action_links);
1169 1169
 
1170
-				$action_links = array_filter( (array) $action_links ); // Remove any empty array items.
1170
+				$action_links = array_filter((array) $action_links); // Remove any empty array items.
1171 1171
 
1172
-				if ( ! empty( $action_links ) && is_array( $action_links ) ) {
1173
-					$action_links = sprintf( $line_template, implode( ' | ', $action_links ) );
1174
-					$rendered    .= apply_filters( 'tgmpa_notice_rendered_action_links', $action_links );
1172
+				if (!empty($action_links) && is_array($action_links)) {
1173
+					$action_links = sprintf($line_template, implode(' | ', $action_links));
1174
+					$rendered    .= apply_filters('tgmpa_notice_rendered_action_links', $action_links);
1175 1175
 				}
1176 1176
 
1177 1177
 				// Register the nag messages and prepare them to be processed.
1178
-				if ( ! empty( $this->strings['nag_type'] ) ) {
1179
-					add_settings_error( 'tgmpa', 'tgmpa', $rendered, sanitize_html_class( strtolower( $this->strings['nag_type'] ) ) );
1178
+				if (!empty($this->strings['nag_type'])) {
1179
+					add_settings_error('tgmpa', 'tgmpa', $rendered, sanitize_html_class(strtolower($this->strings['nag_type'])));
1180 1180
 				} else {
1181
-					$nag_class = version_compare( $this->wp_version, '3.8', '<' ) ? 'updated' : 'update-nag';
1182
-					add_settings_error( 'tgmpa', 'tgmpa', $rendered, $nag_class );
1181
+					$nag_class = version_compare($this->wp_version, '3.8', '<') ? 'updated' : 'update-nag';
1182
+					add_settings_error('tgmpa', 'tgmpa', $rendered, $nag_class);
1183 1183
 				}
1184 1184
 			}
1185 1185
 
1186 1186
 			// Admin options pages already output settings_errors, so this is to avoid duplication.
1187
-			if ( 'options-general' !== $GLOBALS['current_screen']->parent_base ) {
1187
+			if ('options-general' !== $GLOBALS['current_screen']->parent_base) {
1188 1188
 				$this->display_settings_errors();
1189 1189
 			}
1190 1190
 		}
@@ -1197,11 +1197,11 @@  discard block
 block discarded – undo
1197 1197
 		protected function display_settings_errors() {
1198 1198
 			global $wp_settings_errors;
1199 1199
 
1200
-			settings_errors( 'tgmpa' );
1200
+			settings_errors('tgmpa');
1201 1201
 
1202
-			foreach ( (array) $wp_settings_errors as $key => $details ) {
1203
-				if ( 'tgmpa' === $details['setting'] ) {
1204
-					unset( $wp_settings_errors[ $key ] );
1202
+			foreach ((array) $wp_settings_errors as $key => $details) {
1203
+				if ('tgmpa' === $details['setting']) {
1204
+					unset($wp_settings_errors[$key]);
1205 1205
 					break;
1206 1206
 				}
1207 1207
 			}
@@ -1215,8 +1215,8 @@  discard block
 block discarded – undo
1215 1215
 		 * @since 2.1.0
1216 1216
 		 */
1217 1217
 		public function dismiss() {
1218
-			if ( isset( $_GET['tgmpa-dismiss'] ) ) {
1219
-				update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, 1 );
1218
+			if (isset($_GET['tgmpa-dismiss'])) {
1219
+				update_user_meta(get_current_user_id(), 'tgmpa_dismissed_notice_'.$this->id, 1);
1220 1220
 			}
1221 1221
 		}
1222 1222
 
@@ -1231,55 +1231,55 @@  discard block
 block discarded – undo
1231 1231
 		 * @param array|null $plugin Array of plugin arguments or null if invalid argument.
1232 1232
 		 * @return null Return early if incorrect argument.
1233 1233
 		 */
1234
-		public function register( $plugin ) {
1235
-			if ( empty( $plugin['slug'] ) || empty( $plugin['name'] ) ) {
1234
+		public function register($plugin) {
1235
+			if (empty($plugin['slug']) || empty($plugin['name'])) {
1236 1236
 				return;
1237 1237
 			}
1238 1238
 
1239
-			if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) {
1239
+			if (empty($plugin['slug']) || !is_string($plugin['slug']) || isset($this->plugins[$plugin['slug']])) {
1240 1240
 				return;
1241 1241
 			}
1242 1242
 
1243 1243
 			$defaults = array(
1244
-				'name'               => '',      // String
1245
-				'slug'               => '',      // String
1246
-				'source'             => 'repo',  // String
1247
-				'required'           => false,   // Boolean
1248
-				'version'            => '',      // String
1249
-				'force_activation'   => false,   // Boolean
1250
-				'force_deactivation' => false,   // Boolean
1251
-				'external_url'       => '',      // String
1252
-				'is_callable'        => '',      // String|Array.
1244
+				'name'               => '', // String
1245
+				'slug'               => '', // String
1246
+				'source'             => 'repo', // String
1247
+				'required'           => false, // Boolean
1248
+				'version'            => '', // String
1249
+				'force_activation'   => false, // Boolean
1250
+				'force_deactivation' => false, // Boolean
1251
+				'external_url'       => '', // String
1252
+				'is_callable'        => '', // String|Array.
1253 1253
 			);
1254 1254
 
1255 1255
 			// Prepare the received data.
1256
-			$plugin = wp_parse_args( $plugin, $defaults );
1256
+			$plugin = wp_parse_args($plugin, $defaults);
1257 1257
 
1258 1258
 			// Standardize the received slug.
1259
-			$plugin['slug'] = $this->sanitize_key( $plugin['slug'] );
1259
+			$plugin['slug'] = $this->sanitize_key($plugin['slug']);
1260 1260
 
1261 1261
 			// Forgive users for using string versions of booleans or floats for version number.
1262 1262
 			$plugin['version']            = (string) $plugin['version'];
1263
-			$plugin['source']             = empty( $plugin['source'] ) ? 'repo' : $plugin['source'];
1264
-			$plugin['required']           = TGMPA_Utils::validate_bool( $plugin['required'] );
1265
-			$plugin['force_activation']   = TGMPA_Utils::validate_bool( $plugin['force_activation'] );
1266
-			$plugin['force_deactivation'] = TGMPA_Utils::validate_bool( $plugin['force_deactivation'] );
1263
+			$plugin['source']             = empty($plugin['source']) ? 'repo' : $plugin['source'];
1264
+			$plugin['required']           = TGMPA_Utils::validate_bool($plugin['required']);
1265
+			$plugin['force_activation']   = TGMPA_Utils::validate_bool($plugin['force_activation']);
1266
+			$plugin['force_deactivation'] = TGMPA_Utils::validate_bool($plugin['force_deactivation']);
1267 1267
 
1268 1268
 			// Enrich the received data.
1269
-			$plugin['file_path']   = $this->_get_plugin_basename_from_slug( $plugin['slug'] );
1270
-			$plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] );
1269
+			$plugin['file_path']   = $this->_get_plugin_basename_from_slug($plugin['slug']);
1270
+			$plugin['source_type'] = $this->get_plugin_source_type($plugin['source']);
1271 1271
 
1272 1272
 			// Set the class properties.
1273
-			$this->plugins[ $plugin['slug'] ]    = $plugin;
1274
-			$this->sort_order[ $plugin['slug'] ] = $plugin['name'];
1273
+			$this->plugins[$plugin['slug']]    = $plugin;
1274
+			$this->sort_order[$plugin['slug']] = $plugin['name'];
1275 1275
 
1276 1276
 			// Should we add the force activation hook ?
1277
-			if ( true === $plugin['force_activation'] ) {
1277
+			if (true === $plugin['force_activation']) {
1278 1278
 				$this->has_forced_activation = true;
1279 1279
 			}
1280 1280
 
1281 1281
 			// Should we add the force deactivation hook ?
1282
-			if ( true === $plugin['force_deactivation'] ) {
1282
+			if (true === $plugin['force_deactivation']) {
1283 1283
 				$this->has_forced_deactivation = true;
1284 1284
 			}
1285 1285
 		}
@@ -1293,10 +1293,10 @@  discard block
 block discarded – undo
1293 1293
 		 *                       (= bundled) or an external URL.
1294 1294
 		 * @return string 'repo', 'external', or 'bundled'
1295 1295
 		 */
1296
-		protected function get_plugin_source_type( $source ) {
1297
-			if ( 'repo' === $source || preg_match( self::WP_REPO_REGEX, $source ) ) {
1296
+		protected function get_plugin_source_type($source) {
1297
+			if ('repo' === $source || preg_match(self::WP_REPO_REGEX, $source)) {
1298 1298
 				return 'repo';
1299
-			} elseif ( preg_match( self::IS_URL_REGEX, $source ) ) {
1299
+			} elseif (preg_match(self::IS_URL_REGEX, $source)) {
1300 1300
 				return 'external';
1301 1301
 			} else {
1302 1302
 				return 'bundled';
@@ -1317,9 +1317,9 @@  discard block
 block discarded – undo
1317 1317
 		 * @param string $key String key.
1318 1318
 		 * @return string Sanitized key
1319 1319
 		 */
1320
-		public function sanitize_key( $key ) {
1320
+		public function sanitize_key($key) {
1321 1321
 			$raw_key = $key;
1322
-			$key     = preg_replace( '`[^A-Za-z0-9_-]`', '', $key );
1322
+			$key     = preg_replace('`[^A-Za-z0-9_-]`', '', $key);
1323 1323
 
1324 1324
 			/**
1325 1325
 			* Filter a sanitized key string.
@@ -1329,7 +1329,7 @@  discard block
 block discarded – undo
1329 1329
 			* @param string $key     Sanitized key.
1330 1330
 			* @param string $raw_key The key prior to sanitization.
1331 1331
 			*/
1332
-			return apply_filters( 'tgmpa_sanitize_key', $key, $raw_key );
1332
+			return apply_filters('tgmpa_sanitize_key', $key, $raw_key);
1333 1333
 		}
1334 1334
 
1335 1335
 		/**
@@ -1339,7 +1339,7 @@  discard block
 block discarded – undo
1339 1339
 		 *
1340 1340
 		 * @param array $config Array of config options to pass as class properties.
1341 1341
 		 */
1342
-		public function config( $config ) {
1342
+		public function config($config) {
1343 1343
 			$keys = array(
1344 1344
 				'id',
1345 1345
 				'default_path',
@@ -1354,12 +1354,12 @@  discard block
 block discarded – undo
1354 1354
 				'strings',
1355 1355
 			);
1356 1356
 
1357
-			foreach ( $keys as $key ) {
1358
-				if ( isset( $config[ $key ] ) ) {
1359
-					if ( is_array( $config[ $key ] ) ) {
1360
-						$this->$key = array_merge( $this->$key, $config[ $key ] );
1357
+			foreach ($keys as $key) {
1358
+				if (isset($config[$key])) {
1359
+					if (is_array($config[$key])) {
1360
+						$this->$key = array_merge($this->$key, $config[$key]);
1361 1361
 					} else {
1362
-						$this->$key = $config[ $key ];
1362
+						$this->$key = $config[$key];
1363 1363
 					}
1364 1364
 				}
1365 1365
 			}
@@ -1373,9 +1373,9 @@  discard block
 block discarded – undo
1373 1373
 		 * @param array $install_actions Existing array of actions.
1374 1374
 		 * @return array Amended array of actions.
1375 1375
 		 */
1376
-		public function actions( $install_actions ) {
1376
+		public function actions($install_actions) {
1377 1377
 			// Remove action links on the TGMPA install page.
1378
-			if ( $this->is_tgmpa_page() ) {
1378
+			if ($this->is_tgmpa_page()) {
1379 1379
 				return false;
1380 1380
 			}
1381 1381
 
@@ -1391,8 +1391,8 @@  discard block
 block discarded – undo
1391 1391
 		 * @param bool $clear_update_cache Optional. Whether to clear the Plugin updates cache.
1392 1392
 		 *                                 Parameter added in v2.5.0.
1393 1393
 		 */
1394
-		public function flush_plugins_cache( $clear_update_cache = true ) {
1395
-			wp_clean_plugins_cache( $clear_update_cache );
1394
+		public function flush_plugins_cache($clear_update_cache = true) {
1395
+			wp_clean_plugins_cache($clear_update_cache);
1396 1396
 		}
1397 1397
 
1398 1398
 		/**
@@ -1403,13 +1403,13 @@  discard block
 block discarded – undo
1403 1403
 		 * @param string $plugin_slug Optional. If set, only (re-)populates the file path for that specific plugin.
1404 1404
 		 *                            Parameter added in v2.5.0.
1405 1405
 		 */
1406
-		public function populate_file_path( $plugin_slug = '' ) {
1407
-			if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) {
1408
-				$this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug );
1406
+		public function populate_file_path($plugin_slug = '') {
1407
+			if (!empty($plugin_slug) && is_string($plugin_slug) && isset($this->plugins[$plugin_slug])) {
1408
+				$this->plugins[$plugin_slug]['file_path'] = $this->_get_plugin_basename_from_slug($plugin_slug);
1409 1409
 			} else {
1410 1410
 				// Add file_path key for all plugins.
1411
-				foreach ( $this->plugins as $slug => $values ) {
1412
-					$this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug );
1411
+				foreach ($this->plugins as $slug => $values) {
1412
+					$this->plugins[$slug]['file_path'] = $this->_get_plugin_basename_from_slug($slug);
1413 1413
 				}
1414 1414
 			}
1415 1415
 		}
@@ -1423,11 +1423,11 @@  discard block
 block discarded – undo
1423 1423
 		 * @param string $slug Plugin slug (typically folder name) as provided by the developer.
1424 1424
 		 * @return string Either file path for plugin if installed, or just the plugin slug.
1425 1425
 		 */
1426
-		protected function _get_plugin_basename_from_slug( $slug ) {
1427
-			$keys = array_keys( $this->get_plugins() );
1426
+		protected function _get_plugin_basename_from_slug($slug) {
1427
+			$keys = array_keys($this->get_plugins());
1428 1428
 
1429
-			foreach ( $keys as $key ) {
1430
-				if ( preg_match( '|^' . $slug . '/|', $key ) ) {
1429
+			foreach ($keys as $key) {
1430
+				if (preg_match('|^'.$slug.'/|', $key)) {
1431 1431
 					return $key;
1432 1432
 				}
1433 1433
 			}
@@ -1447,10 +1447,10 @@  discard block
 block discarded – undo
1447 1447
 		 * @param string $data Optional. Array key of plugin data to return. Default is slug.
1448 1448
 		 * @return string|boolean Plugin slug if found, false otherwise.
1449 1449
 		 */
1450
-		public function _get_plugin_data_from_name( $name, $data = 'slug' ) {
1451
-			foreach ( $this->plugins as $values ) {
1452
-				if ( $name === $values['name'] && isset( $values[ $data ] ) ) {
1453
-					return $values[ $data ];
1450
+		public function _get_plugin_data_from_name($name, $data = 'slug') {
1451
+			foreach ($this->plugins as $values) {
1452
+				if ($name === $values['name'] && isset($values[$data])) {
1453
+					return $values[$data];
1454 1454
 				}
1455 1455
 			}
1456 1456
 
@@ -1465,16 +1465,16 @@  discard block
 block discarded – undo
1465 1465
 		 * @param string $slug Plugin slug.
1466 1466
 		 * @return string Plugin download URL or path to local file or empty string if undetermined.
1467 1467
 		 */
1468
-		public function get_download_url( $slug ) {
1468
+		public function get_download_url($slug) {
1469 1469
 			$dl_source = '';
1470 1470
 
1471
-			switch ( $this->plugins[ $slug ]['source_type'] ) {
1471
+			switch ($this->plugins[$slug]['source_type']) {
1472 1472
 				case 'repo':
1473
-					return $this->get_wp_repo_download_url( $slug );
1473
+					return $this->get_wp_repo_download_url($slug);
1474 1474
 				case 'external':
1475
-					return $this->plugins[ $slug ]['source'];
1475
+					return $this->plugins[$slug]['source'];
1476 1476
 				case 'bundled':
1477
-					return $this->default_path . $this->plugins[ $slug ]['source'];
1477
+					return $this->default_path.$this->plugins[$slug]['source'];
1478 1478
 			}
1479 1479
 
1480 1480
 			return $dl_source; // Should never happen.
@@ -1488,11 +1488,11 @@  discard block
 block discarded – undo
1488 1488
 		 * @param string $slug Plugin slug.
1489 1489
 		 * @return string Plugin download URL.
1490 1490
 		 */
1491
-		protected function get_wp_repo_download_url( $slug ) {
1491
+		protected function get_wp_repo_download_url($slug) {
1492 1492
 			$source = '';
1493
-			$api    = $this->get_plugins_api( $slug );
1493
+			$api    = $this->get_plugins_api($slug);
1494 1494
 
1495
-			if ( false !== $api && isset( $api->download_link ) ) {
1495
+			if (false !== $api && isset($api->download_link)) {
1496 1496
 				$source = $api->download_link;
1497 1497
 			}
1498 1498
 
@@ -1507,26 +1507,26 @@  discard block
 block discarded – undo
1507 1507
 		 * @param string $slug Plugin slug.
1508 1508
 		 * @return object Plugins_api response object on success, WP_Error on failure.
1509 1509
 		 */
1510
-		protected function get_plugins_api( $slug ) {
1510
+		protected function get_plugins_api($slug) {
1511 1511
 			static $api = array(); // Cache received responses.
1512 1512
 
1513
-			if ( ! isset( $api[ $slug ] ) ) {
1514
-				if ( ! function_exists( 'plugins_api' ) ) {
1515
-					require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
1513
+			if (!isset($api[$slug])) {
1514
+				if (!function_exists('plugins_api')) {
1515
+					require_once ABSPATH.'wp-admin/includes/plugin-install.php';
1516 1516
 				}
1517 1517
 
1518
-				$response = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) );
1518
+				$response = plugins_api('plugin_information', array('slug' => $slug, 'fields' => array('sections' => false)));
1519 1519
 
1520
-				$api[ $slug ] = false;
1520
+				$api[$slug] = false;
1521 1521
 
1522
-				if ( is_wp_error( $response ) ) {
1523
-					wp_die( esc_html( $this->strings['oops'] ) );
1522
+				if (is_wp_error($response)) {
1523
+					wp_die(esc_html($this->strings['oops']));
1524 1524
 				} else {
1525
-					$api[ $slug ] = $response;
1525
+					$api[$slug] = $response;
1526 1526
 				}
1527 1527
 			}
1528 1528
 
1529
-			return $api[ $slug ];
1529
+			return $api[$slug];
1530 1530
 		}
1531 1531
 
1532 1532
 		/**
@@ -1538,32 +1538,32 @@  discard block
 block discarded – undo
1538 1538
 		 * @return string Fully formed html link to a plugin information page if available
1539 1539
 		 *                or the plugin name if not.
1540 1540
 		 */
1541
-		public function get_info_link( $slug ) {
1542
-			if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ]['external_url'] ) ) {
1541
+		public function get_info_link($slug) {
1542
+			if (!empty($this->plugins[$slug]['external_url']) && preg_match(self::IS_URL_REGEX, $this->plugins[$slug]['external_url'])) {
1543 1543
 				$link = sprintf(
1544 1544
 					'<a href="%1$s" target="_blank">%2$s</a>',
1545
-					esc_url( $this->plugins[ $slug ]['external_url'] ),
1546
-					esc_html( $this->plugins[ $slug ]['name'] )
1545
+					esc_url($this->plugins[$slug]['external_url']),
1546
+					esc_html($this->plugins[$slug]['name'])
1547 1547
 				);
1548
-			} elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) {
1548
+			} elseif ('repo' === $this->plugins[$slug]['source_type']) {
1549 1549
 				$url = add_query_arg(
1550 1550
 					array(
1551 1551
 						'tab'       => 'plugin-information',
1552
-						'plugin'    => urlencode( $slug ),
1552
+						'plugin'    => urlencode($slug),
1553 1553
 						'TB_iframe' => 'true',
1554 1554
 						'width'     => '640',
1555 1555
 						'height'    => '500',
1556 1556
 					),
1557
-					self_admin_url( 'plugin-install.php' )
1557
+					self_admin_url('plugin-install.php')
1558 1558
 				);
1559 1559
 
1560 1560
 				$link = sprintf(
1561 1561
 					'<a href="%1$s" class="thickbox">%2$s</a>',
1562
-					esc_url( $url ),
1563
-					esc_html( $this->plugins[ $slug ]['name'] )
1562
+					esc_url($url),
1563
+					esc_html($this->plugins[$slug]['name'])
1564 1564
 				);
1565 1565
 			} else {
1566
-				$link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink.
1566
+				$link = esc_html($this->plugins[$slug]['name']); // No hyperlink.
1567 1567
 			}
1568 1568
 
1569 1569
 			return $link;
@@ -1577,7 +1577,7 @@  discard block
 block discarded – undo
1577 1577
 		 * @return boolean True when on the TGMPA page, false otherwise.
1578 1578
 		 */
1579 1579
 		protected function is_tgmpa_page() {
1580
-			return isset( $_GET['page'] ) && $this->menu === $_GET['page'];
1580
+			return isset($_GET['page']) && $this->menu === $_GET['page'];
1581 1581
 		}
1582 1582
 
1583 1583
 		/**
@@ -1593,16 +1593,16 @@  discard block
 block discarded – undo
1593 1593
 		public function get_tgmpa_url() {
1594 1594
 			static $url;
1595 1595
 
1596
-			if ( ! isset( $url ) ) {
1596
+			if (!isset($url)) {
1597 1597
 				$parent = $this->parent_slug;
1598
-				if ( false === strpos( $parent, '.php' ) ) {
1598
+				if (false === strpos($parent, '.php')) {
1599 1599
 					$parent = 'admin.php';
1600 1600
 				}
1601 1601
 				$url = add_query_arg(
1602 1602
 					array(
1603
-						'page' => urlencode( $this->menu ),
1603
+						'page' => urlencode($this->menu),
1604 1604
 					),
1605
-					self_admin_url( $parent )
1605
+					self_admin_url($parent)
1606 1606
 				);
1607 1607
 			}
1608 1608
 
@@ -1620,10 +1620,10 @@  discard block
 block discarded – undo
1620 1620
 		 * @param string $status Plugin status - either 'install', 'update' or 'activate'.
1621 1621
 		 * @return string Properly encoded URL (not escaped).
1622 1622
 		 */
1623
-		public function get_tgmpa_status_url( $status ) {
1623
+		public function get_tgmpa_status_url($status) {
1624 1624
 			return add_query_arg(
1625 1625
 				array(
1626
-					'plugin_status' => urlencode( $status ),
1626
+					'plugin_status' => urlencode($status),
1627 1627
 				),
1628 1628
 				$this->get_tgmpa_url()
1629 1629
 			);
@@ -1638,8 +1638,8 @@  discard block
 block discarded – undo
1638 1638
 		 */
1639 1639
 		public function is_tgmpa_complete() {
1640 1640
 			$complete = true;
1641
-			foreach ( $this->plugins as $slug => $plugin ) {
1642
-				if ( ! $this->is_plugin_active( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) {
1641
+			foreach ($this->plugins as $slug => $plugin) {
1642
+				if (!$this->is_plugin_active($slug) || false !== $this->does_plugin_have_update($slug)) {
1643 1643
 					$complete = false;
1644 1644
 					break;
1645 1645
 				}
@@ -1656,10 +1656,10 @@  discard block
 block discarded – undo
1656 1656
 		 * @param string $slug Plugin slug.
1657 1657
 		 * @return bool True if installed, false otherwise.
1658 1658
 		 */
1659
-		public function is_plugin_installed( $slug ) {
1659
+		public function is_plugin_installed($slug) {
1660 1660
 			$installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).
1661 1661
 
1662
-			return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) );
1662
+			return (!empty($installed_plugins[$this->plugins[$slug]['file_path']]));
1663 1663
 		}
1664 1664
 
1665 1665
 		/**
@@ -1670,8 +1670,8 @@  discard block
 block discarded – undo
1670 1670
 		 * @param string $slug Plugin slug.
1671 1671
 		 * @return bool True if active, false otherwise.
1672 1672
 		 */
1673
-		public function is_plugin_active( $slug ) {
1674
-			return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) );
1673
+		public function is_plugin_active($slug) {
1674
+			return ((!empty($this->plugins[$slug]['is_callable']) && is_callable($this->plugins[$slug]['is_callable'])) || is_plugin_active($this->plugins[$slug]['file_path']));
1675 1675
 		}
1676 1676
 
1677 1677
 		/**
@@ -1683,16 +1683,16 @@  discard block
 block discarded – undo
1683 1683
 		 * @param string $slug Plugin slug.
1684 1684
 		 * @return bool True if OK to update, false otherwise.
1685 1685
 		 */
1686
-		public function can_plugin_update( $slug ) {
1686
+		public function can_plugin_update($slug) {
1687 1687
 			// We currently can't get reliable info on non-WP-repo plugins - issue #380.
1688
-			if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
1688
+			if ('repo' !== $this->plugins[$slug]['source_type']) {
1689 1689
 				return true;
1690 1690
 			}
1691 1691
 
1692
-			$api = $this->get_plugins_api( $slug );
1692
+			$api = $this->get_plugins_api($slug);
1693 1693
 
1694
-			if ( false !== $api && isset( $api->requires ) ) {
1695
-				return version_compare( $GLOBALS['wp_version'], $api->requires, '>=' );
1694
+			if (false !== $api && isset($api->requires)) {
1695
+				return version_compare($GLOBALS['wp_version'], $api->requires, '>=');
1696 1696
 			}
1697 1697
 
1698 1698
 			// No usable info received from the plugins API, presume we can update.
@@ -1708,8 +1708,8 @@  discard block
 block discarded – undo
1708 1708
 		 * @param string $slug Plugin slug.
1709 1709
 		 * @return bool True if OK to activate, false otherwise.
1710 1710
 		 */
1711
-		public function can_plugin_activate( $slug ) {
1712
-			return ( ! $this->is_plugin_active( $slug ) && ! $this->does_plugin_require_update( $slug ) );
1711
+		public function can_plugin_activate($slug) {
1712
+			return (!$this->is_plugin_active($slug) && !$this->does_plugin_require_update($slug));
1713 1713
 		}
1714 1714
 
1715 1715
 		/**
@@ -1721,11 +1721,11 @@  discard block
 block discarded – undo
1721 1721
 		 * @return string Version number as string or an empty string if the plugin is not installed
1722 1722
 		 *                or version unknown (plugins which don't comply with the plugin header standard).
1723 1723
 		 */
1724
-		public function get_installed_version( $slug ) {
1724
+		public function get_installed_version($slug) {
1725 1725
 			$installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).
1726 1726
 
1727
-			if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) {
1728
-				return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'];
1727
+			if (!empty($installed_plugins[$this->plugins[$slug]['file_path']]['Version'])) {
1728
+				return $installed_plugins[$this->plugins[$slug]['file_path']]['Version'];
1729 1729
 			}
1730 1730
 
1731 1731
 			return '';
@@ -1739,11 +1739,11 @@  discard block
 block discarded – undo
1739 1739
 		 * @param string $slug Plugin slug.
1740 1740
 		 * @return bool True when a plugin needs to be updated, otherwise false.
1741 1741
 		 */
1742
-		public function does_plugin_require_update( $slug ) {
1743
-			$installed_version = $this->get_installed_version( $slug );
1744
-			$minimum_version   = $this->plugins[ $slug ]['version'];
1742
+		public function does_plugin_require_update($slug) {
1743
+			$installed_version = $this->get_installed_version($slug);
1744
+			$minimum_version   = $this->plugins[$slug]['version'];
1745 1745
 
1746
-			return version_compare( $minimum_version, $installed_version, '>' );
1746
+			return version_compare($minimum_version, $installed_version, '>');
1747 1747
 		}
1748 1748
 
1749 1749
 		/**
@@ -1754,20 +1754,20 @@  discard block
 block discarded – undo
1754 1754
 		 * @param string $slug Plugin slug.
1755 1755
 		 * @return false|string Version number string of the available update or false if no update available.
1756 1756
 		 */
1757
-		public function does_plugin_have_update( $slug ) {
1757
+		public function does_plugin_have_update($slug) {
1758 1758
 			// Presume bundled and external plugins will point to a package which meets the minimum required version.
1759
-			if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
1760
-				if ( $this->does_plugin_require_update( $slug ) ) {
1761
-					return $this->plugins[ $slug ]['version'];
1759
+			if ('repo' !== $this->plugins[$slug]['source_type']) {
1760
+				if ($this->does_plugin_require_update($slug)) {
1761
+					return $this->plugins[$slug]['version'];
1762 1762
 				}
1763 1763
 
1764 1764
 				return false;
1765 1765
 			}
1766 1766
 
1767
-			$repo_updates = get_site_transient( 'update_plugins' );
1767
+			$repo_updates = get_site_transient('update_plugins');
1768 1768
 
1769
-			if ( isset( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version ) ) {
1770
-				return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version;
1769
+			if (isset($repo_updates->response[$this->plugins[$slug]['file_path']]->new_version)) {
1770
+				return $repo_updates->response[$this->plugins[$slug]['file_path']]->new_version;
1771 1771
 			}
1772 1772
 
1773 1773
 			return false;
@@ -1781,16 +1781,16 @@  discard block
 block discarded – undo
1781 1781
 		 * @param string $slug Plugin slug.
1782 1782
 		 * @return string The upgrade notice or an empty string if no message was available or provided.
1783 1783
 		 */
1784
-		public function get_upgrade_notice( $slug ) {
1784
+		public function get_upgrade_notice($slug) {
1785 1785
 			// We currently can't get reliable info on non-WP-repo plugins - issue #380.
1786
-			if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
1786
+			if ('repo' !== $this->plugins[$slug]['source_type']) {
1787 1787
 				return '';
1788 1788
 			}
1789 1789
 
1790
-			$repo_updates = get_site_transient( 'update_plugins' );
1790
+			$repo_updates = get_site_transient('update_plugins');
1791 1791
 
1792
-			if ( ! empty( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice ) ) {
1793
-				return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice;
1792
+			if (!empty($repo_updates->response[$this->plugins[$slug]['file_path']]->upgrade_notice)) {
1793
+				return $repo_updates->response[$this->plugins[$slug]['file_path']]->upgrade_notice;
1794 1794
 			}
1795 1795
 
1796 1796
 			return '';
@@ -1804,12 +1804,12 @@  discard block
 block discarded – undo
1804 1804
 		 * @param string $plugin_folder Optional. Relative path to single plugin folder.
1805 1805
 		 * @return array Array of installed plugins with plugin information.
1806 1806
 		 */
1807
-		public function get_plugins( $plugin_folder = '' ) {
1808
-			if ( ! function_exists( 'get_plugins' ) ) {
1809
-				require_once ABSPATH . 'wp-admin/includes/plugin.php';
1807
+		public function get_plugins($plugin_folder = '') {
1808
+			if (!function_exists('get_plugins')) {
1809
+				require_once ABSPATH.'wp-admin/includes/plugin.php';
1810 1810
 			}
1811 1811
 
1812
-			return get_plugins( $plugin_folder );
1812
+			return get_plugins($plugin_folder);
1813 1813
 		}
1814 1814
 
1815 1815
 		/**
@@ -1821,7 +1821,7 @@  discard block
 block discarded – undo
1821 1821
 		 * @since 2.1.1
1822 1822
 		 */
1823 1823
 		public function update_dismiss() {
1824
-			delete_metadata( 'user', null, 'tgmpa_dismissed_notice_' . $this->id, null, true );
1824
+			delete_metadata('user', null, 'tgmpa_dismissed_notice_'.$this->id, null, true);
1825 1825
 		}
1826 1826
 
1827 1827
 		/**
@@ -1839,14 +1839,14 @@  discard block
 block discarded – undo
1839 1839
 		 * @since 2.2.0
1840 1840
 		 */
1841 1841
 		public function force_activation() {
1842
-			foreach ( $this->plugins as $slug => $plugin ) {
1843
-				if ( true === $plugin['force_activation'] ) {
1844
-					if ( ! $this->is_plugin_installed( $slug ) ) {
1842
+			foreach ($this->plugins as $slug => $plugin) {
1843
+				if (true === $plugin['force_activation']) {
1844
+					if (!$this->is_plugin_installed($slug)) {
1845 1845
 						// Oops, plugin isn't there so iterate to next condition.
1846 1846
 						continue;
1847
-					} elseif ( $this->can_plugin_activate( $slug ) ) {
1847
+					} elseif ($this->can_plugin_activate($slug)) {
1848 1848
 						// There we go, activate the plugin.
1849
-						activate_plugin( $plugin['file_path'] );
1849
+						activate_plugin($plugin['file_path']);
1850 1850
 					}
1851 1851
 				}
1852 1852
 			}
@@ -1865,10 +1865,10 @@  discard block
 block discarded – undo
1865 1865
 		 * @since 2.2.0
1866 1866
 		 */
1867 1867
 		public function force_deactivation() {
1868
-			foreach ( $this->plugins as $slug => $plugin ) {
1868
+			foreach ($this->plugins as $slug => $plugin) {
1869 1869
 				// Only proceed forward if the parameter is set to true and plugin is active.
1870
-				if ( true === $plugin['force_deactivation'] && $this->is_plugin_active( $slug ) ) {
1871
-					deactivate_plugins( $plugin['file_path'] );
1870
+				if (true === $plugin['force_deactivation'] && $this->is_plugin_active($slug)) {
1871
+					deactivate_plugins($plugin['file_path']);
1872 1872
 				}
1873 1873
 			}
1874 1874
 		}
@@ -1878,7 +1878,7 @@  discard block
 block discarded – undo
1878 1878
 		 */
1879 1879
 		public function show_tgmpa_version() {
1880 1880
 			echo '<p style="float: right; padding: 0em 1.5em 0.5em 0;"><strong><small>',
1881
-				esc_html( sprintf( _x( 'TGMPA v%s', '%s = version number', 'tgmpa' ), self::TGMPA_VERSION ) ),
1881
+				esc_html(sprintf(_x('TGMPA v%s', '%s = version number', 'tgmpa'), self::TGMPA_VERSION)),
1882 1882
 				'</small></strong></p>';
1883 1883
 		}
1884 1884
 
@@ -1890,7 +1890,7 @@  discard block
 block discarded – undo
1890 1890
 		 * @return object The TGM_Plugin_Activation object.
1891 1891
 		 */
1892 1892
 		public static function get_instance() {
1893
-			if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {
1893
+			if (!isset(self::$instance) && !(self::$instance instanceof self)) {
1894 1894
 				self::$instance = new self();
1895 1895
 			}
1896 1896
 
@@ -1898,7 +1898,7 @@  discard block
 block discarded – undo
1898 1898
 		}
1899 1899
 	}
1900 1900
 
1901
-	if ( ! function_exists( 'load_tgm_plugin_activation' ) ) {
1901
+	if (!function_exists('load_tgm_plugin_activation')) {
1902 1902
 		/**
1903 1903
 		 * Ensure only one instance of the class is ever invoked.
1904 1904
 		 */
@@ -1907,14 +1907,14 @@  discard block
 block discarded – undo
1907 1907
 		}
1908 1908
 	}
1909 1909
 
1910
-	if ( did_action( 'plugins_loaded' ) ) {
1910
+	if (did_action('plugins_loaded')) {
1911 1911
 		load_tgm_plugin_activation();
1912 1912
 	} else {
1913
-		add_action( 'plugins_loaded', 'load_tgm_plugin_activation' );
1913
+		add_action('plugins_loaded', 'load_tgm_plugin_activation');
1914 1914
 	}
1915 1915
 }
1916 1916
 
1917
-if ( ! function_exists( 'tgmpa' ) ) {
1917
+if (!function_exists('tgmpa')) {
1918 1918
 	/**
1919 1919
 	 * Helper function to register a collection of required plugins.
1920 1920
 	 *
@@ -1924,30 +1924,30 @@  discard block
 block discarded – undo
1924 1924
 	 * @param array $plugins An array of plugin arrays.
1925 1925
 	 * @param array $config  Optional. An array of configuration values.
1926 1926
 	 */
1927
-	function tgmpa( $plugins, $config = array() ) {
1928
-		$instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
1927
+	function tgmpa($plugins, $config = array()) {
1928
+		$instance = call_user_func(array(get_class($GLOBALS['tgmpa']), 'get_instance'));
1929 1929
 
1930
-		foreach ( $plugins as $plugin ) {
1931
-			call_user_func( array( $instance, 'register' ), $plugin );
1930
+		foreach ($plugins as $plugin) {
1931
+			call_user_func(array($instance, 'register'), $plugin);
1932 1932
 		}
1933 1933
 
1934
-		if ( ! empty( $config ) && is_array( $config ) ) {
1934
+		if (!empty($config) && is_array($config)) {
1935 1935
 			// Send out notices for deprecated arguments passed.
1936
-			if ( isset( $config['notices'] ) ) {
1937
-				_deprecated_argument( __FUNCTION__, '2.2.0', 'The `notices` config parameter was renamed to `has_notices` in TGMPA 2.2.0. Please adjust your configuration.' );
1938
-				if ( ! isset( $config['has_notices'] ) ) {
1936
+			if (isset($config['notices'])) {
1937
+				_deprecated_argument(__FUNCTION__, '2.2.0', 'The `notices` config parameter was renamed to `has_notices` in TGMPA 2.2.0. Please adjust your configuration.');
1938
+				if (!isset($config['has_notices'])) {
1939 1939
 					$config['has_notices'] = $config['notices'];
1940 1940
 				}
1941 1941
 			}
1942 1942
 
1943
-			if ( isset( $config['parent_menu_slug'] ) ) {
1944
-				_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.' );
1943
+			if (isset($config['parent_menu_slug'])) {
1944
+				_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.');
1945 1945
 			}
1946
-			if ( isset( $config['parent_url_slug'] ) ) {
1947
-				_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.' );
1946
+			if (isset($config['parent_url_slug'])) {
1947
+				_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.');
1948 1948
 			}
1949 1949
 
1950
-			call_user_func( array( $instance, 'config' ), $config );
1950
+			call_user_func(array($instance, 'config'), $config);
1951 1951
 		}
1952 1952
 	}
1953 1953
 }
@@ -1958,11 +1958,11 @@  discard block
 block discarded – undo
1958 1958
  *
1959 1959
  * @since 2.2.0
1960 1960
  */
1961
-if ( ! class_exists( 'WP_List_Table' ) ) {
1962
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
1961
+if (!class_exists('WP_List_Table')) {
1962
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
1963 1963
 }
1964 1964
 
1965
-if ( ! class_exists( 'TGMPA_List_Table' ) ) {
1965
+if (!class_exists('TGMPA_List_Table')) {
1966 1966
 
1967 1967
 	/**
1968 1968
 	 * List table class for handling plugins.
@@ -2020,7 +2020,7 @@  discard block
 block discarded – undo
2020 2020
 		 * @since 2.2.0
2021 2021
 		 */
2022 2022
 		public function __construct() {
2023
-			$this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
2023
+			$this->tgmpa = call_user_func(array(get_class($GLOBALS['tgmpa']), 'get_instance'));
2024 2024
 
2025 2025
 			parent::__construct(
2026 2026
 				array(
@@ -2030,11 +2030,11 @@  discard block
 block discarded – undo
2030 2030
 				)
2031 2031
 			);
2032 2032
 
2033
-			if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'install', 'update', 'activate' ), true ) ) {
2034
-				$this->view_context = sanitize_key( $_REQUEST['plugin_status'] );
2033
+			if (isset($_REQUEST['plugin_status']) && in_array($_REQUEST['plugin_status'], array('install', 'update', 'activate'), true)) {
2034
+				$this->view_context = sanitize_key($_REQUEST['plugin_status']);
2035 2035
 			}
2036 2036
 
2037
-			add_filter( 'tgmpa_table_data_items', array( $this, 'sort_table_items' ) );
2037
+			add_filter('tgmpa_table_data_items', array($this, 'sort_table_items'));
2038 2038
 		}
2039 2039
 
2040 2040
 		/**
@@ -2047,7 +2047,7 @@  discard block
 block discarded – undo
2047 2047
 		 * @return array CSS classnames.
2048 2048
 		 */
2049 2049
 		public function get_table_classes() {
2050
-			return array( 'widefat', 'fixed' );
2050
+			return array('widefat', 'fixed');
2051 2051
 		}
2052 2052
 
2053 2053
 		/**
@@ -2066,37 +2066,37 @@  discard block
 block discarded – undo
2066 2066
 			$plugins = $this->categorize_plugins_to_views();
2067 2067
 
2068 2068
 			// Set the counts for the view links.
2069
-			$this->set_view_totals( $plugins );
2069
+			$this->set_view_totals($plugins);
2070 2070
 
2071 2071
 			// Prep variables for use and grab list of all installed plugins.
2072 2072
 			$table_data = array();
2073 2073
 			$i          = 0;
2074 2074
 
2075 2075
 			// Redirect to the 'all' view if no plugins were found for the selected view context.
2076
-			if ( empty( $plugins[ $this->view_context ] ) ) {
2076
+			if (empty($plugins[$this->view_context])) {
2077 2077
 				$this->view_context = 'all';
2078 2078
 			}
2079 2079
 
2080
-			foreach ( $plugins[ $this->view_context ] as $slug => $plugin ) {
2081
-				$table_data[ $i ]['sanitized_plugin']  = $plugin['name'];
2082
-				$table_data[ $i ]['slug']              = $slug;
2083
-				$table_data[ $i ]['plugin']            = '<strong>' . $this->tgmpa->get_info_link( $slug ) . '</strong>';
2084
-				$table_data[ $i ]['source']            = $this->get_plugin_source_type_text( $plugin['source_type'] );
2085
-				$table_data[ $i ]['type']              = $this->get_plugin_advise_type_text( $plugin['required'] );
2086
-				$table_data[ $i ]['status']            = $this->get_plugin_status_text( $slug );
2087
-				$table_data[ $i ]['installed_version'] = $this->tgmpa->get_installed_version( $slug );
2088
-				$table_data[ $i ]['minimum_version']   = $plugin['version'];
2089
-				$table_data[ $i ]['available_version'] = $this->tgmpa->does_plugin_have_update( $slug );
2080
+			foreach ($plugins[$this->view_context] as $slug => $plugin) {
2081
+				$table_data[$i]['sanitized_plugin']  = $plugin['name'];
2082
+				$table_data[$i]['slug']              = $slug;
2083
+				$table_data[$i]['plugin']            = '<strong>'.$this->tgmpa->get_info_link($slug).'</strong>';
2084
+				$table_data[$i]['source']            = $this->get_plugin_source_type_text($plugin['source_type']);
2085
+				$table_data[$i]['type']              = $this->get_plugin_advise_type_text($plugin['required']);
2086
+				$table_data[$i]['status']            = $this->get_plugin_status_text($slug);
2087
+				$table_data[$i]['installed_version'] = $this->tgmpa->get_installed_version($slug);
2088
+				$table_data[$i]['minimum_version']   = $plugin['version'];
2089
+				$table_data[$i]['available_version'] = $this->tgmpa->does_plugin_have_update($slug);
2090 2090
 
2091 2091
 				// Prep the upgrade notice info.
2092
-				$upgrade_notice = $this->tgmpa->get_upgrade_notice( $slug );
2093
-				if ( ! empty( $upgrade_notice ) ) {
2094
-					$table_data[ $i ]['upgrade_notice'] = $upgrade_notice;
2092
+				$upgrade_notice = $this->tgmpa->get_upgrade_notice($slug);
2093
+				if (!empty($upgrade_notice)) {
2094
+					$table_data[$i]['upgrade_notice'] = $upgrade_notice;
2095 2095
 
2096
-					add_action( "tgmpa_after_plugin_row_$slug", array( $this, 'wp_plugin_update_row' ), 10, 2 );
2096
+					add_action("tgmpa_after_plugin_row_$slug", array($this, 'wp_plugin_update_row'), 10, 2);
2097 2097
 				}
2098 2098
 
2099
-				$table_data[ $i ] = apply_filters( 'tgmpa_table_data_item', $table_data[ $i ], $plugin );
2099
+				$table_data[$i] = apply_filters('tgmpa_table_data_item', $table_data[$i], $plugin);
2100 2100
 
2101 2101
 				$i++;
2102 2102
 			}
@@ -2117,22 +2117,22 @@  discard block
 block discarded – undo
2117 2117
 				'activate' => array(),
2118 2118
 			);
2119 2119
 
2120
-			foreach ( $this->tgmpa->plugins as $slug => $plugin ) {
2121
-				if ( $this->tgmpa->is_plugin_active( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) {
2120
+			foreach ($this->tgmpa->plugins as $slug => $plugin) {
2121
+				if ($this->tgmpa->is_plugin_active($slug) && false === $this->tgmpa->does_plugin_have_update($slug)) {
2122 2122
 					// No need to display plugins if they are installed, up-to-date and active.
2123 2123
 					continue;
2124 2124
 				} else {
2125
-					$plugins['all'][ $slug ] = $plugin;
2125
+					$plugins['all'][$slug] = $plugin;
2126 2126
 
2127
-					if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) {
2128
-						$plugins['install'][ $slug ] = $plugin;
2127
+					if (!$this->tgmpa->is_plugin_installed($slug)) {
2128
+						$plugins['install'][$slug] = $plugin;
2129 2129
 					} else {
2130
-						if ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) {
2131
-							$plugins['update'][ $slug ] = $plugin;
2130
+						if (false !== $this->tgmpa->does_plugin_have_update($slug)) {
2131
+							$plugins['update'][$slug] = $plugin;
2132 2132
 						}
2133 2133
 
2134
-						if ( $this->tgmpa->can_plugin_activate( $slug ) ) {
2135
-							$plugins['activate'][ $slug ] = $plugin;
2134
+						if ($this->tgmpa->can_plugin_activate($slug)) {
2135
+							$plugins['activate'][$slug] = $plugin;
2136 2136
 						}
2137 2137
 					}
2138 2138
 				}
@@ -2148,9 +2148,9 @@  discard block
 block discarded – undo
2148 2148
 		 *
2149 2149
 		 * @param array $plugins Plugins order by view.
2150 2150
 		 */
2151
-		protected function set_view_totals( $plugins ) {
2152
-			foreach ( $plugins as $type => $list ) {
2153
-				$this->view_totals[ $type ] = count( $list );
2151
+		protected function set_view_totals($plugins) {
2152
+			foreach ($plugins as $type => $list) {
2153
+				$this->view_totals[$type] = count($list);
2154 2154
 			}
2155 2155
 		}
2156 2156
 
@@ -2162,12 +2162,12 @@  discard block
 block discarded – undo
2162 2162
 		 * @param string $required Plugin required setting.
2163 2163
 		 * @return string
2164 2164
 		 */
2165
-		protected function get_plugin_advise_type_text( $required ) {
2166
-			if ( true === $required ) {
2167
-				return __( 'Required', 'tgmpa' );
2165
+		protected function get_plugin_advise_type_text($required) {
2166
+			if (true === $required) {
2167
+				return __('Required', 'tgmpa');
2168 2168
 			}
2169 2169
 
2170
-			return __( 'Recommended', 'tgmpa' );
2170
+			return __('Recommended', 'tgmpa');
2171 2171
 		}
2172 2172
 
2173 2173
 		/**
@@ -2178,18 +2178,18 @@  discard block
 block discarded – undo
2178 2178
 		 * @param string $type Plugin type.
2179 2179
 		 * @return string
2180 2180
 		 */
2181
-		protected function get_plugin_source_type_text( $type ) {
2181
+		protected function get_plugin_source_type_text($type) {
2182 2182
 			$string = '';
2183 2183
 
2184
-			switch ( $type ) {
2184
+			switch ($type) {
2185 2185
 				case 'repo':
2186
-					$string = __( 'WordPress Repository', 'tgmpa' );
2186
+					$string = __('WordPress Repository', 'tgmpa');
2187 2187
 					break;
2188 2188
 				case 'external':
2189
-					$string = __( 'External Source', 'tgmpa' );
2189
+					$string = __('External Source', 'tgmpa');
2190 2190
 					break;
2191 2191
 				case 'bundled':
2192
-					$string = __( 'Pre-Packaged', 'tgmpa' );
2192
+					$string = __('Pre-Packaged', 'tgmpa');
2193 2193
 					break;
2194 2194
 			}
2195 2195
 
@@ -2204,35 +2204,35 @@  discard block
 block discarded – undo
2204 2204
 		 * @param string $slug Plugin slug.
2205 2205
 		 * @return string
2206 2206
 		 */
2207
-		protected function get_plugin_status_text( $slug ) {
2208
-			if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) {
2209
-				return __( 'Not Installed', 'tgmpa' );
2207
+		protected function get_plugin_status_text($slug) {
2208
+			if (!$this->tgmpa->is_plugin_installed($slug)) {
2209
+				return __('Not Installed', 'tgmpa');
2210 2210
 			}
2211 2211
 
2212
-			if ( ! $this->tgmpa->is_plugin_active( $slug ) ) {
2213
-				$install_status = __( 'Installed But Not Activated', 'tgmpa' );
2212
+			if (!$this->tgmpa->is_plugin_active($slug)) {
2213
+				$install_status = __('Installed But Not Activated', 'tgmpa');
2214 2214
 			} else {
2215
-				$install_status = __( 'Active', 'tgmpa' );
2215
+				$install_status = __('Active', 'tgmpa');
2216 2216
 			}
2217 2217
 
2218 2218
 			$update_status = '';
2219 2219
 
2220
-			if ( $this->tgmpa->does_plugin_require_update( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) {
2221
-				$update_status = __( 'Required Update not Available', 'tgmpa' );
2220
+			if ($this->tgmpa->does_plugin_require_update($slug) && false === $this->tgmpa->does_plugin_have_update($slug)) {
2221
+				$update_status = __('Required Update not Available', 'tgmpa');
2222 2222
 
2223
-			} elseif ( $this->tgmpa->does_plugin_require_update( $slug ) ) {
2224
-				$update_status = __( 'Requires Update', 'tgmpa' );
2223
+			} elseif ($this->tgmpa->does_plugin_require_update($slug)) {
2224
+				$update_status = __('Requires Update', 'tgmpa');
2225 2225
 
2226
-			} elseif ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) {
2227
-				$update_status = __( 'Update recommended', 'tgmpa' );
2226
+			} elseif (false !== $this->tgmpa->does_plugin_have_update($slug)) {
2227
+				$update_status = __('Update recommended', 'tgmpa');
2228 2228
 			}
2229 2229
 
2230
-			if ( '' === $update_status ) {
2230
+			if ('' === $update_status) {
2231 2231
 				return $install_status;
2232 2232
 			}
2233 2233
 
2234 2234
 			return sprintf(
2235
-				_x( '%1$s, %2$s', '%1$s = install status, %2$s = update status', 'tgmpa' ),
2235
+				_x('%1$s, %2$s', '%1$s = install status, %2$s = update status', 'tgmpa'),
2236 2236
 				$install_status,
2237 2237
 				$update_status
2238 2238
 			);
@@ -2246,16 +2246,16 @@  discard block
 block discarded – undo
2246 2246
 		 * @param array $items Prepared table items.
2247 2247
 		 * @return array Sorted table items.
2248 2248
 		 */
2249
-		public function sort_table_items( $items ) {
2249
+		public function sort_table_items($items) {
2250 2250
 			$type = array();
2251 2251
 			$name = array();
2252 2252
 
2253
-			foreach ( $items as $i => $plugin ) {
2254
-				$type[ $i ] = $plugin['type']; // Required / recommended.
2255
-				$name[ $i ] = $plugin['sanitized_plugin'];
2253
+			foreach ($items as $i => $plugin) {
2254
+				$type[$i] = $plugin['type']; // Required / recommended.
2255
+				$name[$i] = $plugin['sanitized_plugin'];
2256 2256
 			}
2257 2257
 
2258
-			array_multisort( $type, SORT_DESC, $name, SORT_ASC, $items );
2258
+			array_multisort($type, SORT_DESC, $name, SORT_ASC, $items);
2259 2259
 
2260 2260
 			return $items;
2261 2261
 		}
@@ -2270,36 +2270,36 @@  discard block
 block discarded – undo
2270 2270
 		public function get_views() {
2271 2271
 			$status_links = array();
2272 2272
 
2273
-			foreach ( $this->view_totals as $type => $count ) {
2274
-				if ( $count < 1 ) {
2273
+			foreach ($this->view_totals as $type => $count) {
2274
+				if ($count < 1) {
2275 2275
 					continue;
2276 2276
 				}
2277 2277
 
2278
-				switch ( $type ) {
2278
+				switch ($type) {
2279 2279
 					case 'all':
2280
-						$text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'plugins', 'tgmpa' );
2280
+						$text = _nx('All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'plugins', 'tgmpa');
2281 2281
 						break;
2282 2282
 					case 'install':
2283
-						$text = _n( 'To Install <span class="count">(%s)</span>', 'To Install <span class="count">(%s)</span>', $count, 'tgmpa' );
2283
+						$text = _n('To Install <span class="count">(%s)</span>', 'To Install <span class="count">(%s)</span>', $count, 'tgmpa');
2284 2284
 						break;
2285 2285
 					case 'update':
2286
-						$text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count, 'tgmpa' );
2286
+						$text = _n('Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count, 'tgmpa');
2287 2287
 						break;
2288 2288
 					case 'activate':
2289
-						$text = _n( 'To Activate <span class="count">(%s)</span>', 'To Activate <span class="count">(%s)</span>', $count, 'tgmpa' );
2289
+						$text = _n('To Activate <span class="count">(%s)</span>', 'To Activate <span class="count">(%s)</span>', $count, 'tgmpa');
2290 2290
 						break;
2291 2291
 					default:
2292 2292
 						$text = '';
2293 2293
 						break;
2294 2294
 				}
2295 2295
 
2296
-				if ( ! empty( $text ) ) {
2296
+				if (!empty($text)) {
2297 2297
 
2298
-					$status_links[ $type ] = sprintf(
2298
+					$status_links[$type] = sprintf(
2299 2299
 						'<a href="%s"%s>%s</a>',
2300
-						esc_url( $this->tgmpa->get_tgmpa_status_url( $type ) ),
2301
-						( $type === $this->view_context ) ? ' class="current"' : '',
2302
-						sprintf( $text, number_format_i18n( $count ) )
2300
+						esc_url($this->tgmpa->get_tgmpa_status_url($type)),
2301
+						($type === $this->view_context) ? ' class="current"' : '',
2302
+						sprintf($text, number_format_i18n($count))
2303 2303
 					);
2304 2304
 				}
2305 2305
 			}
@@ -2317,8 +2317,8 @@  discard block
 block discarded – undo
2317 2317
 		 * @param string $column_name The name of the column.
2318 2318
 		 * @return string
2319 2319
 		 */
2320
-		public function column_default( $item, $column_name ) {
2321
-			return $item[ $column_name ];
2320
+		public function column_default($item, $column_name) {
2321
+			return $item[$column_name];
2322 2322
 		}
2323 2323
 
2324 2324
 		/**
@@ -2331,12 +2331,12 @@  discard block
 block discarded – undo
2331 2331
 		 * @param array $item Array of item data.
2332 2332
 		 * @return string The input checkbox with all necessary info.
2333 2333
 		 */
2334
-		public function column_cb( $item ) {
2334
+		public function column_cb($item) {
2335 2335
 			return sprintf(
2336 2336
 				'<input type="checkbox" name="%1$s[]" value="%2$s" id="%3$s" />',
2337
-				esc_attr( $this->_args['singular'] ),
2338
-				esc_attr( $item['slug'] ),
2339
-				esc_attr( $item['sanitized_plugin'] )
2337
+				esc_attr($this->_args['singular']),
2338
+				esc_attr($item['slug']),
2339
+				esc_attr($item['sanitized_plugin'])
2340 2340
 			);
2341 2341
 		}
2342 2342
 
@@ -2348,11 +2348,11 @@  discard block
 block discarded – undo
2348 2348
 		 * @param array $item Array of item data.
2349 2349
 		 * @return string The plugin name and action links.
2350 2350
 		 */
2351
-		public function column_plugin( $item ) {
2351
+		public function column_plugin($item) {
2352 2352
 			return sprintf(
2353 2353
 				'%1$s %2$s',
2354 2354
 				$item['plugin'],
2355
-				$this->row_actions( $this->get_row_actions( $item ), true )
2355
+				$this->row_actions($this->get_row_actions($item), true)
2356 2356
 			);
2357 2357
 		}
2358 2358
 
@@ -2364,48 +2364,48 @@  discard block
 block discarded – undo
2364 2364
 		 * @param array $item Array of item data.
2365 2365
 		 * @return string HTML-formatted version information.
2366 2366
 		 */
2367
-		public function column_version( $item ) {
2367
+		public function column_version($item) {
2368 2368
 			$output = array();
2369 2369
 
2370
-			if ( $this->tgmpa->is_plugin_installed( $item['slug'] ) ) {
2371
-				$installed = ! empty( $item['installed_version'] ) ? $item['installed_version'] : _x( 'unknown', 'as in: "version nr unknown"', 'tgmpa' );
2370
+			if ($this->tgmpa->is_plugin_installed($item['slug'])) {
2371
+				$installed = !empty($item['installed_version']) ? $item['installed_version'] : _x('unknown', 'as in: "version nr unknown"', 'tgmpa');
2372 2372
 
2373 2373
 				$color = '';
2374
-				if ( ! empty( $item['minimum_version'] ) && $this->tgmpa->does_plugin_require_update( $item['slug'] ) ) {
2374
+				if (!empty($item['minimum_version']) && $this->tgmpa->does_plugin_require_update($item['slug'])) {
2375 2375
 					$color = ' color: #ff0000; font-weight: bold;';
2376 2376
 				}
2377 2377
 
2378 2378
 				$output[] = sprintf(
2379
-					'<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Installed version:', 'tgmpa' ) . '</p>',
2379
+					'<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>'.__('Installed version:', 'tgmpa').'</p>',
2380 2380
 					$color,
2381 2381
 					$installed
2382 2382
 				);
2383 2383
 			}
2384 2384
 
2385
-			if ( ! empty( $item['minimum_version'] ) ) {
2385
+			if (!empty($item['minimum_version'])) {
2386 2386
 				$output[] = sprintf(
2387
-					'<p><span style="min-width: 32px; text-align: right; float: right;">%1$s</span>' . __( 'Minimum required version:', 'tgmpa' ) . '</p>',
2387
+					'<p><span style="min-width: 32px; text-align: right; float: right;">%1$s</span>'.__('Minimum required version:', 'tgmpa').'</p>',
2388 2388
 					$item['minimum_version']
2389 2389
 				);
2390 2390
 			}
2391 2391
 
2392
-			if ( ! empty( $item['available_version'] ) ) {
2392
+			if (!empty($item['available_version'])) {
2393 2393
 				$color = '';
2394
-				if ( ! empty( $item['minimum_version'] ) && version_compare( $item['available_version'], $item['minimum_version'], '>=' ) ) {
2394
+				if (!empty($item['minimum_version']) && version_compare($item['available_version'], $item['minimum_version'], '>=')) {
2395 2395
 					$color = ' color: #71C671; font-weight: bold;';
2396 2396
 				}
2397 2397
 
2398 2398
 				$output[] = sprintf(
2399
-					'<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Available version:', 'tgmpa' ) . '</p>',
2399
+					'<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>'.__('Available version:', 'tgmpa').'</p>',
2400 2400
 					$color,
2401 2401
 					$item['available_version']
2402 2402
 				);
2403 2403
 			}
2404 2404
 
2405
-			if ( empty( $output ) ) {
2405
+			if (empty($output)) {
2406 2406
 				return '&nbsp;'; // Let's not break the table layout.
2407 2407
 			} else {
2408
-				return implode( "\n", $output );
2408
+				return implode("\n", $output);
2409 2409
 			}
2410 2410
 		}
2411 2411
 
@@ -2419,7 +2419,7 @@  discard block
 block discarded – undo
2419 2419
 		 * @since 2.2.0
2420 2420
 		 */
2421 2421
 		public function no_items() {
2422
-			printf( wp_kses_post( __( 'No plugins to install, update or activate. <a href="%1$s">Return to the Dashboard</a>', 'tgmpa' ) ), esc_url( self_admin_url() ) );
2422
+			printf(wp_kses_post(__('No plugins to install, update or activate. <a href="%1$s">Return to the Dashboard</a>', 'tgmpa')), esc_url(self_admin_url()));
2423 2423
 			echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
2424 2424
 		}
2425 2425
 
@@ -2433,17 +2433,17 @@  discard block
 block discarded – undo
2433 2433
 		public function get_columns() {
2434 2434
 			$columns = array(
2435 2435
 				'cb'     => '<input type="checkbox" />',
2436
-				'plugin' => __( 'Plugin', 'tgmpa' ),
2437
-				'source' => __( 'Source', 'tgmpa' ),
2438
-				'type'   => __( 'Type', 'tgmpa' ),
2436
+				'plugin' => __('Plugin', 'tgmpa'),
2437
+				'source' => __('Source', 'tgmpa'),
2438
+				'type'   => __('Type', 'tgmpa'),
2439 2439
 			);
2440 2440
 
2441
-			if ( 'all' === $this->view_context || 'update' === $this->view_context ) {
2442
-				$columns['version'] = __( 'Version', 'tgmpa' );
2443
-				$columns['status']  = __( 'Status', 'tgmpa' );
2441
+			if ('all' === $this->view_context || 'update' === $this->view_context) {
2442
+				$columns['version'] = __('Version', 'tgmpa');
2443
+				$columns['status']  = __('Status', 'tgmpa');
2444 2444
 			}
2445 2445
 
2446
-			return apply_filters( 'tgmpa_table_columns', $columns );
2446
+			return apply_filters('tgmpa_table_columns', $columns);
2447 2447
 		}
2448 2448
 
2449 2449
 		/**
@@ -2467,7 +2467,7 @@  discard block
 block discarded – undo
2467 2467
 		 * @return string The name of the primary column.
2468 2468
 		 */
2469 2469
 		protected function get_primary_column_name() {
2470
-			if ( method_exists( 'WP_List_Table', 'get_primary_column_name' ) ) {
2470
+			if (method_exists('WP_List_Table', 'get_primary_column_name')) {
2471 2471
 				return parent::get_primary_column_name();
2472 2472
 			} else {
2473 2473
 				return $this->get_default_primary_column_name();
@@ -2482,48 +2482,48 @@  discard block
 block discarded – undo
2482 2482
 		 * @param array $item Array of item data.
2483 2483
 		 * @return array Array with relevant action links.
2484 2484
 		 */
2485
-		protected function get_row_actions( $item ) {
2485
+		protected function get_row_actions($item) {
2486 2486
 			$actions      = array();
2487 2487
 			$action_links = array();
2488 2488
 
2489 2489
 			// Display the 'Install' action link if the plugin is not yet available.
2490
-			if ( ! $this->tgmpa->is_plugin_installed( $item['slug'] ) ) {
2491
-				$actions['install'] = _x( 'Install %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa' );
2490
+			if (!$this->tgmpa->is_plugin_installed($item['slug'])) {
2491
+				$actions['install'] = _x('Install %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa');
2492 2492
 			} else {
2493 2493
 				// Display the 'Update' action link if an update is available and WP complies with plugin minimum.
2494
-				if ( false !== $this->tgmpa->does_plugin_have_update( $item['slug'] ) && $this->tgmpa->can_plugin_update( $item['slug'] ) ) {
2495
-					$actions['update'] = _x( 'Update %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa' );
2494
+				if (false !== $this->tgmpa->does_plugin_have_update($item['slug']) && $this->tgmpa->can_plugin_update($item['slug'])) {
2495
+					$actions['update'] = _x('Update %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa');
2496 2496
 				}
2497 2497
 
2498 2498
 				// Display the 'Activate' action link, but only if the plugin meets the minimum version.
2499
-				if ( $this->tgmpa->can_plugin_activate( $item['slug'] ) ) {
2500
-					$actions['activate'] = _x( 'Activate %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa' );
2499
+				if ($this->tgmpa->can_plugin_activate($item['slug'])) {
2500
+					$actions['activate'] = _x('Activate %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa');
2501 2501
 				}
2502 2502
 			}
2503 2503
 
2504 2504
 			// Create the actual links.
2505
-			foreach ( $actions as $action => $text ) {
2505
+			foreach ($actions as $action => $text) {
2506 2506
 				$nonce_url = wp_nonce_url(
2507 2507
 					add_query_arg(
2508 2508
 						array(
2509
-							'plugin'           => urlencode( $item['slug'] ),
2510
-							'tgmpa-' . $action => $action . '-plugin',
2509
+							'plugin'           => urlencode($item['slug']),
2510
+							'tgmpa-'.$action => $action.'-plugin',
2511 2511
 						),
2512 2512
 						$this->tgmpa->get_tgmpa_url()
2513 2513
 					),
2514
-					'tgmpa-' . $action,
2514
+					'tgmpa-'.$action,
2515 2515
 					'tgmpa-nonce'
2516 2516
 				);
2517 2517
 
2518
-				$action_links[ $action ] = sprintf(
2519
-					'<a href="%1$s">' . esc_html( $text ) . '</a>',
2520
-					esc_url( $nonce_url ),
2521
-					'<span class="screen-reader-text">' . esc_html( $item['sanitized_plugin'] ) . '</span>'
2518
+				$action_links[$action] = sprintf(
2519
+					'<a href="%1$s">'.esc_html($text).'</a>',
2520
+					esc_url($nonce_url),
2521
+					'<span class="screen-reader-text">'.esc_html($item['sanitized_plugin']).'</span>'
2522 2522
 				);
2523 2523
 			}
2524 2524
 
2525
-			$prefix = ( defined( 'WP_NETWORK_ADMIN' ) && WP_NETWORK_ADMIN ) ? 'network_admin_' : '';
2526
-			return apply_filters( "tgmpa_{$prefix}plugin_action_links", array_filter( $action_links ), $item['slug'], $item, $this->view_context );
2525
+			$prefix = (defined('WP_NETWORK_ADMIN') && WP_NETWORK_ADMIN) ? 'network_admin_' : '';
2526
+			return apply_filters("tgmpa_{$prefix}plugin_action_links", array_filter($action_links), $item['slug'], $item, $this->view_context);
2527 2527
 		}
2528 2528
 
2529 2529
 		/**
@@ -2533,8 +2533,8 @@  discard block
 block discarded – undo
2533 2533
 		 *
2534 2534
 		 * @param object $item The current item.
2535 2535
 		 */
2536
-		public function single_row( $item ) {
2537
-			parent::single_row( $item );
2536
+		public function single_row($item) {
2537
+			parent::single_row($item);
2538 2538
 
2539 2539
 			/**
2540 2540
 			 * Fires after each specific row in the TGMPA Plugins list table.
@@ -2544,7 +2544,7 @@  discard block
 block discarded – undo
2544 2544
 			 *
2545 2545
 			 * @since 2.5.0
2546 2546
 			 */
2547
-			do_action( "tgmpa_after_plugin_row_{$item['slug']}", $item['slug'], $item, $this->view_context );
2547
+			do_action("tgmpa_after_plugin_row_{$item['slug']}", $item['slug'], $item, $this->view_context);
2548 2548
 		}
2549 2549
 
2550 2550
 		/**
@@ -2558,17 +2558,17 @@  discard block
 block discarded – undo
2558 2558
 		 * @param array  $item The information available in this table row.
2559 2559
 		 * @return null Return early if upgrade notice is empty.
2560 2560
 		 */
2561
-		public function wp_plugin_update_row( $slug, $item ) {
2562
-			if ( empty( $item['upgrade_notice'] ) ) {
2561
+		public function wp_plugin_update_row($slug, $item) {
2562
+			if (empty($item['upgrade_notice'])) {
2563 2563
 				return;
2564 2564
 			}
2565 2565
 
2566 2566
 			echo '
2567 2567
 				<tr class="plugin-update-tr">
2568
-					<td colspan="', absint( $this->get_column_count() ), '" class="plugin-update colspanchange">
2568
+					<td colspan="', absint($this->get_column_count()), '" class="plugin-update colspanchange">
2569 2569
 						<div class="update-message">',
2570
-							esc_html__( 'Upgrade message from the plugin author:', 'tgmpa' ),
2571
-							' <strong>', wp_kses_data( $item['upgrade_notice'] ), '</strong>
2570
+							esc_html__('Upgrade message from the plugin author:', 'tgmpa'),
2571
+							' <strong>', wp_kses_data($item['upgrade_notice']), '</strong>
2572 2572
 						</div>
2573 2573
 					</td>
2574 2574
 				</tr>';
@@ -2581,8 +2581,8 @@  discard block
 block discarded – undo
2581 2581
 		 *
2582 2582
 		 * @param string $which 'top' or 'bottom' table navigation.
2583 2583
 		 */
2584
-		public function extra_tablenav( $which ) {
2585
-			if ( 'bottom' === $which ) {
2584
+		public function extra_tablenav($which) {
2585
+			if ('bottom' === $which) {
2586 2586
 				$this->tgmpa->show_tgmpa_version();
2587 2587
 			}
2588 2588
 		}
@@ -2598,18 +2598,18 @@  discard block
 block discarded – undo
2598 2598
 
2599 2599
 			$actions = array();
2600 2600
 
2601
-			if ( 'update' !== $this->view_context && 'activate' !== $this->view_context ) {
2602
-				if ( current_user_can( 'install_plugins' ) ) {
2603
-					$actions['tgmpa-bulk-install'] = __( 'Install', 'tgmpa' );
2601
+			if ('update' !== $this->view_context && 'activate' !== $this->view_context) {
2602
+				if (current_user_can('install_plugins')) {
2603
+					$actions['tgmpa-bulk-install'] = __('Install', 'tgmpa');
2604 2604
 				}
2605 2605
 			}
2606 2606
 
2607
-			if ( 'install' !== $this->view_context ) {
2608
-				if ( current_user_can( 'update_plugins' ) ) {
2609
-					$actions['tgmpa-bulk-update'] = __( 'Update', 'tgmpa' );
2607
+			if ('install' !== $this->view_context) {
2608
+				if (current_user_can('update_plugins')) {
2609
+					$actions['tgmpa-bulk-update'] = __('Update', 'tgmpa');
2610 2610
 				}
2611
-				if ( current_user_can( 'activate_plugins' ) ) {
2612
-					$actions['tgmpa-bulk-activate'] = __( 'Activate', 'tgmpa' );
2611
+				if (current_user_can('activate_plugins')) {
2612
+					$actions['tgmpa-bulk-activate'] = __('Activate', 'tgmpa');
2613 2613
 				}
2614 2614
 			}
2615 2615
 
@@ -2626,64 +2626,64 @@  discard block
 block discarded – undo
2626 2626
 		 */
2627 2627
 		public function process_bulk_actions() {
2628 2628
 			// Bulk installation process.
2629
-			if ( 'tgmpa-bulk-install' === $this->current_action() || 'tgmpa-bulk-update' === $this->current_action() ) {
2629
+			if ('tgmpa-bulk-install' === $this->current_action() || 'tgmpa-bulk-update' === $this->current_action()) {
2630 2630
 
2631
-				check_admin_referer( 'bulk-' . $this->_args['plural'] );
2631
+				check_admin_referer('bulk-'.$this->_args['plural']);
2632 2632
 
2633 2633
 				$install_type = 'install';
2634
-				if ( 'tgmpa-bulk-update' === $this->current_action() ) {
2634
+				if ('tgmpa-bulk-update' === $this->current_action()) {
2635 2635
 					$install_type = 'update';
2636 2636
 				}
2637 2637
 
2638 2638
 				$plugins_to_install = array();
2639 2639
 
2640 2640
 				// Did user actually select any plugins to install/update ?
2641
-				if ( empty( $_POST['plugin'] ) ) {
2642
-					if ( 'install' === $install_type ) {
2643
-						$message = __( 'No plugins were selected to be installed. No action taken.', 'tgmpa' );
2641
+				if (empty($_POST['plugin'])) {
2642
+					if ('install' === $install_type) {
2643
+						$message = __('No plugins were selected to be installed. No action taken.', 'tgmpa');
2644 2644
 					} else {
2645
-						$message = __( 'No plugins were selected to be updated. No action taken.', 'tgmpa' );
2645
+						$message = __('No plugins were selected to be updated. No action taken.', 'tgmpa');
2646 2646
 					}
2647 2647
 
2648
-					echo '<div id="message" class="error"><p>', esc_html( $message ), '</p></div>';
2648
+					echo '<div id="message" class="error"><p>', esc_html($message), '</p></div>';
2649 2649
 
2650 2650
 					return false;
2651 2651
 				}
2652 2652
 
2653
-				if ( is_array( $_POST['plugin'] ) ) {
2653
+				if (is_array($_POST['plugin'])) {
2654 2654
 					$plugins_to_install = (array) $_POST['plugin'];
2655
-				} elseif ( is_string( $_POST['plugin'] ) ) {
2655
+				} elseif (is_string($_POST['plugin'])) {
2656 2656
 					// Received via Filesystem page - un-flatten array (WP bug #19643).
2657
-					$plugins_to_install = explode( ',', $_POST['plugin'] );
2657
+					$plugins_to_install = explode(',', $_POST['plugin']);
2658 2658
 				}
2659 2659
 
2660 2660
 				// Sanitize the received input.
2661
-				$plugins_to_install = array_map( 'urldecode', $plugins_to_install );
2662
-				$plugins_to_install = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins_to_install );
2661
+				$plugins_to_install = array_map('urldecode', $plugins_to_install);
2662
+				$plugins_to_install = array_map(array($this->tgmpa, 'sanitize_key'), $plugins_to_install);
2663 2663
 
2664 2664
 				// Validate the received input.
2665
-				foreach ( $plugins_to_install as $key => $slug ) {
2665
+				foreach ($plugins_to_install as $key => $slug) {
2666 2666
 					// Check if the plugin was registered with TGMPA and remove if not.
2667
-					if ( ! isset( $this->tgmpa->plugins[ $slug ] ) ) {
2668
-						unset( $plugins_to_install[ $key ] );
2667
+					if (!isset($this->tgmpa->plugins[$slug])) {
2668
+						unset($plugins_to_install[$key]);
2669 2669
 						continue;
2670 2670
 					}
2671 2671
 
2672 2672
 					// For updates: make sure this is a plugin we *can* update (update available and WP version ok).
2673
-					if ( 'update' === $install_type && ( $this->tgmpa->is_plugin_installed( $slug ) && ( false === $this->tgmpa->does_plugin_have_update( $slug ) || ! $this->tgmpa->can_plugin_update( $slug ) ) ) ) {
2674
-						unset( $plugins_to_install[ $key ] );
2673
+					if ('update' === $install_type && ($this->tgmpa->is_plugin_installed($slug) && (false === $this->tgmpa->does_plugin_have_update($slug) || !$this->tgmpa->can_plugin_update($slug)))) {
2674
+						unset($plugins_to_install[$key]);
2675 2675
 					}
2676 2676
 				}
2677 2677
 
2678 2678
 				// No need to proceed further if we have no plugins to handle.
2679
-				if ( empty( $plugins_to_install ) ) {
2680
-					if ( 'install' === $install_type ) {
2681
-						$message = __( 'No plugins are available to be installed at this time.', 'tgmpa' );
2679
+				if (empty($plugins_to_install)) {
2680
+					if ('install' === $install_type) {
2681
+						$message = __('No plugins are available to be installed at this time.', 'tgmpa');
2682 2682
 					} else {
2683
-						$message = __( 'No plugins are available to be updated at this time.', 'tgmpa' );
2683
+						$message = __('No plugins are available to be updated at this time.', 'tgmpa');
2684 2684
 					}
2685 2685
 
2686
-					echo '<div id="message" class="error"><p>', esc_html( $message ), '</p></div>';
2686
+					echo '<div id="message" class="error"><p>', esc_html($message), '</p></div>';
2687 2687
 
2688 2688
 					return false;
2689 2689
 				}
@@ -2691,23 +2691,23 @@  discard block
 block discarded – undo
2691 2691
 				// Pass all necessary information if WP_Filesystem is needed.
2692 2692
 				$url = wp_nonce_url(
2693 2693
 					$this->tgmpa->get_tgmpa_url(),
2694
-					'bulk-' . $this->_args['plural']
2694
+					'bulk-'.$this->_args['plural']
2695 2695
 				);
2696 2696
 
2697 2697
 				// Give validated data back to $_POST which is the only place the filesystem looks for extra fields.
2698
-				$_POST['plugin'] = implode( ',', $plugins_to_install ); // Work around for WP bug #19643.
2698
+				$_POST['plugin'] = implode(',', $plugins_to_install); // Work around for WP bug #19643.
2699 2699
 
2700 2700
 				$method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
2701
-				$fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem.
2701
+				$fields = array_keys($_POST); // Extra fields to pass to WP_Filesystem.
2702 2702
 
2703
-				if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, $fields ) ) ) {
2703
+				if (false === ($creds = request_filesystem_credentials(esc_url_raw($url), $method, false, false, $fields))) {
2704 2704
 					return true; // Stop the normal page form from displaying, credential request form will be shown.
2705 2705
 				}
2706 2706
 
2707 2707
 				// Now we have some credentials, setup WP_Filesystem.
2708
-				if ( ! WP_Filesystem( $creds ) ) {
2708
+				if (!WP_Filesystem($creds)) {
2709 2709
 					// Our credentials were no good, ask the user for them again.
2710
-					request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields );
2710
+					request_filesystem_credentials(esc_url_raw($url), $method, true, false, $fields);
2711 2711
 
2712 2712
 					return true;
2713 2713
 				}
@@ -2721,35 +2721,35 @@  discard block
 block discarded – undo
2721 2721
 				$to_inject  = array(); // Information to inject into the update_plugins transient.
2722 2722
 
2723 2723
 				// Prepare the data for validated plugins for the install/upgrade.
2724
-				foreach ( $plugins_to_install as $slug ) {
2725
-					$name   = $this->tgmpa->plugins[ $slug ]['name'];
2726
-					$source = $this->tgmpa->get_download_url( $slug );
2724
+				foreach ($plugins_to_install as $slug) {
2725
+					$name   = $this->tgmpa->plugins[$slug]['name'];
2726
+					$source = $this->tgmpa->get_download_url($slug);
2727 2727
 
2728
-					if ( ! empty( $name ) && ! empty( $source ) ) {
2728
+					if (!empty($name) && !empty($source)) {
2729 2729
 						$names[] = $name;
2730 2730
 
2731
-						switch ( $install_type ) {
2731
+						switch ($install_type) {
2732 2732
 
2733 2733
 							case 'install':
2734 2734
 								$sources[] = $source;
2735 2735
 								break;
2736 2736
 
2737 2737
 							case 'update':
2738
-								$file_paths[]                 = $this->tgmpa->plugins[ $slug ]['file_path'];
2739
-								$to_inject[ $slug ]           = $this->tgmpa->plugins[ $slug ];
2740
-								$to_inject[ $slug ]['source'] = $source;
2738
+								$file_paths[]                 = $this->tgmpa->plugins[$slug]['file_path'];
2739
+								$to_inject[$slug]           = $this->tgmpa->plugins[$slug];
2740
+								$to_inject[$slug]['source'] = $source;
2741 2741
 								break;
2742 2742
 						}
2743 2743
 					}
2744 2744
 				}
2745
-				unset( $slug, $name, $source );
2745
+				unset($slug, $name, $source);
2746 2746
 
2747 2747
 				// Create a new instance of TGMPA_Bulk_Installer.
2748 2748
 				$installer = new TGMPA_Bulk_Installer(
2749 2749
 					new TGMPA_Bulk_Installer_Skin(
2750 2750
 						array(
2751
-							'url'          => esc_url_raw( $this->tgmpa->get_tgmpa_url() ),
2752
-							'nonce'        => 'bulk-' . $this->_args['plural'],
2751
+							'url'          => esc_url_raw($this->tgmpa->get_tgmpa_url()),
2752
+							'nonce'        => 'bulk-'.$this->_args['plural'],
2753 2753
 							'names'        => $names,
2754 2754
 							'install_type' => $install_type,
2755 2755
 						)
@@ -2758,21 +2758,21 @@  discard block
 block discarded – undo
2758 2758
 
2759 2759
 				// Wrap the install process with the appropriate HTML.
2760 2760
 				echo '<div class="tgmpa wrap">',
2761
-					'<h2>', esc_html( get_admin_page_title() ), '</h2>';
2761
+					'<h2>', esc_html(get_admin_page_title()), '</h2>';
2762 2762
 
2763 2763
 				// Process the bulk installation submissions.
2764
-				add_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1, 3 );
2764
+				add_filter('upgrader_source_selection', array($this->tgmpa, 'maybe_adjust_source_dir'), 1, 3);
2765 2765
 
2766
-				if ( 'tgmpa-bulk-update' === $this->current_action() ) {
2766
+				if ('tgmpa-bulk-update' === $this->current_action()) {
2767 2767
 					// Inject our info into the update transient.
2768
-					$this->tgmpa->inject_update_info( $to_inject );
2768
+					$this->tgmpa->inject_update_info($to_inject);
2769 2769
 
2770
-					$installer->bulk_upgrade( $file_paths );
2770
+					$installer->bulk_upgrade($file_paths);
2771 2771
 				} else {
2772
-					$installer->bulk_install( $sources );
2772
+					$installer->bulk_install($sources);
2773 2773
 				}
2774 2774
 
2775
-				remove_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1, 3 );
2775
+				remove_filter('upgrader_source_selection', array($this->tgmpa, 'maybe_adjust_source_dir'), 1, 3);
2776 2776
 
2777 2777
 				echo '</div>';
2778 2778
 
@@ -2780,70 +2780,70 @@  discard block
 block discarded – undo
2780 2780
 			}
2781 2781
 
2782 2782
 			// Bulk activation process.
2783
-			if ( 'tgmpa-bulk-activate' === $this->current_action() ) {
2784
-				check_admin_referer( 'bulk-' . $this->_args['plural'] );
2783
+			if ('tgmpa-bulk-activate' === $this->current_action()) {
2784
+				check_admin_referer('bulk-'.$this->_args['plural']);
2785 2785
 
2786 2786
 				// Did user actually select any plugins to activate ?
2787
-				if ( empty( $_POST['plugin'] ) ) {
2788
-					echo '<div id="message" class="error"><p>', esc_html__( 'No plugins were selected to be activated. No action taken.', 'tgmpa' ), '</p></div>';
2787
+				if (empty($_POST['plugin'])) {
2788
+					echo '<div id="message" class="error"><p>', esc_html__('No plugins were selected to be activated. No action taken.', 'tgmpa'), '</p></div>';
2789 2789
 
2790 2790
 					return false;
2791 2791
 				}
2792 2792
 
2793 2793
 				// Grab plugin data from $_POST.
2794 2794
 				$plugins = array();
2795
-				if ( isset( $_POST['plugin'] ) ) {
2796
-					$plugins = array_map( 'urldecode', (array) $_POST['plugin'] );
2797
-					$plugins = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins );
2795
+				if (isset($_POST['plugin'])) {
2796
+					$plugins = array_map('urldecode', (array) $_POST['plugin']);
2797
+					$plugins = array_map(array($this->tgmpa, 'sanitize_key'), $plugins);
2798 2798
 				}
2799 2799
 
2800 2800
 				$plugins_to_activate = array();
2801 2801
 				$plugin_names        = array();
2802 2802
 
2803 2803
 				// Grab the file paths for the selected & inactive plugins from the registration array.
2804
-				foreach ( $plugins as $slug ) {
2805
-					if ( $this->tgmpa->can_plugin_activate( $slug ) ) {
2806
-						$plugins_to_activate[] = $this->tgmpa->plugins[ $slug ]['file_path'];
2807
-						$plugin_names[]        = $this->tgmpa->plugins[ $slug ]['name'];
2804
+				foreach ($plugins as $slug) {
2805
+					if ($this->tgmpa->can_plugin_activate($slug)) {
2806
+						$plugins_to_activate[] = $this->tgmpa->plugins[$slug]['file_path'];
2807
+						$plugin_names[]        = $this->tgmpa->plugins[$slug]['name'];
2808 2808
 					}
2809 2809
 				}
2810
-				unset( $slug );
2810
+				unset($slug);
2811 2811
 
2812 2812
 				// Return early if there are no plugins to activate.
2813
-				if ( empty( $plugins_to_activate ) ) {
2814
-					echo '<div id="message" class="error"><p>', esc_html__( 'No plugins are available to be activated at this time.', 'tgmpa' ), '</p></div>';
2813
+				if (empty($plugins_to_activate)) {
2814
+					echo '<div id="message" class="error"><p>', esc_html__('No plugins are available to be activated at this time.', 'tgmpa'), '</p></div>';
2815 2815
 
2816 2816
 					return false;
2817 2817
 				}
2818 2818
 
2819 2819
 				// Now we are good to go - let's start activating plugins.
2820
-				$activate = activate_plugins( $plugins_to_activate );
2820
+				$activate = activate_plugins($plugins_to_activate);
2821 2821
 
2822
-				if ( is_wp_error( $activate ) ) {
2823
-					echo '<div id="message" class="error"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>';
2822
+				if (is_wp_error($activate)) {
2823
+					echo '<div id="message" class="error"><p>', wp_kses_post($activate->get_error_message()), '</p></div>';
2824 2824
 				} else {
2825
-					$count        = count( $plugin_names ); // Count so we can use _n function.
2826
-					$plugin_names = array_map( array( 'TGMPA_Utils', 'wrap_in_strong' ), $plugin_names );
2827
-					$last_plugin  = array_pop( $plugin_names ); // Pop off last name to prep for readability.
2828
-					$imploded     = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'tgmpa' ) . ' ' . $last_plugin );
2825
+					$count        = count($plugin_names); // Count so we can use _n function.
2826
+					$plugin_names = array_map(array('TGMPA_Utils', 'wrap_in_strong'), $plugin_names);
2827
+					$last_plugin  = array_pop($plugin_names); // Pop off last name to prep for readability.
2828
+					$imploded     = empty($plugin_names) ? $last_plugin : (implode(', ', $plugin_names).' '.esc_html_x('and', 'plugin A *and* plugin B', 'tgmpa').' '.$last_plugin);
2829 2829
 
2830 2830
 					printf( // WPCS: xss ok.
2831 2831
 						'<div id="message" class="updated"><p>%1$s %2$s.</p></div>',
2832
-						esc_html( _n( 'The following plugin was activated successfully:', 'The following plugins were activated successfully:', $count, 'tgmpa' ) ),
2832
+						esc_html(_n('The following plugin was activated successfully:', 'The following plugins were activated successfully:', $count, 'tgmpa')),
2833 2833
 						$imploded
2834 2834
 					);
2835 2835
 
2836 2836
 					// Update recently activated plugins option.
2837
-					$recent = (array) get_option( 'recently_activated' );
2838
-					foreach ( $plugins_to_activate as $plugin => $time ) {
2839
-						if ( isset( $recent[ $plugin ] ) ) {
2840
-							unset( $recent[ $plugin ] );
2837
+					$recent = (array) get_option('recently_activated');
2838
+					foreach ($plugins_to_activate as $plugin => $time) {
2839
+						if (isset($recent[$plugin])) {
2840
+							unset($recent[$plugin]);
2841 2841
 						}
2842 2842
 					}
2843
-					update_option( 'recently_activated', $recent );
2843
+					update_option('recently_activated', $recent);
2844 2844
 				}
2845 2845
 
2846
-				unset( $_POST ); // Reset the $_POST variable in case user wants to perform one action after another.
2846
+				unset($_POST); // Reset the $_POST variable in case user wants to perform one action after another.
2847 2847
 
2848 2848
 				return true;
2849 2849
 			}
@@ -2861,15 +2861,15 @@  discard block
 block discarded – undo
2861 2861
 			$hidden                = array(); // No columns to hide, but we must set as an array.
2862 2862
 			$sortable              = array(); // No reason to make sortable columns.
2863 2863
 			$primary               = $this->get_primary_column_name(); // Column which has the row actions.
2864
-			$this->_column_headers = array( $columns, $hidden, $sortable, $primary ); // Get all necessary column headers.
2864
+			$this->_column_headers = array($columns, $hidden, $sortable, $primary); // Get all necessary column headers.
2865 2865
 
2866 2866
 			// Process our bulk activations here.
2867
-			if ( 'tgmpa-bulk-activate' === $this->current_action() ) {
2867
+			if ('tgmpa-bulk-activate' === $this->current_action()) {
2868 2868
 				$this->process_bulk_actions();
2869 2869
 			}
2870 2870
 
2871 2871
 			// Store all of our plugin data into $items array so WP_List_Table can use it.
2872
-			$this->items = apply_filters( 'tgmpa_table_data_items', $this->_gather_plugin_data() );
2872
+			$this->items = apply_filters('tgmpa_table_data_items', $this->_gather_plugin_data());
2873 2873
 		}
2874 2874
 
2875 2875
 		/* *********** DEPRECATED METHODS *********** */
@@ -2885,16 +2885,16 @@  discard block
 block discarded – undo
2885 2885
 		 * @param string $data Optional. Array key of plugin data to return. Default is slug.
2886 2886
 		 * @return string|boolean Plugin slug if found, false otherwise.
2887 2887
 		 */
2888
-		protected function _get_plugin_data_from_name( $name, $data = 'slug' ) {
2889
-			_deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'TGM_Plugin_Activation::_get_plugin_data_from_name()' );
2888
+		protected function _get_plugin_data_from_name($name, $data = 'slug') {
2889
+			_deprecated_function(__FUNCTION__, 'TGMPA 2.5.0', 'TGM_Plugin_Activation::_get_plugin_data_from_name()');
2890 2890
 
2891
-			return $this->tgmpa->_get_plugin_data_from_name( $name, $data );
2891
+			return $this->tgmpa->_get_plugin_data_from_name($name, $data);
2892 2892
 		}
2893 2893
 	}
2894 2894
 }
2895 2895
 
2896 2896
 
2897
-if ( ! class_exists( 'TGM_Bulk_Installer' ) ) {
2897
+if (!class_exists('TGM_Bulk_Installer')) {
2898 2898
 
2899 2899
 	/**
2900 2900
 	 * Hack: Prevent TGMPA v2.4.1- bulk installer class from being loaded if 2.4.1- is loaded after 2.5+.
@@ -2902,7 +2902,7 @@  discard block
 block discarded – undo
2902 2902
 	class TGM_Bulk_Installer {
2903 2903
 	}
2904 2904
 }
2905
-if ( ! class_exists( 'TGM_Bulk_Installer_Skin' ) ) {
2905
+if (!class_exists('TGM_Bulk_Installer_Skin')) {
2906 2906
 
2907 2907
 	/**
2908 2908
 	 * Hack: Prevent TGMPA v2.4.1- bulk installer skin class from being loaded if 2.4.1- is loaded after 2.5+.
@@ -2921,26 +2921,26 @@  discard block
 block discarded – undo
2921 2921
  *
2922 2922
  * @since 2.2.0
2923 2923
  */
2924
-add_action( 'admin_init', 'tgmpa_load_bulk_installer' );
2925
-if ( ! function_exists( 'tgmpa_load_bulk_installer' ) ) {
2924
+add_action('admin_init', 'tgmpa_load_bulk_installer');
2925
+if (!function_exists('tgmpa_load_bulk_installer')) {
2926 2926
 	/**
2927 2927
 	 * Load bulk installer
2928 2928
 	 */
2929 2929
 	function tgmpa_load_bulk_installer() {
2930 2930
 		// Silently fail if 2.5+ is loaded *after* an older version.
2931
-		if ( ! isset( $GLOBALS['tgmpa'] ) ) {
2931
+		if (!isset($GLOBALS['tgmpa'])) {
2932 2932
 			return;
2933 2933
 		}
2934 2934
 
2935 2935
 		// Get TGMPA class instance.
2936
-		$tgmpa_instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
2936
+		$tgmpa_instance = call_user_func(array(get_class($GLOBALS['tgmpa']), 'get_instance'));
2937 2937
 
2938
-		if ( isset( $_GET['page'] ) && $tgmpa_instance->menu === $_GET['page'] ) {
2939
-			if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
2940
-				require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
2938
+		if (isset($_GET['page']) && $tgmpa_instance->menu === $_GET['page']) {
2939
+			if (!class_exists('Plugin_Upgrader', false)) {
2940
+				require_once ABSPATH.'wp-admin/includes/class-wp-upgrader.php';
2941 2941
 			}
2942 2942
 
2943
-			if ( ! class_exists( 'TGMPA_Bulk_Installer' ) ) {
2943
+			if (!class_exists('TGMPA_Bulk_Installer')) {
2944 2944
 
2945 2945
 				/**
2946 2946
 				 * Installer class to handle bulk plugin installations.
@@ -3002,21 +3002,21 @@  discard block
 block discarded – undo
3002 3002
 					 *
3003 3003
 					 * @param \Bulk_Upgrader_Skin|null $skin Installer skin.
3004 3004
 					 */
3005
-					public function __construct( $skin = null ) {
3005
+					public function __construct($skin = null) {
3006 3006
 						// Get TGMPA class instance.
3007
-						$this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
3007
+						$this->tgmpa = call_user_func(array(get_class($GLOBALS['tgmpa']), 'get_instance'));
3008 3008
 
3009
-						parent::__construct( $skin );
3009
+						parent::__construct($skin);
3010 3010
 
3011
-						if ( isset( $this->skin->options['install_type'] ) && 'update' === $this->skin->options['install_type'] ) {
3011
+						if (isset($this->skin->options['install_type']) && 'update' === $this->skin->options['install_type']) {
3012 3012
 							$this->clear_destination = true;
3013 3013
 						}
3014 3014
 
3015
-						if ( $this->tgmpa->is_automatic ) {
3015
+						if ($this->tgmpa->is_automatic) {
3016 3016
 							$this->activate_strings();
3017 3017
 						}
3018 3018
 
3019
-						add_action( 'upgrader_process_complete', array( $this->tgmpa, 'populate_file_path' ) );
3019
+						add_action('upgrader_process_complete', array($this->tgmpa, 'populate_file_path'));
3020 3020
 					}
3021 3021
 
3022 3022
 					/**
@@ -3025,8 +3025,8 @@  discard block
 block discarded – undo
3025 3025
 					 * @since 2.2.0
3026 3026
 					 */
3027 3027
 					public function activate_strings() {
3028
-						$this->strings['activation_failed']  = __( 'Plugin activation failed.', 'tgmpa' );
3029
-						$this->strings['activation_success'] = __( 'Plugin activated successfully.', 'tgmpa' );
3028
+						$this->strings['activation_failed']  = __('Plugin activation failed.', 'tgmpa');
3029
+						$this->strings['activation_success'] = __('Plugin activated successfully.', 'tgmpa');
3030 3030
 					}
3031 3031
 
3032 3032
 					/**
@@ -3039,12 +3039,12 @@  discard block
 block discarded – undo
3039 3039
 					 * @param array $options The installation config options.
3040 3040
 					 * @return null|array Return early if error, array of installation data on success.
3041 3041
 					 */
3042
-					public function run( $options ) {
3043
-						$result = parent::run( $options );
3042
+					public function run($options) {
3043
+						$result = parent::run($options);
3044 3044
 
3045 3045
 						// Reset the strings in case we changed one during automatic activation.
3046
-						if ( $this->tgmpa->is_automatic ) {
3047
-							if ( 'update' === $this->skin->options['install_type'] ) {
3046
+						if ($this->tgmpa->is_automatic) {
3047
+							if ('update' === $this->skin->options['install_type']) {
3048 3048
 								$this->upgrade_strings();
3049 3049
 							} else {
3050 3050
 								$this->install_strings();
@@ -3071,14 +3071,14 @@  discard block
 block discarded – undo
3071 3071
 					 * @param array $args    Arbitrary passed extra arguments.
3072 3072
 					 * @return string|bool Install confirmation messages on success, false on failure.
3073 3073
 					 */
3074
-					public function bulk_install( $plugins, $args = array() ) {
3074
+					public function bulk_install($plugins, $args = array()) {
3075 3075
 						// [TGMPA + ] Hook auto-activation in.
3076
-						add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
3076
+						add_filter('upgrader_post_install', array($this, 'auto_activate'), 10);
3077 3077
 
3078 3078
 						$defaults    = array(
3079 3079
 							'clear_update_cache' => true,
3080 3080
 						);
3081
-						$parsed_args = wp_parse_args( $args, $defaults );
3081
+						$parsed_args = wp_parse_args($args, $defaults);
3082 3082
 
3083 3083
 						$this->init();
3084 3084
 						$this->bulk = true;
@@ -3092,8 +3092,8 @@  discard block
 block discarded – undo
3092 3092
 						$this->skin->header();
3093 3093
 
3094 3094
 						// Connect to the Filesystem first.
3095
-						$res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) );
3096
-						if ( ! $res ) {
3095
+						$res = $this->fs_connect(array(WP_CONTENT_DIR, WP_PLUGIN_DIR));
3096
+						if (!$res) {
3097 3097
 							$this->skin->footer();
3098 3098
 
3099 3099
 							return false;
@@ -3105,22 +3105,22 @@  discard block
 block discarded – undo
3105 3105
 						// - running Multisite and there are one or more plugins specified, OR
3106 3106
 						// - a plugin with an update available is currently active.
3107 3107
 						// @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible.
3108
-						$maintenance = ( is_multisite() && ! empty( $plugins ) );
3108
+						$maintenance = (is_multisite() && !empty($plugins));
3109 3109
 
3110 3110
 						/*
3111 3111
 						[TGMPA - ]
3112 3112
 						foreach ( $plugins as $plugin )
3113 3113
 							$maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin] ) );
3114 3114
 						*/
3115
-						if ( $maintenance ) {
3116
-							$this->maintenance_mode( true );
3115
+						if ($maintenance) {
3116
+							$this->maintenance_mode(true);
3117 3117
 						}
3118 3118
 
3119 3119
 						$results = array();
3120 3120
 
3121
-						$this->update_count   = count( $plugins );
3121
+						$this->update_count   = count($plugins);
3122 3122
 						$this->update_current = 0;
3123
-						foreach ( $plugins as $plugin ) {
3123
+						foreach ($plugins as $plugin) {
3124 3124
 							$this->update_current++;
3125 3125
 
3126 3126
 							/*
@@ -3142,7 +3142,7 @@  discard block
 block discarded – undo
3142 3142
 							$this->skin->plugin_active = is_plugin_active($plugin);
3143 3143
 							*/
3144 3144
 
3145
-							$result = $this->run( array(
3145
+							$result = $this->run(array(
3146 3146
 								'package'           => $plugin, // [TGMPA + ] adjusted.
3147 3147
 								'destination'       => WP_PLUGIN_DIR,
3148 3148
 								'clear_destination' => false, // [TGMPA + ] adjusted.
@@ -3151,17 +3151,17 @@  discard block
 block discarded – undo
3151 3151
 								'hook_extra'        => array(
3152 3152
 									'plugin' => $plugin,
3153 3153
 								),
3154
-							) );
3154
+							));
3155 3155
 
3156
-							$results[ $plugin ] = $this->result;
3156
+							$results[$plugin] = $this->result;
3157 3157
 
3158 3158
 							// Prevent credentials auth screen from displaying multiple times.
3159
-							if ( false === $result ) {
3159
+							if (false === $result) {
3160 3160
 								break;
3161 3161
 							}
3162 3162
 						} //end foreach $plugins
3163 3163
 
3164
-						$this->maintenance_mode( false );
3164
+						$this->maintenance_mode(false);
3165 3165
 
3166 3166
 						/**
3167 3167
 						 * Fires when the bulk upgrader process is complete.
@@ -3179,12 +3179,12 @@  discard block
 block discarded – undo
3179 3179
 						 *     @type array  $packages Array of plugin, theme, or core packages to update.
3180 3180
 						 * }
3181 3181
 						 */
3182
-						do_action( 'upgrader_process_complete', $this, array(
3182
+						do_action('upgrader_process_complete', $this, array(
3183 3183
 							'action'  => 'install', // [TGMPA + ] adjusted.
3184 3184
 							'type'    => 'plugin',
3185 3185
 							'bulk'    => true,
3186 3186
 							'plugins' => $plugins,
3187
-						) );
3187
+						));
3188 3188
 
3189 3189
 						$this->skin->bulk_footer();
3190 3190
 
@@ -3194,10 +3194,10 @@  discard block
 block discarded – undo
3194 3194
 						/* [TGMPA - ] remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); */
3195 3195
 
3196 3196
 						// [TGMPA + ] Remove our auto-activation hook.
3197
-						remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
3197
+						remove_filter('upgrader_post_install', array($this, 'auto_activate'), 10);
3198 3198
 
3199 3199
 						// Force refresh of plugin update information.
3200
-						wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
3200
+						wp_clean_plugins_cache($parsed_args['clear_update_cache']);
3201 3201
 
3202 3202
 						return $results;
3203 3203
 					}
@@ -3213,13 +3213,13 @@  discard block
 block discarded – undo
3213 3213
 					 * @param array $args    Arbitrary passed extra arguments.
3214 3214
 					 * @return string|bool Install confirmation messages on success, false on failure.
3215 3215
 					 */
3216
-					public function bulk_upgrade( $plugins, $args = array() ) {
3216
+					public function bulk_upgrade($plugins, $args = array()) {
3217 3217
 
3218
-						add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
3218
+						add_filter('upgrader_post_install', array($this, 'auto_activate'), 10);
3219 3219
 
3220
-						$result = parent::bulk_upgrade( $plugins, $args );
3220
+						$result = parent::bulk_upgrade($plugins, $args);
3221 3221
 
3222
-						remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
3222
+						remove_filter('upgrader_post_install', array($this, 'auto_activate'), 10);
3223 3223
 
3224 3224
 						return $result;
3225 3225
 					}
@@ -3234,9 +3234,9 @@  discard block
 block discarded – undo
3234 3234
 					 * @param bool $bool The value we need to give back (true).
3235 3235
 					 * @return bool
3236 3236
 					 */
3237
-					public function auto_activate( $bool ) {
3237
+					public function auto_activate($bool) {
3238 3238
 						// Only process the activation of installed plugins if the automatic flag is set to true.
3239
-						if ( $this->tgmpa->is_automatic ) {
3239
+						if ($this->tgmpa->is_automatic) {
3240 3240
 							// Flush plugins cache so the headers of the newly installed plugins will be read correctly.
3241 3241
 							wp_clean_plugins_cache();
3242 3242
 
@@ -3244,14 +3244,14 @@  discard block
 block discarded – undo
3244 3244
 							$plugin_info = $this->plugin_info();
3245 3245
 
3246 3246
 							// Don't try to activate on upgrade of active plugin as WP will do this already.
3247
-							if ( ! is_plugin_active( $plugin_info ) ) {
3248
-								$activate = activate_plugin( $plugin_info );
3247
+							if (!is_plugin_active($plugin_info)) {
3248
+								$activate = activate_plugin($plugin_info);
3249 3249
 
3250 3250
 								// Adjust the success string based on the activation result.
3251
-								$this->strings['process_success'] = $this->strings['process_success'] . "<br />\n";
3251
+								$this->strings['process_success'] = $this->strings['process_success']."<br />\n";
3252 3252
 
3253
-								if ( is_wp_error( $activate ) ) {
3254
-									$this->skin->error( $activate );
3253
+								if (is_wp_error($activate)) {
3254
+									$this->skin->error($activate);
3255 3255
 									$this->strings['process_success'] .= $this->strings['activation_failed'];
3256 3256
 								} else {
3257 3257
 									$this->strings['process_success'] .= $this->strings['activation_success'];
@@ -3264,7 +3264,7 @@  discard block
 block discarded – undo
3264 3264
 				}
3265 3265
 			}
3266 3266
 
3267
-			if ( ! class_exists( 'TGMPA_Bulk_Installer_Skin' ) ) {
3267
+			if (!class_exists('TGMPA_Bulk_Installer_Skin')) {
3268 3268
 
3269 3269
 				/**
3270 3270
 				 * Installer skin to set strings for the bulk plugin installations..
@@ -3328,9 +3328,9 @@  discard block
 block discarded – undo
3328 3328
 					 *
3329 3329
 					 * @param array $args Arguments to pass for use within the class.
3330 3330
 					 */
3331
-					public function __construct( $args = array() ) {
3331
+					public function __construct($args = array()) {
3332 3332
 						// Get TGMPA class instance.
3333
-						$this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
3333
+						$this->tgmpa = call_user_func(array(get_class($GLOBALS['tgmpa']), 'get_instance'));
3334 3334
 
3335 3335
 						// Parse default and new args.
3336 3336
 						$defaults = array(
@@ -3339,13 +3339,13 @@  discard block
 block discarded – undo
3339 3339
 							'names'        => array(),
3340 3340
 							'install_type' => 'install',
3341 3341
 						);
3342
-						$args     = wp_parse_args( $args, $defaults );
3342
+						$args = wp_parse_args($args, $defaults);
3343 3343
 
3344 3344
 						// Set plugin names to $this->plugin_names property.
3345 3345
 						$this->plugin_names = $args['names'];
3346 3346
 
3347 3347
 						// Extract the new args.
3348
-						parent::__construct( $args );
3348
+						parent::__construct($args);
3349 3349
 					}
3350 3350
 
3351 3351
 					/**
@@ -3357,25 +3357,25 @@  discard block
 block discarded – undo
3357 3357
 					 * @since 2.2.0
3358 3358
 					 */
3359 3359
 					public function add_strings() {
3360
-						if ( 'update' === $this->options['install_type'] ) {
3360
+						if ('update' === $this->options['install_type']) {
3361 3361
 							parent::add_strings();
3362
-							$this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
3362
+							$this->upgrader->strings['skin_before_update_header'] = __('Updating Plugin %1$s (%2$d/%3$d)', 'tgmpa');
3363 3363
 						} else {
3364
-							$this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: <strong>%2$s</strong>.', 'tgmpa' );
3365
-							$this->upgrader->strings['skin_update_failed']       = __( 'The installation of %1$s failed.', 'tgmpa' );
3364
+							$this->upgrader->strings['skin_update_failed_error'] = __('An error occurred while installing %1$s: <strong>%2$s</strong>.', 'tgmpa');
3365
+							$this->upgrader->strings['skin_update_failed']       = __('The installation of %1$s failed.', 'tgmpa');
3366 3366
 
3367
-							if ( $this->tgmpa->is_automatic ) {
3367
+							if ($this->tgmpa->is_automatic) {
3368 3368
 								// Automatic activation strings.
3369
-								$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' );
3370
-								$this->upgrader->strings['skin_update_successful']    = __( '%1$s installed and activated successfully.', 'tgmpa' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'tgmpa' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'tgmpa' ) . '</span>.</a>';
3371
-								$this->upgrader->strings['skin_upgrade_end']          = __( 'All installations and activations have been completed.', 'tgmpa' );
3372
-								$this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
3369
+								$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');
3370
+								$this->upgrader->strings['skin_update_successful']    = __('%1$s installed and activated successfully.', 'tgmpa').' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>'.esc_html__('Show Details', 'tgmpa').'</span><span class="hidden">'.esc_html__('Hide Details', 'tgmpa').'</span>.</a>';
3371
+								$this->upgrader->strings['skin_upgrade_end']          = __('All installations and activations have been completed.', 'tgmpa');
3372
+								$this->upgrader->strings['skin_before_update_header'] = __('Installing and Activating Plugin %1$s (%2$d/%3$d)', 'tgmpa');
3373 3373
 							} else {
3374 3374
 								// Default installation strings.
3375
-								$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' );
3376
-								$this->upgrader->strings['skin_update_successful']    = esc_html__( '%1$s installed successfully.', 'tgmpa' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'tgmpa' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'tgmpa' ) . '</span>.</a>';
3377
-								$this->upgrader->strings['skin_upgrade_end']          = __( 'All installations have been completed.', 'tgmpa' );
3378
-								$this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
3375
+								$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');
3376
+								$this->upgrader->strings['skin_update_successful']    = esc_html__('%1$s installed successfully.', 'tgmpa').' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>'.esc_html__('Show Details', 'tgmpa').'</span><span class="hidden">'.esc_html__('Hide Details', 'tgmpa').'</span>.</a>';
3377
+								$this->upgrader->strings['skin_upgrade_end']          = __('All installations have been completed.', 'tgmpa');
3378
+								$this->upgrader->strings['skin_before_update_header'] = __('Installing Plugin %1$s (%2$d/%3$d)', 'tgmpa');
3379 3379
 							}
3380 3380
 						}
3381 3381
 					}
@@ -3387,11 +3387,11 @@  discard block
 block discarded – undo
3387 3387
 					 *
3388 3388
 					 * @param string $title Unused in this implementation.
3389 3389
 					 */
3390
-					public function before( $title = '' ) {
3391
-						if ( empty( $title ) ) {
3392
-							$title = esc_html( $this->plugin_names[ $this->i ] );
3390
+					public function before($title = '') {
3391
+						if (empty($title)) {
3392
+							$title = esc_html($this->plugin_names[$this->i]);
3393 3393
 						}
3394
-						parent::before( $title );
3394
+						parent::before($title);
3395 3395
 					}
3396 3396
 
3397 3397
 					/**
@@ -3404,11 +3404,11 @@  discard block
 block discarded – undo
3404 3404
 					 *
3405 3405
 					 * @param string $title Unused in this implementation.
3406 3406
 					 */
3407
-					public function after( $title = '' ) {
3408
-						if ( empty( $title ) ) {
3409
-							$title = esc_html( $this->plugin_names[ $this->i ] );
3407
+					public function after($title = '') {
3408
+						if (empty($title)) {
3409
+							$title = esc_html($this->plugin_names[$this->i]);
3410 3410
 						}
3411
-						parent::after( $title );
3411
+						parent::after($title);
3412 3412
 
3413 3413
 						$this->i++;
3414 3414
 					}
@@ -3430,15 +3430,15 @@  discard block
 block discarded – undo
3430 3430
 						// Display message based on if all plugins are now active or not.
3431 3431
 						$update_actions = array();
3432 3432
 
3433
-						if ( $this->tgmpa->is_tgmpa_complete() ) {
3433
+						if ($this->tgmpa->is_tgmpa_complete()) {
3434 3434
 							// All plugins are active, so we display the complete string and hide the menu to protect users.
3435 3435
 							echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
3436 3436
 							$update_actions['dashboard'] = sprintf(
3437
-								esc_html( $this->tgmpa->strings['complete'] ),
3438
-								'<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'tgmpa' ) . '</a>'
3437
+								esc_html($this->tgmpa->strings['complete']),
3438
+								'<a href="'.esc_url(self_admin_url()).'">'.esc_html__('Return to the Dashboard', 'tgmpa').'</a>'
3439 3439
 							);
3440 3440
 						} else {
3441
-							$update_actions['tgmpa_page'] = '<a href="' . esc_url( $this->tgmpa->get_tgmpa_url() ) . '" target="_parent">' . esc_html( $this->tgmpa->strings['return'] ) . '</a>';
3441
+							$update_actions['tgmpa_page'] = '<a href="'.esc_url($this->tgmpa->get_tgmpa_url()).'" target="_parent">'.esc_html($this->tgmpa->strings['return']).'</a>';
3442 3442
 						}
3443 3443
 
3444 3444
 						/**
@@ -3449,10 +3449,10 @@  discard block
 block discarded – undo
3449 3449
 						 * @param array $update_actions Array of plugin action links.
3450 3450
 						 * @param array $plugin_info    Array of information for the last-handled plugin.
3451 3451
 						 */
3452
-						$update_actions = apply_filters( 'tgmpa_update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info );
3452
+						$update_actions = apply_filters('tgmpa_update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info);
3453 3453
 
3454
-						if ( ! empty( $update_actions ) ) {
3455
-							$this->feedback( implode( ' | ', (array) $update_actions ) );
3454
+						if (!empty($update_actions)) {
3455
+							$this->feedback(implode(' | ', (array) $update_actions));
3456 3456
 						}
3457 3457
 					}
3458 3458
 
@@ -3466,7 +3466,7 @@  discard block
 block discarded – undo
3466 3466
 					 * @see        Bulk_Upgrader_Skin::flush_output()
3467 3467
 					 */
3468 3468
 					public function before_flush_output() {
3469
-						_deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' );
3469
+						_deprecated_function(__FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()');
3470 3470
 						$this->flush_output();
3471 3471
 					}
3472 3472
 
@@ -3479,7 +3479,7 @@  discard block
 block discarded – undo
3479 3479
 					 * @see        Bulk_Upgrader_Skin::flush_output()
3480 3480
 					 */
3481 3481
 					public function after_flush_output() {
3482
-						_deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' );
3482
+						_deprecated_function(__FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()');
3483 3483
 						$this->flush_output();
3484 3484
 						$this->i++;
3485 3485
 					}
@@ -3489,7 +3489,7 @@  discard block
 block discarded – undo
3489 3489
 	}
3490 3490
 }
3491 3491
 
3492
-if ( ! class_exists( 'TGMPA_Utils' ) ) {
3492
+if (!class_exists('TGMPA_Utils')) {
3493 3493
 
3494 3494
 	/**
3495 3495
 	 * Generic utilities for TGMPA.
@@ -3527,8 +3527,8 @@  discard block
 block discarded – undo
3527 3527
 		 * @param string $string Text to be wrapped.
3528 3528
 		 * @return string
3529 3529
 		 */
3530
-		public static function wrap_in_em( $string ) {
3531
-			return '<em>' . wp_kses_post( $string ) . '</em>';
3530
+		public static function wrap_in_em($string) {
3531
+			return '<em>'.wp_kses_post($string).'</em>';
3532 3532
 		}
3533 3533
 
3534 3534
 		/**
@@ -3541,8 +3541,8 @@  discard block
 block discarded – undo
3541 3541
 		 * @param string $string Text to be wrapped.
3542 3542
 		 * @return string
3543 3543
 		 */
3544
-		public static function wrap_in_strong( $string ) {
3545
-			return '<strong>' . wp_kses_post( $string ) . '</strong>';
3544
+		public static function wrap_in_strong($string) {
3545
+			return '<strong>'.wp_kses_post($string).'</strong>';
3546 3546
 		}
3547 3547
 
3548 3548
 		/**
@@ -3555,15 +3555,15 @@  discard block
 block discarded – undo
3555 3555
 		 * @param mixed $value Arbitrary value.
3556 3556
 		 * @return bool
3557 3557
 		 */
3558
-		public static function validate_bool( $value ) {
3559
-			if ( ! isset( self::$has_filters ) ) {
3560
-				self::$has_filters = extension_loaded( 'filter' );
3558
+		public static function validate_bool($value) {
3559
+			if (!isset(self::$has_filters)) {
3560
+				self::$has_filters = extension_loaded('filter');
3561 3561
 			}
3562 3562
 
3563
-			if ( self::$has_filters ) {
3564
-				return filter_var( $value, FILTER_VALIDATE_BOOLEAN );
3563
+			if (self::$has_filters) {
3564
+				return filter_var($value, FILTER_VALIDATE_BOOLEAN);
3565 3565
 			} else {
3566
-				return self::emulate_filter_bool( $value );
3566
+				return self::emulate_filter_bool($value);
3567 3567
 			}
3568 3568
 		}
3569 3569
 
@@ -3577,9 +3577,9 @@  discard block
 block discarded – undo
3577 3577
 		 * @param mixed $value Value to cast.
3578 3578
 		 * @return bool
3579 3579
 		 */
3580
-		protected static function emulate_filter_bool( $value ) {
3580
+		protected static function emulate_filter_bool($value) {
3581 3581
 			// @codingStandardsIgnoreStart
3582
-			static $true  = array(
3582
+			static $true = array(
3583 3583
 				'1',
3584 3584
 				'true', 'True', 'TRUE',
3585 3585
 				'y', 'Y',
@@ -3595,17 +3595,17 @@  discard block
 block discarded – undo
3595 3595
 			);
3596 3596
 			// @codingStandardsIgnoreEnd
3597 3597
 
3598
-			if ( is_bool( $value ) ) {
3598
+			if (is_bool($value)) {
3599 3599
 				return $value;
3600
-			} else if ( is_int( $value ) && ( 0 === $value || 1 === $value ) ) {
3600
+			} else if (is_int($value) && (0 === $value || 1 === $value)) {
3601 3601
 				return (bool) $value;
3602
-			} else if ( ( is_float( $value ) && ! is_nan( $value ) ) && ( (float) 0 === $value || (float) 1 === $value ) ) {
3602
+			} else if ((is_float($value) && !is_nan($value)) && ((float) 0 === $value || (float) 1 === $value)) {
3603 3603
 				return (bool) $value;
3604
-			} else if ( is_string( $value ) ) {
3605
-				$value = trim( $value );
3606
-				if ( in_array( $value, $true, true ) ) {
3604
+			} else if (is_string($value)) {
3605
+				$value = trim($value);
3606
+				if (in_array($value, $true, true)) {
3607 3607
 					return true;
3608
-				} else if ( in_array( $value, $false, true ) ) {
3608
+				} else if (in_array($value, $false, true)) {
3609 3609
 					return false;
3610 3610
 				} else {
3611 3611
 					return false;
Please login to merge, or discard this patch.
public/includes/editor-modules--gallery.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
 
12 12
 	ob_start();
13 13
 
14
-	if ( $galleries ) { ?>
14
+	if ($galleries) { ?>
15 15
 	
16
-		<?php if ( lasso_user_can( 'publish_posts' ) ): ?>
16
+		<?php if (lasso_user_can('publish_posts')): ?>
17 17
 			<div class="ase-gallery-opts ase-gallery-opts--create-gallery" style="display:inline !important; postion:relative !important;left:12px !important">
18 18
 				<div class="ase-gallery-opts--single lasso-option">
19
-				<a href="#" class="editor-btn-secondary" id="lasso--gallery__create"><?php _e( 'Create gallery', 'lasso' );?></a>
19
+				<a href="#" class="editor-btn-secondary" id="lasso--gallery__create"><?php _e('Create gallery', 'lasso'); ?></a>
20 20
 				</div>
21 21
 			</div>
22 22
 		<?php endif; ?>
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
 		<div class="ase-gallery-opts ase-gallery-opts--edit-gallery" >
25 25
 			<div class="ase-gallery-opts--single lasso-option">
26 26
 
27
-				<label><?php _e( 'Manage Images', 'lasso' );?>
28
-					<a href="#" id="ase-gallery-add-image" class="lasso-editor-tiny-btn" title="<?php esc_attr_e( 'Add Images', 'lasso' );?>"><i class="lasso-icon-pencil"></i></a>
27
+				<label><?php _e('Manage Images', 'lasso'); ?>
28
+					<a href="#" id="ase-gallery-add-image" class="lasso-editor-tiny-btn" title="<?php esc_attr_e('Add Images', 'lasso'); ?>"><i class="lasso-icon-pencil"></i></a>
29 29
 
30 30
 				</label>
31
-				<small class="lasso-option-desc"><?php _e( 'Rearrange or edit the images in this gallery.', 'lasso' );?></small>
31
+				<small class="lasso-option-desc"><?php _e('Rearrange or edit the images in this gallery.', 'lasso'); ?></small>
32 32
 
33 33
 				<div id="lasso--gallery__images"><span class="lasso-icon-spinner6"></span></div>
34 34
 
@@ -38,22 +38,22 @@  discard block
 block discarded – undo
38 38
 
39 39
 	<?php }
40 40
 
41
-	if ( lasso_user_can( 'publish_posts' ) ): ?>
41
+	if (lasso_user_can('publish_posts')): ?>
42 42
 
43 43
 		<div class="ase-gallery-opts ase-gallery-opts--create-gallery" >
44 44
 
45 45
 			<div class="ase-gallery-opts--single lasso-option">
46 46
 
47
-				<label><?php _e( 'Create a Gallery', 'lasso' );?></label>
47
+				<label><?php _e('Create a Gallery', 'lasso'); ?></label>
48 48
 				<small class="lasso-option-desc">Gallery Name:</small>
49 49
                 <input type="text" id="lasso--gallery__galleryname" value="New Gallery"><br>
50 50
 				
51
-				<small class="lasso-option-desc"><?php _e( 'Select images to create a gallery.', 'lasso' );?></small>
52
-				<a href="#" class="editor-btn-secondary" id="lasso--gallery__selectImages"><?php _e( 'Select Images', 'lasso' );?></a>
51
+				<small class="lasso-option-desc"><?php _e('Select images to create a gallery.', 'lasso'); ?></small>
52
+				<a href="#" class="editor-btn-secondary" id="lasso--gallery__selectImages"><?php _e('Select Images', 'lasso'); ?></a>
53 53
 
54 54
 				<div id="ase-gallery-images"></div>
55 55
 
56
-				<a style="display:none;" class="editor-btn-secondary" data-post-title="<?php echo esc_attr( strtolower( the_title_attribute() ) );?>" id="lasso--gallery__save" href="#"><?php _e( 'Create Gallery', 'lasso' );?></a>
56
+				<a style="display:none;" class="editor-btn-secondary" data-post-title="<?php echo esc_attr(strtolower(the_title_attribute())); ?>" id="lasso--gallery__save" href="#"><?php _e('Create Gallery', 'lasso'); ?></a>
57 57
 
58 58
 			</div>
59 59
 
@@ -64,14 +64,14 @@  discard block
 block discarded – undo
64 64
 	<!-- Gallery Layout/Type Chooser -->
65 65
 	<div class="ase-gallery-opts ase-gallery-opts--type" >
66 66
 		<div data-option="gallery-type" class="ase-gallery-opts--single lasso-option">
67
-			<label><?php _e( 'Gallery Type', 'lasso' );?></label>
68
-			<small class="lasso-option-desc"><?php _e( 'Select the type of gallery.', 'lasso' );?></small>
67
+			<label><?php _e('Gallery Type', 'lasso'); ?></label>
68
+			<small class="lasso-option-desc"><?php _e('Select the type of gallery.', 'lasso'); ?></small>
69 69
 			<fieldset>
70
-	      		<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="grid"><?php _e( 'Grid', 'lasso' );?></label>
71
-	        	<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="thumbnail"><?php _e( 'Thumbnail', 'lasso' );?></label>
70
+	      		<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="grid"><?php _e('Grid', 'lasso'); ?></label>
71
+	        	<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="thumbnail"><?php _e('Thumbnail', 'lasso'); ?></label>
72 72
 				<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="sequence">Sequence</label>
73
-				<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="photoset"><?php _e( 'Photoset', 'lasso' );?></label>
74
-				<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="stacked"><?php _e( 'Parallax', 'lasso' );?></label>
73
+				<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="photoset"><?php _e('Photoset', 'lasso'); ?></label>
74
+				<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="stacked"><?php _e('Parallax', 'lasso'); ?></label>
75 75
 			</fieldset>
76 76
 		</div>
77 77
 	</div>
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
 	<div class="ase-gallery-opts ase-gallery-opts--grid" style="display:none;">
81 81
 
82 82
 		<div data-option="itemwidth" class="ase-gallery-opts--single lasso-option">
83
-			<label for="lasso_grid_gallery_width"><?php _e( 'Grid Item Width', 'lasso' );?></label>
84
-			<small class="lasso-option-desc"><?php _e( 'Adjust the width of the individual grid items, only if using Grid gallery style. Default is 400.', 'lasso' );?></small>
83
+			<label for="lasso_grid_gallery_width"><?php _e('Grid Item Width', 'lasso'); ?></label>
84
+			<small class="lasso-option-desc"><?php _e('Adjust the width of the individual grid items, only if using Grid gallery style. Default is 400.', 'lasso'); ?></small>
85 85
 			<input type="text_small" class="lasso-generator-attr" name="lasso_grid_gallery_width" value="">
86 86
 		</div>
87 87
 
@@ -91,24 +91,24 @@  discard block
 block discarded – undo
91 91
 	<div class="ase-gallery-opts ase-gallery-opts--thumb" style="display:none;">
92 92
 
93 93
 		<div data-option="transition" class="ase-gallery-opts--single lasso-option">
94
-			<label for="lasso_thumb_gallery_transition"><?php _e( 'Gallery Transition', 'lasso' );?></label>
95
-			<small class="lasso-option-desc"><?php _e( 'Adjust the transition effect for the Thumbnail gallery. Default is slide.', 'lasso' );?></small>
94
+			<label for="lasso_thumb_gallery_transition"><?php _e('Gallery Transition', 'lasso'); ?></label>
95
+			<small class="lasso-option-desc"><?php _e('Adjust the transition effect for the Thumbnail gallery. Default is slide.', 'lasso'); ?></small>
96 96
 		   	<select name="lasso_thumb_gallery_transition" class="lasso-generator-attr">
97
-		      <option value="crossfade"><?php _e( 'Fade', 'lasso' );?></option>
98
-		      <option value="slide"><?php _e( 'Slide', 'lasso' );?></option>
99
-		      <option value="dissolve"><?php _e( 'Dissolve', 'lasso' );?></option>
97
+		      <option value="crossfade"><?php _e('Fade', 'lasso'); ?></option>
98
+		      <option value="slide"><?php _e('Slide', 'lasso'); ?></option>
99
+		      <option value="dissolve"><?php _e('Dissolve', 'lasso'); ?></option>
100 100
 		    </select>
101 101
 		</div>
102 102
 
103 103
 		<div data-option="speed" class="ase-gallery-opts--single lasso-option">
104
-			<label for="lasso_thumb_gallery_transition_speed"><?php _e( 'Gallery Transition Speed', 'lasso' );?></label>
105
-			<small class="lasso-option-desc"><?php _e( 'Activate slideshow by setting a speed for the transition.5000 = 5 seconds.', 'lasso' );?></small>
104
+			<label for="lasso_thumb_gallery_transition_speed"><?php _e('Gallery Transition Speed', 'lasso'); ?></label>
105
+			<small class="lasso-option-desc"><?php _e('Activate slideshow by setting a speed for the transition.5000 = 5 seconds.', 'lasso'); ?></small>
106 106
 			<input type="text" class="lasso-generator-attr" name="lasso_thumb_gallery_transition_speed" value="">
107 107
 		</div>
108 108
 
109 109
 		<div data-option="hide-thumbs" class="ase-gallery-opts--single lasso-option">
110 110
 			<input class="lasso-generator-attr" type="checkbox" name="lasso_thumb_gallery_hide_thumbs">
111
-			<label for="lasso_thumb_gallery_hide_thumbs"><?php _e( 'Hide Gallery Thumbnails', 'lasso' );?></label>
111
+			<label for="lasso_thumb_gallery_hide_thumbs"><?php _e('Hide Gallery Thumbnails', 'lasso'); ?></label>
112 112
 		</div>
113 113
 
114 114
 	</div>
@@ -117,14 +117,14 @@  discard block
 block discarded – undo
117 117
 	<div class="ase-gallery-opts ase-gallery-opts--photoset" style="display:none;">
118 118
 
119 119
 		<div data-option="pslayout" class="ase-gallery-opts--single lasso-option">
120
-			<label for="lasso-photoset-gallery-layout"><?php _e( 'Gallery Layout', 'lasso' );?></label>
121
-			<small class="lasso-option-desc"><?php _e( 'Let\'s say you have 4 images in this gallery. If you enter 121 you will have one image on the top row, two images on the second row, and one image on the third row.', 'lasso' );?></small>
120
+			<label for="lasso-photoset-gallery-layout"><?php _e('Gallery Layout', 'lasso'); ?></label>
121
+			<small class="lasso-option-desc"><?php _e('Let\'s say you have 4 images in this gallery. If you enter 121 you will have one image on the top row, two images on the second row, and one image on the third row.', 'lasso'); ?></small>
122 122
 			<input type="text" class="lasso-generator-attr" name="lasso_photoset_gallery_layout" value="">
123 123
 		</div>
124 124
 
125 125
 		<div data-option="pslightbox" class="ase-gallery-opts--single lasso-option">
126 126
 			<input type="checkbox" class="lasso-generator-attr" name="lasso_photoset_gallery_lightbox">
127
-			<label for="lasso_photoset_gallery_lightbox"><?php _e( 'Enable Lightbox', 'lasso' );?></label>
127
+			<label for="lasso_photoset_gallery_lightbox"><?php _e('Enable Lightbox', 'lasso'); ?></label>
128 128
 		</div>
129 129
 
130 130
 	</div>
@@ -133,13 +133,13 @@  discard block
 block discarded – undo
133 133
 	<div class="ase-gallery-opts ase-gallery-opts--global">
134 134
 
135 135
 		<div data-option="width" class="ase-gallery-opts--single lasso-option">
136
-			<label for="lasso_gallery_width"><?php _e( 'Main Gallery Width', 'lasso' );?></label>
137
-			<small class="lasso-option-desc"><?php _e( 'Adjust the overall width of the grid/thumbnail gallery. Acceptable values include 500px or 50%.', 'lasso' );?></small>
136
+			<label for="lasso_gallery_width"><?php _e('Main Gallery Width', 'lasso'); ?></label>
137
+			<small class="lasso-option-desc"><?php _e('Adjust the overall width of the grid/thumbnail gallery. Acceptable values include 500px or 50%.', 'lasso'); ?></small>
138 138
 			<input type="text_small" class="lasso-generator-attr" name="lasso_gallery_width" value="">
139 139
 		</div>
140 140
 		<div data-option="caption" class="ase-gallery-opts--single lasso-option">
141
-			<label for="lasso_gallery_caption"><?php _e( 'Gallery Caption', 'lasso' );?></label>
142
-			<small class="lasso-option-desc"><?php _e( 'Add an optional caption for the gallery.', 'lasso' );?></small>
141
+			<label for="lasso_gallery_caption"><?php _e('Gallery Caption', 'lasso'); ?></label>
142
+			<small class="lasso-option-desc"><?php _e('Add an optional caption for the gallery.', 'lasso'); ?></small>
143 143
 			<textarea name="lasso_gallery_caption" class="lasso-generator-attr"></textarea>
144 144
 		</div>
145 145
 
Please login to merge, or discard this patch.
includes/process/save.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -19,26 +19,26 @@  discard block
 block discarded – undo
19 19
 	 *
20 20
 	 * @return bool Always returns true.
21 21
 	 */
22
-	public function content( $data ) {
22
+	public function content($data) {
23 23
 
24 24
 		$save_to_post_disabled = $this->save_to_post_disables();
25 25
 
26
-		$postid = (int) $data[ 'post_id' ];
27
-		$content = $this->replace_rendered_shortcodes( $data[ 'content' ] );
26
+		$postid = (int) $data['post_id'];
27
+		$content = $this->replace_rendered_shortcodes($data['content']);
28 28
 
29
-		if ( 'off' == $save_to_post_disabled || empty( $save_to_post_disabled ) ) {
29
+		if ('off' == $save_to_post_disabled || empty($save_to_post_disabled)) {
30 30
 
31 31
 			$args = array(
32 32
 				'ID'           => (int) $postid,
33 33
 				'post_content' => $content
34 34
 			);
35 35
 
36
-			wp_update_post( apply_filters( 'lasso_object_save_args', $args ) );
36
+			wp_update_post(apply_filters('lasso_object_save_args', $args));
37 37
 
38 38
 		}
39 39
 
40 40
 		// run save action
41
-		do_action( 'lasso_post_saved', $postid, $content, get_current_user_ID() );
41
+		do_action('lasso_post_saved', $postid, $content, get_current_user_ID());
42 42
 
43 43
 		return true;
44 44
 
@@ -53,24 +53,24 @@  discard block
 block discarded – undo
53 53
 	 *
54 54
 	 * @return bool Always returns true.
55 55
 	 */
56
-	public function publish_content( $data ) {
56
+	public function publish_content($data) {
57 57
 		$save_to_post_disabled = $this->save_to_post_disables();
58 58
 
59
-		$postid = (int) $data[ 'post_id' ];
60
-		$content = $this->replace_rendered_shortcodes( $data[ 'content' ] );
59
+		$postid = (int) $data['post_id'];
60
+		$content = $this->replace_rendered_shortcodes($data['content']);
61 61
 
62
-		if ( 'off' == $save_to_post_disabled || empty( $save_to_post_disabled ) ) {
62
+		if ('off' == $save_to_post_disabled || empty($save_to_post_disabled)) {
63 63
 
64
-			$args = array (
64
+			$args = array(
65 65
 				'ID'           	=> $postid,
66 66
 				'post_content' 	=> $content,
67 67
 				'post_status' 	=> 'publish'
68 68
 			);
69
-			wp_update_post( apply_filters( 'lasso_object_publish_args', $args ) );
69
+			wp_update_post(apply_filters('lasso_object_publish_args', $args));
70 70
 
71 71
 		}
72 72
 
73
-		do_action( 'lasso_post_published', $postid, $content, get_current_user_ID() );
73
+		do_action('lasso_post_published', $postid, $content, get_current_user_ID());
74 74
 
75 75
 		return true;
76 76
 
@@ -83,13 +83,13 @@  discard block
 block discarded – undo
83 83
 	 *
84 84
 	 * @return array Array of keys to pull from $_POST per action and their sanitization callback
85 85
 	 */
86
-	public static function params(){
87
-		$params[ 'process_save_content' ] = array(
86
+	public static function params() {
87
+		$params['process_save_content'] = array(
88 88
 			'post_id' => 'absint',
89 89
 			'content' => 'wp_kses_post'
90 90
 		);
91 91
 
92
-		$params[ 'process_save_publish_content' ] = array(
92
+		$params['process_save_publish_content'] = array(
93 93
 			'post_id' => 'absint',
94 94
 			'content' => 'wp_kses_post'
95 95
 		);
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
 	 * @return array Array of additional functions to use to authorize action.
106 106
 	 */
107 107
 	public static function auth_callbacks() {
108
-		$params[ 'process_save_content' ] = array(
108
+		$params['process_save_content'] = array(
109 109
 			'lasso_user_can'
110 110
 		);
111 111
 
112
-		$params[ 'process_save_publish_content' ] = array();
112
+		$params['process_save_publish_content'] = array();
113 113
 
114 114
 		return $params;
115 115
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	 * @return bool
126 126
 	 */
127 127
 	protected function save_to_post_disables() {
128
-		$save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
128
+		$save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
129 129
 
130 130
 		return $save_to_post_disabled;
131 131
 
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
 	 *
143 143
 	 * @return string
144 144
 	 */
145
-	protected function replace_rendered_shortcodes( $content ) {
146
-		if ( false === strpos( $content, '--EDITUS_OTHER_SHORTCODE_START|' ) ) {
145
+	protected function replace_rendered_shortcodes($content) {
146
+		if (false === strpos($content, '--EDITUS_OTHER_SHORTCODE_START|')) {
147 147
 			return $content;
148 148
 		}
149
-		$content = htmlspecialchars_decode ($content);
149
+		$content = htmlspecialchars_decode($content);
150 150
 
151 151
 		$content = preg_replace(
152 152
 			'/<!--EDITUS_OTHER_SHORTCODE_START\|\[(.*?)\]-->(.*?)<!--EDITUS_OTHER_SHORTCODE_END-->/s',
Please login to merge, or discard this patch.
public/includes/wrap-shortcodes.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	if ( strpos( $m[2],'aesop_'  ) === 0 ) {
68 68
 		// check against the exceptions
69 69
 		if (strpos_arr($m[2],array('aesop_gallery_pop','aesop_character_carousel'))===false) {
70
-		    return $m[0];
70
+			return $m[0];
71 71
 		}
72 72
 	}
73 73
 
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
 
77 77
 /* a helper function */
78 78
 function strpos_arr($haystack, $needle) {
79
-    if(!is_array($needle)) $needle = array($needle);
80
-    foreach($needle as $what) {
81
-        if(($pos = strpos($haystack, $what))!==false) return $pos;
82
-    }
83
-    return false;
79
+	if(!is_array($needle)) $needle = array($needle);
80
+	foreach($needle as $what) {
81
+		if(($pos = strpos($haystack, $what))!==false) return $pos;
82
+	}
83
+	return false;
84 84
 }
85 85
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
  * Wraps shortcodes of other Plugins in prep for later replacement on save to preserve the shortcodes
4 4
  */
5 5
 
6
-if ( lasso_user_can( 'edit_posts' ) && ! is_admin() ) {
7
-	add_filter( 'the_content', 'lasso_wrap_shortcodes', 9 );
6
+if (lasso_user_can('edit_posts') && !is_admin()) {
7
+	add_filter('the_content', 'lasso_wrap_shortcodes', 9);
8 8
 }
9 9
 
10 10
 /**
@@ -17,33 +17,33 @@  discard block
 block discarded – undo
17 17
  *
18 18
  * @return string
19 19
  */
20
-function lasso_wrap_shortcodes( $content ) {
20
+function lasso_wrap_shortcodes($content) {
21 21
 	global $shortcode_tags;
22 22
 
23
-	if ( false === strpos( $content, '[' ) ) {
23
+	if (false === strpos($content, '[')) {
24 24
 		return $content;
25 25
 	}
26 26
 
27
-	if ( empty( $shortcode_tags ) || ! is_array( $shortcode_tags ) ) {
27
+	if (empty($shortcode_tags) || !is_array($shortcode_tags)) {
28 28
 		return $content;
29 29
 	}
30 30
 
31
-	$tagnames  = array_keys( $shortcode_tags );
32
-	$tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) );
31
+	$tagnames  = array_keys($shortcode_tags);
32
+	$tagregexp = join('|', array_map('preg_quote', $tagnames));
33 33
 	$pattern   = "/\\[($tagregexp)/s";
34 34
 
35
-	if ( 1 !== preg_match( $pattern, $content ) ) {
35
+	if (1 !== preg_match($pattern, $content)) {
36 36
 		// Avoids parsing HTML when there are no shortcodes or embeds anyway.
37 37
 		return $content;
38 38
 	}
39 39
 
40
-	$content = do_shortcodes_in_html_tags( $content, true ,$tagnames);
40
+	$content = do_shortcodes_in_html_tags($content, true, $tagnames);
41 41
 
42 42
 	$pattern = get_shortcode_regex();
43
-	$content = preg_replace_callback( "/$pattern/s", 'lasso_wrap_shortcode_tag', $content );
43
+	$content = preg_replace_callback("/$pattern/s", 'lasso_wrap_shortcode_tag', $content);
44 44
 
45 45
 	// Always restore square braces so we don't break things like <!--[if IE ]>
46
-	$content = unescape_invalid_shortcodes( $content );
46
+	$content = unescape_invalid_shortcodes($content);
47 47
 
48 48
 	return $content;
49 49
 }
@@ -57,28 +57,28 @@  discard block
 block discarded – undo
57 57
  *
58 58
  * @return string
59 59
  */
60
-function lasso_wrap_shortcode_tag( $m ) {
60
+function lasso_wrap_shortcode_tag($m) {
61 61
 	// allow [[foo]] syntax for escaping a tag
62
-	if ( $m[1] == '[' && $m[6] == ']' ) {
63
-		return substr( $m[0], 1, - 1 );
62
+	if ($m[1] == '[' && $m[6] == ']') {
63
+		return substr($m[0], 1, - 1);
64 64
 	}
65 65
 	//array('aesop_quote','aesop_gallery','aesop_chapter','aesop_timeline_stop','aesop_video','aesop_collection','aesop_character','aesop_document','aesop_audio','aesop_content','aesop_map')
66 66
 
67
-	if ( strpos( $m[2],'aesop_'  ) === 0 ) {
67
+	if (strpos($m[2], 'aesop_') === 0) {
68 68
 		// check against the exceptions
69
-		if (strpos_arr($m[2],array('aesop_gallery_pop','aesop_character_carousel'))===false) {
69
+		if (strpos_arr($m[2], array('aesop_gallery_pop', 'aesop_character_carousel')) === false) {
70 70
 		    return $m[0];
71 71
 		}
72 72
 	}
73 73
 
74
-	return '<!--EDITUS_OTHER_SHORTCODE_START|[' . $m[0] . ']-->' . $m[0] . '<!--EDITUS_OTHER_SHORTCODE_END-->';
74
+	return '<!--EDITUS_OTHER_SHORTCODE_START|['.$m[0].']-->'.$m[0].'<!--EDITUS_OTHER_SHORTCODE_END-->';
75 75
 }
76 76
 
77 77
 /* a helper function */
78 78
 function strpos_arr($haystack, $needle) {
79
-    if(!is_array($needle)) $needle = array($needle);
80
-    foreach($needle as $what) {
81
-        if(($pos = strpos($haystack, $what))!==false) return $pos;
79
+    if (!is_array($needle)) $needle = array($needle);
80
+    foreach ($needle as $what) {
81
+        if (($pos = strpos($haystack, $what)) !== false) return $pos;
82 82
     }
83 83
     return false;
84 84
 }
85 85
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,9 +76,13 @@
 block discarded – undo
76 76
 
77 77
 /* a helper function */
78 78
 function strpos_arr($haystack, $needle) {
79
-    if(!is_array($needle)) $needle = array($needle);
79
+    if(!is_array($needle)) {
80
+    	$needle = array($needle);
81
+    }
80 82
     foreach($needle as $what) {
81
-        if(($pos = strpos($haystack, $what))!==false) return $pos;
83
+        if(($pos = strpos($haystack, $what))!==false) {
84
+        	return $pos;
85
+        }
82 86
     }
83 87
     return false;
84 88
 }
85 89
\ No newline at end of file
Please login to merge, or discard this patch.
public/includes/editor-modules.php 3 patches
Braces   +32 added lines, -20 removed lines patch added patch discarded remove patch
@@ -107,8 +107,9 @@  discard block
 block discarded – undo
107 107
 
108 108
 	ob_start();
109 109
 
110
-	if ( !lasso_user_can() )
111
-		return;
110
+	if ( !lasso_user_can() ) {
111
+			return;
112
+	}
112 113
 
113 114
 	// let users add custom css classes
114 115
 	$custom_classes = apply_filters( 'lasso_sidebar_classes', '' );
@@ -131,8 +132,9 @@  discard block
 block discarded – undo
131 132
 
132 133
 	ob_start();
133 134
 
134
-	if ( !lasso_user_can() )
135
-		return;
135
+	if ( !lasso_user_can() ) {
136
+			return;
137
+	}
136 138
 
137 139
 	// check for lasso story engine and add a class doniting this
138 140
 	$ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
@@ -205,8 +207,11 @@  discard block
 block discarded – undo
205 207
 						<?php if ( class_exists ('Aesop_GalleryPop') ) { ?>
206 208
 						     <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>"  class="lasso-toolbar--component__gallerypop"></li>
207 209
 						<?php }?>
208
-					<?php else: ?>
209
-						<li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li>
210
+					<?php else {
211
+	: ?>
212
+						<li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );
213
+}
214
+?>" class="image lasso-toolbar--component__image"></li>
210 215
 						<li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li>
211 216
 						<!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li-->
212 217
 					<?php endif; ?>
@@ -230,8 +235,9 @@  discard block
 block discarded – undo
230 235
 
231 236
 	ob_start();
232 237
 
233
-	if ( !lasso_user_can() )
234
-		return;
238
+	if ( !lasso_user_can() ) {
239
+			return;
240
+	}
235 241
 
236 242
 	// let users add custom css classes
237 243
 	$custom_classes = apply_filters( 'lasso_component_classes', '' );
@@ -257,8 +263,9 @@  discard block
 block discarded – undo
257 263
 
258 264
 	ob_start();
259 265
 
260
-	if ( !lasso_user_can() )
261
-		return;
266
+	if ( !lasso_user_can() ) {
267
+			return;
268
+	}
262 269
 
263 270
 	// has post thumbnail
264 271
 	$has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false;
@@ -286,8 +293,9 @@  discard block
 block discarded – undo
286 293
 
287 294
 	ob_start();
288 295
 
289
-	if ( !lasso_user_can() )
290
-		return;
296
+	if ( !lasso_user_can() ) {
297
+			return;
298
+	}
291 299
 
292 300
 	global $post;
293 301
 
@@ -417,8 +425,9 @@  discard block
 block discarded – undo
417 425
 
418 426
 	ob_start();
419 427
 
420
-	if ( !lasso_user_can('edit_posts') )
421
-		return;
428
+	if ( !lasso_user_can('edit_posts') ) {
429
+			return;
430
+	}
422 431
 
423 432
 	$status = get_post_status( get_the_ID() );
424 433
 
@@ -541,8 +550,9 @@  discard block
 block discarded – undo
541 550
 
542 551
 	ob_start();
543 552
 
544
-	if ( !lasso_user_can() )
545
-		return;
553
+	if ( !lasso_user_can() ) {
554
+			return;
555
+	}
546 556
 
547 557
 	// let users add custom css classes
548 558
 	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
@@ -562,8 +572,9 @@  discard block
 block discarded – undo
562 572
 
563 573
 	ob_start();
564 574
 
565
-	if ( !lasso_user_can() )
566
-		return;
575
+	if ( !lasso_user_can() ) {
576
+			return;
577
+	}
567 578
 
568 579
 	// let users add custom css classes
569 580
 	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
@@ -634,8 +645,9 @@  discard block
 block discarded – undo
634 645
 
635 646
 	$blob = array();
636 647
 
637
-	if ( empty( $codes ) )
638
-		return;
648
+	if ( empty( $codes ) ) {
649
+			return;
650
+	}
639 651
 
640 652
 	foreach ( $codes as $slug => $shortcode ) {
641 653
 		$return = '';
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
 	$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
147 147
 
148 148
 	$toolbar_class  = $toolbar_headings ? 'toolbar-extended' : false;
149
-    $mobile_class = $is_mobile ? 'lasso-mobile' : false;
149
+	$mobile_class = $is_mobile ? 'lasso-mobile' : false;
150 150
 	
151 151
 	$mobile_style =$is_mobile ? 'style="top:40px;"' : null;
152 152
 
Please login to merge, or discard this patch.
Spacing   +207 added lines, -207 removed lines patch added patch discarded remove patch
@@ -12,32 +12,32 @@  discard block
 block discarded – undo
12 12
  *
13 13
  * @since 1.0
14 14
  */
15
-add_action( 'wp_footer', 'lasso_editor_controls' );
15
+add_action('wp_footer', 'lasso_editor_controls');
16 16
 function lasso_editor_controls() {
17 17
 
18 18
 	global $post;
19 19
 
20
-	if ( lasso_user_can('edit_posts') ) {
20
+	if (lasso_user_can('edit_posts')) {
21 21
 
22
-		$status = get_post_status( get_the_ID() );
22
+		$status = get_post_status(get_the_ID());
23 23
 
24 24
 		// let users add custom css classes
25
-		$custom_classes = apply_filters( 'lasso_control_classes', '' );
25
+		$custom_classes = apply_filters('lasso_control_classes', '');
26 26
 
27 27
 		$post_access_class   = '';
28
-		$post_new_disabled   = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' );
29
-		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
30
-		$shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
28
+		$post_new_disabled   = lasso_editor_get_option('post_adding_disabled', 'lasso_editor');
29
+		$post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor');
30
+		$shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor');
31 31
 
32 32
 
33 33
 		// CSS class if adding new post objects is disabled
34
-		if ( 'on' == $post_new_disabled ) { $post_access_class = 'lasso--post-new-disabled'; }
34
+		if ('on' == $post_new_disabled) { $post_access_class = 'lasso--post-new-disabled'; }
35 35
 
36 36
 		// CSS class if adjust settings is disabled
37
-		if ( 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-settings-disabled'; }
37
+		if ('on' == $post_settings_disabled) { $post_access_class = 'lasso--post-settings-disabled'; }
38 38
 
39 39
 		// CSS class if adding new post objects AND settings are disabled
40
-		if ( 'on' == $post_new_disabled && 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-all-disabled'; }
40
+		if ('on' == $post_new_disabled && 'on' == $post_settings_disabled) { $post_access_class = 'lasso--post-all-disabled'; }
41 41
 
42 42
 		// CSS class if shortcodify or (Aesop Shortcode Conversion) is disabled
43 43
 		$sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled';
@@ -47,44 +47,44 @@  discard block
 block discarded – undo
47 47
 		
48 48
 		$mobile_style = wp_is_mobile() ? 'style="top:40px;"' : null;
49 49
 
50
-		?><div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class( $status );?> <?php echo sanitize_html_class( $custom_classes );?>" data-post-id="<?php echo get_the_ID();?>" >
50
+		?><div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class($status); ?> <?php echo sanitize_html_class($custom_classes); ?>" data-post-id="<?php echo get_the_ID(); ?>" >
51 51
 
52
-			<ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class;?> "  <?php echo $mobile_style ?> >
52
+			<ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class; ?> "  <?php echo $mobile_style ?> >
53 53
 
54
-				<?php do_action( 'lasso_editor_controls_before' );
54
+				<?php do_action('lasso_editor_controls_before');
55 55
 
56
-				if ( $is_capable ) { ?>
56
+				if ($is_capable) { ?>
57 57
 
58
-					<li id="lasso--edit" title="<?php esc_attr_e( 'Edit Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
58
+					<li id="lasso--edit" title="<?php esc_attr_e('Edit Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
59 59
 
60
-					<?php if ( 'off' == $post_settings_disabled || empty( $post_settings_disabled ) ) { ?>
61
-						<li id="lasso--post-settings" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
60
+					<?php if ('off' == $post_settings_disabled || empty($post_settings_disabled)) { ?>
61
+						<li id="lasso--post-settings" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
62 62
 					<?php }
63 63
 
64 64
 				} ?>
65 65
 
66
-				<li id="lasso--post-all" title="<?php esc_attr_e( 'All Posts', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
66
+				<li id="lasso--post-all" title="<?php esc_attr_e('All Posts', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
67 67
 
68
-				<?php if ( $is_capable && wp_revisions_enabled( $post ) ) { ?>
69
-					<li id="lasso--post-revisions" title="<?php esc_attr_e( 'Revisions', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
68
+				<?php if ($is_capable && wp_revisions_enabled($post)) { ?>
69
+					<li id="lasso--post-revisions" title="<?php esc_attr_e('Revisions', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
70 70
 				<?php } ?>
71 71
 
72
-				<?php if ( ( 'off' == $post_new_disabled || empty( $post_new_disabled ) && lasso_user_can('publish_posts') ) ) { ?>
73
-					<li id="lasso--post-new" title="<?php esc_attr_e( 'Add Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li>
72
+				<?php if (('off' == $post_new_disabled || empty($post_new_disabled) && lasso_user_can('publish_posts'))) { ?>
73
+					<li id="lasso--post-new" title="<?php esc_attr_e('Add Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li>
74 74
 				<?php } ?>
75 75
 
76
-				<?php do_action( 'lasso_editor_controls_after' );?>
76
+				<?php do_action('lasso_editor_controls_after'); ?>
77 77
 
78 78
 			</ul>
79 79
 
80
-			<?php if ( is_singular() ) { ?>
80
+			<?php if (is_singular()) { ?>
81 81
 
82 82
 				<div class="lasso--controls__right">
83 83
 
84
-					<a href="#" title="<?php esc_attr_e( 'Save Post', 'lasso' );?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a>
84
+					<a href="#" title="<?php esc_attr_e('Save Post', 'lasso'); ?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a>
85 85
 
86
-					<?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') )  ) { ?>
87
-						<a href="#" title="<?php esc_attr_e( 'Publish Post', 'lasso' );?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class;?>"></a>
86
+					<?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?>
87
+						<a href="#" title="<?php esc_attr_e('Publish Post', 'lasso'); ?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class; ?>"></a>
88 88
 					<?php } ?>
89 89
 
90 90
 				</div>
@@ -107,13 +107,13 @@  discard block
 block discarded – undo
107 107
 
108 108
 	ob_start();
109 109
 
110
-	if ( !lasso_user_can() )
110
+	if (!lasso_user_can())
111 111
 		return;
112 112
 
113 113
 	// let users add custom css classes
114
-	$custom_classes = apply_filters( 'lasso_sidebar_classes', '' );
114
+	$custom_classes = apply_filters('lasso_sidebar_classes', '');
115 115
 	?>
116
-	<div id="lasso--sidebar" class="<?php echo sanitize_html_class( $custom_classes );?>" >
116
+	<div id="lasso--sidebar" class="<?php echo sanitize_html_class($custom_classes); ?>" >
117 117
 		<div class="lasso--sidebar__inner">
118 118
 			<div id="lasso--component__settings"></div>
119 119
 		</div>
@@ -131,25 +131,25 @@  discard block
 block discarded – undo
131 131
 
132 132
 	ob_start();
133 133
 
134
-	if ( !lasso_user_can() )
134
+	if (!lasso_user_can())
135 135
 		return;
136 136
 	
137 137
 	$is_mobile = wp_is_mobile();
138 138
 
139 139
 	// check for lasso story engine and add a class doniting this
140
-	$ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
140
+	$ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active';
141 141
 
142 142
 	// let users add custom css classes
143
-	$custom_classes = apply_filters( 'lasso_toolbar_classes', '' );
143
+	$custom_classes = apply_filters('lasso_toolbar_classes', '');
144 144
 
145 145
 	// are toolbar headings enabled
146
-	$toolbar_headings      = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' );
146
+	$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
147 147
 
148
-	$toolbar_class  = $toolbar_headings ? 'toolbar-extended' : false;
148
+	$toolbar_class = $toolbar_headings ? 'toolbar-extended' : false;
149 149
 	
150 150
 	// mobile styles
151 151
     $mobile_class = $is_mobile ? 'lasso-mobile' : false;
152
-	$mobile_style =$is_mobile ? 'style="top:40px;"' : null;
152
+	$mobile_style = $is_mobile ? 'style="top:40px;"' : null;
153 153
 	
154 154
 	//show color
155 155
 	$show_color = true;
@@ -159,81 +159,81 @@  discard block
 block discarded – undo
159 159
 
160 160
 
161 161
 	?>
162
-	<div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style ?>>
162
+	<div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style ?>>
163 163
 		<ul class="lasso--toolbar__inner lasso-editor-controls">
164
-			<?php do_action( 'lasso_toolbar_components_before' );?>
165
-		    <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li>
166
-		    <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li>
167
-		    <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li>
168
-		    <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li>
169
-		    <?php if ( $toolbar_headings ): ?>
170
-		    <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li>
171
-		    <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li>
164
+			<?php do_action('lasso_toolbar_components_before'); ?>
165
+		    <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li>
166
+		    <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li>
167
+		    <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li>
168
+		    <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li>
169
+		    <?php if ($toolbar_headings): ?>
170
+		    <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li>
171
+		    <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li>
172 172
 			<?php endif; ?>
173 173
 			
174
-			<?php if ( $show_color ): ?>
175
-		    <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Text Color', 'lasso' );?>"></li>
176
-		    <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li>
174
+			<?php if ($show_color): ?>
175
+		    <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Text Color', 'lasso'); ?>"></li>
176
+		    <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li>
177 177
 			<?php endif; ?>
178 178
 			
179
-		    <li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>">
179
+		    <li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>">
180 180
 		    	<div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> >
181
-		    		<div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div>
182
-		    		<a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a>
181
+		    		<div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div>
182
+		    		<a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a>
183 183
 					<!--input class="styled-checkbox" type="checkbox" /-->
184 184
                     <!--label>Styled Check Box</label-->
185 185
 		    	</div>
186 186
 		    </li>
187
-		    <?php do_action( 'lasso_toolbar_components_after' );?>
188
-		    <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML', 'lasso' );?>">
187
+		    <?php do_action('lasso_toolbar_components_after'); ?>
188
+		    <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML', 'lasso'); ?>">
189 189
 		    	<div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>>
190
-		    		<div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div>
190
+		    		<div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div>
191 191
 		    		<div id="lasso-toolbar--html__footer">
192 192
 		    			<ul class="lasso-toolbar--html-snips">
193
-		    				<?php if ( !$toolbar_headings ): ?>
194
-		    				<li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>">
195
-		    				<li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>">
193
+		    				<?php if (!$toolbar_headings): ?>
194
+		    				<li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>">
195
+		    				<li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>">
196 196
 		    				<?php endif; ?>
197
-		    				<li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>">
198
-		    				<li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>">
197
+		    				<li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>">
198
+		    				<li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>">
199 199
 		    			</ul>
200
-		    			<a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a>
201
-		    			<a href="#" title="<?php esc_attr_e( 'Insert HTML', 'lasso' );?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e( 'Insert', 'lasso' );?></a>
200
+		    			<a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a>
201
+		    			<a href="#" title="<?php esc_attr_e('Insert HTML', 'lasso'); ?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e('Insert', 'lasso'); ?></a>
202 202
 		    		</div>
203 203
 		    	</div>
204 204
 		    </li>
205 205
 			
206
-			<?php if ( $show_align ): ?>
207
-		    <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li>
208
-		    <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li>
209
-			<li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li>
206
+			<?php if ($show_align): ?>
207
+		    <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li>
208
+		    <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li>
209
+			<li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li>
210 210
 			<?php endif; ?>
211 211
 			
212
-		    <li id="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>">
212
+		    <li id="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>">
213 213
 			    <ul id="lasso-toolbar--components__list" style="display:none;">
214
-			    	<?php if ( 'ase-active' == $ase_status ): ?>
215
-						<li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li>
216
-						<li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li>
217
-						<li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>"  class="lasso-toolbar--component__quote"></li>
218
-						<li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>"  class="lasso-toolbar--component__content"></li>
219
-						<li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>"  class="lasso-toolbar--component__chapter"></li>
220
-						<li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>"  class="lasso-toolbar--component__parallax"></li>
221
-						<li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>"  class="lasso-toolbar--component__audio"></li>
222
-						<li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>"  class="lasso-toolbar--component__video"></li>
223
-						<li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>"  class="lasso-toolbar--component__map"></li>
224
-						<li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>"  class="lasso-toolbar--component__timeline"></li>
225
-						<li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>"  class="lasso-toolbar--component__document"></li>
226
-						<li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>"  class="lasso-toolbar--component__collection"></li>
227
-						<li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>"  class="lasso-toolbar--component__gallery"></li>
228
-						<?php if ( class_exists ('Aesop_GalleryPop') ) { ?>
229
-						     <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>"  class="lasso-toolbar--component__gallerypop"></li>
214
+			    	<?php if ('ase-active' == $ase_status): ?>
215
+						<li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li>
216
+						<li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li>
217
+						<li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>"  class="lasso-toolbar--component__quote"></li>
218
+						<li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>"  class="lasso-toolbar--component__content"></li>
219
+						<li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>"  class="lasso-toolbar--component__chapter"></li>
220
+						<li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>"  class="lasso-toolbar--component__parallax"></li>
221
+						<li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>"  class="lasso-toolbar--component__audio"></li>
222
+						<li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>"  class="lasso-toolbar--component__video"></li>
223
+						<li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>"  class="lasso-toolbar--component__map"></li>
224
+						<li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>"  class="lasso-toolbar--component__timeline"></li>
225
+						<li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>"  class="lasso-toolbar--component__document"></li>
226
+						<li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>"  class="lasso-toolbar--component__collection"></li>
227
+						<li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>"  class="lasso-toolbar--component__gallery"></li>
228
+						<?php if (class_exists('Aesop_GalleryPop')) { ?>
229
+						     <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>"  class="lasso-toolbar--component__gallerypop"></li>
230 230
 						<?php }?>
231 231
 					<?php else: ?>
232
-						<li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li>
233
-						<li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li>
234
-						<!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li-->
232
+						<li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li>
233
+						<li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li>
234
+						<!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li-->
235 235
 					<?php endif; ?>
236
-					<?php do_action( 'lasso_toolbar_components' );?>
236
+					<?php do_action('lasso_toolbar_components'); ?>
237 237
 			    </ul>
238 238
 			</li>
239 239
 		</ul>
@@ -249,22 +249,22 @@  discard block
 block discarded – undo
249 249
  */
250 250
 function lasso_editor_settings_toolbar() {
251 251
 
252
-	$delete_nonce = wp_create_nonce( 'lasso-delete-nonce' );
252
+	$delete_nonce = wp_create_nonce('lasso-delete-nonce');
253 253
 
254 254
 	ob_start();
255 255
 
256
-	if ( !lasso_user_can() )
256
+	if (!lasso_user_can())
257 257
 		return;
258 258
 
259 259
 	// let users add custom css classes
260
-	$custom_classes = apply_filters( 'lasso_component_classes', '' );
260
+	$custom_classes = apply_filters('lasso_component_classes', '');
261 261
 
262 262
 	?>
263
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
264
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
265
-		<li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
266
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
267
-		<li class="lasso-delete" data-postid="<?php echo get_the_ID();?>" data-nonce="<?php echo $delete_nonce;?>" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
263
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
264
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
265
+		<li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
266
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
267
+		<li class="lasso-delete" data-postid="<?php echo get_the_ID(); ?>" data-nonce="<?php echo $delete_nonce; ?>" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
268 268
 	</ul>
269 269
 
270 270
 	<?php return ob_get_clean();
@@ -280,17 +280,17 @@  discard block
 block discarded – undo
280 280
 
281 281
 	ob_start();
282 282
 
283
-	if ( !lasso_user_can() )
283
+	if (!lasso_user_can())
284 284
 		return;
285 285
 
286 286
 	// has post thumbnail
287
-	$has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false;
287
+	$has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false;
288 288
 
289 289
 	?>
290
-	<ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>>
291
-		<li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li>
292
-		<li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li>
293
-		<li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li>
290
+	<ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>>
291
+		<li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li>
292
+		<li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li>
293
+		<li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li>
294 294
 	</ul>
295 295
 
296 296
 	<?php return ob_get_clean();
@@ -309,55 +309,55 @@  discard block
 block discarded – undo
309 309
 
310 310
 	ob_start();
311 311
 
312
-	if ( !lasso_user_can() )
312
+	if (!lasso_user_can())
313 313
 		return;
314 314
 
315 315
 	global $post;
316 316
 
317 317
 	$postid = get_the_ID();
318 318
 
319
-	$status = get_post_status( $postid );
320
-	$nonce = wp_create_nonce( 'lasso-update-post-settings' );
319
+	$status = get_post_status($postid);
320
+	$nonce = wp_create_nonce('lasso-update-post-settings');
321 321
 
322 322
 	// let users add custom css classes
323
-	$custom_classes = apply_filters( 'lasso_modal_settings_classes', '' );
323
+	$custom_classes = apply_filters('lasso_modal_settings_classes', '');
324 324
 
325 325
 	// objects categories
326
-	$categories 		= lasso_get_post_objects( $postid, 'category' );
327
-	$tags 				= lasso_get_post_objects( $postid, 'tag' );
326
+	$categories = lasso_get_post_objects($postid, 'category');
327
+	$tags = lasso_get_post_objects($postid, 'tag');
328 328
 
329 329
 	// modal tabs
330
-	$tabs  				= lasso_modal_addons('tab');
331
-	$content 			= lasso_modal_addons('content');
330
+	$tabs = lasso_modal_addons('tab');
331
+	$content = lasso_modal_addons('content');
332 332
 
333 333
 	// are we singular
334
-	$is_singular 		= is_singular();
334
+	$is_singular = is_singular();
335 335
 	$is_singular_class 	= $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col';
336 336
 	$has_thumb_class    = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail';
337 337
 	$theme_supports     = current_theme_supports('post-thumbnails');
338
-	$default_image 		= LASSO_URL.'/admin/assets/img/empty-img.png';
338
+	$default_image = LASSO_URL.'/admin/assets/img/empty-img.png';
339 339
 
340 340
 ?>
341
-	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>">
341
+	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>">
342 342
 		<div class="lasso--modal__inner">
343 343
 
344
-			<?php if( $tabs ) { echo $tabs; } ?>
344
+			<?php if ($tabs) { echo $tabs; } ?>
345 345
 
346 346
 			<div class="lasso--modal__content modal__content--core visible" data-addon-content="core">
347
-				<form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" >
347
+				<form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" >
348 348
 
349
-					<?php if ( $is_singular && $theme_supports ) : ?>
349
+					<?php if ($is_singular && $theme_supports) : ?>
350 350
 					<div class="lasso--postsettings__left">
351
-						<label><?php _e( 'Featured Image', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the featured image for this post.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
352
-						<div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>">
351
+						<label><?php _e('Featured Image', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the featured image for this post.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
352
+						<div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>">
353 353
 
354 354
 							<div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls">
355
-								<i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i>
356
-								<i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i>
355
+								<i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i>
356
+								<i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i>
357 357
 								<i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i>
358 358
 							</div>
359 359
 
360
-							<?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?>
360
+							<?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?>
361 361
 
362 362
 						</div>
363 363
 						<div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div>
@@ -367,12 +367,12 @@  discard block
 block discarded – undo
367 367
 
368 368
 					<div class="lasso--postsettings__right">
369 369
 
370
-						<?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?>
370
+						<?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?>
371 371
 						<div class="lasso--postsettings__option story-status-option">
372
-							<label><?php _e( 'Status', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the status of the post to draft or publish.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
373
-							<ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>">
374
-								<li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li>
375
-								<li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li>
372
+							<label><?php _e('Status', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the status of the post to draft or publish.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
373
+							<ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>">
374
+								<li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li>
375
+								<li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li>
376 376
 							</ul>
377 377
 							<div class="lasso--slider_wrap">
378 378
 								<div id="lasso--slider"></div>
@@ -380,10 +380,10 @@  discard block
 block discarded – undo
380 380
 						</div>
381 381
 						<?php endif; ?>
382 382
 
383
-						<?php if ( 'publish' == $status ): ?>
383
+						<?php if ('publish' == $status): ?>
384 384
 						<div class="lasso--postsettings__option story-slug-option">
385
-							<label><?php _e( 'Post URL', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the URL (slug) of this post.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
386
-							<input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>">
385
+							<label><?php _e('Post URL', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the URL (slug) of this post.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
386
+							<input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>">
387 387
 						</div>
388 388
 						<?php endif; ?>
389 389
 
@@ -392,34 +392,34 @@  discard block
 block discarded – undo
392 392
 					<div class="lasso--postsettings__middle">
393 393
 
394 394
 						<div class="lasso--postsettings__option story-categories-option">
395
-							<label><?php _e( 'Categories', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Type a category name and press enter.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
396
-							<input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>">
395
+							<label><?php _e('Categories', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Type a category name and press enter.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
396
+							<input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>">
397 397
 						</div>
398 398
 
399 399
 						<div class="lasso--postsettings__option story-tags-option">
400
-							<label><?php _e( 'Tags', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Type a tag name and press enter.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
401
-							<input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>">
400
+							<label><?php _e('Tags', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Type a tag name and press enter.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
401
+							<input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>">
402 402
 						</div>
403 403
 
404 404
 					</div>
405 405
 
406
-					<?php do_action( 'lasso_modal_post_form' ); // action ?>
406
+					<?php do_action('lasso_modal_post_form'); // action ?>
407 407
 
408 408
 					<div class="lasso--postsettings__footer" style="display:none;">
409
-						<a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a>
409
+						<a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a>
410 410
 						<input type="hidden" name="status" value="">
411 411
 						<input type="hidden" name="categories" value="">
412
-						<input type="hidden" name="postid" value="<?php echo get_the_ID();?>">
412
+						<input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>">
413 413
 						<input type="hidden" name="action" value="process_update-object_post">
414
-						<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
415
-						<?php do_action( 'lasso_modal_post_form_footer' ); // action ?>
416
-						<input type="submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>">
414
+						<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
415
+						<?php do_action('lasso_modal_post_form_footer'); // action ?>
416
+						<input type="submit" value="<?php esc_attr_e('Save', 'lasso'); ?>">
417 417
 					</div>
418 418
 
419 419
 				</form>
420 420
 			</div>
421 421
 
422
-			<?php if( $tabs ) { echo $content; } ?>
422
+			<?php if ($tabs) { echo $content; } ?>
423 423
 
424 424
 		</div>
425 425
 
@@ -440,41 +440,41 @@  discard block
 block discarded – undo
440 440
 
441 441
 	ob_start();
442 442
 
443
-	if ( !lasso_user_can('edit_posts') )
443
+	if (!lasso_user_can('edit_posts'))
444 444
 		return;
445 445
 
446
-	$status = get_post_status( get_the_ID() );
446
+	$status = get_post_status(get_the_ID());
447 447
 
448
-	$nonce = wp_create_nonce( 'lasso-editor-new-post' );
448
+	$nonce = wp_create_nonce('lasso-editor-new-post');
449 449
 
450 450
 	// let users add custom css classes
451
-	$custom_classes = apply_filters( 'lasso_modal_post_classes', '' );
451
+	$custom_classes = apply_filters('lasso_modal_post_classes', '');
452 452
 
453 453
 	// return the post type
454
-	$type = get_post_type( get_the_ID() );
454
+	$type = get_post_type(get_the_ID());
455 455
 
456 456
 	?>
457
-	<div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>">
457
+	<div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>">
458 458
 		<div class="lasso--modal__inner">
459 459
 
460 460
 			<form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form">
461 461
 
462 462
 				<div class="lasso--postsettings__option story-slug-option lasso--last-option">
463
-					<label><?php esc_attr_e( 'New <span>post</span> title', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Specify title for new post, then save to edit.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
464
-					<input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Grump Wizards Make Toxic Brew', 'lasso' );?>">
463
+					<label><?php esc_attr_e('New <span>post</span> title', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Specify title for new post, then save to edit.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
464
+					<input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Grump Wizards Make Toxic Brew', 'lasso'); ?>">
465 465
 						<div class="lasso--select-wrap" style="width:90px">
466 466
 						<select id="lasso--select-type" name="story_type">
467 467
 
468 468
 							<?php
469 469
 								$types = lasso_post_types();
470 470
 
471
-								if ( !empty( $types ) ) {
471
+								if (!empty($types)) {
472 472
 
473
-									foreach( $types as $type ) {
473
+									foreach ($types as $type) {
474 474
 
475
-										$type = preg_replace( '/s\b/','', $type );
475
+										$type = preg_replace('/s\b/', '', $type);
476 476
 
477
-										printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $type ) ) );
477
+										printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($type)));
478 478
 									}
479 479
 
480 480
 								}
@@ -485,11 +485,11 @@  discard block
 block discarded – undo
485 485
 				</div>
486 486
 
487 487
 				<div class="lasso--postsettings__footer" style="display:none;">
488
-					<a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a>
488
+					<a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a>
489 489
 					<input type="hidden" name="action" value="process_new-object_post">
490 490
 					<input type="hidden" name="object" value="post">
491
-					<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
492
-					<input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>">
491
+					<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
492
+					<input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>">
493 493
 				</div>
494 494
 
495 495
 			</form>
@@ -513,18 +513,18 @@  discard block
 block discarded – undo
513 513
 	ob_start();
514 514
 
515 515
 	// post status
516
-	$status = get_post_status( get_the_ID() );
516
+	$status = get_post_status(get_the_ID());
517 517
 
518 518
 	// let users add custom css classes
519
-	$custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' );
519
+	$custom_classes = apply_filters('lasso_modal_all_post_classes', '');
520 520
 
521 521
 	?>
522
-	<div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>">
522
+	<div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>">
523 523
 		<div class="lasso--modal__inner">
524 524
 
525 525
 			<div class="lasso--post-filtering not-visible">
526 526
 				<div class="lasso--search__results">
527
-					<span id="lasso--results-found"></span><?php _e('results found','lasso');?>
527
+					<span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?>
528 528
 				</div>
529 529
 				<div class="lasso--search">
530 530
 					<i id="lasso--search__toggle" class="dashicons dashicons-search"></i>
@@ -537,16 +537,16 @@  discard block
 block discarded – undo
537 537
 
538 538
 				$post_types = lasso_post_types_names();
539 539
 
540
-				if ( ! empty( $post_types ) ) {
540
+				if (!empty($post_types)) {
541 541
 					$first = 'active';
542
-					foreach( $post_types as $name => $label ) {
543
-						printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $name ), esc_attr( $label ) );
542
+					foreach ($post_types as $name => $label) {
543
+						printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($name), esc_attr($label));
544 544
 						$first = '';
545 545
 					}
546 546
 
547 547
 				}
548 548
 
549
-				do_action('lasso_modal_post_objects');?>
549
+				do_action('lasso_modal_post_objects'); ?>
550 550
 
551 551
 			</ul>
552 552
 			<div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div>
@@ -564,18 +564,18 @@  discard block
 block discarded – undo
564 564
 
565 565
 	ob_start();
566 566
 
567
-	if ( !lasso_user_can() )
567
+	if (!lasso_user_can())
568 568
 		return;
569 569
 
570 570
 	// let users add custom css classes
571
-	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
571
+	$custom_classes = apply_filters('lasso_wpimg_classes', '');
572 572
 
573 573
 	?>
574
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
575
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
576
-		<li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
577
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
578
-		<li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
574
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
575
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
576
+		<li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
577
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
578
+		<li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
579 579
 	</ul>
580 580
 
581 581
 	<?php return ob_get_clean();
@@ -585,18 +585,18 @@  discard block
 block discarded – undo
585 585
 
586 586
 	ob_start();
587 587
 
588
-	if ( !lasso_user_can() )
588
+	if (!lasso_user_can())
589 589
 		return;
590 590
 
591 591
 	// let users add custom css classes
592
-	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
592
+	$custom_classes = apply_filters('lasso_wpimg_classes', '');
593 593
 
594 594
 	?>
595
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
596
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
597
-		<li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
598
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
599
-		<li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
595
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
596
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
597
+		<li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
598
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
599
+		<li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
600 600
 	</ul>
601 601
 
602 602
 	<?php return ob_get_clean();
@@ -609,16 +609,16 @@  discard block
 block discarded – undo
609 609
  */
610 610
 function lasso_map_form_footer() {
611 611
 
612
-	$nonce = wp_create_nonce( 'lasso-process-map' );
612
+	$nonce = wp_create_nonce('lasso-process-map');
613 613
 
614 614
 	ob_start();
615 615
 
616 616
 	?>
617 617
 	<div class="lasso--map-form__footer">
618
-		<input type="hidden" name="postid" value="<?php echo get_the_ID();?>">
619
-		<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
618
+		<input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>">
619
+		<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
620 620
 		<input type="hidden" name="action" value="process_map_save">
621
-		<input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>">
621
+		<input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>">
622 622
 	</div>
623 623
 
624 624
 	<?php return ob_get_clean();
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
 
637 637
 	?>
638 638
 	<div id="lasso--pagerefresh" class="visible">
639
-		<?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?>
639
+		<?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?>
640 640
 	</div>
641 641
 
642 642
 	<?php return ob_get_clean();
@@ -650,43 +650,43 @@  discard block
 block discarded – undo
650 650
  */
651 651
 function lasso_editor_options_blob() {
652 652
 
653
-	$codes   = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : apply_filters( 'lasso_custom_options', '' );
654
-	$galleries  = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
653
+	$codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : apply_filters('lasso_custom_options', '');
654
+	$galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
655 655
 
656
-	$nonce = wp_create_nonce( 'lasso_gallery' );
656
+	$nonce = wp_create_nonce('lasso_gallery');
657 657
 
658 658
 	$blob = array();
659 659
 
660
-	if ( empty( $codes ) )
660
+	if (empty($codes))
661 661
 		return;
662 662
 
663
-	foreach ( $codes as $slug => $shortcode ) {
663
+	foreach ($codes as $slug => $shortcode) {
664 664
 		$return = '';
665 665
 		// Shortcode has atts
666 666
 
667
-		if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) {
667
+		if (count($shortcode['atts']) && $shortcode['atts']) {
668 668
 
669
-			foreach ( $shortcode['atts'] as $attr_name => $attr_info ) {
669
+			foreach ($shortcode['atts'] as $attr_name => $attr_info) {
670 670
 
671 671
 
672
-				$prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null;
672
+				$prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null;
673 673
 
674 674
 				$return .= '<form id="lasso--component-settings-form" class="'.$galleries.'" method="post">';
675 675
 				$return .= '<p data-option="'.$attr_name.'" class="lasso-option lasso-'.$slug.'-'.$attr_name.'">';
676
-				$return .= '<label for="lasso-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>';
676
+				$return .= '<label for="lasso-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>';
677 677
 				$return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>';
678 678
 				// Select
679 679
 
680
-				if ( isset( $attr_info['values'] ) ) {
680
+				if (isset($attr_info['values'])) {
681 681
 
682
-					$return .= '<select name="' . $attr_name . '" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr">';
682
+					$return .= '<select name="'.$attr_name.'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr">';
683 683
 
684
-					$i=0;
684
+					$i = 0;
685 685
 
686
-					foreach ( $attr_info['values'] as $attr_value ) {
686
+					foreach ($attr_info['values'] as $attr_value) {
687 687
 						$attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : '';
688 688
 
689
-						$return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>';
689
+						$return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>';
690 690
 
691 691
 						$i++;
692 692
 					}
@@ -695,24 +695,24 @@  discard block
 block discarded – undo
695 695
 
696 696
 				} else {
697 697
 
698
-					$attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text';
698
+					$attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text';
699 699
 
700 700
 					// image upload
701
-					if ( 'media_upload' == $attr_info['type'] ) {
701
+					if ('media_upload' == $attr_info['type']) {
702 702
 
703
-						$return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />';
703
+						$return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />';
704 704
 						$return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>';
705 705
 
706
-					} elseif ( 'color' == $attr_info['type'] ) {
706
+					} elseif ('color' == $attr_info['type']) {
707 707
 
708
-						$return .= '<input type="color" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />';
708
+						$return .= '<input type="color" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />';
709 709
 
710
-					} elseif ( 'text_area' == $attr_info['type'] ) {
710
+					} elseif ('text_area' == $attr_info['type']) {
711 711
 
712
-						$return .= '<textarea name="' . $attr_name . '" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.'';
712
+						$return .= '<textarea name="'.$attr_name.'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.'';
713 713
 
714 714
 					} else {
715
-						$return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'.$prefix.'';
715
+						$return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'.$prefix.'';
716 716
 					}
717 717
 				}
718 718
 				$return .= '</p>';
@@ -723,9 +723,9 @@  discard block
 block discarded – undo
723 723
 		///////////////////////////
724 724
 		// START GALLERY AND MAP FRONT END STUFFS
725 725
 		///////////////////////////
726
-		if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) {
726
+		if (isset($shortcode['front']) && true == $shortcode['front']) {
727 727
 
728
-			if ( 'gallery' == $shortcode['front_type'] ) {
728
+			if ('gallery' == $shortcode['front_type']) {
729 729
 
730 730
 				$return .= lasso_gallery_editor_module();
731 731
 
@@ -736,13 +736,13 @@  discard block
 block discarded – undo
736 736
 		///////////////////////////
737 737
 
738 738
 		// Single shortcode (not closed)
739
-		if ( 'single' == $shortcode['type'] ) {
739
+		if ('single' == $shortcode['type']) {
740 740
 
741 741
 			$return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />';
742 742
 
743 743
 		} else {
744 744
 
745
-			$return .= '<p data-option="content" class="lasso-option lasso-c-comp-text"><label>' . __( 'Content', 'lasso' ) . '</label><textarea type="text" name="lasso-generator-content" id="lasso-generator-content" value="' . $shortcode['content'] . '" /></textarea></p>';
745
+			$return .= '<p data-option="content" class="lasso-option lasso-c-comp-text"><label>'.__('Content', 'lasso').'</label><textarea type="text" name="lasso-generator-content" id="lasso-generator-content" value="'.$shortcode['content'].'" /></textarea></p>';
746 746
 		}
747 747
 
748 748
 		$return .= '<p class="lasso-buttoninsert-wrap"><a href="#" class="lasso-generator-cancel" id="lasso--sidebar__close">Cancel
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
 				<div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div>
776 776
 				<div id="lasso--hide" style="display:none;" class="lasso--post-form">
777 777
 					<i class="lasso-icon lasso-icon-move"></i>
778
-					<label><?php _e( 'Revisions', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Use the slider to view the revision live on the page.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label>
778
+					<label><?php _e('Revisions', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Use the slider to view the revision live on the page.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label>
779 779
 					<div class="lasso--slider_wrap">
780 780
 						<div id="lasso--slider"></div>
781 781
 					</div>
Please login to merge, or discard this patch.
lasso.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,27 +18,27 @@
 block discarded – undo
18 18
  */
19 19
 
20 20
 // If this file is called directly, abort.
21
-if ( ! defined( 'WPINC' ) ) {
21
+if (!defined('WPINC')) {
22 22
 	die;
23 23
 }
24 24
 
25 25
 // Set some constants
26
-define( 'LASSO_VERSION', '0.9.10.5' );
27
-define( 'LASSO_DIR', plugin_dir_path( __FILE__ ) );
28
-define( 'LASSO_URL', plugins_url( '', __FILE__ ) );
29
-define( 'LASSO_FILE', __FILE__ );
26
+define('LASSO_VERSION', '0.9.10.5');
27
+define('LASSO_DIR', plugin_dir_path(__FILE__));
28
+define('LASSO_URL', plugins_url('', __FILE__));
29
+define('LASSO_FILE', __FILE__);
30 30
 
31 31
 /**
32 32
  * Load plugin if PHP version is 5.4 or later.
33 33
  */
34
-if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) {
34
+if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
35 35
 
36
-	include_once( LASSO_DIR . '/bootstrap.php' );
36
+	include_once(LASSO_DIR.'/bootstrap.php');
37 37
 
38 38
 } else {
39 39
 
40 40
 	add_action('admin_head', 'lasso_fail_notice');
41
-	function lasso_fail_notice(){
41
+	function lasso_fail_notice() {
42 42
 
43 43
 		printf('<div class="error"><p>Lasso requires PHP 5.4 or higher.</p></div>');
44 44
 
Please login to merge, or discard this patch.
public/includes/components.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -16,76 +16,76 @@  discard block
 block discarded – undo
16 16
 
17 17
 	$array = array(
18 18
 		'quote' => array(
19
-			'name'    => __('Quote','lasso'),
19
+			'name'    => __('Quote', 'lasso'),
20 20
 			'content' => lasso_quote_component(),
21 21
 		),
22 22
 		'image' => array(
23
-			'name'    => __('Image','lasso'),
23
+			'name'    => __('Image', 'lasso'),
24 24
 			'content' => lasso_image_component(),
25 25
 		),
26 26
 		'parallax' => array(
27
-			'name'    => __('Parallax','lasso'),
27
+			'name'    => __('Parallax', 'lasso'),
28 28
 			'content' => lasso_parallax_component(),
29 29
 		),
30 30
 		'audio' => array(
31
-			'name'    => __('Audio','lasso'),
31
+			'name'    => __('Audio', 'lasso'),
32 32
 			'content' => lasso_audio_component(),
33 33
 		),
34 34
 		'content' => array(
35
-			'name'    => __('Content','lasso'),
35
+			'name'    => __('Content', 'lasso'),
36 36
 			'content' => lasso_content_component(),
37 37
 		),
38 38
 		'character' => array(
39
-			'name'    => __('Character','lasso'),
39
+			'name'    => __('Character', 'lasso'),
40 40
 			'content' => lasso_character_component(),
41 41
 		),
42 42
 		'collection' => array(
43
-			'name'    => __('Collection','lasso'),
43
+			'name'    => __('Collection', 'lasso'),
44 44
 			'content' => lasso_collections_component(),
45 45
 		),
46 46
 		'document' => array(
47
-			'name'    => __('Document','lasso'),
47
+			'name'    => __('Document', 'lasso'),
48 48
 			'content' => lasso_document_component(),
49 49
 		),
50 50
 		'gallery' => array(
51
-			'name'    => __('Gallery','lasso'),
51
+			'name'    => __('Gallery', 'lasso'),
52 52
 			'content' => lasso_gallery_component(),
53 53
 		),
54 54
 		'chapter' => array(
55
-			'name'    => __('Chapter','lasso'),
55
+			'name'    => __('Chapter', 'lasso'),
56 56
 			'content' => lasso_heading_component(),
57 57
 		),
58 58
 		'map' => array(
59
-			'name'    => __('Map','lasso'),
59
+			'name'    => __('Map', 'lasso'),
60 60
 			'content' => lasso_map_component(),
61 61
 		),
62 62
 		'timeline_stop' => array(
63
-			'name'    => __('Timeline','lasso'),
63
+			'name'    => __('Timeline', 'lasso'),
64 64
 			'content' => lasso_timeline_component(),
65 65
 		),
66 66
 		'video' => array(
67
-			'name'    => __('Video','lasso'),
67
+			'name'    => __('Video', 'lasso'),
68 68
 			'content' => lasso_video_component(),
69 69
 		),
70 70
 		'wpimg' => array(
71
-			'name'    => __('WordPress Image','lasso'),
71
+			'name'    => __('WordPress Image', 'lasso'),
72 72
 			'content' => lasso_wp_image(),
73 73
 		),
74 74
 		'wpquote' => array(
75
-			'name'    => __('WordPress Quote','lasso'),
75
+			'name'    => __('WordPress Quote', 'lasso'),
76 76
 			'content' => lasso_wp_quote(),
77 77
 		),
78 78
 		'gallery_pop' => array(
79
-			'name'    => __('Gallery Pop','lasso'),
79
+			'name'    => __('Gallery Pop', 'lasso'),
80 80
 			'content' => lasso_gallery_pop_component(),
81 81
 		),
82 82
 		'wpvideo' => array(
83
-			'name'    => __('WordPress Image','lasso'),
83
+			'name'    => __('WordPress Image', 'lasso'),
84 84
 			'content' => lasso_wp_video(),
85 85
 		),
86 86
 	);
87 87
 
88
-	return apply_filters( 'lasso_components', $array );
88
+	return apply_filters('lasso_components', $array);
89 89
 }
90 90
 
91 91
 /**
@@ -111,132 +111,132 @@  discard block
 block discarded – undo
111 111
  */
112 112
 
113 113
 // 1
114
-if ( !function_exists( 'lasso_quote_component' ) ):
114
+if (!function_exists('lasso_quote_component')):
115 115
 	function lasso_quote_component() {
116 116
 
117
-		return do_shortcode( '[aesop_quote quote="The Universe is made of stories, not of atoms."]' );
117
+		return do_shortcode('[aesop_quote quote="The Universe is made of stories, not of atoms."]');
118 118
 	}
119 119
 endif;
120 120
 
121 121
 // 2
122
-if ( !function_exists( 'lasso_image_component' ) ):
122
+if (!function_exists('lasso_image_component')):
123 123
 	function lasso_image_component() {
124 124
 
125
-		return do_shortcode( '[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="800px"]' );
125
+		return do_shortcode('[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="800px"]');
126 126
 	}
127 127
 endif;
128 128
 
129 129
 // 3
130
-if ( !function_exists( 'lasso_parallax_component' ) ):
130
+if (!function_exists('lasso_parallax_component')):
131 131
 	function lasso_parallax_component() {
132 132
 
133
-		return do_shortcode( '[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]' );
133
+		return do_shortcode('[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]');
134 134
 	}
135 135
 endif;
136 136
 
137 137
 // 4
138
-if ( !function_exists( 'lasso_audio_component' ) ):
138
+if (!function_exists('lasso_audio_component')):
139 139
 	function lasso_audio_component() {
140 140
 
141
-		return do_shortcode( '[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]' );
141
+		return do_shortcode('[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]');
142 142
 
143 143
 	}
144 144
 endif;
145 145
 
146 146
 // 5
147
-if ( !function_exists( 'lasso_content_component' ) ):
147
+if (!function_exists('lasso_content_component')):
148 148
 	function lasso_content_component() {
149 149
 
150
-		return do_shortcode( '[aesop_content]Start typing here...[/aesop_content]' );
150
+		return do_shortcode('[aesop_content]Start typing here...[/aesop_content]');
151 151
 	}
152 152
 endif;
153 153
 
154 154
 // 6
155
-if ( !function_exists( 'lasso_character_component' ) ):
155
+if (!function_exists('lasso_character_component')):
156 156
 	function lasso_character_component() {
157 157
 
158
-		return do_shortcode( '[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]' );
158
+		return do_shortcode('[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]');
159 159
 
160 160
 	}
161 161
 endif;
162 162
 
163 163
 // 7
164
-if ( !function_exists( 'lasso_collections_component' ) ):
164
+if (!function_exists('lasso_collections_component')):
165 165
 	function lasso_collections_component() {
166 166
 
167
-		return do_shortcode( '[aesop_collection]' );
167
+		return do_shortcode('[aesop_collection]');
168 168
 	}
169 169
 endif;
170 170
 
171 171
 // 8
172
-if ( !function_exists( 'lasso_document_component' ) ):
172
+if (!function_exists('lasso_document_component')):
173 173
 	function lasso_document_component() {
174 174
 
175
-		return do_shortcode( '[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]' );
175
+		return do_shortcode('[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]');
176 176
 
177 177
 	}
178 178
 endif;
179 179
 
180 180
 // 9
181
-if ( !function_exists( 'lasso_gallery_component' ) ):
181
+if (!function_exists('lasso_gallery_component')):
182 182
 	function lasso_gallery_component() {
183 183
 
184
-		return do_shortcode( '[aesop_gallery]' );
184
+		return do_shortcode('[aesop_gallery]');
185 185
 
186 186
 	}
187 187
 endif;
188 188
 
189 189
 // 10
190
-if ( !function_exists( 'lasso_heading_component' ) ):
190
+if (!function_exists('lasso_heading_component')):
191 191
 	function lasso_heading_component() {
192 192
 
193
-		return do_shortcode( '[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]' );
193
+		return do_shortcode('[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]');
194 194
 	}
195 195
 endif;
196 196
 
197 197
 // 11
198
-if ( !function_exists( 'lasso_map_component' ) ):
198
+if (!function_exists('lasso_map_component')):
199 199
 	function lasso_map_component() {
200 200
 
201 201
 		return '<form id="lasso--map-form" class="aesop-component aesop-map-component lasso--map-drag-holder" enctype="multipart/form-data">
202 202
 				'.lasso_map_form_footer().'
203
-				'.do_shortcode( '[aesop_map sticky="off"]' ).'
203
+				'.do_shortcode('[aesop_map sticky="off"]').'
204 204
 			</form>';
205 205
 
206 206
 	}
207 207
 endif;
208 208
 
209 209
 // 12
210
-if ( !function_exists( 'lasso_timeline_component' ) ):
210
+if (!function_exists('lasso_timeline_component')):
211 211
 	function lasso_timeline_component() {
212 212
 
213
-		return do_shortcode( '[aesop_timeline_stop num="Title" title="2014"]' );
213
+		return do_shortcode('[aesop_timeline_stop num="Title" title="2014"]');
214 214
 
215 215
 	}
216 216
 endif;
217 217
 
218 218
 // 13
219
-if ( !function_exists( 'lasso_video_component' ) ):
219
+if (!function_exists('lasso_video_component')):
220 220
 	function lasso_video_component() {
221 221
 
222
-		return do_shortcode( '[aesop_video src="vimeo" id="59940289" width="100%" align="center"]' );
222
+		return do_shortcode('[aesop_video src="vimeo" id="59940289" width="100%" align="center"]');
223 223
 
224 224
 	}
225 225
 endif;
226 226
 
227 227
 // 14 - since 0.9.1
228
-if ( !function_exists('lasso_wp_image') ):
228
+if (!function_exists('lasso_wp_image')):
229 229
 
230
-	function lasso_wp_image(){
230
+	function lasso_wp_image() {
231 231
 		return '<div data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img class="wp-image-0" src="'.LASSO_URL.'/public/assets/img/empty-img.png"></div>';
232 232
 	}
233 233
 
234 234
 endif;
235 235
 
236 236
 // 15 - since 0.9.2
237
-if ( !function_exists('lasso_wp_quote') ):
237
+if (!function_exists('lasso_wp_quote')):
238 238
 
239
-	function lasso_wp_quote(){
239
+	function lasso_wp_quote() {
240 240
 		return '<blockquote data-component-type="wpquote" class="lasso--wpquote lasso-component"><p>The universe is made of stories.</p></blockquote>';
241 241
 	}
242 242
 
@@ -244,16 +244,16 @@  discard block
 block discarded – undo
244 244
 
245 245
 // 16 gallery pop added but not fully supported as of 0.9.9.11 
246 246
 
247
-if ( !function_exists( 'lasso_gallery_pop_component' ) ):
247
+if (!function_exists('lasso_gallery_pop_component')):
248 248
 	function lasso_gallery_pop_component() {
249
-		return do_shortcode( '[aesop_gallery_pop]' );
249
+		return do_shortcode('[aesop_gallery_pop]');
250 250
 	}
251 251
 endif;
252 252
 
253 253
 // 17 - work in progress
254
-if ( !function_exists('lasso_wp_video') ):
254
+if (!function_exists('lasso_wp_video')):
255 255
 
256
-	function lasso_wp_video(){
256
+	function lasso_wp_video() {
257 257
 		return '<div data-component-type="wpvideo" class="lasso--wpvideo__wrap lasso-component"><video class="wp-video-0"></video>';
258 258
 	}
259 259
 
Please login to merge, or discard this patch.
public/includes/assets.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	public function scripts(){
19 19
 
20 20
 	
21
-        // for now editus is disabled for mobile. it will be reenabled when mobile platforms are better supported
21
+		// for now editus is disabled for mobile. it will be reenabled when mobile platforms are better supported
22 22
 		if ( lasso_user_can('edit_posts')) {
23 23
 
24 24
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
@@ -181,15 +181,15 @@  discard block
 block discarded – undo
181 181
 			if ($show_color) {
182 182
 				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'iris'), LASSO_VERSION, true);
183 183
 			} else {
184
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery'), LASSO_VERSION, true);
184
+				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery'), LASSO_VERSION, true);
185 185
 			}
186 186
 			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
187 187
 			
188 188
 			//enqueue js if tour is not hidden 
189
-            		$tour_hidden = get_user_meta( get_current_user_ID(), 'lasso_hide_tour', true );
190
-    			if ( lasso_user_can() && !$tour_hidden ){
191
-                		wp_enqueue_script('lasso-tour', LASSO_URL. "/public/assets/js/tour.js", array('jquery', 'lasso'), LASSO_VERSION, true);
192
-    			}
189
+					$tour_hidden = get_user_meta( get_current_user_ID(), 'lasso_hide_tour', true );
190
+				if ( lasso_user_can() && !$tour_hidden ){
191
+						wp_enqueue_script('lasso-tour', LASSO_URL. "/public/assets/js/tour.js", array('jquery', 'lasso'), LASSO_VERSION, true);
192
+				}
193 193
 
194 194
 		}
195 195
 
Please login to merge, or discard this patch.
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -10,16 +10,16 @@  discard block
 block discarded – undo
10 10
 
11 11
 class assets {
12 12
 
13
-	public function __construct(){
13
+	public function __construct() {
14 14
 
15
-		add_action('wp_enqueue_scripts', array($this,'scripts'));
15
+		add_action('wp_enqueue_scripts', array($this, 'scripts'));
16 16
 	}
17 17
 
18
-	public function scripts(){
18
+	public function scripts() {
19 19
 
20 20
 	
21 21
         // for now editus is disabled for mobile. it will be reenabled when mobile platforms are better supported
22
-		if ( lasso_user_can('edit_posts')) {
22
+		if (lasso_user_can('edit_posts')) {
23 23
 
24 24
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
25 25
 
@@ -34,21 +34,21 @@  discard block
 block discarded – undo
34 34
 			// url for json api
35 35
 			$home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false;
36 36
 
37
-			$article_object 	= lasso_editor_get_option('article_class','lasso_editor');
37
+			$article_object 	= lasso_editor_get_option('article_class', 'lasso_editor');
38 38
 
39
-			$article_object 	= empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
39
+			$article_object 	= empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
40 40
 
41
-			$featImgClass 		= lasso_editor_get_option('featimg_class','lasso_editor');
42
-			if (empty( $featImgClass )) {
41
+			$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
42
+			if (empty($featImgClass)) {
43 43
 				$featImgClass = lasso_get_supported_theme_featured_image_class();
44 44
 			}
45
-			$titleClass 		= lasso_editor_get_option('title_class','lasso_editor');
46
-			if (empty( $titleClass )) {
45
+			$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
46
+			if (empty($titleClass)) {
47 47
 				$titleClass = lasso_get_supported_theme_title_class();
48 48
 			}
49
-			$toolbar_headings  	= lasso_editor_get_option('toolbar_headings', 'lasso_editor');
50
-			$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
51
-			$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
49
+			$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
50
+			$objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor');
51
+			$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
52 52
 
53 53
 			
54 54
 			//text alignement
@@ -59,74 +59,74 @@  discard block
 block discarded – undo
59 59
 			
60 60
 			if ($show_color) {
61 61
 				//color picker
62
-				wp_enqueue_style( 'wp-color-picker' );
63
-				wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
62
+				wp_enqueue_style('wp-color-picker');
63
+				wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1);
64 64
 			}
65 65
 
66 66
 
67 67
 
68 68
 			// post id reference
69
-			$postid 			= get_the_ID();
69
+			$postid = get_the_ID();
70 70
 
71 71
 			$strings = array(
72
-				'save' 				=> __('Save','lasso'),
73
-				'saving' 			=> __('Saving...','lasso'),
74
-				'saved'				=> __('Saved!','lasso'),
75
-				'adding' 			=> __('Adding...','lasso'),
76
-				'added'				=> __('Added!','lasso'),
77
-				'loading' 			=> __('Loading...','lasso'),
78
-				'loadMore'			=> __('Load More','lasso'),
79
-				'noPostsFound'		=> __('No more posts found','lasso'),
80
-				'fetchFail'	    	=> __('Fetching failed. REST API plugin may not have been installed or configured correctly.','lasso'),
81
-				'galleryCreated' 	=> __('Gallery Created!','lasso'),
82
-				'galleryUpdated' 	=> __('Gallery Updated!','lasso'),
83
-				'justWrite'			=> __('Just write...','lasso'),
84
-				'chooseImage'		=> __('Choose an image','lasso'),
85
-				'updateImage'		=> __('Update Image','lasso'),
86
-				'insertImage'		=> __('Insert Image','lasso'),
87
-				'selectImage'		=> __('Select Image','lasso'),
88
-				'removeFeatImg'     => __('Remove featured image?','lasso'),
89
-				'updateSelectedImg' => __('Update Selected Image','lasso'),
90
-				'chooseImages'		=> __('Choose images','lasso'),
91
-				'editImage'			=> __('Edit Image','lasso'),
92
-				'addImages'			=> __('Add Images','lasso'),
93
-				'addNewGallery'		=> __('Add New Gallery','lasso'),
94
-				'selectGallery'		=> __('Select Lasso Gallery Image','lasso'),
95
-				'useSelectedImages' => __('Use Selected Images','lasso'),
96
-				'publishPost'		=> __('Publish Post?','lasso'),
97
-				'publishYes'		=> __('Yes, publish it!','lasso'),
98
-				'deletePost'		=> __('Trash Post?','lasso'),
99
-				'deleteYes'			=> __('Yes, trash it!','lasso'),
100
-				'warning'			=> __('Oh snap!','laso'),
101
-				'cancelText'		=> __('O.K. got it!','lasso'),
102
-				'missingClass'		=> __('It looks like we are either missing the Article CSS class, or it is configured incorrectly. Editus will not function correctly without this CSS class.','lasso'),
72
+				'save' 				=> __('Save', 'lasso'),
73
+				'saving' 			=> __('Saving...', 'lasso'),
74
+				'saved'				=> __('Saved!', 'lasso'),
75
+				'adding' 			=> __('Adding...', 'lasso'),
76
+				'added'				=> __('Added!', 'lasso'),
77
+				'loading' 			=> __('Loading...', 'lasso'),
78
+				'loadMore'			=> __('Load More', 'lasso'),
79
+				'noPostsFound'		=> __('No more posts found', 'lasso'),
80
+				'fetchFail'	    	=> __('Fetching failed. REST API plugin may not have been installed or configured correctly.', 'lasso'),
81
+				'galleryCreated' 	=> __('Gallery Created!', 'lasso'),
82
+				'galleryUpdated' 	=> __('Gallery Updated!', 'lasso'),
83
+				'justWrite'			=> __('Just write...', 'lasso'),
84
+				'chooseImage'		=> __('Choose an image', 'lasso'),
85
+				'updateImage'		=> __('Update Image', 'lasso'),
86
+				'insertImage'		=> __('Insert Image', 'lasso'),
87
+				'selectImage'		=> __('Select Image', 'lasso'),
88
+				'removeFeatImg'     => __('Remove featured image?', 'lasso'),
89
+				'updateSelectedImg' => __('Update Selected Image', 'lasso'),
90
+				'chooseImages'		=> __('Choose images', 'lasso'),
91
+				'editImage'			=> __('Edit Image', 'lasso'),
92
+				'addImages'			=> __('Add Images', 'lasso'),
93
+				'addNewGallery'		=> __('Add New Gallery', 'lasso'),
94
+				'selectGallery'		=> __('Select Lasso Gallery Image', 'lasso'),
95
+				'useSelectedImages' => __('Use Selected Images', 'lasso'),
96
+				'publishPost'		=> __('Publish Post?', 'lasso'),
97
+				'publishYes'		=> __('Yes, publish it!', 'lasso'),
98
+				'deletePost'		=> __('Trash Post?', 'lasso'),
99
+				'deleteYes'			=> __('Yes, trash it!', 'lasso'),
100
+				'warning'			=> __('Oh snap!', 'laso'),
101
+				'cancelText'		=> __('O.K. got it!', 'lasso'),
102
+				'missingClass'		=> __('It looks like we are either missing the Article CSS class, or it is configured incorrectly. Editus will not function correctly without this CSS class.', 'lasso'),
103 103
 				'missingConfirm'	=> __('Update Settings', 'lasso'),
104
-				'helperText'		=> __('one more letter','lasso'),
104
+				'helperText'		=> __('one more letter', 'lasso'),
105 105
 				'editingBackup'  	=> __('You are currently editing a backup copy of this post.')
106 106
 			);
107 107
 
108
-			$api_url = trailingslashit( home_url() ) . 'lasso-internal-api';
108
+			$api_url = trailingslashit(home_url()).'lasso-internal-api';
109 109
 
110 110
 			$gallery_class = new gallery();
111 111
 			$gallery_nonce_action = $gallery_class->nonce_action;
112
-			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
112
+			$gallery_nonce = wp_create_nonce($gallery_nonce_action);
113 113
 
114 114
 			// localized objects
115 115
 			$objects = array(
116
-				'ajaxurl' 			=> esc_url( $api_url ),
117
-				'ajaxurl2' 			=> esc_url( admin_url( 'admin-ajax.php' )),
116
+				'ajaxurl' 			=> esc_url($api_url),
117
+				'ajaxurl2' 			=> esc_url(admin_url('admin-ajax.php')),
118 118
 				'editor' 			=> 'lasso--content', // ID of editable content (without #) DONT CHANGE
119 119
 				'article_object'	=> $article_object,
120 120
 				'featImgClass'		=> $featImgClass,
121 121
 				'titleClass'		=> $titleClass,
122 122
 				'strings'			=> $strings,
123
-				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ),
124
-				'post_status'		=> get_post_status( $postid ),
123
+				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'),
124
+				'post_status'		=> get_post_status($postid),
125 125
 				'postid'			=> $postid,
126 126
 				'permalink'			=> get_permalink(),
127 127
 				'edit_others_pages'	=> current_user_can('edit_others_pages') ? true : false,
128 128
 				'edit_others_posts'	=> current_user_can('edit_others_posts') ? true : false,
129
-				'userCanEdit'		=> current_user_can('edit_post', $postid ),
129
+				'userCanEdit'		=> current_user_can('edit_post', $postid),
130 130
 				'can_publish_posts'	=> current_user_can('publish_posts'),
131 131
 				'can_publish_pages'	=> current_user_can('publish_pages'),
132 132
 				'author'			=> is_user_logged_in() ? get_current_user_ID() : false,
@@ -160,35 +160,35 @@  discard block
 block discarded – undo
160 160
 				'postTags'    		=> lasso_get_objects('tag'),
161 161
 				'noResultsDiv'		=> lasso_editor_empty_results(),
162 162
 				'noRevisionsDiv'	=> lasso_editor_empty_results('revision'),
163
-				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false,
164
-				'mapLocations'		=> get_post_meta( $postid, 'ase_map_component_locations' ),
165
-				'mapStart'			=> get_post_meta( $postid, 'ase_map_component_start_point', true ),
166
-				'mapZoom'			=> get_post_meta( $postid, 'ase_map_component_zoom', true ),
163
+				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false,
164
+				'mapLocations'		=> get_post_meta($postid, 'ase_map_component_locations'),
165
+				'mapStart'			=> get_post_meta($postid, 'ase_map_component_start_point', true),
166
+				'mapZoom'			=> get_post_meta($postid, 'ase_map_component_zoom', true),
167 167
 				'revisionModal' 	=> lasso_editor_revision_modal(),
168 168
 				'isMobile'          => wp_is_mobile(),
169
-				'enableAutoSave'    => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ),
169
+				'enableAutoSave'    => lasso_editor_get_option('enable_autosave', 'lasso_editor'),
170 170
 				'showColor'         => $show_color,
171 171
 				'showAlignment'  => $show_align
172 172
 			);
173 173
 
174 174
 
175 175
 			// wp api client
176
-			wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
177
-			$settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
178
-			wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
176
+			wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
177
+			$settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json'));
178
+			wp_localize_script('wp-api-js', 'WP_API_Settings', $settings);
179 179
 
180
-			$postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min';
180
+			$postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min';
181 181
 			if ($show_color) {
182
-				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'iris'), LASSO_VERSION, true);
182
+				wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'iris'), LASSO_VERSION, true);
183 183
 			} else {
184
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery'), LASSO_VERSION, true);
184
+			    wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery'), LASSO_VERSION, true);
185 185
 			}
186
-			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
186
+			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects));
187 187
 			
188 188
 			//enqueue js if tour is not hidden 
189
-            		$tour_hidden = get_user_meta( get_current_user_ID(), 'lasso_hide_tour', true );
190
-    			if ( lasso_user_can() && !$tour_hidden ){
191
-                		wp_enqueue_script('lasso-tour', LASSO_URL. "/public/assets/js/tour.js", array('jquery', 'lasso'), LASSO_VERSION, true);
189
+            		$tour_hidden = get_user_meta(get_current_user_ID(), 'lasso_hide_tour', true);
190
+    			if (lasso_user_can() && !$tour_hidden) {
191
+                		wp_enqueue_script('lasso-tour', LASSO_URL."/public/assets/js/tour.js", array('jquery', 'lasso'), LASSO_VERSION, true);
192 192
     			}
193 193
 
194 194
 		}
Please login to merge, or discard this patch.