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 ;
}
2021-07-22 09:53:00 -04:00
// Used in the HTML title tag.
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' );
2022-01-07 06:21:04 -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 .
*
2021-09-21 14:21:00 -04: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-19 22:36:09 -04:00
*
* @ 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' =>
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 12:25:03 -04: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 01:21:56 -04: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-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>' .
2023-02-23 05:38:21 -05:00
'<p>' . __ ( '<a href="https://wordpress.org/documentation/article/plugins-add-new-screen/">Documentation on Installing Plugins</a>' ) . '</p>' .
'<p>' . __ ( '<a href="https://wordpress.org/support/forums/">Support forums</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' ;
Upgrade/Install: Introduce Plugin Dependencies.
Introduces a new "Requires Plugins" plugin header so that plugin developers can list the slugs of the plugins theirs depends on.
This will inform users of the requirements, and provide links to the WordPress.org Plugins Repository that they can click to install and activate the dependencies first.
Plugins whose requirements are not met cannot be installed or activated, and they will be deactivated automatically if their requirements become unmet.
Plugins that others rely on cannot be deactivated or deleted until their dependent plugins are deactivated or deleted.
In memory of Alex Mills and Alex King.
WordPress Remembers.
Props ahoereth, afragen, alanfuller, alexkingorg, amykamala, anonymized_10690803, apeatling, ashfame, atimmer, audrasjb, aristath, azaozz, batmoo, beaulebens, blobaugh, bobbingwide, boonebgorges, brianhenryie, chanthaboune, chrisdavidmiles, coolmann, costdev, courane01, danielbachhuber, davidperez, dd32, Denis-de-Bernardy, dingo_d, DJPaul, dougal, DrewAPicture, ethitter, filosofo, georgestephanis, giuseppemazzapica-1, goldenapples, griffinjt, hellofromTonya, husobj, ideag, jarednova, jbobich, jbrinley, jltallon, joedolson, johnciacia, johnjamesjacoby, joppuyo, jsmoriss, karmatosed, kebbet, knutsp, kraftbj, kraftner, kurtpayne, lkraav, logikal16, luisherranz, man4toman, markjaquith, matt, mbijon, megphillips91, mikeschinkel, mordauk, morehawes, mrwweb, mte90, mukesh27, mzaweb, nacin, norcross, nvwd, nwjames, obliviousharmony, ocean90, oglekler, paaljoachim, pauldewouters, pbaylies, pbiron, peterwilsoncc, Philipp15b, poena, pogidude, retlehs, rmccue, ryan, sabreuse, sc0ttkclark, scribu, sereedmedia, SergeyBiryukov, ShaneF, shidouhikari, soean, spacedmonkey, stephenh1988, swissspidy, taylorde, tazotodua, threadi, TimothyBlynJacobs, TJNowell, tollmanz, toscho, tropicalista, Viper007Bond, westi, whiteshadow, williamsba1, wpsmith, ZaneMatthew.
Fixes #22316.
Built from https://develop.svn.wordpress.org/trunk@57545
git-svn-id: http://core.svn.wordpress.org/trunk@57046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-06 18:46:14 -05:00
Plugin Dependencies: Remove auto-deactivation and bootstrapping logic.
Automatic deactivation of dependents with unmet dependencies requires a write operation to the database. This was performed during Core's bootstrap, which risked the database and cache becoming out-of-sync on sites with heavy traffic.
No longer loading plugins that have unmet requirements has not had a final approach decided core-wide, and is still in discussion in #60491 to be handled in a future release.
The `plugin_data` option, used to persistently store plugin data for detecting unmet dependencies during Core's bootstrap, is no longer needed.
Follow-up to [57545], [57592], [57606], [57617].
Props dd32, azaozz, swissspidy, desrosj, afragen, pbiron, zunaid321, costdev.
Fixes #60457. See #60491, #60510, #60518.
Built from https://develop.svn.wordpress.org/trunk@57658
git-svn-id: http://core.svn.wordpress.org/trunk@57159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-20 02:27:06 -05:00
WP_Plugin_Dependencies :: initialize ();
Upgrade/Install: Introduce Plugin Dependencies.
Introduces a new "Requires Plugins" plugin header so that plugin developers can list the slugs of the plugins theirs depends on.
This will inform users of the requirements, and provide links to the WordPress.org Plugins Repository that they can click to install and activate the dependencies first.
Plugins whose requirements are not met cannot be installed or activated, and they will be deactivated automatically if their requirements become unmet.
Plugins that others rely on cannot be deactivated or deleted until their dependent plugins are deactivated or deleted.
In memory of Alex Mills and Alex King.
WordPress Remembers.
Props ahoereth, afragen, alanfuller, alexkingorg, amykamala, anonymized_10690803, apeatling, ashfame, atimmer, audrasjb, aristath, azaozz, batmoo, beaulebens, blobaugh, bobbingwide, boonebgorges, brianhenryie, chanthaboune, chrisdavidmiles, coolmann, costdev, courane01, danielbachhuber, davidperez, dd32, Denis-de-Bernardy, dingo_d, DJPaul, dougal, DrewAPicture, ethitter, filosofo, georgestephanis, giuseppemazzapica-1, goldenapples, griffinjt, hellofromTonya, husobj, ideag, jarednova, jbobich, jbrinley, jltallon, joedolson, johnciacia, johnjamesjacoby, joppuyo, jsmoriss, karmatosed, kebbet, knutsp, kraftbj, kraftner, kurtpayne, lkraav, logikal16, luisherranz, man4toman, markjaquith, matt, mbijon, megphillips91, mikeschinkel, mordauk, morehawes, mrwweb, mte90, mukesh27, mzaweb, nacin, norcross, nvwd, nwjames, obliviousharmony, ocean90, oglekler, paaljoachim, pauldewouters, pbaylies, pbiron, peterwilsoncc, Philipp15b, poena, pogidude, retlehs, rmccue, ryan, sabreuse, sc0ttkclark, scribu, sereedmedia, SergeyBiryukov, ShaneF, shidouhikari, soean, spacedmonkey, stephenh1988, swissspidy, taylorde, tazotodua, threadi, TimothyBlynJacobs, TJNowell, tollmanz, toscho, tropicalista, Viper007Bond, westi, whiteshadow, williamsba1, wpsmith, ZaneMatthew.
Fixes #22316.
Built from https://develop.svn.wordpress.org/trunk@57545
git-svn-id: http://core.svn.wordpress.org/trunk@57046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-06 18:46:14 -05:00
WP_Plugin_Dependencies :: display_admin_notice_for_unmet_dependencies ();
WP_Plugin_Dependencies :: display_admin_notice_for_circular_dependencies ();
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 ();
}
2013-09-19 22:36:09 -04:00
/**
* Fires after the plugins list table in each tab of the Install Plugins screen .
*
2021-09-21 14:21:00 -04: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-19 22:36:09 -04:00
*
* @ 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' ;