- F324C3E723AE8D5248A4BC68B41BF2867524CF50D19D64F09D965A7C7E7F5E521BEE9570BFF3ECE96AD44F0E2086D69CEB97E0101BC6B1AECD2D574A540AED79
+ F42C4E6E3FB6A8F32281A6A8BD0049B1BDF120FCC3A0B917F8F5BD2AD5299DA654A3236D37D47F679288BFDF2CBC48968DC2B574E2C8DCA54FE1E6DF7C24A01C
mp-wp/wp-admin/includes/plugin.php
(124 . 7)(124 . 7)
24634 if ( ! empty($plugin_data['AuthorURI']) )
24635 $plugin_data['Author'] = '<a href="' . $plugin_data['AuthorURI'] . '" title="' . __( 'Visit author homepage' ) . '">' . $plugin_data['Author'] . '</a>';
24636
24637 $plugin_data['Description'] = wptexturize( $plugin_data['Description'] );
24638 $plugin_data['Description'] = $plugin_data['Description'];
24639 if( ! empty($plugin_data['Author']) )
24640 $plugin_data['Description'] .= ' <cite>' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.</cite>';
24641 }
(342 . 99)(342 . 6)
24643 return true;
24644 }
24645
24646 /**
24647 * Remove directory and files of a plugin for a single or list of plugin(s).
24648 *
24649 * If the plugins parameter list is empty, false will be returned. True when
24650 * completed.
24651 *
24652 * @since unknown
24653 *
24654 * @param array $plugins List of plugin
24655 * @param string $redirect Redirect to page when complete.
24656 * @return mixed
24657 */
24658 function delete_plugins($plugins, $redirect = '' ) {
24659 global $wp_filesystem;
24660
24661 if( empty($plugins) )
24662 return false;
24663
24664 $checked = array();
24665 foreach( $plugins as $plugin )
24666 $checked[] = 'checked[]=' . $plugin;
24667
24668 ob_start();
24669 $url = wp_nonce_url('plugins.php?action=delete-selected&verify-delete=1&' . implode('&', $checked), 'bulk-manage-plugins');
24670 if ( false === ($credentials = request_filesystem_credentials($url)) ) {
24671 $data = ob_get_contents();
24672 ob_end_clean();
24673 if( ! empty($data) ){
24674 include_once( ABSPATH . 'wp-admin/admin-header.php');
24675 echo $data;
24676 include( ABSPATH . 'wp-admin/admin-footer.php');
24677 exit;
24678 }
24679 return;
24680 }
24681
24682 if ( ! WP_Filesystem($credentials) ) {
24683 request_filesystem_credentials($url, '', true); //Failed to connect, Error and request again
24684 $data = ob_get_contents();
24685 ob_end_clean();
24686 if( ! empty($data) ){
24687 include_once( ABSPATH . 'wp-admin/admin-header.php');
24688 echo $data;
24689 include( ABSPATH . 'wp-admin/admin-footer.php');
24690 exit;
24691 }
24692 return;
24693 }
24694
24695 if ( $wp_filesystem->errors->get_error_code() ) {
24696 return $wp_filesystem->errors;
24697 }
24698
24699 if ( ! is_object($wp_filesystem) )
24700 return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
24701
24702 if ( $wp_filesystem->errors->get_error_code() )
24703 return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors);
24704
24705 //Get the base plugin folder
24706 $plugins_dir = $wp_filesystem->wp_plugins_dir();
24707 if ( empty($plugins_dir) )
24708 return new WP_Error('fs_no_plugins_dir', __('Unable to locate WordPress Plugin directory.'));
24709
24710 $plugins_dir = trailingslashit( $plugins_dir );
24711
24712 $errors = array();
24713
24714 foreach( $plugins as $plugin_file ) {
24715 // Run Uninstall hook
24716 if ( is_uninstallable_plugin( $plugin_file ) )
24717 uninstall_plugin($plugin_file);
24718
24719 $this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin_file) );
24720 // If plugin is in its own directory, recursively delete the directory.
24721 if ( strpos($plugin_file, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory seperator AND that its not the root plugin folder
24722 $deleted = $wp_filesystem->delete($this_plugin_dir, true);
24723 else
24724 $deleted = $wp_filesystem->delete($plugins_dir . $plugin_file);
24725
24726 if ( ! $deleted )
24727 $errors[] = $plugin_file;
24728 }
24729
24730 if ( ! empty($errors) )
24731 return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s'), implode(', ', $errors)) );
24732
24733 // Force refresh of plugin update information
24734 delete_option('update_plugins');
24735
24736 return true;
24737 }
24738
24739 function validate_active_plugins() {
24740 $check_plugins = get_option('active_plugins');
24741
(479 . 63)(386 . 6)
24743 return 0;
24744 }
24745
24746 /**
24747 * Whether the plugin can be uninstalled.
24748 *
24749 * @since 2.7.0
24750 *
24751 * @param string $plugin Plugin path to check.
24752 * @return bool Whether plugin can be uninstalled.
24753 */
24754 function is_uninstallable_plugin($plugin) {
24755 $file = plugin_basename($plugin);
24756
24757 $uninstallable_plugins = (array) get_option('uninstall_plugins');
24758 if ( isset( $uninstallable_plugins[$file] ) || file_exists( WP_PLUGIN_DIR . '/' . dirname($file) . '/uninstall.php' ) )
24759 return true;
24760
24761 return false;
24762 }
24763
24764 /**
24765 * Uninstall a single plugin.
24766 *
24767 * Calls the uninstall hook, if it is available.
24768 *
24769 * @since 2.7.0
24770 *
24771 * @param string $plugin Relative plugin path from Plugin Directory.
24772 */
24773 function uninstall_plugin($plugin) {
24774 $file = plugin_basename($plugin);
24775
24776 $uninstallable_plugins = (array) get_option('uninstall_plugins');
24777 if ( file_exists( WP_PLUGIN_DIR . '/' . dirname($file) . '/uninstall.php' ) ) {
24778 if ( isset( $uninstallable_plugins[$file] ) ) {
24779 unset($uninstallable_plugins[$file]);
24780 update_option('uninstall_plugins', $uninstallable_plugins);
24781 }
24782 unset($uninstallable_plugins);
24783
24784 define('WP_UNINSTALL_PLUGIN', $file);
24785 include WP_PLUGIN_DIR . '/' . dirname($file) . '/uninstall.php';
24786
24787 return true;
24788 }
24789
24790 if ( isset( $uninstallable_plugins[$file] ) ) {
24791 $callable = $uninstallable_plugins[$file];
24792 unset($uninstallable_plugins[$file]);
24793 update_option('uninstall_plugins', $uninstallable_plugins);
24794 unset($uninstallable_plugins);
24795
24796 include WP_PLUGIN_DIR . '/' . $file;
24797
24798 add_action( 'uninstall_' . $file, $callable );
24799 do_action( 'uninstall_' . $file );
24800 }
24801 }
24802
24803 //
24804 // Menu
24805 //
(711 . 14)(561 . 6)
24807 $parent = $_wp_real_parent_file[$parent];
24808 return $parent;
24809 }
24810 /*
24811 if ( !empty ( $parent_file ) ) {
24812 if ( isset( $_wp_real_parent_file[$parent_file] ) )
24813 $parent_file = $_wp_real_parent_file[$parent_file];
24814
24815 return $parent_file;
24816 }
24817 */
24818
24819 if ( $pagenow == 'admin.php' && isset( $plugin_page ) ) {
24820 foreach ( $menu as $parent_menu ) {