whoami7 - Manager
:
/
home
/
topsuzmw
/
public_html
/
wp-includes
/
private
/
Upload File:
files >> //home/topsuzmw/public_html/wp-includes/private/wp-admin.zip
PK w �Z��Õ� � custom-header.phpnu ��� <?php /** * Custom header image script. * * This file is deprecated, use 'wp-admin/includes/class-custom-image-header.php' instead. * * @deprecated 5.3.0 * @package WordPress * @subpackage Administration */ // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } _deprecated_file( basename( __FILE__ ), '5.3.0', 'wp-admin/includes/class-custom-image-header.php' ); /** Custom_Image_Header class */ require_once ABSPATH . 'wp-admin/includes/class-custom-image-header.php'; PK w �Z�H��3 3 media.phpnu ��� <?php /** * Media management action handler. * * This file is deprecated, use 'wp-admin/upload.php' instead. * * @deprecated 6.3.0 * @package WordPress * @subpackage Administration */ /** Load WordPress Administration Bootstrap. */ require_once __DIR__ . '/admin.php'; $parent_file = 'upload.php'; $submenu_file = 'upload.php'; $action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : ''; switch ( $action ) { case 'editattachment': case 'edit': if ( empty( $_GET['attachment_id'] ) ) { wp_redirect( admin_url( 'upload.php?error=deprecated' ) ); exit; } $att_id = (int) $_GET['attachment_id']; wp_redirect( admin_url( "upload.php?item={$att_id}&error=deprecated" ) ); exit; default: wp_redirect( admin_url( 'upload.php?error=deprecated' ) ); exit; } PK w �Z��z�Ws Ws edit-form-advanced.phpnu ��� <?php /** * Post advanced form for inclusion in the administration panels. * * @package WordPress * @subpackage Administration */ // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } /** * @global string $post_type Global post type. * @global WP_Post_Type $post_type_object Global post type object. * @global WP_Post $post Global post object. */ global $post_type, $post_type_object, $post; // Flag that we're not loading the block editor. $current_screen = get_current_screen(); $current_screen->is_block_editor( false ); if ( is_multisite() ) { add_action( 'admin_footer', '_admin_notice_post_locked' ); } else { if ( get_user_count() > 1 ) { add_action( 'admin_footer', '_admin_notice_post_locked' ); } unset( $check_users ); } wp_enqueue_script( 'post' ); $_wp_editor_expand = false; $_content_editor_dfw = false; if ( post_type_supports( $post_type, 'editor' ) && ! wp_is_mobile() && ! ( $is_IE && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) ) ) { /** * Filters whether to enable the 'expand' functionality in the post editor. * * @since 4.0.0 * @since 4.1.0 Added the `$post_type` parameter. * * @param bool $expand Whether to enable the 'expand' functionality. Default true. * @param string $post_type Post type. */ if ( apply_filters( 'wp_editor_expand', true, $post_type ) ) { wp_enqueue_script( 'editor-expand' ); $_content_editor_dfw = true; $_wp_editor_expand = ( 'on' === get_user_setting( 'editor_expand', 'on' ) ); } } if ( wp_is_mobile() ) { wp_enqueue_script( 'jquery-touch-punch' ); } /** * Post ID global * * @name $post_ID * @var int */ $post_ID = isset( $post_ID ) ? (int) $post_ID : 0; $user_ID = isset( $user_ID ) ? (int) $user_ID : 0; $action = isset( $action ) ? $action : ''; if ( (int) get_option( 'page_for_posts' ) === $post->ID && empty( $post->post_content ) ) { add_action( 'edit_form_after_title', '_wp_posts_page_notice' ); remove_post_type_support( $post_type, 'editor' ); } $thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' ); if ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) { if ( wp_attachment_is( 'audio', $post ) ) { $thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' ); } elseif ( wp_attachment_is( 'video', $post ) ) { $thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' ); } } if ( $thumbnail_support ) { add_thickbox(); wp_enqueue_media( array( 'post' => $post->ID ) ); } // Add the local autosave notice HTML. add_action( 'admin_footer', '_local_storage_notice' ); /* * @todo Document the $messages array(s). */ $permalink = get_permalink( $post->ID ); if ( ! $permalink ) { $permalink = ''; } $messages = array(); $preview_post_link_html = ''; $scheduled_post_link_html = ''; $view_post_link_html = ''; $preview_page_link_html = ''; $scheduled_page_link_html = ''; $view_page_link_html = ''; $preview_url = get_preview_post_link( $post ); $viewable = is_post_type_viewable( $post_type_object ); if ( $viewable ) { // Preview post link. $preview_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( $preview_url ), __( 'Preview post' ) ); // Scheduled post preview link. $scheduled_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( $permalink ), __( 'Preview post' ) ); // View post link. $view_post_link_html = sprintf( ' <a href="%1$s">%2$s</a>', esc_url( $permalink ), __( 'View post' ) ); // Preview page link. $preview_page_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( $preview_url ), __( 'Preview page' ) ); // Scheduled page preview link. $scheduled_page_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', esc_url( $permalink ), __( 'Preview page' ) ); // View page link. $view_page_link_html = sprintf( ' <a href="%1$s">%2$s</a>', esc_url( $permalink ), __( 'View page' ) ); } $scheduled_date = sprintf( /* translators: Publish box date string. 1: Date, 2: Time. */ __( '%1$s at %2$s' ), /* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */ date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ), /* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */ date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) ) ); $messages['post'] = array( 0 => '', // Unused. Messages start at index 1. 1 => __( 'Post updated.' ) . $view_post_link_html, 2 => __( 'Custom field updated.' ), 3 => __( 'Custom field deleted.' ), 4 => __( 'Post updated.' ), /* translators: %s: Date and time of the revision. */ 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Post restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 6 => __( 'Post published.' ) . $view_post_link_html, 7 => __( 'Post saved.' ), 8 => __( 'Post submitted.' ) . $preview_post_link_html, /* translators: %s: Scheduled date for the post. */ 9 => sprintf( __( 'Post scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html, 10 => __( 'Post draft updated.' ) . $preview_post_link_html, ); $messages['page'] = array( 0 => '', // Unused. Messages start at index 1. 1 => __( 'Page updated.' ) . $view_page_link_html, 2 => __( 'Custom field updated.' ), 3 => __( 'Custom field deleted.' ), 4 => __( 'Page updated.' ), /* translators: %s: Date and time of the revision. */ 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Page restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 6 => __( 'Page published.' ) . $view_page_link_html, 7 => __( 'Page saved.' ), 8 => __( 'Page submitted.' ) . $preview_page_link_html, /* translators: %s: Scheduled date for the page. */ 9 => sprintf( __( 'Page scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_page_link_html, 10 => __( 'Page draft updated.' ) . $preview_page_link_html, ); $messages['attachment'] = array_fill( 1, 10, __( 'Media file updated.' ) ); // Hack, for now. /** * Filters the post updated messages. * * @since 3.0.0 * * @param array[] $messages Post updated messages. For defaults see `$messages` declarations above. */ $messages = apply_filters( 'post_updated_messages', $messages ); $message = false; if ( isset( $_GET['message'] ) ) { $_GET['message'] = absint( $_GET['message'] ); if ( isset( $messages[ $post_type ][ $_GET['message'] ] ) ) { $message = $messages[ $post_type ][ $_GET['message'] ]; } elseif ( ! isset( $messages[ $post_type ] ) && isset( $messages['post'][ $_GET['message'] ] ) ) { $message = $messages['post'][ $_GET['message'] ]; } } $notice = false; $form_extra = ''; if ( 'auto-draft' === $post->post_status ) { if ( 'edit' === $action ) { $post->post_title = ''; } $autosave = false; $form_extra .= "<input type='hidden' id='auto_draft' name='auto_draft' value='1' />"; } else { $autosave = wp_get_post_autosave( $post->ID ); } $form_action = 'editpost'; $nonce_action = 'update-post_' . $post->ID; $form_extra .= "<input type='hidden' id='post_ID' name='post_ID' value='" . esc_attr( $post->ID ) . "' />"; // Detect if there exists an autosave newer than the post and if that autosave is different than the post. if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) { foreach ( _wp_post_revision_fields( $post ) as $autosave_field => $_autosave_field ) { if ( normalize_whitespace( $autosave->$autosave_field ) !== normalize_whitespace( $post->$autosave_field ) ) { $notice = sprintf( /* translators: %s: URL to view the autosave. */ __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>' ), get_edit_post_link( $autosave->ID ) ); break; } } // If this autosave isn't different from the current post, begone. if ( ! $notice ) { wp_delete_post_revision( $autosave->ID ); } unset( $autosave_field, $_autosave_field ); } $post_type_object = get_post_type_object( $post_type ); // All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action). require_once ABSPATH . 'wp-admin/includes/meta-boxes.php'; register_and_do_post_meta_boxes( $post ); add_screen_option( 'layout_columns', array( 'max' => 2, 'default' => 2, ) ); if ( 'post' === $post_type ) { $customize_display = '<p>' . __( 'The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes using drag and drop. You can also minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.' ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'customize-display', 'title' => __( 'Customizing This Display' ), 'content' => $customize_display, ) ); $title_and_editor = '<p>' . __( '<strong>Title</strong> — Enter a title for your post. After you enter a title, you’ll see the permalink below, which you can edit.' ) . '</p>'; $title_and_editor .= '<p>' . __( '<strong>Post editor</strong> — Enter the text for your post. There are two modes of editing: Visual and Code. Choose the mode by clicking on the appropriate tab.' ) . '</p>'; $title_and_editor .= '<p>' . __( 'Visual mode gives you an editor that is similar to a word processor. Click the Toolbar Toggle button to get a second row of controls.' ) . '</p>'; $title_and_editor .= '<p>' . __( 'The Code mode allows you to enter HTML along with your post text. Note that <p> and <br> tags are converted to line breaks when switching to the Code editor to make it less cluttered. When you type, a single line break can be used instead of typing <br>, and two line breaks instead of paragraph tags. The line breaks are converted back to tags automatically.' ) . '</p>'; $title_and_editor .= '<p>' . __( 'You can insert media files by clicking the button above the post editor and following the directions. You can align or edit images using the inline formatting toolbar available in Visual mode.' ) . '</p>'; $title_and_editor .= '<p>' . __( 'You can enable distraction-free writing mode using the icon to the right. This feature is not available for old browsers or devices with small screens, and requires that the full-height editor be enabled in Screen Options.' ) . '</p>'; $title_and_editor .= '<p>' . sprintf( /* translators: %s: Alt + F10 */ __( 'Keyboard users: When you are working in the visual editor, you can use %s to access the toolbar.' ), '<kbd>Alt + F10</kbd>' ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'title-post-editor', 'title' => __( 'Title and Post Editor' ), 'content' => $title_and_editor, ) ); get_current_screen()->set_help_sidebar( '<p>' . sprintf( /* translators: %s: URL to Press This bookmarklet. */ __( 'You can also create posts with the <a href="%s">Press This bookmarklet</a>.' ), 'tools.php' ) . '</p>' . '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/write-posts-classic-editor/">Documentation on Writing and Editing Posts</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); } elseif ( 'page' === $post_type ) { $about_pages = '<p>' . __( 'Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the “Parent” of the other, creating a group of pages.' ) . '</p>' . '<p>' . __( 'Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. This screen also has the distraction-free writing space, available in both the Visual and Code modes via the Fullscreen buttons. The Page editor mostly works the same as the Post editor, but there are some Page-specific features in the Page Attributes box.' ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'about-pages', 'title' => __( 'About Pages' ), 'content' => $about_pages, ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/pages-add-new-screen/">Documentation on Adding New Pages</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/pages-screen/">Documentation on Editing Pages</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); } elseif ( 'attachment' === $post_type ) { get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'This screen allows you to edit fields for metadata in a file within the media library.' ) . '</p>' . '<p>' . __( 'For images only, you can click on Edit Image under the thumbnail to expand out an inline image editor with icons for cropping, rotating, or flipping the image as well as for undoing and redoing. The boxes on the right give you more options for scaling the image, for cropping it, and for cropping the thumbnail in a different way than you crop the original image. You can click on Help in those boxes to get more information.' ) . '</p>' . '<p>' . __( 'Note that you crop the image by clicking on it (the Crop icon is already selected) and dragging the cropping frame to select the desired part. Then click Save to retain the cropping.' ) . '</p>' . '<p>' . __( 'Remember to click Update to save metadata entered or changed.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/edit-media/">Documentation on Edit Media</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); } if ( 'post' === $post_type || 'page' === $post_type ) { $inserting_media = '<p>' . __( 'You can upload and insert media (images, audio, documents, etc.) by clicking the Add Media button. You can select from the images and files already uploaded to the Media Library, or upload new media to add to your page or post. To create an image gallery, select the images to add and click the “Create a new gallery” button.' ) . '</p>'; $inserting_media .= '<p>' . __( 'You can also embed media from many popular websites including Twitter, YouTube, Flickr and others by pasting the media URL on its own line into the content of your post/page. <a href="https://wordpress.org/documentation/article/embeds/">Learn more about embeds</a>.' ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'inserting-media', 'title' => __( 'Inserting Media' ), 'content' => $inserting_media, ) ); } if ( 'post' === $post_type ) { $publish_box = '<p>' . __( 'Several boxes on this screen contain settings for how your content will be published, including:' ) . '</p>'; $publish_box .= '<ul><li>' . __( '<strong>Publish</strong> — You can set the terms of publishing your post in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a post or making it stay at the top of your blog indefinitely (sticky). The Password protected option allows you to set an arbitrary password for each post. The Private option hides the post from everyone except editors and administrators. Publish (immediately) allows you to set a future or past date and time, so you can schedule a post to be published in the future or backdate a post.' ) . '</li>'; if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) { $publish_box .= '<li>' . __( '<strong>Format</strong> — Post Formats designate how your theme will display a specific post. For example, you could have a <em>standard</em> blog post with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Your theme could enable all or some of 10 possible formats. <a href="https://developer.wordpress.org/advanced-administration/wordpress/post-formats/#supported-formats">Learn more about each post format</a>.' ) . '</li>'; } if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) { $publish_box .= '<li>' . sprintf( /* translators: %s: Featured image. */ __( '<strong>%s</strong> — This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the image as a post thumbnail on the home page, a custom header, etc.' ), esc_html( $post_type_object->labels->featured_image ) ) . '</li>'; } $publish_box .= '</ul>'; get_current_screen()->add_help_tab( array( 'id' => 'publish-box', 'title' => __( 'Publish Settings' ), 'content' => $publish_box, ) ); $discussion_settings = '<p>' . __( '<strong>Send Trackbacks</strong> — Trackbacks are a way to notify legacy blog systems that you’ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they’ll be notified automatically using pingbacks, and this field is unnecessary.' ) . '</p>'; $discussion_settings .= '<p>' . __( '<strong>Discussion</strong> — You can turn comments and pings on or off, and if there are comments on the post, you can see them here and moderate them.' ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'discussion-settings', 'title' => __( 'Discussion Settings' ), 'content' => $discussion_settings, ) ); } elseif ( 'page' === $post_type ) { $page_attributes = '<p>' . __( '<strong>Parent</strong> — You can arrange your pages in hierarchies. For example, you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how many levels you can nest pages.' ) . '</p>' . '<p>' . __( '<strong>Template</strong> — Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them in this dropdown menu.' ) . '</p>' . '<p>' . __( '<strong>Order</strong> — Pages are usually ordered alphabetically, but you can choose your own order by entering a number (1 for first, etc.) in this field.' ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'page-attributes', 'title' => __( 'Page Attributes' ), 'content' => $page_attributes, ) ); } require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1 class="wp-heading-inline"> <?php echo esc_html( $title ); ?> </h1> <?php if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) ) { echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="page-title-action">' . esc_html( $post_type_object->labels->add_new_item ) . '</a>'; } ?> <hr class="wp-header-end"> <?php if ( $notice ) : wp_admin_notice( '<p id="has-newer-autosave">' . $notice . '</p>', array( 'type' => 'warning', 'id' => 'notice', 'paragraph_wrap' => false, ) ); endif; if ( $message ) : wp_admin_notice( $message, array( 'type' => 'success', 'dismissible' => true, 'id' => 'message', 'additional_classes' => array( 'updated' ), ) ); endif; $connection_lost_message = sprintf( '<span class="spinner"></span> %1$s <span class="hide-if-no-sessionstorage">%2$s</span>', __( '<strong>Connection lost.</strong> Saving has been disabled until you are reconnected.' ), __( 'This post is being backed up in your browser, just in case.' ) ); wp_admin_notice( $connection_lost_message, array( 'id' => 'lost-connection-notice', 'additional_classes' => array( 'error', 'hidden' ), ) ); ?> <form name="post" action="post.php" method="post" id="post" <?php /** * Fires inside the post editor form tag. * * @since 3.0.0 * * @param WP_Post $post Post object. */ do_action( 'post_edit_form_tag', $post ); $referer = wp_get_referer(); ?> > <?php wp_nonce_field( $nonce_action ); ?> <input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID; ?>" /> <input type="hidden" id="hiddenaction" name="action" value="<?php echo esc_attr( $form_action ); ?>" /> <input type="hidden" id="originalaction" name="originalaction" value="<?php echo esc_attr( $form_action ); ?>" /> <input type="hidden" id="post_author" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" /> <input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr( $post_type ); ?>" /> <input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr( $post->post_status ); ?>" /> <input type="hidden" id="referredby" name="referredby" value="<?php echo $referer ? esc_url( $referer ) : ''; ?>" /> <?php if ( ! empty( $active_post_lock ) ) { ?> <input type="hidden" id="active_post_lock" value="<?php echo esc_attr( implode( ':', $active_post_lock ) ); ?>" /> <?php } if ( 'draft' !== get_post_status( $post ) ) { wp_original_referer_field( true, 'previous' ); } echo $form_extra; wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?> <?php /** * Fires at the beginning of the edit form. * * At this point, the required hidden fields and nonces have already been output. * * @since 3.7.0 * * @param WP_Post $post Post object. */ do_action( 'edit_form_top', $post ); ?> <div id="poststuff"> <div id="post-body" class="metabox-holder columns-<?php echo ( 1 === get_current_screen()->get_columns() ) ? '1' : '2'; ?>"> <div id="post-body-content"> <?php if ( post_type_supports( $post_type, 'title' ) ) { ?> <div id="titlediv"> <div id="titlewrap"> <?php /** * Filters the title field placeholder text. * * @since 3.1.0 * * @param string $text Placeholder text. Default 'Add title'. * @param WP_Post $post Post object. */ $title_placeholder = apply_filters( 'enter_title_here', __( 'Add title' ), $post ); ?> <label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo $title_placeholder; ?></label> <input type="text" name="post_title" size="30" value="<?php echo esc_attr( $post->post_title ); ?>" id="title" spellcheck="true" autocomplete="off" /> <?php if ( post_type_supports( $post_type, 'editor' ) ) { ?> <a href="#content" class="button-secondary screen-reader-text skiplink" onclick="if (tinymce) { tinymce.execCommand( 'mceFocus', false, 'content' ); }"><?php esc_html_e( 'Skip to Editor' ); ?></a> <?php } ?> </div> <?php /** * Fires before the permalink field in the edit form. * * @since 4.1.0 * * @param WP_Post $post Post object. */ do_action( 'edit_form_before_permalink', $post ); ?> <div class="inside"> <?php if ( $viewable ) : $sample_permalink_html = $post_type_object->public ? get_sample_permalink_html( $post->ID ) : ''; // As of 4.4, the Get Shortlink button is hidden by default. if ( has_filter( 'pre_get_shortlink' ) || has_filter( 'get_shortlink' ) ) { $shortlink = wp_get_shortlink( $post->ID, 'post' ); if ( ! empty( $shortlink ) && $shortlink !== $permalink && home_url( '?page_id=' . $post->ID ) !== $permalink ) { $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" />' . '<button type="button" class="button button-small" onclick="prompt('URL:', jQuery(\'#shortlink\').val());">' . __( 'Get Shortlink' ) . '</button>'; } } if ( $post_type_object->public && ! ( 'pending' === get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) { $has_sample_permalink = $sample_permalink_html && 'auto-draft' !== $post->post_status; ?> <div id="edit-slug-box" class="hide-if-no-js"> <?php if ( $has_sample_permalink ) { echo $sample_permalink_html; } ?> </div> <?php } endif; ?> </div> <?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?> </div><!-- /titlediv --> <?php } /** * Fires after the title field. * * @since 3.5.0 * * @param WP_Post $post Post object. */ do_action( 'edit_form_after_title', $post ); if ( post_type_supports( $post_type, 'editor' ) ) { $_wp_editor_expand_class = ''; if ( $_wp_editor_expand ) { $_wp_editor_expand_class = ' wp-editor-expand'; } ?> <div id="postdivrich" class="postarea<?php echo $_wp_editor_expand_class; ?>"> <?php wp_editor( $post->post_content, 'content', array( '_content_editor_dfw' => $_content_editor_dfw, 'drag_drop_upload' => true, 'editor_height' => 300, 'tinymce' => array( 'resize' => false, 'wp_autoresize_on' => $_wp_editor_expand, 'add_unload_trigger' => false, ), ) ); ?> <table id="post-status-info" role="presentation"><tbody><tr> <td id="wp-word-count" class="hide-if-no-js"> <?php printf( /* translators: %s: Number of words. */ __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?> </td> <td class="autosave-info"> <span class="autosave-message"> </span> <?php if ( 'auto-draft' !== $post->post_status ) { echo '<span id="last-edit">'; $last_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) ); if ( $last_user ) { printf( /* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time. */ __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) ); } else { printf( /* translators: 1: Post edited date, 2: Post edited time. */ __( 'Last edited on %1$s at %2$s' ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) ); } echo '</span>'; } ?> </td> <td id="content-resize-handle" class="hide-if-no-js"><br /></td> </tr></tbody></table> </div> <?php } /** * Fires after the content editor. * * @since 3.5.0 * * @param WP_Post $post Post object. */ do_action( 'edit_form_after_editor', $post ); ?> </div><!-- /post-body-content --> <div id="postbox-container-1" class="postbox-container"> <?php if ( 'page' === $post_type ) { /** * Fires before meta boxes with 'side' context are output for the 'page' post type. * * The submitpage box is a meta box with 'side' context, so this hook fires just before it is output. * * @since 2.5.0 * * @param WP_Post $post Post object. */ do_action( 'submitpage_box', $post ); } else { /** * Fires before meta boxes with 'side' context are output for all post types other than 'page'. * * The submitpost box is a meta box with 'side' context, so this hook fires just before it is output. * * @since 2.5.0 * * @param WP_Post $post Post object. */ do_action( 'submitpost_box', $post ); } do_meta_boxes( $post_type, 'side', $post ); ?> </div> <div id="postbox-container-2" class="postbox-container"> <?php do_meta_boxes( null, 'normal', $post ); if ( 'page' === $post_type ) { /** * Fires after 'normal' context meta boxes have been output for the 'page' post type. * * @since 1.5.0 * * @param WP_Post $post Post object. */ do_action( 'edit_page_form', $post ); } else { /** * Fires after 'normal' context meta boxes have been output for all post types other than 'page'. * * @since 1.5.0 * * @param WP_Post $post Post object. */ do_action( 'edit_form_advanced', $post ); } do_meta_boxes( null, 'advanced', $post ); ?> </div> <?php /** * Fires after all meta box sections have been output, before the closing #post-body div. * * @since 2.1.0 * * @param WP_Post $post Post object. */ do_action( 'dbx_post_sidebar', $post ); ?> </div><!-- /post-body --> <br class="clear" /> </div><!-- /poststuff --> </form> </div> <?php if ( post_type_supports( $post_type, 'comments' ) ) { wp_comment_reply(); } ?> <?php if ( ! wp_is_mobile() && post_type_supports( $post_type, 'title' ) && '' === $post->post_title ) : ?> <script type="text/javascript"> try{document.post.title.focus();}catch(e){} </script> <?php endif; ?> PK w �Z�����E �E setup-config.phpnu ��� <?php /** * Retrieves and creates the wp-config.php file. * * The permissions for the base directory must allow for writing files in order * for the wp-config.php to be created using this page. * * @package WordPress * @subpackage Administration */ /** * We are installing. */ define( 'WP_INSTALLING', true ); /** * We are blissfully unaware of anything. */ define( 'WP_SETUP_CONFIG', true ); /** * Disable error reporting * * Set this to error_reporting( -1 ) for debugging */ error_reporting( 0 ); if ( ! defined( 'ABSPATH' ) ) { define( 'ABSPATH', dirname( __DIR__ ) . '/' ); } require ABSPATH . 'wp-settings.php'; /** Load WordPress Administration Upgrade API */ require_once ABSPATH . 'wp-admin/includes/upgrade.php'; /** Load WordPress Translation Installation API */ require_once ABSPATH . 'wp-admin/includes/translation-install.php'; nocache_headers(); // Support wp-config-sample.php one level up, for the develop repo. if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) { $config_file = file( ABSPATH . 'wp-config-sample.php' ); } elseif ( file_exists( dirname( ABSPATH ) . '/wp-config-sample.php' ) ) { $config_file = file( dirname( ABSPATH ) . '/wp-config-sample.php' ); } else { wp_die( sprintf( /* translators: %s: wp-config-sample.php */ __( 'Sorry, I need a %s file to work from. Please re-upload this file to your WordPress installation.' ), '<code>wp-config-sample.php</code>' ) ); } // Check if wp-config.php has been created. if ( file_exists( ABSPATH . 'wp-config.php' ) ) { wp_die( '<p>' . sprintf( /* translators: 1: wp-config.php, 2: install.php */ __( 'The file %1$s already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href="%2$s">installing now</a>.' ), '<code>wp-config.php</code>', 'install.php' ) . '</p>', 409 ); } // Check if wp-config.php exists above the root directory but is not part of another installation. if ( @file_exists( ABSPATH . '../wp-config.php' ) && ! @file_exists( ABSPATH . '../wp-settings.php' ) ) { wp_die( '<p>' . sprintf( /* translators: 1: wp-config.php, 2: install.php */ __( 'The file %1$s already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href="%2$s">installing now</a>.' ), '<code>wp-config.php</code>', 'install.php' ) . '</p>', 409 ); } $step = isset( $_GET['step'] ) ? (int) $_GET['step'] : -1; /** * Display setup wp-config.php file header. * * @ignore * @since 2.3.0 * * @param string|string[] $body_classes Class attribute values for the body tag. */ function setup_config_display_header( $body_classes = array() ) { $body_classes = (array) $body_classes; $body_classes[] = 'wp-core-ui'; $dir_attr = ''; if ( is_rtl() ) { $body_classes[] = 'rtl'; $dir_attr = ' dir="rtl"'; } header( 'Content-Type: text/html; charset=utf-8' ); ?> <!DOCTYPE html> <html<?php echo $dir_attr; ?>> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="robots" content="noindex,nofollow" /> <title><?php _e( 'WordPress › Setup Configuration File' ); ?></title> <?php wp_admin_css( 'install', true ); ?> </head> <body class="<?php echo implode( ' ', $body_classes ); ?>"> <p id="logo"><?php _e( 'WordPress' ); ?></p> <?php } // End function setup_config_display_header(); /** * @global string $wp_local_package Locale code of the package. * @global WP_Locale $wp_locale WordPress date and time locale object. */ $language = ''; if ( ! empty( $_REQUEST['language'] ) ) { $language = preg_replace( '/[^a-zA-Z0-9_]/', '', $_REQUEST['language'] ); } elseif ( isset( $GLOBALS['wp_local_package'] ) ) { $language = $GLOBALS['wp_local_package']; } switch ( $step ) { case -1: if ( wp_can_install_language_pack() && empty( $language ) ) { $languages = wp_get_available_translations(); if ( $languages ) { setup_config_display_header( 'language-chooser' ); echo '<h1 class="screen-reader-text">Select a default language</h1>'; echo '<form id="setup" method="post" action="?step=0">'; wp_install_language_form( $languages ); echo '</form>'; break; } } // Deliberately fall through if we can't reach the translations API. case 0: if ( ! empty( $language ) ) { $loaded_language = wp_download_language_pack( $language ); if ( $loaded_language ) { load_default_textdomain( $loaded_language ); $GLOBALS['wp_locale'] = new WP_Locale(); } } setup_config_display_header(); $step_1 = 'setup-config.php?step=1'; if ( isset( $_REQUEST['noapi'] ) ) { $step_1 .= '&noapi'; } if ( ! empty( $loaded_language ) ) { $step_1 .= '&language=' . $loaded_language; } ?> <h1 class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Before getting started' ); ?> </h1> <p><?php _e( 'Welcome to WordPress. Before getting started, you will need to know the following items.' ); ?></p> <ol> <li><?php _e( 'Database name' ); ?></li> <li><?php _e( 'Database username' ); ?></li> <li><?php _e( 'Database password' ); ?></li> <li><?php _e( 'Database host' ); ?></li> <li><?php _e( 'Table prefix (if you want to run more than one WordPress in a single database)' ); ?></li> </ol> <p> <?php printf( /* translators: %s: wp-config.php */ __( 'This information is being used to create a %s file.' ), '<code>wp-config.php</code>' ); ?> <strong> <?php printf( /* translators: 1: wp-config-sample.php, 2: wp-config.php */ __( 'If for any reason this automatic file creation does not work, do not worry. All this does is fill in the database information to a configuration file. You may also simply open %1$s in a text editor, fill in your information, and save it as %2$s.' ), '<code>wp-config-sample.php</code>', '<code>wp-config.php</code>' ); ?> </strong> <?php printf( /* translators: 1: Documentation URL, 2: wp-config.php */ __( 'Need more help? <a href="%1$s">Read the support article on %2$s</a>.' ), __( 'https://developer.wordpress.org/advanced-administration/wordpress/wp-config/' ), '<code>wp-config.php</code>' ); ?> </p> <p><?php _e( 'In all likelihood, these items were supplied to you by your web host. If you do not have this information, then you will need to contact them before you can continue. If you are ready…' ); ?></p> <p class="step"><a href="<?php echo $step_1; ?>" class="button button-large"><?php _e( 'Let’s go!' ); ?></a></p> <?php break; case 1: load_default_textdomain( $language ); $GLOBALS['wp_locale'] = new WP_Locale(); setup_config_display_header(); $autofocus = wp_is_mobile() ? '' : ' autofocus'; ?> <h1 class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Set up your database connection' ); ?> </h1> <form method="post" action="setup-config.php?step=2"> <p><?php _e( 'Below you should enter your database connection details. If you are not sure about these, contact your host.' ); ?></p> <table class="form-table" role="presentation"> <tr> <th scope="row"><label for="dbname"><?php _e( 'Database Name' ); ?></label></th> <td><input name="dbname" id="dbname" type="text" aria-describedby="dbname-desc" size="25" placeholder="wordpress"<?php echo $autofocus; ?> /> <p id="dbname-desc"><?php _e( 'The name of the database you want to use with WordPress.' ); ?></p></td> </tr> <tr> <th scope="row"><label for="uname"><?php _e( 'Username' ); ?></label></th> <td><input name="uname" id="uname" type="text" aria-describedby="uname-desc" size="25" placeholder="<?php echo htmlspecialchars( _x( 'username', 'example username' ), ENT_QUOTES ); ?>" /> <p id="uname-desc"><?php _e( 'Your database username.' ); ?></p></td> </tr> <tr> <th scope="row"><label for="pwd"><?php _e( 'Password' ); ?></label></th> <td> <div class="wp-pwd"> <input name="pwd" id="pwd" type="password" class="regular-text" data-reveal="1" aria-describedby="pwd-desc" size="25" placeholder="<?php echo htmlspecialchars( _x( 'password', 'example password' ), ENT_QUOTES ); ?>" autocomplete="off" spellcheck="false" /> <button type="button" class="button pwd-toggle hide-if-no-js" data-toggle="0" data-start-masked="1" aria-label="<?php esc_attr_e( 'Show password' ); ?>"> <span class="dashicons dashicons-visibility"></span> <span class="text"><?php _e( 'Show' ); ?></span> </button> </div> <p id="pwd-desc"><?php _e( 'Your database password.' ); ?></p> </td> </tr> <tr> <th scope="row"><label for="dbhost"><?php _e( 'Database Host' ); ?></label></th> <td><input name="dbhost" id="dbhost" type="text" aria-describedby="dbhost-desc" size="25" value="localhost" /> <p id="dbhost-desc"> <?php /* translators: %s: localhost */ printf( __( 'You should be able to get this info from your web host, if %s does not work.' ), '<code>localhost</code>' ); ?> </p></td> </tr> <tr> <th scope="row"><label for="prefix"><?php _e( 'Table Prefix' ); ?></label></th> <td><input name="prefix" id="prefix" type="text" aria-describedby="prefix-desc" value="wp_" size="25" /> <p id="prefix-desc"><?php _e( 'If you want to run multiple WordPress installations in a single database, change this.' ); ?></p></td> </tr> </table> <?php if ( isset( $_GET['noapi'] ) ) { ?> <input name="noapi" type="hidden" value="1" /><?php } ?> <input type="hidden" name="language" value="<?php echo esc_attr( $language ); ?>" /> <p class="step"><input name="submit" type="submit" value="<?php echo htmlspecialchars( __( 'Submit' ), ENT_QUOTES ); ?>" class="button button-large" /></p> </form> <?php wp_print_scripts( 'password-toggle' ); break; case 2: load_default_textdomain( $language ); $GLOBALS['wp_locale'] = new WP_Locale(); $dbname = trim( wp_unslash( $_POST['dbname'] ) ); $uname = trim( wp_unslash( $_POST['uname'] ) ); $pwd = trim( wp_unslash( $_POST['pwd'] ) ); $dbhost = trim( wp_unslash( $_POST['dbhost'] ) ); $prefix = trim( wp_unslash( $_POST['prefix'] ) ); $step_1 = 'setup-config.php?step=1'; $install = 'install.php'; if ( isset( $_REQUEST['noapi'] ) ) { $step_1 .= '&noapi'; } if ( ! empty( $language ) ) { $step_1 .= '&language=' . $language; $install .= '?language=' . $language; } else { $install .= '?language=en_US'; } $tryagain_link = '</p><p class="step"><a href="' . $step_1 . '" onclick="javascript:history.go(-1);return false;" class="button button-large">' . __( 'Try Again' ) . '</a>'; if ( empty( $prefix ) ) { wp_die( __( '<strong>Error:</strong> "Table Prefix" must not be empty.' ) . $tryagain_link ); } // Validate $prefix: it can only contain letters, numbers and underscores. if ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) { wp_die( __( '<strong>Error:</strong> "Table Prefix" can only contain numbers, letters, and underscores.' ) . $tryagain_link ); } // Test the DB connection. /**#@+ * * @ignore */ define( 'DB_NAME', $dbname ); define( 'DB_USER', $uname ); define( 'DB_PASSWORD', $pwd ); define( 'DB_HOST', $dbhost ); /**#@-*/ // Re-construct $wpdb with these new values. unset( $wpdb ); require_wp_db(); /* * The wpdb constructor bails when WP_SETUP_CONFIG is set, so we must * fire this manually. We'll fail here if the values are no good. */ $wpdb->db_connect(); if ( ! empty( $wpdb->error ) ) { wp_die( $wpdb->error->get_error_message() . $tryagain_link ); } $errors = $wpdb->suppress_errors(); $wpdb->query( "SELECT $prefix" ); $wpdb->suppress_errors( $errors ); if ( ! $wpdb->last_error ) { // MySQL was able to parse the prefix as a value, which we don't want. Bail. wp_die( __( '<strong>Error:</strong> "Table Prefix" is invalid.' ) ); } // Generate keys and salts using secure CSPRNG; fallback to API if enabled; further fallback to original wp_generate_password(). try { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_ []{}<>~`+=,.;:/?|'; $max = strlen( $chars ) - 1; for ( $i = 0; $i < 8; $i++ ) { $key = ''; for ( $j = 0; $j < 64; $j++ ) { $key .= substr( $chars, random_int( 0, $max ), 1 ); } $secret_keys[] = $key; } } catch ( Exception $ex ) { $no_api = isset( $_POST['noapi'] ); if ( ! $no_api ) { $secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); } if ( $no_api || is_wp_error( $secret_keys ) ) { $secret_keys = array(); for ( $i = 0; $i < 8; $i++ ) { $secret_keys[] = wp_generate_password( 64, true, true ); } } else { $secret_keys = explode( "\n", wp_remote_retrieve_body( $secret_keys ) ); foreach ( $secret_keys as $k => $v ) { $secret_keys[ $k ] = substr( $v, 28, 64 ); } } } $key = 0; foreach ( $config_file as $line_num => $line ) { if ( str_starts_with( $line, '$table_prefix =' ) ) { $config_file[ $line_num ] = '$table_prefix = \'' . addcslashes( $prefix, "\\'" ) . "';\r\n"; continue; } if ( ! preg_match( '/^define\(\s*\'([A-Z_]+)\',([ ]+)/', $line, $match ) ) { continue; } $constant = $match[1]; $padding = $match[2]; switch ( $constant ) { case 'DB_NAME': case 'DB_USER': case 'DB_PASSWORD': case 'DB_HOST': $config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "' );\r\n"; break; case 'DB_CHARSET': if ( 'utf8mb4' === $wpdb->charset || ( ! $wpdb->charset ) ) { $config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'utf8mb4' );\r\n"; } break; case 'AUTH_KEY': case 'SECURE_AUTH_KEY': case 'LOGGED_IN_KEY': case 'NONCE_KEY': case 'AUTH_SALT': case 'SECURE_AUTH_SALT': case 'LOGGED_IN_SALT': case 'NONCE_SALT': $config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'" . $secret_keys[ $key++ ] . "' );\r\n"; break; } } unset( $line ); if ( ! is_writable( ABSPATH ) ) : setup_config_display_header(); ?> <p> <?php /* translators: %s: wp-config.php */ printf( __( 'Unable to write to %s file.' ), '<code>wp-config.php</code>' ); ?> </p> <p id="wp-config-description"> <?php /* translators: %s: wp-config.php */ printf( __( 'You can create the %s file manually and paste the following text into it.' ), '<code>wp-config.php</code>' ); $config_text = ''; foreach ( $config_file as $line ) { $config_text .= htmlentities( $line, ENT_COMPAT, 'UTF-8' ); } ?> </p> <p class="configuration-rules-label"><label for="wp-config"> <?php /* translators: %s: wp-config.php */ printf( __( 'Configuration rules for %s:' ), '<code>wp-config.php</code>' ); ?> </label></p> <textarea id="wp-config" cols="98" rows="15" class="code" readonly="readonly" aria-describedby="wp-config-description"><?php echo $config_text; ?></textarea> <p><?php _e( 'After you’ve done that, click “Run the installation”.' ); ?></p> <p class="step"><a href="<?php echo $install; ?>" class="button button-large"><?php _e( 'Run the installation' ); ?></a></p> <script> (function(){ if ( ! /iPad|iPod|iPhone/.test( navigator.userAgent ) ) { var el = document.getElementById('wp-config'); el.focus(); el.select(); } })(); </script> <?php else : /* * If this file doesn't exist, then we are using the wp-config-sample.php * file one level up, which is for the develop repo. */ if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) { $path_to_wp_config = ABSPATH . 'wp-config.php'; } else { $path_to_wp_config = dirname( ABSPATH ) . '/wp-config.php'; } $error_message = ''; $handle = fopen( $path_to_wp_config, 'w' ); /* * Why check for the absence of false instead of checking for resource with is_resource()? * To future-proof the check for when fopen returns object instead of resource, i.e. a known * change coming in PHP. */ if ( false !== $handle ) { foreach ( $config_file as $line ) { fwrite( $handle, $line ); } fclose( $handle ); } else { $wp_config_perms = fileperms( $path_to_wp_config ); if ( ! empty( $wp_config_perms ) && ! is_writable( $path_to_wp_config ) ) { $error_message = sprintf( /* translators: 1: wp-config.php, 2: Documentation URL. */ __( 'You need to make the file %1$s writable before you can save your changes. See <a href="%2$s">Changing File Permissions</a> for more information.' ), '<code>wp-config.php</code>', __( 'https://developer.wordpress.org/advanced-administration/server/file-permissions/' ) ); } else { $error_message = sprintf( /* translators: %s: wp-config.php */ __( 'Unable to write to %s file.' ), '<code>wp-config.php</code>' ); } } chmod( $path_to_wp_config, 0666 ); setup_config_display_header(); if ( false !== $handle ) : ?> <h1 class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Successful database connection' ); ?> </h1> <p><?php _e( 'All right, sparky! You’ve made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to…' ); ?></p> <p class="step"><a href="<?php echo $install; ?>" class="button button-large"><?php _e( 'Run the installation' ); ?></a></p> <?php else : printf( '<p>%s</p>', $error_message ); endif; endif; break; } // End of the steps switch. ?> <?php wp_print_scripts( 'language-chooser' ); ?> </body> </html> PK w �Z��\ \ press-this.phpnu ��� <?php /** * Press This Display and Handler. * * @package WordPress * @subpackage Press_This */ define( 'IFRAME_REQUEST', true ); /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; function wp_load_press_this() { $plugin_slug = 'press-this'; $plugin_file = 'press-this/press-this-plugin.php'; if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) { wp_die( __( 'Sorry, you are not allowed to create posts as this user.' ), __( 'You need a higher level of permission.' ), 403 ); } elseif ( is_plugin_active( $plugin_file ) ) { include WP_PLUGIN_DIR . '/press-this/class-wp-press-this-plugin.php'; $wp_press_this = new WP_Press_This_Plugin(); $wp_press_this->html(); } elseif ( current_user_can( 'activate_plugins' ) ) { if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_file ) ) { $url = wp_nonce_url( add_query_arg( array( 'action' => 'activate', 'plugin' => $plugin_file, 'from' => 'press-this', ), admin_url( 'plugins.php' ) ), 'activate-plugin_' . $plugin_file ); $action = sprintf( '<a href="%1$s" aria-label="%2$s">%2$s</a>', esc_url( $url ), __( 'Activate Press This' ) ); } else { if ( is_main_site() ) { $url = wp_nonce_url( add_query_arg( array( 'action' => 'install-plugin', 'plugin' => $plugin_slug, 'from' => 'press-this', ), self_admin_url( 'update.php' ) ), 'install-plugin_' . $plugin_slug ); $action = sprintf( '<a href="%1$s" class="install-now" data-slug="%2$s" data-name="%2$s" aria-label="%3$s">%3$s</a>', esc_url( $url ), esc_attr( $plugin_slug ), _x( 'Install Now', 'plugin' ) ); } else { $action = sprintf( /* translators: %s: URL to Press This bookmarklet on the main site. */ __( 'Press This is not installed. Please install Press This from <a href="%s">the main site</a>.' ), get_admin_url( get_current_network_id(), 'press-this.php' ) ); } } wp_die( __( 'The Press This plugin is required.' ) . '<br />' . $action, __( 'Installation Required' ), 200 ); } else { wp_die( __( 'Press This is not available. Please contact your site administrator.' ), __( 'Installation Required' ), 200 ); } } wp_load_press_this(); PK w �Z���� link-manager.phpnu ��� <?php /** * Link Management Administration Screen. * * @package WordPress * @subpackage Administration */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'manage_links' ) ) { wp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) ); } $wp_list_table = _get_list_table( 'WP_Links_List_Table' ); // Handle bulk deletes. $doaction = $wp_list_table->current_action(); if ( $doaction && isset( $_REQUEST['linkcheck'] ) ) { check_admin_referer( 'bulk-bookmarks' ); $redirect_to = admin_url( 'link-manager.php' ); $bulklinks = (array) $_REQUEST['linkcheck']; if ( 'delete' === $doaction ) { foreach ( $bulklinks as $link_id ) { $link_id = (int) $link_id; wp_delete_link( $link_id ); } $redirect_to = add_query_arg( 'deleted', count( $bulklinks ), $redirect_to ); } else { $screen = get_current_screen()->id; /** This action is documented in wp-admin/edit.php */ $redirect_to = apply_filters( "handle_bulk_actions-{$screen}", $redirect_to, $doaction, $bulklinks ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores } wp_redirect( $redirect_to ); exit; } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) { wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ); exit; } $wp_list_table->prepare_items(); // Used in the HTML title tag. $title = __( 'Links' ); $this_file = 'link-manager.php'; $parent_file = $this_file; get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . sprintf( /* translators: %s: URL to Widgets screen. */ __( 'You can add links here to be displayed on your site, usually using <a href="%s">Widgets</a>. By default, links to several sites in the WordPress community are included as examples.' ), 'widgets.php' ) . '</p>' . '<p>' . __( 'Links may be separated into Link Categories; these are different than the categories used on your posts.' ) . '</p>' . '<p>' . __( 'You can customize the display of this screen using the Screen Options tab and/or the dropdown filters above the links table.' ) . '</p>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'deleting-links', 'title' => __( 'Deleting Links' ), 'content' => '<p>' . __( 'If you delete a link, it will be removed permanently, as Links do not have a Trash function yet.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://codex.wordpress.org/Links_Screen">Documentation on Managing Links</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); get_current_screen()->set_screen_reader_content( array( 'heading_list' => __( 'Links list' ), ) ); require_once ABSPATH . 'wp-admin/admin-header.php'; if ( ! current_user_can( 'manage_links' ) ) { wp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) ); } ?> <div class="wrap nosubsub"> <h1 class="wp-heading-inline"> <?php echo esc_html( $title ); ?> </h1> <a href="link-add.php" class="page-title-action"><?php echo esc_html__( 'Add Link' ); ?></a> <?php if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { echo '<span class="subtitle">'; printf( /* translators: %s: Search query. */ __( 'Search results for: %s' ), '<strong>' . esc_html( wp_unslash( $_REQUEST['s'] ) ) . '</strong>' ); echo '</span>'; } ?> <hr class="wp-header-end"> <?php if ( isset( $_REQUEST['deleted'] ) ) { $deleted = (int) $_REQUEST['deleted']; /* translators: %s: Number of links. */ $deleted_message = sprintf( _n( '%s link deleted.', '%s links deleted.', $deleted ), $deleted ); wp_admin_notice( $deleted_message, array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'deleted' ), $_SERVER['REQUEST_URI'] ); } ?> <form id="posts-filter" method="get"> <?php $wp_list_table->search_box( __( 'Search Links' ), 'link' ); ?> <?php $wp_list_table->display(); ?> <div id="ajax-response"></div> </form> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; PK w �Z�v0)V V import.phpnu ��� <?php /** * Import WordPress Administration Screen * * @package WordPress * @subpackage Administration */ define( 'WP_LOAD_IMPORTERS', true ); /** Load WordPress Bootstrap */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'import' ) ) { wp_die( __( 'Sorry, you are not allowed to import content into this site.' ) ); } // Used in the HTML title tag. $title = __( 'Import' ); get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'This screen lists links to plugins to import data from blogging/content management platforms. Choose the platform you want to import from, and click Install Now when you are prompted in the popup window. If your platform is not listed, click the link to search the plugin directory for other importer plugins to see if there is one for your platform.' ) . '</p>' . '<p>' . __( 'In previous versions of WordPress, all importers were built-in. They have been turned into plugins since most people only use them once or infrequently.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/tools-import-screen/">Documentation on Import</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); if ( current_user_can( 'install_plugins' ) ) { // List of popular importer plugins from the WordPress.org API. $popular_importers = wp_get_popular_importers(); } else { $popular_importers = array(); } // Detect and redirect invalid importers like 'movabletype', which is registered as 'mt'. if ( ! empty( $_GET['invalid'] ) && isset( $popular_importers[ $_GET['invalid'] ] ) ) { $importer_id = $popular_importers[ $_GET['invalid'] ]['importer-id']; if ( $importer_id !== $_GET['invalid'] ) { // Prevent redirect loops. wp_redirect( admin_url( 'admin.php?import=' . $importer_id ) ); exit; } unset( $importer_id ); } add_thickbox(); wp_enqueue_script( 'plugin-install' ); wp_enqueue_script( 'updates' ); require_once ABSPATH . 'wp-admin/admin-header.php'; $parent_file = 'tools.php'; ?> <div class="wrap"> <h1><?php echo esc_html( $title ); ?></h1> <?php if ( ! empty( $_GET['invalid'] ) ) : $importer_not_installed = '<strong>' . __( 'Error:' ) . '</strong> ' . sprintf( /* translators: %s: Importer slug. */ __( 'The %s importer is invalid or is not installed.' ), '<strong>' . esc_html( $_GET['invalid'] ) . '</strong>' ); wp_admin_notice( $importer_not_installed, array( 'additional_classes' => array( 'error' ), ) ); endif; ?> <p><?php _e( 'If you have posts or comments in another system, WordPress can import those into this site. To get started, choose a system to import from below:' ); ?></p> <?php // Registered (already installed) importers. They're stored in the global $wp_importers. $importers = get_importers(); // If a popular importer is not registered, create a dummy registration that links to the plugin installer. foreach ( $popular_importers as $pop_importer => $pop_data ) { if ( isset( $importers[ $pop_importer ] ) ) { continue; } if ( isset( $importers[ $pop_data['importer-id'] ] ) ) { continue; } // Fill the array of registered (already installed) importers with data of the popular importers from the WordPress.org API. $importers[ $pop_data['importer-id'] ] = array( $pop_data['name'], $pop_data['description'], 'install' => $pop_data['plugin-slug'], ); } if ( empty( $importers ) ) { echo '<p>' . __( 'No importers are available.' ) . '</p>'; // TODO: Make more helpful. } else { uasort( $importers, '_usort_by_first_member' ); ?> <table class="widefat importers striped"> <?php foreach ( $importers as $importer_id => $data ) { $plugin_slug = ''; $action = ''; $is_plugin_installed = false; if ( isset( $data['install'] ) ) { $plugin_slug = $data['install']; if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_slug ) ) { // Looks like an importer is installed, but not active. $plugins = get_plugins( '/' . $plugin_slug ); if ( ! empty( $plugins ) ) { $keys = array_keys( $plugins ); $plugin_file = $plugin_slug . '/' . $keys[0]; $url = wp_nonce_url( add_query_arg( array( 'action' => 'activate', 'plugin' => $plugin_file, 'from' => 'import', ), admin_url( 'plugins.php' ) ), 'activate-plugin_' . $plugin_file ); $action = sprintf( '<a href="%s" aria-label="%s">%s</a>', esc_url( $url ), /* translators: %s: Importer name. */ esc_attr( sprintf( __( 'Run %s' ), $data[0] ) ), __( 'Run Importer' ) ); $is_plugin_installed = true; } } if ( empty( $action ) ) { if ( is_main_site() ) { $url = wp_nonce_url( add_query_arg( array( 'action' => 'install-plugin', 'plugin' => $plugin_slug, 'from' => 'import', ), self_admin_url( 'update.php' ) ), 'install-plugin_' . $plugin_slug ); $action = sprintf( '<a href="%1$s" class="install-now" data-slug="%2$s" data-name="%3$s" aria-label="%4$s">%5$s</a>', esc_url( $url ), esc_attr( $plugin_slug ), esc_attr( $data[0] ), /* translators: %s: Importer name. */ esc_attr( sprintf( _x( 'Install %s now', 'plugin' ), $data[0] ) ), _x( 'Install Now', 'plugin' ) ); } else { $action = sprintf( /* translators: %s: URL to Import screen on the main site. */ __( 'This importer is not installed. Please install importers from <a href="%s">the main site</a>.' ), get_admin_url( get_current_network_id(), 'import.php' ) ); } } } else { $url = add_query_arg( array( 'import' => $importer_id, ), self_admin_url( 'admin.php' ) ); $action = sprintf( '<a href="%1$s" aria-label="%2$s">%3$s</a>', esc_url( $url ), /* translators: %s: Importer name. */ esc_attr( sprintf( __( 'Run %s' ), $data[0] ) ), __( 'Run Importer' ) ); $is_plugin_installed = true; } if ( ! $is_plugin_installed && is_main_site() ) { $url = add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => $plugin_slug, 'from' => 'import', 'TB_iframe' => 'true', 'width' => 600, 'height' => 550, ), network_admin_url( 'plugin-install.php' ) ); $action .= sprintf( ' | <a href="%1$s" class="thickbox open-plugin-details-modal" aria-label="%2$s">%3$s</a>', esc_url( $url ), /* translators: %s: Importer name. */ esc_attr( sprintf( __( 'More information about %s' ), $data[0] ) ), __( 'Details' ) ); } echo " <tr class='importer-item'> <td class='import-system'> <span class='importer-title'>{$data[0]}</span> <span class='importer-action'>{$action}</span> </td> <td class='desc'> <span class='importer-desc'>{$data[1]}</span> </td> </tr>"; } ?> </table> <?php } if ( current_user_can( 'install_plugins' ) ) { echo '<p>' . sprintf( /* translators: %s: URL to Add Plugins screen. */ __( 'If the importer you need is not listed, <a href="%s">search the plugin directory</a> to see if an importer is available.' ), esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '</p>'; } /** * Fires at the end of the Import screen. * * @since 6.8.0 */ do_action( 'import_filters' ); ?> </div> <?php wp_print_request_filesystem_credentials_modal(); wp_print_admin_notice_templates(); require_once ABSPATH . 'wp-admin/admin-footer.php'; PK w �Z��r�_; _; upload.phpnu ��� <?php /** * Media Library administration panel. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'upload_files' ) ) { wp_die( __( 'Sorry, you are not allowed to upload files.' ) ); } $message = ''; if ( ! empty( $_GET['posted'] ) ) { $message = __( 'Media file updated.' ); $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'posted' ), $_SERVER['REQUEST_URI'] ); unset( $_GET['posted'] ); } if ( ! empty( $_GET['attached'] ) && absint( $_GET['attached'] ) ) { $attached = absint( $_GET['attached'] ); if ( 1 === $attached ) { $message = __( 'Media file attached.' ); } else { $message = sprintf( /* translators: %s: Number of media files. */ _n( '%s media file attached.', '%s media files attached.', $attached ), number_format_i18n( $attached ) ); } $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'detach', 'attached' ), $_SERVER['REQUEST_URI'] ); unset( $_GET['detach'], $_GET['attached'] ); } if ( ! empty( $_GET['detach'] ) && absint( $_GET['detach'] ) ) { $detached = absint( $_GET['detach'] ); if ( 1 === $detached ) { $message = __( 'Media file detached.' ); } else { $message = sprintf( /* translators: %s: Number of media files. */ _n( '%s media file detached.', '%s media files detached.', $detached ), number_format_i18n( $detached ) ); } $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'detach', 'attached' ), $_SERVER['REQUEST_URI'] ); unset( $_GET['detach'], $_GET['attached'] ); } if ( ! empty( $_GET['deleted'] ) && absint( $_GET['deleted'] ) ) { $deleted = absint( $_GET['deleted'] ); if ( 1 === $deleted ) { $message = __( 'Media file permanently deleted.' ); } else { $message = sprintf( /* translators: %s: Number of media files. */ _n( '%s media file permanently deleted.', '%s media files permanently deleted.', $deleted ), number_format_i18n( $deleted ) ); } $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'deleted' ), $_SERVER['REQUEST_URI'] ); unset( $_GET['deleted'] ); } if ( ! empty( $_GET['trashed'] ) && absint( $_GET['trashed'] ) ) { $trashed = absint( $_GET['trashed'] ); if ( 1 === $trashed ) { $message = __( 'Media file moved to the Trash.' ); } else { $message = sprintf( /* translators: %s: Number of media files. */ _n( '%s media file moved to the Trash.', '%s media files moved to the Trash.', $trashed ), number_format_i18n( $trashed ) ); } $message .= sprintf( ' <a href="%1$s">%2$s</a>', esc_url( wp_nonce_url( 'upload.php?doaction=undo&action=untrash&ids=' . ( isset( $_GET['ids'] ) ? $_GET['ids'] : '' ), 'bulk-media' ) ), __( 'Undo' ) ); $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'trashed' ), $_SERVER['REQUEST_URI'] ); unset( $_GET['trashed'] ); } if ( ! empty( $_GET['untrashed'] ) && absint( $_GET['untrashed'] ) ) { $untrashed = absint( $_GET['untrashed'] ); if ( 1 === $untrashed ) { $message = __( 'Media file restored from the Trash.' ); } else { $message = sprintf( /* translators: %s: Number of media files. */ _n( '%s media file restored from the Trash.', '%s media files restored from the Trash.', $untrashed ), number_format_i18n( $untrashed ) ); } $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'untrashed' ), $_SERVER['REQUEST_URI'] ); unset( $_GET['untrashed'] ); } $messages[1] = __( 'Media file updated.' ); $messages[2] = __( 'Media file permanently deleted.' ); $messages[3] = __( 'Error saving media file.' ); $messages[4] = __( 'Media file moved to the Trash.' ) . sprintf( ' <a href="%1$s">%2$s</a>', esc_url( wp_nonce_url( 'upload.php?doaction=undo&action=untrash&ids=' . ( isset( $_GET['ids'] ) ? $_GET['ids'] : '' ), 'bulk-media' ) ), __( 'Undo' ) ); $messages[5] = __( 'Media file restored from the Trash.' ); if ( ! empty( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) { $message = $messages[ $_GET['message'] ]; $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'message' ), $_SERVER['REQUEST_URI'] ); } $modes = array( 'grid', 'list' ); if ( isset( $_GET['mode'] ) && in_array( $_GET['mode'], $modes, true ) ) { $mode = $_GET['mode']; update_user_option( get_current_user_id(), 'media_library_mode', $mode ); } else { $mode = get_user_option( 'media_library_mode', get_current_user_id() ) ? get_user_option( 'media_library_mode', get_current_user_id() ) : 'grid'; } if ( 'grid' === $mode ) { wp_enqueue_media(); wp_enqueue_script( 'media-grid' ); wp_enqueue_script( 'media' ); // Remove the error parameter added by deprecation of wp-admin/media.php. add_filter( 'removable_query_args', function () { return array( 'error' ); }, 10, 0 ); $q = $_GET; // Let JS handle this. unset( $q['s'] ); $vars = wp_edit_attachments_query_vars( $q ); $ignore = array( 'mode', 'post_type', 'post_status', 'posts_per_page' ); foreach ( $vars as $key => $value ) { if ( ! $value || in_array( $key, $ignore, true ) ) { unset( $vars[ $key ] ); } } wp_localize_script( 'media-grid', '_wpMediaGridSettings', array( 'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ), 'queryVars' => (object) $vars, ) ); get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'All the files you’ve uploaded are listed in the Media Library, with the most recent uploads listed first.' ) . '</p>' . '<p>' . __( 'You can view your media in a simple visual grid or a list with columns. Switch between these views using the icons to the left above the media.' ) . '</p>' . '<p>' . __( 'To delete media items, click the Bulk Select button at the top of the screen. Select any items you wish to delete, then click the Delete Selected button. Clicking the Cancel Selection button takes you back to viewing your media.' ) . '</p>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'attachment-details', 'title' => __( 'Attachment Details' ), 'content' => '<p>' . __( 'Clicking an item will display an Attachment Details dialog, which allows you to preview media and make quick edits. Any changes you make to the attachment details will be automatically saved.' ) . '</p>' . '<p>' . __( 'Use the arrow buttons at the top of the dialog, or the left and right arrow keys on your keyboard, to navigate between media items quickly.' ) . '</p>' . '<p>' . __( 'You can also delete individual items and access the extended edit screen from the details dialog.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/media-library-screen/">Documentation on Media Library</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); // Used in the HTML title tag. $title = __( 'Media Library' ); $parent_file = 'upload.php'; require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap" id="wp-media-grid" data-search="<?php _admin_search_query(); ?>"> <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1> <?php if ( current_user_can( 'upload_files' ) ) { ?> <a href="<?php echo esc_url( admin_url( 'media-new.php' ) ); ?>" class="page-title-action aria-button-if-js"><?php echo esc_html__( 'Add Media File' ); ?></a> <?php } ?> <hr class="wp-header-end"> <?php if ( ! empty( $message ) ) { wp_admin_notice( $message, array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } $js_required_message = sprintf( /* translators: %s: List view URL. */ __( 'The grid view for the Media Library requires JavaScript. <a href="%s">Switch to the list view</a>.' ), 'upload.php?mode=list' ); wp_admin_notice( $js_required_message, array( 'additional_classes' => array( 'error', 'hide-if-js' ), ) ); ?> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; exit; } $wp_list_table = _get_list_table( 'WP_Media_List_Table' ); $pagenum = $wp_list_table->get_pagenum(); // Handle bulk actions. $doaction = $wp_list_table->current_action(); if ( $doaction ) { check_admin_referer( 'bulk-media' ); $post_ids = array(); if ( 'delete_all' === $doaction ) { $post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type='attachment' AND post_status = 'trash'" ); $doaction = 'delete'; } elseif ( isset( $_REQUEST['media'] ) ) { $post_ids = $_REQUEST['media']; } elseif ( isset( $_REQUEST['ids'] ) ) { $post_ids = explode( ',', $_REQUEST['ids'] ); } $post_ids = array_map( 'intval', (array) $post_ids ); $location = 'upload.php'; $referer = wp_get_referer(); if ( $referer ) { if ( str_contains( $referer, 'upload.php' ) ) { $location = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'message', 'ids', 'posted' ), $referer ); } } switch ( $doaction ) { case 'detach': wp_media_attach_action( $_REQUEST['parent_post_id'], 'detach' ); break; case 'attach': wp_media_attach_action( $_REQUEST['found_post_id'] ); break; case 'trash': if ( empty( $post_ids ) ) { break; } foreach ( $post_ids as $post_id ) { if ( ! current_user_can( 'delete_post', $post_id ) ) { wp_die( __( 'Sorry, you are not allowed to move this item to the Trash.' ) ); } if ( ! wp_trash_post( $post_id ) ) { wp_die( __( 'Error in moving the item to Trash.' ) ); } } $location = add_query_arg( array( 'trashed' => count( $post_ids ), 'ids' => implode( ',', $post_ids ), ), $location ); break; case 'untrash': if ( empty( $post_ids ) ) { break; } foreach ( $post_ids as $post_id ) { if ( ! current_user_can( 'delete_post', $post_id ) ) { wp_die( __( 'Sorry, you are not allowed to restore this item from the Trash.' ) ); } if ( ! wp_untrash_post( $post_id ) ) { wp_die( __( 'Error in restoring the item from Trash.' ) ); } } $location = add_query_arg( 'untrashed', count( $post_ids ), $location ); break; case 'delete': if ( empty( $post_ids ) ) { break; } foreach ( $post_ids as $post_id_del ) { if ( ! current_user_can( 'delete_post', $post_id_del ) ) { wp_die( __( 'Sorry, you are not allowed to delete this item.' ) ); } if ( ! wp_delete_attachment( $post_id_del ) ) { wp_die( __( 'Error in deleting the attachment.' ) ); } } $location = add_query_arg( 'deleted', count( $post_ids ), $location ); break; default: $screen = get_current_screen()->id; /** This action is documented in wp-admin/edit.php */ $location = apply_filters( "handle_bulk_actions-{$screen}", $location, $doaction, $post_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores } wp_redirect( $location ); exit; } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) { wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ); exit; } $wp_list_table->prepare_items(); // Used in the HTML title tag. $title = __( 'Media Library' ); $parent_file = 'upload.php'; wp_enqueue_script( 'media' ); add_screen_option( 'per_page' ); get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'All the files you’ve uploaded are listed in the Media Library, with the most recent uploads listed first. You can use the Screen Options tab to customize the display of this screen.' ) . '</p>' . '<p>' . __( 'You can narrow the list by file type/status or by date using the dropdown menus above the media table.' ) . '</p>' . '<p>' . __( 'You can view your media in a simple visual grid or a list with columns. Switch between these views using the icons to the left above the media.' ) . '</p>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'actions-links', 'title' => __( 'Available Actions' ), 'content' => '<p>' . __( 'Hovering over a row reveals action links that allow you to manage media items. You can perform the following actions:' ) . '</p>' . '<ul>' . '<li>' . __( '<strong>Edit</strong> takes you to a simple screen to edit that individual file’s metadata. You can also reach that screen by clicking on the media file name or thumbnail.' ) . '</li>' . '<li>' . __( '<strong>Delete Permanently</strong> will delete the file from the media library (as well as from any posts to which it is currently attached).' ) . '</li>' . '<li>' . __( '<strong>View</strong> will take you to a public display page for that file.' ) . '</li>' . '<li>' . __( '<strong>Copy URL</strong> copies the URL for the media file to your clipboard.' ) . '</li>' . '<li>' . __( '<strong>Download file</strong> downloads the original media file to your device.' ) . '</li>' . '</ul>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'attaching-files', 'title' => __( 'Attaching Files' ), 'content' => '<p>' . __( 'If a media file has not been attached to any content, you will see that in the Uploaded To column, and can click on Attach to launch a small popup that will allow you to search for existing content and attach the file.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/media-library-screen/">Documentation on Media Library</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); get_current_screen()->set_screen_reader_content( array( 'heading_views' => __( 'Filter media items list' ), 'heading_pagination' => __( 'Media items list navigation' ), 'heading_list' => __( 'Media items list' ), ) ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1> <?php if ( current_user_can( 'upload_files' ) ) { ?> <a href="<?php echo esc_url( admin_url( 'media-new.php' ) ); ?>" class="page-title-action"><?php echo esc_html__( 'Add Media File' ); ?></a> <?php } if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { echo '<span class="subtitle">'; printf( /* translators: %s: Search query. */ __( 'Search results for: %s' ), '<strong>' . get_search_query() . '</strong>' ); echo '</span>'; } ?> <hr class="wp-header-end"> <?php if ( ! empty( $message ) ) { wp_admin_notice( $message, array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } ?> <form id="posts-filter" method="get"> <?php $wp_list_table->views(); ?> <?php $wp_list_table->display(); ?> <div id="ajax-response"></div> <?php find_posts_div(); ?> </form> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; PK w �Zz~!x$ x$ admin-header.phpnu ��� <?php /** * WordPress Administration Template Header * * @package WordPress * @subpackage Administration */ // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); if ( ! defined( 'WP_ADMIN' ) ) { require_once __DIR__ . '/admin.php'; } /** * In case admin-header.php is included in a function. * * @global string $title The title of the current screen. * @global string $hook_suffix * @global WP_Screen $current_screen WordPress current screen object. * @global WP_Locale $wp_locale WordPress date and time locale object. * @global string $pagenow The filename of the current screen. * @global string $update_title * @global int $total_update_count * @global string $parent_file * @global string $typenow The post type of the current screen. */ global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $update_title, $total_update_count, $parent_file, $typenow; // Catch plugins that include admin-header.php before admin.php completes. if ( empty( $current_screen ) ) { set_current_screen(); } get_admin_page_title(); $title = strip_tags( $title ); if ( is_network_admin() ) { /* translators: Network admin screen title. %s: Network title. */ $admin_title = sprintf( __( 'Network Admin: %s' ), get_network()->site_name ); } elseif ( is_user_admin() ) { /* translators: User dashboard screen title. %s: Network title. */ $admin_title = sprintf( __( 'User Dashboard: %s' ), get_network()->site_name ); } else { $admin_title = get_bloginfo( 'name' ); } if ( $admin_title === $title ) { /* translators: Admin screen title. %s: Admin screen name. */ $admin_title = sprintf( __( '%s — WordPress' ), $title ); } else { $screen_title = $title; if ( 'post' === $current_screen->base && 'add' !== $current_screen->action ) { $post_title = get_the_title(); if ( ! empty( $post_title ) ) { $post_type_obj = get_post_type_object( $typenow ); $screen_title = sprintf( /* translators: Editor admin screen title. 1: "Edit item" text for the post type, 2: Post title. */ __( '%1$s “%2$s”' ), $post_type_obj->labels->edit_item, $post_title ); } } /* translators: Admin screen title. 1: Admin screen name, 2: Network or site name. */ $admin_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $screen_title, $admin_title ); } if ( wp_is_recovery_mode() ) { /* translators: %s: Admin screen title. */ $admin_title = sprintf( __( 'Recovery Mode — %s' ), $admin_title ); } /** * Filters the title tag content for an admin page. * * @since 3.1.0 * * @param string $admin_title The page title, with extra context added. * @param string $title The original page title. */ $admin_title = apply_filters( 'admin_title', $admin_title, $title ); wp_user_settings(); _wp_admin_html_begin(); ?> <title><?php echo esc_html( $admin_title ); ?></title> <?php wp_enqueue_style( 'colors' ); wp_enqueue_script( 'utils' ); wp_enqueue_script( 'svg-painter' ); $admin_body_class = preg_replace( '/[^a-z0-9_-]+/i', '-', $hook_suffix ); ?> <script type="text/javascript"> addLoadEvent = function(func){if(typeof jQuery!=='undefined')jQuery(function(){func();});else if(typeof wpOnload!=='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>', pagenow = '<?php echo esc_js( $current_screen->id ); ?>', typenow = '<?php echo esc_js( $current_screen->post_type ); ?>', adminpage = '<?php echo esc_js( $admin_body_class ); ?>', thousandsSeparator = '<?php echo esc_js( $wp_locale->number_format['thousands_sep'] ); ?>', decimalPoint = '<?php echo esc_js( $wp_locale->number_format['decimal_point'] ); ?>', isRtl = <?php echo (int) is_rtl(); ?>; </script> <?php /** * Fires when enqueuing scripts for all admin pages. * * @since 2.8.0 * * @param string $hook_suffix The current admin page. */ do_action( 'admin_enqueue_scripts', $hook_suffix ); /** * Fires when styles are printed for a specific admin page based on $hook_suffix. * * @since 2.6.0 */ do_action( "admin_print_styles-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores /** * Fires when styles are printed for all admin pages. * * @since 2.6.0 */ do_action( 'admin_print_styles' ); /** * Fires when scripts are printed for a specific admin page based on $hook_suffix. * * @since 2.1.0 */ do_action( "admin_print_scripts-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores /** * Fires when scripts are printed for all admin pages. * * @since 2.1.0 */ do_action( 'admin_print_scripts' ); /** * Fires in head section for a specific admin page. * * The dynamic portion of the hook name, `$hook_suffix`, refers to the hook suffix * for the admin page. * * @since 2.1.0 */ do_action( "admin_head-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores /** * Fires in head section for all admin pages. * * @since 2.1.0 */ do_action( 'admin_head' ); if ( 'f' === get_user_setting( 'mfold' ) ) { $admin_body_class .= ' folded'; } if ( ! get_user_setting( 'unfold' ) ) { $admin_body_class .= ' auto-fold'; } if ( is_admin_bar_showing() ) { $admin_body_class .= ' admin-bar'; } if ( is_rtl() ) { $admin_body_class .= ' rtl'; } if ( $current_screen->post_type ) { $admin_body_class .= ' post-type-' . $current_screen->post_type; } if ( $current_screen->taxonomy ) { $admin_body_class .= ' taxonomy-' . $current_screen->taxonomy; } $admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', (float) get_bloginfo( 'version' ) ); $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', get_bloginfo( 'version' ) ) ); $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' ); $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) ); if ( wp_is_mobile() ) { $admin_body_class .= ' mobile'; } if ( is_multisite() ) { $admin_body_class .= ' multisite'; } if ( is_network_admin() ) { $admin_body_class .= ' network-admin'; } $admin_body_class .= ' no-customize-support svg'; if ( $current_screen->is_block_editor() ) { $admin_body_class .= ' block-editor-page wp-embed-responsive'; } $admin_body_class .= ' wp-theme-' . sanitize_html_class( get_template() ); if ( is_child_theme() ) { $admin_body_class .= ' wp-child-theme-' . sanitize_html_class( get_stylesheet() ); } $error_get_last = error_get_last(); // Print a CSS class to make PHP errors visible. if ( $error_get_last && WP_DEBUG && WP_DEBUG_DISPLAY && ini_get( 'display_errors' ) // Don't print the class for PHP notices in wp-config.php, as they happen before WP_DEBUG takes effect, // and should not be displayed with the `error_reporting` level previously set in wp-load.php. && ( E_NOTICE !== $error_get_last['type'] || 'wp-config.php' !== wp_basename( $error_get_last['file'] ) ) ) { $admin_body_class .= ' php-error'; } unset( $error_get_last ); ?> </head> <?php /** * Filters the CSS classes for the body tag in the admin. * * This filter differs from the {@see 'post_class'} and {@see 'body_class'} filters * in two important ways: * * 1. `$classes` is a space-separated string of class names instead of an array. * 2. Not all core admin classes are filterable, notably: wp-admin, wp-core-ui, * and no-js cannot be removed. * * @since 2.3.0 * * @param string $classes Space-separated list of CSS classes. */ $admin_body_classes = apply_filters( 'admin_body_class', '' ); $admin_body_classes = ltrim( $admin_body_classes . ' ' . $admin_body_class ); ?> <body class="wp-admin wp-core-ui no-js <?php echo esc_attr( $admin_body_classes ); ?>"> <script type="text/javascript"> document.body.className = document.body.className.replace('no-js','js'); </script> <?php // Make sure the customize body classes are correct as early as possible. if ( current_user_can( 'customize' ) ) { wp_customize_support_script(); } ?> <div id="wpwrap"> <?php require ABSPATH . 'wp-admin/menu-header.php'; ?> <div id="wpcontent"> <?php /** * Fires at the beginning of the content section in an admin page. * * @since 3.0.0 */ do_action( 'in_admin_header' ); ?> <div id="wpbody" role="main"> <?php unset( $blog_name, $total_update_count, $update_title ); $current_screen->set_parentage( $parent_file ); ?> <div id="wpbody-content"> <?php $current_screen->render_screen_meta(); if ( is_network_admin() ) { /** * Prints network admin screen notices. * * @since 3.1.0 */ do_action( 'network_admin_notices' ); } elseif ( is_user_admin() ) { /** * Prints user admin screen notices. * * @since 3.1.0 */ do_action( 'user_admin_notices' ); } else { /** * Prints admin screen notices. * * @since 3.1.0 */ do_action( 'admin_notices' ); } /** * Prints generic admin screen notices. * * @since 3.1.0 */ do_action( 'all_admin_notices' ); if ( 'options-general.php' === $parent_file ) { require ABSPATH . 'wp-admin/options-head.php'; } PK w �Z� #w? ? user/menu.phpnu ��� <?php /** * Build User Administration Menu. * * @package WordPress * @subpackage Administration * @since 3.1.0 */ // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } $menu[2] = array( __( 'Dashboard' ), 'exist', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' ); $menu[4] = array( '', 'exist', 'separator1', '', 'wp-menu-separator' ); $menu[70] = array( __( 'Profile' ), 'exist', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' ); $menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator' ); $_wp_real_parent_file['users.php'] = 'profile.php'; $compat = array(); $submenu = array(); require_once ABSPATH . 'wp-admin/includes/menu.php'; PK w �Z/J� � user/profile.phpnu ��� <?php /** * User Profile Administration Screen. * * @package WordPress * @subpackage Administration * @since 3.1.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/profile.php'; PK w �Z;p�Q� � user/index.phpnu ��� <?php /** * User Dashboard Administration Screen * * @package WordPress * @subpackage Administration * @since 3.1.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/index.php'; PK w �ZQ�O user/contribute.phpnu ��� <?php /** * User Dashboard Contribute administration panel. * * @package WordPress * @subpackage Administration * @since 6.6.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/contribute.php'; PK w �Zޟ user/credits.phpnu ��� <?php /** * User Dashboard Credits administration panel. * * @package WordPress * @subpackage Administration * @since 3.4.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/credits.php'; PK w �Z��� � user/user-edit.phpnu ��� <?php /** * Edit user administration panel. * * @package WordPress * @subpackage Administration * @since 3.1.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/user-edit.php'; PK w �Z�D� user/about.phpnu ��� <?php /** * User Dashboard About administration panel. * * @package WordPress * @subpackage Administration * @since 3.4.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/about.php'; PK w �Z ��a a user/admin.phpnu ��� <?php /** * WordPress User Administration Bootstrap * * @package WordPress * @subpackage Administration * @since 3.1.0 */ define( 'WP_USER_ADMIN', true ); require_once dirname( __DIR__ ) . '/admin.php'; if ( ! is_multisite() ) { wp_redirect( admin_url() ); exit; } $redirect_user_admin_request = ( 0 !== strcasecmp( $current_blog->domain, $current_site->domain ) || 0 !== strcasecmp( $current_blog->path, $current_site->path ) ); /** * Filters whether to redirect the request to the User Admin in Multisite. * * @since 3.2.0 * * @param bool $redirect_user_admin_request Whether the request should be redirected. */ $redirect_user_admin_request = apply_filters( 'redirect_user_admin_request', $redirect_user_admin_request ); if ( $redirect_user_admin_request ) { wp_redirect( user_admin_url() ); exit; } unset( $redirect_user_admin_request ); PK w �Z>i�� user/freedoms.phpnu ��� <?php /** * User Dashboard Freedoms administration panel. * * @package WordPress * @subpackage Administration * @since 3.4.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/freedoms.php'; PK w �Z:9h user/privacy.phpnu ��� <?php /** * User Dashboard Privacy administration panel. * * @package WordPress * @subpackage Administration * @since 4.9.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/privacy.php'; PK w �Z.��S/ S/ site-editor.phpnu ��� <?php /** * Site Editor administration screen. * * @package WordPress * @subpackage Administration */ global $editor_styles; /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'edit_theme_options' ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>', 403 ); } /** * Maps old site editor urls to the new updated ones. * * @since 6.8.0 * @access private * * @global string $pagenow The filename of the current screen. * * @return string|false The new URL to redirect to, or false if no redirection is needed. */ function _wp_get_site_editor_redirection_url() { global $pagenow; if ( 'site-editor.php' !== $pagenow || isset( $_REQUEST['p'] ) || empty( $_SERVER['QUERY_STRING'] ) ) { return false; } // The following redirects are for the new permalinks in the site editor. if ( isset( $_REQUEST['postType'] ) && 'wp_navigation' === $_REQUEST['postType'] && ! empty( $_REQUEST['postId'] ) ) { return add_query_arg( array( 'p' => '/wp_navigation/' . $_REQUEST['postId'] ), remove_query_arg( array( 'postType', 'postId' ) ) ); } if ( isset( $_REQUEST['postType'] ) && 'wp_navigation' === $_REQUEST['postType'] && empty( $_REQUEST['postId'] ) ) { return add_query_arg( array( 'p' => '/navigation' ), remove_query_arg( 'postType' ) ); } if ( isset( $_REQUEST['path'] ) && '/wp_global_styles' === $_REQUEST['path'] ) { return add_query_arg( array( 'p' => '/styles' ), remove_query_arg( 'path' ) ); } if ( isset( $_REQUEST['postType'] ) && 'page' === $_REQUEST['postType'] && ( empty( $_REQUEST['canvas'] ) || empty( $_REQUEST['postId'] ) ) ) { return add_query_arg( array( 'p' => '/page' ), remove_query_arg( 'postType' ) ); } if ( isset( $_REQUEST['postType'] ) && 'page' === $_REQUEST['postType'] && ! empty( $_REQUEST['postId'] ) ) { return add_query_arg( array( 'p' => '/page/' . $_REQUEST['postId'] ), remove_query_arg( array( 'postType', 'postId' ) ) ); } if ( isset( $_REQUEST['postType'] ) && 'wp_template' === $_REQUEST['postType'] && ( empty( $_REQUEST['canvas'] ) || empty( $_REQUEST['postId'] ) ) ) { return add_query_arg( array( 'p' => '/template' ), remove_query_arg( 'postType' ) ); } if ( isset( $_REQUEST['postType'] ) && 'wp_template' === $_REQUEST['postType'] && ! empty( $_REQUEST['postId'] ) ) { return add_query_arg( array( 'p' => '/wp_template/' . $_REQUEST['postId'] ), remove_query_arg( array( 'postType', 'postId' ) ) ); } if ( isset( $_REQUEST['postType'] ) && 'wp_block' === $_REQUEST['postType'] && ( empty( $_REQUEST['canvas'] ) || empty( $_REQUEST['postId'] ) ) ) { return add_query_arg( array( 'p' => '/pattern' ), remove_query_arg( 'postType' ) ); } if ( isset( $_REQUEST['postType'] ) && 'wp_block' === $_REQUEST['postType'] && ! empty( $_REQUEST['postId'] ) ) { return add_query_arg( array( 'p' => '/wp_block/' . $_REQUEST['postId'] ), remove_query_arg( array( 'postType', 'postId' ) ) ); } if ( isset( $_REQUEST['postType'] ) && 'wp_template_part' === $_REQUEST['postType'] && ( empty( $_REQUEST['canvas'] ) || empty( $_REQUEST['postId'] ) ) ) { return add_query_arg( array( 'p' => '/pattern' ) ); } if ( isset( $_REQUEST['postType'] ) && 'wp_template_part' === $_REQUEST['postType'] && ! empty( $_REQUEST['postId'] ) ) { return add_query_arg( array( 'p' => '/wp_template_part/' . $_REQUEST['postId'] ), remove_query_arg( array( 'postType', 'postId' ) ) ); } // The following redirects are for backward compatibility with the old site editor URLs. if ( isset( $_REQUEST['path'] ) && '/wp_template_part/all' === $_REQUEST['path'] ) { return add_query_arg( array( 'p' => '/pattern', 'postType' => 'wp_template_part', ), remove_query_arg( 'path' ) ); } if ( isset( $_REQUEST['path'] ) && '/page' === $_REQUEST['path'] ) { return add_query_arg( array( 'p' => '/page' ), remove_query_arg( 'path' ) ); } if ( isset( $_REQUEST['path'] ) && '/wp_template' === $_REQUEST['path'] ) { return add_query_arg( array( 'p' => '/template' ), remove_query_arg( 'path' ) ); } if ( isset( $_REQUEST['path'] ) && '/patterns' === $_REQUEST['path'] ) { return add_query_arg( array( 'p' => '/pattern' ), remove_query_arg( 'path' ) ); } if ( isset( $_REQUEST['path'] ) && '/navigation' === $_REQUEST['path'] ) { return add_query_arg( array( 'p' => '/navigation' ), remove_query_arg( 'path' ) ); } return add_query_arg( array( 'p' => '/' ) ); } // Redirect to the site editor to the new URLs if needed. $redirection = _wp_get_site_editor_redirection_url(); if ( false !== $redirection ) { wp_safe_redirect( $redirection ); exit; } // Used in the HTML title tag. $title = _x( 'Editor', 'site editor title tag' ); $parent_file = 'themes.php'; // Flag that we're loading the block editor. $current_screen = get_current_screen(); $current_screen->is_block_editor( true ); // Default to is-fullscreen-mode to avoid jumps in the UI. add_filter( 'admin_body_class', static function ( $classes ) { return "$classes is-fullscreen-mode"; } ); $indexed_template_types = array(); foreach ( get_default_block_template_types() as $slug => $template_type ) { $template_type['slug'] = (string) $slug; $indexed_template_types[] = $template_type; } $context_settings = array( 'name' => 'core/edit-site' ); if ( ! empty( $_GET['postId'] ) && is_numeric( $_GET['postId'] ) ) { $context_settings['post'] = get_post( (int) $_GET['postId'] ); } elseif ( isset( $_GET['p'] ) && preg_match( '/^\/page\/(\d+)$/', $_GET['p'], $matches ) ) { $context_settings['post'] = get_post( (int) $matches[1] ); } $block_editor_context = new WP_Block_Editor_Context( $context_settings ); $custom_settings = array( 'siteUrl' => site_url(), 'postsPerPage' => get_option( 'posts_per_page' ), 'styles' => get_block_editor_theme_styles(), 'defaultTemplateTypes' => $indexed_template_types, 'defaultTemplatePartAreas' => get_allowed_block_template_part_areas(), 'supportsLayout' => wp_theme_has_theme_json(), 'supportsTemplatePartsMode' => ! wp_is_block_theme() && current_theme_supports( 'block-template-parts' ), ); // Add additional back-compat patterns registered by `current_screen` et al. $custom_settings['__experimentalAdditionalBlockPatterns'] = WP_Block_Patterns_Registry::get_instance()->get_all_registered( true ); $custom_settings['__experimentalAdditionalBlockPatternCategories'] = WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered( true ); $editor_settings = get_block_editor_settings( $custom_settings, $block_editor_context ); if ( isset( $_GET['postType'] ) && ! isset( $_GET['postId'] ) ) { $post_type = get_post_type_object( $_GET['postType'] ); if ( ! $post_type ) { wp_die( __( 'Invalid post type.' ) ); } } $active_global_styles_id = WP_Theme_JSON_Resolver::get_user_global_styles_post_id(); $active_theme = get_stylesheet(); $navigation_rest_route = rest_get_route_for_post_type_items( 'wp_navigation' ); $preload_paths = array( array( rest_get_route_for_post_type_items( 'attachment' ), 'OPTIONS' ), array( rest_get_route_for_post_type_items( 'page' ), 'OPTIONS' ), '/wp/v2/types?context=view', '/wp/v2/types/wp_template?context=edit', '/wp/v2/types/wp_template_part?context=edit', '/wp/v2/templates?context=edit&per_page=-1', '/wp/v2/template-parts?context=edit&per_page=-1', '/wp/v2/themes?context=edit&status=active', '/wp/v2/global-styles/' . $active_global_styles_id . '?context=edit', array( '/wp/v2/global-styles/' . $active_global_styles_id, 'OPTIONS' ), '/wp/v2/global-styles/themes/' . $active_theme . '?context=view', '/wp/v2/global-styles/themes/' . $active_theme . '/variations?context=view', array( $navigation_rest_route, 'OPTIONS' ), array( add_query_arg( array( 'context' => 'edit', 'per_page' => 100, 'order' => 'desc', 'orderby' => 'date', // array indices are required to avoid query being encoded and not matching in cache. 'status[0]' => 'publish', 'status[1]' => 'draft', ), $navigation_rest_route ), 'GET', ), '/wp/v2/settings', array( '/wp/v2/settings', 'OPTIONS' ), // Used by getBlockPatternCategories in useBlockEditorSettings. '/wp/v2/block-patterns/categories', // @see packages/core-data/src/entities.js '/?_fields=' . implode( ',', array( 'description', 'gmt_offset', 'home', 'name', 'site_icon', 'site_icon_url', 'site_logo', 'timezone_string', 'url', 'page_for_posts', 'page_on_front', 'show_on_front', ) ), ); if ( $block_editor_context->post ) { $route_for_post = rest_get_route_for_post( $block_editor_context->post ); if ( $route_for_post ) { $preload_paths[] = add_query_arg( 'context', 'edit', $route_for_post ); if ( 'page' === $block_editor_context->post->post_type ) { $preload_paths[] = add_query_arg( 'slug', // @see https://github.com/WordPress/gutenberg/blob/e093fefd041eb6cc4a4e7f67b92ab54fd75c8858/packages/core-data/src/private-selectors.ts#L244-L254 empty( $block_editor_context->post->post_name ) ? 'page' : 'page-' . $block_editor_context->post->post_name, '/wp/v2/templates/lookup' ); } } } else { $preload_paths[] = '/wp/v2/templates/lookup?slug=front-page'; $preload_paths[] = '/wp/v2/templates/lookup?slug=home'; } block_editor_rest_api_preload( $preload_paths, $block_editor_context ); wp_add_inline_script( 'wp-edit-site', sprintf( 'wp.domReady( function() { wp.editSite.initializeEditor( "site-editor", %s ); } );', wp_json_encode( $editor_settings ) ) ); // Preload server-registered block schemas. wp_add_inline_script( 'wp-blocks', 'wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . wp_json_encode( get_block_editor_server_block_settings() ) . ');' ); // Preload server-registered block bindings sources. $registered_sources = get_all_registered_block_bindings_sources(); if ( ! empty( $registered_sources ) ) { $filtered_sources = array(); foreach ( $registered_sources as $source ) { $filtered_sources[] = array( 'name' => $source->name, 'label' => $source->label, 'usesContext' => $source->uses_context, ); } $script = sprintf( 'for ( const source of %s ) { wp.blocks.registerBlockBindingsSource( source ); }', wp_json_encode( $filtered_sources ) ); wp_add_inline_script( 'wp-blocks', $script ); } wp_add_inline_script( 'wp-blocks', sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( isset( $editor_settings['blockCategories'] ) ? $editor_settings['blockCategories'] : array() ) ), 'after' ); wp_enqueue_script( 'wp-edit-site' ); wp_enqueue_script( 'wp-format-library' ); wp_enqueue_style( 'wp-edit-site' ); wp_enqueue_style( 'wp-format-library' ); wp_enqueue_media(); if ( current_theme_supports( 'wp-block-styles' ) && ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) ) { wp_enqueue_style( 'wp-block-library-theme' ); } /** This action is documented in wp-admin/edit-form-blocks.php */ do_action( 'enqueue_block_editor_assets' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="edit-site" id="site-editor"> <?php // JavaScript is disabled. ?> <div class="wrap hide-if-js site-editor-no-js"> <h1 class="wp-heading-inline"><?php _e( 'Edit Site' ); ?></h1> <?php /** * Filters the message displayed in the site editor interface when JavaScript is * not enabled in the browser. * * @since 6.3.0 * * @param string $message The message being displayed. * @param WP_Post $post The post being edited. */ $message = apply_filters( 'site_editor_no_javascript_message', __( 'The site editor requires JavaScript. Please enable JavaScript in your browser settings.' ), $post ); wp_admin_notice( $message, array( 'type' => 'error', 'additional_classes' => array( 'hide-if-js' ), ) ); ?> </div> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; PK w �Z-��Ȋr �r error_lognu ��� [07-May-2025 18:23:44 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [07-May-2025 18:23:45 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [08-May-2025 02:03:29 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [08-May-2025 02:03:30 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [09-May-2025 02:10:24 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [09-May-2025 02:10:25 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [10-May-2025 02:08:23 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [10-May-2025 02:08:24 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [11-May-2025 02:07:08 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [11-May-2025 02:07:09 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [12-May-2025 02:08:37 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [12-May-2025 02:08:37 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [13-May-2025 02:09:29 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [13-May-2025 02:09:29 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [14-May-2025 02:16:35 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [14-May-2025 02:16:36 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [15-May-2025 02:05:23 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [15-May-2025 02:05:24 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [16-May-2025 02:07:30 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [16-May-2025 02:07:31 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [17-May-2025 02:00:29 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [17-May-2025 02:00:30 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [18-May-2025 01:54:34 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [18-May-2025 01:54:35 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [19-May-2025 01:56:35 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [19-May-2025 01:56:35 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [19-May-2025 19:23:03 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [19-May-2025 19:23:03 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [20-May-2025 01:51:29 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [20-May-2025 01:51:30 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [20-May-2025 11:02:15 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [20-May-2025 11:02:15 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [20-May-2025 11:02:33 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [20-May-2025 11:02:33 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [21-May-2025 01:44:00 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [21-May-2025 01:44:01 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [22-May-2025 02:06:19 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [22-May-2025 02:06:20 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [23-May-2025 01:55:29 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [23-May-2025 01:55:30 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [23-May-2025 10:17:12 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [23-May-2025 10:17:12 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [24-May-2025 01:56:29 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [24-May-2025 01:56:29 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [25-May-2025 01:58:38 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [25-May-2025 01:58:39 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [26-May-2025 01:53:21 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [26-May-2025 01:53:22 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [27-May-2025 01:51:41 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [27-May-2025 01:51:42 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [27-May-2025 02:41:19 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [27-May-2025 02:41:19 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [28-May-2025 01:50:34 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [28-May-2025 01:50:35 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [28-May-2025 08:44:05 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [28-May-2025 08:44:05 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [29-May-2025 01:46:46 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [29-May-2025 01:46:47 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [30-May-2025 01:44:27 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [30-May-2025 01:44:28 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [31-May-2025 01:52:15 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [31-May-2025 01:52:16 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [01-Jun-2025 01:47:03 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [01-Jun-2025 01:47:03 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [02-Jun-2025 01:47:25 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [02-Jun-2025 01:47:25 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [03-Jun-2025 01:44:57 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [03-Jun-2025 01:44:58 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [04-Jun-2025 01:45:19 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [04-Jun-2025 01:45:19 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [05-Jun-2025 01:44:43 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [05-Jun-2025 01:44:44 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [06-Jun-2025 01:46:01 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [06-Jun-2025 01:46:02 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [07-Jun-2025 01:44:05 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [07-Jun-2025 01:44:06 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [08-Jun-2025 01:46:00 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [08-Jun-2025 01:46:00 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [09-Jun-2025 01:43:53 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [09-Jun-2025 01:43:54 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [10-Jun-2025 01:44:55 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [10-Jun-2025 01:44:56 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [11-Jun-2025 01:49:47 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [11-Jun-2025 01:49:48 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [12-Jun-2025 01:44:53 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [12-Jun-2025 01:44:53 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [13-Jun-2025 01:46:33 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [13-Jun-2025 01:46:33 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [13-Jun-2025 13:55:23 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [13-Jun-2025 13:55:23 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [14-Jun-2025 02:09:58 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [14-Jun-2025 02:09:59 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [14-Jun-2025 05:12:11 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [14-Jun-2025 05:12:11 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [15-Jun-2025 01:44:12 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [15-Jun-2025 01:44:13 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [15-Jun-2025 04:17:33 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [15-Jun-2025 04:17:33 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [15-Jun-2025 05:20:08 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [15-Jun-2025 05:20:08 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [15-Jun-2025 05:20:17 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [15-Jun-2025 05:20:17 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [15-Jun-2025 05:20:22 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [15-Jun-2025 05:20:22 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [15-Jun-2025 09:36:34 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [15-Jun-2025 09:36:34 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [15-Jun-2025 21:54:28 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [15-Jun-2025 21:54:28 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [16-Jun-2025 01:44:05 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [16-Jun-2025 01:44:06 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [16-Jun-2025 04:47:34 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [16-Jun-2025 04:47:34 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [16-Jun-2025 05:54:36 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [16-Jun-2025 05:54:36 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [17-Jun-2025 01:46:21 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [17-Jun-2025 01:46:22 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [17-Jun-2025 06:24:17 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [17-Jun-2025 06:24:17 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [17-Jun-2025 07:03:46 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [17-Jun-2025 07:03:46 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [17-Jun-2025 18:22:29 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [17-Jun-2025 18:22:29 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [17-Jun-2025 18:24:09 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [17-Jun-2025 18:24:09 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [18-Jun-2025 01:47:03 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [18-Jun-2025 01:47:04 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [18-Jun-2025 21:18:51 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [18-Jun-2025 21:18:51 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [18-Jun-2025 21:34:55 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [18-Jun-2025 21:34:55 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [18-Jun-2025 21:44:18 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [18-Jun-2025 21:44:18 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [18-Jun-2025 21:54:11 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [18-Jun-2025 21:54:11 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [18-Jun-2025 22:20:38 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [18-Jun-2025 22:20:38 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [18-Jun-2025 22:24:37 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [18-Jun-2025 22:24:37 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [18-Jun-2025 22:50:29 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [18-Jun-2025 22:50:29 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [18-Jun-2025 23:22:27 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [18-Jun-2025 23:22:27 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [19-Jun-2025 01:43:31 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [19-Jun-2025 01:43:32 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [19-Jun-2025 05:03:03 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [19-Jun-2025 05:03:03 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [19-Jun-2025 21:09:38 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [19-Jun-2025 21:09:38 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [20-Jun-2025 01:44:30 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [20-Jun-2025 01:44:31 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [21-Jun-2025 01:43:25 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [21-Jun-2025 01:43:26 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [22-Jun-2025 01:43:23 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [22-Jun-2025 01:43:24 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [23-Jun-2025 01:43:48 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [23-Jun-2025 01:43:48 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [23-Jun-2025 13:40:23 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [23-Jun-2025 13:40:23 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [23-Jun-2025 13:44:01 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [23-Jun-2025 13:44:01 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [23-Jun-2025 13:51:30 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [23-Jun-2025 13:51:30 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [23-Jun-2025 13:55:48 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [23-Jun-2025 13:55:48 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [23-Jun-2025 13:58:58 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [23-Jun-2025 13:58:58 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [23-Jun-2025 17:41:44 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [23-Jun-2025 17:41:44 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [23-Jun-2025 21:01:33 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [23-Jun-2025 21:01:33 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [24-Jun-2025 01:44:18 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [24-Jun-2025 01:44:18 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [24-Jun-2025 18:58:26 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [24-Jun-2025 18:58:26 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [25-Jun-2025 01:44:06 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [25-Jun-2025 01:44:07 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [25-Jun-2025 10:58:44 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [25-Jun-2025 10:58:44 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [25-Jun-2025 11:31:52 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [25-Jun-2025 11:31:52 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [25-Jun-2025 15:30:43 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [25-Jun-2025 15:30:43 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [25-Jun-2025 15:35:33 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [25-Jun-2025 15:35:33 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [25-Jun-2025 16:08:24 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [25-Jun-2025 16:08:24 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [26-Jun-2025 01:44:11 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [26-Jun-2025 01:44:12 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [26-Jun-2025 13:44:48 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [26-Jun-2025 13:44:48 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [26-Jun-2025 13:55:14 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [26-Jun-2025 13:55:14 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [26-Jun-2025 14:00:18 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [26-Jun-2025 14:00:18 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [26-Jun-2025 14:04:24 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [26-Jun-2025 14:04:24 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [27-Jun-2025 01:44:34 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [27-Jun-2025 01:44:35 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [27-Jun-2025 14:09:49 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [27-Jun-2025 14:09:49 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [27-Jun-2025 18:49:37 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [27-Jun-2025 18:49:37 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [27-Jun-2025 18:55:54 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [27-Jun-2025 18:55:54 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [27-Jun-2025 21:49:02 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [27-Jun-2025 21:49:02 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [28-Jun-2025 01:43:04 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [28-Jun-2025 01:43:04 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [28-Jun-2025 21:56:04 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [28-Jun-2025 21:56:04 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [29-Jun-2025 01:43:26 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [29-Jun-2025 01:43:26 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [29-Jun-2025 14:03:27 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [29-Jun-2025 14:03:27 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [29-Jun-2025 14:08:42 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [29-Jun-2025 14:08:42 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [29-Jun-2025 14:14:44 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [29-Jun-2025 14:14:44 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [29-Jun-2025 16:03:55 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [29-Jun-2025 16:03:55 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [29-Jun-2025 20:54:50 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [29-Jun-2025 20:54:50 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [29-Jun-2025 21:05:27 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [29-Jun-2025 21:05:27 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [30-Jun-2025 01:43:22 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [30-Jun-2025 01:43:23 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [30-Jun-2025 14:08:20 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [30-Jun-2025 14:08:20 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [30-Jun-2025 14:14:24 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [30-Jun-2025 14:14:24 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [30-Jun-2025 14:19:32 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [30-Jun-2025 14:19:32 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [01-Jul-2025 01:44:18 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [01-Jul-2025 01:44:19 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [01-Jul-2025 13:56:36 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [01-Jul-2025 13:56:36 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [01-Jul-2025 14:07:40 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [01-Jul-2025 14:07:40 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [01-Jul-2025 14:14:31 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [01-Jul-2025 14:14:31 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [01-Jul-2025 14:20:28 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [01-Jul-2025 14:20:28 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [01-Jul-2025 14:22:34 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [01-Jul-2025 14:22:34 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [02-Jul-2025 01:44:46 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [02-Jul-2025 01:44:47 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [02-Jul-2025 02:12:46 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [02-Jul-2025 02:12:46 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [02-Jul-2025 02:20:04 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [02-Jul-2025 02:20:04 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [02-Jul-2025 07:02:52 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [02-Jul-2025 07:02:52 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [02-Jul-2025 07:07:16 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [02-Jul-2025 07:07:16 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [02-Jul-2025 13:58:51 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [02-Jul-2025 13:58:51 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [02-Jul-2025 14:12:49 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [02-Jul-2025 14:12:49 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [02-Jul-2025 14:17:52 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [02-Jul-2025 14:17:52 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [02-Jul-2025 14:23:50 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [02-Jul-2025 14:23:50 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [03-Jul-2025 01:46:37 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [03-Jul-2025 01:46:38 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [03-Jul-2025 04:01:51 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [03-Jul-2025 04:01:51 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [03-Jul-2025 11:45:25 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [03-Jul-2025 11:45:25 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [03-Jul-2025 14:02:53 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [03-Jul-2025 14:02:53 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [03-Jul-2025 14:15:11 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [03-Jul-2025 14:15:11 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [03-Jul-2025 14:22:10 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [03-Jul-2025 14:22:10 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [03-Jul-2025 14:27:05 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [03-Jul-2025 14:27:05 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [03-Jul-2025 23:17:56 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [03-Jul-2025 23:17:56 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [04-Jul-2025 01:46:32 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'siteurl' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpPluginDirectoryConstants, wp_plugin_directory_constants, get_option [04-Jul-2025 01:46:33 UTC] WordPress database error Table 'just.wp_rg45rg435t5teoptions' doesn't exist for query SELECT option_value FROM wp_rg45rg435t5teoptions WHERE option_name = 'home' LIMIT 1 made by Lsc\Wp\UserCommand::run, Lsc\Wp\UserCommand->runAsUser, Lsc\Wp\WPCaller::getInstance, Lsc\Wp\WPCaller->__construct, Lsc\Wp\WPCaller->init, Lsc\Wp\WPCaller->initWp, Lsc\Wp\WpWrapper\WpFuncs::wpCookieConstants, wp_cookie_constants, get_option [04-Jul-2025 03:16:51 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [04-Jul-2025 03:16:51 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [04-Jul-2025 08:54:33 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [04-Jul-2025 08:54:33 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [04-Jul-2025 21:20:38 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [04-Jul-2025 21:20:38 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [05-Jul-2025 00:52:57 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [05-Jul-2025 00:52:57 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [05-Jul-2025 00:57:30 UTC] PHP Warning: require_once(/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php): Failed to open stream: No such file or directory in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 [05-Jul-2025 00:57:30 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/topsuzmw/public_html/wordpress/wp-includes/blocks/navigation-submenu.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php:37 Stack trace: #0 /home/topsuzmw/public_html/wordpress/wp-includes/blocks/index.php(18): require() #1 /home/topsuzmw/public_html/wordpress/wp-settings.php(369): require('/home/topsuzmw/...') #2 /home/topsuzmw/public_html/wordpress/wp-config.php(102): require_once('/home/topsuzmw/...') #3 /home/topsuzmw/public_html/wordpress/wp-load.php(50): require_once('/home/topsuzmw/...') #4 /home/topsuzmw/public_html/wordpress/wp-admin/install.php(36): require_once('/home/topsuzmw/...') #5 {main} thrown in /home/topsuzmw/public_html/wordpress/wp-includes/blocks/require-dynamic-blocks.php on line 37 PK w �Z��JM M upgrade.phpnu ��� <?php /** * Upgrade WordPress Page. * * @package WordPress * @subpackage Administration */ /** * We are upgrading WordPress. * * @since 1.5.1 * @var bool */ define( 'WP_INSTALLING', true ); /** Load WordPress Bootstrap */ require dirname( __DIR__ ) . '/wp-load.php'; nocache_headers(); require_once ABSPATH . 'wp-admin/includes/upgrade.php'; delete_site_transient( 'update_core' ); if ( isset( $_GET['step'] ) ) { $step = $_GET['step']; } else { $step = 0; } // Do it. No output. if ( 'upgrade_db' === $step ) { wp_upgrade(); die( '0' ); } /** * @global string $wp_version The WordPress version string. * @global string $required_php_version The required PHP version string. * @global string[] $required_php_extensions The names of required PHP extensions. * @global string $required_mysql_version The required MySQL version string. * @global wpdb $wpdb WordPress database abstraction object. */ global $wp_version, $required_php_version, $required_php_extensions, $required_mysql_version, $wpdb; $step = (int) $step; $php_version = PHP_VERSION; $mysql_version = $wpdb->db_version(); $php_compat = version_compare( $php_version, $required_php_version, '>=' ); if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) { $mysql_compat = true; } else { $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ); } $missing_extensions = array(); if ( isset( $required_php_extensions ) && is_array( $required_php_extensions ) ) { foreach ( $required_php_extensions as $extension ) { if ( extension_loaded( $extension ) ) { continue; } $missing_extensions[] = sprintf( /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: The PHP extension name needed. */ __( 'You cannot upgrade because <a href="%1$s">WordPress %2$s</a> requires the %3$s PHP extension.' ), $version_url, $wp_version, $extension ); } } header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); ?> <!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>" /> <meta name="robots" content="noindex,nofollow" /> <title><?php _e( 'WordPress › Update' ); ?></title> <?php wp_admin_css( 'install', true ); ?> </head> <body class="wp-core-ui"> <p id="logo"><a href="<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>"><?php _e( 'WordPress' ); ?></a></p> <?php if ( (int) get_option( 'db_version' ) === $wp_db_version || ! is_blog_installed() ) : ?> <h1><?php _e( 'No Update Required' ); ?></h1> <p><?php _e( 'Your WordPress database is already up to date!' ); ?></p> <p class="step"><a class="button button-large" href="<?php echo esc_url( get_option( 'home' ) ); ?>/"><?php _e( 'Continue' ); ?></a></p> <?php elseif ( ! $php_compat || ! $mysql_compat ) : $version_url = sprintf( /* translators: %s: WordPress version. */ esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ), sanitize_title( $wp_version ) ); $php_update_message = '</p><p>' . sprintf( /* translators: %s: URL to Update PHP page. */ __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) ); $annotation = wp_get_update_php_annotation(); if ( $annotation ) { $php_update_message .= '</p><p><em>' . $annotation . '</em>'; } if ( ! $mysql_compat && ! $php_compat ) { $message = sprintf( /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number. */ __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ) . $php_update_message; } elseif ( ! $php_compat ) { $message = sprintf( /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number. */ __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_php_version, $php_version ) . $php_update_message; } elseif ( ! $mysql_compat ) { $message = sprintf( /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number. */ __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_mysql_version, $mysql_version ); } echo '<p>' . $message . '</p>'; elseif ( count( $missing_extensions ) > 0 ) : echo '<p>' . implode( '</p><p>', $missing_extensions ) . '</p>'; else : switch ( $step ) : case 0: $goback = wp_get_referer(); if ( $goback ) { $goback = sanitize_url( $goback ); $goback = urlencode( $goback ); } ?> <h1><?php _e( 'Database Update Required' ); ?></h1> <p><?php _e( 'WordPress has been updated! Next and final step is to update your database to the newest version.' ); ?></p> <p><?php _e( 'The database update process may take a little while, so please be patient.' ); ?></p> <p class="step"><a class="button button-large button-primary" href="upgrade.php?step=1&backto=<?php echo $goback; ?>"><?php _e( 'Update WordPress Database' ); ?></a></p> <?php break; case 1: wp_upgrade(); $backto = ! empty( $_GET['backto'] ) ? wp_unslash( urldecode( $_GET['backto'] ) ) : __get_option( 'home' ) . '/'; $backto = esc_url( $backto ); $backto = wp_validate_redirect( $backto, __get_option( 'home' ) . '/' ); ?> <h1><?php _e( 'Update Complete' ); ?></h1> <p><?php _e( 'Your WordPress database has been successfully updated!' ); ?></p> <p class="step"><a class="button button-large" href="<?php echo $backto; ?>"><?php _e( 'Continue' ); ?></a></p> <?php break; endswitch; endif; ?> </body> </html> PK w �Z#���� � widgets-form-blocks.phpnu ��� <?php /** * The block-based widgets editor, for use in widgets.php. * * @package WordPress * @subpackage Administration */ // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } // Flag that we're loading the block editor. $current_screen = get_current_screen(); $current_screen->is_block_editor( true ); $block_editor_context = new WP_Block_Editor_Context( array( 'name' => 'core/edit-widgets' ) ); $preload_paths = array( array( rest_get_route_for_post_type_items( 'attachment' ), 'OPTIONS' ), '/wp/v2/widget-types?context=edit&per_page=-1', '/wp/v2/sidebars?context=edit&per_page=-1', '/wp/v2/widgets?context=edit&per_page=-1&_embed=about', ); block_editor_rest_api_preload( $preload_paths, $block_editor_context ); $editor_settings = get_block_editor_settings( array_merge( get_legacy_widget_block_editor_settings(), array( 'styles' => get_block_editor_theme_styles() ) ), $block_editor_context ); // The widgets editor does not support the Block Directory, so don't load any of // its assets. This also prevents 'wp-editor' from being enqueued which we // cannot load in the widgets screen because many widget scripts rely on `wp.editor`. remove_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' ); wp_add_inline_script( 'wp-edit-widgets', sprintf( 'wp.domReady( function() { wp.editWidgets.initialize( "widgets-editor", %s ); } );', wp_json_encode( $editor_settings ) ) ); // Preload server-registered block schemas. wp_add_inline_script( 'wp-blocks', 'wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . wp_json_encode( get_block_editor_server_block_settings() ) . ');' ); // Preload server-registered block bindings sources. $registered_sources = get_all_registered_block_bindings_sources(); if ( ! empty( $registered_sources ) ) { $filtered_sources = array(); foreach ( $registered_sources as $source ) { $filtered_sources[] = array( 'name' => $source->name, 'label' => $source->label, 'usesContext' => $source->uses_context, ); } $script = sprintf( 'for ( const source of %s ) { wp.blocks.registerBlockBindingsSource( source ); }', wp_json_encode( $filtered_sources ) ); wp_add_inline_script( 'wp-blocks', $script ); } wp_add_inline_script( 'wp-blocks', sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( $block_editor_context ) ) ), 'after' ); wp_enqueue_script( 'wp-edit-widgets' ); wp_enqueue_script( 'admin-widgets' ); wp_enqueue_style( 'wp-edit-widgets' ); /** This action is documented in wp-admin/edit-form-blocks.php */ do_action( 'enqueue_block_editor_assets' ); /** This action is documented in wp-admin/widgets-form.php */ do_action( 'sidebar_admin_setup' ); require_once ABSPATH . 'wp-admin/admin-header.php'; /** This action is documented in wp-admin/widgets-form.php */ do_action( 'widgets_admin_page' ); ?> <div id="widgets-editor" class="blocks-widgets-container"> <?php // JavaScript is disabled. ?> <div class="wrap hide-if-js widgets-editor-no-js"> <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1> <?php if ( file_exists( WP_PLUGIN_DIR . '/classic-widgets/classic-widgets.php' ) ) { // If Classic Widgets is already installed, provide a link to activate the plugin. $installed = true; $plugin_activate_url = wp_nonce_url( 'plugins.php?action=activate&plugin=classic-widgets/classic-widgets.php', 'activate-plugin_classic-widgets/classic-widgets.php' ); $message = sprintf( /* translators: %s: Link to activate the Classic Widgets plugin. */ __( 'The block widgets require JavaScript. Please enable JavaScript in your browser settings, or activate the <a href="%s">Classic Widgets plugin</a>.' ), esc_url( $plugin_activate_url ) ); } else { // If Classic Widgets is not installed, provide a link to install it. $installed = false; $plugin_install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=classic-widgets' ), 'install-plugin_classic-widgets' ); $message = sprintf( /* translators: %s: A link to install the Classic Widgets plugin. */ __( 'The block widgets require JavaScript. Please enable JavaScript in your browser settings, or install the <a href="%s">Classic Widgets plugin</a>.' ), esc_url( $plugin_install_url ) ); } /** * Filters the message displayed in the block widget interface when JavaScript is * not enabled in the browser. * * @since 6.4.0 * * @param string $message The message being displayed. * @param bool $installed Whether the Classic Widget plugin is installed. */ $message = apply_filters( 'block_widgets_no_javascript_message', $message, $installed ); wp_admin_notice( $message, array( 'type' => 'error', 'additional_classes' => array( 'hide-if-js' ), ) ); ?> </div> </div> <?php /** This action is documented in wp-admin/widgets-form.php */ do_action( 'sidebar_admin_page' ); require_once ABSPATH . 'wp-admin/admin-footer.php'; PK w �Z�3N� � privacy-policy-guide.phpnu ��� <?php /** * Privacy Policy Guide Screen. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'manage_privacy_options' ) ) { wp_die( __( 'Sorry, you are not allowed to manage privacy options on this site.' ) ); } if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) { require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php'; } // Used in the HTML title tag. $title = __( 'Privacy Policy Guide' ); add_filter( 'admin_body_class', static function ( $body_class ) { $body_class .= ' privacy-settings '; return $body_class; } ); wp_enqueue_script( 'privacy-tools' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="privacy-settings-header"> <div class="privacy-settings-title-section"> <h1> <?php _e( 'Privacy' ); ?> </h1> </div> <nav class="privacy-settings-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>"> <a href="<?php echo esc_url( admin_url( 'options-privacy.php' ) ); ?>" class="privacy-settings-tab"> <?php /* translators: Tab heading for Site Health Status page. */ _ex( 'Settings', 'Privacy Settings' ); ?> </a> <a href="<?php echo esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ); ?>" class="privacy-settings-tab active" aria-current="true"> <?php /* translators: Tab heading for Site Health Status page. */ _ex( 'Policy Guide', 'Privacy Settings' ); ?> </a> </nav> </div> <hr class="wp-header-end"> <?php wp_admin_notice( __( 'The Privacy Settings require JavaScript.' ), array( 'type' => 'error', 'additional_classes' => array( 'hide-if-js' ), ) ); ?> <div class="privacy-settings-body hide-if-no-js"> <h2><?php _e( 'Privacy Policy Guide' ); ?></h2> <h3 class="section-title"><?php _e( 'Introduction' ); ?></h3> <p><?php _e( 'This text template will help you to create your website’s privacy policy.' ); ?></p> <p><?php _e( 'The template contains a suggestion of sections you most likely will need. Under each section heading, you will find a short summary of what information you should provide, which will help you to get started. Some sections include suggested policy content, others will have to be completed with information from your theme and plugins.' ); ?></p> <p><?php _e( 'Please edit your privacy policy content, making sure to delete the summaries, and adding any information from your theme and plugins. Once you publish your policy page, remember to add it to your navigation menu.' ); ?></p> <p><?php _e( 'It is your responsibility to write a comprehensive privacy policy, to make sure it reflects all national and international legal requirements on privacy, and to keep your policy current and accurate.' ); ?></p> <div class="privacy-settings-accordion"> <h4 class="privacy-settings-accordion-heading"> <button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-privacy-policy-guide" type="button"> <span class="title"><?php _e( 'Privacy Policy Guide' ); ?></span> <span class="icon"></span> </button> </h4> <div id="privacy-settings-accordion-block-privacy-policy-guide" class="privacy-settings-accordion-panel" hidden="hidden"> <?php $content = WP_Privacy_Policy_Content::get_default_content( true, false ); echo $content; ?> </div> </div> <hr class="hr-separator"> <h3 class="section-title"><?php _e( 'Policies' ); ?></h3> <div class="privacy-settings-accordion wp-privacy-policy-guide"> <?php WP_Privacy_Policy_Content::privacy_policy_guide(); ?> </div> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; PK w �ZbB�� � ms-admin.phpnu ��� <?php /** * Multisite administration panel. * * @package WordPress * @subpackage Multisite * @since 3.0.0 */ require_once __DIR__ . '/admin.php'; wp_redirect( network_admin_url() ); exit; PK x �Z7k��� � link-parse-opml.phpnu ��� <?php /** * Parse OPML XML files and store in globals. * * @package WordPress * @subpackage Administration */ if ( ! defined( 'ABSPATH' ) ) { die(); } /** * @global string $opml */ global $opml; /** * Starts a new XML tag. * * Callback function for xml_set_element_handler(). * * @since 0.71 * @access private * * @global array $names * @global array $urls * @global array $targets * @global array $descriptions * @global array $feeds * * @param resource $parser XML Parser resource. * @param string $tag_name XML element name. * @param array $attrs XML element attributes. */ function startElement( $parser, $tag_name, $attrs ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid global $names, $urls, $targets, $descriptions, $feeds; if ( 'OUTLINE' === $tag_name ) { $name = ''; if ( isset( $attrs['TEXT'] ) ) { $name = $attrs['TEXT']; } if ( isset( $attrs['TITLE'] ) ) { $name = $attrs['TITLE']; } $url = ''; if ( isset( $attrs['URL'] ) ) { $url = $attrs['URL']; } if ( isset( $attrs['HTMLURL'] ) ) { $url = $attrs['HTMLURL']; } // Save the data away. $names[] = $name; $urls[] = $url; $targets[] = isset( $attrs['TARGET'] ) ? $attrs['TARGET'] : ''; $feeds[] = isset( $attrs['XMLURL'] ) ? $attrs['XMLURL'] : ''; $descriptions[] = isset( $attrs['DESCRIPTION'] ) ? $attrs['DESCRIPTION'] : ''; } // End if outline. } /** * Ends a new XML tag. * * Callback function for xml_set_element_handler(). * * @since 0.71 * @access private * * @param resource $parser XML Parser resource. * @param string $tag_name XML tag name. */ function endElement( $parser, $tag_name ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid // Nothing to do. } // Create an XML parser. if ( ! function_exists( 'xml_parser_create' ) ) { wp_trigger_error( '', __( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." ) ); wp_die( __( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." ) ); } $xml_parser = xml_parser_create(); // Set the functions to handle opening and closing tags. xml_set_element_handler( $xml_parser, 'startElement', 'endElement' ); if ( ! xml_parse( $xml_parser, $opml, true ) ) { printf( /* translators: 1: Error message, 2: Line number. */ __( 'XML Error: %1$s at line %2$s' ), xml_error_string( xml_get_error_code( $xml_parser ) ), xml_get_current_line_number( $xml_parser ) ); } // Free up memory used by the XML parser. xml_parser_free( $xml_parser ); unset( $xml_parser ); PK x �ZU�f1 1 install-helper.phpnu ��� <?php /** * Plugins may load this file to gain access to special helper functions * for plugin installation. This file is not included by WordPress and it is * recommended, to prevent fatal errors, that this file is included using * require_once. * * These functions are not optimized for speed, but they should only be used * once in a while, so speed shouldn't be a concern. If it is and you are * needing to use these functions a lot, you might experience timeouts. * If you do, then it is advised to just write the SQL code yourself. * * check_column( 'wp_links', 'link_description', 'mediumtext' ); * * if ( check_column( $wpdb->comments, 'comment_author', 'tinytext' ) ) { * echo "ok\n"; * } * * // Check the column. * if ( ! check_column( $wpdb->links, 'link_description', 'varchar( 255 )' ) ) { * $ddl = "ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' "; * $q = $wpdb->query( $ddl ); * } * * $error_count = 0; * $tablename = $wpdb->links; * * if ( check_column( $wpdb->links, 'link_description', 'varchar( 255 )' ) ) { * $res .= $tablename . ' - ok <br />'; * } else { * $res .= 'There was a problem with ' . $tablename . '<br />'; * ++$error_count; * } * * @package WordPress * @subpackage Plugin */ /** Load WordPress Bootstrap */ require_once dirname( __DIR__ ) . '/wp-load.php'; if ( ! function_exists( 'maybe_create_table' ) ) : /** * Creates a table in the database if it doesn't already exist. * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $table_name Database table name. * @param string $create_ddl SQL statement to create table. * @return bool True on success or if the table already exists. False on failure. */ function maybe_create_table( $table_name, $create_ddl ) { global $wpdb; foreach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) { if ( $table === $table_name ) { return true; } } // Didn't find it, so try to create it. // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query. $wpdb->query( $create_ddl ); // We cannot directly tell whether this succeeded! foreach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) { if ( $table === $table_name ) { return true; } } return false; } endif; if ( ! function_exists( 'maybe_add_column' ) ) : /** * Adds column to database table, if it doesn't already exist. * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $table_name Database table name. * @param string $column_name Table column name. * @param string $create_ddl SQL statement to add column. * @return bool True on success or if the column already exists. False on failure. */ function maybe_add_column( $table_name, $column_name, $create_ddl ) { global $wpdb; // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names. foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { if ( $column === $column_name ) { return true; } } // Didn't find it, so try to create it. // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query. $wpdb->query( $create_ddl ); // We cannot directly tell whether this succeeded! // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names. foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { if ( $column === $column_name ) { return true; } } return false; } endif; /** * Drops column from database table, if it exists. * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $table_name Database table name. * @param string $column_name Table column name. * @param string $drop_ddl SQL statement to drop column. * @return bool True on success or if the column doesn't exist. False on failure. */ function maybe_drop_column( $table_name, $column_name, $drop_ddl ) { global $wpdb; // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names. foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { if ( $column === $column_name ) { // Found it, so try to drop it. // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query. $wpdb->query( $drop_ddl ); // We cannot directly tell whether this succeeded! // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names. foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { if ( $column === $column_name ) { return false; } } } } // Else didn't find it. return true; } /** * Checks that database table column matches the criteria. * * Uses the SQL DESC for retrieving the table info for the column. It will help * understand the parameters, if you do more research on what column information * is returned by the SQL statement. Pass in null to skip checking that criteria. * * Column names returned from DESC table are case sensitive and are as listed: * * - Field * - Type * - Null * - Key * - Default * - Extra * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $table_name Database table name. * @param string $col_name Table column name. * @param string $col_type Table column type. * @param bool $is_null Optional. Check is null. * @param mixed $key Optional. Key info. * @param mixed $default_value Optional. Default value. * @param mixed $extra Optional. Extra value. * @return bool True, if matches. False, if not matching. */ function check_column( $table_name, $col_name, $col_type, $is_null = null, $key = null, $default_value = null, $extra = null ) { global $wpdb; $diffs = 0; // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names. $results = $wpdb->get_results( "DESC $table_name" ); foreach ( $results as $row ) { if ( $row->Field === $col_name ) { // Got our column, check the params. if ( ( null !== $col_type ) && ( $row->Type !== $col_type ) ) { ++$diffs; } if ( ( null !== $is_null ) && ( $row->Null !== $is_null ) ) { ++$diffs; } if ( ( null !== $key ) && ( $row->Key !== $key ) ) { ++$diffs; } if ( ( null !== $default_value ) && ( $row->Default !== $default_value ) ) { ++$diffs; } if ( ( null !== $extra ) && ( $row->Extra !== $extra ) ) { ++$diffs; } if ( $diffs > 0 ) { return false; } return true; } // End if found our column. } return false; } PK x �Zq$r��5 �5 options.phpnu ��� <?php /** * Options Management Administration Screen. * * If accessed directly in a browser this page shows a list of all saved options * along with editable fields for their values. Serialized data is not supported * and there is no way to remove options via this page. It is not linked to from * anywhere else in the admin. * * This file is also the target of the forms in core and custom options pages * that use the Settings API. In this case it saves the new option values * and returns the user to their page of origin. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; // Used in the HTML title tag. $title = __( 'Settings' ); $this_file = 'options.php'; $parent_file = 'options-general.php'; $action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : ''; $option_page = ! empty( $_REQUEST['option_page'] ) ? sanitize_text_field( $_REQUEST['option_page'] ) : ''; $capability = 'manage_options'; // This is for back compat and will eventually be removed. if ( empty( $option_page ) ) { $option_page = 'options'; } else { /** * Filters the capability required when using the Settings API. * * By default, the options groups for all registered settings require the manage_options capability. * This filter is required to change the capability required for a certain options page. * * @since 3.2.0 * * @param string $capability The capability used for the page, which is manage_options by default. */ $capability = apply_filters( "option_page_capability_{$option_page}", $capability ); } if ( ! current_user_can( $capability ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to manage options for this site.' ) . '</p>', 403 ); } // Handle admin email change requests. if ( ! empty( $_GET['adminhash'] ) ) { $new_admin_details = get_option( 'adminhash' ); $redirect = 'options-general.php?updated=false'; if ( is_array( $new_admin_details ) && hash_equals( $new_admin_details['hash'], $_GET['adminhash'] ) && ! empty( $new_admin_details['newemail'] ) ) { update_option( 'admin_email', $new_admin_details['newemail'] ); delete_option( 'adminhash' ); delete_option( 'new_admin_email' ); $redirect = 'options-general.php?updated=true'; } wp_redirect( admin_url( $redirect ) ); exit; } elseif ( ! empty( $_GET['dismiss'] ) && 'new_admin_email' === $_GET['dismiss'] ) { check_admin_referer( 'dismiss-' . get_current_blog_id() . '-new_admin_email' ); delete_option( 'adminhash' ); delete_option( 'new_admin_email' ); wp_redirect( admin_url( 'options-general.php?updated=true' ) ); exit; } if ( is_multisite() && ! current_user_can( 'manage_network_options' ) && 'update' !== $action ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to delete these items.' ) . '</p>', 403 ); } $allowed_options = array( 'general' => array( 'blogname', 'blogdescription', 'site_icon', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string', 'WPLANG', 'new_admin_email', ), 'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_previously_approved', 'comment_max_links', 'moderation_keys', 'disallowed_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration', 'show_comments_cookies_opt_in', ), 'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type', ), 'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'show_on_front', 'page_on_front', 'page_for_posts', 'blog_public', ), 'writing' => array( 'default_category', 'default_email_category', 'default_link_category', 'default_post_format', ), ); $allowed_options['misc'] = array(); $allowed_options['options'] = array(); $allowed_options['privacy'] = array(); /** * Filters whether the post-by-email functionality is enabled. * * @since 3.0.0 * * @param bool $enabled Whether post-by-email configuration is enabled. Default true. */ if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { $allowed_options['writing'][] = 'mailserver_url'; $allowed_options['writing'][] = 'mailserver_port'; $allowed_options['writing'][] = 'mailserver_login'; $allowed_options['writing'][] = 'mailserver_pass'; } if ( ! is_utf8_charset() ) { $allowed_options['reading'][] = 'blog_charset'; } if ( get_site_option( 'initial_db_version' ) < 32453 ) { $allowed_options['writing'][] = 'use_smilies'; $allowed_options['writing'][] = 'use_balanceTags'; } if ( ! is_multisite() ) { if ( ! defined( 'WP_SITEURL' ) ) { $allowed_options['general'][] = 'siteurl'; } if ( ! defined( 'WP_HOME' ) ) { $allowed_options['general'][] = 'home'; } $allowed_options['general'][] = 'users_can_register'; $allowed_options['general'][] = 'default_role'; if ( '1' === get_option( 'blog_public' ) ) { $allowed_options['writing'][] = 'ping_sites'; } $allowed_options['media'][] = 'uploads_use_yearmonth_folders'; /* * If upload_url_path is not the default (empty), * or upload_path is not the default ('wp-content/uploads' or empty), * they can be edited, otherwise they're locked. */ if ( get_option( 'upload_url_path' ) || get_option( 'upload_path' ) && 'wp-content/uploads' !== get_option( 'upload_path' ) ) { $allowed_options['media'][] = 'upload_path'; $allowed_options['media'][] = 'upload_url_path'; } } /** * Filters the allowed options list. * * @since 2.7.0 * @deprecated 5.5.0 Use {@see 'allowed_options'} instead. * * @param array $allowed_options The allowed options list. */ $allowed_options = apply_filters_deprecated( 'whitelist_options', array( $allowed_options ), '5.5.0', 'allowed_options', __( 'Please consider writing more inclusive code.' ) ); /** * Filters the allowed options list. * * @since 5.5.0 * * @param array $allowed_options The allowed options list. */ $allowed_options = apply_filters( 'allowed_options', $allowed_options ); if ( 'update' === $action ) { // We are saving settings sent from a settings page. if ( 'options' === $option_page && ! isset( $_POST['option_page'] ) ) { // This is for back compat and will eventually be removed. $unregistered = true; check_admin_referer( 'update-options' ); } else { $unregistered = false; check_admin_referer( $option_page . '-options' ); } if ( ! isset( $allowed_options[ $option_page ] ) ) { wp_die( sprintf( /* translators: %s: The options page name. */ __( '<strong>Error:</strong> The %s options page is not in the allowed options list.' ), '<code>' . esc_html( $option_page ) . '</code>' ) ); } if ( 'options' === $option_page ) { if ( is_multisite() && ! current_user_can( 'manage_network_options' ) ) { wp_die( __( 'Sorry, you are not allowed to modify unregistered settings for this site.' ) ); } $options = isset( $_POST['page_options'] ) ? explode( ',', wp_unslash( $_POST['page_options'] ) ) : null; } else { $options = $allowed_options[ $option_page ]; } if ( 'general' === $option_page ) { // Handle custom date/time formats. if ( ! empty( $_POST['date_format'] ) && isset( $_POST['date_format_custom'] ) && '\c\u\s\t\o\m' === wp_unslash( $_POST['date_format'] ) ) { $_POST['date_format'] = $_POST['date_format_custom']; } if ( ! empty( $_POST['time_format'] ) && isset( $_POST['time_format_custom'] ) && '\c\u\s\t\o\m' === wp_unslash( $_POST['time_format'] ) ) { $_POST['time_format'] = $_POST['time_format_custom']; } // Map UTC+- timezones to gmt_offsets and set timezone_string to empty. if ( ! empty( $_POST['timezone_string'] ) && preg_match( '/^UTC[+-]/', $_POST['timezone_string'] ) ) { $_POST['gmt_offset'] = $_POST['timezone_string']; $_POST['gmt_offset'] = preg_replace( '/UTC\+?/', '', $_POST['gmt_offset'] ); $_POST['timezone_string'] = ''; } elseif ( isset( $_POST['timezone_string'] ) && ! in_array( $_POST['timezone_string'], timezone_identifiers_list( DateTimeZone::ALL_WITH_BC ), true ) ) { // Reset to the current value. $current_timezone_string = get_option( 'timezone_string' ); if ( ! empty( $current_timezone_string ) ) { $_POST['timezone_string'] = $current_timezone_string; } else { $_POST['gmt_offset'] = get_option( 'gmt_offset' ); $_POST['timezone_string'] = ''; } add_settings_error( 'general', 'settings_updated', __( 'The timezone you have entered is not valid. Please select a valid timezone.' ), 'error' ); } // Handle translation installation. if ( ! empty( $_POST['WPLANG'] ) && current_user_can( 'install_languages' ) ) { require_once ABSPATH . 'wp-admin/includes/translation-install.php'; if ( wp_can_install_language_pack() ) { $language = wp_download_language_pack( $_POST['WPLANG'] ); if ( $language ) { $_POST['WPLANG'] = $language; } } } } if ( $options ) { $user_language_old = get_user_locale(); foreach ( $options as $option ) { if ( $unregistered ) { _deprecated_argument( 'options.php', '2.7.0', sprintf( /* translators: 1: The option/setting, 2: Documentation URL. */ __( 'The %1$s setting is unregistered. Unregistered settings are deprecated. See <a href="%2$s">documentation on the Settings API</a>.' ), '<code>' . esc_html( $option ) . '</code>', __( 'https://developer.wordpress.org/plugins/settings/settings-api/' ) ) ); } $option = trim( $option ); $value = null; if ( isset( $_POST[ $option ] ) ) { $value = $_POST[ $option ]; if ( ! is_array( $value ) ) { $value = trim( $value ); } $value = wp_unslash( $value ); } update_option( $option, $value ); } /* * Switch translation in case WPLANG was changed. * The global $locale is used in get_locale() which is * used as a fallback in get_user_locale(). */ unset( $GLOBALS['locale'] ); $user_language_new = get_user_locale(); if ( $user_language_old !== $user_language_new ) { load_default_textdomain( $user_language_new ); } } else { add_settings_error( 'general', 'settings_updated', __( 'Settings save failed.' ), 'error' ); } /* * Handle settings errors and return to options page. */ // If no settings errors were registered add a general 'updated' message. if ( ! count( get_settings_errors() ) ) { add_settings_error( 'general', 'settings_updated', __( 'Settings saved.' ), 'success' ); } set_transient( 'settings_errors', get_settings_errors(), 30 ); // 30 seconds. // Redirect back to the settings page that was submitted. $goback = add_query_arg( 'settings-updated', 'true', wp_get_referer() ); wp_redirect( $goback ); exit; } require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1><?php esc_html_e( 'All Settings' ); ?></h1> <?php wp_admin_notice( '<strong>' . __( 'Warning:' ) . '</strong> ' . __( 'This page allows direct access to your site settings. You can break things here. Please be cautious!' ), array( 'type' => 'warning', ) ); ?> <form name="form" action="options.php" method="post" id="all-options"> <?php wp_nonce_field( 'options-options' ); ?> <input type="hidden" name="action" value="update" /> <input type="hidden" name="option_page" value="options" /> <table class="form-table" role="presentation"> <?php $options = $wpdb->get_results( "SELECT * FROM $wpdb->options ORDER BY option_name" ); foreach ( (array) $options as $option ) : $disabled = false; if ( '' === $option->option_name ) { continue; } if ( is_serialized( $option->option_value ) ) { if ( is_serialized_string( $option->option_value ) ) { // This is a serialized string, so we should display it. $value = maybe_unserialize( $option->option_value ); $options_to_update[] = $option->option_name; $class = 'all-options'; } else { $value = 'SERIALIZED DATA'; $disabled = true; $class = 'all-options disabled'; } } else { $value = $option->option_value; $options_to_update[] = $option->option_name; $class = 'all-options'; } $name = esc_attr( $option->option_name ); ?> <tr> <th scope="row"><label for="<?php echo $name; ?>"><?php echo esc_html( $option->option_name ); ?></label></th> <td> <?php if ( str_contains( $value, "\n" ) ) : ?> <textarea class="<?php echo $class; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>" cols="30" rows="5"><?php echo esc_textarea( $value ); ?></textarea> <?php else : ?> <input class="regular-text <?php echo $class; ?>" type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr( $value ); ?>"<?php disabled( $disabled, true ); ?> /> <?php endif; ?></td> </tr> <?php endforeach; ?> </table> <input type="hidden" name="page_options" value="<?php echo esc_attr( implode( ',', $options_to_update ) ); ?>" /> <?php submit_button( __( 'Save Changes' ), 'primary', 'Update' ); ?> </form> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; PK x �Z�j~�( ( options-reading.phpnu ��� <?php /** * Reading settings administration panel. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'manage_options' ) ) { wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) ); } // Used in the HTML title tag. $title = __( 'Reading Settings' ); $parent_file = 'options-general.php'; add_action( 'admin_head', 'options_reading_add_js' ); get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'This screen contains the settings that affect the display of your content.' ) . '</p>' . '<p>' . sprintf( /* translators: %s: URL to create a new page. */ __( 'You can choose what’s displayed on the homepage of your site. It can be posts in reverse chronological order (classic blog), or a fixed/static page. To set a static homepage, you first need to create two <a href="%s">Pages</a>. One will become the homepage, and the other will be where your posts are displayed.' ), 'post-new.php?post_type=page' ) . '</p>' . '<p>' . sprintf( /* translators: %s: Documentation URL. */ __( 'You can also control the display of your content in RSS feeds, including the maximum number of posts to display and whether to show full text or an excerpt. <a href="%s">Learn more about feeds</a>.' ), __( 'https://developer.wordpress.org/advanced-administration/wordpress/feeds/' ) ) . '</p>' . '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'site-visibility', 'title' => has_action( 'blog_privacy_selector' ) ? __( 'Site visibility' ) : __( 'Search engine visibility' ), 'content' => '<p>' . __( 'You can choose whether or not your site will be crawled by robots, ping services, and spiders. If you want those services to ignore your site, click the checkbox next to “Discourage search engines from indexing this site” and click the Save Changes button at the bottom of the screen.' ) . '</p>' . '<p>' . __( 'Note that even when set to discourage search engines, your site is still visible on the web and not all search engines adhere to this directive.' ) . '</p>' . '<p>' . __( 'When this setting is in effect, a reminder is shown in the At a Glance box of the Dashboard that says, “Search engines discouraged”, to remind you that you have directed search engines to not crawl your site.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/settings-reading-screen/">Documentation on Reading Settings</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1><?php echo esc_html( $title ); ?></h1> <form method="post" action="options.php"> <?php settings_fields( 'reading' ); if ( ! is_utf8_charset() ) { add_settings_field( 'blog_charset', __( 'Encoding for pages and feeds' ), 'options_reading_blog_charset', 'reading', 'default', array( 'label_for' => 'blog_charset' ) ); } ?> <?php if ( ! get_pages() ) : ?> <input name="show_on_front" type="hidden" value="posts" /> <table class="form-table" role="presentation"> <?php if ( 'posts' !== get_option( 'show_on_front' ) ) : update_option( 'show_on_front', 'posts' ); endif; else : if ( 'page' === get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) ) { update_option( 'show_on_front', 'posts' ); } ?> <table class="form-table" role="presentation"> <tr> <th scope="row"><?php _e( 'Your homepage displays' ); ?></th> <td id="front-static-pages"><fieldset> <legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ _e( 'Your homepage displays' ); ?> </span></legend> <p><label> <input name="show_on_front" type="radio" value="posts" class="tog" <?php checked( 'posts', get_option( 'show_on_front' ) ); ?> /> <?php _e( 'Your latest posts' ); ?> </label> </p> <p><label> <input name="show_on_front" type="radio" value="page" class="tog" <?php checked( 'page', get_option( 'show_on_front' ) ); ?> /> <?php printf( /* translators: %s: URL to Pages screen. */ __( 'A <a href="%s">static page</a> (select below)' ), 'edit.php?post_type=page' ); ?> </label> </p> <ul> <li><label for="page_on_front"> <?php printf( /* translators: %s: Select field to choose the front page. */ __( 'Homepage: %s' ), wp_dropdown_pages( array( 'name' => 'page_on_front', 'echo' => 0, 'show_option_none' => __( '— Select —' ), 'option_none_value' => '0', 'selected' => get_option( 'page_on_front' ), ) ) ); ?> </label></li> <li><label for="page_for_posts"> <?php printf( /* translators: %s: Select field to choose the page for posts. */ __( 'Posts page: %s' ), wp_dropdown_pages( array( 'name' => 'page_for_posts', 'echo' => 0, 'show_option_none' => __( '— Select —' ), 'option_none_value' => '0', 'selected' => get_option( 'page_for_posts' ), ) ) ); ?> </label></li> </ul> <?php if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) === get_option( 'page_on_front' ) ) : wp_admin_notice( __( '<strong>Warning:</strong> these pages should not be the same!' ), array( 'type' => 'warning', 'id' => 'front-page-warning', 'additional_classes' => array( 'inline' ), ) ); endif; if ( get_option( 'wp_page_for_privacy_policy' ) === get_option( 'page_for_posts' ) || get_option( 'wp_page_for_privacy_policy' ) === get_option( 'page_on_front' ) ) : wp_admin_notice( __( '<strong>Warning:</strong> these pages should not be the same as your Privacy Policy page!' ), array( 'type' => 'warning', 'id' => 'privacy-policy-page-warning', 'additional_classes' => array( 'inline' ), ) ); endif; ?> </fieldset></td> </tr> <?php endif; ?> <tr> <th scope="row"><label for="posts_per_page"><?php _e( 'Blog pages show at most' ); ?></label></th> <td> <input name="posts_per_page" type="number" step="1" min="1" id="posts_per_page" value="<?php form_option( 'posts_per_page' ); ?>" class="small-text" /> <?php _e( 'posts' ); ?> </td> </tr> <tr> <th scope="row"><label for="posts_per_rss"><?php _e( 'Syndication feeds show the most recent' ); ?></label></th> <td><input name="posts_per_rss" type="number" step="1" min="1" id="posts_per_rss" value="<?php form_option( 'posts_per_rss' ); ?>" class="small-text" /> <?php _e( 'items' ); ?></td> </tr> <tr> <th scope="row"><?php _e( 'For each post in a feed, include' ); ?> </th> <td><fieldset> <legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ _e( 'For each post in a feed, include' ); ?> </span></legend> <p> <label><input name="rss_use_excerpt" type="radio" value="0" <?php checked( 0, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Full text' ); ?></label><br /> <label><input name="rss_use_excerpt" type="radio" value="1" <?php checked( 1, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Excerpt' ); ?></label> </p> <p class="description"> <?php printf( /* translators: %s: Documentation URL. */ __( 'Your theme determines how content is displayed in browsers. <a href="%s">Learn more about feeds</a>.' ), __( 'https://developer.wordpress.org/advanced-administration/wordpress/feeds/' ) ); ?> </p> </fieldset></td> </tr> <tr class="option-site-visibility"> <th scope="row"><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site visibility' ) : _e( 'Search engine visibility' ); ?> </th> <td><fieldset> <legend class="screen-reader-text"><span> <?php has_action( 'blog_privacy_selector' ) /* translators: Hidden accessibility text. */ ? _e( 'Site visibility' ) /* translators: Hidden accessibility text. */ : _e( 'Search engine visibility' ); ?> </span></legend> <?php if ( has_action( 'blog_privacy_selector' ) ) : ?> <input id="blog-public" type="radio" name="blog_public" value="1" <?php checked( '1', get_option( 'blog_public' ) ); ?> /> <label for="blog-public"><?php _e( 'Allow search engines to index this site' ); ?></label><br /> <input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked( '0', get_option( 'blog_public' ) ); ?> /> <label for="blog-norobots"><?php _e( 'Discourage search engines from indexing this site' ); ?></label> <p class="description"><?php _e( 'Note: Neither of these options blocks access to your site — it is up to search engines to honor your request.' ); ?></p> <?php /** * Enables the legacy 'Site visibility' privacy options. * * By default the privacy options form displays a single checkbox to 'discourage' search * engines from indexing the site. Hooking to this action serves a dual purpose: * * 1. Disable the single checkbox in favor of a multiple-choice list of radio buttons. * 2. Open the door to adding additional radio button choices to the list. * * Hooking to this action also converts the 'Search engine visibility' heading to the more * open-ended 'Site visibility' heading. * * @since 2.1.0 */ do_action( 'blog_privacy_selector' ); ?> <?php else : ?> <label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked( '0', get_option( 'blog_public' ) ); ?> /> <?php _e( 'Discourage search engines from indexing this site' ); ?></label> <p class="description"><?php _e( 'It is up to search engines to honor this request.' ); ?></p> <?php endif; ?> </fieldset></td> </tr> <?php do_settings_fields( 'reading', 'default' ); ?> </table> <?php do_settings_sections( 'reading' ); ?> <?php submit_button(); ?> </form> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?> PK x �Z�7/] export-personal-data.phpnu ��� <?php /** * Privacy tools, Export Personal Data screen. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'export_others_personal_data' ) ) { wp_die( __( 'Sorry, you are not allowed to export personal data on this site.' ) ); } // Used in the HTML title tag. $title = __( 'Export Personal Data' ); // Contextual help - choose Help on the top right of admin panel to preview this. get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'This screen is where you manage requests for an export of personal data.' ) . '</p>' . '<p>' . __( 'Privacy Laws around the world require businesses and online services to provide an export of some of the data they collect about an individual, and to deliver that export on request. The rights those laws enshrine are sometimes called the "Right of Data Portability". It allows individuals to obtain and reuse their personal data for their own purposes across different services. It allows them to move, copy or transfer personal data easily from one IT environment to another.' ) . '</p>' . '<p>' . __( 'The tool associates data stored in WordPress with a supplied email address, including profile data and comments.' ) . '</p>' . '<p><strong>' . __( 'Note: Since this tool only gathers data from WordPress and participating plugins, you may need to do more to comply with export requests. For example, you should also send the requester some of the data collected from or stored with the 3rd party services your organization uses.' ) . '</strong></p>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'default-data', 'title' => __( 'Default Data' ), 'content' => '<p>' . __( 'WordPress collects (but <em>never</em> publishes) a limited amount of data from registered users who have logged in to the site. Generally, these users are people who contribute to the site in some way -- content, store management, and so on. With rare exceptions, these users do not include occasional visitors who might have registered to comment on articles or buy products. The data WordPress retains can include:' ) . '</p>' . '<p>' . __( '<strong>Profile Information</strong> — user email address, username, display name, nickname, first name, last name, description/bio, and registration date.' ) . '</p>' . '<p>' . __( '<strong>Community Events Location</strong> — The IP Address of the user, which populates the Upcoming Community Events dashboard widget with relevant information.' ) . '</p>' . '<p>' . __( '<strong>Session Tokens</strong> — User login information, IP Addresses, Expiration Date, User Agent (Browser/OS), and Last Login.' ) . '</p>' . '<p>' . __( '<strong>Comments</strong> — For user comments, Email Address, IP Address, User Agent (Browser/OS), Date/Time, Comment Content, and Content URL.' ) . '</p>' . '<p>' . __( '<strong>Media</strong> — A list of URLs for media files the user uploads.' ) . '</p>', ) ); $privacy_policy_guide = '<p>' . sprintf( /* translators: %s: URL to Privacy Policy Guide screen. */ __( 'If you are not sure, check the plugin documentation or contact the plugin author to see if the plugin collects data and if it supports the Data Exporter tool. This information may be available in the <a href="%s">Privacy Policy Guide</a>.' ), admin_url( 'options-privacy.php?tab=policyguide' ) ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'plugin-data', 'title' => __( 'Plugin Data' ), 'content' => '<p>' . __( 'Many plugins may collect or store personal data either in the WordPress database or remotely. Any Export Personal Data request should include data from plugins as well.' ) . '</p>' . $privacy_policy_guide . '<p>' . __( 'If you are a plugin author, you can learn more about <a href="https://developer.wordpress.org/plugins/privacy/adding-the-personal-data-exporter-to-your-plugin/">how to add the Personal Data Exporter to a plugin</a>.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/tools-export-personal-data-screen/">Documentation on Export Personal Data</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); // Handle list table actions. _wp_personal_data_handle_actions(); // Cleans up failed and expired requests before displaying the list table. _wp_personal_data_cleanup_requests(); wp_enqueue_script( 'privacy-tools' ); add_screen_option( 'per_page', array( 'default' => 20, 'option' => 'export_personal_data_requests_per_page', ) ); $_list_table_args = array( 'plural' => 'privacy_requests', 'singular' => 'privacy_request', ); $requests_table = _get_list_table( 'WP_Privacy_Data_Export_Requests_List_Table', $_list_table_args ); $requests_table->screen->set_screen_reader_content( array( 'heading_views' => __( 'Filter export personal data list' ), 'heading_pagination' => __( 'Export personal data list navigation' ), 'heading_list' => __( 'Export personal data list' ), ) ); $requests_table->process_bulk_action(); $requests_table->prepare_items(); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap nosubsub"> <h1><?php esc_html_e( 'Export Personal Data' ); ?></h1> <p><?php _e( 'This tool helps site owners comply with local laws and regulations by exporting known data for a given user in a .zip file.' ); ?></p> <hr class="wp-header-end" /> <?php settings_errors(); ?> <form action="<?php echo esc_url( admin_url( 'export-personal-data.php' ) ); ?>" method="post" class="wp-privacy-request-form"> <h2><?php esc_html_e( 'Add Data Export Request' ); ?></h2> <div class="wp-privacy-request-form-field"> <table class="form-table"> <tr> <th scope="row"> <label for="username_or_email_for_privacy_request"><?php esc_html_e( 'Username or email address' ); ?></label> </th> <td> <input type="text" required class="regular-text ltr" id="username_or_email_for_privacy_request" name="username_or_email_for_privacy_request" /> </td> </tr> <tr> <th scope="row"> <?php _e( 'Confirmation email' ); ?> </th> <td> <label for="send_confirmation_email"> <input type="checkbox" name="send_confirmation_email" id="send_confirmation_email" value="1" checked="checked" /> <?php _e( 'Send personal data export confirmation email.' ); ?> </label> </td> </tr> </table> <p class="submit"> <?php submit_button( __( 'Send Request' ), 'secondary', 'submit', false ); ?> </p> </div> <?php wp_nonce_field( 'personal-data-request' ); ?> <input type="hidden" name="action" value="add_export_personal_data_request" /> <input type="hidden" name="type_of_action" value="export_personal_data" /> </form> <hr /> <?php $requests_table->views(); ?> <form class="search-form wp-clearfix"> <?php $requests_table->search_box( __( 'Search Requests' ), 'requests' ); ?> <input type="hidden" name="filter-status" value="<?php echo isset( $_REQUEST['filter-status'] ) ? esc_attr( sanitize_text_field( $_REQUEST['filter-status'] ) ) : ''; ?>" /> <input type="hidden" name="orderby" value="<?php echo isset( $_REQUEST['orderby'] ) ? esc_attr( sanitize_text_field( $_REQUEST['orderby'] ) ) : ''; ?>" /> <input type="hidden" name="order" value="<?php echo isset( $_REQUEST['order'] ) ? esc_attr( sanitize_text_field( $_REQUEST['order'] ) ) : ''; ?>" /> </form> <form method="post"> <?php $requests_table->display(); $requests_table->embed_scripts(); ?> </form> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; PK x �ZA1NI� � admin-post.phpnu ��� <?php /** * WordPress Generic Request (POST/GET) Handler * * Intended for form submission handling in themes and plugins. * * @package WordPress * @subpackage Administration */ /** We are located in WordPress Administration Screens */ if ( ! defined( 'WP_ADMIN' ) ) { define( 'WP_ADMIN', true ); } /** Load WordPress Bootstrap */ require_once dirname( __DIR__ ) . '/wp-load.php'; /** Allow for cross-domain requests (from the front end). */ send_origin_headers(); require_once ABSPATH . 'wp-admin/includes/admin.php'; nocache_headers(); /** This action is documented in wp-admin/admin.php */ do_action( 'admin_init' ); $action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : ''; // Reject invalid parameters. if ( ! is_scalar( $action ) ) { wp_die( '', 400 ); } if ( ! is_user_logged_in() ) { if ( empty( $action ) ) { /** * Fires on a non-authenticated admin post request where no action is supplied. * * @since 2.6.0 */ do_action( 'admin_post_nopriv' ); } else { // If no action is registered, return a Bad Request response. if ( ! has_action( "admin_post_nopriv_{$action}" ) ) { wp_die( '', 400 ); } /** * Fires on a non-authenticated admin post request for the given action. * * The dynamic portion of the hook name, `$action`, refers to the given * request action. * * @since 2.6.0 */ do_action( "admin_post_nopriv_{$action}" ); } } else { if ( empty( $action ) ) { /** * Fires on an authenticated admin post request where no action is supplied. * * @since 2.6.0 */ do_action( 'admin_post' ); } else { // If no action is registered, return a Bad Request response. if ( ! has_action( "admin_post_{$action}" ) ) { wp_die( '', 400 ); } /** * Fires on an authenticated admin post request for the given action. * * The dynamic portion of the hook name, `$action`, refers to the given * request action. * * @since 2.6.0 */ do_action( "admin_post_{$action}" ); } } PK x �Z��E�C �C menu.phpnu ��� <?php /** * Build Administration Menu. * * @package WordPress * @subpackage Administration */ // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } /** * Constructs the admin menu. * * The elements in the array are: * 0: Menu item name. * 1: Minimum level or capability required. * 2: The URL of the item's file. * 3: Page title. * 4: Classes. * 5: ID. * 6: Icon for top level menu. * * @global array $menu */ $menu[2] = array( __( 'Dashboard' ), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' ); $submenu['index.php'][0] = array( __( 'Home' ), 'read', 'index.php' ); if ( is_multisite() ) { $submenu['index.php'][5] = array( __( 'My Sites' ), 'read', 'my-sites.php' ); } if ( ! is_multisite() || current_user_can( 'update_core' ) ) { $update_data = wp_get_update_data(); } if ( ! is_multisite() ) { if ( current_user_can( 'update_core' ) ) { $cap = 'update_core'; } elseif ( current_user_can( 'update_plugins' ) ) { $cap = 'update_plugins'; } elseif ( current_user_can( 'update_themes' ) ) { $cap = 'update_themes'; } else { $cap = 'update_languages'; } $submenu['index.php'][10] = array( sprintf( /* translators: %s: Number of pending updates. */ __( 'Updates %s' ), sprintf( '<span class="update-plugins count-%s"><span class="update-count">%s</span></span>', $update_data['counts']['total'], number_format_i18n( $update_data['counts']['total'] ) ) ), $cap, 'update-core.php', ); unset( $cap ); } $menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' ); // $menu[5] = Posts. $menu[10] = array( __( 'Media' ), 'upload_files', 'upload.php', '', 'menu-top menu-icon-media', 'menu-media', 'dashicons-admin-media' ); $submenu['upload.php'][5] = array( __( 'Library' ), 'upload_files', 'upload.php' ); $submenu['upload.php'][10] = array( __( 'Add Media File' ), 'upload_files', 'media-new.php' ); $i = 15; foreach ( get_taxonomies_for_attachments( 'objects' ) as $tax ) { if ( ! $tax->show_ui || ! $tax->show_in_menu ) { continue; } $submenu['upload.php'][ $i++ ] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name . '&post_type=attachment' ); } unset( $tax, $i ); $menu[15] = array( __( 'Links' ), 'manage_links', 'link-manager.php', '', 'menu-top menu-icon-links', 'menu-links', 'dashicons-admin-links' ); $submenu['link-manager.php'][5] = array( _x( 'All Links', 'admin menu' ), 'manage_links', 'link-manager.php' ); $submenu['link-manager.php'][10] = array( __( 'Add Link' ), 'manage_links', 'link-add.php' ); $submenu['link-manager.php'][15] = array( __( 'Link Categories' ), 'manage_categories', 'edit-tags.php?taxonomy=link_category' ); // $menu[20] = Pages. // Avoid the comment count query for users who cannot edit_posts. if ( current_user_can( 'edit_posts' ) ) { $awaiting_mod = wp_count_comments(); $awaiting_mod = $awaiting_mod->moderated; $awaiting_mod_i18n = number_format_i18n( $awaiting_mod ); /* translators: %s: Number of comments. */ $awaiting_mod_text = sprintf( _n( '%s Comment in moderation', '%s Comments in moderation', $awaiting_mod ), $awaiting_mod_i18n ); $menu[25] = array( /* translators: %s: Number of comments. */ sprintf( __( 'Comments %s' ), '<span class="awaiting-mod count-' . absint( $awaiting_mod ) . '"><span class="pending-count" aria-hidden="true">' . $awaiting_mod_i18n . '</span><span class="comments-in-moderation-text screen-reader-text">' . $awaiting_mod_text . '</span></span>' ), 'edit_posts', 'edit-comments.php', '', 'menu-top menu-icon-comments', 'menu-comments', 'dashicons-admin-comments', ); unset( $awaiting_mod ); } $submenu['edit-comments.php'][0] = array( __( 'All Comments' ), 'edit_posts', 'edit-comments.php' ); $_wp_last_object_menu = 25; // The index of the last top-level menu in the object menu group. $types = (array) get_post_types( array( 'show_ui' => true, '_builtin' => false, 'show_in_menu' => true, ) ); $builtin = array( 'post', 'page' ); foreach ( array_merge( $builtin, $types ) as $ptype ) { $ptype_obj = get_post_type_object( $ptype ); // Check if it should be a submenu. if ( true !== $ptype_obj->show_in_menu ) { continue; } $ptype_menu_position = is_int( $ptype_obj->menu_position ) ? $ptype_obj->menu_position : ++$_wp_last_object_menu; // If we're to use $_wp_last_object_menu, increment it first. $ptype_for_id = sanitize_html_class( $ptype ); $menu_icon = 'dashicons-admin-post'; if ( is_string( $ptype_obj->menu_icon ) ) { // Special handling for an empty div.wp-menu-image, data:image/svg+xml, and Dashicons. if ( 'none' === $ptype_obj->menu_icon || 'div' === $ptype_obj->menu_icon || str_starts_with( $ptype_obj->menu_icon, 'data:image/svg+xml;base64,' ) || str_starts_with( $ptype_obj->menu_icon, 'dashicons-' ) ) { $menu_icon = $ptype_obj->menu_icon; } else { $menu_icon = esc_url( $ptype_obj->menu_icon ); } } elseif ( in_array( $ptype, $builtin, true ) ) { $menu_icon = 'dashicons-admin-' . $ptype; } $menu_class = 'menu-top menu-icon-' . $ptype_for_id; // 'post' special case. if ( 'post' === $ptype ) { $menu_class .= ' open-if-no-js'; $ptype_file = 'edit.php'; $post_new_file = 'post-new.php'; $edit_tags_file = 'edit-tags.php?taxonomy=%s'; } else { $ptype_file = "edit.php?post_type=$ptype"; $post_new_file = "post-new.php?post_type=$ptype"; $edit_tags_file = "edit-tags.php?taxonomy=%s&post_type=$ptype"; } if ( in_array( $ptype, $builtin, true ) ) { $ptype_menu_id = 'menu-' . $ptype_for_id . 's'; } else { $ptype_menu_id = 'menu-posts-' . $ptype_for_id; } /* * If $ptype_menu_position is already populated or will be populated * by a hard-coded value below, increment the position. */ $core_menu_positions = array( 59, 60, 65, 70, 75, 80, 85, 99 ); while ( isset( $menu[ $ptype_menu_position ] ) || in_array( $ptype_menu_position, $core_menu_positions, true ) ) { ++$ptype_menu_position; } $menu[ $ptype_menu_position ] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap->edit_posts, $ptype_file, '', $menu_class, $ptype_menu_id, $menu_icon ); $submenu[ $ptype_file ][5] = array( $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, $ptype_file ); $submenu[ $ptype_file ][10] = array( $ptype_obj->labels->add_new_item, $ptype_obj->cap->create_posts, $post_new_file ); $i = 15; foreach ( get_taxonomies( array(), 'objects' ) as $tax ) { if ( ! $tax->show_ui || ! $tax->show_in_menu || ! in_array( $ptype, (array) $tax->object_type, true ) ) { continue; } $submenu[ $ptype_file ][ $i++ ] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, sprintf( $edit_tags_file, $tax->name ) ); } } unset( $ptype, $ptype_obj, $ptype_for_id, $ptype_menu_position, $menu_icon, $i, $tax, $post_new_file ); $menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' ); $appearance_cap = current_user_can( 'switch_themes' ) ? 'switch_themes' : 'edit_theme_options'; $menu[60] = array( __( 'Appearance' ), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' ); $count = ''; if ( ! is_multisite() && current_user_can( 'update_themes' ) ) { if ( ! isset( $update_data ) ) { $update_data = wp_get_update_data(); } $count = sprintf( '<span class="update-plugins count-%s"><span class="theme-count">%s</span></span>', $update_data['counts']['themes'], number_format_i18n( $update_data['counts']['themes'] ) ); } /* translators: %s: Number of available theme updates. */ $submenu['themes.php'][5] = array( sprintf( __( 'Themes %s' ), $count ), $appearance_cap, 'themes.php' ); if ( wp_is_block_theme() ) { $submenu['themes.php'][6] = array( _x( 'Editor', 'site editor menu item' ), 'edit_theme_options', 'site-editor.php' ); } else { $supports_stylebook = ( current_theme_supports( 'editor-styles' ) || wp_theme_has_theme_json() ); if ( $supports_stylebook ) { $submenu['themes.php'][6] = array( _x( 'Design', 'design menu item' ), 'edit_theme_options', 'site-editor.php' ); } else { $submenu['themes.php'][6] = array( _x( 'Patterns', 'patterns menu item' ), 'edit_theme_options', 'site-editor.php?p=/pattern' ); } } $customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' ); // Hide Customize link on block themes unless a plugin or theme // is using 'customize_register' to add a setting. if ( ! wp_is_block_theme() || has_action( 'customize_register' ) ) { $submenu['themes.php'][7] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' ); } if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) { $submenu['themes.php'][10] = array( __( 'Menus' ), 'edit_theme_options', 'nav-menus.php' ); } if ( current_theme_supports( 'custom-header' ) && current_user_can( 'customize' ) ) { $customize_header_url = add_query_arg( array( 'autofocus' => array( 'control' => 'header_image' ) ), $customize_url ); $submenu['themes.php'][15] = array( _x( 'Header', 'custom image header' ), $appearance_cap, esc_url( $customize_header_url ), '', 'hide-if-no-customize' ); } if ( current_theme_supports( 'custom-background' ) && current_user_can( 'customize' ) ) { $customize_background_url = add_query_arg( array( 'autofocus' => array( 'control' => 'background_image' ) ), $customize_url ); $submenu['themes.php'][20] = array( _x( 'Background', 'custom background' ), $appearance_cap, esc_url( $customize_background_url ), '', 'hide-if-no-customize' ); } unset( $customize_url ); unset( $appearance_cap ); // Add 'Theme File Editor' to the bottom of the Appearance (non-block themes) or Tools (block themes) menu. if ( ! is_multisite() ) { // Must use API on the admin_menu hook, direct modification is only possible on/before the _admin_menu hook. add_action( 'admin_menu', '_add_themes_utility_last', 101 ); } /** * Adds the 'Theme File Editor' menu item to the bottom of the Appearance (non-block themes) * or Tools (block themes) menu. * * @access private * @since 3.0.0 * @since 5.9.0 Renamed 'Theme Editor' to 'Theme File Editor'. * Relocates to Tools for block themes. */ function _add_themes_utility_last() { add_submenu_page( wp_is_block_theme() ? 'tools.php' : 'themes.php', __( 'Theme File Editor' ), __( 'Theme File Editor' ), 'edit_themes', 'theme-editor.php' ); } /** * Adds the 'Plugin File Editor' menu item after the 'Themes File Editor' in Tools * for block themes. * * @access private * @since 5.9.0 */ function _add_plugin_file_editor_to_tools() { if ( ! wp_is_block_theme() ) { return; } add_submenu_page( 'tools.php', __( 'Plugin File Editor' ), __( 'Plugin File Editor' ), 'edit_plugins', 'plugin-editor.php' ); } $count = ''; if ( ! is_multisite() && current_user_can( 'update_plugins' ) ) { if ( ! isset( $update_data ) ) { $update_data = wp_get_update_data(); } $count = sprintf( '<span class="update-plugins count-%s"><span class="plugin-count">%s</span></span>', $update_data['counts']['plugins'], number_format_i18n( $update_data['counts']['plugins'] ) ); } /* translators: %s: Number of available plugin updates. */ $menu[65] = array( sprintf( __( 'Plugins %s' ), $count ), 'activate_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' ); $submenu['plugins.php'][5] = array( __( 'Installed Plugins' ), 'activate_plugins', 'plugins.php' ); if ( ! is_multisite() ) { $submenu['plugins.php'][10] = array( __( 'Add Plugin' ), 'install_plugins', 'plugin-install.php' ); if ( wp_is_block_theme() ) { // Place the menu item below the Theme File Editor menu item. add_action( 'admin_menu', '_add_plugin_file_editor_to_tools', 101 ); } else { $submenu['plugins.php'][15] = array( __( 'Plugin File Editor' ), 'edit_plugins', 'plugin-editor.php' ); } } unset( $update_data ); if ( current_user_can( 'list_users' ) ) { $menu[70] = array( __( 'Users' ), 'list_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' ); } else { $menu[70] = array( __( 'Profile' ), 'read', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' ); } if ( current_user_can( 'list_users' ) ) { $_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php. $submenu['users.php'][5] = array( __( 'All Users' ), 'list_users', 'users.php' ); if ( current_user_can( 'create_users' ) ) { $submenu['users.php'][10] = array( __( 'Add User' ), 'create_users', 'user-new.php' ); } elseif ( is_multisite() ) { $submenu['users.php'][10] = array( __( 'Add User' ), 'promote_users', 'user-new.php' ); } $submenu['users.php'][15] = array( __( 'Profile' ), 'read', 'profile.php' ); } else { $_wp_real_parent_file['users.php'] = 'profile.php'; $submenu['profile.php'][5] = array( __( 'Profile' ), 'read', 'profile.php' ); if ( current_user_can( 'create_users' ) ) { $submenu['profile.php'][10] = array( __( 'Add User' ), 'create_users', 'user-new.php' ); } elseif ( is_multisite() ) { $submenu['profile.php'][10] = array( __( 'Add User' ), 'promote_users', 'user-new.php' ); } } $site_health_count = ''; if ( ! is_multisite() && current_user_can( 'view_site_health_checks' ) ) { $get_issues = get_transient( 'health-check-site-status-result' ); $issue_counts = array(); if ( false !== $get_issues ) { $issue_counts = json_decode( $get_issues, true ); } if ( ! is_array( $issue_counts ) || ! $issue_counts ) { $issue_counts = array( 'good' => 0, 'recommended' => 0, 'critical' => 0, ); } $site_health_count = sprintf( '<span class="menu-counter site-health-counter count-%s"><span class="count">%s</span></span>', $issue_counts['critical'], number_format_i18n( $issue_counts['critical'] ) ); } $menu[75] = array( __( 'Tools' ), 'edit_posts', 'tools.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'dashicons-admin-tools' ); $submenu['tools.php'][5] = array( __( 'Available Tools' ), 'edit_posts', 'tools.php' ); $submenu['tools.php'][10] = array( __( 'Import' ), 'import', 'import.php' ); $submenu['tools.php'][15] = array( __( 'Export' ), 'export', 'export.php' ); /* translators: %s: Number of critical Site Health checks. */ $submenu['tools.php'][20] = array( sprintf( __( 'Site Health %s' ), $site_health_count ), 'view_site_health_checks', 'site-health.php' ); $submenu['tools.php'][25] = array( __( 'Export Personal Data' ), 'export_others_personal_data', 'export-personal-data.php' ); $submenu['tools.php'][30] = array( __( 'Erase Personal Data' ), 'erase_others_personal_data', 'erase-personal-data.php' ); if ( is_multisite() && ! is_main_site() ) { $submenu['tools.php'][35] = array( __( 'Delete Site' ), 'delete_site', 'ms-delete-site.php' ); } if ( ! is_multisite() && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) { $submenu['tools.php'][50] = array( __( 'Network Setup' ), 'setup_network', 'network.php' ); } $menu[80] = array( __( 'Settings' ), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' ); $submenu['options-general.php'][10] = array( _x( 'General', 'settings screen' ), 'manage_options', 'options-general.php' ); $submenu['options-general.php'][15] = array( __( 'Writing' ), 'manage_options', 'options-writing.php' ); $submenu['options-general.php'][20] = array( __( 'Reading' ), 'manage_options', 'options-reading.php' ); $submenu['options-general.php'][25] = array( __( 'Discussion' ), 'manage_options', 'options-discussion.php' ); $submenu['options-general.php'][30] = array( __( 'Media' ), 'manage_options', 'options-media.php' ); $submenu['options-general.php'][40] = array( __( 'Permalinks' ), 'manage_options', 'options-permalink.php' ); $submenu['options-general.php'][45] = array( __( 'Privacy' ), 'manage_privacy_options', 'options-privacy.php' ); $_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group. $menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator' ); // Back-compat for old top-levels. $_wp_real_parent_file['post.php'] = 'edit.php'; $_wp_real_parent_file['post-new.php'] = 'edit.php'; $_wp_real_parent_file['edit-pages.php'] = 'edit.php?post_type=page'; $_wp_real_parent_file['page-new.php'] = 'edit.php?post_type=page'; $_wp_real_parent_file['wpmu-admin.php'] = 'tools.php'; $_wp_real_parent_file['ms-admin.php'] = 'tools.php'; // Ensure backward compatibility. $compat = array( 'index' => 'dashboard', 'edit' => 'posts', 'post' => 'posts', 'upload' => 'media', 'link-manager' => 'links', 'edit-pages' => 'pages', 'page' => 'pages', 'edit-comments' => 'comments', 'options-general' => 'settings', 'themes' => 'appearance', ); require_once ABSPATH . 'wp-admin/includes/menu.php'; PK x �Z��I�� � ms-delete-site.phpnu ��� <?php /** * Multisite delete site panel. * * @package WordPress * @subpackage Multisite * @since 3.0.0 */ require_once __DIR__ . '/admin.php'; if ( ! is_multisite() ) { wp_die( __( 'Multisite support is not enabled.' ) ); } if ( ! current_user_can( 'delete_site' ) ) { wp_die( __( 'Sorry, you are not allowed to delete this site.' ) ); } if ( isset( $_GET['h'] ) && '' !== $_GET['h'] && false !== get_option( 'delete_blog_hash' ) ) { if ( hash_equals( get_option( 'delete_blog_hash' ), $_GET['h'] ) ) { wpmu_delete_blog( get_current_blog_id() ); wp_die( sprintf( /* translators: %s: Network title. */ __( 'Thank you for using %s, your site has been deleted. Happy trails to you until we meet again.' ), get_network()->site_name ) ); } else { wp_die( __( 'Sorry, the link you clicked is stale. Please select another option.' ) ); } } $blog = get_site(); $user = wp_get_current_user(); // Used in the HTML title tag. $title = __( 'Delete Site' ); $parent_file = 'tools.php'; require_once ABSPATH . 'wp-admin/admin-header.php'; echo '<div class="wrap">'; echo '<h1>' . esc_html( $title ) . '</h1>'; if ( isset( $_POST['action'] ) && 'deleteblog' === $_POST['action'] && isset( $_POST['confirmdelete'] ) && '1' === $_POST['confirmdelete'] ) { check_admin_referer( 'delete-blog' ); $hash = wp_generate_password( 20, false ); update_option( 'delete_blog_hash', $hash, false ); $url_delete = esc_url( admin_url( 'ms-delete-site.php?h=' . $hash ) ); $switched_locale = switch_to_locale( get_locale() ); /* translators: Do not translate USERNAME, URL_DELETE, SITENAME, SITEURL: those are placeholders. */ $content = __( "Howdy ###USERNAME###, You recently clicked the 'Delete Site' link on your site and filled in a form on that page. If you really want to delete your site, click the link below. You will not be asked to confirm again so only click this link if you are absolutely certain: ###URL_DELETE### If you delete your site, please consider opening a new site here some time in the future! (But remember that your current site and username are gone forever.) Thank you for using the site, All at ###SITENAME### ###SITEURL###" ); /** * Filters the text for the email sent to the site admin when a request to delete a site in a Multisite network is submitted. * * @since 3.0.0 * * @param string $content The email text. */ $content = apply_filters( 'delete_site_email_content', $content ); $content = str_replace( '###USERNAME###', $user->user_login, $content ); $content = str_replace( '###URL_DELETE###', $url_delete, $content ); $content = str_replace( '###SITENAME###', get_network()->site_name, $content ); $content = str_replace( '###SITEURL###', network_home_url(), $content ); wp_mail( get_option( 'admin_email' ), sprintf( /* translators: %s: Site title. */ __( '[%s] Delete My Site' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), $content ); if ( $switched_locale ) { restore_previous_locale(); } ?> <p><?php _e( 'Thank you. Please check your email for a link to confirm your action. Your site will not be deleted until this link is clicked.' ); ?></p> <?php } else { ?> <p> <?php printf( /* translators: %s: Network title. */ __( 'If you do not want to use your %s site any more, you can delete it using the form below. When you click <strong>Delete My Site Permanently</strong> you will be sent an email with a link in it. Click on this link to delete your site.' ), get_network()->site_name ); ?> </p> <p><?php _e( 'Remember, once deleted your site cannot be restored.' ); ?></p> <form method="post" name="deletedirect"> <?php wp_nonce_field( 'delete-blog' ); ?> <input type="hidden" name="action" value="deleteblog" /> <p><input id="confirmdelete" type="checkbox" name="confirmdelete" value="1" /> <label for="confirmdelete"><strong> <?php printf( /* translators: %s: Site address. */ __( "I'm sure I want to permanently delete my site, and I am aware I can never get it back or use %s again." ), $blog->domain . $blog->path ); ?> </strong></label></p> <?php submit_button( __( 'Delete My Site Permanently' ) ); ?> </form> <?php } echo '</div>'; require_once ABSPATH . 'wp-admin/admin-footer.php'; PK x �Zo~@�K K includes/class-wp-importer.phpnu ��� <?php /** * WP_Importer base class */ #[AllowDynamicProperties] class WP_Importer { /** * Class Constructor */ public function __construct() {} /** * Returns array with imported permalinks from WordPress database. * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $importer_name * @param string $blog_id * @return array */ public function get_imported_posts( $importer_name, $blog_id ) { global $wpdb; $hashtable = array(); $limit = 100; $offset = 0; // Grab all posts in chunks. do { $meta_key = $importer_name . '_' . $blog_id . '_permalink'; $sql = $wpdb->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; } /** * Returns 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; } /** * Sets 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 ( (int) $blog_id === (int) $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; } /** * Sorts by strlen, longest string first. * * @param string $a * @param string $b * @return int */ public function cmpr_strlen( $a, $b ) { return strlen( $b ) - strlen( $a ); } /** * Gets URL. * * @param string $url * @param string $username * @param string $password * @param bool $head * @return array */ public function get_page( $url, $username = '', #[\SensitiveParameter] $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 ); } /** * Bumps up the request timeout for http requests. * * @param int $val * @return int */ public function bump_request_timeout( $val ) { return 60; } /** * Checks 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; } /** * Replaces 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; } PK x �ZFȶ�ײ ײ includes/misc.phpnu ��� <?php /** * Misc WordPress Administration API. * * @package WordPress * @subpackage Administration */ /** * Returns whether the server is running Apache with the mod_rewrite module loaded. * * @since 2.0.0 * * @return bool Whether the server is running Apache with the mod_rewrite module loaded. */ function got_mod_rewrite() { $got_rewrite = apache_mod_loaded( 'mod_rewrite', true ); /** * Filters whether Apache and mod_rewrite are present. * * This filter was previously used to force URL rewriting for other servers, * like nginx. Use the {@see 'got_url_rewrite'} filter in got_url_rewrite() instead. * * @since 2.5.0 * * @see got_url_rewrite() * * @param bool $got_rewrite Whether Apache and mod_rewrite are present. */ return apply_filters( 'got_rewrite', $got_rewrite ); } /** * Returns whether the server supports URL rewriting. * * Detects Apache's mod_rewrite, IIS 7.0+ permalink support, and nginx. * * @since 3.7.0 * * @global bool $is_nginx * @global bool $is_caddy * * @return bool Whether the server supports URL rewriting. */ function got_url_rewrite() { $got_url_rewrite = ( got_mod_rewrite() || $GLOBALS['is_nginx'] || $GLOBALS['is_caddy'] || iis7_supports_permalinks() ); /** * Filters whether URL rewriting is available. * * @since 3.7.0 * * @param bool $got_url_rewrite Whether URL rewriting is available. */ return apply_filters( 'got_url_rewrite', $got_url_rewrite ); } /** * Extracts strings from between the BEGIN and END markers in the .htaccess file. * * @since 1.5.0 * * @param string $filename Filename to extract the strings from. * @param string $marker The marker to extract the strings from. * @return string[] An array of strings from a file (.htaccess) from between BEGIN and END markers. */ function extract_from_markers( $filename, $marker ) { $result = array(); if ( ! file_exists( $filename ) ) { return $result; } $markerdata = explode( "\n", implode( '', file( $filename ) ) ); $state = false; foreach ( $markerdata as $markerline ) { if ( str_contains( $markerline, '# END ' . $marker ) ) { $state = false; } if ( $state ) { if ( str_starts_with( $markerline, '#' ) ) { continue; } $result[] = $markerline; } if ( str_contains( $markerline, '# BEGIN ' . $marker ) ) { $state = true; } } return $result; } /** * Inserts an array of strings into a file (.htaccess), placing it between * BEGIN and END markers. * * Replaces existing marked info. Retains surrounding * data. Creates file if none exists. * * @since 1.5.0 * * @param string $filename Filename to alter. * @param string $marker The marker to alter. * @param array|string $insertion The new content to insert. * @return bool True on write success, false on failure. */ function insert_with_markers( $filename, $marker, $insertion ) { if ( ! file_exists( $filename ) ) { if ( ! is_writable( dirname( $filename ) ) ) { return false; } if ( ! touch( $filename ) ) { return false; } // Make sure the file is created with a minimum set of permissions. $perms = fileperms( $filename ); if ( $perms ) { chmod( $filename, $perms | 0644 ); } } elseif ( ! is_writable( $filename ) ) { return false; } if ( ! is_array( $insertion ) ) { $insertion = explode( "\n", $insertion ); } $switched_locale = switch_to_locale( get_locale() ); $instructions = sprintf( /* translators: 1: Marker. */ __( 'The directives (lines) between "BEGIN %1$s" and "END %1$s" are dynamically generated, and should only be modified via WordPress filters. Any changes to the directives between these markers will be overwritten.' ), $marker ); $instructions = explode( "\n", $instructions ); foreach ( $instructions as $line => $text ) { $instructions[ $line ] = '# ' . $text; } /** * Filters the inline instructions inserted before the dynamically generated content. * * @since 5.3.0 * * @param string[] $instructions Array of lines with inline instructions. * @param string $marker The marker being inserted. */ $instructions = apply_filters( 'insert_with_markers_inline_instructions', $instructions, $marker ); if ( $switched_locale ) { restore_previous_locale(); } $insertion = array_merge( $instructions, $insertion ); $start_marker = "# BEGIN {$marker}"; $end_marker = "# END {$marker}"; $fp = fopen( $filename, 'r+' ); if ( ! $fp ) { return false; } // Attempt to get a lock. If the filesystem supports locking, this will block until the lock is acquired. flock( $fp, LOCK_EX ); $lines = array(); while ( ! feof( $fp ) ) { $lines[] = rtrim( fgets( $fp ), "\r\n" ); } // Split out the existing file into the preceding lines, and those that appear after the marker. $pre_lines = array(); $post_lines = array(); $existing_lines = array(); $found_marker = false; $found_end_marker = false; foreach ( $lines as $line ) { if ( ! $found_marker && str_contains( $line, $start_marker ) ) { $found_marker = true; continue; } elseif ( ! $found_end_marker && str_contains( $line, $end_marker ) ) { $found_end_marker = true; continue; } if ( ! $found_marker ) { $pre_lines[] = $line; } elseif ( $found_marker && $found_end_marker ) { $post_lines[] = $line; } else { $existing_lines[] = $line; } } // Check to see if there was a change. if ( $existing_lines === $insertion ) { flock( $fp, LOCK_UN ); fclose( $fp ); return true; } // Generate the new file data. $new_file_data = implode( "\n", array_merge( $pre_lines, array( $start_marker ), $insertion, array( $end_marker ), $post_lines ) ); // Write to the start of the file, and truncate it to that length. fseek( $fp, 0 ); $bytes = fwrite( $fp, $new_file_data ); if ( $bytes ) { ftruncate( $fp, ftell( $fp ) ); } fflush( $fp ); flock( $fp, LOCK_UN ); fclose( $fp ); return (bool) $bytes; } /** * Updates the htaccess file with the current rules if it is writable. * * Always writes to the file if it exists and is writable to ensure that we * blank out old rules. * * @since 1.5.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @return bool|null True on write success, false on failure. Null in multisite. */ function save_mod_rewrite_rules() { global $wp_rewrite; if ( is_multisite() ) { return; } // Ensure get_home_path() is declared. require_once ABSPATH . 'wp-admin/includes/file.php'; $home_path = get_home_path(); $htaccess_file = $home_path . '.htaccess'; /* * If the file doesn't already exist check for write access to the directory * and whether we have some rules. Else check for write access to the file. */ if ( ! file_exists( $htaccess_file ) && is_writable( $home_path ) && $wp_rewrite->using_mod_rewrite_permalinks() || is_writable( $htaccess_file ) ) { if ( got_mod_rewrite() ) { $rules = explode( "\n", $wp_rewrite->mod_rewrite_rules() ); return insert_with_markers( $htaccess_file, 'WordPress', $rules ); } } return false; } /** * Updates the IIS web.config file with the current rules if it is writable. * If the permalinks do not require rewrite rules then the rules are deleted from the web.config file. * * @since 2.8.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @return bool|null True on write success, false on failure. Null in multisite. */ function iis7_save_url_rewrite_rules() { global $wp_rewrite; if ( is_multisite() ) { return; } // Ensure get_home_path() is declared. require_once ABSPATH . 'wp-admin/includes/file.php'; $home_path = get_home_path(); $web_config_file = $home_path . 'web.config'; // Using win_is_writable() instead of is_writable() because of a bug in Windows PHP. if ( iis7_supports_permalinks() && ( ! file_exists( $web_config_file ) && win_is_writable( $home_path ) && $wp_rewrite->using_mod_rewrite_permalinks() || win_is_writable( $web_config_file ) ) ) { $rule = $wp_rewrite->iis7_url_rewrite_rules( false ); if ( ! empty( $rule ) ) { return iis7_add_rewrite_rule( $web_config_file, $rule ); } else { return iis7_delete_rewrite_rule( $web_config_file ); } } return false; } /** * Updates the "recently-edited" file for the plugin or theme file editor. * * @since 1.5.0 * * @param string $file */ function update_recently_edited( $file ) { $oldfiles = (array) get_option( 'recently_edited' ); if ( $oldfiles ) { $oldfiles = array_reverse( $oldfiles ); $oldfiles[] = $file; $oldfiles = array_reverse( $oldfiles ); $oldfiles = array_unique( $oldfiles ); if ( 5 < count( $oldfiles ) ) { array_pop( $oldfiles ); } } else { $oldfiles[] = $file; } update_option( 'recently_edited', $oldfiles ); } /** * Makes a tree structure for the theme file editor's file list. * * @since 4.9.0 * @access private * * @param array $allowed_files List of theme file paths. * @return array Tree structure for listing theme files. */ function wp_make_theme_file_tree( $allowed_files ) { $tree_list = array(); foreach ( $allowed_files as $file_name => $absolute_filename ) { $list = explode( '/', $file_name ); $last_dir = &$tree_list; foreach ( $list as $dir ) { $last_dir =& $last_dir[ $dir ]; } $last_dir = $file_name; } return $tree_list; } /** * Outputs the formatted file list for the theme file editor. * * @since 4.9.0 * @access private * * @global string $relative_file Name of the file being edited relative to the * theme directory. * @global string $stylesheet The stylesheet name of the theme being edited. * * @param array|string $tree List of file/folder paths, or filename. * @param int $level The aria-level for the current iteration. * @param int $size The aria-setsize for the current iteration. * @param int $index The aria-posinset for the current iteration. */ function wp_print_theme_file_tree( $tree, $level = 2, $size = 1, $index = 1 ) { global $relative_file, $stylesheet; if ( is_array( $tree ) ) { $index = 0; $size = count( $tree ); foreach ( $tree as $label => $theme_file ) : ++$index; if ( ! is_array( $theme_file ) ) { wp_print_theme_file_tree( $theme_file, $level, $index, $size ); continue; } ?> <li role="treeitem" aria-expanded="true" tabindex="-1" aria-level="<?php echo esc_attr( $level ); ?>" aria-setsize="<?php echo esc_attr( $size ); ?>" aria-posinset="<?php echo esc_attr( $index ); ?>"> <span class="folder-label"><?php echo esc_html( $label ); ?> <span class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'folder' ); ?> </span><span aria-hidden="true" class="icon"></span></span> <ul role="group" class="tree-folder"><?php wp_print_theme_file_tree( $theme_file, $level + 1, $index, $size ); ?></ul> </li> <?php endforeach; } else { $filename = $tree; $url = add_query_arg( array( 'file' => rawurlencode( $tree ), 'theme' => rawurlencode( $stylesheet ), ), self_admin_url( 'theme-editor.php' ) ); ?> <li role="none" class="<?php echo esc_attr( $relative_file === $filename ? 'current-file' : '' ); ?>"> <a role="treeitem" tabindex="<?php echo esc_attr( $relative_file === $filename ? '0' : '-1' ); ?>" href="<?php echo esc_url( $url ); ?>" aria-level="<?php echo esc_attr( $level ); ?>" aria-setsize="<?php echo esc_attr( $size ); ?>" aria-posinset="<?php echo esc_attr( $index ); ?>"> <?php $file_description = esc_html( get_file_description( $filename ) ); if ( $file_description !== $filename && wp_basename( $filename ) !== $file_description ) { $file_description .= '<br /><span class="nonessential">(' . esc_html( $filename ) . ')</span>'; } if ( $relative_file === $filename ) { echo '<span class="notice notice-info">' . $file_description . '</span>'; } else { echo $file_description; } ?> </a> </li> <?php } } /** * Makes a tree structure for the plugin file editor's file list. * * @since 4.9.0 * @access private * * @param array $plugin_editable_files List of plugin file paths. * @return array Tree structure for listing plugin files. */ function wp_make_plugin_file_tree( $plugin_editable_files ) { $tree_list = array(); foreach ( $plugin_editable_files as $plugin_file ) { $list = explode( '/', preg_replace( '#^.+?/#', '', $plugin_file ) ); $last_dir = &$tree_list; foreach ( $list as $dir ) { $last_dir =& $last_dir[ $dir ]; } $last_dir = $plugin_file; } return $tree_list; } /** * Outputs the formatted file list for the plugin file editor. * * @since 4.9.0 * @access private * * @param array|string $tree List of file/folder paths, or filename. * @param string $label Name of file or folder to print. * @param int $level The aria-level for the current iteration. * @param int $size The aria-setsize for the current iteration. * @param int $index The aria-posinset for the current iteration. */ function wp_print_plugin_file_tree( $tree, $label = '', $level = 2, $size = 1, $index = 1 ) { global $file, $plugin; if ( is_array( $tree ) ) { $index = 0; $size = count( $tree ); foreach ( $tree as $label => $plugin_file ) : ++$index; if ( ! is_array( $plugin_file ) ) { wp_print_plugin_file_tree( $plugin_file, $label, $level, $index, $size ); continue; } ?> <li role="treeitem" aria-expanded="true" tabindex="-1" aria-level="<?php echo esc_attr( $level ); ?>" aria-setsize="<?php echo esc_attr( $size ); ?>" aria-posinset="<?php echo esc_attr( $index ); ?>"> <span class="folder-label"><?php echo esc_html( $label ); ?> <span class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'folder' ); ?> </span><span aria-hidden="true" class="icon"></span></span> <ul role="group" class="tree-folder"><?php wp_print_plugin_file_tree( $plugin_file, '', $level + 1, $index, $size ); ?></ul> </li> <?php endforeach; } else { $url = add_query_arg( array( 'file' => rawurlencode( $tree ), 'plugin' => rawurlencode( $plugin ), ), self_admin_url( 'plugin-editor.php' ) ); ?> <li role="none" class="<?php echo esc_attr( $file === $tree ? 'current-file' : '' ); ?>"> <a role="treeitem" tabindex="<?php echo esc_attr( $file === $tree ? '0' : '-1' ); ?>" href="<?php echo esc_url( $url ); ?>" aria-level="<?php echo esc_attr( $level ); ?>" aria-setsize="<?php echo esc_attr( $size ); ?>" aria-posinset="<?php echo esc_attr( $index ); ?>"> <?php if ( $file === $tree ) { echo '<span class="notice notice-info">' . esc_html( $label ) . '</span>'; } else { echo esc_html( $label ); } ?> </a> </li> <?php } } /** * Flushes rewrite rules if `siteurl`, `home` or `page_on_front` changed. * * @since 2.1.0 * * @param string $old_value * @param string $value */ function update_home_siteurl( $old_value, $value ) { if ( wp_installing() ) { return; } if ( is_multisite() && ms_is_switched() ) { delete_option( 'rewrite_rules' ); } else { flush_rewrite_rules(); } } /** * Resets global variables based on `$_GET` and `$_POST`. * * This function resets global variables based on the names passed * in the `$vars` array to the value of `$_POST[$var]` or `$_GET[$var]` or an * empty string if neither is defined. * * @since 2.0.0 * * @param array $vars An array of globals to reset. */ function wp_reset_vars( $vars ) { foreach ( $vars as $var ) { if ( empty( $_POST[ $var ] ) ) { if ( empty( $_GET[ $var ] ) ) { $GLOBALS[ $var ] = ''; } else { $GLOBALS[ $var ] = $_GET[ $var ]; } } else { $GLOBALS[ $var ] = $_POST[ $var ]; } } } /** * Displays the given administration message. * * @since 2.1.0 * * @param string|WP_Error $message */ function show_message( $message ) { if ( is_wp_error( $message ) ) { if ( $message->get_error_data() && is_string( $message->get_error_data() ) ) { $message = $message->get_error_message() . ': ' . $message->get_error_data(); } else { $message = $message->get_error_message(); } } echo "<p>$message</p>\n"; wp_ob_end_flush_all(); flush(); } /** * @since 2.8.0 * * @param string $content * @return string[] Array of function names. */ function wp_doc_link_parse( $content ) { if ( ! is_string( $content ) || empty( $content ) ) { return array(); } if ( ! function_exists( 'token_get_all' ) ) { return array(); } $tokens = token_get_all( $content ); $count = count( $tokens ); $functions = array(); $ignore_functions = array(); for ( $t = 0; $t < $count - 2; $t++ ) { if ( ! is_array( $tokens[ $t ] ) ) { continue; } if ( T_STRING === $tokens[ $t ][0] && ( '(' === $tokens[ $t + 1 ] || '(' === $tokens[ $t + 2 ] ) ) { // If it's a function or class defined locally, there's not going to be any docs available. if ( ( isset( $tokens[ $t - 2 ][1] ) && in_array( $tokens[ $t - 2 ][1], array( 'function', 'class' ), true ) ) || ( isset( $tokens[ $t - 2 ][0] ) && T_OBJECT_OPERATOR === $tokens[ $t - 1 ][0] ) ) { $ignore_functions[] = $tokens[ $t ][1]; } // Add this to our stack of unique references. $functions[] = $tokens[ $t ][1]; } } $functions = array_unique( $functions ); sort( $functions ); /** * Filters the list of functions and classes to be ignored from the documentation lookup. * * @since 2.8.0 * * @param string[] $ignore_functions Array of names of functions and classes to be ignored. */ $ignore_functions = apply_filters( 'documentation_ignore_functions', $ignore_functions ); $ignore_functions = array_unique( $ignore_functions ); $output = array(); foreach ( $functions as $function ) { if ( in_array( $function, $ignore_functions, true ) ) { continue; } $output[] = $function; } return $output; } /** * Saves option for number of rows when listing posts, pages, comments, etc. * * @since 2.8.0 */ function set_screen_options() { if ( ! isset( $_POST['wp_screen_options'] ) || ! is_array( $_POST['wp_screen_options'] ) ) { return; } check_admin_referer( 'screen-options-nonce', 'screenoptionnonce' ); $user = wp_get_current_user(); if ( ! $user ) { return; } $option = $_POST['wp_screen_options']['option']; $value = $_POST['wp_screen_options']['value']; if ( sanitize_key( $option ) !== $option ) { return; } $map_option = $option; $type = str_replace( 'edit_', '', $map_option ); $type = str_replace( '_per_page', '', $type ); if ( in_array( $type, get_taxonomies(), true ) ) { $map_option = 'edit_tags_per_page'; } elseif ( in_array( $type, get_post_types(), true ) ) { $map_option = 'edit_per_page'; } else { $option = str_replace( '-', '_', $option ); } switch ( $map_option ) { case 'edit_per_page': case 'users_per_page': case 'edit_comments_per_page': case 'upload_per_page': case 'edit_tags_per_page': case 'plugins_per_page': case 'export_personal_data_requests_per_page': case 'remove_personal_data_requests_per_page': // Network admin. case 'sites_network_per_page': case 'users_network_per_page': case 'site_users_network_per_page': case 'plugins_network_per_page': case 'themes_network_per_page': case 'site_themes_network_per_page': $value = (int) $value; if ( $value < 1 || $value > 999 ) { return; } break; default: $screen_option = false; if ( str_ends_with( $option, '_page' ) || 'layout_columns' === $option ) { /** * Filters a screen option value before it is set. * * The filter can also be used to modify non-standard `[items]_per_page` * settings. See the parent function for a full list of standard options. * * Returning false from the filter will skip saving the current option. * * @since 2.8.0 * @since 5.4.2 Only applied to options ending with '_page', * or the 'layout_columns' option. * * @see set_screen_options() * * @param mixed $screen_option The value to save instead of the option value. * Default false (to skip saving the current option). * @param string $option The option name. * @param int $value The option value. */ $screen_option = apply_filters( 'set-screen-option', $screen_option, $option, $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores } /** * Filters a screen option value before it is set. * * The dynamic portion of the hook name, `$option`, refers to the option name. * * Returning false from the filter will skip saving the current option. * * @since 5.4.2 * * @see set_screen_options() * * @param mixed $screen_option The value to save instead of the option value. * Default false (to skip saving the current option). * @param string $option The option name. * @param int $value The option value. */ $value = apply_filters( "set_screen_option_{$option}", $screen_option, $option, $value ); if ( false === $value ) { return; } break; } update_user_meta( $user->ID, $option, $value ); $url = remove_query_arg( array( 'pagenum', 'apage', 'paged' ), wp_get_referer() ); if ( isset( $_POST['mode'] ) ) { $url = add_query_arg( array( 'mode' => $_POST['mode'] ), $url ); } wp_safe_redirect( $url ); exit; } /** * Checks if rewrite rule for WordPress already exists in the IIS 7+ configuration file. * * @since 2.8.0 * * @param string $filename The file path to the configuration file. * @return bool */ function iis7_rewrite_rule_exists( $filename ) { if ( ! file_exists( $filename ) ) { return false; } if ( ! class_exists( 'DOMDocument', false ) ) { return false; } $doc = new DOMDocument(); if ( $doc->load( $filename ) === false ) { return false; } $xpath = new DOMXPath( $doc ); $rules = $xpath->query( '/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]' ); if ( 0 === $rules->length ) { return false; } return true; } /** * Deletes WordPress rewrite rule from web.config file if it exists there. * * @since 2.8.0 * * @param string $filename Name of the configuration file. * @return bool */ function iis7_delete_rewrite_rule( $filename ) { // If configuration file does not exist then rules also do not exist, so there is nothing to delete. if ( ! file_exists( $filename ) ) { return true; } if ( ! class_exists( 'DOMDocument', false ) ) { return false; } $doc = new DOMDocument(); $doc->preserveWhiteSpace = false; if ( $doc->load( $filename ) === false ) { return false; } $xpath = new DOMXPath( $doc ); $rules = $xpath->query( '/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]' ); if ( $rules->length > 0 ) { $child = $rules->item( 0 ); $parent = $child->parentNode; $parent->removeChild( $child ); $doc->formatOutput = true; saveDomDocument( $doc, $filename ); } return true; } /** * Adds WordPress rewrite rule to the IIS 7+ configuration file. * * @since 2.8.0 * * @param string $filename The file path to the configuration file. * @param string $rewrite_rule The XML fragment with URL Rewrite rule. * @return bool */ function iis7_add_rewrite_rule( $filename, $rewrite_rule ) { if ( ! class_exists( 'DOMDocument', false ) ) { return false; } // If configuration file does not exist then we create one. if ( ! file_exists( $filename ) ) { $fp = fopen( $filename, 'w' ); fwrite( $fp, '<configuration/>' ); fclose( $fp ); } $doc = new DOMDocument(); $doc->preserveWhiteSpace = false; if ( $doc->load( $filename ) === false ) { return false; } $xpath = new DOMXPath( $doc ); // First check if the rule already exists as in that case there is no need to re-add it. $wordpress_rules = $xpath->query( '/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]' ); if ( $wordpress_rules->length > 0 ) { return true; } // Check the XPath to the rewrite rule and create XML nodes if they do not exist. $xml_nodes = $xpath->query( '/configuration/system.webServer/rewrite/rules' ); if ( $xml_nodes->length > 0 ) { $rules_node = $xml_nodes->item( 0 ); } else { $rules_node = $doc->createElement( 'rules' ); $xml_nodes = $xpath->query( '/configuration/system.webServer/rewrite' ); if ( $xml_nodes->length > 0 ) { $rewrite_node = $xml_nodes->item( 0 ); $rewrite_node->appendChild( $rules_node ); } else { $rewrite_node = $doc->createElement( 'rewrite' ); $rewrite_node->appendChild( $rules_node ); $xml_nodes = $xpath->query( '/configuration/system.webServer' ); if ( $xml_nodes->length > 0 ) { $system_web_server_node = $xml_nodes->item( 0 ); $system_web_server_node->appendChild( $rewrite_node ); } else { $system_web_server_node = $doc->createElement( 'system.webServer' ); $system_web_server_node->appendChild( $rewrite_node ); $xml_nodes = $xpath->query( '/configuration' ); if ( $xml_nodes->length > 0 ) { $config_node = $xml_nodes->item( 0 ); $config_node->appendChild( $system_web_server_node ); } else { $config_node = $doc->createElement( 'configuration' ); $doc->appendChild( $config_node ); $config_node->appendChild( $system_web_server_node ); } } } } $rule_fragment = $doc->createDocumentFragment(); $rule_fragment->appendXML( $rewrite_rule ); $rules_node->appendChild( $rule_fragment ); $doc->encoding = 'UTF-8'; $doc->formatOutput = true; saveDomDocument( $doc, $filename ); return true; } /** * Saves the XML document into a file. * * @since 2.8.0 * * @param DOMDocument $doc * @param string $filename */ function saveDomDocument( $doc, $filename ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid $config = $doc->saveXML(); $config = preg_replace( "/([^\r])\n/", "$1\r\n", $config ); $fp = fopen( $filename, 'w' ); fwrite( $fp, $config ); fclose( $fp ); } /** * Displays the default admin color scheme picker (Used in user-edit.php). * * @since 3.0.0 * * @global array $_wp_admin_css_colors * * @param int $user_id User ID. */ function admin_color_scheme_picker( $user_id ) { global $_wp_admin_css_colors; ksort( $_wp_admin_css_colors ); if ( isset( $_wp_admin_css_colors['fresh'] ) ) { // Set Default ('fresh') and Light should go first. $_wp_admin_css_colors = array_filter( array_merge( array( 'fresh' => '', 'light' => '', 'modern' => '', ), $_wp_admin_css_colors ) ); } $current_color = get_user_option( 'admin_color', $user_id ); if ( empty( $current_color ) || ! isset( $_wp_admin_css_colors[ $current_color ] ) ) { $current_color = 'fresh'; } ?> <fieldset id="color-picker" class="scheme-list"> <legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ _e( 'Admin Color Scheme' ); ?> </span></legend> <?php wp_nonce_field( 'save-color-scheme', 'color-nonce', false ); foreach ( $_wp_admin_css_colors as $color => $color_info ) : ?> <div class="color-option <?php echo ( $color === $current_color ) ? 'selected' : ''; ?>"> <input name="admin_color" id="admin_color_<?php echo esc_attr( $color ); ?>" type="radio" value="<?php echo esc_attr( $color ); ?>" class="tog" <?php checked( $color, $current_color ); ?> /> <input type="hidden" class="css_url" value="<?php echo esc_url( $color_info->url ); ?>" /> <input type="hidden" class="icon_colors" value="<?php echo esc_attr( wp_json_encode( array( 'icons' => $color_info->icon_colors ) ) ); ?>" /> <label for="admin_color_<?php echo esc_attr( $color ); ?>"><?php echo esc_html( $color_info->name ); ?></label> <div class="color-palette"> <?php foreach ( $color_info->colors as $html_color ) { ?> <div class="color-palette-shade" style="background-color: <?php echo esc_attr( $html_color ); ?>"> </div> <?php } ?> </div> </div> <?php endforeach; ?> </fieldset> <?php } /** * * @global array $_wp_admin_css_colors */ function wp_color_scheme_settings() { global $_wp_admin_css_colors; $color_scheme = get_user_option( 'admin_color' ); // It's possible to have a color scheme set that is no longer registered. if ( empty( $_wp_admin_css_colors[ $color_scheme ] ) ) { $color_scheme = 'fresh'; } if ( ! empty( $_wp_admin_css_colors[ $color_scheme ]->icon_colors ) ) { $icon_colors = $_wp_admin_css_colors[ $color_scheme ]->icon_colors; } elseif ( ! empty( $_wp_admin_css_colors['fresh']->icon_colors ) ) { $icon_colors = $_wp_admin_css_colors['fresh']->icon_colors; } else { // Fall back to the default set of icon colors if the default scheme is missing. $icon_colors = array( 'base' => '#a7aaad', 'focus' => '#72aee6', 'current' => '#fff', ); } echo '<script type="text/javascript">var _wpColorScheme = ' . wp_json_encode( array( 'icons' => $icon_colors ) ) . ";</script>\n"; } /** * Displays the viewport meta in the admin. * * @since 5.5.0 */ function wp_admin_viewport_meta() { /** * Filters the viewport meta in the admin. * * @since 5.5.0 * * @param string $viewport_meta The viewport meta. */ $viewport_meta = apply_filters( 'admin_viewport_meta', 'width=device-width,initial-scale=1.0' ); if ( empty( $viewport_meta ) ) { return; } echo '<meta name="viewport" content="' . esc_attr( $viewport_meta ) . '">'; } /** * Adds viewport meta for mobile in Customizer. * * Hooked to the {@see 'admin_viewport_meta'} filter. * * @since 5.5.0 * * @param string $viewport_meta The viewport meta. * @return string Filtered viewport meta. */ function _customizer_mobile_viewport_meta( $viewport_meta ) { return trim( $viewport_meta, ',' ) . ',minimum-scale=0.5,maximum-scale=1.2'; } /** * Checks lock status for posts displayed on the Posts screen. * * @since 3.6.0 * * @param array $response The Heartbeat response. * @param array $data The $_POST data sent. * @param string $screen_id The screen ID. * @return array The Heartbeat response. */ function wp_check_locked_posts( $response, $data, $screen_id ) { $checked = array(); if ( array_key_exists( 'wp-check-locked-posts', $data ) && is_array( $data['wp-check-locked-posts'] ) ) { foreach ( $data['wp-check-locked-posts'] as $key ) { $post_id = absint( substr( $key, 5 ) ); if ( ! $post_id ) { continue; } $user_id = wp_check_post_lock( $post_id ); if ( $user_id ) { $user = get_userdata( $user_id ); if ( $user && current_user_can( 'edit_post', $post_id ) ) { $send = array( 'name' => $user->display_name, /* translators: %s: User's display name. */ 'text' => sprintf( __( '%s is currently editing' ), $user->display_name ), ); if ( get_option( 'show_avatars' ) ) { $send['avatar_src'] = get_avatar_url( $user->ID, array( 'size' => 18 ) ); $send['avatar_src_2x'] = get_avatar_url( $user->ID, array( 'size' => 36 ) ); } $checked[ $key ] = $send; } } } } if ( ! empty( $checked ) ) { $response['wp-check-locked-posts'] = $checked; } return $response; } /** * Checks lock status on the New/Edit Post screen and refresh the lock. * * @since 3.6.0 * * @param array $response The Heartbeat response. * @param array $data The $_POST data sent. * @param string $screen_id The screen ID. * @return array The Heartbeat response. */ function wp_refresh_post_lock( $response, $data, $screen_id ) { if ( array_key_exists( 'wp-refresh-post-lock', $data ) ) { $received = $data['wp-refresh-post-lock']; $send = array(); $post_id = absint( $received['post_id'] ); if ( ! $post_id ) { return $response; } if ( ! current_user_can( 'edit_post', $post_id ) ) { return $response; } $user_id = wp_check_post_lock( $post_id ); $user = get_userdata( $user_id ); if ( $user ) { $error = array( 'name' => $user->display_name, /* translators: %s: User's display name. */ 'text' => sprintf( __( '%s has taken over and is currently editing.' ), $user->display_name ), ); if ( get_option( 'show_avatars' ) ) { $error['avatar_src'] = get_avatar_url( $user->ID, array( 'size' => 64 ) ); $error['avatar_src_2x'] = get_avatar_url( $user->ID, array( 'size' => 128 ) ); } $send['lock_error'] = $error; } else { $new_lock = wp_set_post_lock( $post_id ); if ( $new_lock ) { $send['new_lock'] = implode( ':', $new_lock ); } } $response['wp-refresh-post-lock'] = $send; } return $response; } /** * Checks nonce expiration on the New/Edit Post screen and refresh if needed. * * @since 3.6.0 * * @param array $response The Heartbeat response. * @param array $data The $_POST data sent. * @param string $screen_id The screen ID. * @return array The Heartbeat response. */ function wp_refresh_post_nonces( $response, $data, $screen_id ) { if ( array_key_exists( 'wp-refresh-post-nonces', $data ) ) { $received = $data['wp-refresh-post-nonces']; $response['wp-refresh-post-nonces'] = array( 'check' => 1 ); $post_id = absint( $received['post_id'] ); if ( ! $post_id ) { return $response; } if ( ! current_user_can( 'edit_post', $post_id ) ) { return $response; } $response['wp-refresh-post-nonces'] = array( 'replace' => array( 'getpermalinknonce' => wp_create_nonce( 'getpermalink' ), 'samplepermalinknonce' => wp_create_nonce( 'samplepermalink' ), 'closedpostboxesnonce' => wp_create_nonce( 'closedpostboxes' ), '_ajax_linking_nonce' => wp_create_nonce( 'internal-linking' ), '_wpnonce' => wp_create_nonce( 'update-post_' . $post_id ), ), ); } return $response; } /** * Refresh nonces used with meta boxes in the block editor. * * @since 6.1.0 * * @param array $response The Heartbeat response. * @param array $data The $_POST data sent. * @return array The Heartbeat response. */ function wp_refresh_metabox_loader_nonces( $response, $data ) { if ( empty( $data['wp-refresh-metabox-loader-nonces'] ) ) { return $response; } $received = $data['wp-refresh-metabox-loader-nonces']; $post_id = (int) $received['post_id']; if ( ! $post_id ) { return $response; } if ( ! current_user_can( 'edit_post', $post_id ) ) { return $response; } $response['wp-refresh-metabox-loader-nonces'] = array( 'replace' => array( 'metabox_loader_nonce' => wp_create_nonce( 'meta-box-loader' ), '_wpnonce' => wp_create_nonce( 'update-post_' . $post_id ), ), ); return $response; } /** * Adds the latest Heartbeat and REST API nonce to the Heartbeat response. * * @since 5.0.0 * * @param array $response The Heartbeat response. * @return array The Heartbeat response. */ function wp_refresh_heartbeat_nonces( $response ) { // Refresh the Rest API nonce. $response['rest_nonce'] = wp_create_nonce( 'wp_rest' ); // Refresh the Heartbeat nonce. $response['heartbeat_nonce'] = wp_create_nonce( 'heartbeat-nonce' ); return $response; } /** * Disables suspension of Heartbeat on the Add/Edit Post screens. * * @since 3.8.0 * * @global string $pagenow The filename of the current screen. * * @param array $settings An array of Heartbeat settings. * @return array Filtered Heartbeat settings. */ function wp_heartbeat_set_suspension( $settings ) { global $pagenow; if ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) { $settings['suspension'] = 'disable'; } return $settings; } /** * Performs autosave with heartbeat. * * @since 3.9.0 * * @param array $response The Heartbeat response. * @param array $data The $_POST data sent. * @return array The Heartbeat response. */ function heartbeat_autosave( $response, $data ) { if ( ! empty( $data['wp_autosave'] ) ) { $saved = wp_autosave( $data['wp_autosave'] ); if ( is_wp_error( $saved ) ) { $response['wp_autosave'] = array( 'success' => false, 'message' => $saved->get_error_message(), ); } elseif ( empty( $saved ) ) { $response['wp_autosave'] = array( 'success' => false, 'message' => __( 'Error while saving.' ), ); } else { /* translators: Draft saved date format, see https://www.php.net/manual/datetime.format.php */ $draft_saved_date_format = __( 'g:i:s a' ); $response['wp_autosave'] = array( 'success' => true, /* translators: %s: Date and time. */ 'message' => sprintf( __( 'Draft saved at %s.' ), date_i18n( $draft_saved_date_format ) ), ); } } return $response; } /** * Removes single-use URL parameters and create canonical link based on new URL. * * Removes specific query string parameters from a URL, create the canonical link, * put it in the admin header, and change the current URL to match. * * @since 4.2.0 */ function wp_admin_canonical_url() { $removable_query_args = wp_removable_query_args(); if ( empty( $removable_query_args ) ) { return; } // Ensure we're using an absolute URL. $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); $filtered_url = remove_query_arg( $removable_query_args, $current_url ); /** * Filters the admin canonical URL value. * * @since 6.5.0 * * @param string $filtered_url The admin canonical URL value. */ $filtered_url = apply_filters( 'wp_admin_canonical_url', $filtered_url ); ?> <link id="wp-admin-canonical" rel="canonical" href="<?php echo esc_url( $filtered_url ); ?>" /> <script> if ( window.history.replaceState ) { window.history.replaceState( null, null, document.getElementById( 'wp-admin-canonical' ).href + window.location.hash ); } </script> <?php } /** * Outputs JS that reloads the page if the user navigated to it with the Back or Forward button. * * Used on the Edit Post and Add New Post screens. Needed to ensure the page is not loaded from browser cache, * so the post title and editor content are the last saved versions. Ideally this script should run first in the head. * * @since 4.6.0 */ function wp_page_reload_on_back_button_js() { ?> <script> if ( typeof performance !== 'undefined' && performance.navigation && performance.navigation.type === 2 ) { document.location.reload( true ); } </script> <?php } /** * Sends a confirmation request email when a change of site admin email address is attempted. * * The new site admin address will not become active until confirmed. * * @since 3.0.0 * @since 4.9.0 This function was moved from wp-admin/includes/ms.php so it's no longer Multisite specific. * * @param string $old_value The old site admin email address. * @param string $value The proposed new site admin email address. */ function update_option_new_admin_email( $old_value, $value ) { if ( get_option( 'admin_email' ) === $value || ! is_email( $value ) ) { return; } $hash = md5( $value . time() . wp_rand() ); $new_admin_email = array( 'hash' => $hash, 'newemail' => $value, ); update_option( 'adminhash', $new_admin_email, false ); $switched_locale = switch_to_user_locale( get_current_user_id() ); /* translators: Do not translate USERNAME, ADMIN_URL, EMAIL, SITENAME, SITEURL: those are placeholders. */ $email_text = __( 'Howdy, A site administrator (###USERNAME###) recently requested to have the administration email address changed on this site: ###SITEURL### To confirm this change, please click on the following link: ###ADMIN_URL### You can safely ignore and delete this email if you do not want to take this action. This email has been sent to ###EMAIL### Regards, All at ###SITENAME### ###SITEURL###' ); /** * Filters the text of the email sent when a change of site admin email address is attempted. * * The following strings have a special meaning and will get replaced dynamically: * - ###USERNAME### The current user's username. * - ###ADMIN_URL### The link to click on to confirm the email change. * - ###EMAIL### The proposed new site admin email address. * - ###SITENAME### The name of the site. * - ###SITEURL### The URL to the site. * * @since MU (3.0.0) * @since 4.9.0 This filter is no longer Multisite specific. * * @param string $email_text Text in the email. * @param array $new_admin_email { * Data relating to the new site admin email address. * * @type string $hash The secure hash used in the confirmation link URL. * @type string $newemail The proposed new site admin email address. * } */ $content = apply_filters( 'new_admin_email_content', $email_text, $new_admin_email ); $current_user = wp_get_current_user(); $content = str_replace( '###USERNAME###', $current_user->user_login, $content ); $content = str_replace( '###ADMIN_URL###', esc_url( self_admin_url( 'options.php?adminhash=' . $hash ) ), $content ); $content = str_replace( '###EMAIL###', $value, $content ); $content = str_replace( '###SITENAME###', wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), $content ); $content = str_replace( '###SITEURL###', home_url(), $content ); if ( '' !== get_option( 'blogname' ) ) { $site_title = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); } else { $site_title = parse_url( home_url(), PHP_URL_HOST ); } $subject = sprintf( /* translators: New admin email address notification email subject. %s: Site title. */ __( '[%s] New Admin Email Address' ), $site_title ); /** * Filters the subject of the email sent when a change of site admin email address is attempted. * * @since 6.5.0 * * @param string $subject Subject of the email. */ $subject = apply_filters( 'new_admin_email_subject', $subject ); wp_mail( $value, $subject, $content ); if ( $switched_locale ) { restore_previous_locale(); } } /** * Appends '(Draft)' to draft page titles in the privacy page dropdown * so that unpublished content is obvious. * * @since 4.9.8 * @access private * * @param string $title Page title. * @param WP_Post $page Page data object. * @return string Page title. */ function _wp_privacy_settings_filter_draft_page_titles( $title, $page ) { if ( 'draft' === $page->post_status && 'privacy' === get_current_screen()->id ) { /* translators: %s: Page title. */ $title = sprintf( __( '%s (Draft)' ), $title ); } return $title; } /** * Checks if the user needs to update PHP. * * @since 5.1.0 * @since 5.1.1 Added the {@see 'wp_is_php_version_acceptable'} filter. * * @return array|false { * Array of PHP version data. False on failure. * * @type string $recommended_version The PHP version recommended by WordPress. * @type string $minimum_version The minimum required PHP version. * @type bool $is_supported Whether the PHP version is actively supported. * @type bool $is_secure Whether the PHP version receives security updates. * @type bool $is_acceptable Whether the PHP version is still acceptable or warnings * should be shown and an update recommended. * } */ function wp_check_php_version() { $version = PHP_VERSION; $key = md5( $version ); $response = get_site_transient( 'php_check_' . $key ); if ( false === $response ) { $url = 'http://api.wordpress.org/core/serve-happy/1.0/'; if ( wp_http_supports( array( 'ssl' ) ) ) { $url = set_url_scheme( $url, 'https' ); } $url = add_query_arg( 'php_version', $version, $url ); $response = wp_remote_get( $url ); if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { return false; } $response = json_decode( wp_remote_retrieve_body( $response ), true ); if ( ! is_array( $response ) ) { return false; } set_site_transient( 'php_check_' . $key, $response, WEEK_IN_SECONDS ); } if ( isset( $response['is_acceptable'] ) && $response['is_acceptable'] ) { /** * Filters whether the active PHP version is considered acceptable by WordPress. * * Returning false will trigger a PHP version warning to show up in the admin dashboard to administrators. * * This filter is only run if the wordpress.org Serve Happy API considers the PHP version acceptable, ensuring * that this filter can only make this check stricter, but not loosen it. * * @since 5.1.1 * * @param bool $is_acceptable Whether the PHP version is considered acceptable. Default true. * @param string $version PHP version checked. */ $response['is_acceptable'] = (bool) apply_filters( 'wp_is_php_version_acceptable', true, $version ); } $response['is_lower_than_future_minimum'] = false; // The minimum supported PHP version will be updated to 7.4 in the future. Check if the current version is lower. if ( version_compare( $version, '7.4', '<' ) ) { $response['is_lower_than_future_minimum'] = true; // Force showing of warnings. $response['is_acceptable'] = false; } return $response; } PK x �ZuU�E� E� includes/media.phpnu ��� <?php /** * WordPress Administration Media API. * * @package WordPress * @subpackage Administration */ /** * Defines the default media upload tabs. * * @since 2.5.0 * * @return string[] Default tabs. */ function media_upload_tabs() { $_default_tabs = array( 'type' => __( 'From Computer' ), // Handler action suffix => tab text. 'type_url' => __( 'From URL' ), 'gallery' => __( 'Gallery' ), 'library' => __( 'Media Library' ), ); /** * Filters the available tabs in the legacy (pre-3.5.0) media popup. * * @since 2.5.0 * * @param string[] $_default_tabs An array of media tabs. */ return apply_filters( 'media_upload_tabs', $_default_tabs ); } /** * Adds the gallery tab back to the tabs array if post has image attachments. * * @since 2.5.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param array $tabs * @return array $tabs with gallery if post has image attachment */ function update_gallery_tab( $tabs ) { global $wpdb; if ( ! isset( $_REQUEST['post_id'] ) ) { unset( $tabs['gallery'] ); return $tabs; } $post_id = (int) $_REQUEST['post_id']; if ( $post_id ) { $attachments = (int) $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent = %d", $post_id ) ); } if ( empty( $attachments ) ) { unset( $tabs['gallery'] ); return $tabs; } /* translators: %s: Number of attachments. */ $tabs['gallery'] = sprintf( __( 'Gallery (%s)' ), "<span id='attachments-count'>$attachments</span>" ); return $tabs; } /** * Outputs the legacy media upload tabs UI. * * @since 2.5.0 * * @global string $redir_tab */ function the_media_upload_tabs() { global $redir_tab; $tabs = media_upload_tabs(); $default = 'type'; if ( ! empty( $tabs ) ) { echo "<ul id='sidemenu'>\n"; if ( isset( $redir_tab ) && array_key_exists( $redir_tab, $tabs ) ) { $current = $redir_tab; } elseif ( isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $tabs ) ) { $current = $_GET['tab']; } else { /** This filter is documented in wp-admin/media-upload.php */ $current = apply_filters( 'media_upload_default_tab', $default ); } foreach ( $tabs as $callback => $text ) { $class = ''; if ( $current === $callback ) { $class = " class='current'"; } $href = add_query_arg( array( 'tab' => $callback, 's' => false, 'paged' => false, 'post_mime_type' => false, 'm' => false, ) ); $link = "<a href='" . esc_url( $href ) . "'$class>$text</a>"; echo "\t<li id='" . esc_attr( "tab-$callback" ) . "'>$link</li>\n"; } echo "</ul>\n"; } } /** * Retrieves the image HTML to send to the editor. * * @since 2.5.0 * * @param int $id Image attachment ID. * @param string $caption Image caption. * @param string $title Image title attribute. * @param string $align Image CSS alignment property. * @param string $url Optional. Image src URL. Default empty. * @param bool|string $rel Optional. Value for rel attribute or whether to add a default value. Default false. * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of * width and height values in pixels (in that order). Default 'medium'. * @param string $alt Optional. Image alt attribute. Default empty. * @return string The HTML output to insert into the editor. */ function get_image_send_to_editor( $id, $caption, $title, $align, $url = '', $rel = false, $size = 'medium', $alt = '' ) { $html = get_image_tag( $id, $alt, '', $align, $size ); if ( $rel ) { if ( is_string( $rel ) ) { $rel = ' rel="' . esc_attr( $rel ) . '"'; } else { $rel = ' rel="attachment wp-att-' . (int) $id . '"'; } } else { $rel = ''; } if ( $url ) { $html = '<a href="' . esc_url( $url ) . '"' . $rel . '>' . $html . '</a>'; } /** * Filters the image HTML markup to send to the editor when inserting an image. * * @since 2.5.0 * @since 5.6.0 The `$rel` parameter was added. * * @param string $html The image HTML markup to send. * @param int $id The attachment ID. * @param string $caption The image caption. * @param string $title The image title. * @param string $align The image alignment. * @param string $url The image source URL. * @param string|int[] $size Requested image size. Can be any registered image size name, or * an array of width and height values in pixels (in that order). * @param string $alt The image alternative, or alt, text. * @param string $rel The image rel attribute. */ $html = apply_filters( 'image_send_to_editor', $html, $id, $caption, $title, $align, $url, $size, $alt, $rel ); return $html; } /** * Adds image shortcode with caption to editor. * * @since 2.6.0 * * @param string $html The image HTML markup to send. * @param int $id Image attachment ID. * @param string $caption Image caption. * @param string $title Image title attribute (not used). * @param string $align Image CSS alignment property. * @param string $url Image source URL (not used). * @param string $size Image size (not used). * @param string $alt Image `alt` attribute (not used). * @return string The image HTML markup with caption shortcode. */ function image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $alt = '' ) { /** * Filters the caption text. * * Note: If the caption text is empty, the caption shortcode will not be appended * to the image HTML when inserted into the editor. * * Passing an empty value also prevents the {@see 'image_add_caption_shortcode'} * Filters from being evaluated at the end of image_add_caption(). * * @since 4.1.0 * * @param string $caption The original caption text. * @param int $id The attachment ID. */ $caption = apply_filters( 'image_add_caption_text', $caption, $id ); /** * Filters whether to disable captions. * * Prevents image captions from being appended to image HTML when inserted into the editor. * * @since 2.6.0 * * @param bool $bool Whether to disable appending captions. Returning true from the filter * will disable captions. Default empty string. */ if ( empty( $caption ) || apply_filters( 'disable_captions', '' ) ) { return $html; } $id = ( 0 < (int) $id ) ? 'attachment_' . $id : ''; if ( ! preg_match( '/width=["\']([0-9]+)/', $html, $matches ) ) { return $html; } $width = $matches[1]; $caption = str_replace( array( "\r\n", "\r" ), "\n", $caption ); $caption = preg_replace_callback( '/<[a-zA-Z0-9]+(?: [^<>]+>)*/', '_cleanup_image_add_caption', $caption ); // Convert any remaining line breaks to <br />. $caption = preg_replace( '/[ \n\t]*\n[ \t]*/', '<br />', $caption ); $html = preg_replace( '/(class=["\'][^\'"]*)align(none|left|right|center)\s?/', '$1', $html ); if ( empty( $align ) ) { $align = 'none'; } $shcode = '[caption id="' . $id . '" align="align' . $align . '" width="' . $width . '"]' . $html . ' ' . $caption . '[/caption]'; /** * Filters the image HTML markup including the caption shortcode. * * @since 2.6.0 * * @param string $shcode The image HTML markup with caption shortcode. * @param string $html The image HTML markup. */ return apply_filters( 'image_add_caption_shortcode', $shcode, $html ); } /** * Private preg_replace callback used in image_add_caption(). * * @access private * @since 3.4.0 * * @param array $matches Single regex match. * @return string Cleaned up HTML for caption. */ function _cleanup_image_add_caption( $matches ) { // Remove any line breaks from inside the tags. return preg_replace( '/[\r\n\t]+/', ' ', $matches[0] ); } /** * Adds image HTML to editor. * * @since 2.5.0 * * @param string $html */ function media_send_to_editor( $html ) { ?> <script type="text/javascript"> var win = window.dialogArguments || opener || parent || top; win.send_to_editor( <?php echo wp_json_encode( $html ); ?> ); </script> <?php exit; } /** * Saves a file submitted from a POST request and create an attachment post for it. * * @since 2.5.0 * * @param string $file_id Index of the `$_FILES` array that the file was sent. * @param int $post_id The post ID of a post to attach the media item to. Required, but can * be set to 0, creating a media item that has no relationship to a post. * @param array $post_data Optional. Overwrite some of the attachment. * @param array $overrides Optional. Override the wp_handle_upload() behavior. * @return int|WP_Error ID of the attachment or a WP_Error object on failure. */ function media_handle_upload( $file_id, $post_id, $post_data = array(), $overrides = array( 'test_form' => false ) ) { $time = current_time( 'mysql' ); $post = get_post( $post_id ); if ( $post ) { // The post date doesn't usually matter for pages, so don't backdate this upload. if ( 'page' !== $post->post_type && substr( $post->post_date, 0, 4 ) > 0 ) { $time = $post->post_date; } } $file = wp_handle_upload( $_FILES[ $file_id ], $overrides, $time ); if ( isset( $file['error'] ) ) { return new WP_Error( 'upload_error', $file['error'] ); } $name = $_FILES[ $file_id ]['name']; $ext = pathinfo( $name, PATHINFO_EXTENSION ); $name = wp_basename( $name, ".$ext" ); $url = $file['url']; $type = $file['type']; $file = $file['file']; $title = sanitize_text_field( $name ); $content = ''; $excerpt = ''; if ( preg_match( '#^audio#', $type ) ) { $meta = wp_read_audio_metadata( $file ); if ( ! empty( $meta['title'] ) ) { $title = $meta['title']; } if ( ! empty( $title ) ) { if ( ! empty( $meta['album'] ) && ! empty( $meta['artist'] ) ) { /* translators: 1: Audio track title, 2: Album title, 3: Artist name. */ $content .= sprintf( __( '"%1$s" from %2$s by %3$s.' ), $title, $meta['album'], $meta['artist'] ); } elseif ( ! empty( $meta['album'] ) ) { /* translators: 1: Audio track title, 2: Album title. */ $content .= sprintf( __( '"%1$s" from %2$s.' ), $title, $meta['album'] ); } elseif ( ! empty( $meta['artist'] ) ) { /* translators: 1: Audio track title, 2: Artist name. */ $content .= sprintf( __( '"%1$s" by %2$s.' ), $title, $meta['artist'] ); } else { /* translators: %s: Audio track title. */ $content .= sprintf( __( '"%s".' ), $title ); } } elseif ( ! empty( $meta['album'] ) ) { if ( ! empty( $meta['artist'] ) ) { /* translators: 1: Audio album title, 2: Artist name. */ $content .= sprintf( __( '%1$s by %2$s.' ), $meta['album'], $meta['artist'] ); } else { $content .= $meta['album'] . '.'; } } elseif ( ! empty( $meta['artist'] ) ) { $content .= $meta['artist'] . '.'; } if ( ! empty( $meta['year'] ) ) { /* translators: Audio file track information. %d: Year of audio track release. */ $content .= ' ' . sprintf( __( 'Released: %d.' ), $meta['year'] ); } if ( ! empty( $meta['track_number'] ) ) { $track_number = explode( '/', $meta['track_number'] ); if ( is_numeric( $track_number[0] ) ) { if ( isset( $track_number[1] ) && is_numeric( $track_number[1] ) ) { $content .= ' ' . sprintf( /* translators: Audio file track information. 1: Audio track number, 2: Total audio tracks. */ __( 'Track %1$s of %2$s.' ), number_format_i18n( $track_number[0] ), number_format_i18n( $track_number[1] ) ); } else { $content .= ' ' . sprintf( /* translators: Audio file track information. %s: Audio track number. */ __( 'Track %s.' ), number_format_i18n( $track_number[0] ) ); } } } if ( ! empty( $meta['genre'] ) ) { /* translators: Audio file genre information. %s: Audio genre name. */ $content .= ' ' . sprintf( __( 'Genre: %s.' ), $meta['genre'] ); } // Use image exif/iptc data for title and caption defaults if possible. } elseif ( str_starts_with( $type, 'image/' ) ) { $image_meta = wp_read_image_metadata( $file ); if ( $image_meta ) { if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) { $title = $image_meta['title']; } if ( trim( $image_meta['caption'] ) ) { $excerpt = $image_meta['caption']; } } } // Construct the attachment array. $attachment = array_merge( array( 'post_mime_type' => $type, 'guid' => $url, 'post_parent' => $post_id, 'post_title' => $title, 'post_content' => $content, 'post_excerpt' => $excerpt, ), $post_data ); // This should never be set as it would then overwrite an existing attachment. unset( $attachment['ID'] ); // Save the data. $attachment_id = wp_insert_attachment( $attachment, $file, $post_id, true ); if ( ! is_wp_error( $attachment_id ) ) { /* * Set a custom header with the attachment_id. * Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. */ if ( ! headers_sent() ) { header( 'X-WP-Upload-Attachment-ID: ' . $attachment_id ); } /* * The image sub-sizes are created during wp_generate_attachment_metadata(). * This is generally slow and may cause timeouts or out of memory errors. */ wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) ); } return $attachment_id; } /** * Handles a side-loaded file in the same way as an uploaded file is handled by media_handle_upload(). * * @since 2.6.0 * @since 5.3.0 The `$post_id` parameter was made optional. * * @param string[] $file_array Array that represents a `$_FILES` upload array. * @param int $post_id Optional. The post ID the media is associated with. * @param string $desc Optional. Description of the side-loaded file. Default null. * @param array $post_data Optional. Post data to override. Default empty array. * @return int|WP_Error The ID of the attachment or a WP_Error on failure. */ function media_handle_sideload( $file_array, $post_id = 0, $desc = null, $post_data = array() ) { $overrides = array( 'test_form' => false ); if ( isset( $post_data['post_date'] ) && substr( $post_data['post_date'], 0, 4 ) > 0 ) { $time = $post_data['post_date']; } else { $post = get_post( $post_id ); if ( $post && substr( $post->post_date, 0, 4 ) > 0 ) { $time = $post->post_date; } else { $time = current_time( 'mysql' ); } } $file = wp_handle_sideload( $file_array, $overrides, $time ); if ( isset( $file['error'] ) ) { return new WP_Error( 'upload_error', $file['error'] ); } $url = $file['url']; $type = $file['type']; $file = $file['file']; $title = preg_replace( '/\.[^.]+$/', '', wp_basename( $file ) ); $content = ''; // Use image exif/iptc data for title and caption defaults if possible. $image_meta = wp_read_image_metadata( $file ); if ( $image_meta ) { if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) { $title = $image_meta['title']; } if ( trim( $image_meta['caption'] ) ) { $content = $image_meta['caption']; } } if ( isset( $desc ) ) { $title = $desc; } // Construct the attachment array. $attachment = array_merge( array( 'post_mime_type' => $type, 'guid' => $url, 'post_parent' => $post_id, 'post_title' => $title, 'post_content' => $content, ), $post_data ); // This should never be set as it would then overwrite an existing attachment. unset( $attachment['ID'] ); // Save the attachment metadata. $attachment_id = wp_insert_attachment( $attachment, $file, $post_id, true ); if ( ! is_wp_error( $attachment_id ) ) { wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) ); } return $attachment_id; } /** * Outputs the iframe to display the media upload page. * * @since 2.5.0 * @since 5.3.0 Formalized the existing and already documented `...$args` parameter * by adding it to the function signature. * * @global string $body_id * * @param callable $content_func Function that outputs the content. * @param mixed ...$args Optional additional parameters to pass to the callback function when it's called. */ function wp_iframe( $content_func, ...$args ) { global $body_id; _wp_admin_html_begin(); ?> <title><?php bloginfo( 'name' ); ?> › <?php _e( 'Uploads' ); ?> — <?php _e( 'WordPress' ); ?></title> <?php wp_enqueue_style( 'colors' ); // Check callback name for 'media'. if ( ( is_array( $content_func ) && ! empty( $content_func[1] ) && str_starts_with( (string) $content_func[1], 'media' ) ) || ( ! is_array( $content_func ) && str_starts_with( $content_func, 'media' ) ) ) { wp_enqueue_style( 'deprecated-media' ); } ?> <script type="text/javascript"> addLoadEvent = function(func){if(typeof jQuery!=='undefined')jQuery(function(){func();});else if(typeof wpOnload!=='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup', isRtl = <?php echo (int) is_rtl(); ?>; </script> <?php /** This action is documented in wp-admin/admin-header.php */ do_action( 'admin_enqueue_scripts', 'media-upload-popup' ); /** * Fires when admin styles enqueued for the legacy (pre-3.5.0) media upload popup are printed. * * @since 2.9.0 */ do_action( 'admin_print_styles-media-upload-popup' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores /** This action is documented in wp-admin/admin-header.php */ do_action( 'admin_print_styles' ); /** * Fires when admin scripts enqueued for the legacy (pre-3.5.0) media upload popup are printed. * * @since 2.9.0 */ do_action( 'admin_print_scripts-media-upload-popup' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores /** This action is documented in wp-admin/admin-header.php */ do_action( 'admin_print_scripts' ); /** * Fires when scripts enqueued for the admin header for the legacy (pre-3.5.0) * media upload popup are printed. * * @since 2.9.0 */ do_action( 'admin_head-media-upload-popup' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores /** This action is documented in wp-admin/admin-header.php */ do_action( 'admin_head' ); if ( is_string( $content_func ) ) { /** * Fires in the admin header for each specific form tab in the legacy * (pre-3.5.0) media upload popup. * * The dynamic portion of the hook name, `$content_func`, refers to the form * callback for the media upload type. * * @since 2.5.0 */ do_action( "admin_head_{$content_func}" ); } $body_id_attr = ''; if ( isset( $body_id ) ) { $body_id_attr = ' id="' . $body_id . '"'; } ?> </head> <body<?php echo $body_id_attr; ?> class="wp-core-ui no-js"> <script type="text/javascript"> document.body.className = document.body.className.replace('no-js', 'js'); </script> <?php call_user_func_array( $content_func, $args ); /** This action is documented in wp-admin/admin-footer.php */ do_action( 'admin_print_footer_scripts' ); ?> <script type="text/javascript">if(typeof wpOnload==='function')wpOnload();</script> </body> </html> <?php } /** * Adds the media button to the editor. * * @since 2.5.0 * * @global int $post_ID * * @param string $editor_id */ function media_buttons( $editor_id = 'content' ) { static $instance = 0; ++$instance; $post = get_post(); if ( ! $post && ! empty( $GLOBALS['post_ID'] ) ) { $post = $GLOBALS['post_ID']; } wp_enqueue_media( array( 'post' => $post ) ); $img = '<span class="wp-media-buttons-icon"></span> '; $id_attribute = 1 === $instance ? ' id="insert-media-button"' : ''; printf( '<button type="button"%s class="button insert-media add_media" data-editor="%s">%s</button>', $id_attribute, esc_attr( $editor_id ), $img . __( 'Add Media' ) ); /** * Filters the legacy (pre-3.5.0) media buttons. * * Use {@see 'media_buttons'} action instead. * * @since 2.5.0 * @deprecated 3.5.0 Use {@see 'media_buttons'} action instead. * * @param string $string Media buttons context. Default empty. */ $legacy_filter = apply_filters_deprecated( 'media_buttons_context', array( '' ), '3.5.0', 'media_buttons' ); if ( $legacy_filter ) { // #WP22559. Close <a> if a plugin started by closing <a> to open their own <a> tag. if ( 0 === stripos( trim( $legacy_filter ), '</a>' ) ) { $legacy_filter .= '</a>'; } echo $legacy_filter; } } /** * Retrieves the upload iframe source URL. * * @since 3.0.0 * * @global int $post_ID * * @param string $type Media type. * @param int $post_id Post ID. * @param string $tab Media upload tab. * @return string Upload iframe source URL. */ function get_upload_iframe_src( $type = null, $post_id = null, $tab = null ) { global $post_ID; if ( empty( $post_id ) ) { $post_id = $post_ID; } $upload_iframe_src = add_query_arg( 'post_id', (int) $post_id, admin_url( 'media-upload.php' ) ); if ( $type && 'media' !== $type ) { $upload_iframe_src = add_query_arg( 'type', $type, $upload_iframe_src ); } if ( ! empty( $tab ) ) { $upload_iframe_src = add_query_arg( 'tab', $tab, $upload_iframe_src ); } /** * Filters the upload iframe source URL for a specific media type. * * The dynamic portion of the hook name, `$type`, refers to the type * of media uploaded. * * Possible hook names include: * * - `image_upload_iframe_src` * - `media_upload_iframe_src` * * @since 3.0.0 * * @param string $upload_iframe_src The upload iframe source URL. */ $upload_iframe_src = apply_filters( "{$type}_upload_iframe_src", $upload_iframe_src ); return add_query_arg( 'TB_iframe', true, $upload_iframe_src ); } /** * Handles form submissions for the legacy media uploader. * * @since 2.5.0 * * @return null|array|void Array of error messages keyed by attachment ID, null or void on success. */ function media_upload_form_handler() { check_admin_referer( 'media-form' ); $errors = null; if ( isset( $_POST['send'] ) ) { $keys = array_keys( $_POST['send'] ); $send_id = (int) reset( $keys ); } if ( ! empty( $_POST['attachments'] ) ) { foreach ( $_POST['attachments'] as $attachment_id => $attachment ) { $post = get_post( $attachment_id, ARRAY_A ); $_post = $post; if ( ! current_user_can( 'edit_post', $attachment_id ) ) { continue; } if ( isset( $attachment['post_content'] ) ) { $post['post_content'] = $attachment['post_content']; } if ( isset( $attachment['post_title'] ) ) { $post['post_title'] = $attachment['post_title']; } if ( isset( $attachment['post_excerpt'] ) ) { $post['post_excerpt'] = $attachment['post_excerpt']; } if ( isset( $attachment['menu_order'] ) ) { $post['menu_order'] = $attachment['menu_order']; } if ( isset( $send_id ) && $attachment_id === $send_id ) { if ( isset( $attachment['post_parent'] ) ) { $post['post_parent'] = $attachment['post_parent']; } } /** * Filters the attachment fields to be saved. * * @since 2.5.0 * * @see wp_get_attachment_metadata() * * @param array $post An array of post data. * @param array $attachment An array of attachment metadata. */ $post = apply_filters( 'attachment_fields_to_save', $post, $attachment ); if ( isset( $attachment['image_alt'] ) ) { $image_alt = wp_unslash( $attachment['image_alt'] ); if ( get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ) !== $image_alt ) { $image_alt = wp_strip_all_tags( $image_alt, true ); // update_post_meta() expects slashed. update_post_meta( $attachment_id, '_wp_attachment_image_alt', wp_slash( $image_alt ) ); } } if ( isset( $post['errors'] ) ) { $errors[ $attachment_id ] = $post['errors']; unset( $post['errors'] ); } if ( $post != $_post ) { wp_update_post( $post ); } foreach ( get_attachment_taxonomies( $post ) as $t ) { if ( isset( $attachment[ $t ] ) ) { wp_set_object_terms( $attachment_id, array_map( 'trim', preg_split( '/,+/', $attachment[ $t ] ) ), $t, false ); } } } } if ( isset( $_POST['insert-gallery'] ) || isset( $_POST['update-gallery'] ) ) { ?> <script type="text/javascript"> var win = window.dialogArguments || opener || parent || top; win.tb_remove(); </script> <?php exit; } if ( isset( $send_id ) ) { $attachment = wp_unslash( $_POST['attachments'][ $send_id ] ); $html = isset( $attachment['post_title'] ) ? $attachment['post_title'] : ''; if ( ! empty( $attachment['url'] ) ) { $rel = ''; if ( str_contains( $attachment['url'], 'attachment_id' ) || get_attachment_link( $send_id ) === $attachment['url'] ) { $rel = " rel='attachment wp-att-" . esc_attr( $send_id ) . "'"; } $html = "<a href='{$attachment['url']}'$rel>$html</a>"; } /** * Filters the HTML markup for a media item sent to the editor. * * @since 2.5.0 * * @see wp_get_attachment_metadata() * * @param string $html HTML markup for a media item sent to the editor. * @param int $send_id The first key from the $_POST['send'] data. * @param array $attachment Array of attachment metadata. */ $html = apply_filters( 'media_send_to_editor', $html, $send_id, $attachment ); return media_send_to_editor( $html ); } return $errors; } /** * Handles the process of uploading media. * * @since 2.5.0 * * @return null|string */ function wp_media_upload_handler() { $errors = array(); $id = 0; if ( isset( $_POST['html-upload'] ) && ! empty( $_FILES ) ) { check_admin_referer( 'media-form' ); // Upload File button was clicked. $id = media_handle_upload( 'async-upload', $_REQUEST['post_id'] ); unset( $_FILES ); if ( is_wp_error( $id ) ) { $errors['upload_error'] = $id; $id = false; } } if ( ! empty( $_POST['insertonlybutton'] ) ) { $src = $_POST['src']; if ( ! empty( $src ) && ! strpos( $src, '://' ) ) { $src = "http://$src"; } if ( isset( $_POST['media_type'] ) && 'image' !== $_POST['media_type'] ) { $title = esc_html( wp_unslash( $_POST['title'] ) ); if ( empty( $title ) ) { $title = esc_html( wp_basename( $src ) ); } if ( $title && $src ) { $html = "<a href='" . esc_url( $src ) . "'>$title</a>"; } $type = 'file'; $ext = preg_replace( '/^.+?\.([^.]+)$/', '$1', $src ); if ( $ext ) { $ext_type = wp_ext2type( $ext ); if ( 'audio' === $ext_type || 'video' === $ext_type ) { $type = $ext_type; } } /** * Filters the URL sent to the editor for a specific media type. * * The dynamic portion of the hook name, `$type`, refers to the type * of media being sent. * * Possible hook names include: * * - `audio_send_to_editor_url` * - `file_send_to_editor_url` * - `video_send_to_editor_url` * * @since 3.3.0 * * @param string $html HTML markup sent to the editor. * @param string $src Media source URL. * @param string $title Media title. */ $html = apply_filters( "{$type}_send_to_editor_url", $html, sanitize_url( $src ), $title ); } else { $align = ''; $alt = esc_attr( wp_unslash( $_POST['alt'] ) ); if ( isset( $_POST['align'] ) ) { $align = esc_attr( wp_unslash( $_POST['align'] ) ); $class = " class='align$align'"; } if ( ! empty( $src ) ) { $html = "<img src='" . esc_url( $src ) . "' alt='$alt'$class />"; } /** * Filters the image URL sent to the editor. * * @since 2.8.0 * * @param string $html HTML markup sent to the editor for an image. * @param string $src Image source URL. * @param string $alt Image alternate, or alt, text. * @param string $align The image alignment. Default 'alignnone'. Possible values include * 'alignleft', 'aligncenter', 'alignright', 'alignnone'. */ $html = apply_filters( 'image_send_to_editor_url', $html, sanitize_url( $src ), $alt, $align ); } return media_send_to_editor( $html ); } if ( isset( $_POST['save'] ) ) { $errors['upload_notice'] = __( 'Saved.' ); wp_enqueue_script( 'admin-gallery' ); return wp_iframe( 'media_upload_gallery_form', $errors ); } elseif ( ! empty( $_POST ) ) { $return = media_upload_form_handler(); if ( is_string( $return ) ) { return $return; } if ( is_array( $return ) ) { $errors = $return; } } if ( isset( $_GET['tab'] ) && 'type_url' === $_GET['tab'] ) { $type = 'image'; if ( isset( $_GET['type'] ) && in_array( $_GET['type'], array( 'video', 'audio', 'file' ), true ) ) { $type = $_GET['type']; } return wp_iframe( 'media_upload_type_url_form', $type, $errors, $id ); } return wp_iframe( 'media_upload_type_form', 'image', $errors, $id ); } /** * Downloads an image from the specified URL, saves it as an attachment, and optionally attaches it to a post. * * @since 2.6.0 * @since 4.2.0 Introduced the `$return_type` parameter. * @since 4.8.0 Introduced the 'id' option for the `$return_type` parameter. * @since 5.3.0 The `$post_id` parameter was made optional. * @since 5.4.0 The original URL of the attachment is stored in the `_source_url` * post meta value. * @since 5.8.0 Added 'webp' to the default list of allowed file extensions. * * @param string $file The URL of the image to download. * @param int $post_id Optional. The post ID the media is to be associated with. * @param string $desc Optional. Description of the image. * @param string $return_type Optional. Accepts 'html' (image tag html) or 'src' (URL), * or 'id' (attachment ID). Default 'html'. * @return string|int|WP_Error Populated HTML img tag, attachment ID, or attachment source * on success, WP_Error object otherwise. */ function media_sideload_image( $file, $post_id = 0, $desc = null, $return_type = 'html' ) { if ( ! empty( $file ) ) { $allowed_extensions = array( 'jpg', 'jpeg', 'jpe', 'png', 'gif', 'webp' ); /** * Filters the list of allowed file extensions when sideloading an image from a URL. * * The default allowed extensions are: * * - `jpg` * - `jpeg` * - `jpe` * - `png` * - `gif` * - `webp` * * @since 5.6.0 * @since 5.8.0 Added 'webp' to the default list of allowed file extensions. * * @param string[] $allowed_extensions Array of allowed file extensions. * @param string $file The URL of the image to download. */ $allowed_extensions = apply_filters( 'image_sideload_extensions', $allowed_extensions, $file ); $allowed_extensions = array_map( 'preg_quote', $allowed_extensions ); // Set variables for storage, fix file filename for query strings. preg_match( '/[^\?]+\.(' . implode( '|', $allowed_extensions ) . ')\b/i', $file, $matches ); if ( ! $matches ) { return new WP_Error( 'image_sideload_failed', __( 'Invalid image URL.' ) ); } $file_array = array(); $file_array['name'] = wp_basename( $matches[0] ); // Download file to temp location. $file_array['tmp_name'] = download_url( $file ); // If error storing temporarily, return the error. if ( is_wp_error( $file_array['tmp_name'] ) ) { return $file_array['tmp_name']; } // Do the validation and storage stuff. $id = media_handle_sideload( $file_array, $post_id, $desc ); // If error storing permanently, unlink. if ( is_wp_error( $id ) ) { @unlink( $file_array['tmp_name'] ); return $id; } // Store the original attachment source in meta. add_post_meta( $id, '_source_url', $file ); // If attachment ID was requested, return it. if ( 'id' === $return_type ) { return $id; } $src = wp_get_attachment_url( $id ); } // Finally, check to make sure the file has been saved, then return the HTML. if ( ! empty( $src ) ) { if ( 'src' === $return_type ) { return $src; } $alt = isset( $desc ) ? esc_attr( $desc ) : ''; $html = "<img src='$src' alt='$alt' />"; return $html; } else { return new WP_Error( 'image_sideload_failed' ); } } /** * Retrieves the legacy media uploader form in an iframe. * * @since 2.5.0 * * @return string|null */ function media_upload_gallery() { $errors = array(); if ( ! empty( $_POST ) ) { $return = media_upload_form_handler(); if ( is_string( $return ) ) { return $return; } if ( is_array( $return ) ) { $errors = $return; } } wp_enqueue_script( 'admin-gallery' ); return wp_iframe( 'media_upload_gallery_form', $errors ); } /** * Retrieves the legacy media library form in an iframe. * * @since 2.5.0 * * @return string|null */ function media_upload_library() { $errors = array(); if ( ! empty( $_POST ) ) { $return = media_upload_form_handler(); if ( is_string( $return ) ) { return $return; } if ( is_array( $return ) ) { $errors = $return; } } return wp_iframe( 'media_upload_library_form', $errors ); } /** * Retrieves HTML for the image alignment radio buttons with the specified one checked. * * @since 2.7.0 * * @param WP_Post $post * @param string $checked * @return string */ function image_align_input_fields( $post, $checked = '' ) { if ( empty( $checked ) ) { $checked = get_user_setting( 'align', 'none' ); } $alignments = array( 'none' => __( 'None' ), 'left' => __( 'Left' ), 'center' => __( 'Center' ), 'right' => __( 'Right' ), ); if ( ! array_key_exists( (string) $checked, $alignments ) ) { $checked = 'none'; } $output = array(); foreach ( $alignments as $name => $label ) { $name = esc_attr( $name ); $output[] = "<input type='radio' name='attachments[{$post->ID}][align]' id='image-align-{$name}-{$post->ID}' value='$name'" . ( $checked === $name ? " checked='checked'" : '' ) . " /><label for='image-align-{$name}-{$post->ID}' class='align image-align-{$name}-label'>$label</label>"; } return implode( "\n", $output ); } /** * Retrieves HTML for the size radio buttons with the specified one checked. * * @since 2.7.0 * * @param WP_Post $post * @param bool|string $check * @return array */ function image_size_input_fields( $post, $check = '' ) { /** * Filters the names and labels of the default image sizes. * * @since 3.3.0 * * @param string[] $size_names Array of image size labels keyed by their name. Default values * include 'Thumbnail', 'Medium', 'Large', and 'Full Size'. */ $size_names = apply_filters( 'image_size_names_choose', array( 'thumbnail' => __( 'Thumbnail' ), 'medium' => __( 'Medium' ), 'large' => __( 'Large' ), 'full' => __( 'Full Size' ), ) ); if ( empty( $check ) ) { $check = get_user_setting( 'imgsize', 'medium' ); } $output = array(); foreach ( $size_names as $size => $label ) { $downsize = image_downsize( $post->ID, $size ); $checked = ''; // Is this size selectable? $enabled = ( $downsize[3] || 'full' === $size ); $css_id = "image-size-{$size}-{$post->ID}"; // If this size is the default but that's not available, don't select it. if ( $size === $check ) { if ( $enabled ) { $checked = " checked='checked'"; } else { $check = ''; } } elseif ( ! $check && $enabled && 'thumbnail' !== $size ) { /* * If $check is not enabled, default to the first available size * that's bigger than a thumbnail. */ $check = $size; $checked = " checked='checked'"; } $html = "<div class='image-size-item'><input type='radio' " . disabled( $enabled, false, false ) . "name='attachments[$post->ID][image-size]' id='{$css_id}' value='{$size}'$checked />"; $html .= "<label for='{$css_id}'>$label</label>"; // Only show the dimensions if that choice is available. if ( $enabled ) { $html .= " <label for='{$css_id}' class='help'>" . sprintf( '(%d × %d)', $downsize[1], $downsize[2] ) . '</label>'; } $html .= '</div>'; $output[] = $html; } return array( 'label' => __( 'Size' ), 'input' => 'html', 'html' => implode( "\n", $output ), ); } /** * Retrieves HTML for the Link URL buttons with the default link type as specified. * * @since 2.7.0 * * @param WP_Post $post * @param string $url_type * @return string */ function image_link_input_fields( $post, $url_type = '' ) { $file = wp_get_attachment_url( $post->ID ); $link = get_attachment_link( $post->ID ); if ( empty( $url_type ) ) { $url_type = get_user_setting( 'urlbutton', 'post' ); } $url = ''; if ( 'file' === $url_type ) { $url = $file; } elseif ( 'post' === $url_type ) { $url = $link; } return " <input type='text' class='text urlfield' name='attachments[$post->ID][url]' value='" . esc_attr( $url ) . "' /><br /> <button type='button' class='button urlnone' data-link-url=''>" . __( 'None' ) . "</button> <button type='button' class='button urlfile' data-link-url='" . esc_url( $file ) . "'>" . __( 'File URL' ) . "</button> <button type='button' class='button urlpost' data-link-url='" . esc_url( $link ) . "'>" . __( 'Attachment Post URL' ) . '</button> '; } /** * Outputs a textarea element for inputting an attachment caption. * * @since 3.4.0 * * @param WP_Post $edit_post Attachment WP_Post object. * @return string HTML markup for the textarea element. */ function wp_caption_input_textarea( $edit_post ) { // Post data is already escaped. $name = "attachments[{$edit_post->ID}][post_excerpt]"; return '<textarea name="' . $name . '" id="' . $name . '">' . $edit_post->post_excerpt . '</textarea>'; } /** * Retrieves the image attachment fields to edit form fields. * * @since 2.5.0 * * @param array $form_fields * @param object $post * @return array */ function image_attachment_fields_to_edit( $form_fields, $post ) { return $form_fields; } /** * Retrieves the single non-image attachment fields to edit form fields. * * @since 2.5.0 * * @param array $form_fields An array of attachment form fields. * @param WP_Post $post The WP_Post attachment object. * @return array Filtered attachment form fields. */ function media_single_attachment_fields_to_edit( $form_fields, $post ) { unset( $form_fields['url'], $form_fields['align'], $form_fields['image-size'] ); return $form_fields; } /** * Retrieves the post non-image attachment fields to edit form fields. * * @since 2.8.0 * * @param array $form_fields An array of attachment form fields. * @param WP_Post $post The WP_Post attachment object. * @return array Filtered attachment form fields. */ function media_post_single_attachment_fields_to_edit( $form_fields, $post ) { unset( $form_fields['image_url'] ); return $form_fields; } /** * Retrieves the media element HTML to send to the editor. * * @since 2.5.0 * * @param string $html * @param int $attachment_id * @param array $attachment * @return string */ function image_media_send_to_editor( $html, $attachment_id, $attachment ) { $post = get_post( $attachment_id ); if ( str_starts_with( $post->post_mime_type, 'image' ) ) { $url = $attachment['url']; $align = ! empty( $attachment['align'] ) ? $attachment['align'] : 'none'; $size = ! empty( $attachment['image-size'] ) ? $attachment['image-size'] : 'medium'; $alt = ! empty( $attachment['image_alt'] ) ? $attachment['image_alt'] : ''; $rel = ( str_contains( $url, 'attachment_id' ) || get_attachment_link( $attachment_id ) === $url ); return get_image_send_to_editor( $attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, $rel, $size, $alt ); } return $html; } /** * Retrieves the attachment fields to edit form fields. * * @since 2.5.0 * * @param WP_Post $post * @param array $errors * @return array */ function get_attachment_fields_to_edit( $post, $errors = null ) { if ( is_int( $post ) ) { $post = get_post( $post ); } if ( is_array( $post ) ) { $post = new WP_Post( (object) $post ); } $image_url = wp_get_attachment_url( $post->ID ); $edit_post = sanitize_post( $post, 'edit' ); $form_fields = array( 'post_title' => array( 'label' => __( 'Title' ), 'value' => $edit_post->post_title, ), 'image_alt' => array(), 'post_excerpt' => array( 'label' => __( 'Caption' ), 'input' => 'html', 'html' => wp_caption_input_textarea( $edit_post ), ), 'post_content' => array( 'label' => __( 'Description' ), 'value' => $edit_post->post_content, 'input' => 'textarea', ), 'url' => array( 'label' => __( 'Link URL' ), 'input' => 'html', 'html' => image_link_input_fields( $post, get_option( 'image_default_link_type' ) ), 'helps' => __( 'Enter a link URL or click above for presets.' ), ), 'menu_order' => array( 'label' => __( 'Order' ), 'value' => $edit_post->menu_order, ), 'image_url' => array( 'label' => __( 'File URL' ), 'input' => 'html', 'html' => "<input type='text' class='text urlfield' readonly='readonly' name='attachments[$post->ID][url]' value='" . esc_attr( $image_url ) . "' /><br />", 'value' => wp_get_attachment_url( $post->ID ), 'helps' => __( 'Location of the uploaded file.' ), ), ); foreach ( get_attachment_taxonomies( $post ) as $taxonomy ) { $t = (array) get_taxonomy( $taxonomy ); if ( ! $t['public'] || ! $t['show_ui'] ) { continue; } if ( empty( $t['label'] ) ) { $t['label'] = $taxonomy; } if ( empty( $t['args'] ) ) { $t['args'] = array(); } $terms = get_object_term_cache( $post->ID, $taxonomy ); if ( false === $terms ) { $terms = wp_get_object_terms( $post->ID, $taxonomy, $t['args'] ); } $values = array(); foreach ( $terms as $term ) { $values[] = $term->slug; } $t['value'] = implode( ', ', $values ); $form_fields[ $taxonomy ] = $t; } /* * Merge default fields with their errors, so any key passed with the error * (e.g. 'error', 'helps', 'value') will replace the default. * The recursive merge is easily traversed with array casting: * foreach ( (array) $things as $thing ) */ $form_fields = array_merge_recursive( $form_fields, (array) $errors ); // This was formerly in image_attachment_fields_to_edit(). if ( str_starts_with( $post->post_mime_type, 'image' ) ) { $alt = get_post_meta( $post->ID, '_wp_attachment_image_alt', true ); if ( empty( $alt ) ) { $alt = ''; } $form_fields['post_title']['required'] = true; $form_fields['image_alt'] = array( 'value' => $alt, 'label' => __( 'Alternative Text' ), 'helps' => __( 'Alt text for the image, e.g. “The Mona Lisa”' ), ); $form_fields['align'] = array( 'label' => __( 'Alignment' ), 'input' => 'html', 'html' => image_align_input_fields( $post, get_option( 'image_default_align' ) ), ); $form_fields['image-size'] = image_size_input_fields( $post, get_option( 'image_default_size', 'medium' ) ); } else { unset( $form_fields['image_alt'] ); } /** * Filters the attachment fields to edit. * * @since 2.5.0 * * @param array $form_fields An array of attachment form fields. * @param WP_Post $post The WP_Post attachment object. */ $form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post ); return $form_fields; } /** * Retrieves HTML for media items of post gallery. * * The HTML markup retrieved will be created for the progress of SWF Upload * component. Will also create link for showing and hiding the form to modify * the image attachment. * * @since 2.5.0 * * @global WP_Query $wp_the_query WordPress Query object. * * @param int $post_id Post ID. * @param array $errors Errors for attachment, if any. * @return string HTML content for media items of post gallery. */ function get_media_items( $post_id, $errors ) { $attachments = array(); if ( $post_id ) { $post = get_post( $post_id ); if ( $post && 'attachment' === $post->post_type ) { $attachments = array( $post->ID => $post ); } else { $attachments = get_children( array( 'post_parent' => $post_id, 'post_type' => 'attachment', 'orderby' => 'menu_order ASC, ID', 'order' => 'DESC', ) ); } } else { if ( is_array( $GLOBALS['wp_the_query']->posts ) ) { foreach ( $GLOBALS['wp_the_query']->posts as $attachment ) { $attachments[ $attachment->ID ] = $attachment; } } } $output = ''; foreach ( (array) $attachments as $id => $attachment ) { if ( 'trash' === $attachment->post_status ) { continue; } $item = get_media_item( $id, array( 'errors' => isset( $errors[ $id ] ) ? $errors[ $id ] : null ) ); if ( $item ) { $output .= "\n<div id='media-item-$id' class='media-item child-of-$attachment->post_parent preloaded'><div class='progress hidden'><div class='bar'></div></div><div id='media-upload-error-$id' class='hidden'></div><div class='filename hidden'></div>$item\n</div>"; } } return $output; } /** * Retrieves HTML form for modifying the image attachment. * * @since 2.5.0 * * @global string $redir_tab * * @param int $attachment_id Attachment ID for modification. * @param string|array $args Optional. Override defaults. * @return string HTML form for attachment. */ function get_media_item( $attachment_id, $args = null ) { global $redir_tab; $thumb_url = false; $attachment_id = (int) $attachment_id; if ( $attachment_id ) { $thumb_url = wp_get_attachment_image_src( $attachment_id, 'thumbnail', true ); if ( $thumb_url ) { $thumb_url = $thumb_url[0]; } } $post = get_post( $attachment_id ); $current_post_id = ! empty( $_GET['post_id'] ) ? (int) $_GET['post_id'] : 0; $default_args = array( 'errors' => null, 'send' => $current_post_id ? post_type_supports( get_post_type( $current_post_id ), 'editor' ) : true, 'delete' => true, 'toggle' => true, 'show_title' => true, ); $parsed_args = wp_parse_args( $args, $default_args ); /** * Filters the arguments used to retrieve an image for the edit image form. * * @since 3.1.0 * * @see get_media_item * * @param array $parsed_args An array of arguments. */ $parsed_args = apply_filters( 'get_media_item_args', $parsed_args ); $toggle_on = __( 'Show' ); $toggle_off = __( 'Hide' ); $file = get_attached_file( $post->ID ); $filename = esc_html( wp_basename( $file ) ); $title = esc_attr( $post->post_title ); $post_mime_types = get_post_mime_types(); $keys = array_keys( wp_match_mime_types( array_keys( $post_mime_types ), $post->post_mime_type ) ); $type = reset( $keys ); $type_html = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />"; $form_fields = get_attachment_fields_to_edit( $post, $parsed_args['errors'] ); if ( $parsed_args['toggle'] ) { $class = empty( $parsed_args['errors'] ) ? 'startclosed' : 'startopen'; $toggle_links = " <a class='toggle describe-toggle-on' href='#'>$toggle_on</a> <a class='toggle describe-toggle-off' href='#'>$toggle_off</a>"; } else { $class = ''; $toggle_links = ''; } $display_title = ( ! empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case. $display_title = $parsed_args['show_title'] ? "<div class='filename new'><span class='title'>" . wp_html_excerpt( $display_title, 60, '…' ) . '</span></div>' : ''; $gallery = ( ( isset( $_REQUEST['tab'] ) && 'gallery' === $_REQUEST['tab'] ) || ( isset( $redir_tab ) && 'gallery' === $redir_tab ) ); $order = ''; foreach ( $form_fields as $key => $val ) { if ( 'menu_order' === $key ) { if ( $gallery ) { $order = "<div class='menu_order'> <input class='menu_order_input' type='text' id='attachments[$attachment_id][menu_order]' name='attachments[$attachment_id][menu_order]' value='" . esc_attr( $val['value'] ) . "' /></div>"; } else { $order = "<input type='hidden' name='attachments[$attachment_id][menu_order]' value='" . esc_attr( $val['value'] ) . "' />"; } unset( $form_fields['menu_order'] ); break; } } $media_dims = ''; $meta = wp_get_attachment_metadata( $post->ID ); if ( isset( $meta['width'], $meta['height'] ) ) { /* translators: 1: A number of pixels wide, 2: A number of pixels tall. */ $media_dims .= "<span id='media-dims-$post->ID'>" . sprintf( __( '%1$s by %2$s pixels' ), $meta['width'], $meta['height'] ) . '</span>'; } /** * Filters the media metadata. * * @since 2.5.0 * * @param string $media_dims The HTML markup containing the media dimensions. * @param WP_Post $post The WP_Post attachment object. */ $media_dims = apply_filters( 'media_meta', $media_dims, $post ); $image_edit_button = ''; if ( wp_attachment_is_image( $post->ID ) && wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) { $nonce = wp_create_nonce( "image_editor-$post->ID" ); $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <span class='spinner'></span>"; } $attachment_url = get_permalink( $attachment_id ); $item = " $type_html $toggle_links $order $display_title <table class='slidetoggle describe $class'> <thead class='media-item-info' id='media-head-$post->ID'> <tr> <td class='A1B1' id='thumbnail-head-$post->ID'> <p><a href='$attachment_url' target='_blank'><img class='thumbnail' src='$thumb_url' alt='' /></a></p> <p>$image_edit_button</p> </td> <td> <p><strong>" . __( 'File name:' ) . "</strong> $filename</p> <p><strong>" . __( 'File type:' ) . "</strong> $post->post_mime_type</p> <p><strong>" . __( 'Upload date:' ) . '</strong> ' . mysql2date( __( 'F j, Y' ), $post->post_date ) . '</p>'; if ( ! empty( $media_dims ) ) { $item .= '<p><strong>' . __( 'Dimensions:' ) . "</strong> $media_dims</p>\n"; } $item .= "</td></tr>\n"; $item .= " </thead> <tbody> <tr><td colspan='2' class='imgedit-response' id='imgedit-response-$post->ID'></td></tr>\n <tr><td style='display:none' colspan='2' class='image-editor' id='image-editor-$post->ID'></td></tr>\n <tr><td colspan='2'><p class='media-types media-types-required-info'>" . wp_required_field_message() . "</p></td></tr>\n"; $defaults = array( 'input' => 'text', 'required' => false, 'value' => '', 'extra_rows' => array(), ); if ( $parsed_args['send'] ) { $parsed_args['send'] = get_submit_button( __( 'Insert into Post' ), '', "send[$attachment_id]", false ); } $delete = empty( $parsed_args['delete'] ) ? '' : $parsed_args['delete']; if ( $delete && current_user_can( 'delete_post', $attachment_id ) ) { if ( ! EMPTY_TRASH_DAYS ) { $delete = "<a href='" . wp_nonce_url( "post.php?action=delete&post=$attachment_id", 'delete-post_' . $attachment_id ) . "' id='del[$attachment_id]' class='delete-permanently'>" . __( 'Delete Permanently' ) . '</a>'; } elseif ( ! MEDIA_TRASH ) { $delete = "<a href='#' class='del-link' onclick=\"document.getElementById('del_attachment_$attachment_id').style.display='block';return false;\">" . __( 'Delete' ) . "</a> <div id='del_attachment_$attachment_id' class='del-attachment' style='display:none;'>" . /* translators: %s: File name. */ '<p>' . sprintf( __( 'You are about to delete %s.' ), '<strong>' . $filename . '</strong>' ) . "</p> <a href='" . wp_nonce_url( "post.php?action=delete&post=$attachment_id", 'delete-post_' . $attachment_id ) . "' id='del[$attachment_id]' class='button'>" . __( 'Continue' ) . "</a> <a href='#' class='button' onclick=\"this.parentNode.style.display='none';return false;\">" . __( 'Cancel' ) . '</a> </div>'; } else { $delete = "<a href='" . wp_nonce_url( "post.php?action=trash&post=$attachment_id", 'trash-post_' . $attachment_id ) . "' id='del[$attachment_id]' class='delete'>" . __( 'Move to Trash' ) . "</a> <a href='" . wp_nonce_url( "post.php?action=untrash&post=$attachment_id", 'untrash-post_' . $attachment_id ) . "' id='undo[$attachment_id]' class='undo hidden'>" . __( 'Undo' ) . '</a>'; } } else { $delete = ''; } $thumbnail = ''; $calling_post_id = 0; if ( isset( $_GET['post_id'] ) ) { $calling_post_id = absint( $_GET['post_id'] ); } elseif ( isset( $_POST ) && count( $_POST ) ) {// Like for async-upload where $_GET['post_id'] isn't set. $calling_post_id = $post->post_parent; } if ( 'image' === $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) && post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' ) && get_post_thumbnail_id( $calling_post_id ) !== $attachment_id ) { $calling_post = get_post( $calling_post_id ); $calling_post_type_object = get_post_type_object( $calling_post->post_type ); $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" ); $thumbnail = "<a class='wp-post-thumbnail' id='wp-post-thumbnail-" . $attachment_id . "' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\", \"$ajax_nonce\");return false;'>" . esc_html( $calling_post_type_object->labels->use_featured_image ) . '</a>'; } if ( ( $parsed_args['send'] || $thumbnail || $delete ) && ! isset( $form_fields['buttons'] ) ) { $form_fields['buttons'] = array( 'tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>" . $parsed_args['send'] . " $thumbnail $delete</td></tr>\n" ); } $hidden_fields = array(); foreach ( $form_fields as $id => $field ) { if ( '_' === $id[0] ) { continue; } if ( ! empty( $field['tr'] ) ) { $item .= $field['tr']; continue; } $field = array_merge( $defaults, $field ); $name = "attachments[$attachment_id][$id]"; if ( 'hidden' === $field['input'] ) { $hidden_fields[ $name ] = $field['value']; continue; } $required = $field['required'] ? ' ' . wp_required_field_indicator() : ''; $required_attr = $field['required'] ? ' required' : ''; $class = $id; $class .= $field['required'] ? ' form-required' : ''; $item .= "\t\t<tr class='$class'>\n\t\t\t<th scope='row' class='label'><label for='$name'><span class='alignleft'>{$field['label']}{$required}</span><br class='clear' /></label></th>\n\t\t\t<td class='field'>"; if ( ! empty( $field[ $field['input'] ] ) ) { $item .= $field[ $field['input'] ]; } elseif ( 'textarea' === $field['input'] ) { if ( 'post_content' === $id && user_can_richedit() ) { // Sanitize_post() skips the post_content when user_can_richedit. $field['value'] = htmlspecialchars( $field['value'], ENT_QUOTES ); } // Post_excerpt is already escaped by sanitize_post() in get_attachment_fields_to_edit(). $item .= "<textarea id='$name' name='$name'{$required_attr}>" . $field['value'] . '</textarea>'; } else { $item .= "<input type='text' class='text' id='$name' name='$name' value='" . esc_attr( $field['value'] ) . "'{$required_attr} />"; } if ( ! empty( $field['helps'] ) ) { $item .= "<p class='help'>" . implode( "</p>\n<p class='help'>", array_unique( (array) $field['helps'] ) ) . '</p>'; } $item .= "</td>\n\t\t</tr>\n"; $extra_rows = array(); if ( ! empty( $field['errors'] ) ) { foreach ( array_unique( (array) $field['errors'] ) as $error ) { $extra_rows['error'][] = $error; } } if ( ! empty( $field['extra_rows'] ) ) { foreach ( $field['extra_rows'] as $class => $rows ) { foreach ( (array) $rows as $html ) { $extra_rows[ $class ][] = $html; } } } foreach ( $extra_rows as $class => $rows ) { foreach ( $rows as $html ) { $item .= "\t\t<tr><td></td><td class='$class'>$html</td></tr>\n"; } } } if ( ! empty( $form_fields['_final'] ) ) { $item .= "\t\t<tr class='final'><td colspan='2'>{$form_fields['_final']}</td></tr>\n"; } $item .= "\t</tbody>\n"; $item .= "\t</table>\n"; foreach ( $hidden_fields as $name => $value ) { $item .= "\t<input type='hidden' name='$name' id='$name' value='" . esc_attr( $value ) . "' />\n"; } if ( $post->post_parent < 1 && isset( $_REQUEST['post_id'] ) ) { $parent = (int) $_REQUEST['post_id']; $parent_name = "attachments[$attachment_id][post_parent]"; $item .= "\t<input type='hidden' name='$parent_name' id='$parent_name' value='$parent' />\n"; } return $item; } /** * @since 3.5.0 * * @param int $attachment_id * @param array $args * @return array */ function get_compat_media_markup( $attachment_id, $args = null ) { $post = get_post( $attachment_id ); $default_args = array( 'errors' => null, 'in_modal' => false, ); $user_can_edit = current_user_can( 'edit_post', $attachment_id ); $args = wp_parse_args( $args, $default_args ); /** This filter is documented in wp-admin/includes/media.php */ $args = apply_filters( 'get_media_item_args', $args ); $form_fields = array(); if ( $args['in_modal'] ) { foreach ( get_attachment_taxonomies( $post ) as $taxonomy ) { $t = (array) get_taxonomy( $taxonomy ); if ( ! $t['public'] || ! $t['show_ui'] ) { continue; } if ( empty( $t['label'] ) ) { $t['label'] = $taxonomy; } if ( empty( $t['args'] ) ) { $t['args'] = array(); } $terms = get_object_term_cache( $post->ID, $taxonomy ); if ( false === $terms ) { $terms = wp_get_object_terms( $post->ID, $taxonomy, $t['args'] ); } $values = array(); foreach ( $terms as $term ) { $values[] = $term->slug; } $t['value'] = implode( ', ', $values ); $t['taxonomy'] = true; $form_fields[ $taxonomy ] = $t; } } /* * Merge default fields with their errors, so any key passed with the error * (e.g. 'error', 'helps', 'value') will replace the default. * The recursive merge is easily traversed with array casting: * foreach ( (array) $things as $thing ) */ $form_fields = array_merge_recursive( $form_fields, (array) $args['errors'] ); /** This filter is documented in wp-admin/includes/media.php */ $form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post ); unset( $form_fields['image-size'], $form_fields['align'], $form_fields['image_alt'], $form_fields['post_title'], $form_fields['post_excerpt'], $form_fields['post_content'], $form_fields['url'], $form_fields['menu_order'], $form_fields['image_url'] ); /** This filter is documented in wp-admin/includes/media.php */ $media_meta = apply_filters( 'media_meta', '', $post ); $defaults = array( 'input' => 'text', 'required' => false, 'value' => '', 'extra_rows' => array(), 'show_in_edit' => true, 'show_in_modal' => true, ); $hidden_fields = array(); $item = ''; foreach ( $form_fields as $id => $field ) { if ( '_' === $id[0] ) { continue; } $name = "attachments[$attachment_id][$id]"; $id_attr = "attachments-$attachment_id-$id"; if ( ! empty( $field['tr'] ) ) { $item .= $field['tr']; continue; } $field = array_merge( $defaults, $field ); if ( ( ! $field['show_in_edit'] && ! $args['in_modal'] ) || ( ! $field['show_in_modal'] && $args['in_modal'] ) ) { continue; } if ( 'hidden' === $field['input'] ) { $hidden_fields[ $name ] = $field['value']; continue; } $readonly = ! $user_can_edit && ! empty( $field['taxonomy'] ) ? " readonly='readonly' " : ''; $required = $field['required'] ? ' ' . wp_required_field_indicator() : ''; $required_attr = $field['required'] ? ' required' : ''; $class = 'compat-field-' . $id; $class .= $field['required'] ? ' form-required' : ''; $item .= "\t\t<tr class='$class'>"; $item .= "\t\t\t<th scope='row' class='label'><label for='$id_attr'><span class='alignleft'>{$field['label']}</span>$required<br class='clear' /></label>"; $item .= "</th>\n\t\t\t<td class='field'>"; if ( ! empty( $field[ $field['input'] ] ) ) { $item .= $field[ $field['input'] ]; } elseif ( 'textarea' === $field['input'] ) { if ( 'post_content' === $id && user_can_richedit() ) { // sanitize_post() skips the post_content when user_can_richedit. $field['value'] = htmlspecialchars( $field['value'], ENT_QUOTES ); } $item .= "<textarea id='$id_attr' name='$name'{$required_attr}>" . $field['value'] . '</textarea>'; } else { $item .= "<input type='text' class='text' id='$id_attr' name='$name' value='" . esc_attr( $field['value'] ) . "' $readonly{$required_attr} />"; } if ( ! empty( $field['helps'] ) ) { $item .= "<p class='help'>" . implode( "</p>\n<p class='help'>", array_unique( (array) $field['helps'] ) ) . '</p>'; } $item .= "</td>\n\t\t</tr>\n"; $extra_rows = array(); if ( ! empty( $field['errors'] ) ) { foreach ( array_unique( (array) $field['errors'] ) as $error ) { $extra_rows['error'][] = $error; } } if ( ! empty( $field['extra_rows'] ) ) { foreach ( $field['extra_rows'] as $class => $rows ) { foreach ( (array) $rows as $html ) { $extra_rows[ $class ][] = $html; } } } foreach ( $extra_rows as $class => $rows ) { foreach ( $rows as $html ) { $item .= "\t\t<tr><td></td><td class='$class'>$html</td></tr>\n"; } } } if ( ! empty( $form_fields['_final'] ) ) { $item .= "\t\t<tr class='final'><td colspan='2'>{$form_fields['_final']}</td></tr>\n"; } if ( $item ) { $item = '<p class="media-types media-types-required-info">' . wp_required_field_message() . '</p>' . '<table class="compat-attachment-fields">' . $item . '</table>'; } foreach ( $hidden_fields as $hidden_field => $value ) { $item .= '<input type="hidden" name="' . esc_attr( $hidden_field ) . '" value="' . esc_attr( $value ) . '" />' . "\n"; } if ( $item ) { $item = '<input type="hidden" name="attachments[' . $attachment_id . '][menu_order]" value="' . esc_attr( $post->menu_order ) . '" />' . $item; } return array( 'item' => $item, 'meta' => $media_meta, ); } /** * Outputs the legacy media upload header. * * @since 2.5.0 */ function media_upload_header() { $post_id = isset( $_REQUEST['post_id'] ) ? (int) $_REQUEST['post_id'] : 0; echo '<script type="text/javascript">post_id = ' . $post_id . ';</script>'; if ( empty( $_GET['chromeless'] ) ) { echo '<div id="media-upload-header">'; the_media_upload_tabs(); echo '</div>'; } } /** * Outputs the legacy media upload form. * * @since 2.5.0 * * @global string $type * @global string $tab * * @param array $errors */ function media_upload_form( $errors = null ) { global $type, $tab; if ( ! _device_can_upload() ) { echo '<p>' . sprintf( /* translators: %s: https://apps.wordpress.org/ */ __( 'The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.' ), 'https://apps.wordpress.org/' ) . '</p>'; return; } $upload_action_url = admin_url( 'async-upload.php' ); $post_id = isset( $_REQUEST['post_id'] ) ? (int) $_REQUEST['post_id'] : 0; $_type = isset( $type ) ? $type : ''; $_tab = isset( $tab ) ? $tab : ''; $max_upload_size = wp_max_upload_size(); if ( ! $max_upload_size ) { $max_upload_size = 0; } ?> <div id="media-upload-notice"> <?php if ( isset( $errors['upload_notice'] ) ) { echo $errors['upload_notice']; } ?> </div> <div id="media-upload-error"> <?php if ( isset( $errors['upload_error'] ) && is_wp_error( $errors['upload_error'] ) ) { echo $errors['upload_error']->get_error_message(); } ?> </div> <?php if ( is_multisite() && ! is_upload_space_available() ) { /** * Fires when an upload will exceed the defined upload space quota for a network site. * * @since 3.5.0 */ do_action( 'upload_ui_over_quota' ); return; } /** * Fires just before the legacy (pre-3.5.0) upload interface is loaded. * * @since 2.6.0 */ do_action( 'pre-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores $post_params = array( 'post_id' => $post_id, '_wpnonce' => wp_create_nonce( 'media-form' ), 'type' => $_type, 'tab' => $_tab, 'short' => '1', ); /** * Filters the media upload post parameters. * * @since 3.1.0 As 'swfupload_post_params' * @since 3.3.0 * * @param array $post_params An array of media upload parameters used by Plupload. */ $post_params = apply_filters( 'upload_post_params', $post_params ); /* * Since 4.9 the `runtimes` setting is hardcoded in our version of Plupload to `html5,html4`, * and the `flash_swf_url` and `silverlight_xap_url` are not used. */ $plupload_init = array( 'browse_button' => 'plupload-browse-button', 'container' => 'plupload-upload-ui', 'drop_element' => 'drag-drop-area', 'file_data_name' => 'async-upload', 'url' => $upload_action_url, 'filters' => array( 'max_file_size' => $max_upload_size . 'b' ), 'multipart_params' => $post_params, ); /* * Currently only iOS Safari supports multiple files uploading, * but iOS 7.x has a bug that prevents uploading of videos when enabled. * See #29602. */ if ( wp_is_mobile() && str_contains( $_SERVER['HTTP_USER_AGENT'], 'OS 7_' ) && str_contains( $_SERVER['HTTP_USER_AGENT'], 'like Mac OS X' ) ) { $plupload_init['multi_selection'] = false; } /** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php */ $prevent_unsupported_uploads = apply_filters( 'wp_prevent_unsupported_mime_type_uploads', true, null ); if ( $prevent_unsupported_uploads ) { // Check if WebP images can be edited. if ( ! wp_image_editor_supports( array( 'mime_type' => 'image/webp' ) ) ) { $plupload_init['webp_upload_error'] = true; } // Check if AVIF images can be edited. if ( ! wp_image_editor_supports( array( 'mime_type' => 'image/avif' ) ) ) { $plupload_init['avif_upload_error'] = true; } } /** * Filters the default Plupload settings. * * @since 3.3.0 * * @param array $plupload_init An array of default settings used by Plupload. */ $plupload_init = apply_filters( 'plupload_init', $plupload_init ); ?> <script type="text/javascript"> <?php // Verify size is an int. If not return default value. $large_size_h = absint( get_option( 'large_size_h' ) ); if ( ! $large_size_h ) { $large_size_h = 1024; } $large_size_w = absint( get_option( 'large_size_w' ) ); if ( ! $large_size_w ) { $large_size_w = 1024; } ?> var resize_height = <?php echo $large_size_h; ?>, resize_width = <?php echo $large_size_w; ?>, wpUploaderInit = <?php echo wp_json_encode( $plupload_init ); ?>; </script> <div id="plupload-upload-ui" class="hide-if-no-js"> <?php /** * Fires before the upload interface loads. * * @since 2.6.0 As 'pre-flash-upload-ui' * @since 3.3.0 */ do_action( 'pre-plupload-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores ?> <div id="drag-drop-area"> <div class="drag-drop-inside"> <p class="drag-drop-info"><?php _e( 'Drop files to upload' ); ?></p> <p><?php _ex( 'or', 'Uploader: Drop files here - or - Select Files' ); ?></p> <p class="drag-drop-buttons"><input id="plupload-browse-button" type="button" value="<?php esc_attr_e( 'Select Files' ); ?>" class="button" /></p> </div> </div> <?php /** * Fires after the upload interface loads. * * @since 2.6.0 As 'post-flash-upload-ui' * @since 3.3.0 */ do_action( 'post-plupload-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores ?> </div> <div id="html-upload-ui" class="hide-if-js"> <?php /** * Fires before the upload button in the media upload interface. * * @since 2.6.0 */ do_action( 'pre-html-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores ?> <p id="async-upload-wrap"> <label class="screen-reader-text" for="async-upload"> <?php /* translators: Hidden accessibility text. */ _ex( 'Upload', 'verb' ); ?> </label> <input type="file" name="async-upload" id="async-upload" /> <?php submit_button( _x( 'Upload', 'verb' ), 'primary', 'html-upload', false ); ?> <a href="#" onclick="try{top.tb_remove();}catch(e){}; return false;"><?php _e( 'Cancel' ); ?></a> </p> <div class="clear"></div> <?php /** * Fires after the upload button in the media upload interface. * * @since 2.6.0 */ do_action( 'post-html-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores ?> </div> <p class="max-upload-size"> <?php /* translators: %s: Maximum allowed file size. */ printf( __( 'Maximum upload file size: %s.' ), esc_html( size_format( $max_upload_size ) ) ); ?> </p> <?php /** * Fires on the post upload UI screen. * * Legacy (pre-3.5.0) media workflow hook. * * @since 2.6.0 */ do_action( 'post-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores } /** * Outputs the legacy media upload form for a given media type. * * @since 2.5.0 * * @param string $type * @param array $errors * @param int|WP_Error $id */ function media_upload_type_form( $type = 'file', $errors = null, $id = null ) { media_upload_header(); $post_id = isset( $_REQUEST['post_id'] ) ? (int) $_REQUEST['post_id'] : 0; $form_action_url = admin_url( "media-upload.php?type=$type&tab=type&post_id=$post_id" ); /** * Filters the media upload form action URL. * * @since 2.6.0 * * @param string $form_action_url The media upload form action URL. * @param string $type The type of media. Default 'file'. */ $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type ); $form_class = 'media-upload-form type-form validate'; if ( get_user_setting( 'uploader' ) ) { $form_class .= ' html-uploader'; } ?> <form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="<?php echo $type; ?>-form"> <?php submit_button( '', 'hidden', 'save', false ); ?> <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" /> <?php wp_nonce_field( 'media-form' ); ?> <h3 class="media-title"><?php _e( 'Add media files from your computer' ); ?></h3> <?php media_upload_form( $errors ); ?> <script type="text/javascript"> jQuery(function($){ var preloaded = $(".media-item.preloaded"); if ( preloaded.length > 0 ) { preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');}); } updateMediaForm(); }); </script> <div id="media-items"> <?php if ( $id ) { if ( ! is_wp_error( $id ) ) { add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 ); echo get_media_items( $id, $errors ); } else { echo '<div id="media-upload-error">' . esc_html( $id->get_error_message() ) . '</div></div>'; exit; } } ?> </div> <p class="savebutton ml-submit"> <?php submit_button( __( 'Save all changes' ), '', 'save', false ); ?> </p> </form> <?php } /** * Outputs the legacy media upload form for external media. * * @since 2.7.0 * * @param string $type * @param object $errors * @param int $id */ function media_upload_type_url_form( $type = null, $errors = null, $id = null ) { if ( null === $type ) { $type = 'image'; } media_upload_header(); $post_id = isset( $_REQUEST['post_id'] ) ? (int) $_REQUEST['post_id'] : 0; $form_action_url = admin_url( "media-upload.php?type=$type&tab=type&post_id=$post_id" ); /** This filter is documented in wp-admin/includes/media.php */ $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type ); $form_class = 'media-upload-form type-form validate'; if ( get_user_setting( 'uploader' ) ) { $form_class .= ' html-uploader'; } ?> <form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="<?php echo $type; ?>-form"> <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" /> <?php wp_nonce_field( 'media-form' ); ?> <h3 class="media-title"><?php _e( 'Insert media from another website' ); ?></h3> <script type="text/javascript"> var addExtImage = { width : '', height : '', align : 'alignnone', insert : function() { var t = this, html, f = document.forms[0], cls, title = '', alt = '', caption = ''; if ( '' === f.src.value || '' === t.width ) return false; if ( f.alt.value ) alt = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>'); <?php /** This filter is documented in wp-admin/includes/media.php */ if ( ! apply_filters( 'disable_captions', '' ) ) { ?> if ( f.caption.value ) { caption = f.caption.value.replace(/\r\n|\r/g, '\n'); caption = caption.replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g, function(a){ return a.replace(/[\r\n\t]+/, ' '); }); caption = caption.replace(/\s*\n\s*/g, '<br />'); } <?php } ?> cls = caption ? '' : ' class="'+t.align+'"'; html = '<img alt="'+alt+'" src="'+f.src.value+'"'+cls+' width="'+t.width+'" height="'+t.height+'" />'; if ( f.url.value ) { url = f.url.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>'); html = '<a href="'+url+'">'+html+'</a>'; } if ( caption ) html = '[caption id="" align="'+t.align+'" width="'+t.width+'"]'+html+caption+'[/caption]'; var win = window.dialogArguments || opener || parent || top; win.send_to_editor(html); return false; }, resetImageData : function() { var t = addExtImage; t.width = t.height = ''; document.getElementById('go_button').style.color = '#bbb'; if ( ! document.forms[0].src.value ) document.getElementById('status_img').innerHTML = ''; else document.getElementById('status_img').innerHTML = '<img src="<?php echo esc_url( admin_url( 'images/no.png' ) ); ?>" alt="" />'; }, updateImageData : function() { var t = addExtImage; t.width = t.preloadImg.width; t.height = t.preloadImg.height; document.getElementById('go_button').style.color = '#333'; document.getElementById('status_img').innerHTML = '<img src="<?php echo esc_url( admin_url( 'images/yes.png' ) ); ?>" alt="" />'; }, getImageData : function() { if ( jQuery('table.describe').hasClass('not-image') ) return; var t = addExtImage, src = document.forms[0].src.value; if ( ! src ) { t.resetImageData(); return false; } document.getElementById('status_img').innerHTML = '<img src="<?php echo esc_url( admin_url( 'images/spinner-2x.gif' ) ); ?>" alt="" width="16" height="16" />'; t.preloadImg = new Image(); t.preloadImg.onload = t.updateImageData; t.preloadImg.onerror = t.resetImageData; t.preloadImg.src = src; } }; jQuery( function($) { $('.media-types input').click( function() { $('table.describe').toggleClass('not-image', $('#not-image').prop('checked') ); }); } ); </script> <div id="media-items"> <div class="media-item media-blank"> <?php /** * Filters the insert media from URL form HTML. * * @since 3.3.0 * * @param string $form_html The insert from URL form HTML. */ echo apply_filters( 'type_url_form_media', wp_media_insert_url_form( $type ) ); ?> </div> </div> </form> <?php } /** * Adds gallery form to upload iframe. * * @since 2.5.0 * * @global string $redir_tab * @global string $type * @global string $tab * * @param array $errors */ function media_upload_gallery_form( $errors ) { global $redir_tab, $type; $redir_tab = 'gallery'; media_upload_header(); $post_id = (int) $_REQUEST['post_id']; $form_action_url = admin_url( "media-upload.php?type=$type&tab=gallery&post_id=$post_id" ); /** This filter is documented in wp-admin/includes/media.php */ $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type ); $form_class = 'media-upload-form validate'; if ( get_user_setting( 'uploader' ) ) { $form_class .= ' html-uploader'; } ?> <script type="text/javascript"> jQuery(function($){ var preloaded = $(".media-item.preloaded"); if ( preloaded.length > 0 ) { preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');}); updateMediaForm(); } }); </script> <div id="sort-buttons" class="hide-if-no-js"> <span> <?php _e( 'All Tabs:' ); ?> <a href="#" id="showall"><?php _e( 'Show' ); ?></a> <a href="#" id="hideall" style="display:none;"><?php _e( 'Hide' ); ?></a> </span> <?php _e( 'Sort Order:' ); ?> <a href="#" id="asc"><?php _e( 'Ascending' ); ?></a> | <a href="#" id="desc"><?php _e( 'Descending' ); ?></a> | <a href="#" id="clear"><?php _ex( 'Clear', 'verb' ); ?></a> </div> <form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="gallery-form"> <?php wp_nonce_field( 'media-form' ); ?> <table class="widefat"> <thead><tr> <th><?php _e( 'Media' ); ?></th> <th class="order-head"><?php _e( 'Order' ); ?></th> <th class="actions-head"><?php _e( 'Actions' ); ?></th> </tr></thead> </table> <div id="media-items"> <?php add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 ); ?> <?php echo get_media_items( $post_id, $errors ); ?> </div> <p class="ml-submit"> <?php submit_button( __( 'Save all changes' ), 'savebutton', 'save', false, array( 'id' => 'save-all', 'style' => 'display: none;', ) ); ?> <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" /> <input type="hidden" name="type" value="<?php echo esc_attr( $GLOBALS['type'] ); ?>" /> <input type="hidden" name="tab" value="<?php echo esc_attr( $GLOBALS['tab'] ); ?>" /> </p> <div id="gallery-settings" style="display:none;"> <div class="title"><?php _e( 'Gallery Settings' ); ?></div> <table id="basic" class="describe"><tbody> <tr> <th scope="row" class="label"> <label> <span class="alignleft"><?php _e( 'Link thumbnails to:' ); ?></span> </label> </th> <td class="field"> <input type="radio" name="linkto" id="linkto-file" value="file" /> <label for="linkto-file" class="radio"><?php _e( 'Image File' ); ?></label> <input type="radio" checked="checked" name="linkto" id="linkto-post" value="post" /> <label for="linkto-post" class="radio"><?php _e( 'Attachment Page' ); ?></label> </td> </tr> <tr> <th scope="row" class="label"> <label> <span class="alignleft"><?php _e( 'Order images by:' ); ?></span> </label> </th> <td class="field"> <select id="orderby" name="orderby"> <option value="menu_order" selected="selected"><?php _e( 'Menu order' ); ?></option> <option value="title"><?php _e( 'Title' ); ?></option> <option value="post_date"><?php _e( 'Date/Time' ); ?></option> <option value="rand"><?php _e( 'Random' ); ?></option> </select> </td> </tr> <tr> <th scope="row" class="label"> <label> <span class="alignleft"><?php _e( 'Order:' ); ?></span> </label> </th> <td class="field"> <input type="radio" checked="checked" name="order" id="order-asc" value="asc" /> <label for="order-asc" class="radio"><?php _e( 'Ascending' ); ?></label> <input type="radio" name="order" id="order-desc" value="desc" /> <label for="order-desc" class="radio"><?php _e( 'Descending' ); ?></label> </td> </tr> <tr> <th scope="row" class="label"> <label> <span class="alignleft"><?php _e( 'Gallery columns:' ); ?></span> </label> </th> <td class="field"> <select id="columns" name="columns"> <option value="1">1</option> <option value="2">2</option> <option value="3" selected="selected">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> </select> </td> </tr> </tbody></table> <p class="ml-submit"> <input type="button" class="button" style="display:none;" onMouseDown="wpgallery.update();" name="insert-gallery" id="insert-gallery" value="<?php esc_attr_e( 'Insert gallery' ); ?>" /> <input type="button" class="button" style="display:none;" onMouseDown="wpgallery.update();" name="update-gallery" id="update-gallery" value="<?php esc_attr_e( 'Update gallery settings' ); ?>" /> </p> </div> </form> <?php } /** * Outputs the legacy media upload form for the media library. * * @since 2.5.0 * * @global wpdb $wpdb WordPress database abstraction object. * @global WP_Query $wp_query WordPress Query object. * @global WP_Locale $wp_locale WordPress date and time locale object. * @global string $type * @global string $tab * @global array $post_mime_types * * @param array $errors */ function media_upload_library_form( $errors ) { global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types; media_upload_header(); $post_id = isset( $_REQUEST['post_id'] ) ? (int) $_REQUEST['post_id'] : 0; $form_action_url = admin_url( "media-upload.php?type=$type&tab=library&post_id=$post_id" ); /** This filter is documented in wp-admin/includes/media.php */ $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type ); $form_class = 'media-upload-form validate'; if ( get_user_setting( 'uploader' ) ) { $form_class .= ' html-uploader'; } $q = $_GET; $q['posts_per_page'] = 10; $q['paged'] = isset( $q['paged'] ) ? (int) $q['paged'] : 0; if ( $q['paged'] < 1 ) { $q['paged'] = 1; } $q['offset'] = ( $q['paged'] - 1 ) * 10; if ( $q['offset'] < 1 ) { $q['offset'] = 0; } list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query( $q ); ?> <form id="filter" method="get"> <input type="hidden" name="type" value="<?php echo esc_attr( $type ); ?>" /> <input type="hidden" name="tab" value="<?php echo esc_attr( $tab ); ?>" /> <input type="hidden" name="post_id" value="<?php echo (int) $post_id; ?>" /> <input type="hidden" name="post_mime_type" value="<?php echo isset( $_GET['post_mime_type'] ) ? esc_attr( $_GET['post_mime_type'] ) : ''; ?>" /> <input type="hidden" name="context" value="<?php echo isset( $_GET['context'] ) ? esc_attr( $_GET['context'] ) : ''; ?>" /> <p id="media-search" class="search-box"> <label class="screen-reader-text" for="media-search-input"> <?php /* translators: Hidden accessibility text. */ _e( 'Search Media:' ); ?> </label> <input type="search" id="media-search-input" name="s" value="<?php the_search_query(); ?>" /> <?php submit_button( __( 'Search Media' ), '', '', false ); ?> </p> <ul class="subsubsub"> <?php $type_links = array(); $_num_posts = (array) wp_count_attachments(); $matches = wp_match_mime_types( array_keys( $post_mime_types ), array_keys( $_num_posts ) ); foreach ( $matches as $_type => $reals ) { foreach ( $reals as $real ) { if ( isset( $num_posts[ $_type ] ) ) { $num_posts[ $_type ] += $_num_posts[ $real ]; } else { $num_posts[ $_type ] = $_num_posts[ $real ]; } } } // If available type specified by media button clicked, filter by that type. if ( empty( $_GET['post_mime_type'] ) && ! empty( $num_posts[ $type ] ) ) { $_GET['post_mime_type'] = $type; list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query(); } if ( empty( $_GET['post_mime_type'] ) || 'all' === $_GET['post_mime_type'] ) { $class = ' class="current"'; } else { $class = ''; } $type_links[] = '<li><a href="' . esc_url( add_query_arg( array( 'post_mime_type' => 'all', 'paged' => false, 'm' => false, ) ) ) . '"' . $class . '>' . __( 'All Types' ) . '</a>'; foreach ( $post_mime_types as $mime_type => $label ) { $class = ''; if ( ! wp_match_mime_types( $mime_type, $avail_post_mime_types ) ) { continue; } if ( isset( $_GET['post_mime_type'] ) && wp_match_mime_types( $mime_type, $_GET['post_mime_type'] ) ) { $class = ' class="current"'; } $type_links[] = '<li><a href="' . esc_url( add_query_arg( array( 'post_mime_type' => $mime_type, 'paged' => false, ) ) ) . '"' . $class . '>' . sprintf( translate_nooped_plural( $label[2], $num_posts[ $mime_type ] ), '<span id="' . $mime_type . '-counter">' . number_format_i18n( $num_posts[ $mime_type ] ) . '</span>' ) . '</a>'; } /** * Filters the media upload mime type list items. * * Returned values should begin with an `<li>` tag. * * @since 3.1.0 * * @param string[] $type_links An array of list items containing mime type link HTML. */ echo implode( ' | </li>', apply_filters( 'media_upload_mime_type_links', $type_links ) ) . '</li>'; unset( $type_links ); ?> </ul> <div class="tablenav"> <?php $page_links = paginate_links( array( 'base' => add_query_arg( 'paged', '%#%' ), 'format' => '', 'prev_text' => __( '«' ), 'next_text' => __( '»' ), 'total' => (int) ceil( $wp_query->found_posts / 10 ), 'current' => $q['paged'], ) ); if ( $page_links ) { echo "<div class='tablenav-pages'>$page_links</div>"; } ?> <div class="alignleft actions"> <?php $months = $wpdb->get_results( "SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_date DESC" ); $month_count = count( $months ); $selected_month = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0; if ( $month_count && ( 1 !== $month_count || 0 !== (int) $months[0]->month ) ) { ?> <select name='m'> <option<?php selected( $selected_month, 0 ); ?> value='0'><?php _e( 'All dates' ); ?></option> <?php foreach ( $months as $arc_row ) { if ( 0 === (int) $arc_row->year ) { continue; } $month = zeroise( $arc_row->month, 2 ); $year = $arc_row->year; printf( "<option %s value='%s'>%s</option>\n", selected( $selected_month, $year . $month, false ), esc_attr( $year . $month ), /* translators: 1: Month name, 2: 4-digit year. */ esc_html( sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year ) ) ); } ?> </select> <?php } ?> <?php submit_button( __( 'Filter »' ), '', 'post-query-submit', false ); ?> </div> <br class="clear" /> </div> </form> <form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="library-form"> <?php wp_nonce_field( 'media-form' ); ?> <script type="text/javascript"> jQuery(function($){ var preloaded = $(".media-item.preloaded"); if ( preloaded.length > 0 ) { preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');}); updateMediaForm(); } }); </script> <div id="media-items"> <?php add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 ); ?> <?php echo get_media_items( null, $errors ); ?> </div> <p class="ml-submit"> <?php submit_button( __( 'Save all changes' ), 'savebutton', 'save', false ); ?> <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" /> </p> </form> <?php } /** * Creates the form for external url. * * @since 2.7.0 * * @param string $default_view * @return string HTML content of the form. */ function wp_media_insert_url_form( $default_view = 'image' ) { /** This filter is documented in wp-admin/includes/media.php */ if ( ! apply_filters( 'disable_captions', '' ) ) { $caption = ' <tr class="image-only"> <th scope="row" class="label"> <label for="caption"><span class="alignleft">' . __( 'Image Caption' ) . '</span></label> </th> <td class="field"><textarea id="caption" name="caption"></textarea></td> </tr>'; } else { $caption = ''; } $default_align = get_option( 'image_default_align' ); if ( empty( $default_align ) ) { $default_align = 'none'; } if ( 'image' === $default_view ) { $view = 'image-only'; $table_class = ''; } else { $view = 'not-image'; $table_class = $view; } return ' <p class="media-types"><label><input type="radio" name="media_type" value="image" id="image-only"' . checked( 'image-only', $view, false ) . ' /> ' . __( 'Image' ) . '</label> <label><input type="radio" name="media_type" value="generic" id="not-image"' . checked( 'not-image', $view, false ) . ' /> ' . __( 'Audio, Video, or Other File' ) . '</label></p> <p class="media-types media-types-required-info">' . wp_required_field_message() . '</p> <table class="describe ' . $table_class . '"><tbody> <tr> <th scope="row" class="label" style="width:130px;"> <label for="src"><span class="alignleft">' . __( 'URL' ) . '</span> ' . wp_required_field_indicator() . '</label> <span class="alignright" id="status_img"></span> </th> <td class="field"><input id="src" name="src" value="" type="text" required onblur="addExtImage.getImageData()" /></td> </tr> <tr> <th scope="row" class="label"> <label for="title"><span class="alignleft">' . __( 'Title' ) . '</span> ' . wp_required_field_indicator() . '</label> </th> <td class="field"><input id="title" name="title" value="" type="text" required /></td> </tr> <tr class="not-image"><td></td><td><p class="help">' . __( 'Link text, e.g. “Ransom Demands (PDF)”' ) . '</p></td></tr> <tr class="image-only"> <th scope="row" class="label"> <label for="alt"><span class="alignleft">' . __( 'Alternative Text' ) . '</span> ' . wp_required_field_indicator() . '</label> </th> <td class="field"><input id="alt" name="alt" value="" type="text" required /> <p class="help">' . __( 'Alt text for the image, e.g. “The Mona Lisa”' ) . '</p></td> </tr> ' . $caption . ' <tr class="align image-only"> <th scope="row" class="label"><p><label for="align">' . __( 'Alignment' ) . '</label></p></th> <td class="field"> <input name="align" id="align-none" value="none" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ( 'none' === $default_align ? ' checked="checked"' : '' ) . ' /> <label for="align-none" class="align image-align-none-label">' . __( 'None' ) . '</label> <input name="align" id="align-left" value="left" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ( 'left' === $default_align ? ' checked="checked"' : '' ) . ' /> <label for="align-left" class="align image-align-left-label">' . __( 'Left' ) . '</label> <input name="align" id="align-center" value="center" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ( 'center' === $default_align ? ' checked="checked"' : '' ) . ' /> <label for="align-center" class="align image-align-center-label">' . __( 'Center' ) . '</label> <input name="align" id="align-right" value="right" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ( 'right' === $default_align ? ' checked="checked"' : '' ) . ' /> <label for="align-right" class="align image-align-right-label">' . __( 'Right' ) . '</label> </td> </tr> <tr class="image-only"> <th scope="row" class="label"> <label for="url"><span class="alignleft">' . __( 'Link Image To:' ) . '</span></label> </th> <td class="field"><input id="url" name="url" value="" type="text" /><br /> <button type="button" class="button" value="" onclick="document.forms[0].url.value=null">' . __( 'None' ) . '</button> <button type="button" class="button" value="" onclick="document.forms[0].url.value=document.forms[0].src.value">' . __( 'Link to image' ) . '</button> <p class="help">' . __( 'Enter a link URL or click above for presets.' ) . '</p></td> </tr> <tr class="image-only"> <td></td> <td> <input type="button" class="button" id="go_button" style="color:#bbb;" onclick="addExtImage.insert()" value="' . esc_attr__( 'Insert into Post' ) . '" /> </td> </tr> <tr class="not-image"> <td></td> <td> ' . get_submit_button( __( 'Insert into Post' ), '', 'insertonlybutton', false ) . ' </td> </tr> </tbody></table>'; } /** * Displays the multi-file uploader message. * * @since 2.6.0 * * @global int $post_ID */ function media_upload_flash_bypass() { $browser_uploader = admin_url( 'media-new.php?browser-uploader' ); $post = get_post(); if ( $post ) { $browser_uploader .= '&post_id=' . (int) $post->ID; } elseif ( ! empty( $GLOBALS['post_ID'] ) ) { $browser_uploader .= '&post_id=' . (int) $GLOBALS['post_ID']; } ?> <p class="upload-flash-bypass"> <?php printf( /* translators: 1: URL to browser uploader, 2: Additional link attributes. */ __( 'You are using the multi-file uploader. Problems? Try the <a href="%1$s" %2$s>browser uploader</a> instead.' ), $browser_uploader, 'target="_blank"' ); ?> </p> <?php } /** * Displays the browser's built-in uploader message. * * @since 2.6.0 */ function media_upload_html_bypass() { ?> <p class="upload-html-bypass hide-if-no-js"> <?php _e( 'You are using the browser’s built-in file uploader. The WordPress uploader includes multiple file selection and drag and drop capability. <a href="#">Switch to the multi-file uploader</a>.' ); ?> </p> <?php } /** * Used to display a "After a file has been uploaded..." help message. * * @since 3.3.0 */ function media_upload_text_after() {} /** * Displays the checkbox to scale images. * * @since 3.3.0 */ function media_upload_max_image_resize() { $checked = get_user_setting( 'upload_resize' ) ? ' checked="true"' : ''; $a = ''; $end = ''; if ( current_user_can( 'manage_options' ) ) { $a = '<a href="' . esc_url( admin_url( 'options-media.php' ) ) . '" target="_blank">'; $end = '</a>'; } ?> <p class="hide-if-no-js"><label> <input name="image_resize" type="checkbox" id="image_resize" value="true"<?php echo $checked; ?> /> <?php /* translators: 1: Link start tag, 2: Link end tag, 3: Width, 4: Height. */ printf( __( 'Scale images to match the large size selected in %1$simage options%2$s (%3$d × %4$d).' ), $a, $end, (int) get_option( 'large_size_w', '1024' ), (int) get_option( 'large_size_h', '1024' ) ); ?> </label></p> <?php } /** * Displays the out of storage quota message in Multisite. * * @since 3.5.0 */ function multisite_over_quota_message() { echo '<p>' . sprintf( /* translators: %s: Allowed space allocation. */ __( 'Sorry, you have used your space allocation of %s. Please delete some files to upload more files.' ), size_format( get_space_allowed() * MB_IN_BYTES ) ) . '</p>'; } /** * Displays the image and editor in the post editor * * @since 3.5.0 * * @param WP_Post $post A post object. */ function edit_form_image_editor( $post ) { $open = isset( $_GET['image-editor'] ); if ( $open ) { require_once ABSPATH . 'wp-admin/includes/image-edit.php'; } $thumb_url = false; $attachment_id = (int) $post->ID; if ( $attachment_id ) { $thumb_url = wp_get_attachment_image_src( $attachment_id, array( 900, 450 ), true ); } $alt_text = get_post_meta( $post->ID, '_wp_attachment_image_alt', true ); $att_url = wp_get_attachment_url( $post->ID ); ?> <div class="wp_attachment_holder wp-clearfix"> <?php if ( wp_attachment_is_image( $post->ID ) ) : $image_edit_button = ''; if ( wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) { $nonce = wp_create_nonce( "image_editor-$post->ID" ); $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <span class='spinner'></span>"; } $open_style = ''; $not_open_style = ''; if ( $open ) { $open_style = ' style="display:none"'; } else { $not_open_style = ' style="display:none"'; } ?> <div class="imgedit-response" id="imgedit-response-<?php echo $attachment_id; ?>"></div> <div<?php echo $open_style; ?> class="wp_attachment_image wp-clearfix" id="media-head-<?php echo $attachment_id; ?>"> <p id="thumbnail-head-<?php echo $attachment_id; ?>"><img class="thumbnail" src="<?php echo set_url_scheme( $thumb_url[0] ); ?>" style="max-width:100%" alt="" /></p> <p><?php echo $image_edit_button; ?></p> </div> <div<?php echo $not_open_style; ?> class="image-editor" id="image-editor-<?php echo $attachment_id; ?>"> <?php if ( $open ) { wp_image_editor( $attachment_id ); } ?> </div> <?php elseif ( $attachment_id && wp_attachment_is( 'audio', $post ) ) : wp_maybe_generate_attachment_metadata( $post ); echo wp_audio_shortcode( array( 'src' => $att_url ) ); elseif ( $attachment_id && wp_attachment_is( 'video', $post ) ) : wp_maybe_generate_attachment_metadata( $post ); $meta = wp_get_attachment_metadata( $attachment_id ); $w = ! empty( $meta['width'] ) ? min( $meta['width'], 640 ) : 0; $h = ! empty( $meta['height'] ) ? $meta['height'] : 0; if ( $h && $w < $meta['width'] ) { $h = round( ( $meta['height'] * $w ) / $meta['width'] ); } $attr = array( 'src' => $att_url ); if ( ! empty( $w ) && ! empty( $h ) ) { $attr['width'] = $w; $attr['height'] = $h; } $thumb_id = get_post_thumbnail_id( $attachment_id ); if ( ! empty( $thumb_id ) ) { $attr['poster'] = wp_get_attachment_url( $thumb_id ); } echo wp_video_shortcode( $attr ); elseif ( isset( $thumb_url[0] ) ) : ?> <div class="wp_attachment_image wp-clearfix" id="media-head-<?php echo $attachment_id; ?>"> <p id="thumbnail-head-<?php echo $attachment_id; ?>"> <img class="thumbnail" src="<?php echo set_url_scheme( $thumb_url[0] ); ?>" style="max-width:100%" alt="" /> </p> </div> <?php else : /** * Fires when an attachment type can't be rendered in the edit form. * * @since 4.6.0 * * @param WP_Post $post A post object. */ do_action( 'wp_edit_form_attachment_display', $post ); endif; ?> </div> <div class="wp_attachment_details edit-form-section"> <?php if ( str_starts_with( $post->post_mime_type, 'image' ) ) : ?> <p class="attachment-alt-text"> <label for="attachment_alt"><strong><?php _e( 'Alternative Text' ); ?></strong></label><br /> <textarea class="widefat" name="_wp_attachment_image_alt" id="attachment_alt" aria-describedby="alt-text-description"><?php echo esc_attr( $alt_text ); ?></textarea> </p> <p class="attachment-alt-text-description" id="alt-text-description"> <?php printf( /* translators: 1: Link to tutorial, 2: Additional link attributes, 3: Accessibility text. */ __( '<a href="%1$s" %2$s>Learn how to describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ), /* translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. */ esc_url( __( 'https://www.w3.org/WAI/tutorials/images/decision-tree/' ) ), 'target="_blank"', sprintf( '<span class="screen-reader-text"> %s</span>', /* translators: Hidden accessibility text. */ __( '(opens in a new tab)' ) ) ); ?> </p> <?php endif; ?> <p> <label for="attachment_caption"><strong><?php _e( 'Caption' ); ?></strong></label><br /> <textarea class="widefat" name="excerpt" id="attachment_caption"><?php echo $post->post_excerpt; ?></textarea> </p> <?php $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' ); $editor_args = array( 'textarea_name' => 'content', 'textarea_rows' => 5, 'media_buttons' => false, /** * Filters the TinyMCE argument for the media description field on the attachment details screen. * * @since 6.6.0 * * @param bool $tinymce Whether to activate TinyMCE in media description field. Default false. */ 'tinymce' => apply_filters( 'activate_tinymce_for_media_description', false ), 'quicktags' => $quicktags_settings, ); ?> <label for="attachment_content" class="attachment-content-description"><strong><?php _e( 'Description' ); ?></strong> <?php if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) { echo ': ' . __( 'Displayed on attachment pages.' ); } ?> </label> <?php wp_editor( format_to_edit( $post->post_content ), 'attachment_content', $editor_args ); ?> </div> <?php $extras = get_compat_media_markup( $post->ID ); echo $extras['item']; echo '<input type="hidden" id="image-edit-context" value="edit-attachment" />' . "\n"; } /** * Displays non-editable attachment metadata in the publish meta box. * * @since 3.5.0 */ function attachment_submitbox_metadata() { $post = get_post(); $attachment_id = $post->ID; $file = get_attached_file( $attachment_id ); $filename = esc_html( wp_basename( $file ) ); $media_dims = ''; $meta = wp_get_attachment_metadata( $attachment_id ); if ( isset( $meta['width'], $meta['height'] ) ) { /* translators: 1: A number of pixels wide, 2: A number of pixels tall. */ $media_dims .= "<span id='media-dims-$attachment_id'>" . sprintf( __( '%1$s by %2$s pixels' ), $meta['width'], $meta['height'] ) . '</span>'; } /** This filter is documented in wp-admin/includes/media.php */ $media_dims = apply_filters( 'media_meta', $media_dims, $post ); $att_url = wp_get_attachment_url( $attachment_id ); $author = new WP_User( $post->post_author ); $uploaded_by_name = __( '(no author)' ); $uploaded_by_link = ''; if ( $author->exists() ) { $uploaded_by_name = $author->display_name ? $author->display_name : $author->nickname; $uploaded_by_link = get_edit_user_link( $author->ID ); } ?> <div class="misc-pub-section misc-pub-uploadedby"> <?php if ( $uploaded_by_link ) { ?> <?php _e( 'Uploaded by:' ); ?> <a href="<?php echo $uploaded_by_link; ?>"><strong><?php echo $uploaded_by_name; ?></strong></a> <?php } else { ?> <?php _e( 'Uploaded by:' ); ?> <strong><?php echo $uploaded_by_name; ?></strong> <?php } ?> </div> <?php if ( $post->post_parent ) { $post_parent = get_post( $post->post_parent ); if ( $post_parent ) { $uploaded_to_title = $post_parent->post_title ? $post_parent->post_title : __( '(no title)' ); $uploaded_to_link = get_edit_post_link( $post->post_parent, 'raw' ); ?> <div class="misc-pub-section misc-pub-uploadedto"> <?php if ( $uploaded_to_link ) { ?> <?php _e( 'Uploaded to:' ); ?> <a href="<?php echo $uploaded_to_link; ?>"><strong><?php echo $uploaded_to_title; ?></strong></a> <?php } else { ?> <?php _e( 'Uploaded to:' ); ?> <strong><?php echo $uploaded_to_title; ?></strong> <?php } ?> </div> <?php } } ?> <div class="misc-pub-section misc-pub-attachment"> <label for="attachment_url"><?php _e( 'File URL:' ); ?></label> <input type="text" class="widefat urlfield" readonly="readonly" name="attachment_url" id="attachment_url" value="<?php echo esc_attr( $att_url ); ?>" /> <span class="copy-to-clipboard-container"> <button type="button" class="button copy-attachment-url edit-media" data-clipboard-target="#attachment_url"><?php _e( 'Copy URL to clipboard' ); ?></button> <span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span> </span> </div> <div class="misc-pub-section misc-pub-download"> <a href="<?php echo esc_attr( $att_url ); ?>" download><?php _e( 'Download file' ); ?></a> </div> <div class="misc-pub-section misc-pub-filename"> <?php _e( 'File name:' ); ?> <strong><?php echo $filename; ?></strong> </div> <div class="misc-pub-section misc-pub-filetype"> <?php _e( 'File type:' ); ?> <strong> <?php if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) ) { echo esc_html( strtoupper( $matches[1] ) ); list( $mime_type ) = explode( '/', $post->post_mime_type ); if ( 'image' !== $mime_type && ! empty( $meta['mime_type'] ) ) { if ( "$mime_type/" . strtolower( $matches[1] ) !== $meta['mime_type'] ) { echo ' (' . $meta['mime_type'] . ')'; } } } else { echo strtoupper( str_replace( 'image/', '', $post->post_mime_type ) ); } ?> </strong> </div> <?php $file_size = false; if ( isset( $meta['filesize'] ) ) { $file_size = $meta['filesize']; } elseif ( file_exists( $file ) ) { $file_size = wp_filesize( $file ); } if ( ! empty( $file_size ) ) { ?> <div class="misc-pub-section misc-pub-filesize"> <?php _e( 'File size:' ); ?> <strong><?php echo size_format( $file_size ); ?></strong> </div> <?php } if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) { $fields = array( 'length_formatted' => __( 'Length:' ), 'bitrate' => __( 'Bitrate:' ), ); /** * Filters the audio and video metadata fields to be shown in the publish meta box. * * The key for each item in the array should correspond to an attachment * metadata key, and the value should be the desired label. * * @since 3.7.0 * @since 4.9.0 Added the `$post` parameter. * * @param array $fields An array of the attachment metadata keys and labels. * @param WP_Post $post WP_Post object for the current attachment. */ $fields = apply_filters( 'media_submitbox_misc_sections', $fields, $post ); foreach ( $fields as $key => $label ) { if ( empty( $meta[ $key ] ) ) { continue; } ?> <div class="misc-pub-section misc-pub-mime-meta misc-pub-<?php echo sanitize_html_class( $key ); ?>"> <?php echo $label; ?> <strong> <?php switch ( $key ) { case 'bitrate': echo round( $meta['bitrate'] / 1000 ) . 'kb/s'; if ( ! empty( $meta['bitrate_mode'] ) ) { echo ' ' . strtoupper( esc_html( $meta['bitrate_mode'] ) ); } break; case 'length_formatted': echo human_readable_duration( $meta['length_formatted'] ); break; default: echo esc_html( $meta[ $key ] ); break; } ?> </strong> </div> <?php } $fields = array( 'dataformat' => __( 'Audio Format:' ), 'codec' => __( 'Audio Codec:' ), ); /** * Filters the audio attachment metadata fields to be shown in the publish meta box. * * The key for each item in the array should correspond to an attachment * metadata key, and the value should be the desired label. * * @since 3.7.0 * @since 4.9.0 Added the `$post` parameter. * * @param array $fields An array of the attachment metadata keys and labels. * @param WP_Post $post WP_Post object for the current attachment. */ $audio_fields = apply_filters( 'audio_submitbox_misc_sections', $fields, $post ); foreach ( $audio_fields as $key => $label ) { if ( empty( $meta['audio'][ $key ] ) ) { continue; } ?> <div class="misc-pub-section misc-pub-audio misc-pub-<?php echo sanitize_html_class( $key ); ?>"> <?php echo $label; ?> <strong><?php echo esc_html( $meta['audio'][ $key ] ); ?></strong> </div> <?php } } if ( $media_dims ) { ?> <div class="misc-pub-section misc-pub-dimensions"> <?php _e( 'Dimensions:' ); ?> <strong><?php echo $media_dims; ?></strong> </div> <?php } if ( ! empty( $meta['original_image'] ) ) { ?> <div class="misc-pub-section misc-pub-original-image word-wrap-break-word"> <?php _e( 'Original image:' ); ?> <a href="<?php echo esc_url( wp_get_original_image_url( $attachment_id ) ); ?>"> <strong><?php echo esc_html( wp_basename( wp_get_original_image_path( $attachment_id ) ) ); ?></strong> </a> </div> <?php } } /** * Parses ID3v2, ID3v1, and getID3 comments to extract usable data. * * @since 3.6.0 * * @param array $metadata An existing array with data. * @param array $data Data supplied by ID3 tags. */ function wp_add_id3_tag_data( &$metadata, $data ) { foreach ( array( 'id3v2', 'id3v1' ) as $version ) { if ( ! empty( $data[ $version ]['comments'] ) ) { foreach ( $data[ $version ]['comments'] as $key => $list ) { if ( 'length' !== $key && ! empty( $list ) ) { $metadata[ $key ] = wp_kses_post( reset( $list ) ); // Fix bug in byte stream analysis. if ( 'terms_of_use' === $key && str_starts_with( $metadata[ $key ], 'yright notice.' ) ) { $metadata[ $key ] = 'Cop' . $metadata[ $key ]; } } } break; } } if ( ! empty( $data['id3v2']['APIC'] ) ) { $image = reset( $data['id3v2']['APIC'] ); if ( ! empty( $image['data'] ) ) { $metadata['image'] = array( 'data' => $image['data'], 'mime' => $image['image_mime'], 'width' => $image['image_width'], 'height' => $image['image_height'], ); } } elseif ( ! empty( $data['comments']['picture'] ) ) { $image = reset( $data['comments']['picture'] ); if ( ! empty( $image['data'] ) ) { $metadata['image'] = array( 'data' => $image['data'], 'mime' => $image['image_mime'], ); } } } /** * Retrieves metadata from a video file's ID3 tags. * * @since 3.6.0 * * @param string $file Path to file. * @return array|false Returns array of metadata, if found. */ function wp_read_video_metadata( $file ) { if ( ! file_exists( $file ) ) { return false; } $metadata = array(); if ( ! defined( 'GETID3_TEMP_DIR' ) ) { define( 'GETID3_TEMP_DIR', get_temp_dir() ); } if ( ! class_exists( 'getID3', false ) ) { require ABSPATH . WPINC . '/ID3/getid3.php'; } $id3 = new getID3(); // Required to get the `created_timestamp` value. $id3->options_audiovideo_quicktime_ReturnAtomData = true; // phpcs:ignore WordPress.NamingConventions.ValidVariableName $data = $id3->analyze( $file ); if ( isset( $data['video']['lossless'] ) ) { $metadata['lossless'] = $data['video']['lossless']; } if ( ! empty( $data['video']['bitrate'] ) ) { $metadata['bitrate'] = (int) $data['video']['bitrate']; } if ( ! empty( $data['video']['bitrate_mode'] ) ) { $metadata['bitrate_mode'] = $data['video']['bitrate_mode']; } if ( ! empty( $data['filesize'] ) ) { $metadata['filesize'] = (int) $data['filesize']; } if ( ! empty( $data['mime_type'] ) ) { $metadata['mime_type'] = $data['mime_type']; } if ( ! empty( $data['playtime_seconds'] ) ) { $metadata['length'] = (int) round( $data['playtime_seconds'] ); } if ( ! empty( $data['playtime_string'] ) ) { $metadata['length_formatted'] = $data['playtime_string']; } if ( ! empty( $data['video']['resolution_x'] ) ) { $metadata['width'] = (int) $data['video']['resolution_x']; } if ( ! empty( $data['video']['resolution_y'] ) ) { $metadata['height'] = (int) $data['video']['resolution_y']; } if ( ! empty( $data['fileformat'] ) ) { $metadata['fileformat'] = $data['fileformat']; } if ( ! empty( $data['video']['dataformat'] ) ) { $metadata['dataformat'] = $data['video']['dataformat']; } if ( ! empty( $data['video']['encoder'] ) ) { $metadata['encoder'] = $data['video']['encoder']; } if ( ! empty( $data['video']['codec'] ) ) { $metadata['codec'] = $data['video']['codec']; } if ( ! empty( $data['audio'] ) ) { unset( $data['audio']['streams'] ); $metadata['audio'] = $data['audio']; } if ( empty( $metadata['created_timestamp'] ) ) { $created_timestamp = wp_get_media_creation_timestamp( $data ); if ( false !== $created_timestamp ) { $metadata['created_timestamp'] = $created_timestamp; } } wp_add_id3_tag_data( $metadata, $data ); $file_format = isset( $metadata['fileformat'] ) ? $metadata['fileformat'] : null; /** * Filters the array of metadata retrieved from a video. * * In core, usually this selection is what is stored. * More complete data can be parsed from the `$data` parameter. * * @since 4.9.0 * * @param array $metadata Filtered video metadata. * @param string $file Path to video file. * @param string|null $file_format File format of video, as analyzed by getID3. * Null if unknown. * @param array $data Raw metadata from getID3. */ return apply_filters( 'wp_read_video_metadata', $metadata, $file, $file_format, $data ); } /** * Retrieves metadata from an audio file's ID3 tags. * * @since 3.6.0 * * @param string $file Path to file. * @return array|false Returns array of metadata, if found. */ function wp_read_audio_metadata( $file ) { if ( ! file_exists( $file ) ) { return false; } $metadata = array(); if ( ! defined( 'GETID3_TEMP_DIR' ) ) { define( 'GETID3_TEMP_DIR', get_temp_dir() ); } if ( ! class_exists( 'getID3', false ) ) { require ABSPATH . WPINC . '/ID3/getid3.php'; } $id3 = new getID3(); // Required to get the `created_timestamp` value. $id3->options_audiovideo_quicktime_ReturnAtomData = true; // phpcs:ignore WordPress.NamingConventions.ValidVariableName $data = $id3->analyze( $file ); if ( ! empty( $data['audio'] ) ) { unset( $data['audio']['streams'] ); $metadata = $data['audio']; } if ( ! empty( $data['fileformat'] ) ) { $metadata['fileformat'] = $data['fileformat']; } if ( ! empty( $data['filesize'] ) ) { $metadata['filesize'] = (int) $data['filesize']; } if ( ! empty( $data['mime_type'] ) ) { $metadata['mime_type'] = $data['mime_type']; } if ( ! empty( $data['playtime_seconds'] ) ) { $metadata['length'] = (int) round( $data['playtime_seconds'] ); } if ( ! empty( $data['playtime_string'] ) ) { $metadata['length_formatted'] = $data['playtime_string']; } if ( empty( $metadata['created_timestamp'] ) ) { $created_timestamp = wp_get_media_creation_timestamp( $data ); if ( false !== $created_timestamp ) { $metadata['created_timestamp'] = $created_timestamp; } } wp_add_id3_tag_data( $metadata, $data ); $file_format = isset( $metadata['fileformat'] ) ? $metadata['fileformat'] : null; /** * Filters the array of metadata retrieved from an audio file. * * In core, usually this selection is what is stored. * More complete data can be parsed from the `$data` parameter. * * @since 6.1.0 * * @param array $metadata Filtered audio metadata. * @param string $file Path to audio file. * @param string|null $file_format File format of audio, as analyzed by getID3. * Null if unknown. * @param array $data Raw metadata from getID3. */ return apply_filters( 'wp_read_audio_metadata', $metadata, $file, $file_format, $data ); } /** * Parses creation date from media metadata. * * The getID3 library doesn't have a standard method for getting creation dates, * so the location of this data can vary based on the MIME type. * * @since 4.9.0 * * @link https://github.com/JamesHeinrich/getID3/blob/master/structure.txt * * @param array $metadata The metadata returned by getID3::analyze(). * @return int|false A UNIX timestamp for the media's creation date if available * or a boolean FALSE if a timestamp could not be determined. */ function wp_get_media_creation_timestamp( $metadata ) { $creation_date = false; if ( empty( $metadata['fileformat'] ) ) { return $creation_date; } switch ( $metadata['fileformat'] ) { case 'asf': if ( isset( $metadata['asf']['file_properties_object']['creation_date_unix'] ) ) { $creation_date = (int) $metadata['asf']['file_properties_object']['creation_date_unix']; } break; case 'matroska': case 'webm': if ( isset( $metadata['matroska']['comments']['creation_time'][0] ) ) { $creation_date = strtotime( $metadata['matroska']['comments']['creation_time'][0] ); } elseif ( isset( $metadata['matroska']['info'][0]['DateUTC_unix'] ) ) { $creation_date = (int) $metadata['matroska']['info'][0]['DateUTC_unix']; } break; case 'quicktime': case 'mp4': if ( isset( $metadata['quicktime']['moov']['subatoms'][0]['creation_time_unix'] ) ) { $creation_date = (int) $metadata['quicktime']['moov']['subatoms'][0]['creation_time_unix']; } break; } return $creation_date; } /** * Encapsulates the logic for Attach/Detach actions. * * @since 4.2.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $parent_id Attachment parent ID. * @param string $action Optional. Attach/detach action. Accepts 'attach' or 'detach'. * Default 'attach'. */ function wp_media_attach_action( $parent_id, $action = 'attach' ) { global $wpdb; if ( ! $parent_id ) { return; } if ( ! current_user_can( 'edit_post', $parent_id ) ) { wp_die( __( 'Sorry, you are not allowed to edit this post.' ) ); } $ids = array(); foreach ( (array) $_REQUEST['media'] as $attachment_id ) { $attachment_id = (int) $attachment_id; if ( ! current_user_can( 'edit_post', $attachment_id ) ) { continue; } $ids[] = $attachment_id; } if ( ! empty( $ids ) ) { $ids_string = implode( ',', $ids ); if ( 'attach' === $action ) { $result = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_parent = %d WHERE post_type = 'attachment' AND ID IN ( $ids_string )", $parent_id ) ); } else { $result = $wpdb->query( "UPDATE $wpdb->posts SET post_parent = 0 WHERE post_type = 'attachment' AND ID IN ( $ids_string )" ); } } if ( isset( $result ) ) { foreach ( $ids as $attachment_id ) { /** * Fires when media is attached or detached from a post. * * @since 5.5.0 * * @param string $action Attach/detach action. Accepts 'attach' or 'detach'. * @param int $attachment_id The attachment ID. * @param int $parent_id Attachment parent ID. */ do_action( 'wp_media_attach_action', $action, $attachment_id, $parent_id ); clean_attachment_cache( $attachment_id ); } $location = 'upload.php'; $referer = wp_get_referer(); if ( $referer ) { if ( str_contains( $referer, 'upload.php' ) ) { $location = remove_query_arg( array( 'attached', 'detach' ), $referer ); } } $key = 'attach' === $action ? 'attached' : 'detach'; $location = add_query_arg( array( $key => $result ), $location ); wp_redirect( $location ); exit; } } PK x �Z6h� includes/ms-admin-filters.phpnu ��� <?php /** * Multisite Administration hooks * * @package WordPress * @subpackage Administration * @since 4.3.0 */ // Media hooks. add_filter( 'wp_handle_upload_prefilter', 'check_upload_size' ); // User hooks. add_action( 'user_admin_notices', 'new_user_email_admin_notice' ); add_action( 'network_admin_notices', 'new_user_email_admin_notice' ); add_action( 'admin_page_access_denied', '_access_denied_splash', 99 ); // Site hooks. add_action( 'wpmueditblogaction', 'upload_space_setting' ); // Network hooks. add_action( 'update_site_option_admin_email', 'wp_network_admin_email_change_notification', 10, 4 ); // Post hooks. add_filter( 'wp_insert_post_data', 'avoid_blog_page_permalink_collision', 10, 2 ); // Tools hooks. add_filter( 'import_allow_create_users', 'check_import_new_users' ); // Notices hooks. add_action( 'admin_notices', 'site_admin_notice' ); add_action( 'network_admin_notices', 'site_admin_notice' ); // Update hooks. add_action( 'network_admin_notices', 'update_nag', 3 ); add_action( 'network_admin_notices', 'maintenance_nag', 10 ); // Network Admin hooks. add_action( 'add_site_option_new_admin_email', 'update_network_option_new_admin_email', 10, 2 ); add_action( 'update_site_option_new_admin_email', 'update_network_option_new_admin_email', 10, 2 ); PK x �Z;*�T �T $ includes/class-custom-background.phpnu ��� <?php /** * The custom background script. * * @package WordPress * @subpackage Administration */ /** * The custom background class. * * @since 3.0.0 */ #[AllowDynamicProperties] class Custom_Background { /** * Callback for administration header. * * @since 3.0.0 * @var callable */ public $admin_header_callback; /** * Callback for header div. * * @since 3.0.0 * @var callable */ public $admin_image_div_callback; /** * Used to trigger a success message when settings updated and set to true. * * @since 3.0.0 * @var bool */ private $updated; /** * Constructor - Registers administration header callback. * * @since 3.0.0 * * @param callable $admin_header_callback Optional. Administration header callback. * Default empty string. * @param callable $admin_image_div_callback Optional. Custom image div output callback. * Default empty string. */ public function __construct( $admin_header_callback = '', $admin_image_div_callback = '' ) { $this->admin_header_callback = $admin_header_callback; $this->admin_image_div_callback = $admin_image_div_callback; add_action( 'admin_menu', array( $this, 'init' ) ); add_action( 'wp_ajax_custom-background-add', array( $this, 'ajax_background_add' ) ); // Unused since 3.5.0. add_action( 'wp_ajax_set-background-image', array( $this, 'wp_set_background_image' ) ); } /** * Sets up the hooks for the Custom Background admin page. * * @since 3.0.0 */ public function init() { $page = add_theme_page( _x( 'Background', 'custom background' ), _x( 'Background', 'custom background' ), 'edit_theme_options', 'custom-background', array( $this, 'admin_page' ) ); if ( ! $page ) { return; } add_action( "load-{$page}", array( $this, 'admin_load' ) ); add_action( "load-{$page}", array( $this, 'take_action' ), 49 ); add_action( "load-{$page}", array( $this, 'handle_upload' ), 49 ); if ( $this->admin_header_callback ) { add_action( "admin_head-{$page}", $this->admin_header_callback, 51 ); } } /** * Sets up the enqueue for the CSS & JavaScript files. * * @since 3.0.0 */ public function admin_load() { get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'You can customize the look of your site without touching any of your theme’s code by using a custom background. Your background can be an image or a color.' ) . '</p>' . '<p>' . __( 'To use a background image, simply upload it or choose an image that has already been uploaded to your Media Library by clicking the “Choose Image” button. You can display a single instance of your image, or tile it to fill the screen. You can have your background fixed in place, so your site content moves on top of it, or you can have it scroll with your site.' ) . '</p>' . '<p>' . __( 'You can also choose a background color by clicking the Select Color button and either typing in a legitimate HTML hex value, e.g. “#ff0000” for red, or by choosing a color using the color picker.' ) . '</p>' . '<p>' . __( 'Do not forget to click on the Save Changes button when you are finished.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://codex.wordpress.org/Appearance_Background_Screen">Documentation on Custom Background</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); wp_enqueue_media(); wp_enqueue_script( 'custom-background' ); wp_enqueue_style( 'wp-color-picker' ); } /** * Executes custom background modification. * * @since 3.0.0 */ public function take_action() { if ( empty( $_POST ) ) { return; } if ( isset( $_POST['reset-background'] ) ) { check_admin_referer( 'custom-background-reset', '_wpnonce-custom-background-reset' ); remove_theme_mod( 'background_image' ); remove_theme_mod( 'background_image_thumb' ); $this->updated = true; return; } if ( isset( $_POST['remove-background'] ) ) { // @todo Uploaded files are not removed here. check_admin_referer( 'custom-background-remove', '_wpnonce-custom-background-remove' ); set_theme_mod( 'background_image', '' ); set_theme_mod( 'background_image_thumb', '' ); $this->updated = true; wp_safe_redirect( $_POST['_wp_http_referer'] ); return; } if ( isset( $_POST['background-preset'] ) ) { check_admin_referer( 'custom-background' ); if ( in_array( $_POST['background-preset'], array( 'default', 'fill', 'fit', 'repeat', 'custom' ), true ) ) { $preset = $_POST['background-preset']; } else { $preset = 'default'; } set_theme_mod( 'background_preset', $preset ); } if ( isset( $_POST['background-position'] ) ) { check_admin_referer( 'custom-background' ); $position = explode( ' ', $_POST['background-position'] ); if ( in_array( $position[0], array( 'left', 'center', 'right' ), true ) ) { $position_x = $position[0]; } else { $position_x = 'left'; } if ( in_array( $position[1], array( 'top', 'center', 'bottom' ), true ) ) { $position_y = $position[1]; } else { $position_y = 'top'; } set_theme_mod( 'background_position_x', $position_x ); set_theme_mod( 'background_position_y', $position_y ); } if ( isset( $_POST['background-size'] ) ) { check_admin_referer( 'custom-background' ); if ( in_array( $_POST['background-size'], array( 'auto', 'contain', 'cover' ), true ) ) { $size = $_POST['background-size']; } else { $size = 'auto'; } set_theme_mod( 'background_size', $size ); } if ( isset( $_POST['background-repeat'] ) ) { check_admin_referer( 'custom-background' ); $repeat = $_POST['background-repeat']; if ( 'no-repeat' !== $repeat ) { $repeat = 'repeat'; } set_theme_mod( 'background_repeat', $repeat ); } if ( isset( $_POST['background-attachment'] ) ) { check_admin_referer( 'custom-background' ); $attachment = $_POST['background-attachment']; if ( 'fixed' !== $attachment ) { $attachment = 'scroll'; } set_theme_mod( 'background_attachment', $attachment ); } if ( isset( $_POST['background-color'] ) ) { check_admin_referer( 'custom-background' ); $color = preg_replace( '/[^0-9a-fA-F]/', '', $_POST['background-color'] ); if ( strlen( $color ) === 6 || strlen( $color ) === 3 ) { set_theme_mod( 'background_color', $color ); } else { set_theme_mod( 'background_color', '' ); } } $this->updated = true; } /** * Displays the custom background page. * * @since 3.0.0 */ public function admin_page() { ?> <div class="wrap" id="custom-background"> <h1><?php _e( 'Custom Background' ); ?></h1> <?php if ( current_user_can( 'customize' ) ) { $message = sprintf( /* translators: %s: URL to background image configuration in Customizer. */ __( 'You can now manage and live-preview Custom Backgrounds in the <a href="%s">Customizer</a>.' ), admin_url( 'customize.php?autofocus[control]=background_image' ) ); wp_admin_notice( $message, array( 'type' => 'info', 'additional_classes' => array( 'hide-if-no-customize' ), ) ); } if ( ! empty( $this->updated ) ) { $updated_message = sprintf( /* translators: %s: Home URL. */ __( 'Background updated. <a href="%s">Visit your site</a> to see how it looks.' ), esc_url( home_url( '/' ) ) ); wp_admin_notice( $updated_message, array( 'id' => 'message', 'additional_classes' => array( 'updated' ), ) ); } ?> <h2><?php _e( 'Background Image' ); ?></h2> <table class="form-table" role="presentation"> <tbody> <tr> <th scope="row"><?php _e( 'Preview' ); ?></th> <td> <?php if ( $this->admin_image_div_callback ) { call_user_func( $this->admin_image_div_callback ); } else { $background_styles = ''; $bgcolor = get_background_color(); if ( $bgcolor ) { $background_styles .= 'background-color: ' . maybe_hash_hex_color( $bgcolor ) . ';'; } $background_image_thumb = get_background_image(); if ( $background_image_thumb ) { $background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', $background_image_thumb ) ) ) ); $background_position_x = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ); $background_position_y = get_theme_mod( 'background_position_y', get_theme_support( 'custom-background', 'default-position-y' ) ); $background_size = get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ); $background_repeat = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ); $background_attachment = get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) ); // Background-image URL must be single quote, see below. $background_styles .= " background-image: url('$background_image_thumb');" . " background-size: $background_size;" . " background-position: $background_position_x $background_position_y;" . " background-repeat: $background_repeat;" . " background-attachment: $background_attachment;"; } ?> <div id="custom-background-image" style="<?php echo $background_styles; ?>"><?php // Must be double quote, see above. ?> <?php if ( $background_image_thumb ) { ?> <img class="custom-background-image" src="<?php echo $background_image_thumb; ?>" style="visibility:hidden;" alt="" /><br /> <img class="custom-background-image" src="<?php echo $background_image_thumb; ?>" style="visibility:hidden;" alt="" /> <?php } ?> </div> <?php } ?> </td> </tr> <?php if ( get_background_image() ) : ?> <tr> <th scope="row"><?php _e( 'Remove Image' ); ?></th> <td> <form method="post"> <?php wp_nonce_field( 'custom-background-remove', '_wpnonce-custom-background-remove' ); ?> <?php submit_button( __( 'Remove Background Image' ), '', 'remove-background', false ); ?><br /> <?php _e( 'This will remove the background image. You will not be able to restore any customizations.' ); ?> </form> </td> </tr> <?php endif; ?> <?php $default_image = get_theme_support( 'custom-background', 'default-image' ); ?> <?php if ( $default_image && get_background_image() !== $default_image ) : ?> <tr> <th scope="row"><?php _e( 'Restore Original Image' ); ?></th> <td> <form method="post"> <?php wp_nonce_field( 'custom-background-reset', '_wpnonce-custom-background-reset' ); ?> <?php submit_button( __( 'Restore Original Image' ), '', 'reset-background', false ); ?><br /> <?php _e( 'This will restore the original background image. You will not be able to restore any customizations.' ); ?> </form> </td> </tr> <?php endif; ?> <?php if ( current_user_can( 'upload_files' ) ) : ?> <tr> <th scope="row"><?php _e( 'Select Image' ); ?></th> <td><form enctype="multipart/form-data" id="upload-form" class="wp-upload-form" method="post"> <p> <label for="upload"><?php _e( 'Choose an image from your computer:' ); ?></label><br /> <input type="file" id="upload" name="import" /> <input type="hidden" name="action" value="save" /> <?php wp_nonce_field( 'custom-background-upload', '_wpnonce-custom-background-upload' ); ?> <?php submit_button( _x( 'Upload', 'verb' ), '', 'submit', false ); ?> </p> <p> <label for="choose-from-library-link"><?php _e( 'Or choose an image from your media library:' ); ?></label><br /> <button id="choose-from-library-link" class="button" data-choose="<?php esc_attr_e( 'Choose a Background Image' ); ?>" data-update="<?php esc_attr_e( 'Set as background' ); ?>"><?php _e( 'Choose Image' ); ?></button> </p> </form> </td> </tr> <?php endif; ?> </tbody> </table> <h2><?php _e( 'Display Options' ); ?></h2> <form method="post"> <table class="form-table" role="presentation"> <tbody> <?php if ( get_background_image() ) : ?> <input name="background-preset" type="hidden" value="custom"> <?php $background_position = sprintf( '%s %s', get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ), get_theme_mod( 'background_position_y', get_theme_support( 'custom-background', 'default-position-y' ) ) ); $background_position_options = array( array( 'left top' => array( 'label' => __( 'Top Left' ), 'icon' => 'dashicons dashicons-arrow-left-alt', ), 'center top' => array( 'label' => __( 'Top' ), 'icon' => 'dashicons dashicons-arrow-up-alt', ), 'right top' => array( 'label' => __( 'Top Right' ), 'icon' => 'dashicons dashicons-arrow-right-alt', ), ), array( 'left center' => array( 'label' => __( 'Left' ), 'icon' => 'dashicons dashicons-arrow-left-alt', ), 'center center' => array( 'label' => __( 'Center' ), 'icon' => 'background-position-center-icon', ), 'right center' => array( 'label' => __( 'Right' ), 'icon' => 'dashicons dashicons-arrow-right-alt', ), ), array( 'left bottom' => array( 'label' => __( 'Bottom Left' ), 'icon' => 'dashicons dashicons-arrow-left-alt', ), 'center bottom' => array( 'label' => __( 'Bottom' ), 'icon' => 'dashicons dashicons-arrow-down-alt', ), 'right bottom' => array( 'label' => __( 'Bottom Right' ), 'icon' => 'dashicons dashicons-arrow-right-alt', ), ), ); ?> <tr> <th scope="row"><?php _e( 'Image Position' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ _e( 'Image Position' ); ?> </span></legend> <div class="background-position-control"> <?php foreach ( $background_position_options as $group ) : ?> <div class="button-group"> <?php foreach ( $group as $value => $input ) : ?> <label> <input class="ui-helper-hidden-accessible" name="background-position" type="radio" value="<?php echo esc_attr( $value ); ?>"<?php checked( $value, $background_position ); ?>> <span class="button display-options position"><span class="<?php echo esc_attr( $input['icon'] ); ?>" aria-hidden="true"></span></span> <span class="screen-reader-text"><?php echo $input['label']; ?></span> </label> <?php endforeach; ?> </div> <?php endforeach; ?> </div> </fieldset></td> </tr> <tr> <th scope="row"><label for="background-size"><?php _e( 'Image Size' ); ?></label></th> <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ _e( 'Image Size' ); ?> </span></legend> <select id="background-size" name="background-size"> <option value="auto"<?php selected( 'auto', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _ex( 'Original', 'Original Size' ); ?></option> <option value="contain"<?php selected( 'contain', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _e( 'Fit to Screen' ); ?></option> <option value="cover"<?php selected( 'cover', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _e( 'Fill Screen' ); ?></option> </select> </fieldset></td> </tr> <tr> <th scope="row"><?php _ex( 'Repeat', 'Background Repeat' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ _ex( 'Repeat', 'Background Repeat' ); ?> </span></legend> <input name="background-repeat" type="hidden" value="no-repeat"> <label><input type="checkbox" name="background-repeat" value="repeat"<?php checked( 'repeat', get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) ); ?>> <?php _e( 'Repeat Background Image' ); ?></label> </fieldset></td> </tr> <tr> <th scope="row"><?php _ex( 'Scroll', 'Background Scroll' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ _ex( 'Scroll', 'Background Scroll' ); ?> </span></legend> <input name="background-attachment" type="hidden" value="fixed"> <label><input name="background-attachment" type="checkbox" value="scroll" <?php checked( 'scroll', get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) ) ); ?>> <?php _e( 'Scroll with Page' ); ?></label> </fieldset></td> </tr> <?php endif; // get_background_image() ?> <tr> <th scope="row"><?php _e( 'Background Color' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ _e( 'Background Color' ); ?> </span></legend> <?php $default_color = ''; if ( current_theme_supports( 'custom-background', 'default-color' ) ) { $default_color = ' data-default-color="#' . esc_attr( get_theme_support( 'custom-background', 'default-color' ) ) . '"'; } ?> <input type="text" name="background-color" id="background-color" value="#<?php echo esc_attr( get_background_color() ); ?>"<?php echo $default_color; ?>> </fieldset></td> </tr> </tbody> </table> <?php wp_nonce_field( 'custom-background' ); ?> <?php submit_button( null, 'primary', 'save-background-options' ); ?> </form> </div> <?php } /** * Handles an Image upload for the background image. * * @since 3.0.0 */ public function handle_upload() { if ( empty( $_FILES ) ) { return; } check_admin_referer( 'custom-background-upload', '_wpnonce-custom-background-upload' ); $overrides = array( 'test_form' => false ); $uploaded_file = $_FILES['import']; $wp_filetype = wp_check_filetype_and_ext( $uploaded_file['tmp_name'], $uploaded_file['name'] ); if ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) ) { wp_die( __( 'The uploaded file is not a valid image. Please try again.' ) ); } $file = wp_handle_upload( $uploaded_file, $overrides ); if ( isset( $file['error'] ) ) { wp_die( $file['error'] ); } $url = $file['url']; $type = $file['type']; $file = $file['file']; $filename = wp_basename( $file ); // Construct the attachment array. $attachment = array( 'post_title' => $filename, 'post_content' => $url, 'post_mime_type' => $type, 'guid' => $url, 'context' => 'custom-background', ); // Save the data. $id = wp_insert_attachment( $attachment, $file ); // Add the metadata. wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) ); update_post_meta( $id, '_wp_attachment_is_custom_background', get_option( 'stylesheet' ) ); set_theme_mod( 'background_image', sanitize_url( $url ) ); $thumbnail = wp_get_attachment_image_src( $id, 'thumbnail' ); set_theme_mod( 'background_image_thumb', sanitize_url( $thumbnail[0] ) ); /** This filter is documented in wp-admin/includes/class-custom-image-header.php */ $file = apply_filters( 'wp_create_file_in_uploads', $file, $id ); // For replication. $this->updated = true; } /** * Handles Ajax request for adding custom background context to an attachment. * * Triggers when the user adds a new background image from the * Media Manager. * * @since 4.1.0 */ public function ajax_background_add() { check_ajax_referer( 'background-add', 'nonce' ); if ( ! current_user_can( 'edit_theme_options' ) ) { wp_send_json_error(); } $attachment_id = absint( $_POST['attachment_id'] ); if ( $attachment_id < 1 ) { wp_send_json_error(); } update_post_meta( $attachment_id, '_wp_attachment_is_custom_background', get_stylesheet() ); wp_send_json_success(); } /** * @since 3.4.0 * @deprecated 3.5.0 * * @param array $form_fields * @return array $form_fields */ public function attachment_fields_to_edit( $form_fields ) { return $form_fields; } /** * @since 3.4.0 * @deprecated 3.5.0 * * @param array $tabs * @return array $tabs */ public function filter_upload_tabs( $tabs ) { return $tabs; } /** * @since 3.4.0 * @deprecated 3.5.0 */ public function wp_set_background_image() { check_ajax_referer( 'custom-background' ); if ( ! current_user_can( 'edit_theme_options' ) || ! isset( $_POST['attachment_id'] ) ) { exit; } $attachment_id = absint( $_POST['attachment_id'] ); $sizes = array_keys( /** This filter is documented in wp-admin/includes/media.php */ apply_filters( 'image_size_names_choose', array( 'thumbnail' => __( 'Thumbnail' ), 'medium' => __( 'Medium' ), 'large' => __( 'Large' ), 'full' => __( 'Full Size' ), ) ) ); $size = 'thumbnail'; if ( in_array( $_POST['size'], $sizes, true ) ) { $size = esc_attr( $_POST['size'] ); } update_post_meta( $attachment_id, '_wp_attachment_is_custom_background', get_option( 'stylesheet' ) ); $url = wp_get_attachment_image_src( $attachment_id, $size ); $thumbnail = wp_get_attachment_image_src( $attachment_id, 'thumbnail' ); set_theme_mod( 'background_image', sanitize_url( $url[0] ) ); set_theme_mod( 'background_image_thumb', sanitize_url( $thumbnail[0] ) ); exit; } } PK x �Z�(��W W includes/class-pclzip.phpnu ��� <?php // -------------------------------------------------------------------------------- // PhpConcept Library - Zip Module 2.8.2 // -------------------------------------------------------------------------------- // License GNU/LGPL - Vincent Blavet - August 2009 // http://www.phpconcept.net // -------------------------------------------------------------------------------- // // Presentation : // PclZip is a PHP library that manage ZIP archives. // So far tests show that archives generated by PclZip are readable by // WinZip application and other tools. // // Description : // See readme.txt and http://www.phpconcept.net // // Warning : // This library and the associated files are non commercial, non professional // work. // It should not have unexpected results. However if any damage is caused by // this software the author can not be responsible. // The use of this software is at the risk of the user. // // -------------------------------------------------------------------------------- // $Id: pclzip.lib.php,v 1.60 2009/09/30 21:01:04 vblavet Exp $ // -------------------------------------------------------------------------------- // ----- Constants if (!defined('PCLZIP_READ_BLOCK_SIZE')) { define( 'PCLZIP_READ_BLOCK_SIZE', 2048 ); } // ----- File list separator // In version 1.x of PclZip, the separator for file list is a space // (which is not a very smart choice, specifically for windows paths !). // A better separator should be a comma (,). This constant gives you the // ability to change that. // However notice that changing this value, may have impact on existing // scripts, using space separated filenames. // Recommended values for compatibility with older versions : //define( 'PCLZIP_SEPARATOR', ' ' ); // Recommended values for smart separation of filenames. if (!defined('PCLZIP_SEPARATOR')) { define( 'PCLZIP_SEPARATOR', ',' ); } // ----- Error configuration // 0 : PclZip Class integrated error handling // 1 : PclError external library error handling. By enabling this // you must ensure that you have included PclError library. // [2,...] : reserved for future use if (!defined('PCLZIP_ERROR_EXTERNAL')) { define( 'PCLZIP_ERROR_EXTERNAL', 0 ); } // ----- Optional static temporary directory // By default temporary files are generated in the script current // path. // If defined : // - MUST BE terminated by a '/'. // - MUST be a valid, already created directory // Samples : // define( 'PCLZIP_TEMPORARY_DIR', '/temp/' ); // define( 'PCLZIP_TEMPORARY_DIR', 'C:/Temp/' ); if (!defined('PCLZIP_TEMPORARY_DIR')) { define( 'PCLZIP_TEMPORARY_DIR', '' ); } // ----- Optional threshold ratio for use of temporary files // Pclzip sense the size of the file to add/extract and decide to // use or not temporary file. The algorithm is looking for // memory_limit of PHP and apply a ratio. // threshold = memory_limit * ratio. // Recommended values are under 0.5. Default 0.47. // Samples : // define( 'PCLZIP_TEMPORARY_FILE_RATIO', 0.5 ); if (!defined('PCLZIP_TEMPORARY_FILE_RATIO')) { define( 'PCLZIP_TEMPORARY_FILE_RATIO', 0.47 ); } // -------------------------------------------------------------------------------- // ***** UNDER THIS LINE NOTHING NEEDS TO BE MODIFIED ***** // -------------------------------------------------------------------------------- // ----- Global variables $g_pclzip_version = "2.8.2"; // ----- Error codes // -1 : Unable to open file in binary write mode // -2 : Unable to open file in binary read mode // -3 : Invalid parameters // -4 : File does not exist // -5 : Filename is too long (max. 255) // -6 : Not a valid zip file // -7 : Invalid extracted file size // -8 : Unable to create directory // -9 : Invalid archive extension // -10 : Invalid archive format // -11 : Unable to delete file (unlink) // -12 : Unable to rename file (rename) // -13 : Invalid header checksum // -14 : Invalid archive size define( 'PCLZIP_ERR_USER_ABORTED', 2 ); define( 'PCLZIP_ERR_NO_ERROR', 0 ); define( 'PCLZIP_ERR_WRITE_OPEN_FAIL', -1 ); define( 'PCLZIP_ERR_READ_OPEN_FAIL', -2 ); define( 'PCLZIP_ERR_INVALID_PARAMETER', -3 ); define( 'PCLZIP_ERR_MISSING_FILE', -4 ); define( 'PCLZIP_ERR_FILENAME_TOO_LONG', -5 ); define( 'PCLZIP_ERR_INVALID_ZIP', -6 ); define( 'PCLZIP_ERR_BAD_EXTRACTED_FILE', -7 ); define( 'PCLZIP_ERR_DIR_CREATE_FAIL', -8 ); define( 'PCLZIP_ERR_BAD_EXTENSION', -9 ); define( 'PCLZIP_ERR_BAD_FORMAT', -10 ); define( 'PCLZIP_ERR_DELETE_FILE_FAIL', -11 ); define( 'PCLZIP_ERR_RENAME_FILE_FAIL', -12 ); define( 'PCLZIP_ERR_BAD_CHECKSUM', -13 ); define( 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', -14 ); define( 'PCLZIP_ERR_MISSING_OPTION_VALUE', -15 ); define( 'PCLZIP_ERR_INVALID_OPTION_VALUE', -16 ); define( 'PCLZIP_ERR_ALREADY_A_DIRECTORY', -17 ); define( 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', -18 ); define( 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION', -19 ); define( 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE', -20 ); define( 'PCLZIP_ERR_DIRECTORY_RESTRICTION', -21 ); // ----- Options values define( 'PCLZIP_OPT_PATH', 77001 ); define( 'PCLZIP_OPT_ADD_PATH', 77002 ); define( 'PCLZIP_OPT_REMOVE_PATH', 77003 ); define( 'PCLZIP_OPT_REMOVE_ALL_PATH', 77004 ); define( 'PCLZIP_OPT_SET_CHMOD', 77005 ); define( 'PCLZIP_OPT_EXTRACT_AS_STRING', 77006 ); define( 'PCLZIP_OPT_NO_COMPRESSION', 77007 ); define( 'PCLZIP_OPT_BY_NAME', 77008 ); define( 'PCLZIP_OPT_BY_INDEX', 77009 ); define( 'PCLZIP_OPT_BY_EREG', 77010 ); define( 'PCLZIP_OPT_BY_PREG', 77011 ); define( 'PCLZIP_OPT_COMMENT', 77012 ); define( 'PCLZIP_OPT_ADD_COMMENT', 77013 ); define( 'PCLZIP_OPT_PREPEND_COMMENT', 77014 ); define( 'PCLZIP_OPT_EXTRACT_IN_OUTPUT', 77015 ); define( 'PCLZIP_OPT_REPLACE_NEWER', 77016 ); define( 'PCLZIP_OPT_STOP_ON_ERROR', 77017 ); // Having big trouble with crypt. Need to multiply 2 long int // which is not correctly supported by PHP ... //define( 'PCLZIP_OPT_CRYPT', 77018 ); define( 'PCLZIP_OPT_EXTRACT_DIR_RESTRICTION', 77019 ); define( 'PCLZIP_OPT_TEMP_FILE_THRESHOLD', 77020 ); define( 'PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD', 77020 ); // alias define( 'PCLZIP_OPT_TEMP_FILE_ON', 77021 ); define( 'PCLZIP_OPT_ADD_TEMP_FILE_ON', 77021 ); // alias define( 'PCLZIP_OPT_TEMP_FILE_OFF', 77022 ); define( 'PCLZIP_OPT_ADD_TEMP_FILE_OFF', 77022 ); // alias // ----- File description attributes define( 'PCLZIP_ATT_FILE_NAME', 79001 ); define( 'PCLZIP_ATT_FILE_NEW_SHORT_NAME', 79002 ); define( 'PCLZIP_ATT_FILE_NEW_FULL_NAME', 79003 ); define( 'PCLZIP_ATT_FILE_MTIME', 79004 ); define( 'PCLZIP_ATT_FILE_CONTENT', 79005 ); define( 'PCLZIP_ATT_FILE_COMMENT', 79006 ); // ----- Call backs values define( 'PCLZIP_CB_PRE_EXTRACT', 78001 ); define( 'PCLZIP_CB_POST_EXTRACT', 78002 ); define( 'PCLZIP_CB_PRE_ADD', 78003 ); define( 'PCLZIP_CB_POST_ADD', 78004 ); /* For future use define( 'PCLZIP_CB_PRE_LIST', 78005 ); define( 'PCLZIP_CB_POST_LIST', 78006 ); define( 'PCLZIP_CB_PRE_DELETE', 78007 ); define( 'PCLZIP_CB_POST_DELETE', 78008 ); */ // -------------------------------------------------------------------------------- // Class : PclZip // Description : // PclZip is the class that represent a Zip archive. // The public methods allow the manipulation of the archive. // Attributes : // Attributes must not be accessed directly. // Methods : // PclZip() : Object creator // create() : Creates the Zip archive // listContent() : List the content of the Zip archive // extract() : Extract the content of the archive // properties() : List the properties of the archive // -------------------------------------------------------------------------------- class PclZip { // ----- Filename of the zip file var $zipname = ''; // ----- File descriptor of the zip file var $zip_fd = 0; // ----- Internal error handling var $error_code = 1; var $error_string = ''; // ----- Current status of the magic_quotes_runtime // This value store the php configuration for magic_quotes // The class can then disable the magic_quotes and reset it after var $magic_quotes_status; // -------------------------------------------------------------------------------- // Function : PclZip() // Description : // Creates a PclZip object and set the name of the associated Zip archive // filename. // Note that no real action is taken, if the archive does not exist it is not // created. Use create() for that. // -------------------------------------------------------------------------------- function __construct($p_zipname) { // ----- Tests the zlib if (!function_exists('gzopen')) { die('Abort '.basename(__FILE__).' : Missing zlib extensions'); } // ----- Set the attributes $this->zipname = $p_zipname; $this->zip_fd = 0; $this->magic_quotes_status = -1; // ----- Return return; } public function PclZip($p_zipname) { self::__construct($p_zipname); } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : // create($p_filelist, $p_add_dir="", $p_remove_dir="") // create($p_filelist, $p_option, $p_option_value, ...) // Description : // This method supports two different synopsis. The first one is historical. // This method creates a Zip Archive. The Zip file is created in the // filesystem. The files and directories indicated in $p_filelist // are added in the archive. See the parameters description for the // supported format of $p_filelist. // When a directory is in the list, the directory and its content is added // in the archive. // In this synopsis, the function takes an optional variable list of // options. See below the supported options. // Parameters : // $p_filelist : An array containing file or directory names, or // a string containing one filename or one directory name, or // a string containing a list of filenames and/or directory // names separated by spaces. // $p_add_dir : A path to add before the real path of the archived file, // in order to have it memorized in the archive. // $p_remove_dir : A path to remove from the real path of the file to archive, // in order to have a shorter path memorized in the archive. // When $p_add_dir and $p_remove_dir are set, $p_remove_dir // is removed first, before $p_add_dir is added. // Options : // PCLZIP_OPT_ADD_PATH : // PCLZIP_OPT_REMOVE_PATH : // PCLZIP_OPT_REMOVE_ALL_PATH : // PCLZIP_OPT_COMMENT : // PCLZIP_CB_PRE_ADD : // PCLZIP_CB_POST_ADD : // Return Values : // 0 on failure, // The list of the added files, with a status of the add action. // (see PclZip::listContent() for list entry format) // -------------------------------------------------------------------------------- function create($p_filelist) { $v_result=1; // ----- Reset the error handler $this->privErrorReset(); // ----- Set default values $v_options = array(); $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; // ----- Look for variable options arguments $v_size = func_num_args(); // ----- Look for arguments if ($v_size > 1) { // ----- Get the arguments $v_arg_list = func_get_args(); // ----- Remove from the options list the first argument array_shift($v_arg_list); $v_size--; // ----- Look for first arg if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array (PCLZIP_OPT_REMOVE_PATH => 'optional', PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', PCLZIP_OPT_ADD_PATH => 'optional', PCLZIP_CB_PRE_ADD => 'optional', PCLZIP_CB_POST_ADD => 'optional', PCLZIP_OPT_NO_COMPRESSION => 'optional', PCLZIP_OPT_COMMENT => 'optional', PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', PCLZIP_OPT_TEMP_FILE_ON => 'optional', PCLZIP_OPT_TEMP_FILE_OFF => 'optional' //, PCLZIP_OPT_CRYPT => 'optional' )); if ($v_result != 1) { return 0; } } // ----- Look for 2 args // Here we need to support the first historic synopsis of the // method. else { // ----- Get the first argument $v_options[PCLZIP_OPT_ADD_PATH] = $v_arg_list[0]; // ----- Look for the optional second argument if ($v_size == 2) { $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; } else if ($v_size > 2) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); return 0; } } } // ----- Look for default option values $this->privOptionDefaultThreshold($v_options); // ----- Init $v_string_list = array(); $v_att_list = array(); $v_filedescr_list = array(); $p_result_list = array(); // ----- Look if the $p_filelist is really an array if (is_array($p_filelist)) { // ----- Look if the first element is also an array // This will mean that this is a file description entry if (isset($p_filelist[0]) && is_array($p_filelist[0])) { $v_att_list = $p_filelist; } // ----- The list is a list of string names else { $v_string_list = $p_filelist; } } // ----- Look if the $p_filelist is a string else if (is_string($p_filelist)) { // ----- Create a list from the string $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); } // ----- Invalid variable type for $p_filelist else { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist"); return 0; } // ----- Reformat the string list if (sizeof($v_string_list) != 0) { foreach ($v_string_list as $v_string) { if ($v_string != '') { $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; } else { } } } // ----- For each file in the list check the attributes $v_supported_attributes = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional' ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional' ,PCLZIP_ATT_FILE_MTIME => 'optional' ,PCLZIP_ATT_FILE_CONTENT => 'optional' ,PCLZIP_ATT_FILE_COMMENT => 'optional' ); foreach ($v_att_list as $v_entry) { $v_result = $this->privFileDescrParseAtt($v_entry, $v_filedescr_list[], $v_options, $v_supported_attributes); if ($v_result != 1) { return 0; } } // ----- Expand the filelist (expand directories) $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); if ($v_result != 1) { return 0; } // ----- Call the create fct $v_result = $this->privCreate($v_filedescr_list, $p_result_list, $v_options); if ($v_result != 1) { return 0; } // ----- Return return $p_result_list; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : // add($p_filelist, $p_add_dir="", $p_remove_dir="") // add($p_filelist, $p_option, $p_option_value, ...) // Description : // This method supports two synopsis. The first one is historical. // This methods add the list of files in an existing archive. // If a file with the same name already exists, it is added at the end of the // archive, the first one is still present. // If the archive does not exist, it is created. // Parameters : // $p_filelist : An array containing file or directory names, or // a string containing one filename or one directory name, or // a string containing a list of filenames and/or directory // names separated by spaces. // $p_add_dir : A path to add before the real path of the archived file, // in order to have it memorized in the archive. // $p_remove_dir : A path to remove from the real path of the file to archive, // in order to have a shorter path memorized in the archive. // When $p_add_dir and $p_remove_dir are set, $p_remove_dir // is removed first, before $p_add_dir is added. // Options : // PCLZIP_OPT_ADD_PATH : // PCLZIP_OPT_REMOVE_PATH : // PCLZIP_OPT_REMOVE_ALL_PATH : // PCLZIP_OPT_COMMENT : // PCLZIP_OPT_ADD_COMMENT : // PCLZIP_OPT_PREPEND_COMMENT : // PCLZIP_CB_PRE_ADD : // PCLZIP_CB_POST_ADD : // Return Values : // 0 on failure, // The list of the added files, with a status of the add action. // (see PclZip::listContent() for list entry format) // -------------------------------------------------------------------------------- function add($p_filelist) { $v_result=1; // ----- Reset the error handler $this->privErrorReset(); // ----- Set default values $v_options = array(); $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; // ----- Look for variable options arguments $v_size = func_num_args(); // ----- Look for arguments if ($v_size > 1) { // ----- Get the arguments $v_arg_list = func_get_args(); // ----- Remove form the options list the first argument array_shift($v_arg_list); $v_size--; // ----- Look for first arg if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array (PCLZIP_OPT_REMOVE_PATH => 'optional', PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', PCLZIP_OPT_ADD_PATH => 'optional', PCLZIP_CB_PRE_ADD => 'optional', PCLZIP_CB_POST_ADD => 'optional', PCLZIP_OPT_NO_COMPRESSION => 'optional', PCLZIP_OPT_COMMENT => 'optional', PCLZIP_OPT_ADD_COMMENT => 'optional', PCLZIP_OPT_PREPEND_COMMENT => 'optional', PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', PCLZIP_OPT_TEMP_FILE_ON => 'optional', PCLZIP_OPT_TEMP_FILE_OFF => 'optional' //, PCLZIP_OPT_CRYPT => 'optional' )); if ($v_result != 1) { return 0; } } // ----- Look for 2 args // Here we need to support the first historic synopsis of the // method. else { // ----- Get the first argument $v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0]; // ----- Look for the optional second argument if ($v_size == 2) { $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; } else if ($v_size > 2) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); // ----- Return return 0; } } } // ----- Look for default option values $this->privOptionDefaultThreshold($v_options); // ----- Init $v_string_list = array(); $v_att_list = array(); $v_filedescr_list = array(); $p_result_list = array(); // ----- Look if the $p_filelist is really an array if (is_array($p_filelist)) { // ----- Look if the first element is also an array // This will mean that this is a file description entry if (isset($p_filelist[0]) && is_array($p_filelist[0])) { $v_att_list = $p_filelist; } // ----- The list is a list of string names else { $v_string_list = $p_filelist; } } // ----- Look if the $p_filelist is a string else if (is_string($p_filelist)) { // ----- Create a list from the string $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); } // ----- Invalid variable type for $p_filelist else { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type '".gettype($p_filelist)."' for p_filelist"); return 0; } // ----- Reformat the string list if (sizeof($v_string_list) != 0) { foreach ($v_string_list as $v_string) { $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; } } // ----- For each file in the list check the attributes $v_supported_attributes = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional' ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional' ,PCLZIP_ATT_FILE_MTIME => 'optional' ,PCLZIP_ATT_FILE_CONTENT => 'optional' ,PCLZIP_ATT_FILE_COMMENT => 'optional' ); foreach ($v_att_list as $v_entry) { $v_result = $this->privFileDescrParseAtt($v_entry, $v_filedescr_list[], $v_options, $v_supported_attributes); if ($v_result != 1) { return 0; } } // ----- Expand the filelist (expand directories) $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); if ($v_result != 1) { return 0; } // ----- Call the create fct $v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options); if ($v_result != 1) { return 0; } // ----- Return return $p_result_list; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : listContent() // Description : // This public method, gives the list of the files and directories, with their // properties. // The properties of each entries in the list are (used also in other functions) : // filename : Name of the file. For a create or add action it is the filename // given by the user. For an extract function it is the filename // of the extracted file. // stored_filename : Name of the file / directory stored in the archive. // size : Size of the stored file. // compressed_size : Size of the file's data compressed in the archive // (without the headers overhead) // mtime : Last known modification date of the file (UNIX timestamp) // comment : Comment associated with the file // folder : true | false // index : index of the file in the archive // status : status of the action (depending of the action) : // Values are : // ok : OK ! // filtered : the file / dir is not extracted (filtered by user) // already_a_directory : the file can not be extracted because a // directory with the same name already exists // write_protected : the file can not be extracted because a file // with the same name already exists and is // write protected // newer_exist : the file was not extracted because a newer file exists // path_creation_fail : the file is not extracted because the folder // does not exist and can not be created // write_error : the file was not extracted because there was an // error while writing the file // read_error : the file was not extracted because there was an error // while reading the file // invalid_header : the file was not extracted because of an archive // format error (bad file header) // Note that each time a method can continue operating when there // is an action error on a file, the error is only logged in the file status. // Return Values : // 0 on an unrecoverable failure, // The list of the files in the archive. // -------------------------------------------------------------------------------- function listContent() { $v_result=1; // ----- Reset the error handler $this->privErrorReset(); // ----- Check archive if (!$this->privCheckFormat()) { return(0); } // ----- Call the extracting fct $p_list = array(); if (($v_result = $this->privList($p_list)) != 1) { unset($p_list); return(0); } // ----- Return return $p_list; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : // extract($p_path="./", $p_remove_path="") // extract([$p_option, $p_option_value, ...]) // Description : // This method supports two synopsis. The first one is historical. // This method extract all the files / directories from the archive to the // folder indicated in $p_path. // If you want to ignore the 'root' part of path of the memorized files // you can indicate this in the optional $p_remove_path parameter. // By default, if a newer file with the same name already exists, the // file is not extracted. // // If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH options // are used, the path indicated in PCLZIP_OPT_ADD_PATH is append // at the end of the path value of PCLZIP_OPT_PATH. // Parameters : // $p_path : Path where the files and directories are to be extracted // $p_remove_path : First part ('root' part) of the memorized path // (if any similar) to remove while extracting. // Options : // PCLZIP_OPT_PATH : // PCLZIP_OPT_ADD_PATH : // PCLZIP_OPT_REMOVE_PATH : // PCLZIP_OPT_REMOVE_ALL_PATH : // PCLZIP_CB_PRE_EXTRACT : // PCLZIP_CB_POST_EXTRACT : // Return Values : // 0 or a negative value on failure, // The list of the extracted files, with a status of the action. // (see PclZip::listContent() for list entry format) // -------------------------------------------------------------------------------- function extract() { $v_result=1; // ----- Reset the error handler $this->privErrorReset(); // ----- Check archive if (!$this->privCheckFormat()) { return(0); } // ----- Set default values $v_options = array(); // $v_path = "./"; $v_path = ''; $v_remove_path = ""; $v_remove_all_path = false; // ----- Look for variable options arguments $v_size = func_num_args(); // ----- Default values for option $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; // ----- Look for arguments if ($v_size > 0) { // ----- Get the arguments $v_arg_list = func_get_args(); // ----- Look for first arg if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array (PCLZIP_OPT_PATH => 'optional', PCLZIP_OPT_REMOVE_PATH => 'optional', PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', PCLZIP_OPT_ADD_PATH => 'optional', PCLZIP_CB_PRE_EXTRACT => 'optional', PCLZIP_CB_POST_EXTRACT => 'optional', PCLZIP_OPT_SET_CHMOD => 'optional', PCLZIP_OPT_BY_NAME => 'optional', PCLZIP_OPT_BY_EREG => 'optional', PCLZIP_OPT_BY_PREG => 'optional', PCLZIP_OPT_BY_INDEX => 'optional', PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional', PCLZIP_OPT_REPLACE_NEWER => 'optional' ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional', PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', PCLZIP_OPT_TEMP_FILE_ON => 'optional', PCLZIP_OPT_TEMP_FILE_OFF => 'optional' )); if ($v_result != 1) { return 0; } // ----- Set the arguments if (isset($v_options[PCLZIP_OPT_PATH])) { $v_path = $v_options[PCLZIP_OPT_PATH]; } if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; } if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; } if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { // ----- Check for '/' in last path char if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { $v_path .= '/'; } $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; } } // ----- Look for 2 args // Here we need to support the first historic synopsis of the // method. else { // ----- Get the first argument $v_path = $v_arg_list[0]; // ----- Look for the optional second argument if ($v_size == 2) { $v_remove_path = $v_arg_list[1]; } else if ($v_size > 2) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); // ----- Return return 0; } } } // ----- Look for default option values $this->privOptionDefaultThreshold($v_options); // ----- Trace // ----- Call the extracting fct $p_list = array(); $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options); if ($v_result < 1) { unset($p_list); return(0); } // ----- Return return $p_list; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : // extractByIndex($p_index, $p_path="./", $p_remove_path="") // extractByIndex($p_index, [$p_option, $p_option_value, ...]) // Description : // This method supports two synopsis. The first one is historical. // This method is doing a partial extract of the archive. // The extracted files or folders are identified by their index in the // archive (from 0 to n). // Note that if the index identify a folder, only the folder entry is // extracted, not all the files included in the archive. // Parameters : // $p_index : A single index (integer) or a string of indexes of files to // extract. The form of the string is "0,4-6,8-12" with only numbers // and '-' for range or ',' to separate ranges. No spaces or ';' // are allowed. // $p_path : Path where the files and directories are to be extracted // $p_remove_path : First part ('root' part) of the memorized path // (if any similar) to remove while extracting. // Options : // PCLZIP_OPT_PATH : // PCLZIP_OPT_ADD_PATH : // PCLZIP_OPT_REMOVE_PATH : // PCLZIP_OPT_REMOVE_ALL_PATH : // PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and // not as files. // The resulting content is in a new field 'content' in the file // structure. // This option must be used alone (any other options are ignored). // PCLZIP_CB_PRE_EXTRACT : // PCLZIP_CB_POST_EXTRACT : // Return Values : // 0 on failure, // The list of the extracted files, with a status of the action. // (see PclZip::listContent() for list entry format) // -------------------------------------------------------------------------------- //function extractByIndex($p_index, options...) function extractByIndex($p_index) { $v_result=1; // ----- Reset the error handler $this->privErrorReset(); // ----- Check archive if (!$this->privCheckFormat()) { return(0); } // ----- Set default values $v_options = array(); // $v_path = "./"; $v_path = ''; $v_remove_path = ""; $v_remove_all_path = false; // ----- Look for variable options arguments $v_size = func_num_args(); // ----- Default values for option $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; // ----- Look for arguments if ($v_size > 1) { // ----- Get the arguments $v_arg_list = func_get_args(); // ----- Remove form the options list the first argument array_shift($v_arg_list); $v_size--; // ----- Look for first arg if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array (PCLZIP_OPT_PATH => 'optional', PCLZIP_OPT_REMOVE_PATH => 'optional', PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', PCLZIP_OPT_ADD_PATH => 'optional', PCLZIP_CB_PRE_EXTRACT => 'optional', PCLZIP_CB_POST_EXTRACT => 'optional', PCLZIP_OPT_SET_CHMOD => 'optional', PCLZIP_OPT_REPLACE_NEWER => 'optional' ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional', PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', PCLZIP_OPT_TEMP_FILE_ON => 'optional', PCLZIP_OPT_TEMP_FILE_OFF => 'optional' )); if ($v_result != 1) { return 0; } // ----- Set the arguments if (isset($v_options[PCLZIP_OPT_PATH])) { $v_path = $v_options[PCLZIP_OPT_PATH]; } if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; } if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; } if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { // ----- Check for '/' in last path char if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { $v_path .= '/'; } $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; } if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) { $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; } else { } } // ----- Look for 2 args // Here we need to support the first historic synopsis of the // method. else { // ----- Get the first argument $v_path = $v_arg_list[0]; // ----- Look for the optional second argument if ($v_size == 2) { $v_remove_path = $v_arg_list[1]; } else if ($v_size > 2) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); // ----- Return return 0; } } } // ----- Trace // ----- Trick // Here I want to reuse extractByRule(), so I need to parse the $p_index // with privParseOptions() $v_arg_trick = array (PCLZIP_OPT_BY_INDEX, $p_index); $v_options_trick = array(); $v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick, array (PCLZIP_OPT_BY_INDEX => 'optional' )); if ($v_result != 1) { return 0; } $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX]; // ----- Look for default option values $this->privOptionDefaultThreshold($v_options); // ----- Call the extracting fct if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) { return(0); } // ----- Return return $p_list; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : // delete([$p_option, $p_option_value, ...]) // Description : // This method removes files from the archive. // If no parameters are given, then all the archive is emptied. // Parameters : // None or optional arguments. // Options : // PCLZIP_OPT_BY_INDEX : // PCLZIP_OPT_BY_NAME : // PCLZIP_OPT_BY_EREG : // PCLZIP_OPT_BY_PREG : // Return Values : // 0 on failure, // The list of the files which are still present in the archive. // (see PclZip::listContent() for list entry format) // -------------------------------------------------------------------------------- function delete() { $v_result=1; // ----- Reset the error handler $this->privErrorReset(); // ----- Check archive if (!$this->privCheckFormat()) { return(0); } // ----- Set default values $v_options = array(); // ----- Look for variable options arguments $v_size = func_num_args(); // ----- Look for arguments if ($v_size > 0) { // ----- Get the arguments $v_arg_list = func_get_args(); // ----- Parse the options $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array (PCLZIP_OPT_BY_NAME => 'optional', PCLZIP_OPT_BY_EREG => 'optional', PCLZIP_OPT_BY_PREG => 'optional', PCLZIP_OPT_BY_INDEX => 'optional' )); if ($v_result != 1) { return 0; } } // ----- Magic quotes trick $this->privDisableMagicQuotes(); // ----- Call the delete fct $v_list = array(); if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) { $this->privSwapBackMagicQuotes(); unset($v_list); return(0); } // ----- Magic quotes trick $this->privSwapBackMagicQuotes(); // ----- Return return $v_list; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : deleteByIndex() // Description : // ***** Deprecated ***** // delete(PCLZIP_OPT_BY_INDEX, $p_index) should be preferred. // -------------------------------------------------------------------------------- function deleteByIndex($p_index) { $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index); // ----- Return return $p_list; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : properties() // Description : // This method gives the properties of the archive. // The properties are : // nb : Number of files in the archive // comment : Comment associated with the archive file // status : not_exist, ok // Parameters : // None // Return Values : // 0 on failure, // An array with the archive properties. // -------------------------------------------------------------------------------- function properties() { // ----- Reset the error handler $this->privErrorReset(); // ----- Magic quotes trick $this->privDisableMagicQuotes(); // ----- Check archive if (!$this->privCheckFormat()) { $this->privSwapBackMagicQuotes(); return(0); } // ----- Default properties $v_prop = array(); $v_prop['comment'] = ''; $v_prop['nb'] = 0; $v_prop['status'] = 'not_exist'; // ----- Look if file exists if (@is_file($this->zipname)) { // ----- Open the zip file if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) { $this->privSwapBackMagicQuotes(); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); // ----- Return return 0; } // ----- Read the central directory information $v_central_dir = array(); if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { $this->privSwapBackMagicQuotes(); return 0; } // ----- Close the zip file $this->privCloseFd(); // ----- Set the user attributes $v_prop['comment'] = $v_central_dir['comment']; $v_prop['nb'] = $v_central_dir['entries']; $v_prop['status'] = 'ok'; } // ----- Magic quotes trick $this->privSwapBackMagicQuotes(); // ----- Return return $v_prop; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : duplicate() // Description : // This method creates an archive by copying the content of an other one. If // the archive already exist, it is replaced by the new one without any warning. // Parameters : // $p_archive : The filename of a valid archive, or // a valid PclZip object. // Return Values : // 1 on success. // 0 or a negative value on error (error code). // -------------------------------------------------------------------------------- function duplicate($p_archive) { $v_result = 1; // ----- Reset the error handler $this->privErrorReset(); // ----- Look if the $p_archive is an instantiated PclZip object if ($p_archive instanceof pclzip) { // ----- Duplicate the archive $v_result = $this->privDuplicate($p_archive->zipname); } // ----- Look if the $p_archive is a string (so a filename) else if (is_string($p_archive)) { // ----- Check that $p_archive is a valid zip file // TBC : Should also check the archive format if (!is_file($p_archive)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "No file with filename '".$p_archive."'"); $v_result = PCLZIP_ERR_MISSING_FILE; } else { // ----- Duplicate the archive $v_result = $this->privDuplicate($p_archive); } } // ----- Invalid variable else { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); $v_result = PCLZIP_ERR_INVALID_PARAMETER; } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : merge() // Description : // This method merge the $p_archive_to_add archive at the end of the current // one ($this). // If the archive ($this) does not exist, the merge becomes a duplicate. // If the $p_archive_to_add archive does not exist, the merge is a success. // Parameters : // $p_archive_to_add : It can be directly the filename of a valid zip archive, // or a PclZip object archive. // Return Values : // 1 on success, // 0 or negative values on error (see below). // -------------------------------------------------------------------------------- function merge($p_archive_to_add) { $v_result = 1; // ----- Reset the error handler $this->privErrorReset(); // ----- Check archive if (!$this->privCheckFormat()) { return(0); } // ----- Look if the $p_archive_to_add is an instantiated PclZip object if ($p_archive_to_add instanceof pclzip) { // ----- Merge the archive $v_result = $this->privMerge($p_archive_to_add); } // ----- Look if the $p_archive_to_add is a string (so a filename) else if (is_string($p_archive_to_add)) { // ----- Create a temporary archive $v_object_archive = new PclZip($p_archive_to_add); // ----- Merge the archive $v_result = $this->privMerge($v_object_archive); } // ----- Invalid variable else { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); $v_result = PCLZIP_ERR_INVALID_PARAMETER; } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : errorCode() // Description : // Parameters : // -------------------------------------------------------------------------------- function errorCode() { if (PCLZIP_ERROR_EXTERNAL == 1) { return(PclErrorCode()); } else { return($this->error_code); } } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : errorName() // Description : // Parameters : // -------------------------------------------------------------------------------- function errorName($p_with_code=false) { $v_name = array ( PCLZIP_ERR_NO_ERROR => 'PCLZIP_ERR_NO_ERROR', PCLZIP_ERR_WRITE_OPEN_FAIL => 'PCLZIP_ERR_WRITE_OPEN_FAIL', PCLZIP_ERR_READ_OPEN_FAIL => 'PCLZIP_ERR_READ_OPEN_FAIL', PCLZIP_ERR_INVALID_PARAMETER => 'PCLZIP_ERR_INVALID_PARAMETER', PCLZIP_ERR_MISSING_FILE => 'PCLZIP_ERR_MISSING_FILE', PCLZIP_ERR_FILENAME_TOO_LONG => 'PCLZIP_ERR_FILENAME_TOO_LONG', PCLZIP_ERR_INVALID_ZIP => 'PCLZIP_ERR_INVALID_ZIP', PCLZIP_ERR_BAD_EXTRACTED_FILE => 'PCLZIP_ERR_BAD_EXTRACTED_FILE', PCLZIP_ERR_DIR_CREATE_FAIL => 'PCLZIP_ERR_DIR_CREATE_FAIL', PCLZIP_ERR_BAD_EXTENSION => 'PCLZIP_ERR_BAD_EXTENSION', PCLZIP_ERR_BAD_FORMAT => 'PCLZIP_ERR_BAD_FORMAT', PCLZIP_ERR_DELETE_FILE_FAIL => 'PCLZIP_ERR_DELETE_FILE_FAIL', PCLZIP_ERR_RENAME_FILE_FAIL => 'PCLZIP_ERR_RENAME_FILE_FAIL', PCLZIP_ERR_BAD_CHECKSUM => 'PCLZIP_ERR_BAD_CHECKSUM', PCLZIP_ERR_INVALID_ARCHIVE_ZIP => 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', PCLZIP_ERR_MISSING_OPTION_VALUE => 'PCLZIP_ERR_MISSING_OPTION_VALUE', PCLZIP_ERR_INVALID_OPTION_VALUE => 'PCLZIP_ERR_INVALID_OPTION_VALUE', PCLZIP_ERR_UNSUPPORTED_COMPRESSION => 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', PCLZIP_ERR_UNSUPPORTED_ENCRYPTION => 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION' ,PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE => 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE' ,PCLZIP_ERR_DIRECTORY_RESTRICTION => 'PCLZIP_ERR_DIRECTORY_RESTRICTION' ); if (isset($v_name[$this->error_code])) { $v_value = $v_name[$this->error_code]; } else { $v_value = 'NoName'; } if ($p_with_code) { return($v_value.' ('.$this->error_code.')'); } else { return($v_value); } } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : errorInfo() // Description : // Parameters : // -------------------------------------------------------------------------------- function errorInfo($p_full=false) { if (PCLZIP_ERROR_EXTERNAL == 1) { return(PclErrorString()); } else { if ($p_full) { return($this->errorName(true)." : ".$this->error_string); } else { return($this->error_string." [code ".$this->error_code."]"); } } } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS ***** // ***** ***** // ***** THESES FUNCTIONS MUST NOT BE USED DIRECTLY ***** // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privCheckFormat() // Description : // This method check that the archive exists and is a valid zip archive. // Several level of check exists. (future) // Parameters : // $p_level : Level of check. Default 0. // 0 : Check the first bytes (magic codes) (default value)) // 1 : 0 + Check the central directory (future) // 2 : 1 + Check each file header (future) // Return Values : // true on success, // false on error, the error code is set. // -------------------------------------------------------------------------------- function privCheckFormat($p_level=0) { $v_result = true; // ----- Reset the file system cache clearstatcache(); // ----- Reset the error handler $this->privErrorReset(); // ----- Look if the file exits if (!is_file($this->zipname)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "Missing archive file '".$this->zipname."'"); return(false); } // ----- Check that the file is readable if (!is_readable($this->zipname)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '".$this->zipname."'"); return(false); } // ----- Check the magic code // TBC // ----- Check the central header // TBC // ----- Check each file header // TBC // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privParseOptions() // Description : // This internal methods reads the variable list of arguments ($p_options_list, // $p_size) and generate an array with the options and values ($v_result_list). // $v_requested_options contains the options that can be present and those that // must be present. // $v_requested_options is an array, with the option value as key, and 'optional', // or 'mandatory' as value. // Parameters : // See above. // Return Values : // 1 on success. // 0 on failure. // -------------------------------------------------------------------------------- function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options=false) { $v_result=1; // ----- Read the options $i=0; while ($i<$p_size) { // ----- Check if the option is supported if (!isset($v_requested_options[$p_options_list[$i]])) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid optional parameter '".$p_options_list[$i]."' for this method"); // ----- Return return PclZip::errorCode(); } // ----- Look for next option switch ($p_options_list[$i]) { // ----- Look for options that request a path value case PCLZIP_OPT_PATH : case PCLZIP_OPT_REMOVE_PATH : case PCLZIP_OPT_ADD_PATH : // ----- Check the number of parameters if (($i+1) >= $p_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return return PclZip::errorCode(); } // ----- Get the value $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE); $i++; break; case PCLZIP_OPT_TEMP_FILE_THRESHOLD : // ----- Check the number of parameters if (($i+1) >= $p_size) { PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); return PclZip::errorCode(); } // ----- Check for incompatible options if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'"); return PclZip::errorCode(); } // ----- Check the value $v_value = $p_options_list[$i+1]; if ((!is_integer($v_value)) || ($v_value<0)) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Integer expected for option '".PclZipUtilOptionText($p_options_list[$i])."'"); return PclZip::errorCode(); } // ----- Get the value (and convert it in bytes) $v_result_list[$p_options_list[$i]] = $v_value*1048576; $i++; break; case PCLZIP_OPT_TEMP_FILE_ON : // ----- Check for incompatible options if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'"); return PclZip::errorCode(); } $v_result_list[$p_options_list[$i]] = true; break; case PCLZIP_OPT_TEMP_FILE_OFF : // ----- Check for incompatible options if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_ON])) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_ON'"); return PclZip::errorCode(); } // ----- Check for incompatible options if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_THRESHOLD'"); return PclZip::errorCode(); } $v_result_list[$p_options_list[$i]] = true; break; case PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : // ----- Check the number of parameters if (($i+1) >= $p_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return return PclZip::errorCode(); } // ----- Get the value if ( is_string($p_options_list[$i+1]) && ($p_options_list[$i+1] != '')) { $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE); $i++; } else { } break; // ----- Look for options that request an array of string for value case PCLZIP_OPT_BY_NAME : // ----- Check the number of parameters if (($i+1) >= $p_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return return PclZip::errorCode(); } // ----- Get the value if (is_string($p_options_list[$i+1])) { $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1]; } else if (is_array($p_options_list[$i+1])) { $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; } else { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return return PclZip::errorCode(); } $i++; break; // ----- Look for options that request an EREG or PREG expression case PCLZIP_OPT_BY_EREG : // ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG // to PCLZIP_OPT_BY_PREG $p_options_list[$i] = PCLZIP_OPT_BY_PREG; case PCLZIP_OPT_BY_PREG : //case PCLZIP_OPT_CRYPT : // ----- Check the number of parameters if (($i+1) >= $p_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return return PclZip::errorCode(); } // ----- Get the value if (is_string($p_options_list[$i+1])) { $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; } else { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return return PclZip::errorCode(); } $i++; break; // ----- Look for options that takes a string case PCLZIP_OPT_COMMENT : case PCLZIP_OPT_ADD_COMMENT : case PCLZIP_OPT_PREPEND_COMMENT : // ----- Check the number of parameters if (($i+1) >= $p_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '" .PclZipUtilOptionText($p_options_list[$i]) ."'"); // ----- Return return PclZip::errorCode(); } // ----- Get the value if (is_string($p_options_list[$i+1])) { $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; } else { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '" .PclZipUtilOptionText($p_options_list[$i]) ."'"); // ----- Return return PclZip::errorCode(); } $i++; break; // ----- Look for options that request an array of index case PCLZIP_OPT_BY_INDEX : // ----- Check the number of parameters if (($i+1) >= $p_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return return PclZip::errorCode(); } // ----- Get the value $v_work_list = array(); if (is_string($p_options_list[$i+1])) { // ----- Remove spaces $p_options_list[$i+1] = strtr($p_options_list[$i+1], ' ', ''); // ----- Parse items $v_work_list = explode(",", $p_options_list[$i+1]); } else if (is_integer($p_options_list[$i+1])) { $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1]; } else if (is_array($p_options_list[$i+1])) { $v_work_list = $p_options_list[$i+1]; } else { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Value must be integer, string or array for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return return PclZip::errorCode(); } // ----- Reduce the index list // each index item in the list must be a couple with a start and // an end value : [0,3], [5-5], [8-10], ... // ----- Check the format of each item $v_sort_flag=false; $v_sort_value=0; for ($j=0; $j<sizeof($v_work_list); $j++) { // ----- Explode the item $v_item_list = explode("-", $v_work_list[$j]); $v_size_item_list = sizeof($v_item_list); // ----- TBC : Here we might check that each item is a // real integer ... // ----- Look for single value if ($v_size_item_list == 1) { // ----- Set the option value $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0]; $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[0]; } elseif ($v_size_item_list == 2) { // ----- Set the option value $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0]; $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[1]; } else { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Too many values in index range for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return return PclZip::errorCode(); } // ----- Look for list sort if ($v_result_list[$p_options_list[$i]][$j]['start'] < $v_sort_value) { $v_sort_flag=true; // ----- TBC : An automatic sort should be written ... // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Invalid order of index range for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return return PclZip::errorCode(); } $v_sort_value = $v_result_list[$p_options_list[$i]][$j]['start']; } // ----- Sort the items if ($v_sort_flag) { // TBC : To Be Completed } // ----- Next option $i++; break; // ----- Look for options that request no value case PCLZIP_OPT_REMOVE_ALL_PATH : case PCLZIP_OPT_EXTRACT_AS_STRING : case PCLZIP_OPT_NO_COMPRESSION : case PCLZIP_OPT_EXTRACT_IN_OUTPUT : case PCLZIP_OPT_REPLACE_NEWER : case PCLZIP_OPT_STOP_ON_ERROR : $v_result_list[$p_options_list[$i]] = true; break; // ----- Look for options that request an octal value case PCLZIP_OPT_SET_CHMOD : // ----- Check the number of parameters if (($i+1) >= $p_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return return PclZip::errorCode(); } // ----- Get the value $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; $i++; break; // ----- Look for options that request a call-back case PCLZIP_CB_PRE_EXTRACT : case PCLZIP_CB_POST_EXTRACT : case PCLZIP_CB_PRE_ADD : case PCLZIP_CB_POST_ADD : /* for future use case PCLZIP_CB_PRE_DELETE : case PCLZIP_CB_POST_DELETE : case PCLZIP_CB_PRE_LIST : case PCLZIP_CB_POST_LIST : */ // ----- Check the number of parameters if (($i+1) >= $p_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return return PclZip::errorCode(); } // ----- Get the value $v_function_name = $p_options_list[$i+1]; // ----- Check that the value is a valid existing function if (!function_exists($v_function_name)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Function '".$v_function_name."()' is not an existing function for option '".PclZipUtilOptionText($p_options_list[$i])."'"); // ----- Return return PclZip::errorCode(); } // ----- Set the attribute $v_result_list[$p_options_list[$i]] = $v_function_name; $i++; break; default : // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Unknown parameter '" .$p_options_list[$i]."'"); // ----- Return return PclZip::errorCode(); } // ----- Next options $i++; } // ----- Look for mandatory options if ($v_requested_options !== false) { for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { // ----- Look for mandatory option if ($v_requested_options[$key] == 'mandatory') { // ----- Look if present if (!isset($v_result_list[$key])) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); // ----- Return return PclZip::errorCode(); } } } } // ----- Look for default values if (!isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) { } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privOptionDefaultThreshold() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privOptionDefaultThreshold(&$p_options) { $v_result=1; if (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) || isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) { return $v_result; } // ----- Get 'memory_limit' configuration value $v_memory_limit = ini_get('memory_limit'); $v_memory_limit = trim($v_memory_limit); $v_memory_limit_int = (int) $v_memory_limit; $last = strtolower(substr($v_memory_limit, -1)); if($last == 'g') //$v_memory_limit_int = $v_memory_limit_int*1024*1024*1024; $v_memory_limit_int = $v_memory_limit_int*1073741824; if($last == 'm') //$v_memory_limit_int = $v_memory_limit_int*1024*1024; $v_memory_limit_int = $v_memory_limit_int*1048576; if($last == 'k') $v_memory_limit_int = $v_memory_limit_int*1024; $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit_int*PCLZIP_TEMPORARY_FILE_RATIO); // ----- Confidence check : No threshold if value lower than 1M if ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] < 1048576) { unset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]); } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privFileDescrParseAtt() // Description : // Parameters : // Return Values : // 1 on success. // 0 on failure. // -------------------------------------------------------------------------------- function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options=false) { $v_result=1; // ----- For each file in the list check the attributes foreach ($p_file_list as $v_key => $v_value) { // ----- Check if the option is supported if (!isset($v_requested_options[$v_key])) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file attribute '".$v_key."' for this file"); // ----- Return return PclZip::errorCode(); } // ----- Look for attribute switch ($v_key) { case PCLZIP_ATT_FILE_NAME : if (!is_string($v_value)) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); return PclZip::errorCode(); } $p_filedescr['filename'] = PclZipUtilPathReduction($v_value); if ($p_filedescr['filename'] == '') { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'"); return PclZip::errorCode(); } break; case PCLZIP_ATT_FILE_NEW_SHORT_NAME : if (!is_string($v_value)) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); return PclZip::errorCode(); } $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value); if ($p_filedescr['new_short_name'] == '') { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '".PclZipUtilOptionText($v_key)."'"); return PclZip::errorCode(); } break; case PCLZIP_ATT_FILE_NEW_FULL_NAME : if (!is_string($v_value)) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); return PclZip::errorCode(); } $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value); if ($p_filedescr['new_full_name'] == '') { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '".PclZipUtilOptionText($v_key)."'"); return PclZip::errorCode(); } break; // ----- Look for options that takes a string case PCLZIP_ATT_FILE_COMMENT : if (!is_string($v_value)) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); return PclZip::errorCode(); } $p_filedescr['comment'] = $v_value; break; case PCLZIP_ATT_FILE_MTIME : if (!is_integer($v_value)) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". Integer expected for attribute '".PclZipUtilOptionText($v_key)."'"); return PclZip::errorCode(); } $p_filedescr['mtime'] = $v_value; break; case PCLZIP_ATT_FILE_CONTENT : $p_filedescr['content'] = $v_value; break; default : // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Unknown parameter '".$v_key."'"); // ----- Return return PclZip::errorCode(); } // ----- Look for mandatory options if ($v_requested_options !== false) { for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { // ----- Look for mandatory option if ($v_requested_options[$key] == 'mandatory') { // ----- Look if present if (!isset($p_file_list[$key])) { PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); return PclZip::errorCode(); } } } } // end foreach } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privFileDescrExpand() // Description : // This method look for each item of the list to see if its a file, a folder // or a string to be added as file. For any other type of files (link, other) // just ignore the item. // Then prepare the information that will be stored for that file. // When its a folder, expand the folder with all the files that are in that // folder (recursively). // Parameters : // Return Values : // 1 on success. // 0 on failure. // -------------------------------------------------------------------------------- function privFileDescrExpand(&$p_filedescr_list, &$p_options) { $v_result=1; // ----- Create a result list $v_result_list = array(); // ----- Look each entry for ($i=0; $i<sizeof($p_filedescr_list); $i++) { // ----- Get filedescr $v_descr = $p_filedescr_list[$i]; // ----- Reduce the filename $v_descr['filename'] = PclZipUtilTranslateWinPath($v_descr['filename'], false); $v_descr['filename'] = PclZipUtilPathReduction($v_descr['filename']); // ----- Look for real file or folder if (file_exists($v_descr['filename'])) { if (@is_file($v_descr['filename'])) { $v_descr['type'] = 'file'; } else if (@is_dir($v_descr['filename'])) { $v_descr['type'] = 'folder'; } else if (@is_link($v_descr['filename'])) { // skip continue; } else { // skip continue; } } // ----- Look for string added as file else if (isset($v_descr['content'])) { $v_descr['type'] = 'virtual_file'; } // ----- Missing file else { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '".$v_descr['filename']."' does not exist"); // ----- Return return PclZip::errorCode(); } // ----- Calculate the stored filename $this->privCalculateStoredFilename($v_descr, $p_options); // ----- Add the descriptor in result list $v_result_list[sizeof($v_result_list)] = $v_descr; // ----- Look for folder if ($v_descr['type'] == 'folder') { // ----- List of items in folder $v_dirlist_descr = array(); $v_dirlist_nb = 0; if ($v_folder_handler = @opendir($v_descr['filename'])) { while (($v_item_handler = @readdir($v_folder_handler)) !== false) { // ----- Skip '.' and '..' if (($v_item_handler == '.') || ($v_item_handler == '..')) { continue; } // ----- Compose the full filename $v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler; // ----- Look for different stored filename // Because the name of the folder was changed, the name of the // files/sub-folders also change if (($v_descr['stored_filename'] != $v_descr['filename']) && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))) { if ($v_descr['stored_filename'] != '') { $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler; } else { $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_item_handler; } } $v_dirlist_nb++; } @closedir($v_folder_handler); } else { // TBC : unable to open folder in read mode } // ----- Expand each element of the list if ($v_dirlist_nb != 0) { // ----- Expand if (($v_result = $this->privFileDescrExpand($v_dirlist_descr, $p_options)) != 1) { return $v_result; } // ----- Concat the resulting list $v_result_list = array_merge($v_result_list, $v_dirlist_descr); } else { } // ----- Free local array unset($v_dirlist_descr); } } // ----- Get the result list $p_filedescr_list = $v_result_list; // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privCreate() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privCreate($p_filedescr_list, &$p_result_list, &$p_options) { $v_result=1; $v_list_detail = array(); // ----- Magic quotes trick $this->privDisableMagicQuotes(); // ----- Open the file in write mode if (($v_result = $this->privOpenFd('wb')) != 1) { // ----- Return return $v_result; } // ----- Add the list of files $v_result = $this->privAddList($p_filedescr_list, $p_result_list, $p_options); // ----- Close $this->privCloseFd(); // ----- Magic quotes trick $this->privSwapBackMagicQuotes(); // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privAdd() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privAdd($p_filedescr_list, &$p_result_list, &$p_options) { $v_result=1; $v_list_detail = array(); // ----- Look if the archive exists or is empty if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0)) { // ----- Do a create $v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options); // ----- Return return $v_result; } // ----- Magic quotes trick $this->privDisableMagicQuotes(); // ----- Open the zip file if (($v_result=$this->privOpenFd('rb')) != 1) { // ----- Magic quotes trick $this->privSwapBackMagicQuotes(); // ----- Return return $v_result; } // ----- Read the central directory information $v_central_dir = array(); if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); return $v_result; } // ----- Go to beginning of File @rewind($this->zip_fd); // ----- Creates a temporary file $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; // ----- Open the temporary file in write mode if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); // ----- Return return PclZip::errorCode(); } // ----- Copy the files from the archive to the temporary file // TBC : Here I should better append the file and go back to erase the central dir $v_size = $v_central_dir['offset']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); $v_buffer = fread($this->zip_fd, $v_read_size); @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Swap the file descriptor // Here is a trick : I swap the temporary fd with the zip fd, in order to use // the following methods on the temporary fil and not the real archive $v_swap = $this->zip_fd; $this->zip_fd = $v_zip_temp_fd; $v_zip_temp_fd = $v_swap; // ----- Add the files $v_header_list = array(); if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) { fclose($v_zip_temp_fd); $this->privCloseFd(); @unlink($v_zip_temp_name); $this->privSwapBackMagicQuotes(); // ----- Return return $v_result; } // ----- Store the offset of the central dir $v_offset = @ftell($this->zip_fd); // ----- Copy the block of file headers from the old archive $v_size = $v_central_dir['size']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); $v_buffer = @fread($v_zip_temp_fd, $v_read_size); @fwrite($this->zip_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Create the Central Dir files header for ($i=0, $v_count=0; $i<sizeof($v_header_list); $i++) { // ----- Create the file header if ($v_header_list[$i]['status'] == 'ok') { if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) { fclose($v_zip_temp_fd); $this->privCloseFd(); @unlink($v_zip_temp_name); $this->privSwapBackMagicQuotes(); // ----- Return return $v_result; } $v_count++; } // ----- Transform the header to a 'usable' info $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); } // ----- Zip file comment $v_comment = $v_central_dir['comment']; if (isset($p_options[PCLZIP_OPT_COMMENT])) { $v_comment = $p_options[PCLZIP_OPT_COMMENT]; } if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) { $v_comment = $v_comment.$p_options[PCLZIP_OPT_ADD_COMMENT]; } if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) { $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT].$v_comment; } // ----- Calculate the size of the central header $v_size = @ftell($this->zip_fd)-$v_offset; // ----- Create the central dir footer if (($v_result = $this->privWriteCentralHeader($v_count+$v_central_dir['entries'], $v_size, $v_offset, $v_comment)) != 1) { // ----- Reset the file list unset($v_header_list); $this->privSwapBackMagicQuotes(); // ----- Return return $v_result; } // ----- Swap back the file descriptor $v_swap = $this->zip_fd; $this->zip_fd = $v_zip_temp_fd; $v_zip_temp_fd = $v_swap; // ----- Close $this->privCloseFd(); // ----- Close the temporary file @fclose($v_zip_temp_fd); // ----- Magic quotes trick $this->privSwapBackMagicQuotes(); // ----- Delete the zip file // TBC : I should test the result ... @unlink($this->zipname); // ----- Rename the temporary file // TBC : I should test the result ... //@rename($v_zip_temp_name, $this->zipname); PclZipUtilRename($v_zip_temp_name, $this->zipname); // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privOpenFd() // Description : // Parameters : // -------------------------------------------------------------------------------- function privOpenFd($p_mode) { $v_result=1; // ----- Look if already open if ($this->zip_fd != 0) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \''.$this->zipname.'\' already open'); // ----- Return return PclZip::errorCode(); } // ----- Open the zip file if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in '.$p_mode.' mode'); // ----- Return return PclZip::errorCode(); } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privCloseFd() // Description : // Parameters : // -------------------------------------------------------------------------------- function privCloseFd() { $v_result=1; if ($this->zip_fd != 0) @fclose($this->zip_fd); $this->zip_fd = 0; // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privAddList() // Description : // $p_add_dir and $p_remove_dir will give the ability to memorize a path which is // different from the real path of the file. This is useful if you want to have PclTar // running in any directory, and memorize relative path from an other directory. // Parameters : // $p_list : An array containing the file or directory names to add in the tar // $p_result_list : list of added files with their properties (specially the status field) // $p_add_dir : Path to add in the filename path archived // $p_remove_dir : Path to remove in the filename path archived // Return Values : // -------------------------------------------------------------------------------- // function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options) function privAddList($p_filedescr_list, &$p_result_list, &$p_options) { $v_result=1; // ----- Add the files $v_header_list = array(); if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) { // ----- Return return $v_result; } // ----- Store the offset of the central dir $v_offset = @ftell($this->zip_fd); // ----- Create the Central Dir files header for ($i=0,$v_count=0; $i<sizeof($v_header_list); $i++) { // ----- Create the file header if ($v_header_list[$i]['status'] == 'ok') { if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) { // ----- Return return $v_result; } $v_count++; } // ----- Transform the header to a 'usable' info $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); } // ----- Zip file comment $v_comment = ''; if (isset($p_options[PCLZIP_OPT_COMMENT])) { $v_comment = $p_options[PCLZIP_OPT_COMMENT]; } // ----- Calculate the size of the central header $v_size = @ftell($this->zip_fd)-$v_offset; // ----- Create the central dir footer if (($v_result = $this->privWriteCentralHeader($v_count, $v_size, $v_offset, $v_comment)) != 1) { // ----- Reset the file list unset($v_header_list); // ----- Return return $v_result; } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privAddFileList() // Description : // Parameters : // $p_filedescr_list : An array containing the file description // or directory names to add in the zip // $p_result_list : list of added files with their properties (specially the status field) // Return Values : // -------------------------------------------------------------------------------- function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options) { $v_result=1; $v_header = array(); // ----- Recuperate the current number of elt in list $v_nb = sizeof($p_result_list); // ----- Loop on the files for ($j=0; ($j<sizeof($p_filedescr_list)) && ($v_result==1); $j++) { // ----- Format the filename $p_filedescr_list[$j]['filename'] = PclZipUtilTranslateWinPath($p_filedescr_list[$j]['filename'], false); // ----- Skip empty file names // TBC : Can this be possible ? not checked in DescrParseAtt ? if ($p_filedescr_list[$j]['filename'] == "") { continue; } // ----- Check the filename if ( ($p_filedescr_list[$j]['type'] != 'virtual_file') && (!file_exists($p_filedescr_list[$j]['filename']))) { PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '".$p_filedescr_list[$j]['filename']."' does not exist"); return PclZip::errorCode(); } // ----- Look if it is a file or a dir with no all path remove option // or a dir with all its path removed // if ( (is_file($p_filedescr_list[$j]['filename'])) // || ( is_dir($p_filedescr_list[$j]['filename']) if ( ($p_filedescr_list[$j]['type'] == 'file') || ($p_filedescr_list[$j]['type'] == 'virtual_file') || ( ($p_filedescr_list[$j]['type'] == 'folder') && ( !isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]) || !$p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) ) { // ----- Add the file $v_result = $this->privAddFile($p_filedescr_list[$j], $v_header, $p_options); if ($v_result != 1) { return $v_result; } // ----- Store the file infos $p_result_list[$v_nb++] = $v_header; } } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privAddFile() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privAddFile($p_filedescr, &$p_header, &$p_options) { $v_result=1; // ----- Working variable $p_filename = $p_filedescr['filename']; // TBC : Already done in the fileAtt check ... ? if ($p_filename == "") { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)"); // ----- Return return PclZip::errorCode(); } // ----- Look for a stored different filename /* TBC : Removed if (isset($p_filedescr['stored_filename'])) { $v_stored_filename = $p_filedescr['stored_filename']; } else { $v_stored_filename = $p_filedescr['stored_filename']; } */ // ----- Set the file properties clearstatcache(); $p_header['version'] = 20; $p_header['version_extracted'] = 10; $p_header['flag'] = 0; $p_header['compression'] = 0; $p_header['crc'] = 0; $p_header['compressed_size'] = 0; $p_header['filename_len'] = strlen($p_filename); $p_header['extra_len'] = 0; $p_header['disk'] = 0; $p_header['internal'] = 0; $p_header['offset'] = 0; $p_header['filename'] = $p_filename; // TBC : Removed $p_header['stored_filename'] = $v_stored_filename; $p_header['stored_filename'] = $p_filedescr['stored_filename']; $p_header['extra'] = ''; $p_header['status'] = 'ok'; $p_header['index'] = -1; // ----- Look for regular file if ($p_filedescr['type']=='file') { $p_header['external'] = 0x00000000; $p_header['size'] = filesize($p_filename); } // ----- Look for regular folder else if ($p_filedescr['type']=='folder') { $p_header['external'] = 0x00000010; $p_header['mtime'] = filemtime($p_filename); $p_header['size'] = filesize($p_filename); } // ----- Look for virtual file else if ($p_filedescr['type'] == 'virtual_file') { $p_header['external'] = 0x00000000; $p_header['size'] = strlen($p_filedescr['content']); } // ----- Look for filetime if (isset($p_filedescr['mtime'])) { $p_header['mtime'] = $p_filedescr['mtime']; } else if ($p_filedescr['type'] == 'virtual_file') { $p_header['mtime'] = time(); } else { $p_header['mtime'] = filemtime($p_filename); } // ------ Look for file comment if (isset($p_filedescr['comment'])) { $p_header['comment_len'] = strlen($p_filedescr['comment']); $p_header['comment'] = $p_filedescr['comment']; } else { $p_header['comment_len'] = 0; $p_header['comment'] = ''; } // ----- Look for pre-add callback if (isset($p_options[PCLZIP_CB_PRE_ADD])) { // ----- Generate a local information $v_local_header = array(); $this->privConvertHeader2FileInfo($p_header, $v_local_header); // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. $v_result = $p_options[PCLZIP_CB_PRE_ADD](PCLZIP_CB_PRE_ADD, $v_local_header); if ($v_result == 0) { // ----- Change the file status $p_header['status'] = "skipped"; $v_result = 1; } // ----- Update the information // Only some fields can be modified if ($p_header['stored_filename'] != $v_local_header['stored_filename']) { $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']); } } // ----- Look for empty stored filename if ($p_header['stored_filename'] == "") { $p_header['status'] = "filtered"; } // ----- Check the path length if (strlen($p_header['stored_filename']) > 0xFF) { $p_header['status'] = 'filename_too_long'; } // ----- Look if no error, or file not skipped if ($p_header['status'] == 'ok') { // ----- Look for a file if ($p_filedescr['type'] == 'file') { // ----- Look for using temporary file to zip if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_header['size'])) ) ) { $v_result = $this->privAddFileUsingTempFile($p_filedescr, $p_header, $p_options); if ($v_result < PCLZIP_ERR_NO_ERROR) { return $v_result; } } // ----- Use "in memory" zip algo else { // ----- Open the source file if (($v_file = @fopen($p_filename, "rb")) == 0) { PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode"); return PclZip::errorCode(); } // ----- Read the file content if ($p_header['size'] > 0) { $v_content = @fread($v_file, $p_header['size']); } else { $v_content = ''; } // ----- Close the file @fclose($v_file); // ----- Calculate the CRC $p_header['crc'] = @crc32($v_content); // ----- Look for no compression if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { // ----- Set header parameters $p_header['compressed_size'] = $p_header['size']; $p_header['compression'] = 0; } // ----- Look for normal compression else { // ----- Compress the content $v_content = @gzdeflate($v_content); // ----- Set header parameters $p_header['compressed_size'] = strlen($v_content); $p_header['compression'] = 8; } // ----- Call the header generation if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { @fclose($v_file); return $v_result; } // ----- Write the compressed (or not) content @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']); } } // ----- Look for a virtual file (a file from string) else if ($p_filedescr['type'] == 'virtual_file') { $v_content = $p_filedescr['content']; // ----- Calculate the CRC $p_header['crc'] = @crc32($v_content); // ----- Look for no compression if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { // ----- Set header parameters $p_header['compressed_size'] = $p_header['size']; $p_header['compression'] = 0; } // ----- Look for normal compression else { // ----- Compress the content $v_content = @gzdeflate($v_content); // ----- Set header parameters $p_header['compressed_size'] = strlen($v_content); $p_header['compression'] = 8; } // ----- Call the header generation if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { @fclose($v_file); return $v_result; } // ----- Write the compressed (or not) content @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']); } // ----- Look for a directory else if ($p_filedescr['type'] == 'folder') { // ----- Look for directory last '/' if (@substr($p_header['stored_filename'], -1) != '/') { $p_header['stored_filename'] .= '/'; } // ----- Set the file properties $p_header['size'] = 0; //$p_header['external'] = 0x41FF0010; // Value for a folder : to be checked $p_header['external'] = 0x00000010; // Value for a folder : to be checked // ----- Call the header generation if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { return $v_result; } } } // ----- Look for post-add callback if (isset($p_options[PCLZIP_CB_POST_ADD])) { // ----- Generate a local information $v_local_header = array(); $this->privConvertHeader2FileInfo($p_header, $v_local_header); // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. $v_result = $p_options[PCLZIP_CB_POST_ADD](PCLZIP_CB_POST_ADD, $v_local_header); if ($v_result == 0) { // ----- Ignored $v_result = 1; } // ----- Update the information // Nothing can be modified } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privAddFileUsingTempFile() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privAddFileUsingTempFile($p_filedescr, &$p_header, &$p_options) { $v_result=PCLZIP_ERR_NO_ERROR; // ----- Working variable $p_filename = $p_filedescr['filename']; // ----- Open the source file if (($v_file = @fopen($p_filename, "rb")) == 0) { PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode"); return PclZip::errorCode(); } // ----- Creates a compressed temporary file $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz'; if (($v_file_compressed = @gzopen($v_gzip_temp_name, "wb")) == 0) { fclose($v_file); PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode'); return PclZip::errorCode(); } // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks $v_size = filesize($p_filename); while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); $v_buffer = @fread($v_file, $v_read_size); //$v_binary_data = pack('a'.$v_read_size, $v_buffer); @gzputs($v_file_compressed, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Close the file @fclose($v_file); @gzclose($v_file_compressed); // ----- Check the minimum file size if (filesize($v_gzip_temp_name) < 18) { PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'gzip temporary file \''.$v_gzip_temp_name.'\' has invalid filesize - should be minimum 18 bytes'); return PclZip::errorCode(); } // ----- Extract the compressed attributes if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) { PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); return PclZip::errorCode(); } // ----- Read the gzip file header $v_binary_data = @fread($v_file_compressed, 10); $v_data_header = unpack('a1id1/a1id2/a1cm/a1flag/Vmtime/a1xfl/a1os', $v_binary_data); // ----- Check some parameters $v_data_header['os'] = bin2hex($v_data_header['os']); // ----- Read the gzip file footer @fseek($v_file_compressed, filesize($v_gzip_temp_name)-8); $v_binary_data = @fread($v_file_compressed, 8); $v_data_footer = unpack('Vcrc/Vcompressed_size', $v_binary_data); // ----- Set the attributes $p_header['compression'] = ord($v_data_header['cm']); //$p_header['mtime'] = $v_data_header['mtime']; $p_header['crc'] = $v_data_footer['crc']; $p_header['compressed_size'] = filesize($v_gzip_temp_name)-18; // ----- Close the file @fclose($v_file_compressed); // ----- Call the header generation if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { return $v_result; } // ----- Add the compressed data if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) { PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); return PclZip::errorCode(); } // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks fseek($v_file_compressed, 10); $v_size = $p_header['compressed_size']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); $v_buffer = @fread($v_file_compressed, $v_read_size); //$v_binary_data = pack('a'.$v_read_size, $v_buffer); @fwrite($this->zip_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Close the file @fclose($v_file_compressed); // ----- Unlink the temporary file @unlink($v_gzip_temp_name); // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privCalculateStoredFilename() // Description : // Based on file descriptor properties and global options, this method // calculate the filename that will be stored in the archive. // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privCalculateStoredFilename(&$p_filedescr, &$p_options) { $v_result=1; // ----- Working variables $p_filename = $p_filedescr['filename']; if (isset($p_options[PCLZIP_OPT_ADD_PATH])) { $p_add_dir = $p_options[PCLZIP_OPT_ADD_PATH]; } else { $p_add_dir = ''; } if (isset($p_options[PCLZIP_OPT_REMOVE_PATH])) { $p_remove_dir = $p_options[PCLZIP_OPT_REMOVE_PATH]; } else { $p_remove_dir = ''; } if (isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { $p_remove_all_dir = $p_options[PCLZIP_OPT_REMOVE_ALL_PATH]; } else { $p_remove_all_dir = 0; } // ----- Look for full name change if (isset($p_filedescr['new_full_name'])) { // ----- Remove drive letter if any $v_stored_filename = PclZipUtilTranslateWinPath($p_filedescr['new_full_name']); } // ----- Look for path and/or short name change else { // ----- Look for short name change // Its when we change just the filename but not the path if (isset($p_filedescr['new_short_name'])) { $v_path_info = pathinfo($p_filename); $v_dir = ''; if ($v_path_info['dirname'] != '') { $v_dir = $v_path_info['dirname'].'/'; } $v_stored_filename = $v_dir.$p_filedescr['new_short_name']; } else { // ----- Calculate the stored filename $v_stored_filename = $p_filename; } // ----- Look for all path to remove if ($p_remove_all_dir) { $v_stored_filename = basename($p_filename); } // ----- Look for partial path remove else if ($p_remove_dir != "") { if (substr($p_remove_dir, -1) != '/') $p_remove_dir .= "/"; if ( (substr($p_filename, 0, 2) == "./") || (substr($p_remove_dir, 0, 2) == "./")) { if ( (substr($p_filename, 0, 2) == "./") && (substr($p_remove_dir, 0, 2) != "./")) { $p_remove_dir = "./".$p_remove_dir; } if ( (substr($p_filename, 0, 2) != "./") && (substr($p_remove_dir, 0, 2) == "./")) { $p_remove_dir = substr($p_remove_dir, 2); } } $v_compare = PclZipUtilPathInclusion($p_remove_dir, $v_stored_filename); if ($v_compare > 0) { if ($v_compare == 2) { $v_stored_filename = ""; } else { $v_stored_filename = substr($v_stored_filename, strlen($p_remove_dir)); } } } // ----- Remove drive letter if any $v_stored_filename = PclZipUtilTranslateWinPath($v_stored_filename); // ----- Look for path to add if ($p_add_dir != "") { if (substr($p_add_dir, -1) == "/") $v_stored_filename = $p_add_dir.$v_stored_filename; else $v_stored_filename = $p_add_dir."/".$v_stored_filename; } } // ----- Filename (reduce the path of stored name) $v_stored_filename = PclZipUtilPathReduction($v_stored_filename); $p_filedescr['stored_filename'] = $v_stored_filename; // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privWriteFileHeader() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privWriteFileHeader(&$p_header) { $v_result=1; // ----- Store the offset position of the file $p_header['offset'] = ftell($this->zip_fd); // ----- Transform UNIX mtime to DOS format mdate/mtime $v_date = getdate($p_header['mtime']); $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; // ----- Packed data $v_binary_data = pack("VvvvvvVVVvv", 0x04034b50, $p_header['version_extracted'], $p_header['flag'], $p_header['compression'], $v_mtime, $v_mdate, $p_header['crc'], $p_header['compressed_size'], $p_header['size'], strlen($p_header['stored_filename']), $p_header['extra_len']); // ----- Write the first 148 bytes of the header in the archive fputs($this->zip_fd, $v_binary_data, 30); // ----- Write the variable fields if (strlen($p_header['stored_filename']) != 0) { fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); } if ($p_header['extra_len'] != 0) { fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privWriteCentralFileHeader() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privWriteCentralFileHeader(&$p_header) { $v_result=1; // TBC //for(reset($p_header); $key = key($p_header); next($p_header)) { //} // ----- Transform UNIX mtime to DOS format mdate/mtime $v_date = getdate($p_header['mtime']); $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; // ----- Packed data $v_binary_data = pack("VvvvvvvVVVvvvvvVV", 0x02014b50, $p_header['version'], $p_header['version_extracted'], $p_header['flag'], $p_header['compression'], $v_mtime, $v_mdate, $p_header['crc'], $p_header['compressed_size'], $p_header['size'], strlen($p_header['stored_filename']), $p_header['extra_len'], $p_header['comment_len'], $p_header['disk'], $p_header['internal'], $p_header['external'], $p_header['offset']); // ----- Write the 42 bytes of the header in the zip file fputs($this->zip_fd, $v_binary_data, 46); // ----- Write the variable fields if (strlen($p_header['stored_filename']) != 0) { fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); } if ($p_header['extra_len'] != 0) { fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); } if ($p_header['comment_len'] != 0) { fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']); } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privWriteCentralHeader() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment) { $v_result=1; // ----- Packed data $v_binary_data = pack("VvvvvVVv", 0x06054b50, 0, 0, $p_nb_entries, $p_nb_entries, $p_size, $p_offset, strlen($p_comment)); // ----- Write the 22 bytes of the header in the zip file fputs($this->zip_fd, $v_binary_data, 22); // ----- Write the variable fields if (strlen($p_comment) != 0) { fputs($this->zip_fd, $p_comment, strlen($p_comment)); } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privList() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privList(&$p_list) { $v_result=1; // ----- Magic quotes trick $this->privDisableMagicQuotes(); // ----- Open the zip file if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) { // ----- Magic quotes trick $this->privSwapBackMagicQuotes(); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); // ----- Return return PclZip::errorCode(); } // ----- Read the central directory information $v_central_dir = array(); if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { $this->privSwapBackMagicQuotes(); return $v_result; } // ----- Go to beginning of Central Dir @rewind($this->zip_fd); if (@fseek($this->zip_fd, $v_central_dir['offset'])) { $this->privSwapBackMagicQuotes(); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); // ----- Return return PclZip::errorCode(); } // ----- Read each entry for ($i=0; $i<$v_central_dir['entries']; $i++) { // ----- Read the file header if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) { $this->privSwapBackMagicQuotes(); return $v_result; } $v_header['index'] = $i; // ----- Get the only interesting attributes $this->privConvertHeader2FileInfo($v_header, $p_list[$i]); unset($v_header); } // ----- Close the zip file $this->privCloseFd(); // ----- Magic quotes trick $this->privSwapBackMagicQuotes(); // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privConvertHeader2FileInfo() // Description : // This function takes the file information from the central directory // entries and extract the interesting parameters that will be given back. // The resulting file infos are set in the array $p_info // $p_info['filename'] : Filename with full path. Given by user (add), // extracted in the filesystem (extract). // $p_info['stored_filename'] : Stored filename in the archive. // $p_info['size'] = Size of the file. // $p_info['compressed_size'] = Compressed size of the file. // $p_info['mtime'] = Last modification date of the file. // $p_info['comment'] = Comment associated with the file. // $p_info['folder'] = true/false : indicates if the entry is a folder or not. // $p_info['status'] = status of the action on the file. // $p_info['crc'] = CRC of the file content. // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privConvertHeader2FileInfo($p_header, &$p_info) { $v_result=1; // ----- Get the interesting attributes $v_temp_path = PclZipUtilPathReduction($p_header['filename']); $p_info['filename'] = $v_temp_path; $v_temp_path = PclZipUtilPathReduction($p_header['stored_filename']); $p_info['stored_filename'] = $v_temp_path; $p_info['size'] = $p_header['size']; $p_info['compressed_size'] = $p_header['compressed_size']; $p_info['mtime'] = $p_header['mtime']; $p_info['comment'] = $p_header['comment']; $p_info['folder'] = (($p_header['external']&0x00000010)==0x00000010); $p_info['index'] = $p_header['index']; $p_info['status'] = $p_header['status']; $p_info['crc'] = $p_header['crc']; // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privExtractByRule() // Description : // Extract a file or directory depending of rules (by index, by name, ...) // Parameters : // $p_file_list : An array where will be placed the properties of each // extracted file // $p_path : Path to add while writing the extracted files // $p_remove_path : Path to remove (from the file memorized path) while writing the // extracted files. If the path does not match the file path, // the file is extracted with its memorized path. // $p_remove_path does not apply to 'list' mode. // $p_path and $p_remove_path are commulative. // Return Values : // 1 on success,0 or less on error (see error code list) // -------------------------------------------------------------------------------- function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) { $v_result=1; // ----- Magic quotes trick $this->privDisableMagicQuotes(); // ----- Check the path if ( ($p_path == "") || ( (substr($p_path, 0, 1) != "/") && (substr($p_path, 0, 3) != "../") && (substr($p_path,1,2)!=":/"))) $p_path = "./".$p_path; // ----- Reduce the path last (and duplicated) '/' if (($p_path != "./") && ($p_path != "/")) { // ----- Look for the path end '/' while (substr($p_path, -1) == "/") { $p_path = substr($p_path, 0, strlen($p_path)-1); } } // ----- Look for path to remove format (should end by /) if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/')) { $p_remove_path .= '/'; } $p_remove_path_size = strlen($p_remove_path); // ----- Open the zip file if (($v_result = $this->privOpenFd('rb')) != 1) { $this->privSwapBackMagicQuotes(); return $v_result; } // ----- Read the central directory information $v_central_dir = array(); if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { // ----- Close the zip file $this->privCloseFd(); $this->privSwapBackMagicQuotes(); return $v_result; } // ----- Start at beginning of Central Dir $v_pos_entry = $v_central_dir['offset']; // ----- Read each entry $j_start = 0; for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) { // ----- Read next Central dir entry @rewind($this->zip_fd); if (@fseek($this->zip_fd, $v_pos_entry)) { // ----- Close the zip file $this->privCloseFd(); $this->privSwapBackMagicQuotes(); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); // ----- Return return PclZip::errorCode(); } // ----- Read the file header $v_header = array(); if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) { // ----- Close the zip file $this->privCloseFd(); $this->privSwapBackMagicQuotes(); return $v_result; } // ----- Store the index $v_header['index'] = $i; // ----- Store the file position $v_pos_entry = ftell($this->zip_fd); // ----- Look for the specific extract rules $v_extract = false; // ----- Look for extract by name rule if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { // ----- Look if the filename is in the list for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_extract); $j++) { // ----- Look for a directory if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == "/") { // ----- Look if the directory is in the filename path if ( (strlen($v_header['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) && (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { $v_extract = true; } } // ----- Look for a filename elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { $v_extract = true; } } } // ----- Look for extract by ereg rule // ereg() is deprecated with PHP 5.3 /* else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header['stored_filename'])) { $v_extract = true; } } */ // ----- Look for extract by preg rule else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) { $v_extract = true; } } // ----- Look for extract by index rule else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { // ----- Look if the index is in the list for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_extract); $j++) { if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { $v_extract = true; } if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { $j_start = $j+1; } if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { break; } } } // ----- Look for no rule, which means extract all the archive else { $v_extract = true; } // ----- Check compression method if ( ($v_extract) && ( ($v_header['compression'] != 8) && ($v_header['compression'] != 0))) { $v_header['status'] = 'unsupported_compression'; // ----- Look for PCLZIP_OPT_STOP_ON_ERROR if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { $this->privSwapBackMagicQuotes(); PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION, "Filename '".$v_header['stored_filename']."' is " ."compressed by an unsupported compression " ."method (".$v_header['compression'].") "); return PclZip::errorCode(); } } // ----- Check encrypted files if (($v_extract) && (($v_header['flag'] & 1) == 1)) { $v_header['status'] = 'unsupported_encryption'; // ----- Look for PCLZIP_OPT_STOP_ON_ERROR if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { $this->privSwapBackMagicQuotes(); PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, "Unsupported encryption for " ." filename '".$v_header['stored_filename'] ."'"); return PclZip::errorCode(); } } // ----- Look for real extraction if (($v_extract) && ($v_header['status'] != 'ok')) { $v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++]); if ($v_result != 1) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); return $v_result; } $v_extract = false; } // ----- Look for real extraction if ($v_extract) { // ----- Go to the file position @rewind($this->zip_fd); if (@fseek($this->zip_fd, $v_header['offset'])) { // ----- Close the zip file $this->privCloseFd(); $this->privSwapBackMagicQuotes(); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); // ----- Return return PclZip::errorCode(); } // ----- Look for extraction as string if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) { $v_string = ''; // ----- Extracting the file $v_result1 = $this->privExtractFileAsString($v_header, $v_string, $p_options); if ($v_result1 < 1) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); return $v_result1; } // ----- Get the only interesting attributes if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted])) != 1) { // ----- Close the zip file $this->privCloseFd(); $this->privSwapBackMagicQuotes(); return $v_result; } // ----- Set the file content $p_file_list[$v_nb_extracted]['content'] = $v_string; // ----- Next extracted file $v_nb_extracted++; // ----- Look for user callback abort if ($v_result1 == 2) { break; } } // ----- Look for extraction in standard output elseif ( (isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) { // ----- Extracting the file in standard output $v_result1 = $this->privExtractFileInOutput($v_header, $p_options); if ($v_result1 < 1) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); return $v_result1; } // ----- Get the only interesting attributes if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); return $v_result; } // ----- Look for user callback abort if ($v_result1 == 2) { break; } } // ----- Look for normal extraction else { // ----- Extracting the file $v_result1 = $this->privExtractFile($v_header, $p_path, $p_remove_path, $p_remove_all_path, $p_options); if ($v_result1 < 1) { $this->privCloseFd(); $this->privSwapBackMagicQuotes(); return $v_result1; } // ----- Get the only interesting attributes if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) { // ----- Close the zip file $this->privCloseFd(); $this->privSwapBackMagicQuotes(); return $v_result; } // ----- Look for user callback abort if ($v_result1 == 2) { break; } } } } // ----- Close the zip file $this->privCloseFd(); $this->privSwapBackMagicQuotes(); // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privExtractFile() // Description : // Parameters : // Return Values : // // 1 : ... ? // PCLZIP_ERR_USER_ABORTED(2) : User ask for extraction stop in callback // -------------------------------------------------------------------------------- function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) { $v_result=1; // ----- Read the file header if (($v_result = $this->privReadFileHeader($v_header)) != 1) { // ----- Return return $v_result; } // ----- Check that the file header is coherent with $p_entry info if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { // TBC } // ----- Look for all path to remove if ($p_remove_all_path == true) { // ----- Look for folder entry that not need to be extracted if (($p_entry['external']&0x00000010)==0x00000010) { $p_entry['status'] = "filtered"; return $v_result; } // ----- Get the basename of the path $p_entry['filename'] = basename($p_entry['filename']); } // ----- Look for path to remove else if ($p_remove_path != "") { if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2) { // ----- Change the file status $p_entry['status'] = "filtered"; // ----- Return return $v_result; } $p_remove_path_size = strlen($p_remove_path); if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path) { // ----- Remove the path $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size); } } // ----- Add the path if ($p_path != '') { $p_entry['filename'] = $p_path."/".$p_entry['filename']; } // ----- Check a base_dir_restriction if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) { $v_inclusion = PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION], $p_entry['filename']); if ($v_inclusion == 0) { PclZip::privErrorLog(PCLZIP_ERR_DIRECTORY_RESTRICTION, "Filename '".$p_entry['filename']."' is " ."outside PCLZIP_OPT_EXTRACT_DIR_RESTRICTION"); return PclZip::errorCode(); } } // ----- Look for pre-extract callback if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { // ----- Generate a local information $v_local_header = array(); $this->privConvertHeader2FileInfo($p_entry, $v_local_header); // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); if ($v_result == 0) { // ----- Change the file status $p_entry['status'] = "skipped"; $v_result = 1; } // ----- Look for abort result if ($v_result == 2) { // ----- This status is internal and will be changed in 'skipped' $p_entry['status'] = "aborted"; $v_result = PCLZIP_ERR_USER_ABORTED; } // ----- Update the information // Only some fields can be modified $p_entry['filename'] = $v_local_header['filename']; } // ----- Look if extraction should be done if ($p_entry['status'] == 'ok') { // ----- Look for specific actions while the file exist if (file_exists($p_entry['filename'])) { // ----- Look if file is a directory if (is_dir($p_entry['filename'])) { // ----- Change the file status $p_entry['status'] = "already_a_directory"; // ----- Look for PCLZIP_OPT_STOP_ON_ERROR // For historical reason first PclZip implementation does not stop // when this kind of error occurs. if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY, "Filename '".$p_entry['filename']."' is " ."already used by an existing directory"); return PclZip::errorCode(); } } // ----- Look if file is write protected else if (!is_writeable($p_entry['filename'])) { // ----- Change the file status $p_entry['status'] = "write_protected"; // ----- Look for PCLZIP_OPT_STOP_ON_ERROR // For historical reason first PclZip implementation does not stop // when this kind of error occurs. if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, "Filename '".$p_entry['filename']."' exists " ."and is write protected"); return PclZip::errorCode(); } } // ----- Look if the extracted file is older else if (filemtime($p_entry['filename']) > $p_entry['mtime']) { // ----- Change the file status if ( (isset($p_options[PCLZIP_OPT_REPLACE_NEWER])) && ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) { } else { $p_entry['status'] = "newer_exist"; // ----- Look for PCLZIP_OPT_STOP_ON_ERROR // For historical reason first PclZip implementation does not stop // when this kind of error occurs. if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, "Newer version of '".$p_entry['filename']."' exists " ."and option PCLZIP_OPT_REPLACE_NEWER is not selected"); return PclZip::errorCode(); } } } else { } } // ----- Check the directory availability and create it if necessary else { if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/')) $v_dir_to_check = $p_entry['filename']; else if (!strstr($p_entry['filename'], "/")) $v_dir_to_check = ""; else $v_dir_to_check = dirname($p_entry['filename']); if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) { // ----- Change the file status $p_entry['status'] = "path_creation_fail"; // ----- Return //return $v_result; $v_result = 1; } } } // ----- Look if extraction should be done if ($p_entry['status'] == 'ok') { // ----- Do the extraction (if not a folder) if (!(($p_entry['external']&0x00000010)==0x00000010)) { // ----- Look for not compressed file if ($p_entry['compression'] == 0) { // ----- Opening destination file if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { // ----- Change the file status $p_entry['status'] = "write_error"; // ----- Return return $v_result; } // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks $v_size = $p_entry['compressed_size']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); $v_buffer = @fread($this->zip_fd, $v_read_size); /* Try to speed up the code $v_binary_data = pack('a'.$v_read_size, $v_buffer); @fwrite($v_dest_file, $v_binary_data, $v_read_size); */ @fwrite($v_dest_file, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Closing the destination file fclose($v_dest_file); // ----- Change the file mtime touch($p_entry['filename'], $p_entry['mtime']); } else { // ----- TBC // Need to be finished if (($p_entry['flag'] & 1) == 1) { PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, 'File \''.$p_entry['filename'].'\' is encrypted. Encrypted files are not supported.'); return PclZip::errorCode(); } // ----- Look for using temporary file to unzip if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_entry['size'])) ) ) { $v_result = $this->privExtractFileUsingTempFile($p_entry, $p_options); if ($v_result < PCLZIP_ERR_NO_ERROR) { return $v_result; } } // ----- Look for extract in memory else { // ----- Read the compressed file in a buffer (one shot) if ($p_entry['compressed_size'] > 0) { $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); } else { $v_buffer = ''; } // ----- Decompress the file $v_file_content = @gzinflate($v_buffer); unset($v_buffer); if ($v_file_content === FALSE) { // ----- Change the file status // TBC $p_entry['status'] = "error"; return $v_result; } // ----- Opening destination file if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { // ----- Change the file status $p_entry['status'] = "write_error"; return $v_result; } // ----- Write the uncompressed data @fwrite($v_dest_file, $v_file_content, $p_entry['size']); unset($v_file_content); // ----- Closing the destination file @fclose($v_dest_file); } // ----- Change the file mtime @touch($p_entry['filename'], $p_entry['mtime']); } // ----- Look for chmod option if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) { // ----- Change the mode of the file @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]); } } } // ----- Change abort status if ($p_entry['status'] == "aborted") { $p_entry['status'] = "skipped"; } // ----- Look for post-extract callback elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { // ----- Generate a local information $v_local_header = array(); $this->privConvertHeader2FileInfo($p_entry, $v_local_header); // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); // ----- Look for abort result if ($v_result == 2) { $v_result = PCLZIP_ERR_USER_ABORTED; } } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privExtractFileUsingTempFile() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privExtractFileUsingTempFile(&$p_entry, &$p_options) { $v_result=1; // ----- Creates a temporary file $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz'; if (($v_dest_file = @fopen($v_gzip_temp_name, "wb")) == 0) { fclose($v_file); PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode'); return PclZip::errorCode(); } // ----- Write gz file format header $v_binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($p_entry['compression']), Chr(0x00), time(), Chr(0x00), Chr(3)); @fwrite($v_dest_file, $v_binary_data, 10); // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks $v_size = $p_entry['compressed_size']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); $v_buffer = @fread($this->zip_fd, $v_read_size); //$v_binary_data = pack('a'.$v_read_size, $v_buffer); @fwrite($v_dest_file, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Write gz file format footer $v_binary_data = pack('VV', $p_entry['crc'], $p_entry['size']); @fwrite($v_dest_file, $v_binary_data, 8); // ----- Close the temporary file @fclose($v_dest_file); // ----- Opening destination file if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { $p_entry['status'] = "write_error"; return $v_result; } // ----- Open the temporary gz file if (($v_src_file = @gzopen($v_gzip_temp_name, 'rb')) == 0) { @fclose($v_dest_file); $p_entry['status'] = "read_error"; PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); return PclZip::errorCode(); } // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks $v_size = $p_entry['size']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); $v_buffer = @gzread($v_src_file, $v_read_size); //$v_binary_data = pack('a'.$v_read_size, $v_buffer); @fwrite($v_dest_file, $v_buffer, $v_read_size); $v_size -= $v_read_size; } @fclose($v_dest_file); @gzclose($v_src_file); // ----- Delete the temporary file @unlink($v_gzip_temp_name); // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privExtractFileInOutput() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privExtractFileInOutput(&$p_entry, &$p_options) { $v_result=1; // ----- Read the file header if (($v_result = $this->privReadFileHeader($v_header)) != 1) { return $v_result; } // ----- Check that the file header is coherent with $p_entry info if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { // TBC } // ----- Look for pre-extract callback if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { // ----- Generate a local information $v_local_header = array(); $this->privConvertHeader2FileInfo($p_entry, $v_local_header); // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. // eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); if ($v_result == 0) { // ----- Change the file status $p_entry['status'] = "skipped"; $v_result = 1; } // ----- Look for abort result if ($v_result == 2) { // ----- This status is internal and will be changed in 'skipped' $p_entry['status'] = "aborted"; $v_result = PCLZIP_ERR_USER_ABORTED; } // ----- Update the information // Only some fields can be modified $p_entry['filename'] = $v_local_header['filename']; } // ----- Trace // ----- Look if extraction should be done if ($p_entry['status'] == 'ok') { // ----- Do the extraction (if not a folder) if (!(($p_entry['external']&0x00000010)==0x00000010)) { // ----- Look for not compressed file if ($p_entry['compressed_size'] == $p_entry['size']) { // ----- Read the file in a buffer (one shot) if ($p_entry['compressed_size'] > 0) { $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); } else { $v_buffer = ''; } // ----- Send the file to the output echo $v_buffer; unset($v_buffer); } else { // ----- Read the compressed file in a buffer (one shot) if ($p_entry['compressed_size'] > 0) { $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); } else { $v_buffer = ''; } // ----- Decompress the file $v_file_content = gzinflate($v_buffer); unset($v_buffer); // ----- Send the file to the output echo $v_file_content; unset($v_file_content); } } } // ----- Change abort status if ($p_entry['status'] == "aborted") { $p_entry['status'] = "skipped"; } // ----- Look for post-extract callback elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { // ----- Generate a local information $v_local_header = array(); $this->privConvertHeader2FileInfo($p_entry, $v_local_header); // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); // ----- Look for abort result if ($v_result == 2) { $v_result = PCLZIP_ERR_USER_ABORTED; } } return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privExtractFileAsString() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privExtractFileAsString(&$p_entry, &$p_string, &$p_options) { $v_result=1; // ----- Read the file header $v_header = array(); if (($v_result = $this->privReadFileHeader($v_header)) != 1) { // ----- Return return $v_result; } // ----- Check that the file header is coherent with $p_entry info if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { // TBC } // ----- Look for pre-extract callback if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { // ----- Generate a local information $v_local_header = array(); $this->privConvertHeader2FileInfo($p_entry, $v_local_header); // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); if ($v_result == 0) { // ----- Change the file status $p_entry['status'] = "skipped"; $v_result = 1; } // ----- Look for abort result if ($v_result == 2) { // ----- This status is internal and will be changed in 'skipped' $p_entry['status'] = "aborted"; $v_result = PCLZIP_ERR_USER_ABORTED; } // ----- Update the information // Only some fields can be modified $p_entry['filename'] = $v_local_header['filename']; } // ----- Look if extraction should be done if ($p_entry['status'] == 'ok') { // ----- Do the extraction (if not a folder) if (!(($p_entry['external']&0x00000010)==0x00000010)) { // ----- Look for not compressed file // if ($p_entry['compressed_size'] == $p_entry['size']) if ($p_entry['compression'] == 0) { // ----- Reading the file if ($p_entry['compressed_size'] > 0) { $p_string = @fread($this->zip_fd, $p_entry['compressed_size']); } else { $p_string = ''; } } else { // ----- Reading the file if ($p_entry['compressed_size'] > 0) { $v_data = @fread($this->zip_fd, $p_entry['compressed_size']); } else { $v_data = ''; } // ----- Decompress the file if (($p_string = @gzinflate($v_data)) === FALSE) { // TBC } } // ----- Trace } else { // TBC : error : can not extract a folder in a string } } // ----- Change abort status if ($p_entry['status'] == "aborted") { $p_entry['status'] = "skipped"; } // ----- Look for post-extract callback elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { // ----- Generate a local information $v_local_header = array(); $this->privConvertHeader2FileInfo($p_entry, $v_local_header); // ----- Swap the content to header $v_local_header['content'] = $p_string; $p_string = ''; // ----- Call the callback // Here I do not use call_user_func() because I need to send a reference to the // header. $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); // ----- Swap back the content to header $p_string = $v_local_header['content']; unset($v_local_header['content']); // ----- Look for abort result if ($v_result == 2) { $v_result = PCLZIP_ERR_USER_ABORTED; } } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privReadFileHeader() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privReadFileHeader(&$p_header) { $v_result=1; // ----- Read the 4 bytes signature $v_binary_data = @fread($this->zip_fd, 4); $v_data = unpack('Vid', $v_binary_data); // ----- Check signature if ($v_data['id'] != 0x04034b50) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); // ----- Return return PclZip::errorCode(); } // ----- Read the first 42 bytes of the header $v_binary_data = fread($this->zip_fd, 26); // ----- Look for invalid block size if (strlen($v_binary_data) != 26) { $p_header['filename'] = ""; $p_header['status'] = "invalid_header"; // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); // ----- Return return PclZip::errorCode(); } // ----- Extract the values $v_data = unpack('vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $v_binary_data); // ----- Get filename $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']); // ----- Get extra_fields if ($v_data['extra_len'] != 0) { $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']); } else { $p_header['extra'] = ''; } // ----- Extract properties $p_header['version_extracted'] = $v_data['version']; $p_header['compression'] = $v_data['compression']; $p_header['size'] = $v_data['size']; $p_header['compressed_size'] = $v_data['compressed_size']; $p_header['crc'] = $v_data['crc']; $p_header['flag'] = $v_data['flag']; $p_header['filename_len'] = $v_data['filename_len']; // ----- Recuperate date in UNIX format $p_header['mdate'] = $v_data['mdate']; $p_header['mtime'] = $v_data['mtime']; if ($p_header['mdate'] && $p_header['mtime']) { // ----- Extract time $v_hour = ($p_header['mtime'] & 0xF800) >> 11; $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; $v_seconde = ($p_header['mtime'] & 0x001F)*2; // ----- Extract date $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; $v_month = ($p_header['mdate'] & 0x01E0) >> 5; $v_day = $p_header['mdate'] & 0x001F; // ----- Get UNIX date format $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); } else { $p_header['mtime'] = time(); } // TBC //for(reset($v_data); $key = key($v_data); next($v_data)) { //} // ----- Set the stored filename $p_header['stored_filename'] = $p_header['filename']; // ----- Set the status field $p_header['status'] = "ok"; // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privReadCentralFileHeader() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privReadCentralFileHeader(&$p_header) { $v_result=1; // ----- Read the 4 bytes signature $v_binary_data = @fread($this->zip_fd, 4); $v_data = unpack('Vid', $v_binary_data); // ----- Check signature if ($v_data['id'] != 0x02014b50) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); // ----- Return return PclZip::errorCode(); } // ----- Read the first 42 bytes of the header $v_binary_data = fread($this->zip_fd, 42); // ----- Look for invalid block size if (strlen($v_binary_data) != 42) { $p_header['filename'] = ""; $p_header['status'] = "invalid_header"; // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); // ----- Return return PclZip::errorCode(); } // ----- Extract the values $p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data); // ----- Get filename if ($p_header['filename_len'] != 0) $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']); else $p_header['filename'] = ''; // ----- Get extra if ($p_header['extra_len'] != 0) $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']); else $p_header['extra'] = ''; // ----- Get comment if ($p_header['comment_len'] != 0) $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']); else $p_header['comment'] = ''; // ----- Extract properties // ----- Recuperate date in UNIX format //if ($p_header['mdate'] && $p_header['mtime']) // TBC : bug : this was ignoring time with 0/0/0 if (1) { // ----- Extract time $v_hour = ($p_header['mtime'] & 0xF800) >> 11; $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; $v_seconde = ($p_header['mtime'] & 0x001F)*2; // ----- Extract date $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; $v_month = ($p_header['mdate'] & 0x01E0) >> 5; $v_day = $p_header['mdate'] & 0x001F; // ----- Get UNIX date format $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); } else { $p_header['mtime'] = time(); } // ----- Set the stored filename $p_header['stored_filename'] = $p_header['filename']; // ----- Set default status to ok $p_header['status'] = 'ok'; // ----- Look if it is a directory if (substr($p_header['filename'], -1) == '/') { //$p_header['external'] = 0x41FF0010; $p_header['external'] = 0x00000010; } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privCheckFileHeaders() // Description : // Parameters : // Return Values : // 1 on success, // 0 on error; // -------------------------------------------------------------------------------- function privCheckFileHeaders(&$p_local_header, &$p_central_header) { $v_result=1; // ----- Check the static values // TBC if ($p_local_header['filename'] != $p_central_header['filename']) { } if ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) { } if ($p_local_header['flag'] != $p_central_header['flag']) { } if ($p_local_header['compression'] != $p_central_header['compression']) { } if ($p_local_header['mtime'] != $p_central_header['mtime']) { } if ($p_local_header['filename_len'] != $p_central_header['filename_len']) { } // ----- Look for flag bit 3 if (($p_local_header['flag'] & 8) == 8) { $p_local_header['size'] = $p_central_header['size']; $p_local_header['compressed_size'] = $p_central_header['compressed_size']; $p_local_header['crc'] = $p_central_header['crc']; } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privReadEndCentralDir() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privReadEndCentralDir(&$p_central_dir) { $v_result=1; // ----- Go to the end of the zip file $v_size = filesize($this->zipname); @fseek($this->zip_fd, $v_size); if (@ftell($this->zip_fd) != $v_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->zipname.'\''); // ----- Return return PclZip::errorCode(); } // ----- First try : look if this is an archive with no commentaries (most of the time) // in this case the end of central dir is at 22 bytes of the file end $v_found = 0; if ($v_size > 26) { @fseek($this->zip_fd, $v_size-22); if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); // ----- Return return PclZip::errorCode(); } // ----- Read for bytes $v_binary_data = @fread($this->zip_fd, 4); $v_data = @unpack('Vid', $v_binary_data); // ----- Check signature if ($v_data['id'] == 0x06054b50) { $v_found = 1; } $v_pos = ftell($this->zip_fd); } // ----- Go back to the maximum possible size of the Central Dir End Record if (!$v_found) { $v_maximum_size = 65557; // 0xFFFF + 22; if ($v_maximum_size > $v_size) $v_maximum_size = $v_size; @fseek($this->zip_fd, $v_size-$v_maximum_size); if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); // ----- Return return PclZip::errorCode(); } // ----- Read byte per byte in order to find the signature $v_pos = ftell($this->zip_fd); $v_bytes = 0x00000000; while ($v_pos < $v_size) { // ----- Read a byte $v_byte = @fread($this->zip_fd, 1); // ----- Add the byte //$v_bytes = ($v_bytes << 8) | Ord($v_byte); // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number // Otherwise on systems where we have 64bit integers the check below for the magic number will fail. $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte); // ----- Compare the bytes if ($v_bytes == 0x504b0506) { $v_pos++; break; } $v_pos++; } // ----- Look if not found end of central dir if ($v_pos == $v_size) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Unable to find End of Central Dir Record signature"); // ----- Return return PclZip::errorCode(); } } // ----- Read the first 18 bytes of the header $v_binary_data = fread($this->zip_fd, 18); // ----- Look for invalid block size if (strlen($v_binary_data) != 18) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid End of Central Dir Record size : ".strlen($v_binary_data)); // ----- Return return PclZip::errorCode(); } // ----- Extract the values $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data); // ----- Check the global size if (($v_pos + $v_data['comment_size'] + 18) != $v_size) { // ----- Removed in release 2.2 see readme file // The check of the file size is a little too strict. // Some bugs where found when a zip is encrypted/decrypted with 'crypt'. // While decrypted, zip has training 0 bytes if (0) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'The central dir is not at the end of the archive.' .' Some trailing bytes exists after the archive.'); // ----- Return return PclZip::errorCode(); } } // ----- Get comment if ($v_data['comment_size'] != 0) { $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']); } else $p_central_dir['comment'] = ''; $p_central_dir['entries'] = $v_data['entries']; $p_central_dir['disk_entries'] = $v_data['disk_entries']; $p_central_dir['offset'] = $v_data['offset']; $p_central_dir['size'] = $v_data['size']; $p_central_dir['disk'] = $v_data['disk']; $p_central_dir['disk_start'] = $v_data['disk_start']; // TBC //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) { //} // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privDeleteByRule() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privDeleteByRule(&$p_result_list, &$p_options) { $v_result=1; $v_list_detail = array(); // ----- Open the zip file if (($v_result=$this->privOpenFd('rb')) != 1) { // ----- Return return $v_result; } // ----- Read the central directory information $v_central_dir = array(); if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { $this->privCloseFd(); return $v_result; } // ----- Go to beginning of File @rewind($this->zip_fd); // ----- Scan all the files // ----- Start at beginning of Central Dir $v_pos_entry = $v_central_dir['offset']; @rewind($this->zip_fd); if (@fseek($this->zip_fd, $v_pos_entry)) { // ----- Close the zip file $this->privCloseFd(); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); // ----- Return return PclZip::errorCode(); } // ----- Read each entry $v_header_list = array(); $j_start = 0; for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) { // ----- Read the file header $v_header_list[$v_nb_extracted] = array(); if (($v_result = $this->privReadCentralFileHeader($v_header_list[$v_nb_extracted])) != 1) { // ----- Close the zip file $this->privCloseFd(); return $v_result; } // ----- Store the index $v_header_list[$v_nb_extracted]['index'] = $i; // ----- Look for the specific extract rules $v_found = false; // ----- Look for extract by name rule if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { // ----- Look if the filename is in the list for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_found); $j++) { // ----- Look for a directory if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == "/") { // ----- Look if the directory is in the filename path if ( (strlen($v_header_list[$v_nb_extracted]['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { $v_found = true; } elseif ( (($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */ && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) { $v_found = true; } } // ----- Look for a filename elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { $v_found = true; } } } // ----- Look for extract by ereg rule // ereg() is deprecated with PHP 5.3 /* else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { $v_found = true; } } */ // ----- Look for extract by preg rule else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { $v_found = true; } } // ----- Look for extract by index rule else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { // ----- Look if the index is in the list for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_found); $j++) { if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { $v_found = true; } if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { $j_start = $j+1; } if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { break; } } } else { $v_found = true; } // ----- Look for deletion if ($v_found) { unset($v_header_list[$v_nb_extracted]); } else { $v_nb_extracted++; } } // ----- Look if something need to be deleted if ($v_nb_extracted > 0) { // ----- Creates a temporary file $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; // ----- Creates a temporary zip archive $v_temp_zip = new PclZip($v_zip_temp_name); // ----- Open the temporary zip file in write mode if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) { $this->privCloseFd(); // ----- Return return $v_result; } // ----- Look which file need to be kept for ($i=0; $i<sizeof($v_header_list); $i++) { // ----- Calculate the position of the header @rewind($this->zip_fd); if (@fseek($this->zip_fd, $v_header_list[$i]['offset'])) { // ----- Close the zip file $this->privCloseFd(); $v_temp_zip->privCloseFd(); @unlink($v_zip_temp_name); // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); // ----- Return return PclZip::errorCode(); } // ----- Read the file header $v_local_header = array(); if (($v_result = $this->privReadFileHeader($v_local_header)) != 1) { // ----- Close the zip file $this->privCloseFd(); $v_temp_zip->privCloseFd(); @unlink($v_zip_temp_name); // ----- Return return $v_result; } // ----- Check that local file header is same as central file header if ($this->privCheckFileHeaders($v_local_header, $v_header_list[$i]) != 1) { // TBC } unset($v_local_header); // ----- Write the file header if (($v_result = $v_temp_zip->privWriteFileHeader($v_header_list[$i])) != 1) { // ----- Close the zip file $this->privCloseFd(); $v_temp_zip->privCloseFd(); @unlink($v_zip_temp_name); // ----- Return return $v_result; } // ----- Read/write the data block if (($v_result = PclZipUtilCopyBlock($this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size'])) != 1) { // ----- Close the zip file $this->privCloseFd(); $v_temp_zip->privCloseFd(); @unlink($v_zip_temp_name); // ----- Return return $v_result; } } // ----- Store the offset of the central dir $v_offset = @ftell($v_temp_zip->zip_fd); // ----- Re-Create the Central Dir files header for ($i=0; $i<sizeof($v_header_list); $i++) { // ----- Create the file header if (($v_result = $v_temp_zip->privWriteCentralFileHeader($v_header_list[$i])) != 1) { $v_temp_zip->privCloseFd(); $this->privCloseFd(); @unlink($v_zip_temp_name); // ----- Return return $v_result; } // ----- Transform the header to a 'usable' info $v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); } // ----- Zip file comment $v_comment = ''; if (isset($p_options[PCLZIP_OPT_COMMENT])) { $v_comment = $p_options[PCLZIP_OPT_COMMENT]; } // ----- Calculate the size of the central header $v_size = @ftell($v_temp_zip->zip_fd)-$v_offset; // ----- Create the central dir footer if (($v_result = $v_temp_zip->privWriteCentralHeader(sizeof($v_header_list), $v_size, $v_offset, $v_comment)) != 1) { // ----- Reset the file list unset($v_header_list); $v_temp_zip->privCloseFd(); $this->privCloseFd(); @unlink($v_zip_temp_name); // ----- Return return $v_result; } // ----- Close $v_temp_zip->privCloseFd(); $this->privCloseFd(); // ----- Delete the zip file // TBC : I should test the result ... @unlink($this->zipname); // ----- Rename the temporary file // TBC : I should test the result ... //@rename($v_zip_temp_name, $this->zipname); PclZipUtilRename($v_zip_temp_name, $this->zipname); // ----- Destroy the temporary archive unset($v_temp_zip); } // ----- Remove every files : reset the file else if ($v_central_dir['entries'] != 0) { $this->privCloseFd(); if (($v_result = $this->privOpenFd('wb')) != 1) { return $v_result; } if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) { return $v_result; } $this->privCloseFd(); } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privDirCheck() // Description : // Check if a directory exists, if not it creates it and all the parents directory // which may be useful. // Parameters : // $p_dir : Directory path to check. // Return Values : // 1 : OK // -1 : Unable to create directory // -------------------------------------------------------------------------------- function privDirCheck($p_dir, $p_is_dir=false) { $v_result = 1; // ----- Remove the final '/' if (($p_is_dir) && (substr($p_dir, -1)=='/')) { $p_dir = substr($p_dir, 0, strlen($p_dir)-1); } // ----- Check the directory availability if ((is_dir($p_dir)) || ($p_dir == "")) { return 1; } // ----- Extract parent directory $p_parent_dir = dirname($p_dir); // ----- Just a check if ($p_parent_dir != $p_dir) { // ----- Look for parent directory if ($p_parent_dir != "") { if (($v_result = $this->privDirCheck($p_parent_dir)) != 1) { return $v_result; } } } // ----- Create the directory if (!@mkdir($p_dir, 0777)) { // ----- Error log PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, "Unable to create directory '$p_dir'"); // ----- Return return PclZip::errorCode(); } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privMerge() // Description : // If $p_archive_to_add does not exist, the function exit with a success result. // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privMerge(&$p_archive_to_add) { $v_result=1; // ----- Look if the archive_to_add exists if (!is_file($p_archive_to_add->zipname)) { // ----- Nothing to merge, so merge is a success $v_result = 1; // ----- Return return $v_result; } // ----- Look if the archive exists if (!is_file($this->zipname)) { // ----- Do a duplicate $v_result = $this->privDuplicate($p_archive_to_add->zipname); // ----- Return return $v_result; } // ----- Open the zip file if (($v_result=$this->privOpenFd('rb')) != 1) { // ----- Return return $v_result; } // ----- Read the central directory information $v_central_dir = array(); if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) { $this->privCloseFd(); return $v_result; } // ----- Go to beginning of File @rewind($this->zip_fd); // ----- Open the archive_to_add file if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1) { $this->privCloseFd(); // ----- Return return $v_result; } // ----- Read the central directory information $v_central_dir_to_add = array(); if (($v_result = $p_archive_to_add->privReadEndCentralDir($v_central_dir_to_add)) != 1) { $this->privCloseFd(); $p_archive_to_add->privCloseFd(); return $v_result; } // ----- Go to beginning of File @rewind($p_archive_to_add->zip_fd); // ----- Creates a temporary file $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; // ----- Open the temporary file in write mode if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) { $this->privCloseFd(); $p_archive_to_add->privCloseFd(); PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); // ----- Return return PclZip::errorCode(); } // ----- Copy the files from the archive to the temporary file // TBC : Here I should better append the file and go back to erase the central dir $v_size = $v_central_dir['offset']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); $v_buffer = fread($this->zip_fd, $v_read_size); @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Copy the files from the archive_to_add into the temporary file $v_size = $v_central_dir_to_add['offset']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); $v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size); @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Store the offset of the central dir $v_offset = @ftell($v_zip_temp_fd); // ----- Copy the block of file headers from the old archive $v_size = $v_central_dir['size']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); $v_buffer = @fread($this->zip_fd, $v_read_size); @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Copy the block of file headers from the archive_to_add $v_size = $v_central_dir_to_add['size']; while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size); @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Merge the file comments $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment']; // ----- Calculate the size of the (new) central header $v_size = @ftell($v_zip_temp_fd)-$v_offset; // ----- Swap the file descriptor // Here is a trick : I swap the temporary fd with the zip fd, in order to use // the following methods on the temporary fil and not the real archive fd $v_swap = $this->zip_fd; $this->zip_fd = $v_zip_temp_fd; $v_zip_temp_fd = $v_swap; // ----- Create the central dir footer if (($v_result = $this->privWriteCentralHeader($v_central_dir['entries']+$v_central_dir_to_add['entries'], $v_size, $v_offset, $v_comment)) != 1) { $this->privCloseFd(); $p_archive_to_add->privCloseFd(); @fclose($v_zip_temp_fd); $this->zip_fd = null; // ----- Reset the file list unset($v_header_list); // ----- Return return $v_result; } // ----- Swap back the file descriptor $v_swap = $this->zip_fd; $this->zip_fd = $v_zip_temp_fd; $v_zip_temp_fd = $v_swap; // ----- Close $this->privCloseFd(); $p_archive_to_add->privCloseFd(); // ----- Close the temporary file @fclose($v_zip_temp_fd); // ----- Delete the zip file // TBC : I should test the result ... @unlink($this->zipname); // ----- Rename the temporary file // TBC : I should test the result ... //@rename($v_zip_temp_name, $this->zipname); PclZipUtilRename($v_zip_temp_name, $this->zipname); // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privDuplicate() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privDuplicate($p_archive_filename) { $v_result=1; // ----- Look if the $p_archive_filename exists if (!is_file($p_archive_filename)) { // ----- Nothing to duplicate, so duplicate is a success. $v_result = 1; // ----- Return return $v_result; } // ----- Open the zip file if (($v_result=$this->privOpenFd('wb')) != 1) { // ----- Return return $v_result; } // ----- Open the temporary file in write mode if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0) { $this->privCloseFd(); PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode'); // ----- Return return PclZip::errorCode(); } // ----- Copy the files from the archive to the temporary file // TBC : Here I should better append the file and go back to erase the central dir $v_size = filesize($p_archive_filename); while ($v_size != 0) { $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); $v_buffer = fread($v_zip_temp_fd, $v_read_size); @fwrite($this->zip_fd, $v_buffer, $v_read_size); $v_size -= $v_read_size; } // ----- Close $this->privCloseFd(); // ----- Close the temporary file @fclose($v_zip_temp_fd); // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privErrorLog() // Description : // Parameters : // -------------------------------------------------------------------------------- function privErrorLog($p_error_code=0, $p_error_string='') { if (PCLZIP_ERROR_EXTERNAL == 1) { PclError($p_error_code, $p_error_string); } else { $this->error_code = $p_error_code; $this->error_string = $p_error_string; } } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privErrorReset() // Description : // Parameters : // -------------------------------------------------------------------------------- function privErrorReset() { if (PCLZIP_ERROR_EXTERNAL == 1) { PclErrorReset(); } else { $this->error_code = 0; $this->error_string = ''; } } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privDisableMagicQuotes() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privDisableMagicQuotes() { $v_result=1; // EDIT for WordPress 5.3.0 // magic_quote functions are deprecated in PHP 7.4, now assuming it's always off. /* // ----- Look if function exists if ( (!function_exists("get_magic_quotes_runtime")) || (!function_exists("set_magic_quotes_runtime"))) { return $v_result; } // ----- Look if already done if ($this->magic_quotes_status != -1) { return $v_result; } // ----- Get and memorize the magic_quote value $this->magic_quotes_status = @get_magic_quotes_runtime(); // ----- Disable magic_quotes if ($this->magic_quotes_status == 1) { @set_magic_quotes_runtime(0); } */ // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : privSwapBackMagicQuotes() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function privSwapBackMagicQuotes() { $v_result=1; // EDIT for WordPress 5.3.0 // magic_quote functions are deprecated in PHP 7.4, now assuming it's always off. /* // ----- Look if function exists if ( (!function_exists("get_magic_quotes_runtime")) || (!function_exists("set_magic_quotes_runtime"))) { return $v_result; } // ----- Look if something to do if ($this->magic_quotes_status != -1) { return $v_result; } // ----- Swap back magic_quotes if ($this->magic_quotes_status == 1) { @set_magic_quotes_runtime($this->magic_quotes_status); } */ // ----- Return return $v_result; } // -------------------------------------------------------------------------------- } // End of class // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : PclZipUtilPathReduction() // Description : // Parameters : // Return Values : // -------------------------------------------------------------------------------- function PclZipUtilPathReduction($p_dir) { $v_result = ""; // ----- Look for not empty path if ($p_dir != "") { // ----- Explode path by directory names $v_list = explode("/", $p_dir); // ----- Study directories from last to first $v_skip = 0; for ($i=sizeof($v_list)-1; $i>=0; $i--) { // ----- Look for current path if ($v_list[$i] == ".") { // ----- Ignore this directory // Should be the first $i=0, but no check is done } else if ($v_list[$i] == "..") { $v_skip++; } else if ($v_list[$i] == "") { // ----- First '/' i.e. root slash if ($i == 0) { $v_result = "/".$v_result; if ($v_skip > 0) { // ----- It is an invalid path, so the path is not modified // TBC $v_result = $p_dir; $v_skip = 0; } } // ----- Last '/' i.e. indicates a directory else if ($i == (sizeof($v_list)-1)) { $v_result = $v_list[$i]; } // ----- Double '/' inside the path else { // ----- Ignore only the double '//' in path, // but not the first and last '/' } } else { // ----- Look for item to skip if ($v_skip > 0) { $v_skip--; } else { $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:""); } } } // ----- Look for skip if ($v_skip > 0) { while ($v_skip > 0) { $v_result = '../'.$v_result; $v_skip--; } } } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : PclZipUtilPathInclusion() // Description : // This function indicates if the path $p_path is under the $p_dir tree. Or, // said in an other way, if the file or sub-dir $p_path is inside the dir // $p_dir. // The function indicates also if the path is exactly the same as the dir. // This function supports path with duplicated '/' like '//', but does not // support '.' or '..' statements. // Parameters : // Return Values : // 0 if $p_path is not inside directory $p_dir // 1 if $p_path is inside directory $p_dir // 2 if $p_path is exactly the same as $p_dir // -------------------------------------------------------------------------------- function PclZipUtilPathInclusion($p_dir, $p_path) { $v_result = 1; // ----- Look for path beginning by ./ if ( ($p_dir == '.') || ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) { $p_dir = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_dir, 1); } if ( ($p_path == '.') || ((strlen($p_path) >=2) && (substr($p_path, 0, 2) == './'))) { $p_path = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_path, 1); } // ----- Explode dir and path by directory separator $v_list_dir = explode("/", $p_dir); $v_list_dir_size = sizeof($v_list_dir); $v_list_path = explode("/", $p_path); $v_list_path_size = sizeof($v_list_path); // ----- Study directories paths $i = 0; $j = 0; while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) { // ----- Look for empty dir (path reduction) if ($v_list_dir[$i] == '') { $i++; continue; } if ($v_list_path[$j] == '') { $j++; continue; } // ----- Compare the items if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ( $v_list_path[$j] != '')) { $v_result = 0; } // ----- Next items $i++; $j++; } // ----- Look if everything seems to be the same if ($v_result) { // ----- Skip all the empty items while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) $j++; while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) $i++; if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) { // ----- There are exactly the same $v_result = 2; } else if ($i < $v_list_dir_size) { // ----- The path is shorter than the dir $v_result = 0; } } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : PclZipUtilCopyBlock() // Description : // Parameters : // $p_mode : read/write compression mode // 0 : src & dest normal // 1 : src gzip, dest normal // 2 : src normal, dest gzip // 3 : src & dest gzip // Return Values : // -------------------------------------------------------------------------------- function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0) { $v_result = 1; if ($p_mode==0) { while ($p_size != 0) { $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); $v_buffer = @fread($p_src, $v_read_size); @fwrite($p_dest, $v_buffer, $v_read_size); $p_size -= $v_read_size; } } else if ($p_mode==1) { while ($p_size != 0) { $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); $v_buffer = @gzread($p_src, $v_read_size); @fwrite($p_dest, $v_buffer, $v_read_size); $p_size -= $v_read_size; } } else if ($p_mode==2) { while ($p_size != 0) { $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); $v_buffer = @fread($p_src, $v_read_size); @gzwrite($p_dest, $v_buffer, $v_read_size); $p_size -= $v_read_size; } } else if ($p_mode==3) { while ($p_size != 0) { $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); $v_buffer = @gzread($p_src, $v_read_size); @gzwrite($p_dest, $v_buffer, $v_read_size); $p_size -= $v_read_size; } } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : PclZipUtilRename() // Description : // This function tries to do a simple rename() function. If it fails, it // tries to copy the $p_src file in a new $p_dest file and then unlink the // first one. // Parameters : // $p_src : Old filename // $p_dest : New filename // Return Values : // 1 on success, 0 on failure. // -------------------------------------------------------------------------------- function PclZipUtilRename($p_src, $p_dest) { $v_result = 1; // ----- Try to rename the files if (!@rename($p_src, $p_dest)) { // ----- Try to copy & unlink the src if (!@copy($p_src, $p_dest)) { $v_result = 0; } else if (!@unlink($p_src)) { $v_result = 0; } } // ----- Return return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : PclZipUtilOptionText() // Description : // Translate option value in text. Mainly for debug purpose. // Parameters : // $p_option : the option value. // Return Values : // The option text value. // -------------------------------------------------------------------------------- function PclZipUtilOptionText($p_option) { $v_list = get_defined_constants(); for (reset($v_list); $v_key = key($v_list); next($v_list)) { $v_prefix = substr($v_key, 0, 10); if (( ($v_prefix == 'PCLZIP_OPT') || ($v_prefix == 'PCLZIP_CB_') || ($v_prefix == 'PCLZIP_ATT')) && ($v_list[$v_key] == $p_option)) { return $v_key; } } $v_result = 'Unknown'; return $v_result; } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- // Function : PclZipUtilTranslateWinPath() // Description : // Translate windows path by replacing '\' by '/' and optionally removing // drive letter. // Parameters : // $p_path : path to translate. // $p_remove_disk_letter : true | false // Return Values : // The path translated. // -------------------------------------------------------------------------------- function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true) { if (PHP_OS_FAMILY == 'Windows') { // ----- Look for potential disk letter if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) { $p_path = substr($p_path, $v_position+1); } // ----- Change potential windows directory separator if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0,1) == '\\')) { $p_path = strtr($p_path, '\\', '/'); } } return $p_path; } // -------------------------------------------------------------------------------- ?> PK x �Z��-�� � '