Changeset 3441225
- Timestamp:
- 01/16/2026 07:28:09 PM (2 months ago)
- Location:
- code-snippets/trunk
- Files:
-
- 55 added
- 15 edited
-
CHANGELOG.md (modified) (2 diffs)
-
code-snippets.php (modified) (2 diffs)
-
dist/import.js (added)
-
dist/import.js.LICENSE.txt (added)
-
js/components/Import (added)
-
js/components/Import/FromFileUpload (added)
-
js/components/Import/FromFileUpload/FileUploadForm.tsx (added)
-
js/components/Import/FromFileUpload/components (added)
-
js/components/Import/FromFileUpload/components/DragDropUploadArea.tsx (added)
-
js/components/Import/FromFileUpload/components/DuplicateActionSelector.tsx (added)
-
js/components/Import/FromFileUpload/components/ImportResultDisplay.tsx (added)
-
js/components/Import/FromFileUpload/components/SelectedFilesList.tsx (added)
-
js/components/Import/FromFileUpload/components/SnippetSelectionTable.tsx (added)
-
js/components/Import/FromFileUpload/components/index.ts (added)
-
js/components/Import/FromFileUpload/hooks (added)
-
js/components/Import/FromFileUpload/hooks/index.ts (added)
-
js/components/Import/FromFileUpload/hooks/useDragAndDrop.ts (added)
-
js/components/Import/FromFileUpload/hooks/useFileSelection.ts (added)
-
js/components/Import/FromFileUpload/hooks/useImportWorkflow.ts (added)
-
js/components/Import/FromFileUpload/hooks/useSnippetSelection.ts (added)
-
js/components/Import/FromFileUpload/utils (added)
-
js/components/Import/FromFileUpload/utils/fileUtils.ts (added)
-
js/components/Import/FromOtherPlugins (added)
-
js/components/Import/FromOtherPlugins/ImportForm.tsx (added)
-
js/components/Import/FromOtherPlugins/components (added)
-
js/components/Import/FromOtherPlugins/components/ImportOptions.tsx (added)
-
js/components/Import/FromOtherPlugins/components/ImporterSelector.tsx (added)
-
js/components/Import/FromOtherPlugins/components/SimpleSnippetTable.tsx (added)
-
js/components/Import/FromOtherPlugins/components/StatusDisplay.tsx (added)
-
js/components/Import/FromOtherPlugins/components/index.ts (added)
-
js/components/Import/FromOtherPlugins/hooks (added)
-
js/components/Import/FromOtherPlugins/hooks/index.ts (added)
-
js/components/Import/FromOtherPlugins/hooks/useImportSnippetSelection.ts (added)
-
js/components/Import/FromOtherPlugins/hooks/useImporterSelection.ts (added)
-
js/components/Import/FromOtherPlugins/hooks/useSnippetImport.ts (added)
-
js/components/Import/FromOtherPlugins/index.ts (added)
-
js/components/Import/ImportApp.tsx (added)
-
js/components/Import/shared (added)
-
js/components/Import/shared/components (added)
-
js/components/Import/shared/components/ImportCard.tsx (added)
-
js/components/Import/shared/components/ImportSection.tsx (added)
-
js/components/Import/shared/components/index.ts (added)
-
js/components/Import/shared/index.ts (added)
-
js/hooks/useAxios.ts (added)
-
js/hooks/useFileUploadAPI.ts (added)
-
js/hooks/useImportersAPI.ts (added)
-
js/import.tsx (added)
-
php/admin-menus/class-import-menu.php (modified) (2 diffs)
-
php/admin-menus/class-welcome-menu.php (modified) (1 diff)
-
php/class-admin.php (modified) (1 diff)
-
php/class-contextual-help.php (modified) (4 diffs)
-
php/class-db.php (modified) (2 diffs)
-
php/class-plugin.php (modified) (3 diffs)
-
php/flat-files/classes/class-snippet-files.php (modified) (27 diffs)
-
php/migration (added)
-
php/migration/importers (added)
-
php/migration/importers/files (added)
-
php/migration/importers/files/file-upload-importer.php (added)
-
php/migration/importers/plugins (added)
-
php/migration/importers/plugins/header-footer-code-manager.php (added)
-
php/migration/importers/plugins/importer-base.php (added)
-
php/migration/importers/plugins/insert-headers-and-footers.php (added)
-
php/migration/importers/plugins/insert-php-code-snippet.php (added)
-
php/migration/importers/plugins/manager.php (added)
-
php/views/import.php (modified) (2 diffs)
-
php/views/partials/list-table-notices.php (modified) (5 diffs)
-
readme.txt (modified) (3 diffs)
-
vendor/composer/autoload_classmap.php (modified) (2 diffs)
-
vendor/composer/autoload_static.php (modified) (2 diffs)
-
vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
code-snippets/trunk/CHANGELOG.md
r3409719 r3441225 1 1 # Changelog 2 2 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 3 17 4 18 ## [3.9.3] (2025-12-03) … … 379 393 ### Added 380 394 * 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/) 382 396 * Ability to filter shortcode output. Thanks to contributions from [Jack Szwergold](https://github.com/JackSzwergold). 383 397 -
code-snippets/trunk/code-snippets.php
r3409719 r3441225 9 9 * License URI: license.txt 10 10 * Text Domain: code-snippets 11 * Version: 3.9. 311 * Version: 3.9.4 12 12 * Requires PHP: 7.4 13 13 * Requires at least: 5.0 14 14 * 15 * @version 3.9. 315 * @version 3.9.4 16 16 * @package Code_Snippets 17 17 * @author Shea Bunge <[email protected]> … … 38 38 * @const string 39 39 */ 40 define( 'CODE_SNIPPETS_VERSION', '3.9. 3' );40 define( 'CODE_SNIPPETS_VERSION', '3.9.4' ); 41 41 42 42 /** -
code-snippets/trunk/php/admin-menus/class-import-menu.php
r3352486 r3441225 39 39 $contextual_help = new Contextual_Help( 'import' ); 40 40 $contextual_help->load(); 41 42 $this->process_import_files();43 }44 45 /**46 * Process the uploaded import files47 */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.InputNotSanitized62 $upload_files = $_FILES['code_snippets_import_files']['tmp_name'];63 // phpcs:disable WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized64 $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;99 41 } 100 42 … … 119 61 120 62 /** 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. 164 64 * 165 65 * @return void 166 66 */ 167 67 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' ); 169 84 } 170 85 } -
code-snippets/trunk/php/admin-menus/class-welcome-menu.php
r3352486 r3441225 60 60 ], 61 61 'resources' => [ 62 'url' => 'https:// help.codesnippets.pro/',62 'url' => 'https://codesnippets.pro/support/', 63 63 'icon' => 'sos', 64 64 'label' => __( 'Support', 'code-snippets' ), -
code-snippets/trunk/php/class-admin.php
r3392896 r3441225 180 180 sprintf( 181 181 $format, 182 'https:// help.codesnippets.pro/',182 'https://codesnippets.pro/support/', 183 183 esc_attr__( 'Find out how to get support with Code Snippets', 'code-snippets' ), 184 184 esc_html__( 'Docs and Support', 'code-snippets' ) -
code-snippets/trunk/php/class-contextual-help.php
r3352486 r3441225 68 68 $sidebar_links = [ 69 69 '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' ), 71 71 'https://wordpress.org/support/plugin/code-snippets' => __( 'Support Forum', 'code-snippets' ), 72 72 'https://codesnippets.pro' => __( 'Plugin Website', 'code-snippets' ), … … 74 74 75 75 $kses = [ 76 'p' => [],76 'p' => [], 77 77 'strong' => [], 78 'a' => [ 'href'=> [] ],78 'a' => [ 'href' => [] ], 79 79 ]; 80 80 … … 144 144 __( "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' ), 145 145 /* 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/' ), 147 147 ] 148 148 ); … … 160 160 __( 'Here you can add a new snippet, or edit an existing one.', 'code-snippets' ), 161 161 /* 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/' ), 163 163 ] 164 164 ); -
code-snippets/trunk/php/class-db.php
r3352486 r3441225 198 198 } 199 199 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 ) { 222 281 return false; 223 282 } 224 283 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 ); 247 289 } 248 290 … … 283 325 284 326 /** 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; 348 373 } 349 374 } -
code-snippets/trunk/php/class-plugin.php
r3392896 r3441225 133 133 require_once $includes_path . '/settings/settings-fields.php'; 134 134 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'; 136 136 require_once $includes_path . '/settings/settings.php'; 137 137 … … 157 157 add_action( 'plugins_loaded', array( $upgrade, 'run' ), 0 ); 158 158 $this->licensing = new Licensing(); 159 160 // Importers. 161 new Plugins_Import_Manager(); 162 new Files_Import_Manager(); 159 163 } 160 164 … … 355 359 public function get_cap(): string { 356 360 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() ) { 357 365 return $this->get_network_cap_name(); 358 366 } -
code-snippets/trunk/php/flat-files/classes/class-snippet-files.php
r3388874 r3441225 3 3 namespace Code_Snippets; 4 4 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 */ 5 11 class Snippet_Files { 6 12 … … 10 16 private const ENABLED_FLAG_FILE = 'flat-files-enabled.flag'; 11 17 18 /** 19 * Snippet handler registry. 20 * 21 * @var Snippet_Handler_Registry 22 */ 12 23 private Snippet_Handler_Registry $handler_registry; 13 24 25 /** 26 * File system adapter. 27 * 28 * @var File_System_Interface 29 */ 14 30 private File_System_Interface $fs; 15 31 32 /** 33 * Config repository. 34 * 35 * @var Snippet_Config_Repository_Interface 36 */ 16 37 private Snippet_Config_Repository_Interface $config_repo; 17 38 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 */ 18 46 public function __construct( 19 47 Snippet_Handler_Registry $handler_registry, … … 37 65 } 38 66 67 /** 68 * Get the full path to the flat-file enabled flag. 69 * 70 * @return string 71 */ 39 72 private static function get_flag_file_path(): string { 40 73 return self::get_base_dir() . '/' . self::ENABLED_FLAG_FILE; 41 74 } 42 75 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 */ 43 83 private function handle_enabled_file_flag( bool $enabled ): void { 44 84 $flag_file_path = self::get_flag_file_path(); … … 54 94 } 55 95 96 /** 97 * Register WordPress hooks used by file-based execution. 98 * 99 * @return void 100 */ 56 101 public function register_hooks(): void { 57 102 if ( ! $this->fs->is_writable( WP_CONTENT_DIR ) ) { … … 73 118 74 119 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 */ 78 131 public function activate_snippets( $valid_snippets, $table ): void { 79 132 foreach ( $valid_snippets as $snippet ) { … … 83 136 } 84 137 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 */ 85 146 public function handle_snippet( Snippet $snippet, string $table ): void { 86 147 if ( 0 === $snippet->id ) { … … 107 168 } 108 169 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 */ 109 178 public function delete_snippet( Snippet $snippet, bool $network ): void { 110 179 $handler = $this->handler_registry->get_handler( $snippet->type ); … … 123 192 } 124 193 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 */ 125 201 public function activate_snippet( Snippet $snippet ): void { 126 202 $snippet = get_snippet( $snippet->id, $snippet->network ); … … 145 221 } 146 222 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 */ 147 231 public function deactivate_snippet( int $snippet_id, bool $network ): void { 148 232 $snippet = get_snippet( $snippet_id, $network ); … … 159 243 } 160 244 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 */ 161 253 public static function get_base_dir( string $table = '', string $snippet_type = '' ): string { 162 254 $base_dir = WP_CONTENT_DIR . '/code-snippets'; … … 173 265 } 174 266 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 */ 175 275 public static function get_base_url( string $table = '', string $snippet_type = '' ): string { 176 276 $base_url = WP_CONTENT_URL . '/code-snippets'; … … 187 287 } 188 288 289 /** 290 * Create a directory if it does not exist. 291 * 292 * @param string $dir Directory path. 293 * 294 * @return void 295 */ 189 296 private function maybe_create_directory( string $dir ): void { 190 297 if ( ! $this->fs->is_dir( $dir ) ) { … … 197 304 } 198 305 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 */ 199 315 private function get_snippet_file_path( string $base_dir, int $snippet_id, string $ext ): string { 200 316 return trailingslashit( $base_dir ) . $snippet_id . '.' . $ext; 201 317 } 202 318 319 /** 320 * Delete a file if it exists. 321 * 322 * @param string $file_path File path. 323 * 324 * @return void 325 */ 203 326 private function delete_file( string $file_path ): void { 204 327 if ( $this->fs->exists( $file_path ) ) { … … 207 330 } 208 331 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 */ 209 341 public function sync_active_shared_network_snippets( $option, $old_value, $value ): void { 210 342 if ( 'active_shared_network_snippets' !== $option ) { … … 215 347 } 216 348 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 */ 217 357 public function sync_active_shared_network_snippets_add( $option, $value ): void { 218 358 if ( 'active_shared_network_snippets' !== $option ) { … … 223 363 } 224 364 365 /** 366 * Create or update the active shared network snippets config file. 367 * 368 * @param mixed $value Option value. 369 * 370 * @return void 371 */ 225 372 private function create_active_shared_network_snippets_file( $value ): void { 226 373 $table = self::get_hashed_table_name( code_snippets()->db->get_table_name( false ) ); … … 230 377 231 378 $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. 232 380 $file_content = "<?php\n\nif ( ! defined( 'ABSPATH' ) ) { return; }\n\nreturn " . var_export( $value, true ) . ";\n"; 233 381 … … 235 383 } 236 384 385 /** 386 * Hash a table name for file system usage. 387 * 388 * @param string $table Table name. 389 * 390 * @return string 391 */ 237 392 public static function get_hashed_table_name( string $table ): string { 238 393 return wp_hash( $table ); 239 394 } 240 395 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 */ 241 404 public static function get_active_snippets_from_flat_files( 242 405 array $scopes = [], … … 246 409 $db = code_snippets()->db; 247 410 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 ) ); 249 413 $snippets = self::load_active_snippets_from_file( 250 414 $table, … … 290 454 foreach ( $ms_snippets as $snippet ) { 291 455 $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 ) ) { 294 459 continue; 295 460 } … … 313 478 } 314 479 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 { 316 489 $comparisons = [ 317 490 function ( array $a, array $b ) { … … 343 516 } 344 517 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 */ 345 528 private static function load_active_snippets_from_file( 346 529 string $table, … … 372 555 373 556 $file_snippets = require $snippets_file_path; 557 $shared_ids = is_array( $active_shared_ids ) 558 ? array_map( 'intval', $active_shared_ids ) 559 : []; 374 560 375 561 $filtered_snippets = array_filter( 376 562 $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 ); 387 567 388 568 return ( $is_active || 'condition' === $snippet['scope'] ) && in_array( $snippet['scope'], $scopes, true ); … … 395 575 } 396 576 577 /** 578 * Add file-based execution settings fields. 579 * 580 * @param array<string, mixed> $fields Settings fields. 581 * 582 * @return array<string, mixed> 583 */ 397 584 public function add_settings_fields( array $fields ): array { 398 585 $fields['general']['enable_flat_files'] = [ … … 409 596 } 410 597 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 { 412 606 if ( ! isset( $settings['general']['enable_flat_files'] ) ) { 413 607 return; … … 424 618 } 425 619 620 /** 621 * Create snippet code files and config indexes for all active snippets. 622 * 623 * @return void 624 */ 426 625 private function create_snippet_flat_files(): void { 427 626 $db = code_snippets()->db; … … 458 657 } 459 658 659 /** 660 * Create active shared network snippet config files for each site (multisite) or the current site. 661 * 662 * @return void 663 */ 460 664 private function create_active_shared_network_snippets_config_file(): void { 461 665 if ( is_multisite() ) { -
code-snippets/trunk/php/views/import.php
r3352486 r3441225 20 20 21 21 $max_size_bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() ); 22 23 22 ?> 24 23 <div class="wrap"> … … 35 34 </h1> 36 35 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> 121 37 </div> -
code-snippets/trunk/php/views/partials/list-table-notices.php
r3388874 r3441225 31 31 ?> 32 32 33 <a href="https:// help.codesnippets.pro/article/12-safe-mode" target="_blank">33 <a href="https://codesnippets.pro/doc/safe-mode/" target="_blank"> 34 34 <?php esc_html_e( 'Help', 'code-snippets' ); ?> 35 35 </a> … … 46 46 47 47 $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' ), 56 56 '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' ), 62 62 ]; 63 63 … … 65 65 if ( 'deleted' === $result && ! empty( $_REQUEST['ids'] ) ) { 66 66 $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 ), 72 74 'bulk-snippets' 73 75 ); 74 76 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 ) ); 79 80 } 80 81 … … 82 83 if ( 'deleted-multi' === $result && ! empty( $_REQUEST['ids'] ) ) { 83 84 $deleted_ids = sanitize_text_field( $_REQUEST['ids'] ); 84 $undo_url = wp_nonce_url( 85 add_query_arg( array( 86 'action' => 'restore', 87 'ids' => $deleted_ids88 ) ), 85 $undo_url = wp_nonce_url( 86 add_query_arg( array( 87 'action' => 'restore', 88 'ids' => $deleted_ids, 89 ) ), 89 90 'bulk-snippets' 90 91 ); 91 92 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 ) ); 96 96 } 97 97 … … 101 101 $result_kses = [ 102 102 'strong' => [], 103 'a' => [103 'a' => [ 104 104 'href' => [], 105 105 ], -
code-snippets/trunk/readme.txt
r3409719 r3441225 5 5 License: GPL-2.0-or-later 6 6 License URI: license.txt 7 Stable tag: 3.9. 37 Stable tag: 3.9.4 8 8 Tested up to: 6.8 9 9 … … 64 64 == Frequently Asked Questions == 65 65 66 A full list of our Frequently Asked Questions can be found at [ help.codesnippets.pro](https://help.codesnippets.pro/collection/3-faq).66 A full list of our Frequently Asked Questions can be found at [codesnippets.pro](https://codesnippets.pro/docs/faq/). 67 67 68 68 = 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>.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://codesnippets.pro/doc/safe-mode/>. 70 70 71 71 = Will I lose my snippets if I change the theme or upgrade WordPress? = … … 105 105 == Changelog == 106 106 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 107 124 108 125 = 3.9.3 (2025-12-03) = -
code-snippets/trunk/vendor/composer/autoload_classmap.php
r3382390 r3441225 21 21 'Code_Snippets\\Export_Attachment' => $baseDir . '/php/export/class-export-attachment.php', 22 22 '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', 23 24 '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', 24 26 'Code_Snippets\\Html_Snippet_Handler' => $baseDir . '/php/flat-files/handlers/html-snippet-handler.php', 25 27 'Code_Snippets\\Import' => $baseDir . '/php/export/class-import.php', 26 28 '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', 27 32 'Code_Snippets\\Licensing' => $baseDir . '/php/class-licensing.php', 28 33 'Code_Snippets\\List_Table' => $baseDir . '/php/class-list-table.php', … … 30 35 'Code_Snippets\\Php_Snippet_Handler' => $baseDir . '/php/flat-files/handlers/php-snippet-handler.php', 31 36 'Code_Snippets\\Plugin' => $baseDir . '/php/class-plugin.php', 37 'Code_Snippets\\Plugins_Import_Manager' => $baseDir . '/php/migration/importers/plugins/manager.php', 32 38 'Code_Snippets\\REST_API\\Snippets_REST_Controller' => $baseDir . '/php/rest-api/class-snippets-rest-controller.php', 33 39 'Code_Snippets\\Settings\\Setting_Field' => $baseDir . '/php/settings/class-setting-field.php', -
code-snippets/trunk/vendor/composer/autoload_static.php
r3395364 r3441225 49 49 'Code_Snippets\\Export_Attachment' => __DIR__ . '/../..' . '/php/export/class-export-attachment.php', 50 50 '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', 51 52 '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', 52 54 'Code_Snippets\\Html_Snippet_Handler' => __DIR__ . '/../..' . '/php/flat-files/handlers/html-snippet-handler.php', 53 55 'Code_Snippets\\Import' => __DIR__ . '/../..' . '/php/export/class-import.php', 54 56 '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', 55 60 'Code_Snippets\\Licensing' => __DIR__ . '/../..' . '/php/class-licensing.php', 56 61 'Code_Snippets\\List_Table' => __DIR__ . '/../..' . '/php/class-list-table.php', … … 58 63 'Code_Snippets\\Php_Snippet_Handler' => __DIR__ . '/../..' . '/php/flat-files/handlers/php-snippet-handler.php', 59 64 'Code_Snippets\\Plugin' => __DIR__ . '/../..' . '/php/class-plugin.php', 65 'Code_Snippets\\Plugins_Import_Manager' => __DIR__ . '/../..' . '/php/migration/importers/plugins/manager.php', 60 66 'Code_Snippets\\REST_API\\Snippets_REST_Controller' => __DIR__ . '/../..' . '/php/rest-api/class-snippets-rest-controller.php', 61 67 'Code_Snippets\\Settings\\Setting_Field' => __DIR__ . '/../..' . '/php/settings/class-setting-field.php', -
code-snippets/trunk/vendor/composer/installed.php
r3409719 r3441225 2 2 'root' => array( 3 3 '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', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 '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', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.