2008-08-04 17:17:42 -04:00
< ? php
2008-08-16 03:27:34 -04:00
/**
* Install plugin administration panel .
*
* @ package WordPress
* @ subpackage Administration
*/
2020-01-28 19:45:18 -05:00
// TODO: Route this page via a specific iframe handler instead of the do_action below.
2020-05-16 14:42:12 -04:00
if ( ! defined ( 'IFRAME_REQUEST' ) && isset ( $_GET [ 'tab' ] ) && ( 'plugin-information' === $_GET [ 'tab' ] ) ) {
2010-12-01 13:53:37 -05:00
define ( 'IFRAME_REQUEST' , true );
2017-11-30 18:11:00 -05:00
}
2008-08-16 03:27:34 -04:00
2013-09-19 22:36:09 -04:00
/**
* WordPress Administration Bootstrap .
*/
2020-02-06 01:33:11 -05:00
require_once __DIR__ . '/admin.php' ;
2010-12-16 03:43:22 -05:00
2017-11-30 18:11:00 -05:00
if ( ! current_user_can ( 'install_plugins' ) ) {
wp_die ( __ ( 'Sorry, you are not allowed to install plugins on this site.' ) );
}
2010-12-13 16:21:50 -05:00
2010-12-06 10:41:19 -05:00
if ( is_multisite () && ! is_network_admin () ) {
wp_redirect ( network_admin_url ( 'plugin-install.php' ) );
2020-05-26 05:37:10 -04:00
exit ;
2010-12-06 10:41:19 -05:00
}
2017-11-30 18:11:00 -05:00
$wp_list_table = _get_list_table ( 'WP_Plugin_Install_List_Table' );
$pagenum = $wp_list_table -> get_pagenum ();
2014-10-03 09:08:16 -04: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 07:22:46 -04:00
$wp_list_table -> prepare_items ();
2008-08-04 17:17:42 -04:00
2014-10-03 09:08:16 -04: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 ;
}
2017-11-30 18:11:00 -05:00
$title = __ ( 'Add Plugins' );
2008-08-04 17:17:42 -04:00
$parent_file = 'plugins.php' ;
2009-05-16 15:21:29 -04:00
wp_enqueue_script ( 'plugin-install' );
2017-11-30 18:11:00 -05:00
if ( 'plugin-information' != $tab ) {
2009-05-16 15:21:29 -04:00
add_thickbox ();
2017-11-30 18:11:00 -05:00
}
2009-05-16 15:21:29 -04:00
2008-08-04 17:17:42 -04:00
$body_id = $tab ;
2015-02-04 23:19:23 -05:00
wp_enqueue_script ( 'updates' );
2013-09-19 22:36:09 -04:00
/**
* Fires before each tab on the Install Plugins screen is loaded .
*
2014-11-30 06:42:24 -05:00
* The dynamic portion of the action hook , `$tab` , allows for targeting
2013-09-19 22:36:09 -04:00
* individual tabs , for instance 'install_plugins_pre_plugin-information' .
*
* @ since 2.7 . 0
*/
2016-08-22 14:25:31 -04:00
do_action ( " install_plugins_pre_ { $tab } " );
2008-08-04 17:17:42 -04:00
2016-07-31 14:11:29 -04:00
/*
2017-08-22 07:52:48 -04:00
* Call the pre upload action on every non - upload plugin installation screen
2016-07-31 14:11:29 -04: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' );
}
2017-11-30 18:11:00 -05:00
get_current_screen () -> add_help_tab (
array (
'id' => 'overview' ,
'title' => __ ( 'Overview' ),
'content' =>
I18N: Improve translator comments.
* Add missing translator comments.
* Fix placement of some translator comments. Translator comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translator comments.
Includes minor code layout fixes.
Polyglots, rejoice! All WordPress core files now have translator comments for all strings with placeholders!
Props jrf, subrataemfluence, GaryJ, webdados, Dency, swissspidy, alvarogois, marcomartins, mihaiiceyro, vladwtz, niq1982, flipkeijzer, michielatyoast, chandrapatel, thrijith, joshuanoyce, FesoVik, tessak22, bhaktirajdev, cleancoded, dhavalkasvala, garrett-eclipse, bibliofille, socalchristina, priyankkpatel, 5hel2l2y, adamsilverstein, JeffPaul, pierlo, SergeyBiryukov.
Fixes #44360.
Built from https://develop.svn.wordpress.org/trunk@45926
git-svn-id: http://core.svn.wordpress.org/trunk@45737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-01 13:13:59 -04:00
'<p>' . sprintf (
/* translators: %s: https://wordpress.org/plugins/ */
__ ( '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>' .
2019-07-05 01:21:56 -04: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>' ,
2017-11-30 18:11:00 -05:00
)
);
get_current_screen () -> add_help_tab (
array (
'id' => 'adding-plugins' ,
'title' => __ ( 'Adding Plugins' ),
'content' =>
2019-07-05 01:21:56 -04: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>' .
'<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>' ,
2017-11-30 18:11:00 -05:00
)
);
2011-11-02 01:33:53 -04:00
2011-11-02 17:32:16 -04:00
get_current_screen () -> set_help_sidebar (
2017-11-30 18:11:00 -05:00
'<p><strong>' . __ ( 'For more information:' ) . '</strong></p>' .
2019-07-25 18:45:57 -04:00
'<p>' . __ ( '<a href="https://wordpress.org/support/article/plugins-add-new-screen/">Documentation on Installing Plugins</a>' ) . '</p>' .
2019-04-08 18:59:56 -04:00
'<p>' . __ ( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
2010-05-26 16:26:51 -04:00
);
2010-01-15 11:58:36 -05:00
2017-11-30 18:11:00 -05:00
get_current_screen () -> set_screen_reader_content (
array (
'heading_views' => __ ( 'Filter plugins list' ),
'heading_pagination' => __ ( 'Plugins list navigation' ),
'heading_list' => __ ( 'Plugins list' ),
)
);
2015-10-06 21:28:25 -04:00
2013-09-19 22:36:09 -04:00
/**
* WordPress Administration Template Header .
*/
2020-02-06 01:33:11 -05:00
require_once ABSPATH . 'wp-admin/admin-header.php' ;
2008-08-04 17:17:42 -04:00
?>
2016-07-31 14:11:29 -04:00
< div class = " wrap <?php echo esc_attr( " plugin - install - tab - $tab " ); ?> " >
2017-11-30 18:11:00 -05:00
< h1 class = " wp-heading-inline " >
< ? php
2016-12-07 14:06:41 -05:00
echo esc_html ( $title );
2017-11-30 18:11:00 -05:00
?>
</ h1 >
2016-12-07 14:06:41 -05:00
< ? php
if ( ! empty ( $tabs [ 'upload' ] ) && current_user_can ( 'upload_plugins' ) ) {
2017-11-30 18:11:00 -05:00
printf (
' <a href="%s" class="upload-view-toggle page-title-action"><span class="upload">%s</span><span class="browse">%s</span></a>' ,
2016-12-07 14:06:41 -05:00
( '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 16:02:03 -04:00
2016-04-16 12:43:27 -04:00
< ? php
/*
2017-08-22 07:52:48 -04:00
* Output the upload plugin form on every non - upload plugin installation screen , so it can be
2016-04-16 12:43:27 -04:00
* displayed via JavaScript rather then opening up the devoted upload plugin page .
*/
2016-11-21 16:33:30 -05:00
if ( 'upload' !== $tab ) {
2016-07-31 14:11:29 -04: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-26 21:32:18 -04:00
$wp_list_table -> views ();
echo '<br class="clear" />' ;
}
2013-09-19 22:36:09 -04:00
/**
* Fires after the plugins list table in each tab of the Install Plugins screen .
*
2014-11-30 06:42:24 -05:00
* The dynamic portion of the action hook , `$tab` , allows for targeting
2013-09-19 22:36:09 -04: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 .
*/
2017-11-30 18:11:00 -05: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 12:37:29 -04:00
< span class = " spinner " ></ span >
2008-08-04 17:17:42 -04:00
</ div >
2015-03-17 23:18:27 -04:00
2015-04-12 17:29:32 -04:00
< ? php
2015-03-17 23:18:27 -04: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 12:37:29 -04:00
wp_print_admin_notice_templates ();
2015-03-17 23:18:27 -04:00
2013-09-19 22:36:09 -04:00
/**
* WordPress Administration Template Footer .
*/
2020-02-06 01:33:11 -05:00
require_once ABSPATH . 'wp-admin/admin-footer.php' ;