Edit File by line
/home/barbar84/public_h.../wp-admin
File: plugin-install.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Install plugin administration panel.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Administration
[5] Fix | Delete
*/
[6] Fix | Delete
// TODO: Route this page via a specific iframe handler instead of the do_action below.
[7] Fix | Delete
if ( ! defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'plugin-information' === $_GET['tab'] ) ) {
[8] Fix | Delete
define( 'IFRAME_REQUEST', true );
[9] Fix | Delete
}
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* WordPress Administration Bootstrap.
[13] Fix | Delete
*/
[14] Fix | Delete
require_once __DIR__ . '/admin.php';
[15] Fix | Delete
[16] Fix | Delete
if ( ! current_user_can( 'install_plugins' ) ) {
[17] Fix | Delete
wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) );
[18] Fix | Delete
}
[19] Fix | Delete
[20] Fix | Delete
if ( is_multisite() && ! is_network_admin() ) {
[21] Fix | Delete
wp_redirect( network_admin_url( 'plugin-install.php' ) );
[22] Fix | Delete
exit;
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
$wp_list_table = _get_list_table( 'WP_Plugin_Install_List_Table' );
[26] Fix | Delete
$pagenum = $wp_list_table->get_pagenum();
[27] Fix | Delete
[28] Fix | Delete
if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
[29] Fix | Delete
$location = remove_query_arg( '_wp_http_referer', wp_unslash( $_SERVER['REQUEST_URI'] ) );
[30] Fix | Delete
[31] Fix | Delete
if ( ! empty( $_REQUEST['paged'] ) ) {
[32] Fix | Delete
$location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location );
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
wp_redirect( $location );
[36] Fix | Delete
exit;
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
$wp_list_table->prepare_items();
[40] Fix | Delete
[41] Fix | Delete
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
[42] Fix | Delete
[43] Fix | Delete
if ( $pagenum > $total_pages && $total_pages > 0 ) {
[44] Fix | Delete
wp_redirect( add_query_arg( 'paged', $total_pages ) );
[45] Fix | Delete
exit;
[46] Fix | Delete
}
[47] Fix | Delete
[48] Fix | Delete
$title = __( 'Add Plugins' );
[49] Fix | Delete
$parent_file = 'plugins.php';
[50] Fix | Delete
[51] Fix | Delete
wp_enqueue_script( 'plugin-install' );
[52] Fix | Delete
if ( 'plugin-information' != $tab ) {
[53] Fix | Delete
add_thickbox();
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
$body_id = $tab;
[57] Fix | Delete
[58] Fix | Delete
wp_enqueue_script( 'updates' );
[59] Fix | Delete
[60] Fix | Delete
/**
[61] Fix | Delete
* Fires before each tab on the Install Plugins screen is loaded.
[62] Fix | Delete
*
[63] Fix | Delete
* The dynamic portion of the action hook, `$tab`, allows for targeting
[64] Fix | Delete
* individual tabs, for instance 'install_plugins_pre_plugin-information'.
[65] Fix | Delete
*
[66] Fix | Delete
* @since 2.7.0
[67] Fix | Delete
*/
[68] Fix | Delete
do_action( "install_plugins_pre_{$tab}" );
[69] Fix | Delete
[70] Fix | Delete
/*
[71] Fix | Delete
* Call the pre upload action on every non-upload plugin installation screen
[72] Fix | Delete
* because the form is always displayed on these screens.
[73] Fix | Delete
*/
[74] Fix | Delete
if ( 'upload' !== $tab ) {
[75] Fix | Delete
/** This action is documented in wp-admin/plugin-install.php */
[76] Fix | Delete
do_action( 'install_plugins_pre_upload' );
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
get_current_screen()->add_help_tab(
[80] Fix | Delete
array(
[81] Fix | Delete
'id' => 'overview',
[82] Fix | Delete
'title' => __( 'Overview' ),
[83] Fix | Delete
'content' =>
[84] Fix | Delete
'<p>' . sprintf(
[85] Fix | Delete
/* translators: %s: https://wordpress.org/plugins/ */
[86] Fix | Delete
__( '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.' ),
[87] Fix | Delete
__( 'https://wordpress.org/plugins/' )
[88] Fix | Delete
) . '</p>' .
[89] Fix | Delete
'<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>',
[90] Fix | Delete
[91] Fix | Delete
)
[92] Fix | Delete
);
[93] Fix | Delete
get_current_screen()->add_help_tab(
[94] Fix | Delete
array(
[95] Fix | Delete
'id' => 'adding-plugins',
[96] Fix | Delete
'title' => __( 'Adding Plugins' ),
[97] Fix | Delete
'content' =>
[98] Fix | Delete
'<p>' . __( 'If you know what you&#8217;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>' .
[99] Fix | Delete
'<p>' . __( 'If you just want to get an idea of what&#8217;s available, you can browse Featured and Popular plugins by using the links above the plugins list. These sections rotate regularly.' ) . '</p>' .
[100] Fix | Delete
'<p>' . __( 'You can also browse a user&#8217;s favorite plugins, by using the Favorites link above the plugins list and entering their WordPress.org username.' ) . '</p>' .
[101] Fix | Delete
'<p>' . __( 'If you want to install a plugin that you&#8217;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>',
[102] Fix | Delete
)
[103] Fix | Delete
);
[104] Fix | Delete
[105] Fix | Delete
get_current_screen()->set_help_sidebar(
[106] Fix | Delete
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
[107] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/article/plugins-add-new-screen/">Documentation on Installing Plugins</a>' ) . '</p>' .
[108] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
[109] Fix | Delete
);
[110] Fix | Delete
[111] Fix | Delete
get_current_screen()->set_screen_reader_content(
[112] Fix | Delete
array(
[113] Fix | Delete
'heading_views' => __( 'Filter plugins list' ),
[114] Fix | Delete
'heading_pagination' => __( 'Plugins list navigation' ),
[115] Fix | Delete
'heading_list' => __( 'Plugins list' ),
[116] Fix | Delete
)
[117] Fix | Delete
);
[118] Fix | Delete
[119] Fix | Delete
/**
[120] Fix | Delete
* WordPress Administration Template Header.
[121] Fix | Delete
*/
[122] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-header.php';
[123] Fix | Delete
?>
[124] Fix | Delete
<div class="wrap <?php echo esc_attr( "plugin-install-tab-$tab" ); ?>">
[125] Fix | Delete
<h1 class="wp-heading-inline">
[126] Fix | Delete
<?php
[127] Fix | Delete
echo esc_html( $title );
[128] Fix | Delete
?>
[129] Fix | Delete
</h1>
[130] Fix | Delete
[131] Fix | Delete
<?php
[132] Fix | Delete
if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_plugins' ) ) {
[133] Fix | Delete
printf(
[134] Fix | Delete
' <a href="%s" class="upload-view-toggle page-title-action"><span class="upload">%s</span><span class="browse">%s</span></a>',
[135] Fix | Delete
( 'upload' === $tab ) ? self_admin_url( 'plugin-install.php' ) : self_admin_url( 'plugin-install.php?tab=upload' ),
[136] Fix | Delete
__( 'Upload Plugin' ),
[137] Fix | Delete
__( 'Browse Plugins' )
[138] Fix | Delete
);
[139] Fix | Delete
}
[140] Fix | Delete
?>
[141] Fix | Delete
[142] Fix | Delete
<hr class="wp-header-end">
[143] Fix | Delete
[144] Fix | Delete
<?php
[145] Fix | Delete
/*
[146] Fix | Delete
* Output the upload plugin form on every non-upload plugin installation screen, so it can be
[147] Fix | Delete
* displayed via JavaScript rather then opening up the devoted upload plugin page.
[148] Fix | Delete
*/
[149] Fix | Delete
if ( 'upload' !== $tab ) {
[150] Fix | Delete
?>
[151] Fix | Delete
<div class="upload-plugin-wrap">
[152] Fix | Delete
<?php
[153] Fix | Delete
/** This action is documented in wp-admin/plugin-install.php */
[154] Fix | Delete
do_action( 'install_plugins_upload' );
[155] Fix | Delete
?>
[156] Fix | Delete
</div>
[157] Fix | Delete
<?php
[158] Fix | Delete
$wp_list_table->views();
[159] Fix | Delete
}
[160] Fix | Delete
[161] Fix | Delete
/**
[162] Fix | Delete
* Fires after the plugins list table in each tab of the Install Plugins screen.
[163] Fix | Delete
*
[164] Fix | Delete
* The dynamic portion of the action hook, `$tab`, allows for targeting
[165] Fix | Delete
* individual tabs, for instance 'install_plugins_plugin-information'.
[166] Fix | Delete
*
[167] Fix | Delete
* @since 2.7.0
[168] Fix | Delete
*
[169] Fix | Delete
* @param int $paged The current page number of the plugins list table.
[170] Fix | Delete
*/
[171] Fix | Delete
do_action( "install_plugins_{$tab}", $paged );
[172] Fix | Delete
?>
[173] Fix | Delete
[174] Fix | Delete
<span class="spinner"></span>
[175] Fix | Delete
</div>
[176] Fix | Delete
[177] Fix | Delete
<?php
[178] Fix | Delete
wp_print_request_filesystem_credentials_modal();
[179] Fix | Delete
wp_print_admin_notice_templates();
[180] Fix | Delete
[181] Fix | Delete
/**
[182] Fix | Delete
* WordPress Administration Template Footer.
[183] Fix | Delete
*/
[184] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-footer.php';
[185] Fix | Delete
[186] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function