Plugin Directory

Changeset 3380056


Ignore:
Timestamp:
10/17/2025 11:23:08 AM (5 months ago)
Author:
aristath
Message:

Fix plugin name

Location:
wordpress-reset
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • wordpress-reset/tags/1.5.0/includes/class-wpre-reset.php

    r3379912 r3380056  
    8686                    $database_file = FQDB;
    8787                } elseif ( defined( 'DB_DIR' ) && defined( 'DB_FILE' ) ) {
    88                     $database_file = DB_DIR . DB_FILE;
     88                    $database_file = \trailingslashit( DB_DIR ) . DB_FILE;
    8989                } elseif ( defined( 'DB_FILE' ) ) {
    9090                    // 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;
    9292                } else {
    9393                    // Final fallback: default SQLite location.
    94                     $database_file = WP_CONTENT_DIR . '/database/.ht.sqlite';
     94                    $database_file = \trailingslashit( WP_CONTENT_DIR ) . 'database/.ht.sqlite';
    9595                }
    9696
     
    280280    /**
    281281     * 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
    287294        // Get plugin version from plugin headers.
    288295        // Load required WordPress functions if not available.
     
    330337    public function add_page(): void {
    331338        if ( \current_user_can( 'activate_plugins' ) && \function_exists( 'add_management_page' ) ) {
    332             $hook = \add_management_page(
     339            \add_management_page(
    333340                \esc_html__( 'Reset', 'wordpress-reset' ),
    334341                \esc_html__( 'Reset', 'wordpress-reset' ),
     
    337344                array( $this, 'admin_page' )
    338345            );
    339             \add_action( "admin_print_scripts-{$hook}", array( $this, 'admin_js' ) );
     346            \add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
    340347        }
    341348    }
  • wordpress-reset/tags/1.5.0/readme.txt

    r3379908 r3380056  
    1 === WordPress Reset ===
     1=== WP Database Reset ===
    22Contributors: aristath, sivel
    33Donate Link: http://aristath.github.io/donate
  • wordpress-reset/tags/1.5.0/wordpress-reset.php

    r3379908 r3380056  
    11<?php
    22/**
    3  * Plugin Name: WP Reset
     3 * Plugin Name: WP Database Reset
    44 * 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.
    66 * Author: Aristeidis Stathopoulos, Matt Martz
    77 * Version: 1.5.0
  • wordpress-reset/trunk/includes/class-wpre-reset.php

    r3379912 r3380056  
    8686                    $database_file = FQDB;
    8787                } elseif ( defined( 'DB_DIR' ) && defined( 'DB_FILE' ) ) {
    88                     $database_file = DB_DIR . DB_FILE;
     88                    $database_file = \trailingslashit( DB_DIR ) . DB_FILE;
    8989                } elseif ( defined( 'DB_FILE' ) ) {
    9090                    // 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;
    9292                } else {
    9393                    // Final fallback: default SQLite location.
    94                     $database_file = WP_CONTENT_DIR . '/database/.ht.sqlite';
     94                    $database_file = \trailingslashit( WP_CONTENT_DIR ) . 'database/.ht.sqlite';
    9595                }
    9696
     
    280280    /**
    281281     * 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
    287294        // Get plugin version from plugin headers.
    288295        // Load required WordPress functions if not available.
     
    330337    public function add_page(): void {
    331338        if ( \current_user_can( 'activate_plugins' ) && \function_exists( 'add_management_page' ) ) {
    332             $hook = \add_management_page(
     339            \add_management_page(
    333340                \esc_html__( 'Reset', 'wordpress-reset' ),
    334341                \esc_html__( 'Reset', 'wordpress-reset' ),
     
    337344                array( $this, 'admin_page' )
    338345            );
    339             \add_action( "admin_print_scripts-{$hook}", array( $this, 'admin_js' ) );
     346            \add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
    340347        }
    341348    }
  • wordpress-reset/trunk/readme.txt

    r3379908 r3380056  
    1 === WordPress Reset ===
     1=== WP Database Reset ===
    22Contributors: aristath, sivel
    33Donate Link: http://aristath.github.io/donate
  • wordpress-reset/trunk/wordpress-reset.php

    r3379908 r3380056  
    11<?php
    22/**
    3  * Plugin Name: WP Reset
     3 * Plugin Name: WP Database Reset
    44 * 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.
    66 * Author: Aristeidis Stathopoulos, Matt Martz
    77 * Version: 1.5.0
Note: See TracChangeset for help on using the changeset viewer.