2008-08-04 23:17:42 +02:00
< ? php
2008-08-16 09:27:34 +02:00
/**
* Install plugin administration panel .
*
* @ package WordPress
* @ subpackage Administration
*/
2010-11-06 10:41:03 +01:00
// TODO route this pages via a specific iframe handler instead of the do_action below
2010-12-01 19:53:37 +01:00
if ( ! defined ( 'IFRAME_REQUEST' ) && isset ( $_GET [ 'tab' ] ) && ( 'plugin-information' == $_GET [ 'tab' ] ) )
define ( 'IFRAME_REQUEST' , true );
2008-08-16 09:27:34 +02:00
2013-09-20 04:36:09 +02:00
/**
* WordPress Administration Bootstrap .
*/
2013-09-25 02:18:11 +02:00
require_once ( dirname ( __FILE__ ) . '/admin.php' );
2010-12-16 09:43:22 +01:00
2010-12-07 22:06:19 +01:00
if ( ! current_user_can ( 'install_plugins' ) )
2016-06-29 17:16:29 +02:00
wp_die ( __ ( 'Sorry, you are not allowed to install plugins on this site.' ));
2010-12-13 22:21:50 +01:00
2010-12-06 16:41:19 +01:00
if ( is_multisite () && ! is_network_admin () ) {
wp_redirect ( network_admin_url ( 'plugin-install.php' ) );
exit ();
}
2011-01-16 22:47:24 +01:00
$wp_list_table = _get_list_table ( 'WP_Plugin_Install_List_Table' );
2011-01-13 01:03:38 +01:00
$pagenum = $wp_list_table -> get_pagenum ();
2014-10-03 15:08:16 +02:00
if ( ! empty ( $_REQUEST [ '_wp_http_referer' ] ) ) {
$location = remove_query_arg ( '_wp_http_referer' , wp_unslash ( $_SERVER [ 'REQUEST_URI' ] ) );
if ( ! empty ( $_REQUEST [ 'paged' ] ) ) {
$location = add_query_arg ( 'paged' , ( int ) $_REQUEST [ 'paged' ], $location );
}
wp_redirect ( $location );
exit ;
}
2010-08-22 13:22:46 +02:00
$wp_list_table -> prepare_items ();
2008-08-04 23:17:42 +02:00
2014-10-03 15:08:16 +02:00
$total_pages = $wp_list_table -> get_pagination_arg ( 'total_pages' );
if ( $pagenum > $total_pages && $total_pages > 0 ) {
wp_redirect ( add_query_arg ( 'paged' , $total_pages ) );
exit ;
}
2014-08-27 03:32:18 +02:00
$title = __ ( 'Add Plugins' );
2008-08-04 23:17:42 +02:00
$parent_file = 'plugins.php' ;
2009-05-16 21:21:29 +02:00
wp_enqueue_script ( 'plugin-install' );
if ( 'plugin-information' != $tab )
add_thickbox ();
2008-08-04 23:17:42 +02:00
$body_id = $tab ;
2015-02-05 05:19:23 +01:00
wp_enqueue_script ( 'updates' );
2013-09-20 04:36:09 +02:00
/**
* Fires before each tab on the Install Plugins screen is loaded .
*
2014-11-30 12:42:24 +01:00
* The dynamic portion of the action hook , `$tab` , allows for targeting
2013-09-20 04:36:09 +02:00
* individual tabs , for instance 'install_plugins_pre_plugin-information' .
*
* @ since 2.7 . 0
*/
2016-08-22 20:25:31 +02:00
do_action ( " install_plugins_pre_ { $tab } " );
2008-08-04 23:17:42 +02:00
2016-07-31 20:11:29 +02:00
/*
2017-08-22 13:52:48 +02:00
* Call the pre upload action on every non - upload plugin installation screen
2016-07-31 20:11:29 +02:00
* because the form is always displayed on these screens .
*/
if ( 'upload' !== $tab ) {
/** This action is documented in wp-admin/plugin-install.php */
do_action ( 'install_plugins_pre_upload' );
}
2011-11-24 01:21:39 +01:00
get_current_screen () -> add_help_tab ( array (
2011-12-01 02:24:39 +01:00
'id' => 'overview' ,
'title' => __ ( 'Overview' ),
2011-12-01 05:51:35 +01:00
'content' =>
2016-10-04 09:08:29 +02:00
'<p>' . sprintf ( __ ( 'Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from the core WordPress application by thousands of developers all over the world. All plugins in the official <a href="%s">WordPress Plugin Directory</a> are compatible with the license WordPress uses.' ), __ ( 'https://wordpress.org/plugins/' ) ) . '</p>' .
2016-07-20 18:32:31 +02:00
'<p>' . __ ( 'You can find new plugins to install by searching or browsing the directory right here in your own Plugins section.' ) . ' <span id="live-search-desc" class="hide-if-no-js">' . __ ( 'The search results will be updated as you type.' ) . '</span></p>'
2011-11-24 01:21:39 +01:00
) );
get_current_screen () -> add_help_tab ( array (
2011-12-01 02:24:39 +01:00
'id' => 'adding-plugins' ,
'title' => __ ( 'Adding Plugins' ),
2011-12-01 05:51:35 +01:00
'content' =>
2016-04-22 08:57:26 +02:00
'<p>' . __ ( 'If you know what you’re looking for, Search is your best bet. The Search screen has options to search the WordPress Plugin Directory for a particular Term, Author, or Tag. You can also search the directory by selecting popular tags. Tags in larger type mean more plugins have been labeled with that tag.' ) . '</p>' .
2016-06-10 23:43:29 +02:00
'<p>' . __ ( 'If you just want to get an idea of what’s available, you can browse Featured and Popular plugins by using the links above the plugins list. These sections rotate regularly.' ) . '</p>' .
'<p>' . __ ( 'You can also browse a user’s favorite plugins, by using the Favorites link above the plugins list and entering their WordPress.org username.' ) . '</p>' .
'<p>' . __ ( 'If you want to install a plugin that you’ve downloaded elsewhere, click the Upload Plugin button above the plugins list. You will be prompted to upload the .zip package, and once uploaded, you can activate the new plugin.' ) . '</p>'
2011-11-24 01:21:39 +01:00
) );
2011-11-02 06:33:53 +01:00
2011-11-02 22:32:16 +01:00
get_current_screen () -> set_help_sidebar (
2011-10-07 06:57:12 +02:00
'<p><strong>' . __ ( 'For more information:' ) . '</strong></p>' .
2016-10-04 09:08:29 +02:00
'<p>' . __ ( '<a href="https://codex.wordpress.org/Plugins_Add_New_Screen">Documentation on Installing Plugins</a>' ) . '</p>' .
'<p>' . __ ( '<a href="https://wordpress.org/support/">Support Forums</a>' ) . '</p>'
2010-05-26 22:26:51 +02:00
);
2010-01-15 17:58:36 +01:00
2015-10-07 03:28:25 +02:00
get_current_screen () -> set_screen_reader_content ( array (
'heading_views' => __ ( 'Filter plugins list' ),
'heading_pagination' => __ ( 'Plugins list navigation' ),
'heading_list' => __ ( 'Plugins list' ),
) );
2013-09-20 04:36:09 +02:00
/**
* WordPress Administration Template Header .
*/
2010-10-20 16:16:03 +02:00
include ( ABSPATH . 'wp-admin/admin-header.php' );
2008-08-04 23:17:42 +02:00
?>
2016-07-31 20:11:29 +02:00
< div class = " wrap <?php echo esc_attr( " plugin - install - tab - $tab " ); ?> " >
2016-12-07 20:06:41 +01:00
< h1 class = " wp-heading-inline " >< ? php
echo esc_html ( $title );
?> </h1>
< ? php
if ( ! empty ( $tabs [ 'upload' ] ) && current_user_can ( 'upload_plugins' ) ) {
printf ( ' <a href="%s" class="upload-view-toggle page-title-action"><span class="upload">%s</span><span class="browse">%s</span></a>' ,
( 'upload' === $tab ) ? self_admin_url ( 'plugin-install.php' ) : self_admin_url ( 'plugin-install.php?tab=upload' ),
__ ( 'Upload Plugin' ),
__ ( 'Browse Plugins' )
);
}
?>
< hr class = " wp-header-end " >
2008-10-17 22:02:03 +02:00
2016-04-16 18:43:27 +02:00
< ? php
/*
2017-08-22 13:52:48 +02:00
* Output the upload plugin form on every non - upload plugin installation screen , so it can be
2016-04-16 18:43:27 +02:00
* displayed via JavaScript rather then opening up the devoted upload plugin page .
*/
2016-11-21 22:33:30 +01:00
if ( 'upload' !== $tab ) {
2016-07-31 20:11:29 +02:00
?>
< div class = " upload-plugin-wrap " >
< ? php
/** This action is documented in wp-admin/plugin-install.php */
do_action ( 'install_plugins_upload' );
?>
</ div >
< ? php
2014-08-27 03:32:18 +02:00
$wp_list_table -> views ();
echo '<br class="clear" />' ;
}
2013-09-20 04:36:09 +02:00
/**
* Fires after the plugins list table in each tab of the Install Plugins screen .
*
2014-11-30 12:42:24 +01:00
* The dynamic portion of the action hook , `$tab` , allows for targeting
2013-09-20 04:36:09 +02:00
* individual tabs , for instance 'install_plugins_plugin-information' .
*
* @ since 2.7 . 0
*
* @ param int $paged The current page number of the plugins list table .
*/
2016-08-22 20:25:31 +02:00
do_action ( " install_plugins_ { $tab } " , $paged ); ?>
Update/Install: Shiny Updates v2.
Gone are the days of isolation and feelings of "meh", brought on by The Bleak Screen of Sadness. For a shiny knight has arrived to usher our plugins and themes along their arduous journey of installation, updates, and the inevitable fate of ultimate deletion.
Props swissspidy, adamsilverstein, mapk, afragen, ocean90, ryelle, j-falk, michael-arestad, melchoyce, DrewAPicture, AdamSoucie, ethitter, pento, dd32, kraftbj, Ipstenu, jorbin, afercia, stephdau, paulwilde, jipmoors, khag7, svovaf, jipmoors, obenland.
Fixes #22029, #25828, #31002, #31529, #31530, #31773, #33637, #35032.
Built from https://develop.svn.wordpress.org/trunk@37714
git-svn-id: http://core.svn.wordpress.org/trunk@37680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-15 18:37:29 +02:00
< span class = " spinner " ></ span >
2008-08-04 23:17:42 +02:00
</ div >
2015-03-18 04:18:27 +01:00
2015-04-12 23:29:32 +02:00
< ? php
2015-03-18 04:18:27 +01:00
wp_print_request_filesystem_credentials_modal ();
Update/Install: Shiny Updates v2.
Gone are the days of isolation and feelings of "meh", brought on by The Bleak Screen of Sadness. For a shiny knight has arrived to usher our plugins and themes along their arduous journey of installation, updates, and the inevitable fate of ultimate deletion.
Props swissspidy, adamsilverstein, mapk, afragen, ocean90, ryelle, j-falk, michael-arestad, melchoyce, DrewAPicture, AdamSoucie, ethitter, pento, dd32, kraftbj, Ipstenu, jorbin, afercia, stephdau, paulwilde, jipmoors, khag7, svovaf, jipmoors, obenland.
Fixes #22029, #25828, #31002, #31529, #31530, #31773, #33637, #35032.
Built from https://develop.svn.wordpress.org/trunk@37714
git-svn-id: http://core.svn.wordpress.org/trunk@37680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-15 18:37:29 +02:00
wp_print_admin_notice_templates ();
2015-03-18 04:18:27 +01:00
2013-09-20 04:36:09 +02:00
/**
* WordPress Administration Template Footer .
*/
2010-10-20 16:16:03 +02:00
include ( ABSPATH . 'wp-admin/admin-footer.php' );