Changeset 3455487
- Timestamp:
- 02/06/2026 03:07:49 PM (2 weeks ago)
- Location:
- pluxo-blueprint/trunk
- Files:
-
- 4 edited
-
includes/Admin/class-pluxo-blueprint-overview.php (modified) (3 diffs)
-
includes/class-pluxo-blueprint.php (modified) (2 diffs)
-
pluxo-blueprint.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pluxo-blueprint/trunk/includes/Admin/class-pluxo-blueprint-overview.php
r3453209 r3455487 59 59 echo '<div class="pluxo-blueprint-card">'; 60 60 echo '<h2>' . esc_html__( 'Exports', 'pluxo-blueprint' ) . '</h2>'; 61 echo '<form method="post" action="' . esc_url( admin_url( 'admin-post.php' ) ) . '" target="_blank">'; 62 wp_nonce_field( 'pluxo_blueprint_export_overview_pdf' ); 63 echo '<input type="hidden" name="action" value="pluxo_blueprint_export_overview_pdf" />'; 64 echo '<p><button type="submit" class="button button-primary">'; 61 62 $print_url = add_query_arg( 63 array( 64 'page' => 'pluxo-blueprint', 65 'pluxo_bp_print' => '1', 66 '_wpnonce' => wp_create_nonce( 'pluxo_bp_print_overview' ), 67 ), 68 admin_url( 'admin.php' ) 69 ); 70 71 echo '<p><a class="button button-primary" href="' . esc_url( $print_url ) . '" target="_blank" rel="noopener">'; 65 72 echo esc_html__( 'Export Overview PDF', 'pluxo-blueprint' ); 66 echo '</button></p>'; 73 echo '</a></p>'; 74 67 75 echo '<p class="pluxo-blueprint-muted">'; 68 76 echo esc_html__( 'This will open a print-friendly page. Use your browser’s Print → Save as PDF.', 'pluxo-blueprint' ); … … 80 88 ); 81 89 echo '</p>'; 82 echo '</form>';83 90 echo '</div>'; 84 91 … … 148 155 echo '</div>'; 149 156 } 157 158 /** 159 * Get Overview modules HTML for print/export. 160 * 161 * @return string 162 */ 163 public function get_modules_html_for_print() { 164 ob_start(); 165 166 $this->render_export_view(); 167 168 return (string) ob_get_clean(); 169 } 170 150 171 } -
pluxo-blueprint/trunk/includes/class-pluxo-blueprint.php
r3453209 r3455487 105 105 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_menu_assets' ) ); 106 106 add_action( 'admin_init', array( $this, 'handle_overview_actions' ) ); 107 108 add_action( 'admin_post_pluxo_blueprint_export_overview_pdf', array( $this, 'handle_export_overview_pdf' ) ); 107 add_action( 'admin_init', array( $this, 'maybe_render_overview_print_view' ), 0 ); 109 108 110 109 } … … 291 290 292 291 /** 292 * Render Overview print view (GET, opens print-friendly HTML). 293 * 294 * URL example: 295 * /wp-admin/admin.php?page=pluxo-blueprint&pluxo_bp_print=1&_wpnonce=... 296 * 297 * @return void 298 */ 299 public function maybe_render_overview_print_view() { 300 if ( ! is_admin() ) { 301 return; 302 } 303 304 // Only our admin page context. 305 $page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : ''; 306 if ( 'pluxo-blueprint' !== $page ) { 307 return; 308 } 309 310 if ( empty( $_GET['pluxo_bp_print'] ) ) { 311 return; 312 } 313 314 // Capability check. 315 if ( ! current_user_can( 'manage_options' ) ) { 316 wp_die( esc_html__( 'You do not have permission to access this export.', 'pluxo-blueprint' ) ); 317 } 318 319 // Nonce check. 320 if ( empty( $_GET['_wpnonce'] ) ) { 321 wp_die( esc_html__( 'Invalid export link.', 'pluxo-blueprint' ) ); 322 } 323 324 $nonce = (string) wp_unslash( $_GET['_wpnonce'] ); 325 if ( ! wp_verify_nonce( $nonce, 'pluxo_bp_print_overview' ) ) { 326 wp_die( esc_html__( 'This export link has expired. Please try again.', 'pluxo-blueprint' ) ); 327 } 328 329 // Prevent any accidental output before headers. 330 if ( ob_get_level() ) { 331 while ( ob_get_level() ) { 332 ob_end_clean(); 333 } 334 } 335 336 // Force correct content-type (some stacks mess this up). 337 nocache_headers(); 338 header( 'Content-Type: text/html; charset=' . get_bloginfo( 'charset' ) ); 339 header( 'X-Content-Type-Options: nosniff' ); 340 341 require_once __DIR__ . '/Admin/class-pluxo-blueprint-overview.php'; 342 343 $overview = new Pluxo_Blueprint_Overview( $this ); 344 345 ob_start(); 346 $overview->render_export_view(); 347 $modules_html = (string) ob_get_clean(); 348 349 $plugin_dir = defined( 'PLUXO_BLUEPRINT_PLUGIN_DIR' ) 350 ? PLUXO_BLUEPRINT_PLUGIN_DIR 351 : plugin_dir_path( dirname( __DIR__ ) ); 352 353 $generator = new Pluxo_Blueprint_PDF_Generator( $plugin_dir ); 354 355 $generator->render_overview_print_page( $modules_html ); 356 exit; 357 } 358 359 /** 293 360 * Handle Overview export (print to PDF). 294 361 * -
pluxo-blueprint/trunk/pluxo-blueprint.php
r3455410 r3455487 4 4 * Plugin URI: https://pluxo.dev/#pluxo-blueprint 5 5 * Description: Generate a structured PDF snapshot of your WordPress site documentation, with a modular overview and easy Markdown copy for reuse. 6 * Version: 1.2. 16 * Version: 1.2.2 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 7.4 … … 63 63 64 64 if ( ! defined( 'PLUXO_BLUEPRINT_VERSION' ) ) { 65 define( 'PLUXO_BLUEPRINT_VERSION', '1.2. 1');65 define( 'PLUXO_BLUEPRINT_VERSION', '1.2.2'); 66 66 } 67 67 -
pluxo-blueprint/trunk/readme.txt
r3455410 r3455487 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1.2. 17 Stable tag: 1.2.2 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 58 58 59 59 == Changelog == 60 = 1.2.2 = 61 * Fixes in PDF export 62 63 == Changelog == 60 64 = 1.2.1 = 61 65 * Fixes in some of the modules in the overview
Note: See TracChangeset
for help on using the changeset viewer.