Plugin Directory

Changeset 3491371


Ignore:
Timestamp:
03/26/2026 02:15:15 AM (7 days ago)
Author:
mervinpraison
Message:

Update to version 1.6.1 from GitHub

Location:
praison-file-content-git
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • praison-file-content-git/tags/1.6.1/praisonpressgit.php

    r3491360 r3491371  
    33 * Plugin Name: PraisonAI Git Posts
    44 * Description: Load WordPress content from files (Markdown, JSON, YAML) without database writes, with Git-based version control
    5  * Version: 1.6.0
     5 * Version: 1.6.1
    66 * Author: MervinPraison
    77 * Author URI: https://mer.vin
     
    1313
    1414// Define constants
    15 define('PRAISON_VERSION', '1.6.0');
     15define('PRAISON_VERSION', '1.6.1');
    1616define('PRAISON_PLUGIN_DIR', __DIR__);
    1717define('PRAISON_PLUGIN_URL', trailingslashit(plugins_url('', __FILE__)));
  • praison-file-content-git/tags/1.6.1/readme.txt

    r3489866 r3491371  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 1.1.0
     7Stable tag: 1.6.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    187187== Changelog ==
    188188
    189 = 1.0.0 =
    190 * Initial release
    191 * File-based content management
    192 * Markdown parser with YAML front matter support
    193 * Dynamic custom post type discovery
    194 * Custom URL routing
    195 * Built-in caching system
    196 * Git version control integration
    197 * Admin interface with version history
    198 * Auto-update detection for file changes
    199 * WordPress filter compatibility
     189= 1.6.1 =
     190* CRITICAL FIX: Archive safeguard - refuses to scan >500 files without _index.json, preventing OOM
     191* Added WordPress Settings page admin notice for index rebuild feedback
     192* Removed disconnected content_dir settings field
     193* Fixed duplicate docblock on loadSinglePost
     194
     195= 1.6.0 =
     196* NEW: WordPress Settings page for user-friendly configuration
     197* NEW: Index Status table with "Rebuild Index Now" button
     198* All settings stored in wp_options - no ini files or CLI needed
     199* Auto-generates _index.json on plugin activation
     200
     201= 1.5.0 =
     202* PERFORMANCE: Lazy constructor - zero filesystem I/O at plugin load
     203* PERFORMANCE: loadFromIndex() creates WP_Post from index metadata only
     204* PERFORMANCE: loadSinglePost() direct slug lookup - 1 file read (was: full scan)
     205* NEW: content.enabled safety check - plugin does nothing unless enabled
     206* NEW: Cache stampede protection with wp_cache_add lock
    200207
    201208= 1.0.9 =
  • praison-file-content-git/tags/1.6.1/src/Admin/SettingsPage.php

    r3491360 r3491371  
    7575        );
    7676       
    77         add_settings_field(
    78             'content_dir',
    79             'Content Directory',
    80             [$this, 'renderTextField'],
    81             'praison-settings',
    82             'praisonpress_content',
    83             [
    84                 'field' => 'content_dir',
    85                 'description' => 'Path to the content directory. Default: <code>' . esc_html(PRAISON_CONTENT_DIR) . '</code>',
    86                 'placeholder' => PRAISON_CONTENT_DIR,
    87             ]
    88         );
    89        
    9077        // ── Section: Performance ──
    9178        add_settings_section(
     
    142129            'content_enabled' => false,
    143130            'post_types'      => ['lyrics', 'chords'],
    144             'content_dir'     => '',
    145131            'cache_enabled'   => true,
    146132            'cache_ttl'       => 3600,
     
    165151        $sanitized['cache_enabled']   = !empty($input['cache_enabled']);
    166152        $sanitized['cache_ttl']       = absint($input['cache_ttl'] ?? 3600);
    167         $sanitized['content_dir']     = sanitize_text_field($input['content_dir'] ?? '');
    168153       
    169154        // Post types: array of sanitized slugs
     
    337322            <?php settings_errors(); ?>
    338323           
     324            <?php
     325            // Show index rebuild result notice
     326            if (isset($_GET['index_rebuilt'])) {
     327                $success = $_GET['index_rebuilt'] === '1';
     328                $class = $success ? 'notice-success' : 'notice-error';
     329                $msg   = $success ? 'Content index rebuilt successfully.' : 'Index rebuild failed — check file permissions.';
     330                echo '<div class="notice ' . $class . ' is-dismissible"><p>' . esc_html($msg) . '</p></div>';
     331            }
     332            ?>
     333           
    339334            <form method="post" action="options.php">
    340335                <?php
  • praison-file-content-git/tags/1.6.1/src/Loaders/PostLoader.php

    r3490698 r3491371  
    133133       
    134134        if (empty($files)) {
     135            return [];
     136        }
     137       
     138        // SAFETY: refuse to scan large directories without an index.
     139        // Without _index.json, every file is read via file_get_contents().
     140        // For 18K+ files this causes OOM/timeout.
     141        $max_scan = apply_filters('praisonpress_max_scan_files', 500);
     142        if (count($files) > $max_scan) {
     143            if (defined('WP_DEBUG') && WP_DEBUG) {
     144                error_log(sprintf(
     145                    'PraisonPress: Refusing to scan %d files in %s without _index.json (limit: %d). Run "wp praison index" or use the Settings page to rebuild the index.',
     146                    count($files),
     147                    $this->postsDir,
     148                    $max_scan
     149                ));
     150            }
    135151            return [];
    136152        }
     
    407423   
    408424    /**
    409      * Get posts directly (for helper functions)
    410      *
    411      * @param array $args Query arguments
    412      * @return array Array of WP_Post objects
    413      */
    414     /**
    415425     * Load a single post by slug.
    416      * Checks _index.json first for an O(1) file lookup, then falls back to full scan.
     426     * Checks _index.json first for an O(1) file lookup, then falls back to direct file.
    417427     *
    418428     * @param string $slug Post slug
  • praison-file-content-git/trunk/praisonpressgit.php

    r3491360 r3491371  
    33 * Plugin Name: PraisonAI Git Posts
    44 * Description: Load WordPress content from files (Markdown, JSON, YAML) without database writes, with Git-based version control
    5  * Version: 1.6.0
     5 * Version: 1.6.1
    66 * Author: MervinPraison
    77 * Author URI: https://mer.vin
     
    1313
    1414// Define constants
    15 define('PRAISON_VERSION', '1.6.0');
     15define('PRAISON_VERSION', '1.6.1');
    1616define('PRAISON_PLUGIN_DIR', __DIR__);
    1717define('PRAISON_PLUGIN_URL', trailingslashit(plugins_url('', __FILE__)));
  • praison-file-content-git/trunk/readme.txt

    r3489866 r3491371  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 1.1.0
     7Stable tag: 1.6.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    187187== Changelog ==
    188188
    189 = 1.0.0 =
    190 * Initial release
    191 * File-based content management
    192 * Markdown parser with YAML front matter support
    193 * Dynamic custom post type discovery
    194 * Custom URL routing
    195 * Built-in caching system
    196 * Git version control integration
    197 * Admin interface with version history
    198 * Auto-update detection for file changes
    199 * WordPress filter compatibility
     189= 1.6.1 =
     190* CRITICAL FIX: Archive safeguard - refuses to scan >500 files without _index.json, preventing OOM
     191* Added WordPress Settings page admin notice for index rebuild feedback
     192* Removed disconnected content_dir settings field
     193* Fixed duplicate docblock on loadSinglePost
     194
     195= 1.6.0 =
     196* NEW: WordPress Settings page for user-friendly configuration
     197* NEW: Index Status table with "Rebuild Index Now" button
     198* All settings stored in wp_options - no ini files or CLI needed
     199* Auto-generates _index.json on plugin activation
     200
     201= 1.5.0 =
     202* PERFORMANCE: Lazy constructor - zero filesystem I/O at plugin load
     203* PERFORMANCE: loadFromIndex() creates WP_Post from index metadata only
     204* PERFORMANCE: loadSinglePost() direct slug lookup - 1 file read (was: full scan)
     205* NEW: content.enabled safety check - plugin does nothing unless enabled
     206* NEW: Cache stampede protection with wp_cache_add lock
    200207
    201208= 1.0.9 =
  • praison-file-content-git/trunk/src/Admin/SettingsPage.php

    r3491360 r3491371  
    7575        );
    7676       
    77         add_settings_field(
    78             'content_dir',
    79             'Content Directory',
    80             [$this, 'renderTextField'],
    81             'praison-settings',
    82             'praisonpress_content',
    83             [
    84                 'field' => 'content_dir',
    85                 'description' => 'Path to the content directory. Default: <code>' . esc_html(PRAISON_CONTENT_DIR) . '</code>',
    86                 'placeholder' => PRAISON_CONTENT_DIR,
    87             ]
    88         );
    89        
    9077        // ── Section: Performance ──
    9178        add_settings_section(
     
    142129            'content_enabled' => false,
    143130            'post_types'      => ['lyrics', 'chords'],
    144             'content_dir'     => '',
    145131            'cache_enabled'   => true,
    146132            'cache_ttl'       => 3600,
     
    165151        $sanitized['cache_enabled']   = !empty($input['cache_enabled']);
    166152        $sanitized['cache_ttl']       = absint($input['cache_ttl'] ?? 3600);
    167         $sanitized['content_dir']     = sanitize_text_field($input['content_dir'] ?? '');
    168153       
    169154        // Post types: array of sanitized slugs
     
    337322            <?php settings_errors(); ?>
    338323           
     324            <?php
     325            // Show index rebuild result notice
     326            if (isset($_GET['index_rebuilt'])) {
     327                $success = $_GET['index_rebuilt'] === '1';
     328                $class = $success ? 'notice-success' : 'notice-error';
     329                $msg   = $success ? 'Content index rebuilt successfully.' : 'Index rebuild failed — check file permissions.';
     330                echo '<div class="notice ' . $class . ' is-dismissible"><p>' . esc_html($msg) . '</p></div>';
     331            }
     332            ?>
     333           
    339334            <form method="post" action="options.php">
    340335                <?php
  • praison-file-content-git/trunk/src/Loaders/PostLoader.php

    r3490698 r3491371  
    133133       
    134134        if (empty($files)) {
     135            return [];
     136        }
     137       
     138        // SAFETY: refuse to scan large directories without an index.
     139        // Without _index.json, every file is read via file_get_contents().
     140        // For 18K+ files this causes OOM/timeout.
     141        $max_scan = apply_filters('praisonpress_max_scan_files', 500);
     142        if (count($files) > $max_scan) {
     143            if (defined('WP_DEBUG') && WP_DEBUG) {
     144                error_log(sprintf(
     145                    'PraisonPress: Refusing to scan %d files in %s without _index.json (limit: %d). Run "wp praison index" or use the Settings page to rebuild the index.',
     146                    count($files),
     147                    $this->postsDir,
     148                    $max_scan
     149                ));
     150            }
    135151            return [];
    136152        }
     
    407423   
    408424    /**
    409      * Get posts directly (for helper functions)
    410      *
    411      * @param array $args Query arguments
    412      * @return array Array of WP_Post objects
    413      */
    414     /**
    415425     * Load a single post by slug.
    416      * Checks _index.json first for an O(1) file lookup, then falls back to full scan.
     426     * Checks _index.json first for an O(1) file lookup, then falls back to direct file.
    417427     *
    418428     * @param string $slug Post slug
Note: See TracChangeset for help on using the changeset viewer.