Plugin Directory

Changeset 3441225


Ignore:
Timestamp:
01/16/2026 07:28:09 PM (2 months ago)
Author:
codesnippetspro
Message:

Version v3.9.4

Location:
code-snippets/trunk
Files:
55 added
15 edited

Legend:

Unmodified
Added
Removed
  • code-snippets/trunk/CHANGELOG.md

    r3409719 r3441225  
    11# Changelog
    22
     3## [3.9.4] (2026-01-14)
     4
     5### Added
     6* New import functionality to migrate snippets from file uploads with drag-and-drop interface
     7* Support for importing snippets from other popular plugins (Header Footer Code Manager, Insert Headers and Footers, Insert PHP Code Snippet)
     8* Enhanced file based execution support with improved multisite mode compatibility
     9
     10### Changed
     11* Updated links to more recent documentation pages
     12
     13### Fixed
     14* Fixed multisite capability checks in Plugin class
     15* Fixed snippet execution logic for multisite support by centralizing trashed snippet handling
     16* Fixed multisite snippet handling to ensure local snippets use correct table and filter out trashed snippets
    317
    418## [3.9.3] (2025-12-03)
     
    379393### Added
    380394* Added additional editor shortcuts to list in tooltip.
    381 * Filter for changing Snippets admin menu position. [See this help article for more information.](https://help.codesnippets.pro/article/61-how-can-i-change-the-location-of-the-snippets-admin-menu)
     395* Filter for changing Snippets admin menu position. [See this help article for more information.](https://codesnippets.pro/doc/snippets-menu-location/)
    382396* Ability to filter shortcode output. Thanks to contributions from [Jack Szwergold](https://github.com/JackSzwergold).
    383397
  • code-snippets/trunk/code-snippets.php

    r3409719 r3441225  
    99 * License URI:  license.txt
    1010 * Text Domain:  code-snippets
    11  * Version:      3.9.3
     11 * Version:      3.9.4
    1212 * Requires PHP: 7.4
    1313 * Requires at least: 5.0
    1414 *
    15  * @version   3.9.3
     15 * @version   3.9.4
    1616 * @package   Code_Snippets
    1717 * @author    Shea Bunge <[email protected]>
     
    3838     * @const string
    3939     */
    40     define( 'CODE_SNIPPETS_VERSION', '3.9.3' );
     40    define( 'CODE_SNIPPETS_VERSION', '3.9.4' );
    4141
    4242    /**
  • code-snippets/trunk/php/admin-menus/class-import-menu.php

    r3352486 r3441225  
    3939        $contextual_help = new Contextual_Help( 'import' );
    4040        $contextual_help->load();
    41 
    42         $this->process_import_files();
    43     }
    44 
    45     /**
    46      * Process the uploaded import files
    47      */
    48     private function process_import_files() {
    49 
    50         // Ensure the import file exists.
    51         if ( ! isset(
    52             $_FILES['code_snippets_import_files']['name'],
    53             $_FILES['code_snippets_import_files']['type'],
    54             $_FILES['code_snippets_import_files']['tmp_name']
    55         ) ) {
    56             return;
    57         }
    58 
    59         check_admin_referer( 'import_code_snippets_file' );
    60 
    61         // phpcs:disable WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    62         $upload_files = $_FILES['code_snippets_import_files']['tmp_name'];
    63         // phpcs:disable WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    64         $upload_filenames = $_FILES['code_snippets_import_files']['name'];
    65         $upload_mime_types = array_map( 'sanitize_mime_type', wp_unslash( $_FILES['code_snippets_import_files']['type'] ) );
    66 
    67         $count = 0;
    68         $network = is_network_admin();
    69         $error = false;
    70         $dup_action = isset( $_POST['duplicate_action'] ) ? sanitize_key( $_POST['duplicate_action'] ) : 'ignore';
    71 
    72         // Loop through the uploaded files and import the snippets.
    73         foreach ( $upload_files as $i => $import_file ) {
    74             $filename_info = pathinfo( $upload_filenames[ $i ] );
    75             $ext = $filename_info['extension'];
    76             $mime_type = $upload_mime_types[ $i ];
    77 
    78             $import = new Import( $import_file, $network, $dup_action );
    79 
    80             if ( 'json' === $ext || 'application/json' === $mime_type ) {
    81                 $result = $import->import_json();
    82             } elseif ( 'xml' === $ext || 'text/xml' === $mime_type ) {
    83                 $result = $import->import_xml();
    84             } else {
    85                 $result = false;
    86             }
    87 
    88             if ( false === $result ) {
    89                 $error = true;
    90             } else {
    91                 $count += count( $result );
    92             }
    93         }
    94 
    95         // Send the amount of imported snippets to the page.
    96         $url = add_query_arg( $error ? array( 'error' => true ) : array( 'imported' => $count ) );
    97         wp_safe_redirect( esc_url_raw( $url ) );
    98         exit;
    9941    }
    10042
     
    11961
    12062    /**
    121      * Print the status and error messages
    122      */
    123     protected function print_messages() {
    124 
    125         if ( ! empty( $_REQUEST['error'] ) ) {
    126             echo '<div id="message" class="error fade"><p>';
    127             esc_html_e( 'An error occurred when processing the import files.', 'code-snippets' );
    128             echo '</p></div>';
    129         }
    130 
    131         if ( isset( $_REQUEST['imported'] ) ) {
    132             echo '<div id="message" class="updated fade"><p>';
    133 
    134             $imported = intval( $_REQUEST['imported'] );
    135 
    136             if ( 0 === $imported ) {
    137                 esc_html_e( 'No snippets were imported.', 'code-snippets' );
    138 
    139             } else {
    140                 /* translators: %d: amount of snippets imported */
    141                 printf(
    142                     _n(
    143                         'Successfully imported %d snippet.',
    144                         'Successfully imported %d snippets.',
    145                         $imported,
    146                         'code-snippets'
    147                     ),
    148                     '<strong>' . number_format_i18n( $imported ) . '</strong>',
    149                 );
    150 
    151                 printf(
    152                     ' <a href="%s">%s</a>',
    153                     esc_url( code_snippets()->get_menu_url( 'manage' ) ),
    154                     esc_html__( 'Have fun!', 'code-snippets' )
    155                 );
    156             }
    157 
    158             echo '</p></div>';
    159         }
    160     }
    161 
    162     /**
    163      * Empty implementation for enqueue_assets.
     63     * Enqueue assets for the import menu.
    16464     *
    16565     * @return void
    16666     */
    16767    public function enqueue_assets() {
    168         // none required.
     68        $plugin = code_snippets();
     69
     70        wp_enqueue_script(
     71            'code-snippets-import',
     72            plugins_url( 'dist/import.js', $plugin->file ),
     73            [
     74                'react',
     75                'react-dom',
     76                'wp-i18n',
     77                'wp-components',
     78            ],
     79            $plugin->version,
     80            true
     81        );
     82
     83        $plugin->localize_script( 'code-snippets-import' );
    16984    }
    17085}
  • code-snippets/trunk/php/admin-menus/class-welcome-menu.php

    r3352486 r3441225  
    6060            ],
    6161            'resources' => [
    62                 'url'   => 'https://help.codesnippets.pro/',
     62                'url'   => 'https://codesnippets.pro/support/',
    6363                'icon'  => 'sos',
    6464                'label' => __( 'Support', 'code-snippets' ),
  • code-snippets/trunk/php/class-admin.php

    r3392896 r3441225  
    180180                sprintf(
    181181                    $format,
    182                     'https://help.codesnippets.pro/',
     182                    'https://codesnippets.pro/support/',
    183183                    esc_attr__( 'Find out how to get support with Code Snippets', 'code-snippets' ),
    184184                    esc_html__( 'Docs and Support', 'code-snippets' )
  • code-snippets/trunk/php/class-contextual-help.php

    r3352486 r3441225  
    6868        $sidebar_links = [
    6969            'https://wordpress.org/plugins/code-snippets'        => __( 'About Plugin', 'code-snippets' ),
    70             'https://help.codesnippets.pro/collection/3-faq'     => __( 'FAQ', 'code-snippets' ),
     70            'https://codesnippets.pro/docs/faq/'                 => __( 'FAQ', 'code-snippets' ),
    7171            'https://wordpress.org/support/plugin/code-snippets' => __( 'Support Forum', 'code-snippets' ),
    7272            'https://codesnippets.pro'                           => __( 'Plugin Website', 'code-snippets' ),
     
    7474
    7575        $kses = [
    76             'p' => [],
     76            'p'      => [],
    7777            'strong' => [],
    78             'a' => [ 'href' => [] ],
     78            'a'      => [ 'href' => [] ],
    7979        ];
    8080
     
    144144                __( "If something goes wrong with a snippet, and you can't use WordPress, you can cause all snippets to stop executing by turning on <strong>safe mode</strong>.", 'code-snippets' ),
    145145                /* translators: %s: URL to Code Snippets Pro Docs */
    146                 sprintf( __( 'You can find out how to enable safe mode in the <a href="%s">Code Snippets Pro Docs</a>.', 'code-snippets' ), 'https://help.codesnippets.pro/article/12-safe-mode' )
     146                sprintf( __( 'You can find out how to enable safe mode in the <a href="%s">Code Snippets Pro Docs</a>.', 'code-snippets' ), 'https://codesnippets.pro/doc/safe-mode/' ),
    147147            ]
    148148        );
     
    160160                __( 'Here you can add a new snippet, or edit an existing one.', 'code-snippets' ),
    161161                /* translators: %s: URL to Code Snippets Pro Docs */
    162                 sprintf( __( "If you're not sure about the types of snippets you can add, take a look at the <a href=\"%s\">Code Snippets Pro Docs</a> for inspiration.", 'code-snippets' ), 'https://help.codesnippets.pro/collection/2-adding-snippets' ),
     162                sprintf( __( "If you're not sure about the types of snippets you can add, take a look at the <a href=\"%s\">Code Snippets Pro Docs</a> for inspiration.", 'code-snippets' ), 'https://codesnippets.pro/docs/adding-snippets/' ),
    163163            ]
    164164        );
  • code-snippets/trunk/php/class-db.php

    r3352486 r3441225  
    198198    }
    199199
    200     /**
    201      * Fetch a list of active snippets from a database table.
    202      *
    203      * @param string        $table_name  Name of table to fetch snippets from.
    204      * @param array<string> $scopes      List of scopes to include in query.
    205      * @param boolean       $active_only Whether to only fetch active snippets from the table.
    206      *
    207      * @return array<string, array<string, mixed>>|false List of active snippets, if any could be retrieved.
    208      *
    209      * @phpcs:disable WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare
    210      */
    211     private static function fetch_snippets_from_table( string $table_name, array $scopes, bool $active_only = true ) {
    212         global $wpdb;
    213 
    214         $cache_key = sprintf( 'active_snippets_%s_%s', sanitize_key( join( '_', $scopes ) ), $table_name );
    215         $cached_snippets = wp_cache_get( $cache_key, CACHE_GROUP );
    216 
    217         if ( is_array( $cached_snippets ) ) {
    218             return $cached_snippets;
    219         }
    220 
    221         if ( ! self::table_exists( $table_name ) ) {
     200        /**
     201         * Generate the SQL for fetching active snippets from the database.
     202         *
     203         * @param string[] $scopes List of scopes to retrieve in.
     204         *
     205         * @return array{
     206         *     id: int,
     207         *     code: string,
     208         *     scope: string,
     209         *     table: string,
     210         *     network: bool,
     211         *     priority: int,
     212         * } List of active snippets.
     213         */
     214    public function fetch_active_snippets( array $scopes ): array {
     215        $active_snippets = [];
     216
     217        // Fetch the active snippets for the current site, if there are any.
     218        $snippets = $this->fetch_snippets_from_table( $this->table, $scopes, true );
     219        if ( $snippets ) {
     220            foreach ( $snippets as $snippet ) {
     221                $active_snippets[] = [
     222                    'id'       => intval( $snippet['id'] ),
     223                    'code'     => $snippet['code'],
     224                    'scope'    => $snippet['scope'],
     225                    'table'    => $this->table,
     226                    'network'  => false,
     227                    'priority' => intval( $snippet['priority'] ),
     228                ];
     229            }
     230        }
     231
     232        // If multisite is enabled, fetch all snippets from the network table, and filter down to only active snippets.
     233        if ( is_multisite() ) {
     234            $ms_snippets = $this->fetch_snippets_from_table( $this->ms_table, $scopes, false );
     235
     236            if ( $ms_snippets ) {
     237                $active_shared_ids = get_option( 'active_shared_network_snippets', [] );
     238                $active_shared_ids = is_array( $active_shared_ids )
     239                    ? array_map( 'intval', $active_shared_ids )
     240                    : [];
     241
     242                foreach ( $ms_snippets as $snippet ) {
     243                    $id = intval( $snippet['id'] );
     244                    $active_value = intval( $snippet['active'] );
     245
     246                    if ( ! self::is_network_snippet_enabled( $active_value, $id, $active_shared_ids ) ) {
     247                        continue;
     248                    }
     249
     250                    $active_snippets[] = [
     251                        'id'       => $id,
     252                        'code'     => $snippet['code'],
     253                        'scope'    => $snippet['scope'],
     254                        'table'    => $this->ms_table,
     255                        'network'  => true,
     256                        'priority' => intval( $snippet['priority'] ),
     257                    ];
     258                }
     259
     260                $this->sort_active_snippets( $active_snippets );
     261            }
     262        }
     263
     264        return $active_snippets;
     265    }
     266
     267    /**
     268     * Determine whether a network snippet should execute on the current site.
     269     *
     270     * Network snippets execute when active=1, or when the snippet is listed as active-shared for the site.
     271     * Trashed snippets (active=-1) should never execute.
     272     *
     273     * @param int   $active_value      Raw active value: 1=active, 0=inactive, -1=trashed (can be stored as a string in the database).
     274     * @param int   $snippet_id        Snippet ID.
     275     * @param int[] $active_shared_ids Active shared network snippet IDs for the current site.
     276     *
     277     * @return bool
     278     */
     279    public static function is_network_snippet_enabled( int $active_value, int $snippet_id, array $active_shared_ids ): bool {
     280        if ( -1 === $active_value ) {
    222281            return false;
    223282        }
    224283
    225         $scopes_format = implode( ',', array_fill( 0, count( $scopes ), '%s' ) );
    226         $extra_where = $active_only ? 'AND active=1' : '';
    227 
    228         $snippets = $wpdb->get_results(
    229             $wpdb->prepare(
    230                 "
    231                 SELECT id, code, scope, active, priority
    232                 FROM $table_name
    233                 WHERE scope IN ($scopes_format) $extra_where
    234                 ORDER BY priority, id",
    235                 $scopes
    236             ),
    237             'ARRAY_A'
    238         );
    239 
    240         // Cache the full list of snippets.
    241         if ( is_array( $snippets ) ) {
    242             wp_cache_set( $cache_key, $snippets, CACHE_GROUP );
    243             return $snippets;
    244         }
    245 
    246         return false;
     284        if ( 1 === $active_value ) {
     285            return true;
     286        }
     287
     288        return in_array( $snippet_id, $active_shared_ids, true );
    247289    }
    248290
     
    283325
    284326    /**
    285      * Generate the SQL for fetching active snippets from the database.
    286      *
    287      * @param string[] $scopes List of scopes to retrieve in.
    288      *
    289      * @return array{
    290      *     id: int,
    291      *     code: string,
    292      *     scope: string,
    293      *     table: string,
    294      *     network: bool,
    295      *     priority: int,
    296      * } List of active snippets.
    297      */
    298     public function fetch_active_snippets( array $scopes ): array {
    299         $active_snippets = [];
    300 
    301         // Fetch the active snippets for the current site, if there are any.
    302         $snippets = $this->fetch_snippets_from_table( $this->table, $scopes, true );
    303         if ( $snippets ) {
    304             foreach ( $snippets as $snippet ) {
    305                 $active_snippets[] = [
    306                     'id'       => intval( $snippet['id'] ),
    307                     'code'     => $snippet['code'],
    308                     'scope'    => $snippet['scope'],
    309                     'table'    => $this->table,
    310                     'network'  => false,
    311                     'priority' => intval( $snippet['priority'] ),
    312                 ];
    313             }
    314         }
    315 
    316         // If multisite is enabled, fetch all snippets from the network table, and filter down to only active snippets.
    317         if ( is_multisite() ) {
    318             $ms_snippets = $this->fetch_snippets_from_table( $this->ms_table, $scopes, false );
    319 
    320             if ( $ms_snippets ) {
    321                 $active_shared_ids = get_option( 'active_shared_network_snippets', [] );
    322                 $active_shared_ids = is_array( $active_shared_ids )
    323                     ? array_map( 'intval', $active_shared_ids )
    324                     : [];
    325 
    326                 foreach ( $ms_snippets as $snippet ) {
    327                     $id = intval( $snippet['id'] );
    328 
    329                     if ( ! $snippet['active'] && ! in_array( $id, $active_shared_ids, true ) ) {
    330                         continue;
    331                     }
    332 
    333                     $active_snippets[] = [
    334                         'id'       => $id,
    335                         'code'     => $snippet['code'],
    336                         'scope'    => $snippet['scope'],
    337                         'table'    => $this->ms_table,
    338                         'network'  => true,
    339                         'priority' => intval( $snippet['priority'] ),
    340                     ];
    341                 }
    342 
    343                 $this->sort_active_snippets( $active_snippets );
    344             }
    345         }
    346 
    347         return $active_snippets;
     327     * Fetch a list of active snippets from a database table.
     328     *
     329     * @param string        $table_name  Name of table to fetch snippets from.
     330     * @param array<string> $scopes      List of scopes to include in query.
     331     * @param boolean       $active_only Whether to only fetch active snippets from the table.
     332     *
     333     * @return array<string, array<string, mixed>>|false List of active snippets, if any could be retrieved.
     334     *
     335     * @phpcs:disable WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare
     336     */
     337    private static function fetch_snippets_from_table( string $table_name, array $scopes, bool $active_only = true ) {
     338        global $wpdb;
     339
     340        $cache_key = sprintf( 'active_snippets_%s_%s', sanitize_key( join( '_', $scopes ) ), $table_name );
     341        $cached_snippets = wp_cache_get( $cache_key, CACHE_GROUP );
     342
     343        if ( is_array( $cached_snippets ) ) {
     344            return $cached_snippets;
     345        }
     346
     347        if ( ! self::table_exists( $table_name ) ) {
     348            return false;
     349        }
     350
     351        $scopes_format = implode( ',', array_fill( 0, count( $scopes ), '%s' ) );
     352        $extra_where = $active_only ? 'AND active=1' : '';
     353
     354        $snippets = $wpdb->get_results(
     355            $wpdb->prepare(
     356                "
     357                SELECT id, code, scope, active, priority
     358                FROM $table_name
     359                WHERE scope IN ($scopes_format) $extra_where
     360                ORDER BY priority, id",
     361                $scopes
     362            ),
     363            'ARRAY_A'
     364        );
     365
     366        // Cache the full list of snippets.
     367        if ( is_array( $snippets ) ) {
     368            wp_cache_set( $cache_key, $snippets, CACHE_GROUP );
     369            return $snippets;
     370        }
     371
     372        return false;
    348373    }
    349374}
  • code-snippets/trunk/php/class-plugin.php

    r3392896 r3441225  
    133133        require_once $includes_path . '/settings/settings-fields.php';
    134134        require_once $includes_path . '/settings/editor-preview.php';
    135     require_once $includes_path . '/settings/class-version-switch.php';
     135        require_once $includes_path . '/settings/class-version-switch.php';
    136136        require_once $includes_path . '/settings/settings.php';
    137137
     
    157157        add_action( 'plugins_loaded', array( $upgrade, 'run' ), 0 );
    158158        $this->licensing = new Licensing();
     159
     160        // Importers.
     161        new Plugins_Import_Manager();
     162        new Files_Import_Manager();
    159163    }
    160164
     
    355359    public function get_cap(): string {
    356360        if ( is_multisite() && $this->is_network_context() ) {
     361            return $this->get_network_cap_name();
     362        }
     363
     364        if ( is_multisite() && ! $this->is_subsite_menu_enabled() ) {
    357365            return $this->get_network_cap_name();
    358366        }
  • code-snippets/trunk/php/flat-files/classes/class-snippet-files.php

    r3388874 r3441225  
    33namespace Code_Snippets;
    44
     5/**
     6 * Manage file-based snippet execution.
     7 *
     8 * Responsible for writing snippet code to disk, maintaining per-table config indexes,
     9 * and retrieving the active snippet list from those config files.
     10 */
    511class Snippet_Files {
    612
     
    1016    private const ENABLED_FLAG_FILE = 'flat-files-enabled.flag';
    1117
     18    /**
     19     * Snippet handler registry.
     20     *
     21     * @var Snippet_Handler_Registry
     22     */
    1223    private Snippet_Handler_Registry $handler_registry;
    1324
     25    /**
     26     * File system adapter.
     27     *
     28     * @var File_System_Interface
     29     */
    1430    private File_System_Interface $fs;
    1531
     32    /**
     33     * Config repository.
     34     *
     35     * @var Snippet_Config_Repository_Interface
     36     */
    1637    private Snippet_Config_Repository_Interface $config_repo;
    1738
     39    /**
     40     * Constructor.
     41     *
     42     * @param Snippet_Handler_Registry            $handler_registry Handler registry instance.
     43     * @param File_System_Interface               $fs               File system adapter.
     44     * @param Snippet_Config_Repository_Interface $config_repo      Config repository instance.
     45     */
    1846    public function __construct(
    1947        Snippet_Handler_Registry $handler_registry,
     
    3765    }
    3866
     67    /**
     68     * Get the full path to the flat-file enabled flag.
     69     *
     70     * @return string
     71     */
    3972    private static function get_flag_file_path(): string {
    4073        return self::get_base_dir() . '/' . self::ENABLED_FLAG_FILE;
    4174    }
    4275
     76    /**
     77     * Create or delete the enabled flag file.
     78     *
     79     * @param bool $enabled Whether file-based execution is enabled.
     80     *
     81     * @return void
     82     */
    4383    private function handle_enabled_file_flag( bool $enabled ): void {
    4484        $flag_file_path = self::get_flag_file_path();
     
    5494    }
    5595
     96    /**
     97     * Register WordPress hooks used by file-based execution.
     98     *
     99     * @return void
     100     */
    56101    public function register_hooks(): void {
    57102        if ( ! $this->fs->is_writable( WP_CONTENT_DIR ) ) {
     
    73118
    74119        add_filter( 'code_snippets_settings_fields', [ $this, 'add_settings_fields' ], 10, 1 );
    75         add_action( 'code_snippets/settings_updated', [ $this, 'create_all_flat_files' ], 10, 2 );
    76     }
    77 
     120        add_action( 'code_snippets/settings_updated', [ $this, 'create_all_flat_files' ], 10, 1 );
     121    }
     122
     123    /**
     124     * Activate multiple snippets and regenerate their flat files.
     125     *
     126     * @param Snippet[] $valid_snippets Snippets to activate.
     127     * @param string    $table         Table name.
     128     *
     129     * @return void
     130     */
    78131    public function activate_snippets( $valid_snippets, $table ): void {
    79132        foreach ( $valid_snippets as $snippet ) {
     
    83136    }
    84137
     138    /**
     139     * Write a snippet file and update its config index entry.
     140     *
     141     * @param Snippet $snippet Snippet object.
     142     * @param string  $table   Table name.
     143     *
     144     * @return void
     145     */
    85146    public function handle_snippet( Snippet $snippet, string $table ): void {
    86147        if ( 0 === $snippet->id ) {
     
    107168    }
    108169
     170    /**
     171     * Delete a snippet file and remove it from the config index.
     172     *
     173     * @param Snippet $snippet  Snippet object.
     174     * @param bool    $network  Whether the snippet is network-wide.
     175     *
     176     * @return void
     177     */
    109178    public function delete_snippet( Snippet $snippet, bool $network ): void {
    110179        $handler = $this->handler_registry->get_handler( $snippet->type );
     
    123192    }
    124193
     194    /**
     195     * Activate a snippet by writing its code file and updating config.
     196     *
     197     * @param Snippet $snippet Snippet object.
     198     *
     199     * @return void
     200     */
    125201    public function activate_snippet( Snippet $snippet ): void {
    126202        $snippet = get_snippet( $snippet->id, $snippet->network );
     
    145221    }
    146222
     223    /**
     224     * Deactivate a snippet by updating its config entry.
     225     *
     226     * @param int  $snippet_id Snippet ID.
     227     * @param bool $network    Whether the snippet is network-wide.
     228     *
     229     * @return void
     230     */
    147231    public function deactivate_snippet( int $snippet_id, bool $network ): void {
    148232        $snippet = get_snippet( $snippet_id, $network );
     
    159243    }
    160244
     245    /**
     246     * Get the base directory for flat files.
     247     *
     248     * @param string $table       Optional hashed table name.
     249     * @param string $snippet_type Optional snippet type directory.
     250     *
     251     * @return string
     252     */
    161253    public static function get_base_dir( string $table = '', string $snippet_type = '' ): string {
    162254        $base_dir = WP_CONTENT_DIR . '/code-snippets';
     
    173265    }
    174266
     267    /**
     268     * Get the base URL for flat files.
     269     *
     270     * @param string $table       Optional hashed table name.
     271     * @param string $snippet_type Optional snippet type directory.
     272     *
     273     * @return string
     274     */
    175275    public static function get_base_url( string $table = '', string $snippet_type = '' ): string {
    176276        $base_url = WP_CONTENT_URL . '/code-snippets';
     
    187287    }
    188288
     289    /**
     290     * Create a directory if it does not exist.
     291     *
     292     * @param string $dir Directory path.
     293     *
     294     * @return void
     295     */
    189296    private function maybe_create_directory( string $dir ): void {
    190297        if ( ! $this->fs->is_dir( $dir ) ) {
     
    197304    }
    198305
     306    /**
     307     * Build the file path for a snippet's code file.
     308     *
     309     * @param string $base_dir    Base directory path.
     310     * @param int    $snippet_id  Snippet ID.
     311     * @param string $ext         File extension.
     312     *
     313     * @return string
     314     */
    199315    private function get_snippet_file_path( string $base_dir, int $snippet_id, string $ext ): string {
    200316        return trailingslashit( $base_dir ) . $snippet_id . '.' . $ext;
    201317    }
    202318
     319    /**
     320     * Delete a file if it exists.
     321     *
     322     * @param string $file_path File path.
     323     *
     324     * @return void
     325     */
    203326    private function delete_file( string $file_path ): void {
    204327        if ( $this->fs->exists( $file_path ) ) {
     
    207330    }
    208331
     332    /**
     333     * Sync the active shared network snippets list to a config file.
     334     *
     335     * @param string $option    Option name.
     336     * @param mixed  $old_value Previous value.
     337     * @param mixed  $value     New value.
     338     *
     339     * @return void
     340     */
    209341    public function sync_active_shared_network_snippets( $option, $old_value, $value ): void {
    210342        if ( 'active_shared_network_snippets' !== $option ) {
     
    215347    }
    216348
     349    /**
     350     * Sync the active shared network snippets list to a config file when first added.
     351     *
     352     * @param string $option Option name.
     353     * @param mixed  $value  Option value.
     354     *
     355     * @return void
     356     */
    217357    public function sync_active_shared_network_snippets_add( $option, $value ): void {
    218358        if ( 'active_shared_network_snippets' !== $option ) {
     
    223363    }
    224364
     365    /**
     366     * Create or update the active shared network snippets config file.
     367     *
     368     * @param mixed $value Option value.
     369     *
     370     * @return void
     371     */
    225372    private function create_active_shared_network_snippets_file( $value ): void {
    226373        $table = self::get_hashed_table_name( code_snippets()->db->get_table_name( false ) );
     
    230377
    231378        $file_path = trailingslashit( $base_dir ) . 'active-shared-network-snippets.php';
     379        // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export -- var_export is required for writing PHP config files.
    232380        $file_content = "<?php\n\nif ( ! defined( 'ABSPATH' ) ) { return; }\n\nreturn " . var_export( $value, true ) . ";\n";
    233381
     
    235383    }
    236384
     385    /**
     386     * Hash a table name for file system usage.
     387     *
     388     * @param string $table Table name.
     389     *
     390     * @return string
     391     */
    237392    public static function get_hashed_table_name( string $table ): string {
    238393        return wp_hash( $table );
    239394    }
    240395
     396    /**
     397     * Get a list of active snippets from flat file config.
     398     *
     399     * @param array<string> $scopes      Scopes to include.
     400     * @param string        $snippet_type Snippet type directory.
     401     *
     402     * @return array<int, array<string, mixed>>
     403     */
    241404    public static function get_active_snippets_from_flat_files(
    242405        array $scopes = [],
     
    246409        $db = code_snippets()->db;
    247410
    248         $table = self::get_hashed_table_name( $db->get_table_name() );
     411        // Always use the site table for "local" snippets, even in Network Admin.
     412        $table = self::get_hashed_table_name( $db->get_table_name( false ) );
    249413        $snippets = self::load_active_snippets_from_file(
    250414            $table,
     
    290454                foreach ( $ms_snippets as $snippet ) {
    291455                    $id = intval( $snippet['id'] );
    292 
    293                     if ( ! $snippet['active'] && ! in_array( $id, $active_shared_ids, true ) ) {
     456                    $active_value = intval( $snippet['active'] );
     457
     458                    if ( ! DB::is_network_snippet_enabled( $active_value, $id, $active_shared_ids ) ) {
    294459                        continue;
    295460                    }
     
    313478    }
    314479
    315     private static function sort_active_snippets( array &$active_snippets, $db ): void {
     480        /**
     481         * Sort active snippet entries for execution order.
     482         *
     483         * @param array<int, array<string, mixed>> $active_snippets Active snippets list.
     484         * @param DB                               $db Database instance.
     485         *
     486         * @return void
     487         */
     488    private static function sort_active_snippets( array &$active_snippets, DB $db ): void {
    316489        $comparisons = [
    317490            function ( array $a, array $b ) {
     
    343516    }
    344517
     518    /**
     519     * Load active snippets from a flat file config index.
     520     *
     521     * @param string     $table            Hashed table directory name.
     522     * @param string     $snippet_type      Snippet type directory.
     523     * @param string[]   $scopes           Scopes to include.
     524     * @param int[]|null $active_shared_ids Optional list of active shared network snippet IDs.
     525     *
     526     * @return array<int, array<string, mixed>>
     527     */
    345528    private static function load_active_snippets_from_file(
    346529        string $table,
     
    372555
    373556        $file_snippets = require $snippets_file_path;
     557        $shared_ids = is_array( $active_shared_ids )
     558            ? array_map( 'intval', $active_shared_ids )
     559            : [];
    374560
    375561        $filtered_snippets = array_filter(
    376562            $file_snippets,
    377             function ( $snippet ) use ( $scopes, $active_shared_ids ) {
    378                 $is_active = $snippet['active'];
    379 
    380                 if ( null !== $active_shared_ids ) {
    381                     $is_active = $is_active || in_array(
    382                         intval( $snippet['id'] ),
    383                         $active_shared_ids,
    384                         true
    385                     );
    386                 }
     563            function ( $snippet ) use ( $scopes, $shared_ids ) {
     564                $active_value = isset( $snippet['active'] ) ? intval( $snippet['active'] ) : 0;
     565
     566                $is_active = DB::is_network_snippet_enabled( $active_value, intval( $snippet['id'] ), $shared_ids );
    387567
    388568                return ( $is_active || 'condition' === $snippet['scope'] ) && in_array( $snippet['scope'], $scopes, true );
     
    395575    }
    396576
     577    /**
     578     * Add file-based execution settings fields.
     579     *
     580     * @param array<string, mixed> $fields Settings fields.
     581     *
     582     * @return array<string, mixed>
     583     */
    397584    public function add_settings_fields( array $fields ): array {
    398585        $fields['general']['enable_flat_files'] = [
     
    409596    }
    410597
    411     public function create_all_flat_files( array $settings, array $input ): void {
     598    /**
     599     * Recreate all flat files when file-based execution settings are updated.
     600     *
     601     * @param array<string, mixed> $settings Settings data.
     602     *
     603     * @return void
     604     */
     605    public function create_all_flat_files( array $settings ): void {
    412606        if ( ! isset( $settings['general']['enable_flat_files'] ) ) {
    413607            return;
     
    424618    }
    425619
     620    /**
     621     * Create snippet code files and config indexes for all active snippets.
     622     *
     623     * @return void
     624     */
    426625    private function create_snippet_flat_files(): void {
    427626        $db = code_snippets()->db;
     
    458657    }
    459658
     659    /**
     660     * Create active shared network snippet config files for each site (multisite) or the current site.
     661     *
     662     * @return void
     663     */
    460664    private function create_active_shared_network_snippets_config_file(): void {
    461665        if ( is_multisite() ) {
  • code-snippets/trunk/php/views/import.php

    r3352486 r3441225  
    2020
    2121$max_size_bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
    22 
    2322?>
    2423<div class="wrap">
     
    3534    </h1>
    3635
    37     <?php $this->print_messages(); ?>
    38 
    39     <div class="narrow">
    40 
    41         <p><?php esc_html_e( 'Upload one or more Code Snippets export files and the snippets will be imported.', 'code-snippets' ); ?></p>
    42 
    43         <p>
    44             <?php
    45             /* translators: %s: link to snippets admin menu */
    46             $text = __( 'Afterward, you will need to visit the <a href="%s" >All Snippets</a> page to activate the imported snippets.', 'code-snippets' );
    47             $url = esc_url( code_snippets()->get_menu_url( 'manage' ) );
    48 
    49             echo wp_kses(
    50                 sprintf( $text, $url ),
    51                 array(
    52                     'a' => array(
    53                         'href'   => array(),
    54                         'target' => array(),
    55                     ),
    56                 )
    57             );
    58             ?>
    59         </p>
    60 
    61         <form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form"
    62               name="code_snippets_import">
    63             <?php wp_nonce_field( 'import_code_snippets_file' ); ?>
    64 
    65             <h2><?php esc_html_e( 'Duplicate Snippets', 'code-snippets' ); ?></h2>
    66 
    67             <p class="description">
    68                 <?php esc_html_e( 'What should happen if an existing snippet is found with an identical name to an imported snippet?', 'code-snippets' ); ?>
    69             </p>
    70 
    71             <fieldset>
    72                 <p>
    73                     <label>
    74                         <input type="radio" name="duplicate_action" value="ignore" checked="checked">
    75                         <?php esc_html_e( 'Ignore any duplicate snippets: import all snippets from the file regardless and leave all existing snippets unchanged.', 'code-snippets' ); ?>
    76                     </label>
    77                 </p>
    78 
    79                 <p>
    80                     <label>
    81                         <input type="radio" name="duplicate_action" value="replace">
    82                         <?php esc_html_e( 'Replace any existing snippets with a newly imported snippet of the same name.', 'code-snippets' ); ?>
    83                     </label>
    84                 </p>
    85 
    86                 <p>
    87                     <label>
    88                         <input type="radio" name="duplicate_action" value="skip">
    89                         <?php esc_html_e( 'Do not import any duplicate snippets; leave all existing snippets unchanged.', 'code-snippets' ); ?>
    90                     </label>
    91                 </p>
    92             </fieldset>
    93 
    94             <h2><?php esc_html_e( 'Upload Files', 'code-snippets' ); ?></h2>
    95 
    96             <p class="description">
    97                 <?php esc_html_e( 'Choose one or more Code Snippets (.xml or .json) files to upload, then click "Upload files and import".', 'code-snippets' ); ?>
    98             </p>
    99 
    100             <fieldset>
    101                 <p>
    102                     <label for="upload"><?php esc_html_e( 'Choose files from your computer:', 'code-snippets' ); ?></label>
    103                     <?php
    104                     /* translators: %s: size in bytes */
    105                     printf( esc_html__( '(Maximum size: %s)', 'code-snippets' ), esc_html( size_format( $max_size_bytes ) ) ); ?>
    106                     <input type="file" id="upload" name="code_snippets_import_files[]" size="25"
    107                            accept="application/json,.json,text/xml" multiple="multiple">
    108                     <input type="hidden" name="action" value="save">
    109                     <input type="hidden" name="max_file_size" value="<?php echo esc_attr( $max_size_bytes ); ?>">
    110                 </p>
    111             </fieldset>
    112 
    113             <?php
    114 
    115             do_action( 'code_snippets/admin/import_form' );
    116             submit_button( __( 'Upload files and import', 'code-snippets' ) );
    117 
    118             ?>
    119         </form>
    120     </div>
     36    <div id="import-container"></div>
    12137</div>
  • code-snippets/trunk/php/views/partials/list-table-notices.php

    r3388874 r3441225  
    3131            ?>
    3232
    33             <a href="https://help.codesnippets.pro/article/12-safe-mode" target="_blank">
     33            <a href="https://codesnippets.pro/doc/safe-mode/" target="_blank">
    3434                <?php esc_html_e( 'Help', 'code-snippets' ); ?>
    3535            </a>
     
    4646
    4747$result_messages = [
    48     'executed'          => __( 'Snippet <strong>executed</strong>.', 'code-snippets' ),
    49     'activated'         => __( 'Snippet <strong>activated</strong>.', 'code-snippets' ),
    50     'activated-multi'   => __( 'Selected snippets <strong>activated</strong>.', 'code-snippets' ),
    51     'deactivated'       => __( 'Snippet <strong>deactivated</strong>.', 'code-snippets' ),
    52     'deactivated-multi' => __( 'Selected snippets <strong>deactivated</strong>.', 'code-snippets' ),
    53     'deleted'           => __( 'Snippet <strong>trashed</strong>.', 'code-snippets' ),
    54     'deleted-multi'     => __( 'Selected snippets <strong>trashed</strong>.', 'code-snippets' ),
    55     'deleted_permanently' => __( 'Snippet <strong>permanently deleted</strong>.', 'code-snippets' ),
     48    'executed'                  => __( 'Snippet <strong>executed</strong>.', 'code-snippets' ),
     49    'activated'                 => __( 'Snippet <strong>activated</strong>.', 'code-snippets' ),
     50    'activated-multi'           => __( 'Selected snippets <strong>activated</strong>.', 'code-snippets' ),
     51    'deactivated'               => __( 'Snippet <strong>deactivated</strong>.', 'code-snippets' ),
     52    'deactivated-multi'         => __( 'Selected snippets <strong>deactivated</strong>.', 'code-snippets' ),
     53    'deleted'                   => __( 'Snippet <strong>trashed</strong>.', 'code-snippets' ),
     54    'deleted-multi'             => __( 'Selected snippets <strong>trashed</strong>.', 'code-snippets' ),
     55    'deleted_permanently'       => __( 'Snippet <strong>permanently deleted</strong>.', 'code-snippets' ),
    5656    'deleted-permanently-multi' => __( 'Selected snippets <strong>permanently deleted</strong>.', 'code-snippets' ),
    57     'restored'          => __( 'Snippet <strong>restored</strong>.', 'code-snippets' ),
    58     'restored-multi'    => __( 'Selected snippets <strong>restored</strong>.', 'code-snippets' ),
    59     'cloned'            => __( 'Snippet <strong>cloned</strong>.', 'code-snippets' ),
    60     'cloned-multi'      => __( 'Selected snippets <strong>cloned</strong>.', 'code-snippets' ),
    61     'cloud-refreshed'   => __( 'Synced cloud data has been <strong>successfully</strong> refreshed.', 'code-snippets' ),
     57    'restored'                  => __( 'Snippet <strong>restored</strong>.', 'code-snippets' ),
     58    'restored-multi'            => __( 'Selected snippets <strong>restored</strong>.', 'code-snippets' ),
     59    'cloned'                    => __( 'Snippet <strong>cloned</strong>.', 'code-snippets' ),
     60    'cloned-multi'              => __( 'Selected snippets <strong>cloned</strong>.', 'code-snippets' ),
     61    'cloud-refreshed'           => __( 'Synced cloud data has been <strong>successfully</strong> refreshed.', 'code-snippets' ),
    6262];
    6363
     
    6565if ( 'deleted' === $result && ! empty( $_REQUEST['ids'] ) ) {
    6666    $deleted_ids = sanitize_text_field( $_REQUEST['ids'] );
    67     $undo_url = wp_nonce_url(
    68         add_query_arg( array(
    69             'action' => 'restore',
    70             'ids' => $deleted_ids
    71         ) ),
     67    $undo_url = wp_nonce_url(
     68        add_query_arg(
     69            [
     70                'action' => 'restore',
     71                'ids'    => $deleted_ids,
     72            ]
     73        ),
    7274        'bulk-snippets'
    7375    );
    7476
    75     $result_messages['deleted'] = sprintf(
    76         __( 'Snippet <strong>trashed</strong>. <a href="%s">Undo</a>', 'code-snippets' ),
    77         esc_url( $undo_url )
    78     );
     77    // translators: %s: Undo URL.
     78    $undo_message = __( 'Snippet <strong>trashed</strong>. <a href="%s">Undo</a>', 'code-snippets' );
     79    $result_messages['deleted'] = sprintf( $undo_message, esc_url( $undo_url ) );
    7980}
    8081
     
    8283if ( 'deleted-multi' === $result && ! empty( $_REQUEST['ids'] ) ) {
    8384    $deleted_ids = sanitize_text_field( $_REQUEST['ids'] );
    84     $undo_url = wp_nonce_url( 
    85         add_query_arg( array( 
    86             'action' => 'restore', 
    87             'ids' => $deleted_ids
    88         ) ), 
     85    $undo_url = wp_nonce_url(
     86        add_query_arg( array(
     87            'action' => 'restore',
     88            'ids'    => $deleted_ids,
     89        ) ),
    8990        'bulk-snippets'
    9091    );
    9192
    92     $result_messages['deleted-multi'] = sprintf(
    93         __( 'Selected snippets <strong>trashed</strong>. <a href="%s">Undo</a>', 'code-snippets' ),
    94         esc_url( $undo_url )
    95     );
     93    // translators: %s: Undo URL.
     94    $undo_message = __( 'Selected snippets <strong>trashed</strong>. <a href="%s">Undo</a>', 'code-snippets' );
     95    $result_messages['deleted-multi'] = sprintf( $undo_message, esc_url( $undo_url ) );
    9696}
    9797
     
    101101    $result_kses = [
    102102        'strong' => [],
    103         'a' => [
     103        'a'      => [
    104104            'href' => [],
    105105        ],
  • code-snippets/trunk/readme.txt

    r3409719 r3441225  
    55License: GPL-2.0-or-later
    66License URI: license.txt
    7 Stable tag: 3.9.3
     7Stable tag: 3.9.4
    88Tested up to: 6.8
    99
     
    6464== Frequently Asked Questions ==
    6565
    66 A full list of our Frequently Asked Questions can be found at [help.codesnippets.pro](https://help.codesnippets.pro/collection/3-faq).
     66A full list of our Frequently Asked Questions can be found at [codesnippets.pro](https://codesnippets.pro/docs/faq/).
    6767
    6868= How can I recover my site if it is crashed by a buggy snippet? =
    69 You can recover your site by enabling the Code Snippets safe mode feature. Instructions for how to turn it on are available here: <https://help.codesnippets.pro/article/12-safe-mode>.
     69You can recover your site by enabling the Code Snippets safe mode feature. Instructions for how to turn it on are available here: <https://codesnippets.pro/doc/safe-mode/>.
    7070
    7171= Will I lose my snippets if I change the theme or upgrade WordPress? =
     
    105105== Changelog ==
    106106
     107= 3.9.4 (2026-01-14) =
     108
     109__Added__
     110
     111* New import functionality to migrate snippets from file uploads with drag-and-drop interface
     112* Support for importing snippets from other popular plugins (Header Footer Code Manager, Insert Headers and Footers, Insert PHP Code Snippet)
     113* Enhanced file based execution support with improved multisite mode compatibility
     114
     115__Changed__
     116
     117* Updated links to more recent documentation pages
     118
     119__Fixed__
     120
     121* Fixed multisite capability checks in Plugin class
     122* Fixed snippet execution logic for multisite support by centralizing trashed snippet handling
     123* Fixed multisite snippet handling to ensure local snippets use correct table and filter out trashed snippets
    107124
    108125= 3.9.3 (2025-12-03) =
  • code-snippets/trunk/vendor/composer/autoload_classmap.php

    r3382390 r3441225  
    2121    'Code_Snippets\\Export_Attachment' => $baseDir . '/php/export/class-export-attachment.php',
    2222    'Code_Snippets\\File_System_Interface' => $baseDir . '/php/flat-files/interfaces/interface-file-system.php',
     23    'Code_Snippets\\Files_Import_Manager' => $baseDir . '/php/migration/importers/files/file-upload-importer.php',
    2324    'Code_Snippets\\Front_End' => $baseDir . '/php/front-end/class-front-end.php',
     25    'Code_Snippets\\Header_Footer_Code_Manager_Importer' => $baseDir . '/php/migration/importers/plugins/header-footer-code-manager.php',
    2426    'Code_Snippets\\Html_Snippet_Handler' => $baseDir . '/php/flat-files/handlers/html-snippet-handler.php',
    2527    'Code_Snippets\\Import' => $baseDir . '/php/export/class-import.php',
    2628    'Code_Snippets\\Import_Menu' => $baseDir . '/php/admin-menus/class-import-menu.php',
     29    'Code_Snippets\\Importer_Base' => $baseDir . '/php/migration/importers/plugins/importer-base.php',
     30    'Code_Snippets\\Insert_Headers_And_Footers_Importer' => $baseDir . '/php/migration/importers/plugins/insert-headers-and-footers.php',
     31    'Code_Snippets\\Insert_PHP_Code_Snippet_Importer' => $baseDir . '/php/migration/importers/plugins/insert-php-code-snippet.php',
    2732    'Code_Snippets\\Licensing' => $baseDir . '/php/class-licensing.php',
    2833    'Code_Snippets\\List_Table' => $baseDir . '/php/class-list-table.php',
     
    3035    'Code_Snippets\\Php_Snippet_Handler' => $baseDir . '/php/flat-files/handlers/php-snippet-handler.php',
    3136    'Code_Snippets\\Plugin' => $baseDir . '/php/class-plugin.php',
     37    'Code_Snippets\\Plugins_Import_Manager' => $baseDir . '/php/migration/importers/plugins/manager.php',
    3238    'Code_Snippets\\REST_API\\Snippets_REST_Controller' => $baseDir . '/php/rest-api/class-snippets-rest-controller.php',
    3339    'Code_Snippets\\Settings\\Setting_Field' => $baseDir . '/php/settings/class-setting-field.php',
  • code-snippets/trunk/vendor/composer/autoload_static.php

    r3395364 r3441225  
    4949        'Code_Snippets\\Export_Attachment' => __DIR__ . '/../..' . '/php/export/class-export-attachment.php',
    5050        'Code_Snippets\\File_System_Interface' => __DIR__ . '/../..' . '/php/flat-files/interfaces/interface-file-system.php',
     51        'Code_Snippets\\Files_Import_Manager' => __DIR__ . '/../..' . '/php/migration/importers/files/file-upload-importer.php',
    5152        'Code_Snippets\\Front_End' => __DIR__ . '/../..' . '/php/front-end/class-front-end.php',
     53        'Code_Snippets\\Header_Footer_Code_Manager_Importer' => __DIR__ . '/../..' . '/php/migration/importers/plugins/header-footer-code-manager.php',
    5254        'Code_Snippets\\Html_Snippet_Handler' => __DIR__ . '/../..' . '/php/flat-files/handlers/html-snippet-handler.php',
    5355        'Code_Snippets\\Import' => __DIR__ . '/../..' . '/php/export/class-import.php',
    5456        'Code_Snippets\\Import_Menu' => __DIR__ . '/../..' . '/php/admin-menus/class-import-menu.php',
     57        'Code_Snippets\\Importer_Base' => __DIR__ . '/../..' . '/php/migration/importers/plugins/importer-base.php',
     58        'Code_Snippets\\Insert_Headers_And_Footers_Importer' => __DIR__ . '/../..' . '/php/migration/importers/plugins/insert-headers-and-footers.php',
     59        'Code_Snippets\\Insert_PHP_Code_Snippet_Importer' => __DIR__ . '/../..' . '/php/migration/importers/plugins/insert-php-code-snippet.php',
    5560        'Code_Snippets\\Licensing' => __DIR__ . '/../..' . '/php/class-licensing.php',
    5661        'Code_Snippets\\List_Table' => __DIR__ . '/../..' . '/php/class-list-table.php',
     
    5863        'Code_Snippets\\Php_Snippet_Handler' => __DIR__ . '/../..' . '/php/flat-files/handlers/php-snippet-handler.php',
    5964        'Code_Snippets\\Plugin' => __DIR__ . '/../..' . '/php/class-plugin.php',
     65        'Code_Snippets\\Plugins_Import_Manager' => __DIR__ . '/../..' . '/php/migration/importers/plugins/manager.php',
    6066        'Code_Snippets\\REST_API\\Snippets_REST_Controller' => __DIR__ . '/../..' . '/php/rest-api/class-snippets-rest-controller.php',
    6167        'Code_Snippets\\Settings\\Setting_Field' => __DIR__ . '/../..' . '/php/settings/class-setting-field.php',
  • code-snippets/trunk/vendor/composer/installed.php

    r3409719 r3441225  
    22    'root' => array(
    33        'name' => 'codesnippetspro/code-snippets',
    4         'pretty_version' => 'v3.9.3',
    5         'version' => '3.9.3.0',
    6         'reference' => '5311ee913e1d885be15217b6d526bb3969d4f71b',
     4        'pretty_version' => 'v3.9.4',
     5        'version' => '3.9.4.0',
     6        'reference' => '8ee0c5cd40988c6ddfdba4d8fb67523296d84d1e',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'codesnippetspro/code-snippets' => array(
    14             'pretty_version' => 'v3.9.3',
    15             'version' => '3.9.3.0',
    16             'reference' => '5311ee913e1d885be15217b6d526bb3969d4f71b',
     14            'pretty_version' => 'v3.9.4',
     15            'version' => '3.9.4.0',
     16            'reference' => '8ee0c5cd40988c6ddfdba4d8fb67523296d84d1e',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.