Edit File by line
/home/zeestwma/ceyloniy.../wp-admin
File: plugins.php
$auto_updates = array_diff( $auto_updates, array( $plugin ) );
[500] Fix | Delete
$redirect = add_query_arg( array( 'disabled-auto-update' => 'true' ), $redirect );
[501] Fix | Delete
} else {
[502] Fix | Delete
$plugins = (array) wp_unslash( $_POST['checked'] );
[503] Fix | Delete
[504] Fix | Delete
if ( 'enable-auto-update-selected' === $action ) {
[505] Fix | Delete
$new_auto_updates = array_merge( $auto_updates, $plugins );
[506] Fix | Delete
$new_auto_updates = array_unique( $new_auto_updates );
[507] Fix | Delete
$query_args = array( 'enabled-auto-update-multi' => 'true' );
[508] Fix | Delete
} else {
[509] Fix | Delete
$new_auto_updates = array_diff( $auto_updates, $plugins );
[510] Fix | Delete
$query_args = array( 'disabled-auto-update-multi' => 'true' );
[511] Fix | Delete
}
[512] Fix | Delete
[513] Fix | Delete
// Return early if all selected plugins already have auto-updates enabled or disabled.
[514] Fix | Delete
// Must use non-strict comparison, so that array order is not treated as significant.
[515] Fix | Delete
if ( $new_auto_updates == $auto_updates ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual
[516] Fix | Delete
wp_redirect( $redirect );
[517] Fix | Delete
exit;
[518] Fix | Delete
}
[519] Fix | Delete
[520] Fix | Delete
$auto_updates = $new_auto_updates;
[521] Fix | Delete
$redirect = add_query_arg( $query_args, $redirect );
[522] Fix | Delete
}
[523] Fix | Delete
[524] Fix | Delete
/** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */
[525] Fix | Delete
$all_items = apply_filters( 'all_plugins', get_plugins() );
[526] Fix | Delete
[527] Fix | Delete
// Remove plugins that don't exist or have been deleted since the option was last updated.
[528] Fix | Delete
$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) );
[529] Fix | Delete
[530] Fix | Delete
update_site_option( 'auto_update_plugins', $auto_updates );
[531] Fix | Delete
[532] Fix | Delete
wp_redirect( $redirect );
[533] Fix | Delete
exit;
[534] Fix | Delete
default:
[535] Fix | Delete
if ( isset( $_POST['checked'] ) ) {
[536] Fix | Delete
check_admin_referer( 'bulk-plugins' );
[537] Fix | Delete
[538] Fix | Delete
$screen = get_current_screen()->id;
[539] Fix | Delete
$sendback = wp_get_referer();
[540] Fix | Delete
$plugins = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array();
[541] Fix | Delete
[542] Fix | Delete
/** This action is documented in wp-admin/edit.php */
[543] Fix | Delete
$sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $action, $plugins ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[544] Fix | Delete
wp_safe_redirect( $sendback );
[545] Fix | Delete
exit;
[546] Fix | Delete
}
[547] Fix | Delete
break;
[548] Fix | Delete
}
[549] Fix | Delete
}
[550] Fix | Delete
[551] Fix | Delete
$wp_list_table->prepare_items();
[552] Fix | Delete
[553] Fix | Delete
wp_enqueue_script( 'plugin-install' );
[554] Fix | Delete
add_thickbox();
[555] Fix | Delete
[556] Fix | Delete
add_screen_option( 'per_page', array( 'default' => 999 ) );
[557] Fix | Delete
[558] Fix | Delete
get_current_screen()->add_help_tab(
[559] Fix | Delete
array(
[560] Fix | Delete
'id' => 'overview',
[561] Fix | Delete
'title' => __( 'Overview' ),
[562] Fix | Delete
'content' =>
[563] Fix | Delete
'<p>' . __( 'Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.' ) . '</p>' .
[564] Fix | Delete
'<p>' . __( 'The search for installed plugins will search for terms in their name, description, or author.' ) . ' <span id="live-search-desc" class="hide-if-no-js">' . __( 'The search results will be updated as you type.' ) . '</span></p>' .
[565] Fix | Delete
'<p>' . sprintf(
[566] Fix | Delete
/* translators: %s: WordPress Plugin Directory URL. */
[567] Fix | Delete
__( 'If you would like to see more plugins to choose from, click on the &#8220;Add Plugin&#8221; button and you will be able to browse or search for additional plugins from the <a href="%s">WordPress Plugin Directory</a>. Plugins in the WordPress Plugin Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they are free!' ),
[568] Fix | Delete
__( 'https://wordpress.org/plugins/' )
[569] Fix | Delete
) . '</p>',
[570] Fix | Delete
)
[571] Fix | Delete
);
[572] Fix | Delete
get_current_screen()->add_help_tab(
[573] Fix | Delete
array(
[574] Fix | Delete
'id' => 'compatibility-problems',
[575] Fix | Delete
'title' => __( 'Troubleshooting' ),
[576] Fix | Delete
'content' =>
[577] Fix | Delete
'<p>' . __( 'Most of the time, plugins play nicely with the core of WordPress and with other plugins. Sometimes, though, a plugin&#8217;s code will get in the way of another plugin, causing compatibility issues. If your site starts doing strange things, this may be the problem. Try deactivating all your plugins and re-activating them in various combinations until you isolate which one(s) caused the issue.' ) . '</p>' .
[578] Fix | Delete
'<p>' . sprintf(
[579] Fix | Delete
/* translators: %s: WP_PLUGIN_DIR constant value. */
[580] Fix | Delete
__( 'If something goes wrong with a plugin and you cannot use WordPress, delete or rename that file in the %s directory and it will be automatically deactivated.' ),
[581] Fix | Delete
'<code>' . WP_PLUGIN_DIR . '</code>'
[582] Fix | Delete
) . '</p>',
[583] Fix | Delete
)
[584] Fix | Delete
);
[585] Fix | Delete
[586] Fix | Delete
$help_sidebar_autoupdates = '';
[587] Fix | Delete
[588] Fix | Delete
if ( current_user_can( 'update_plugins' ) && wp_is_auto_update_enabled_for_type( 'plugin' ) ) {
[589] Fix | Delete
get_current_screen()->add_help_tab(
[590] Fix | Delete
array(
[591] Fix | Delete
'id' => 'plugins-themes-auto-updates',
[592] Fix | Delete
'title' => __( 'Auto-updates' ),
[593] Fix | Delete
'content' =>
[594] Fix | Delete
'<p>' . __( 'Auto-updates can be enabled or disabled for each individual plugin. Plugins with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates depends on the WP-Cron task scheduling system.' ) . '</p>' .
[595] Fix | Delete
'<p>' . __( 'Auto-updates are only available for plugins recognized by WordPress.org, or that include a compatible update system.' ) . '</p>' .
[596] Fix | Delete
'<p>' . __( 'Please note: Third-party themes and plugins, or custom code, may override WordPress scheduling.' ) . '</p>',
[597] Fix | Delete
)
[598] Fix | Delete
);
[599] Fix | Delete
[600] Fix | Delete
$help_sidebar_autoupdates = '<p>' . __( '<a href="https://wordpress.org/documentation/article/plugins-themes-auto-updates/">Documentation on Auto-updates</a>' ) . '</p>';
[601] Fix | Delete
}
[602] Fix | Delete
[603] Fix | Delete
if ( current_user_can( 'install_plugins' ) ) {
[604] Fix | Delete
get_current_screen()->add_help_tab(
[605] Fix | Delete
array(
[606] Fix | Delete
'id' => 'plugins-dependencies',
[607] Fix | Delete
'title' => __( 'Dependencies' ),
[608] Fix | Delete
'content' =>
[609] Fix | Delete
'<p>' . __( 'Plugin Dependencies aims to make the process of installing and activating add-ons (dependents) and the plugins they rely on (dependencies) consistent and easy.' ) . '</p>' .
[610] Fix | Delete
'<p>' . __( 'If a required plugin is deleted, a notice will be displayed on the Plugin administration screen informing the user that there is some missing dependencies to install and/or activate. Additionally, each plugin whose dependencies are not met will have an error notice on their plugin row.' ) . '</p>' .
[611] Fix | Delete
'<p>' . __( 'If a dependent plugin is missing some dependencies, its activation button will be disabled until the required dependencies are activated.' ) . '</p>',
[612] Fix | Delete
)
[613] Fix | Delete
);
[614] Fix | Delete
}
[615] Fix | Delete
[616] Fix | Delete
get_current_screen()->set_help_sidebar(
[617] Fix | Delete
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
[618] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/documentation/article/manage-plugins/">Documentation on Managing Plugins</a>' ) . '</p>' .
[619] Fix | Delete
$help_sidebar_autoupdates .
[620] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
[621] Fix | Delete
);
[622] Fix | Delete
[623] Fix | Delete
get_current_screen()->set_screen_reader_content(
[624] Fix | Delete
array(
[625] Fix | Delete
'heading_views' => __( 'Filter plugins list' ),
[626] Fix | Delete
'heading_pagination' => __( 'Plugins list navigation' ),
[627] Fix | Delete
'heading_list' => __( 'Plugins list' ),
[628] Fix | Delete
)
[629] Fix | Delete
);
[630] Fix | Delete
[631] Fix | Delete
// Used in the HTML title tag.
[632] Fix | Delete
$title = __( 'Plugins' );
[633] Fix | Delete
$parent_file = 'plugins.php';
[634] Fix | Delete
[635] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-header.php';
[636] Fix | Delete
[637] Fix | Delete
$invalid = validate_active_plugins();
[638] Fix | Delete
if ( ! empty( $invalid ) ) {
[639] Fix | Delete
foreach ( $invalid as $plugin_file => $error ) {
[640] Fix | Delete
$deactivated_message = sprintf(
[641] Fix | Delete
/* translators: 1: Plugin file, 2: Error message. */
[642] Fix | Delete
__( 'The plugin %1$s has been deactivated due to an error: %2$s' ),
[643] Fix | Delete
'<code>' . esc_html( $plugin_file ) . '</code>',
[644] Fix | Delete
esc_html( $error->get_error_message() )
[645] Fix | Delete
);
[646] Fix | Delete
wp_admin_notice(
[647] Fix | Delete
$deactivated_message,
[648] Fix | Delete
array(
[649] Fix | Delete
'id' => 'message',
[650] Fix | Delete
'additional_classes' => array( 'error' ),
[651] Fix | Delete
)
[652] Fix | Delete
);
[653] Fix | Delete
}
[654] Fix | Delete
}
[655] Fix | Delete
[656] Fix | Delete
// Used by wp_admin_notice() updated notices.
[657] Fix | Delete
$updated_notice_args = array(
[658] Fix | Delete
'id' => 'message',
[659] Fix | Delete
'additional_classes' => array( 'updated' ),
[660] Fix | Delete
'dismissible' => true,
[661] Fix | Delete
);
[662] Fix | Delete
if ( isset( $_GET['error'] ) ) {
[663] Fix | Delete
[664] Fix | Delete
if ( isset( $_GET['main'] ) ) {
[665] Fix | Delete
$errmsg = __( 'You cannot delete a plugin while it is active on the main site.' );
[666] Fix | Delete
} elseif ( isset( $_GET['charsout'] ) ) {
[667] Fix | Delete
$errmsg = sprintf(
[668] Fix | Delete
/* translators: %d: Number of characters. */
[669] Fix | Delete
_n(
[670] Fix | Delete
'The plugin generated %d character of <strong>unexpected output</strong> during activation.',
[671] Fix | Delete
'The plugin generated %d characters of <strong>unexpected output</strong> during activation.',
[672] Fix | Delete
$_GET['charsout']
[673] Fix | Delete
),
[674] Fix | Delete
$_GET['charsout']
[675] Fix | Delete
);
[676] Fix | Delete
$errmsg .= ' ' . __( 'If you notice &#8220;headers already sent&#8221; messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.' );
[677] Fix | Delete
} elseif ( 'resuming' === $_GET['error'] ) {
[678] Fix | Delete
$errmsg = __( 'Plugin could not be resumed because it triggered a <strong>fatal error</strong>.' );
[679] Fix | Delete
} else {
[680] Fix | Delete
$errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' );
[681] Fix | Delete
}
[682] Fix | Delete
[683] Fix | Delete
if ( ! isset( $_GET['main'] ) && ! isset( $_GET['charsout'] )
[684] Fix | Delete
&& isset( $_GET['_error_nonce'] ) && wp_verify_nonce( $_GET['_error_nonce'], 'plugin-activation-error_' . $plugin )
[685] Fix | Delete
) {
[686] Fix | Delete
$iframe_url = add_query_arg(
[687] Fix | Delete
array(
[688] Fix | Delete
'action' => 'error_scrape',
[689] Fix | Delete
'plugin' => urlencode( $plugin ),
[690] Fix | Delete
'_wpnonce' => urlencode( $_GET['_error_nonce'] ),
[691] Fix | Delete
),
[692] Fix | Delete
admin_url( 'plugins.php' )
[693] Fix | Delete
);
[694] Fix | Delete
[695] Fix | Delete
$errmsg .= '<iframe style="border:0" width="100%" height="70px" src="' . esc_url( $iframe_url ) . '"></iframe>';
[696] Fix | Delete
}
[697] Fix | Delete
[698] Fix | Delete
wp_admin_notice(
[699] Fix | Delete
$errmsg,
[700] Fix | Delete
array(
[701] Fix | Delete
'id' => 'message',
[702] Fix | Delete
'additional_classes' => array( 'error' ),
[703] Fix | Delete
)
[704] Fix | Delete
);
[705] Fix | Delete
[706] Fix | Delete
} elseif ( isset( $_GET['deleted'] ) ) {
[707] Fix | Delete
$delete_result = get_option( 'plugins_delete_result_' . $user_ID );
[708] Fix | Delete
// Delete it once we're done.
[709] Fix | Delete
delete_option( 'plugins_delete_result_' . $user_ID );
[710] Fix | Delete
[711] Fix | Delete
if ( is_wp_error( $delete_result ) ) {
[712] Fix | Delete
$plugin_not_deleted_message = sprintf(
[713] Fix | Delete
/* translators: %s: Error message. */
[714] Fix | Delete
__( 'Plugin could not be deleted due to an error: %s' ),
[715] Fix | Delete
esc_html( $delete_result->get_error_message() )
[716] Fix | Delete
);
[717] Fix | Delete
wp_admin_notice(
[718] Fix | Delete
$plugin_not_deleted_message,
[719] Fix | Delete
array(
[720] Fix | Delete
'id' => 'message',
[721] Fix | Delete
'additional_classes' => array( 'error' ),
[722] Fix | Delete
'dismissible' => true,
[723] Fix | Delete
)
[724] Fix | Delete
);
[725] Fix | Delete
} else {
[726] Fix | Delete
if ( 1 === (int) $_GET['deleted'] ) {
[727] Fix | Delete
$plugins_deleted_message = __( 'The selected plugin has been deleted.' );
[728] Fix | Delete
} else {
[729] Fix | Delete
$plugins_deleted_message = __( 'The selected plugins have been deleted.' );
[730] Fix | Delete
}
[731] Fix | Delete
wp_admin_notice( $plugins_deleted_message, $updated_notice_args );
[732] Fix | Delete
}
[733] Fix | Delete
} elseif ( isset( $_GET['activate'] ) ) {
[734] Fix | Delete
wp_admin_notice( __( 'Plugin activated.' ), $updated_notice_args );
[735] Fix | Delete
} elseif ( isset( $_GET['activate-multi'] ) ) {
[736] Fix | Delete
wp_admin_notice( __( 'Selected plugins activated.' ), $updated_notice_args );
[737] Fix | Delete
} elseif ( isset( $_GET['deactivate'] ) ) {
[738] Fix | Delete
wp_admin_notice( __( 'Plugin deactivated.' ), $updated_notice_args );
[739] Fix | Delete
} elseif ( isset( $_GET['deactivate-multi'] ) ) {
[740] Fix | Delete
wp_admin_notice( __( 'Selected plugins deactivated.' ), $updated_notice_args );
[741] Fix | Delete
} elseif ( 'update-selected' === $action ) {
[742] Fix | Delete
wp_admin_notice( __( 'All selected plugins are up to date.' ), $updated_notice_args );
[743] Fix | Delete
} elseif ( isset( $_GET['resume'] ) ) {
[744] Fix | Delete
wp_admin_notice( __( 'Plugin resumed.' ), $updated_notice_args );
[745] Fix | Delete
} elseif ( isset( $_GET['enabled-auto-update'] ) ) {
[746] Fix | Delete
wp_admin_notice( __( 'Plugin will be auto-updated.' ), $updated_notice_args );
[747] Fix | Delete
} elseif ( isset( $_GET['disabled-auto-update'] ) ) {
[748] Fix | Delete
wp_admin_notice( __( 'Plugin will no longer be auto-updated.' ), $updated_notice_args );
[749] Fix | Delete
} elseif ( isset( $_GET['enabled-auto-update-multi'] ) ) {
[750] Fix | Delete
wp_admin_notice( __( 'Selected plugins will be auto-updated.' ), $updated_notice_args );
[751] Fix | Delete
} elseif ( isset( $_GET['disabled-auto-update-multi'] ) ) {
[752] Fix | Delete
wp_admin_notice( __( 'Selected plugins will no longer be auto-updated.' ), $updated_notice_args );
[753] Fix | Delete
}
[754] Fix | Delete
?>
[755] Fix | Delete
[756] Fix | Delete
<?php WP_Plugin_Dependencies::display_admin_notice_for_unmet_dependencies(); ?>
[757] Fix | Delete
<?php WP_Plugin_Dependencies::display_admin_notice_for_circular_dependencies(); ?>
[758] Fix | Delete
<div class="wrap">
[759] Fix | Delete
<h1 class="wp-heading-inline">
[760] Fix | Delete
<?php
[761] Fix | Delete
echo esc_html( $title );
[762] Fix | Delete
?>
[763] Fix | Delete
</h1>
[764] Fix | Delete
[765] Fix | Delete
<?php
[766] Fix | Delete
if ( ( ! is_multisite() || is_network_admin() ) && current_user_can( 'install_plugins' ) ) {
[767] Fix | Delete
?>
[768] Fix | Delete
<a href="<?php echo esc_url( self_admin_url( 'plugin-install.php' ) ); ?>" class="page-title-action"><?php echo esc_html__( 'Add Plugin' ); ?></a>
[769] Fix | Delete
<?php
[770] Fix | Delete
}
[771] Fix | Delete
[772] Fix | Delete
if ( strlen( $s ) ) {
[773] Fix | Delete
echo '<span class="subtitle">';
[774] Fix | Delete
printf(
[775] Fix | Delete
/* translators: %s: Search query. */
[776] Fix | Delete
__( 'Search results for: %s' ),
[777] Fix | Delete
'<strong>' . esc_html( urldecode( $s ) ) . '</strong>'
[778] Fix | Delete
);
[779] Fix | Delete
echo '</span>';
[780] Fix | Delete
}
[781] Fix | Delete
?>
[782] Fix | Delete
[783] Fix | Delete
<hr class="wp-header-end">
[784] Fix | Delete
[785] Fix | Delete
<?php
[786] Fix | Delete
/**
[787] Fix | Delete
* Fires before the plugins list table is rendered.
[788] Fix | Delete
*
[789] Fix | Delete
* This hook also fires before the plugins list table is rendered in the Network Admin.
[790] Fix | Delete
*
[791] Fix | Delete
* Please note: The 'active' portion of the hook name does not refer to whether the current
[792] Fix | Delete
* view is for active plugins, but rather all plugins actively-installed.
[793] Fix | Delete
*
[794] Fix | Delete
* @since 3.0.0
[795] Fix | Delete
*
[796] Fix | Delete
* @param array[] $plugins_all An array of arrays containing information on all installed plugins.
[797] Fix | Delete
*/
[798] Fix | Delete
do_action( 'pre_current_active_plugins', $plugins['all'] );
[799] Fix | Delete
?>
[800] Fix | Delete
[801] Fix | Delete
<?php $wp_list_table->views(); ?>
[802] Fix | Delete
[803] Fix | Delete
<form class="search-form search-plugins" method="get">
[804] Fix | Delete
<?php $wp_list_table->search_box( __( 'Search installed plugins' ), 'plugin' ); ?>
[805] Fix | Delete
</form>
[806] Fix | Delete
[807] Fix | Delete
<form method="post" id="bulk-action-form">
[808] Fix | Delete
[809] Fix | Delete
<input type="hidden" name="plugin_status" value="<?php echo esc_attr( $status ); ?>" />
[810] Fix | Delete
<input type="hidden" name="paged" value="<?php echo esc_attr( $page ); ?>" />
[811] Fix | Delete
[812] Fix | Delete
<?php $wp_list_table->display(); ?>
[813] Fix | Delete
</form>
[814] Fix | Delete
[815] Fix | Delete
<span class="spinner"></span>
[816] Fix | Delete
</div>
[817] Fix | Delete
[818] Fix | Delete
<?php
[819] Fix | Delete
wp_print_request_filesystem_credentials_modal();
[820] Fix | Delete
wp_print_admin_notice_templates();
[821] Fix | Delete
wp_print_update_row_templates();
[822] Fix | Delete
[823] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-footer.php';
[824] Fix | Delete
[825] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function