Advertisement
Guest User

Export WP Rocket's options without having access to the dashboard.

a guest
Jan 18th, 2023
1,431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. <?php
  2. // Load WordPress.
  3. require( 'wp-load.php' );
  4.  
  5. $filename = sprintf( 'wp-rocket-settings-%s-%s.json', date( 'Y-m-d' ), uniqid() );
  6. //$gz       = 'gz' . strrev( 'etalfed' );
  7. $options  = wp_json_encode( get_option( 'wp_rocket_settings' ) ); // do not use get_rocket_option() here.
  8. nocache_headers();
  9. @header( 'Content-Type: application/json' );
  10. @header( 'Content-Disposition: attachment; filename="' . $filename . '"' );
  11. @header( 'Content-Transfer-Encoding: binary' );
  12. @header( 'Content-Length: ' . strlen( $options ) );
  13. @header( 'Connection: close' );
  14. echo $options;
  15. exit();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement