Changeset 3432115
- Timestamp:
- 01/04/2026 02:04:25 PM (3 months ago)
- Location:
- quick-playground/trunk
- Files:
-
- 6 edited
-
api.php (modified) (1 diff)
-
blueprint-builder.php (modified) (1 diff)
-
makeBlueprintItem.php (modified) (1 diff)
-
quick-playground.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
utility.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
quick-playground/trunk/api.php
r3431953 r3432115 144 144 $clone['post_count'] = count($clone['posts']); 145 145 $clone = qckply_zip_images($profile,$clone); 146 $clone['post_count_with_images'] = count($clone['posts']);146 $clone['post_count_with_images'] = is_array($clone['posts']) ? count($clone['posts']) : 'error'; 147 147 $clone = qckply_posts_related($clone); 148 148 $clone = qckply_get_menu_data($clone); -
quick-playground/trunk/blueprint-builder.php
r3431953 r3432115 180 180 $clone = qckply_zip_images($profile,$clone,true); 181 181 182 printf('<h2>Zip images Test</h2><p>%s</p><pre>%s</pre>',$clone['images_zip'],var_export($clone['added_images'],true));182 printf('<h2>Zip Images Test</h2><p>%s</p><pre>%s</pre><pre>%s</pre>',$clone['images_zip'],var_export($clone['added_images'],true),var_export($clone['not_found'],true)); 183 183 foreach($clone['posts'] as $post) { 184 184 if($post->post_type == 'attachment') 185 185 printf('<h3>Post ID %d: %s</h3><div>%s</div>',intval($post->ID),esc_html($post->post_title),wp_kses_post($post->guid)); 186 186 } 187 188 printf('<p>Quickplay Directories:</p><pre>%s</pre><p>WP Directories</p><pre>%s</pre>',var_export($qckply_directories,true),var_export(wp_get_upload_dir(),true)); 187 189 188 190 echo '</div>'; -
quick-playground/trunk/makeBlueprintItem.php
r3431953 r3432115 56 56 function qckply_makeZipImagesItem($profile) { 57 57 $qckply_directories = qckply_get_directories(); 58 $path = trailingslashit($qckply_directories[' uploads_url']).$profile.'_images.zip';58 $path = trailingslashit($qckply_directories['site_uploads_url']).$profile.'_images.zip'; 59 59 return qckply_makeBlueprintItem('importWordPressFiles', array("wordPressFilesZip"=>array('resource'=>'url','url'=>$path))); 60 60 } -
quick-playground/trunk/quick-playground.php
r3432092 r3432115 4 4 * Plugin URI: https://quickplayground.com 5 5 * Description: Preview your content in different themes or test plugins using WordPress Playground. Quickly create Theme and Plugin demo, testing, and staging websites. 6 * Version: 1.0. 66 * Version: 1.0.7 7 7 * Author: David F. Carr 8 8 * License: GPL2 -
quick-playground/trunk/readme.txt
r3432092 r3432115 9 9 Tested up to: 6.9 10 10 11 Stable tag: 1.0. 611 Stable tag: 1.0.7 12 12 13 13 License: GPLv2 or later … … 97 97 == Changelog == 98 98 99 = 1.0.7 = 100 101 * Fix for zip images function, multisite 102 99 103 = 1.0.4 = 100 104 -
quick-playground/trunk/utility.php
r3431953 r3432115 1046 1046 $qckply_directories = qckply_get_directories(); 1047 1047 $get_all_attachments = get_option('qckply_get_all_attachments',false); 1048 $qckply_uploads = $qckply_directories[' uploads'];1048 $qckply_uploads = $qckply_directories['site_uploads']; 1049 1049 $upload = wp_get_upload_dir(); 1050 1050 $att_ids = []; … … 1130 1130 1131 1131 if ($zip->open($zip_filepath, ZipArchive::CREATE | ZipArchive::OVERWRITE) !== TRUE) { 1132 error_log(sprintf('<p>Zip creation failed for %s</p>',$zip_filepath)); 1132 1133 return false; // Zip file creation failed 1133 1134 } … … 1135 1136 // Add each image file to zip with /wp-content/uploads relative path 1136 1137 $added = []; 1138 $notfound = []; 1137 1139 foreach ($all_images as $file_path) { 1140 if(empty($file_path)) 1141 continue; 1138 1142 if(strpos($file_path,$base_dir) === false) { 1139 1143 $file_path = $base_dir . $file_path; 1140 1144 } 1141 1145 if (!file_exists($file_path) || in_array($file_path, $added)) { 1146 $notfound[] = 'not found '.$file_path; 1142 1147 //if($debug) printf('<p>skipping %s</p>',$file_path); 1143 1148 continue; … … 1150 1155 1151 1156 //if($debug) printf('<p>adding %s</p>',$file_path); 1152 $zip->addFile($file_path, $relative_path); 1157 $result = $zip->addFile($file_path, $relative_path); 1158 if(!$result) 1159 error_log(sprintf('<p>file path %s<br />relative %s<br />%s</p>',$file_path,$relative_path,var_export($result,true))); 1160 1153 1161 } 1154 1162 1155 1163 if (!$zip->close()) { 1164 if (method_exists($zip, 'getStatusString')) error_log('zip status text: ' . $zip->getStatusString()); 1156 1165 return false; // Failed to close zip 1157 1166 } … … 1173 1182 } 1174 1183 $clone['added_images'] = $added; 1184 $clone['not_found'] = $notfound; 1175 1185 $clone['images_zip'] = sprintf( 1176 1186 __('Images zipped successfully! %d files added. Zip file: %s', 'quick-playground'),
Note: See TracChangeset
for help on using the changeset viewer.