Changeset 3380056
- Timestamp:
- 10/17/2025 11:23:08 AM (5 months ago)
- Location:
- wordpress-reset
- Files:
-
- 6 edited
-
tags/1.5.0/includes/class-wpre-reset.php (modified) (4 diffs)
-
tags/1.5.0/readme.txt (modified) (1 diff)
-
tags/1.5.0/wordpress-reset.php (modified) (1 diff)
-
trunk/includes/class-wpre-reset.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/wordpress-reset.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wordpress-reset/tags/1.5.0/includes/class-wpre-reset.php
r3379912 r3380056 86 86 $database_file = FQDB; 87 87 } elseif ( defined( 'DB_DIR' ) && defined( 'DB_FILE' ) ) { 88 $database_file = DB_DIR. DB_FILE;88 $database_file = \trailingslashit( DB_DIR ) . DB_FILE; 89 89 } elseif ( defined( 'DB_FILE' ) ) { 90 90 // Fallback: try WP_CONTENT_DIR/database/ directory. 91 $database_file = WP_CONTENT_DIR . '/database/' . DB_FILE;91 $database_file = \trailingslashit( WP_CONTENT_DIR ) . 'database/' . DB_FILE; 92 92 } else { 93 93 // Final fallback: default SQLite location. 94 $database_file = WP_CONTENT_DIR . '/database/.ht.sqlite';94 $database_file = \trailingslashit( WP_CONTENT_DIR ) . 'database/.ht.sqlite'; 95 95 } 96 96 … … 280 280 /** 281 281 * Enqueue admin scripts and styles. 282 * 283 * @access public 284 * @return void 285 */ 286 public function admin_js(): void { 282 * Only loads on the plugin's admin page. 283 * 284 * @access public 285 * @param string $hook The current admin page hook. 286 * @return void 287 */ 288 public function admin_enqueue_scripts( string $hook ): void { 289 // Only load on our plugin's page (Tools > Reset). 290 if ( 'tools_page_wordpress-reset' !== $hook ) { 291 return; 292 } 293 287 294 // Get plugin version from plugin headers. 288 295 // Load required WordPress functions if not available. … … 330 337 public function add_page(): void { 331 338 if ( \current_user_can( 'activate_plugins' ) && \function_exists( 'add_management_page' ) ) { 332 $hook =\add_management_page(339 \add_management_page( 333 340 \esc_html__( 'Reset', 'wordpress-reset' ), 334 341 \esc_html__( 'Reset', 'wordpress-reset' ), … … 337 344 array( $this, 'admin_page' ) 338 345 ); 339 \add_action( "admin_print_scripts-{$hook}", array( $this, 'admin_js' ) );346 \add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); 340 347 } 341 348 } -
wordpress-reset/tags/1.5.0/readme.txt
r3379908 r3380056 1 === W ordPressReset ===1 === WP Database Reset === 2 2 Contributors: aristath, sivel 3 3 Donate Link: http://aristath.github.io/donate -
wordpress-reset/tags/1.5.0/wordpress-reset.php
r3379908 r3380056 1 1 <?php 2 2 /** 3 * Plugin Name: WP Reset3 * Plugin Name: WP Database Reset 4 4 * Plugin URI: http://sivel.net/wordpress/wordpress-reset/ 5 * Description: Resets the WordPress database back to it 's defaults. Deletes all customizations and content. Does not modify files only resets the database.5 * Description: Resets the WordPress database back to its defaults. Deletes all customizations and content. Does not modify files only resets the database. 6 6 * Author: Aristeidis Stathopoulos, Matt Martz 7 7 * Version: 1.5.0 -
wordpress-reset/trunk/includes/class-wpre-reset.php
r3379912 r3380056 86 86 $database_file = FQDB; 87 87 } elseif ( defined( 'DB_DIR' ) && defined( 'DB_FILE' ) ) { 88 $database_file = DB_DIR. DB_FILE;88 $database_file = \trailingslashit( DB_DIR ) . DB_FILE; 89 89 } elseif ( defined( 'DB_FILE' ) ) { 90 90 // Fallback: try WP_CONTENT_DIR/database/ directory. 91 $database_file = WP_CONTENT_DIR . '/database/' . DB_FILE;91 $database_file = \trailingslashit( WP_CONTENT_DIR ) . 'database/' . DB_FILE; 92 92 } else { 93 93 // Final fallback: default SQLite location. 94 $database_file = WP_CONTENT_DIR . '/database/.ht.sqlite';94 $database_file = \trailingslashit( WP_CONTENT_DIR ) . 'database/.ht.sqlite'; 95 95 } 96 96 … … 280 280 /** 281 281 * Enqueue admin scripts and styles. 282 * 283 * @access public 284 * @return void 285 */ 286 public function admin_js(): void { 282 * Only loads on the plugin's admin page. 283 * 284 * @access public 285 * @param string $hook The current admin page hook. 286 * @return void 287 */ 288 public function admin_enqueue_scripts( string $hook ): void { 289 // Only load on our plugin's page (Tools > Reset). 290 if ( 'tools_page_wordpress-reset' !== $hook ) { 291 return; 292 } 293 287 294 // Get plugin version from plugin headers. 288 295 // Load required WordPress functions if not available. … … 330 337 public function add_page(): void { 331 338 if ( \current_user_can( 'activate_plugins' ) && \function_exists( 'add_management_page' ) ) { 332 $hook =\add_management_page(339 \add_management_page( 333 340 \esc_html__( 'Reset', 'wordpress-reset' ), 334 341 \esc_html__( 'Reset', 'wordpress-reset' ), … … 337 344 array( $this, 'admin_page' ) 338 345 ); 339 \add_action( "admin_print_scripts-{$hook}", array( $this, 'admin_js' ) );346 \add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); 340 347 } 341 348 } -
wordpress-reset/trunk/readme.txt
r3379908 r3380056 1 === W ordPressReset ===1 === WP Database Reset === 2 2 Contributors: aristath, sivel 3 3 Donate Link: http://aristath.github.io/donate -
wordpress-reset/trunk/wordpress-reset.php
r3379908 r3380056 1 1 <?php 2 2 /** 3 * Plugin Name: WP Reset3 * Plugin Name: WP Database Reset 4 4 * Plugin URI: http://sivel.net/wordpress/wordpress-reset/ 5 * Description: Resets the WordPress database back to it 's defaults. Deletes all customizations and content. Does not modify files only resets the database.5 * Description: Resets the WordPress database back to its defaults. Deletes all customizations and content. Does not modify files only resets the database. 6 6 * Author: Aristeidis Stathopoulos, Matt Martz 7 7 * Version: 1.5.0
Note: See TracChangeset
for help on using the changeset viewer.