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
*/
2020-01-29 01:45:18 +01:00
// TODO: Route this page via a specific iframe handler instead of the do_action below.
2020-05-16 20:42:12 +02:00
if ( ! defined ( 'IFRAME_REQUEST' ) && isset ( $_GET [ 'tab' ] ) && ( 'plugin-information' === $_GET [ 'tab' ] ) ) {
2010-12-01 19:53:37 +01:00
define ( 'IFRAME_REQUEST' , true );
2017-12-01 00:11:00 +01:00
}
2008-08-16 09:27:34 +02:00
2013-09-20 04:36:09 +02:00
/**
* WordPress Administration Bootstrap .
*/
2020-02-06 07:33:11 +01:00
require_once __DIR__ . '/admin.php' ;
2010-12-16 09:43:22 +01:00
2017-12-01 00:11:00 +01:00
if ( ! current_user_can ( 'install_plugins' ) ) {
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' ) );
2020-05-26 11:37:10 +02:00
exit ;
2010-12-06 16:41:19 +01:00
}
2017-12-01 00:11:00 +01:00
$wp_list_table = _get_list_table ( 'WP_Plugin_Install_List_Table' );
$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 ;
}
2021-07-22 15:53:00 +02:00
// Used in the HTML title tag.
2017-12-01 00:11:00 +01: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' );
2022-01-07 12:21:04 +01:00
if ( 'plugin-information' !== $tab ) {
2009-05-16 21:21:29 +02:00
add_thickbox ();
2017-12-01 00:11:00 +01:00
}
2009-05-16 21:21:29 +02:00
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 .
*
2021-09-21 20:21:00 +02:00
* The dynamic portion of the hook name , `$tab` , allows for targeting
* individual tabs .
*
* Possible hook names include :
*
* - `install_plugins_pre_beta`
* - `install_plugins_pre_favorites`
* - `install_plugins_pre_featured`
* - `install_plugins_pre_plugin-information`
* - `install_plugins_pre_popular`
* - `install_plugins_pre_recommended`
* - `install_plugins_pre_search`
* - `install_plugins_pre_upload`
2013-09-20 04:36:09 +02:00
*
* @ 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' );
}
2017-12-01 00:11:00 +01: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 19:13:59 +02: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 07:21:56 +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>' ,
2017-12-01 00:11:00 +01:00
)
);
get_current_screen () -> add_help_tab (
array (
'id' => 'adding-plugins' ,
'title' => __ ( 'Adding Plugins' ),
'content' =>
Administration: Replace contracted verb forms for better consistency.
This changeset replaces contracted verb forms like `doesn't`, `can't`, or `isn't` with non-contracted forms like `does not`, `cannot`, or `is not`, for better consistency across the WordPress administration. It also updates some corresponding unit tests strings.
Props Presskopp, socalchristina, aandrewdixon, francina, SergeyBiryukov, JeffPaul, audrasjb, hellofromTonya.
Fixes #38913.
See #39176.
Built from https://develop.svn.wordpress.org/trunk@52978
git-svn-id: http://core.svn.wordpress.org/trunk@52567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 17:25:03 +01:00
'<p>' . __ ( 'If you know what you are 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>' .
2019-07-05 07:21:56 +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>' ,
2017-12-01 00:11:00 +01:00
)
);
2011-11-02 06:33:53 +01:00
2011-11-02 22:32:16 +01:00
get_current_screen () -> set_help_sidebar (
2017-12-01 00:11:00 +01:00
'<p><strong>' . __ ( 'For more information:' ) . '</strong></p>' .
2019-07-26 00:45:57 +02:00
'<p>' . __ ( '<a href="https://wordpress.org/support/article/plugins-add-new-screen/">Documentation on Installing Plugins</a>' ) . '</p>' .
2019-04-09 00:59:56 +02:00
'<p>' . __ ( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
2010-05-26 22:26:51 +02:00
);
2010-01-15 17:58:36 +01:00
2017-12-01 00:11:00 +01: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-07 03:28:25 +02:00
2013-09-20 04:36:09 +02:00
/**
* WordPress Administration Template Header .
*/
2020-02-06 07:33:11 +01:00
require_once 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 " ); ?> " >
2017-12-01 00:11:00 +01:00
< h1 class = " wp-heading-inline " >
< ? php
2016-12-07 20:06:41 +01:00
echo esc_html ( $title );
2017-12-01 00:11:00 +01:00
?>
</ h1 >
2016-12-07 20:06:41 +01:00
< ? php
if ( ! empty ( $tabs [ 'upload' ] ) && current_user_can ( 'upload_plugins' ) ) {
2017-12-01 00:11:00 +01: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 20:06:41 +01: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 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 ();
}
2013-09-20 04:36:09 +02:00
/**
* Fires after the plugins list table in each tab of the Install Plugins screen .
*
2021-09-21 20:21:00 +02:00
* The dynamic portion of the hook name , `$tab` , allows for targeting
* individual tabs .
*
* Possible hook names include :
*
* - `install_plugins_beta`
* - `install_plugins_favorites`
* - `install_plugins_featured`
* - `install_plugins_plugin-information`
* - `install_plugins_popular`
* - `install_plugins_recommended`
* - `install_plugins_search`
* - `install_plugins_upload`
2013-09-20 04:36:09 +02:00
*
* @ since 2.7 . 0
*
* @ param int $paged The current page number of the plugins list table .
*/
2017-12-01 00:11:00 +01: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 .
*/
2020-02-06 07:33:11 +01:00
require_once ABSPATH . 'wp-admin/admin-footer.php' ;