Plugin Directory

Changeset 3284403


Ignore:
Timestamp:
04/29/2025 09:28:54 PM (11 months ago)
Author:
aaron13100
Message:
  • FIX: Fix the _load_textdomain_just_in_time was called incorrectly issue again, this time for @apos37.
Location:
404-solution
Files:
18 edited
1 copied

Legend:

Unmodified
Added
Removed
  • 404-solution/tags/2.36.10/404-solution.php

    r3282012 r3284403  
    88    Author URI:  https://www.ajexperience.com/404-solution/
    99
    10     Version: 2.36.9
     10    Version: 2.36.10
    1111
    1212    License: GPL-3.0-or-later
     
    7777}
    7878spl_autoload_register('abj404_autoloader');
     79
     80add_action('doing_it_wrong_run', function($function_name, $message, $version) {
     81    if (strpos($message, '404-solution') !== false &&
     82        $function_name == '_load_textdomain_just_in_time') {
     83       
     84        try {
     85            $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
     86
     87            // Prepare the plugin path from ABJ404_FILE
     88            $pluginPath = trailingslashit(plugin_dir_path(ABJ404_FILE)); // e.g., /var/www/html/wp-content/plugins/404-solution/
     89
     90            $logMessage = '';
     91            $isOurPlugin = false;
     92
     93            foreach ($backtrace as $index => $frame) {
     94                $file = isset($frame['file']) ? $frame['file'] : '[internal function]';
     95                $line = isset($frame['line']) ? $frame['line'] : '';
     96                $func = isset($frame['function']) ? $frame['function'] : '[unknown function]';
     97
     98                if (!$isOurPlugin && is_string($file) && strpos($file, $pluginPath) !== false) {
     99                    $isOurPlugin = true;
     100                }
     101
     102                $logMessage .= "#$index $func at [$file:$line]\n";
     103            }
     104
     105            if ($isOurPlugin) {
     106                $header = "=== Detected Early Translation ===\n" .
     107                    "Function: $function_name\n" .
     108                    "Message: $message\n" .
     109                    "Version: $version\n";
     110 
     111                if (!isset($GLOBALS['abj404_pending_errors'])) {
     112                    $GLOBALS['abj404_pending_errors'] = [];
     113                }
     114                $GLOBALS['abj404_pending_errors'][] = $header . $logMessage;
     115            }
     116
     117        } catch (Throwable $e) {
     118            // error_log('Failed to log early translation stack trace: ' . $e->getMessage());
     119        }
     120    }
     121}, 10, 3);
    79122
    80123// shortcode
  • 404-solution/tags/2.36.10/CHANGELOG.md

    r3282012 r3284403  
    11# Changelog #
     2
     3## Version 2.36.10 (April 29, 2025) ##
     4* FIX: Fix the '_load_textdomain_just_in_time was called incorrectly' issue again, this time for @apos37.
    25
    36## Version 2.36.9 (April 25, 2025) ##
  • 404-solution/tags/2.36.10/README.md

    r3282012 r3284403  
    8989## Changelog ##
    9090
     91## Version 2.36.10 (April 29, 2025) ##
     92* FIX: Fix the '_load_textdomain_just_in_time was called incorrectly' issue again, this time for @apos37.
     93
    9194## Version 2.36.9 (April 25, 2025) ##
    9295* FIX: Avoid throwing an error when releasing a synchronization lock not owned by the current process, for leehodson.
  • 404-solution/tags/2.36.10/includes/Loader.php

    r3282012 r3284403  
    44define( 'ABJ404_AUTHOR_EMAIL', '404solution@ajexperience.com' );
    55/* plugin_dir_url( __FILE__ ) */
    6 define( 'ABJ404_URL', plugin_dir_url(ABJ404_FILE));
     6define( 'ABJ404_URL', plugin_dir_url(ABJ404_FILE)); // https://site-url/wp-content/plugins/404-solution/
    77
    88/** plugin_dir_path( __FILE__ ) */
    9 define( 'ABJ404_NAME', plugin_basename(ABJ404_FILE));
     9define( 'ABJ404_NAME', plugin_basename(ABJ404_FILE)); // wp-content/plugins/404-solution/404-solution.php
    1010define('ABJ404_SOLUTION_BASENAME', function_exists('plugin_basename') ? plugin_basename(ABJ404_FILE) :
    1111    basename(dirname(ABJ404_FILE)) . '/' . basename(ABJ404_FILE));
    1212
    13 define( 'ABJ404_VERSION', '2.36.9' );
     13define( 'ABJ404_VERSION', '2.36.10' );
    1414define( 'URL_TRACKING_SUFFIX', '?utm_source=404SolutionPlugin&utm_medium=WordPress');
    1515define( 'ABJ404_HOME_URL', 'https://www.ajexperience.com/404-solution/' . URL_TRACKING_SUFFIX);
  • 404-solution/tags/2.36.10/includes/Logging.php

    r2978904 r3284403  
    1919        if (self::$instance == null) {
    2020            self::$instance = new ABJ_404_Solution_Logging();
    21         }
    22        
     21
     22            // log any errors that were stored before the logger existed.
     23            if (isset($GLOBALS['abj404_pending_errors']) && is_array($GLOBALS['abj404_pending_errors'])) {
     24                foreach ($GLOBALS['abj404_pending_errors'] as $message) {
     25                    self::$instance->errorMessage($message);
     26                }
     27                unset($GLOBALS['abj404_pending_errors']); // Clear after flushing
     28            }
     29        }
     30
    2331        return self::$instance;
    2432    }
  • 404-solution/tags/2.36.10/includes/PluginLogic.php

    r3281548 r3284403  
    614614            'suggest_minscore' => '25',
    615615            'suggest_max' => '5',
    616             'suggest_title' => '<h3>' . __('Here are some other great pages', '404-solution') . '</h3>',
     616            'suggest_title' => '<h3>{suggest_title_text}</h3>',
    617617            'suggest_before' => '<ol>',
    618618            'suggest_after' => '</ol>',
    619619            'suggest_entrybefore' => '<li>',
    620620            'suggest_entryafter' => '</li>',
    621             'suggest_noresults' => '<p>' . __('No suggestions. :/ ', '404-solution') . '</p>',
     621            'suggest_noresults' => '<p>{suggest_noresults_text}</p>',
    622622            'suggest_cats' => '1',
    623623            'suggest_tags' => '1',
  • 404-solution/tags/2.36.10/includes/ShortCode.php

    r3273795 r3284403  
    197197        // allow some HTML.
    198198        $content .= '<div class="suggest-404s">' . "\n";
    199         $content .= wp_kses_post($options['suggest_title']) . "\n";
     199        $content .= wp_kses_post(
     200            str_replace('{suggest_title_text}', __('Here are some other great pages', '404-solution'),
     201                $options['suggest_title'] )) . "\n";
    200202       
    201203        $currentSlug = $abj404logic->removeHomeDirectory(
     
    273275           
    274276        } else {
    275             $content .= wp_kses_post($options['suggest_noresults']);
     277            $content .= wp_kses_post(
     278                str_replace('{suggest_noresults_text}', __('No suggestions. :/ ', '404-solution'),
     279                    $options['suggest_noresults'] ));           
    276280        }
    277281
  • 404-solution/tags/2.36.10/package.json

    r3282012 r3284403  
    11{
    22  "name": "404-solution",
    3   "version": "2.36.9",
     3  "version": "2.36.10",
    44  "description": "The 404 Solution Plugin.",
    55  "main": "Gulpfile.js",
  • 404-solution/tags/2.36.10/readme.txt

    r3282012 r3284403  
    55Requires at least: 3.9
    66Tested up to: 6.8
    7 Stable tag: 2.36.9
     7Stable tag: 2.36.10
    88License: GPL-3.0-or-later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    9191== Changelog ==
    9292
     93= Version 2.36.10 (April 29, 2025) =
     94* FIX: Fix the '_load_textdomain_just_in_time was called incorrectly' issue again, this time for @apos37.
     95
    9396= Version 2.36.9 (April 25, 2025) =
    9497* FIX: Avoid throwing an error when releasing a synchronization lock not owned by the current process, for leehodson.
  • 404-solution/trunk/404-solution.php

    r3282012 r3284403  
    88    Author URI:  https://www.ajexperience.com/404-solution/
    99
    10     Version: 2.36.9
     10    Version: 2.36.10
    1111
    1212    License: GPL-3.0-or-later
     
    7777}
    7878spl_autoload_register('abj404_autoloader');
     79
     80add_action('doing_it_wrong_run', function($function_name, $message, $version) {
     81    if (strpos($message, '404-solution') !== false &&
     82        $function_name == '_load_textdomain_just_in_time') {
     83       
     84        try {
     85            $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
     86
     87            // Prepare the plugin path from ABJ404_FILE
     88            $pluginPath = trailingslashit(plugin_dir_path(ABJ404_FILE)); // e.g., /var/www/html/wp-content/plugins/404-solution/
     89
     90            $logMessage = '';
     91            $isOurPlugin = false;
     92
     93            foreach ($backtrace as $index => $frame) {
     94                $file = isset($frame['file']) ? $frame['file'] : '[internal function]';
     95                $line = isset($frame['line']) ? $frame['line'] : '';
     96                $func = isset($frame['function']) ? $frame['function'] : '[unknown function]';
     97
     98                if (!$isOurPlugin && is_string($file) && strpos($file, $pluginPath) !== false) {
     99                    $isOurPlugin = true;
     100                }
     101
     102                $logMessage .= "#$index $func at [$file:$line]\n";
     103            }
     104
     105            if ($isOurPlugin) {
     106                $header = "=== Detected Early Translation ===\n" .
     107                    "Function: $function_name\n" .
     108                    "Message: $message\n" .
     109                    "Version: $version\n";
     110 
     111                if (!isset($GLOBALS['abj404_pending_errors'])) {
     112                    $GLOBALS['abj404_pending_errors'] = [];
     113                }
     114                $GLOBALS['abj404_pending_errors'][] = $header . $logMessage;
     115            }
     116
     117        } catch (Throwable $e) {
     118            // error_log('Failed to log early translation stack trace: ' . $e->getMessage());
     119        }
     120    }
     121}, 10, 3);
    79122
    80123// shortcode
  • 404-solution/trunk/CHANGELOG.md

    r3282012 r3284403  
    11# Changelog #
     2
     3## Version 2.36.10 (April 29, 2025) ##
     4* FIX: Fix the '_load_textdomain_just_in_time was called incorrectly' issue again, this time for @apos37.
    25
    36## Version 2.36.9 (April 25, 2025) ##
  • 404-solution/trunk/README.md

    r3282012 r3284403  
    8989## Changelog ##
    9090
     91## Version 2.36.10 (April 29, 2025) ##
     92* FIX: Fix the '_load_textdomain_just_in_time was called incorrectly' issue again, this time for @apos37.
     93
    9194## Version 2.36.9 (April 25, 2025) ##
    9295* FIX: Avoid throwing an error when releasing a synchronization lock not owned by the current process, for leehodson.
  • 404-solution/trunk/includes/Loader.php

    r3282012 r3284403  
    44define( 'ABJ404_AUTHOR_EMAIL', '404solution@ajexperience.com' );
    55/* plugin_dir_url( __FILE__ ) */
    6 define( 'ABJ404_URL', plugin_dir_url(ABJ404_FILE));
     6define( 'ABJ404_URL', plugin_dir_url(ABJ404_FILE)); // https://site-url/wp-content/plugins/404-solution/
    77
    88/** plugin_dir_path( __FILE__ ) */
    9 define( 'ABJ404_NAME', plugin_basename(ABJ404_FILE));
     9define( 'ABJ404_NAME', plugin_basename(ABJ404_FILE)); // wp-content/plugins/404-solution/404-solution.php
    1010define('ABJ404_SOLUTION_BASENAME', function_exists('plugin_basename') ? plugin_basename(ABJ404_FILE) :
    1111    basename(dirname(ABJ404_FILE)) . '/' . basename(ABJ404_FILE));
    1212
    13 define( 'ABJ404_VERSION', '2.36.9' );
     13define( 'ABJ404_VERSION', '2.36.10' );
    1414define( 'URL_TRACKING_SUFFIX', '?utm_source=404SolutionPlugin&utm_medium=WordPress');
    1515define( 'ABJ404_HOME_URL', 'https://www.ajexperience.com/404-solution/' . URL_TRACKING_SUFFIX);
  • 404-solution/trunk/includes/Logging.php

    r2978904 r3284403  
    1919        if (self::$instance == null) {
    2020            self::$instance = new ABJ_404_Solution_Logging();
    21         }
    22        
     21
     22            // log any errors that were stored before the logger existed.
     23            if (isset($GLOBALS['abj404_pending_errors']) && is_array($GLOBALS['abj404_pending_errors'])) {
     24                foreach ($GLOBALS['abj404_pending_errors'] as $message) {
     25                    self::$instance->errorMessage($message);
     26                }
     27                unset($GLOBALS['abj404_pending_errors']); // Clear after flushing
     28            }
     29        }
     30
    2331        return self::$instance;
    2432    }
  • 404-solution/trunk/includes/PluginLogic.php

    r3281548 r3284403  
    614614            'suggest_minscore' => '25',
    615615            'suggest_max' => '5',
    616             'suggest_title' => '<h3>' . __('Here are some other great pages', '404-solution') . '</h3>',
     616            'suggest_title' => '<h3>{suggest_title_text}</h3>',
    617617            'suggest_before' => '<ol>',
    618618            'suggest_after' => '</ol>',
    619619            'suggest_entrybefore' => '<li>',
    620620            'suggest_entryafter' => '</li>',
    621             'suggest_noresults' => '<p>' . __('No suggestions. :/ ', '404-solution') . '</p>',
     621            'suggest_noresults' => '<p>{suggest_noresults_text}</p>',
    622622            'suggest_cats' => '1',
    623623            'suggest_tags' => '1',
  • 404-solution/trunk/includes/ShortCode.php

    r3273795 r3284403  
    197197        // allow some HTML.
    198198        $content .= '<div class="suggest-404s">' . "\n";
    199         $content .= wp_kses_post($options['suggest_title']) . "\n";
     199        $content .= wp_kses_post(
     200            str_replace('{suggest_title_text}', __('Here are some other great pages', '404-solution'),
     201                $options['suggest_title'] )) . "\n";
    200202       
    201203        $currentSlug = $abj404logic->removeHomeDirectory(
     
    273275           
    274276        } else {
    275             $content .= wp_kses_post($options['suggest_noresults']);
     277            $content .= wp_kses_post(
     278                str_replace('{suggest_noresults_text}', __('No suggestions. :/ ', '404-solution'),
     279                    $options['suggest_noresults'] ));           
    276280        }
    277281
  • 404-solution/trunk/package.json

    r3282012 r3284403  
    11{
    22  "name": "404-solution",
    3   "version": "2.36.9",
     3  "version": "2.36.10",
    44  "description": "The 404 Solution Plugin.",
    55  "main": "Gulpfile.js",
  • 404-solution/trunk/readme.txt

    r3282012 r3284403  
    55Requires at least: 3.9
    66Tested up to: 6.8
    7 Stable tag: 2.36.9
     7Stable tag: 2.36.10
    88License: GPL-3.0-or-later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    9191== Changelog ==
    9292
     93= Version 2.36.10 (April 29, 2025) =
     94* FIX: Fix the '_load_textdomain_just_in_time was called incorrectly' issue again, this time for @apos37.
     95
    9396= Version 2.36.9 (April 25, 2025) =
    9497* FIX: Avoid throwing an error when releasing a synchronization lock not owned by the current process, for leehodson.
Note: See TracChangeset for help on using the changeset viewer.