__( 'Modula plugin' ), 'fields' => apply_filters( 'modula_debug_information', array( 'core_version' => array( 'label' => __( 'Core Version', 'modula-best-grid-gallery' ), 'value' => MODULA_LITE_VERSION, 'debug' => 'Core version ' . MODULA_LITE_VERSION, ), 'requested_php' => array( 'label' => __( 'Minimum PHP' ), 'value' => 5.6, 'debug' => ( (float)5.6 > (float)phpversion() ) ? 'PHP minimum version not met' : 'PHP minimum version met', ), 'requested_wp' => array( 'label' => __( 'Minimum WP', 'modula-best-grid-gallery' ), 'value' => 5.2, 'debug' => ( (float)get_bloginfo( 'version' ) < (float)5.2 ) ? 'WordPress minimum version not met.Current version: ' . get_bloginfo( 'version' ) : 'Wordpress minimum version met. Current version: ' . get_bloginfo( 'version' ), ), 'galleries_number' => array( 'label' => __( 'Total galleries', 'modula-best-grid-gallery' ), 'value' => count( Modula_Helper::get_galleries() ) - 1, 'debug' => 'Total number of galleries: ' . ( count( Modula_Helper::get_galleries() ) - 1 ) ), 'track_data' => array( 'label' => __( 'Track data', 'modula-best-grid-gallery' ), 'value' => ( $troubleshoot_opt && isset( $troubleshoot_opt[ 'track_data' ] ) && '1' == $troubleshoot_opt[ 'track_data' ] ) ? __( 'Enabled', 'modula-best-grid-gallery' ) : __( 'Disabled', 'modula-best-grid-gallery' ), 'debug' => ( $troubleshoot_opt && isset( $troubleshoot_opt[ 'track_data' ] ) && '1' == $troubleshoot_opt[ 'track_data' ] ) ? 'Track data enabled' : 'Track data disabled' ), 'enqueue_files' => array( 'label' => __( 'Enqueue Modula\'s assets everywhere', 'modula-best-grid-gallery' ), 'value' => ( $troubleshoot_opt && isset( $troubleshoot_opt[ 'enqueue_files' ] ) && '1' == $troubleshoot_opt[ 'track_data' ] ) ? __( 'Enabled', 'modula-best-grid-gallery' ) : __( 'Disabled', 'modula-best-grid-gallery' ), 'debug' => ( $troubleshoot_opt && isset( $troubleshoot_opt[ 'enqueue_files' ] ) && '1' == $troubleshoot_opt[ 'track_data' ] ) ? 'Enqueue files everywhere' : 'Enqueue files disabled' ), 'grid_type' => array( 'label' => __( 'General grid type enqueued', 'modula-best-grid-gallery' ), 'value' => ( $troubleshoot_opt && isset( $troubleshoot_opt[ 'gridtypes' ] ) && isset( $troubleshoot_opt[ 'enqueue_files' ] ) && !empty( $troubleshoot_opt[ 'gridtypes' ] ) ) ? __( 'Enabled', 'modula-best-grid-gallery' ) : __( 'Disabled', 'modula-best-grid-gallery' ), 'debug' => ( $troubleshoot_opt && isset( $troubleshoot_opt[ 'gridtypes' ] ) && isset( $troubleshoot_opt[ 'enqueue_files' ] ) && !empty( $troubleshoot_opt[ 'gridtypes' ] ) ) ? 'Enqueue files for: ' . $grid_type : 'No grid type selected' ), 'lightboxes' => array( 'label' => __( 'Lightboxes everywhere', 'modula-best-grid-gallery' ), 'value' => ( $troubleshoot_opt && isset( $troubleshoot_opt[ 'lightboxes' ] ) && !empty( $troubleshoot_opt[ 'lightboxes' ] ) ) ? __( 'Enabled', 'modula-best-grid-gallery' ) : __( 'Disabled', 'modula-best-grid-gallery' ), 'debug' => ( $troubleshoot_opt && isset( $troubleshoot_opt[ 'lightboxes' ] ) && !empty( $troubleshoot_opt[ 'lightboxes' ] ) ) ? 'Enqueue files for: ' . $lightboxes : 'No lightbox selected' ), 'modula_lazyload' => array( 'label' => __( 'Enable general lazyload', 'modula-best-grid-gallery' ), 'value' => ( $troubleshoot_opt && isset( $troubleshoot_opt[ 'lazy_load' ] ) && '1' == $troubleshoot_opt[ 'lazy_load' ] ) ? __( 'Enabled', 'modula-best-grid-gallery' ) : __( 'Disabled', 'modula-best-grid-gallery' ), 'debug' => ( $troubleshoot_opt && isset( $troubleshoot_opt[ 'lazy_load' ] ) && '1' == $troubleshoot_opt[ 'lazy_load' ] ) ? 'General lazyload enabled: ' : 'No general lazyload' ), 'modula_edit_gallery_link' => array( 'label' => __( '"Edit gallery" link', 'modula-best-grid-gallery' ), 'value' => ( $troubleshoot_opt && isset( $troubleshoot_opt[ 'disable_edit' ] ) && '1' == $troubleshoot_opt[ 'disable_edit' ] ) ? __( 'Disabled', 'modula-best-grid-gallery' ) : __( 'Enabled', 'modula-best-grid-gallery' ), 'debug' => ( $troubleshoot_opt && isset( $troubleshoot_opt[ 'disable_edit' ] ) && '1' == $troubleshoot_opt[ 'disable_edit' ] ) ? 'Edit gallery link disabled: ' : 'Edit gallery link enabled' ), 'modula_disable_srcset' => array( 'label' => __( 'Disable images srcset', 'modula-best-grid-gallery' ), 'value' => ( $troubleshoot_opt && isset( $troubleshoot_opt[ 'disable_srcset' ] ) && '1' == $troubleshoot_opt[ 'disable_srcset' ] ) ? __( 'Disabled', 'modula-best-grid-gallery' ) : __( 'Enabled', 'modula-best-grid-gallery' ), 'debug' => ( $troubleshoot_opt && isset( $troubleshoot_opt[ 'disable_srcset' ] ) && '1' == $troubleshoot_opt[ 'disable_srcset' ] ) ? 'srcset is disabled: ' : 'srcset is enabled' ), ) ) ); return $info; } /** * Export single gallery * * @since 2.5.0 */ public function modula_export_gallery(){ if ( isset( $_GET['modula_single_download'] ) ){ // WXR_VERSION is declared here require_once ABSPATH . 'wp-admin/includes/export.php'; $post = get_post( absint( $_GET['modula_single_download'] ) ); if ( !$post || 'modula-gallery' != $post->post_type ){ return; } global $wpdb; $gallery_name = sanitize_key( $post->post_name ); if ( !empty( $gallery_name ) ){ $gallery_name .= '.'; } $date = gmdate( 'Y-m-d' ); $wp_filename = $gallery_name . $date . '.xml'; header( 'Content-Description: File Transfer' ); header( 'Content-Disposition: attachment; filename=' . $wp_filename ); header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true ); echo '\n"; ?> <?php bloginfo_rss( 'name' ); ?> post_title; ?> <?php echo esc_html( $title ); ?> wxr_cdata( get_the_author_meta( 'login' ) ); ?> ID; ?> wxr_cdata( $post->post_date ); ?> wxr_cdata( $post->post_date_gmt ); ?> wxr_cdata( $post->comment_status ); ?> wxr_cdata( $post->ping_status ); ?> wxr_cdata( $post->post_name ); ?> wxr_cdata( $post->post_status ); ?> post_parent; ?> menu_order; ?> wxr_cdata( $post->post_type ); ?> wxr_cdata( $post->post_password ); ?> get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) ); foreach ( $postmeta as $meta ) : /** * Filters whether to selectively skip post meta used for WXR exports. * * Returning a truthy value from the filter will skip the current meta * object from being exported. * * @param bool $skip Whether to skip the current post meta. Default false. * @param string $meta_key Current meta key. * @param object $meta Current meta object. * * @since 3.3.0 * */ if ( apply_filters( 'wxr_export_skip_postmeta', false, $meta->meta_key, $meta ) ){ continue; } ?> wxr_cdata( $meta->meta_key ); ?> wxr_cdata( $meta->meta_value ); ?> ', ']]]]>', wp_kses_post( $str ) ) . ']]>'; return $str; } /** * Add Debug metabox * * @since 2.5.0 */ public function debug_meta_box_setup() { /* Add meta boxes on the 'add_meta_boxes' hook. */ add_action( 'add_meta_boxes', array( $this, 'add_debug_meta_box' ),10 ); } /** * Add Debug metabox * * @since 2.5.0 */ public function add_debug_meta_box() { add_meta_box( 'modula-debug', // Unique ID esc_html__('Debug gallery', 'modula-best-grid-gallery'), // Title array( $this, 'output_debug_meta' ), // Callback function 'modula-gallery', // Admin page (or post type) 'side', // Context 'low' // Priority ); } /** * Output the Debug Gallery metabox * * @since 2.4.0 */ public function output_debug_meta(){ ?>