Changeset 3685614
- Timestamp:
- 09/07/2026 09:24:00 PM (7 weeks ago)
- Location:
- majed-arabic-demo-content
- Files:
-
- 20 added
- 24 edited
- 1 copied
-
assets/screenshot-1.png (modified) ( previous)
-
assets/screenshot-2.png (modified) ( previous)
-
tags/1.2.0 (copied) (copied from majed-arabic-demo-content/trunk )
-
tags/1.2.0/assets/admin.css (modified) (1 diff)
-
tags/1.2.0/assets/admin.js (modified) (1 diff)
-
tags/1.2.0/data/downloads/en-coffee-pdf.pdf (added)
-
tags/1.2.0/data/downloads/en-fashion-pdf.pdf (added)
-
tags/1.2.0/data/downloads/en-home-pdf.pdf (added)
-
tags/1.2.0/data/downloads/en-stationery-pdf.pdf (added)
-
tags/1.2.0/data/en (added)
-
tags/1.2.0/data/en/article-presets.json (added)
-
tags/1.2.0/data/en/articles.json (added)
-
tags/1.2.0/data/en/download-texts.json (added)
-
tags/1.2.0/data/en/products.json (added)
-
tags/1.2.0/data/en/taxonomies.json (added)
-
tags/1.2.0/includes/class-madc-admin.php (modified) (4 diffs)
-
tags/1.2.0/includes/class-madc-cleanup.php (modified) (3 diffs)
-
tags/1.2.0/includes/class-madc-importer.php (modified) (8 diffs)
-
tags/1.2.0/languages/majed-arabic-demo-content-ar.mo (modified) ( previous)
-
tags/1.2.0/languages/majed-arabic-demo-content-ar.po (modified) (15 diffs)
-
tags/1.2.0/languages/majed-arabic-demo-content.pot (modified) (8 diffs)
-
tags/1.2.0/licenses/THIRD-PARTY-NOTICES.txt (modified) (3 diffs)
-
tags/1.2.0/majed-arabic-demo-content.php (modified) (2 diffs)
-
tags/1.2.0/readme.txt (modified) (8 diffs)
-
trunk/assets/admin.css (modified) (1 diff)
-
trunk/assets/admin.js (modified) (1 diff)
-
trunk/data/downloads/en-coffee-pdf.pdf (added)
-
trunk/data/downloads/en-fashion-pdf.pdf (added)
-
trunk/data/downloads/en-home-pdf.pdf (added)
-
trunk/data/downloads/en-stationery-pdf.pdf (added)
-
trunk/data/en (added)
-
trunk/data/en/article-presets.json (added)
-
trunk/data/en/articles.json (added)
-
trunk/data/en/download-texts.json (added)
-
trunk/data/en/products.json (added)
-
trunk/data/en/taxonomies.json (added)
-
trunk/includes/class-madc-admin.php (modified) (4 diffs)
-
trunk/includes/class-madc-cleanup.php (modified) (3 diffs)
-
trunk/includes/class-madc-importer.php (modified) (8 diffs)
-
trunk/languages/majed-arabic-demo-content-ar.mo (modified) ( previous)
-
trunk/languages/majed-arabic-demo-content-ar.po (modified) (15 diffs)
-
trunk/languages/majed-arabic-demo-content.pot (modified) (8 diffs)
-
trunk/licenses/THIRD-PARTY-NOTICES.txt (modified) (3 diffs)
-
trunk/majed-arabic-demo-content.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
majed-arabic-demo-content/tags/1.2.0/assets/admin.css
r3685065 r3685614 67 67 .madc-support-card{border:1px solid #fdba74}.madc-support-button.button{border-radius:10px;font-weight:700;white-space:nowrap}@media(max-width:640px){.madc-support-card{flex-direction:column;align-items:stretch;gap:18px}.madc-support-button.button{width:100%}} 68 68 .madc-cleanup{margin-block-start:24px;border-color:#fecaca}.madc-admin .madc-danger{border:1px solid #dc2626;color:#b91c1c;background:#fff;border-radius:10px;padding:7px 18px;font-weight:600}.madc-admin .madc-danger:hover{background:#fef2f2}.madc-admin #madc-cleanup-progress{margin-block-start:18px}.madc-admin #madc-refresh{max-inline-size:800px} 69 .madc-admin #madc-language{min-width:180px;min-height:42px;border:1px solid #e2e8f0;border-radius:10px;padding-inline:12px;background-color:#fff;color:#0f172a} -
majed-arabic-demo-content/tags/1.2.0/assets/admin.js
r3685065 r3685614 28 28 event.preventDefault(); 29 29 if (running) return; 30 const payload = { kind: form.elements.kind.value, quantity: Number(form.elements.quantity.value), status: form.elements.status.value, refresh: form.elements.refresh.checked};30 const payload = {language: form.elements.language.value, kind: form.elements.kind.value, quantity: Number(form.elements.quantity.value), status: form.elements.status.value, refresh: form.elements.refresh.checked}; 31 31 const result = document.querySelector('#madc-result'); 32 32 const progress = document.querySelector('#madc-progress'); -
majed-arabic-demo-content/tags/1.2.0/includes/class-madc-admin.php
r3685065 r3685614 21 21 'cleanupFailed' => __( 'Cleanup stopped. Retry to continue.', 'majed-arabic-demo-content' ), 22 22 'deleted' => __( 'Deleted', 'majed-arabic-demo-content' ), 'kept' => __( 'Kept for safety or permissions', 'majed-arabic-demo-content' ), 23 'cleanupConfirm' => __( 'Permanently delete the following imported demo items ? This includes edits made to demo posts and products. Shared media and used categories are kept. This cannot be undone.', 'majed-arabic-demo-content' ),23 'cleanupConfirm' => __( 'Permanently delete the following imported demo items in both languages? This includes edits made to demo posts and products. Shared media and used categories are kept. This cannot be undone.', 'majed-arabic-demo-content' ), 24 24 'nothing' => __( 'There is no tracked demo content to delete.', 'majed-arabic-demo-content' ), 25 25 'cleanupLabels' => array( 'post' => __( 'Articles', 'majed-arabic-demo-content' ), 'product' => __( 'Products', 'majed-arabic-demo-content' ), 'product_variation' => __( 'Variations', 'majed-arabic-demo-content' ), 'attachment' => __( 'Images', 'majed-arabic-demo-content' ), 'term' => __( 'Categories and tags', 'majed-arabic-demo-content' ), 'download' => __( 'PDF files', 'majed-arabic-demo-content' ) ), … … 41 41 register_rest_route( 'madc/v1', '/import', array( 'methods' => 'POST', 'callback' => array( $this, 'step' ), 'permission_callback' => static function () { return current_user_can( 'manage_options' ); }, 'args' => array( 42 42 'kind' => array( 'required' => true, 'type' => 'string', 'enum' => array( 'posts', 'products' ) ), 43 'language' => array( 'type' => 'string', 'enum' => array( 'ar', 'en' ), 'default' => 'ar' ), 43 44 'refresh' => array( 'type' => 'boolean', 'default' => false ), 44 45 'quantity' => array( 'required' => true, 'type' => 'integer', 'enum' => array( 12, 24 ) ), … … 66 67 return new WP_Error( 'madc_permission', __( 'You cannot import this content. Products require WooCommerce and the appropriate permissions.', 'majed-arabic-demo-content' ), array( 'status' => 403 ) ); 67 68 } 68 $items = MADC_Importer::items( $kind, (int) $request['quantity'] );69 $items = MADC_Importer::items( $kind, (int) $request['quantity'], $request['language'] ); 69 70 $index = (int) $request['index']; 70 71 if ( ! isset( $items[ $index ] ) ) { return new WP_Error( 'madc_index', __( 'Invalid import item.', 'majed-arabic-demo-content' ), array( 'status' => 400 ) ); } … … 95 96 ?> 96 97 <div class="wrap madc-admin" dir="<?php echo is_rtl() ? 'rtl' : 'ltr'; ?>"><div class="madc-shell"> 97 <header class="madc-header"><span class="madc-mark dashicons dashicons-welcome-write-blog" aria-hidden="true"></span><div><span class="madc-eyebrow">Majed <span class="madc-badge">v<?php echo esc_html( MADC_VERSION ); ?></span></span><h1><?php esc_html_e( 'Arabic Demo Content', 'majed-arabic-demo-content' ); ?></h1><p><?php esc_html_e( 'Build a realistic demo with ready-made Arabic content.', 'majed-arabic-demo-content' ); ?></p></div></header><hr class="wp-header-end">98 <div class="madc-summary"><span><?php esc_html_e( '24 articles ', 'majed-arabic-demo-content' ); ?></span><span><?php esc_html_e( '28 products', 'majed-arabic-demo-content' ); ?></span><span><?php esc_html_e( '60 product images', 'majed-arabic-demo-content' ); ?></span><span><?php esc_html_e( 'Works offline', 'majed-arabic-demo-content' ); ?></span></div>98 <header class="madc-header"><span class="madc-mark dashicons dashicons-welcome-write-blog" aria-hidden="true"></span><div><span class="madc-eyebrow">Majed <span class="madc-badge">v<?php echo esc_html( MADC_VERSION ); ?></span></span><h1><?php esc_html_e( 'Arabic Demo Content', 'majed-arabic-demo-content' ); ?></h1><p><?php esc_html_e( 'Build a realistic demo with ready-made Arabic or English content.', 'majed-arabic-demo-content' ); ?></p></div></header><hr class="wp-header-end"> 99 <div class="madc-summary"><span><?php esc_html_e( '24 articles per language', 'majed-arabic-demo-content' ); ?></span><span><?php esc_html_e( '28 products per language', 'majed-arabic-demo-content' ); ?></span><span><?php esc_html_e( '60 product images', 'majed-arabic-demo-content' ); ?></span><span><?php esc_html_e( 'Works offline', 'majed-arabic-demo-content' ); ?></span></div> 99 100 <form id="madc-form"><fieldset id="madc-controls"><legend class="screen-reader-text"><?php esc_html_e( 'Import settings', 'majed-arabic-demo-content' ); ?></legend> 100 <div class="madc-grid"><label class="madc-card madc-choice"><input type="radio" name="kind" value="posts" checked><span class="dashicons dashicons-admin-post" aria-hidden="true"></span><strong><?php esc_html_e( 'Articles', 'majed-arabic-demo-content' ); ?></strong><span><?php esc_html_e( 'Expanded Arabic articles with featured images, categories, tags, and excerpts. Images are reused from the product library.', 'majed-arabic-demo-content' ); ?></span></label> 101 <section class="madc-card"><h2><label for="madc-language"><?php esc_html_e( 'Demo content language', 'majed-arabic-demo-content' ); ?></label></h2><select id="madc-language" name="language"><option value="ar"><?php esc_html_e( 'Arabic', 'majed-arabic-demo-content' ); ?></option><option value="en"><?php esc_html_e( 'English', 'majed-arabic-demo-content' ); ?></option></select><p class="madc-muted"><?php esc_html_e( 'Choose the language of imported content. The admin interface keeps your WordPress user language.', 'majed-arabic-demo-content' ); ?></p></section> 102 <div class="madc-grid"><label class="madc-card madc-choice"><input type="radio" name="kind" value="posts" checked><span class="dashicons dashicons-admin-post" aria-hidden="true"></span><strong><?php esc_html_e( 'Articles', 'majed-arabic-demo-content' ); ?></strong><span><?php esc_html_e( 'Expanded articles in your selected language with featured images, categories, tags, and excerpts. Images come from the bundled product library.', 'majed-arabic-demo-content' ); ?></span></label> 101 103 <label class="madc-card madc-choice"><input type="radio" name="kind" value="products" <?php disabled( ! class_exists( 'WooCommerce' ) ); ?>><span class="dashicons dashicons-cart" aria-hidden="true"></span><strong><?php esc_html_e( 'WooCommerce products', 'majed-arabic-demo-content' ); ?></strong><span><?php esc_html_e( 'Simple, variable, grouped, digital, and service products with dedicated images and PDF downloads.', 'majed-arabic-demo-content' ); ?></span><?php if ( ! class_exists( 'WooCommerce' ) ) : ?><small><?php esc_html_e( 'Activate WooCommerce to import products.', 'majed-arabic-demo-content' ); ?></small><?php endif; ?></label></div> 102 104 <section class="madc-card"><h2><?php esc_html_e( 'Customize your import', 'majed-arabic-demo-content' ); ?></h2><div class="madc-fields"><div id="madc-quantity"><label for="quantity"><?php esc_html_e( 'Number of articles', 'majed-arabic-demo-content' ); ?></label><select id="quantity" name="quantity"><option value="12">12</option><option value="24">24</option></select></div><div><label for="madc-status"><?php esc_html_e( 'Content status', 'majed-arabic-demo-content' ); ?></label><select name="status" id="madc-status"><option value="draft"><?php esc_html_e( 'Draft — review before publishing', 'majed-arabic-demo-content' ); ?></option><option value="publish"><?php esc_html_e( 'Published — visible immediately', 'majed-arabic-demo-content' ); ?></option></select></div></div> 103 105 <p id="madc-refresh"><label><input type="checkbox" name="refresh" value="1"> <?php esc_html_e( 'Replace text and featured images of previously imported articles. Existing titles and publication status are preserved.', 'majed-arabic-demo-content' ); ?></label></p> 104 <p class="madc-muted"><?php esc_html_e( ' Content stays Arabic in either interface language. Existing imports are skipped unless article updates are selected. Items in the trash are alwaysskipped. Prices use your store currency.', 'majed-arabic-demo-content' ); ?></p>106 <p class="madc-muted"><?php esc_html_e( 'Arabic and English content can coexist. Existing imports in the selected language are skipped unless article updates are selected. Trashed items are skipped. Prices use your store currency.', 'majed-arabic-demo-content' ); ?></p> 105 107 <button type="submit" class="button button-primary"><?php esc_html_e( 'Import demo content', 'majed-arabic-demo-content' ); ?></button></section></fieldset></form> 106 108 <section class="madc-card" id="madc-progress-panel" hidden><h2><?php esc_html_e( 'Import progress', 'majed-arabic-demo-content' ); ?></h2><progress id="madc-progress" max="100" value="0" aria-label="<?php esc_attr_e( 'Import progress', 'majed-arabic-demo-content' ); ?>"></progress><p id="madc-result" role="status" aria-live="polite"></p><p id="madc-item" dir="auto"></p></section> 107 <section class="madc-card madc-cleanup" aria-labelledby="madc-cleanup-title"><h2 id="madc-cleanup-title"><?php esc_html_e( 'Finished building your demo?', 'majed-arabic-demo-content' ); ?></h2><p><?php esc_html_e( 'Delete all tracked demo articles, products, variations, images, PDFs, and unused categories created by this plugin. Deletion is permanent, including anyedits you made to these demo items.', 'majed-arabic-demo-content' ); ?></p><p class="madc-muted"><?php esc_html_e( 'Other content is kept. Media referenced by remaining content and categories still in use are retained. Categories from versions before 1.1.0 are retained because their original ownership was not recorded.', 'majed-arabic-demo-content' ); ?></p><button type="button" id="madc-cleanup-button" class="button madc-danger"><?php esc_html_e( 'Delete imported demo content', 'majed-arabic-demo-content' ); ?></button><div id="madc-cleanup-progress" hidden><progress id="madc-cleanup-bar" value="0" max="100" aria-label="<?php esc_attr_e( 'Cleanup progress', 'majed-arabic-demo-content' ); ?>"></progress><p id="madc-cleanup-result" role="status" aria-live="polite"></p></div></section>109 <section class="madc-card madc-cleanup" aria-labelledby="madc-cleanup-title"><h2 id="madc-cleanup-title"><?php esc_html_e( 'Finished building your demo?', 'majed-arabic-demo-content' ); ?></h2><p><?php esc_html_e( 'Delete all tracked demo articles, products, variations, images, PDFs, and unused categories in both languages. Deletion is permanent, including edits you made to these demo items.', 'majed-arabic-demo-content' ); ?></p><p class="madc-muted"><?php esc_html_e( 'Other content is kept. Media referenced by remaining content and categories still in use are retained. Categories from versions before 1.1.0 are retained because their original ownership was not recorded.', 'majed-arabic-demo-content' ); ?></p><button type="button" id="madc-cleanup-button" class="button madc-danger"><?php esc_html_e( 'Delete imported demo content', 'majed-arabic-demo-content' ); ?></button><div id="madc-cleanup-progress" hidden><progress id="madc-cleanup-bar" value="0" max="100" aria-label="<?php esc_attr_e( 'Cleanup progress', 'majed-arabic-demo-content' ); ?>"></progress><p id="madc-cleanup-result" role="status" aria-live="polite"></p></div></section> 108 110 <footer class="madc-muted"><?php esc_html_e( 'By Majed Bannani. Imported content and media remain available when the plugin is deactivated or removed.', 'majed-arabic-demo-content' ); ?></footer> 109 111 <aside class="madc-support-card" aria-labelledby="madc-support-title"><div class="madc-support-copy"><h2 id="madc-support-title"><?php esc_html_e( 'Made with care, sustained by your support', 'majed-arabic-demo-content' ); ?> <span class="madc-support-heart" aria-hidden="true">♥</span></h2><p><?php esc_html_e( 'This plugin is free and grows with the support of its users. If it has helped you manage your site, you can contribute to its continued development and new tools.', 'majed-arabic-demo-content' ); ?></p></div><a class="button madc-support-button" href="https://www.paypal.com/ncp/payment/2C3DDKHKMPMLC" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Support via PayPal', 'majed-arabic-demo-content' ); ?></a></aside></div></div> -
majed-arabic-demo-content/tags/1.2.0/includes/class-madc-cleanup.php
r3685065 r3685614 11 11 12 12 private static function owned_posts() { 13 $allowed = array( 'post' => array_column( MADC_Importer::data( 'articles'), 'id' ), 'product' => array(), 'product_variation' => array(), 'attachment' => array() );14 foreach ( MADC_Importer::data( 'products') as $p ) {13 $allowed = array( 'post' => array_column( array_merge( MADC_Importer::data( 'articles' ), MADC_Importer::data( 'articles', 'en' ) ), 'id' ), 'product' => array(), 'product_variation' => array(), 'attachment' => array() ); 14 foreach ( array_merge( MADC_Importer::data( 'products' ), MADC_Importer::data( 'products', 'en' ) ) as $p ) { 15 15 $allowed['product'][] = $p['id']; 16 16 foreach ( $p['variations'] ?? array() as $v ) { $allowed['product_variation'][] = $v['id']; } 17 17 } 18 foreach ( glob( MADC_PATH . 'data/images/*.webp' ) as $image ) { $allowed['attachment'][] = 'media:' . basename( $image ); }18 foreach ( glob( MADC_PATH . 'data/images/*.webp' ) as $image ) { $allowed['attachment'][] = 'media:' . basename( $image ); $allowed['attachment'][] = 'en:media:' . basename( $image ); } 19 19 $items = array(); 20 20 // A fixed bundled catalog limits which ownership markers are accepted, including older releases. … … 49 49 foreach ( $terms as $id ) { $items[] = array( 'kind' => 'term', 'id' => (int) $id, 'taxonomy' => $taxonomy ); } 50 50 } 51 foreach ( MADC_Importer::data( 'download-texts') as $download ) {51 foreach ( array_merge( MADC_Importer::data( 'download-texts' ), MADC_Importer::data( 'download-texts', 'en' ) ) as $download ) { 52 52 if ( get_option( 'madc_download_' . $download['id'] ) ) { $items[] = array( 'kind' => 'download', 'key' => $download['id'] ); } 53 53 } … … 88 88 $values = $wpdb->get_col( $wpdb->prepare( "SELECT pm.meta_value FROM {$wpdb->postmeta} pm INNER JOIN {$wpdb->posts} p ON p.ID = pm.post_id WHERE pm.post_id <> %d AND pm.meta_key NOT IN ('_edit_last','_edit_lock','_price','_regular_price','_sale_price','_stock','_wp_attachment_metadata','_wp_attached_file','_wp_attachment_image_alt') AND pm.meta_key NOT LIKE %s AND pm.meta_value REGEXP %s", $id, $wpdb->esc_like( '_madc_' ) . '%', $pattern ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- Prepared read-only cross-content reference check immediately before deletion; no equivalent core API, and cached results could delete newly shared media. 89 89 foreach ( $values as $value ) { if ( self::contains_id( $value, $id ) ) { return true; } } 90 $options = $wpdb->get_col( $wpdb->prepare( "SELECT option_value FROM {$wpdb->options} WHERE option_name NOT LIKE %s AND option_name NOT REGEXP '(size_[wh]$|image_width$|image_height$)' AND option_value REGEXP %s", 'madc' . '%', $pattern ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- Prepared read-only cross-content reference check immediately before deletion; no equivalent core API, and cached results could delete newly shared media.90 $options = $wpdb->get_col( $wpdb->prepare( "SELECT option_value FROM {$wpdb->options} WHERE option_name NOT LIKE %s AND option_name NOT IN ('comments_per_page','close_comments_days_old','woocommerce_schema_version') AND option_name NOT REGEXP '^_site_transient_wp_theme_files_patterns-' AND option_name NOT REGEXP '(size_[wh]$|image_width$|image_height$)' AND option_value REGEXP %s", 'madc' . '%', $pattern ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- Prepared read-only cross-content reference check immediately before deletion; no equivalent core API, and cached results could delete newly shared media. 91 91 foreach ( $options as $value ) { if ( self::contains_id( $value, $id ) ) { return true; } } 92 92 $block = '%"id":' . absint( $id ) . '%'; -
majed-arabic-demo-content/tags/1.2.0/includes/class-madc-importer.php
r3685065 r3685614 3 3 4 4 final class MADC_Importer { 5 public static function data( $name ) {6 return json_decode( file_get_contents( MADC_PATH . 'data/' . $name . '.json' ), true );5 public static function data( $name, $language = 'ar' ) { 6 return json_decode( file_get_contents( MADC_PATH . 'data/' . ( 'en' === $language ? 'en/' : '' ) . $name . '.json' ), true ); 7 7 } 8 public static function items( $kind, $quantity ) {8 public static function items( $kind, $quantity, $language = 'ar' ) { 9 9 if ( 'posts' === $kind ) { 10 $presets = self::data( 'article-presets' );10 $presets = self::data( 'article-presets', $language ); 11 11 $ids = $presets['options'][ 24 === $quantity ? 1 : 0 ]['article_ids']; 12 return array_values( array_filter( self::data( 'articles' ), static function ( $a ) use ( $ids ) { return in_array( $a['id'], $ids, true ); } ) );12 return array_values( array_filter( self::data( 'articles', $language ), static function ( $a ) use ( $ids ) { return in_array( $a['id'], $ids, true ); } ) ); 13 13 } 14 $products = self::data( 'products' );14 $products = self::data( 'products', $language ); 15 15 usort( $products, static function ( $a, $b ) { return (int) ( 'grouped' === $a['type'] ) <=> (int) ( 'grouped' === $b['type'] ); } ); 16 16 return $products; … … 24 24 return $result; 25 25 } 26 private static function terms( $ids, $taxonomy ) {27 $data = self::data( 'taxonomies' );26 private static function terms( $ids, $taxonomy, $language ) { 27 $data = self::data( 'taxonomies', $language ); 28 28 $out = array(); 29 29 foreach ( array_merge( $data['categories'], $data['tags'] ) as $term ) { … … 38 38 return $out; 39 39 } 40 private static function media( $path, $alt, $parent ) {41 $key = 'media:' . basename( $path );40 private static function media( $path, $alt, $parent, $language ) { 41 $key = ( 'en' === $language ? 'en:' : '' ) . 'media:' . basename( $path ); 42 42 $id = self::existing( $key, 'attachment' ); 43 43 if ( $id && is_file( (string) get_attached_file( $id ) ) ) { return $id; } … … 65 65 } 66 66 public static function run( $kind, $item, $status, $refresh = false ) { 67 $language = isset( $item['language'] ) && 'en' === $item['language'] ? 'en' : 'ar'; 67 68 $type = 'posts' === $kind ? 'post' : 'product'; 68 69 $id = self::existing( $item['id'], $type ); … … 78 79 self::checked( wp_update_post( array( 'ID' => $id, 'post_content' => wp_kses_post( $item['content_html'] ), 'post_excerpt' => $item['excerpt'] ), true ) ); 79 80 } 80 $image_id = self::media( $item['image_path'], $item['image_text']['alt'], $id );81 $image_id = self::media( $item['image_path'], $item['image_text']['alt'], $id, $language ); 81 82 set_post_thumbnail( $id, $image_id ); 82 83 if ( (int) get_post_thumbnail_id( $id ) !== (int) $image_id ) { throw new RuntimeException( esc_html__( 'The featured image could not be assigned.', 'majed-arabic-demo-content' ) ); } 83 update_post_meta( $id, '_madc_content_version', '1. 1.0' );84 update_post_meta( $id, '_madc_content_version', '1.2.0' ); 84 85 if ( ! $updating ) { 85 self::checked( wp_set_object_terms( $id, self::terms( $item['category_ids'], 'category' ), 'category' ) );86 self::checked( wp_set_object_terms( $id, self::terms( $item['tag_ids'], 'post_tag' ), 'post_tag' ) );86 self::checked( wp_set_object_terms( $id, self::terms( $item['category_ids'], 'category', $language ), 'category' ) ); 87 self::checked( wp_set_object_terms( $id, self::terms( $item['tag_ids'], 'post_tag', $language ), 'post_tag' ) ); 87 88 self::checked( wp_update_post( array( 'ID' => $id, 'post_status' => $status ), true ) ); 88 89 } … … 103 104 $p->set_virtual( $item['virtual'] ); 104 105 $p->set_downloadable( $item['downloadable'] ); 105 $p->set_category_ids( self::terms( $item['category_ids'], 'product_cat' ) );106 $p->set_tag_ids( self::terms( $item['tag_ids'], 'product_tag' ) );106 $p->set_category_ids( self::terms( $item['category_ids'], 'product_cat', $language ) ); 107 $p->set_tag_ids( self::terms( $item['tag_ids'], 'product_tag', $language ) ); 107 108 if ( isset( $item['regular_price'] ) ) { $p->set_regular_price( (string) $item['regular_price'] ); } 108 109 if ( isset( $item['stock_quantity'] ) ) { … … 110 111 $p->set_stock_status( $item['stock_quantity'] > 0 ? 'instock' : 'outofstock' ); 111 112 } 112 $p->set_image_id( self::media( $item['image_path'], $item['image_text']['alt'], $id ) );113 $p->set_image_id( self::media( $item['image_path'], $item['image_text']['alt'], $id, $language ) ); 113 114 $gallery = array(); 114 foreach ( $item['gallery_image_paths'] as $path ) { $gallery[] = self::media( $path, $item['name'], $id ); }115 foreach ( $item['gallery_image_paths'] as $path ) { $gallery[] = self::media( $path, $item['name'], $id, $language ); } 115 116 $p->set_gallery_image_ids( $gallery ); 116 117 if ( $item['downloadable'] ) { … … 145 146 $variation->set_description( $v['description'] ); $variation->set_status( 'publish' ); 146 147 $variation->set_sku( 'MADC-' . strtoupper( $v['id'] ) . '-' . $id ); 147 $variation->set_image_id( self::media( $v['image_path'], $v['image_alt'], $id ) );148 $variation->set_image_id( self::media( $v['image_path'], $v['image_alt'], $id, $language ) ); 148 149 $variation->update_meta_data( '_madc_key', $v['id'] ); $variation->save(); 149 150 } -
majed-arabic-demo-content/tags/1.2.0/languages/majed-arabic-demo-content-ar.po
r3685065 r3685614 2 2 msgid "" 3 3 msgstr "" 4 "Project-Id-Version: Majed Arabic Demo Content 1. 1.2\n"4 "Project-Id-Version: Majed Arabic Demo Content 1.2.0\n" 5 5 "Last-Translator: Majed Bannani\n" 6 6 "Language-Team: Arabic\n" … … 11 11 "Plural-Forms: nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5);\n" 12 12 13 #. Plugin Name of the plugin 13 14 #: majed-arabic-demo-content.php 14 15 msgid "Majed Arabic Demo Content" 15 16 msgstr "محتوى عربي تجريبي من ماجد" 16 17 18 #. Description of the plugin 17 19 #: majed-arabic-demo-content.php 18 20 msgid "" 19 "Import ready-made Arabic articles and WooCommerce demo products with local " 20 "images and downloads." 21 msgstr "" 22 "استورد مقالات عربية ومنتجات ووكومرس تجريبية جاهزة مع صور وملفات تنزيل محلية." 23 21 "Import ready-made Arabic or English articles and WooCommerce demo products " 22 "with local images and downloads." 23 msgstr "" 24 "استورد مقالات جاهزة بالعربية أو الإنجليزية ومنتجات ووكومرس تجريبية مع صور " 25 "وملفات تنزيل محلية." 26 27 #. Author of the plugin 24 28 #: majed-arabic-demo-content.php 25 29 msgid "Majed Bannani" 26 30 msgstr "ماجد بناني" 27 31 32 #. Author URI of the plugin 28 33 #: majed-arabic-demo-content.php 29 34 msgid "https://profiles.wordpress.org/majedbannani/" 30 35 msgstr "https://profiles.wordpress.org/majedbannani/" 31 36 32 #: includes/class-madc-admin.php:10 includes/class-madc-admin.php: 8837 #: includes/class-madc-admin.php:10 includes/class-madc-admin.php:98 33 38 msgid "Arabic Demo Content" 34 39 msgstr "محتوى عربي تجريبي" … … 60 65 #: includes/class-madc-admin.php:23 61 66 msgid "" 62 "Permanently delete the following imported demo items ? This includes edits"63 " made to demo posts and products. Shared media and used categories are kept."64 " This cannot be undone."65 msgstr "" 66 "هل تريد حذف العناصر التجريبية ال تالية نهائيًا؟ يشمل ذلك التعديلات التي"67 " أجريتها علىالمقالات والمنتجات التجريبية. تُحفظ الوسائط المشتركة والتصنيفات "68 "المستخدمة. لا يمكن التراجع عن هذاالحذف."67 "Permanently delete the following imported demo items in both languages? This" 68 " includes edits made to demo posts and products. Shared media and used " 69 "categories are kept. This cannot be undone." 70 msgstr "" 71 "هل تريد حذف العناصر التجريبية المستوردة التالية باللغتين نهائيًا؟ يشمل ذلك " 72 "تعديلات المقالات والمنتجات التجريبية. تُحفظ الوسائط المشتركة والتصنيفات " 73 "المستخدمة. لا يمكن التراجع عن الحذف." 69 74 70 75 #: includes/class-madc-admin.php:24 … … 72 77 msgstr "لا يوجد محتوى تجريبي مسجّل لحذفه." 73 78 74 #: includes/class-madc-admin.php:25 includes/class-madc-admin.php: 9179 #: includes/class-madc-admin.php:25 includes/class-madc-admin.php:102 75 80 msgid "Articles" 76 81 msgstr "المقالات" … … 116 121 msgstr "مستورد مسبقًا" 117 122 118 #: includes/class-madc-admin.php:5 2 includes/class-madc-admin.php:74123 #: includes/class-madc-admin.php:53 includes/class-madc-admin.php:75 119 124 msgid "Another import is running. Please retry shortly." 120 125 msgstr "توجد عملية استيراد قيد التنفيذ. أعد المحاولة بعد قليل." 121 126 122 #: includes/class-madc-admin.php:5 8127 #: includes/class-madc-admin.php:59 123 128 msgid "" 124 129 "Cleanup could not finish. Check file permissions and ensure WooCommerce is " … … 127 132 "تعذر إكمال الحذف. تحقق من صلاحيات الملفات وتفعيل ووكومرس، ثم أعد المحاولة." 128 133 129 #: includes/class-madc-admin.php:6 3134 #: includes/class-madc-admin.php:64 130 135 msgid "Finish the current cleanup before importing content." 131 136 msgstr "أكمل عملية الحذف الحالية قبل استيراد المحتوى." 132 137 133 #: includes/class-madc-admin.php:6 6138 #: includes/class-madc-admin.php:67 134 139 msgid "" 135 140 "You cannot import this content. Products require WooCommerce and the " … … 139 144 "المناسبة." 140 145 141 #: includes/class-madc-admin.php:7 0146 #: includes/class-madc-admin.php:71 142 147 msgid "Invalid import item." 143 148 msgstr "عنصر الاستيراد غير صالح." 144 149 145 #: includes/class-madc-admin.php:8 1150 #: includes/class-madc-admin.php:82 146 151 msgid "" 147 152 "Import failed. Check upload permissions, available storage, and any trashed " … … 151 156 "التجريبية في سلة المهملات، ثم أعد المحاولة." 152 157 153 #: includes/class-madc-admin.php: 88154 msgid "Build a realistic demo with ready-made Arabic content."155 msgstr "جهّز موقعك التجريبي بمحتوى عربي جاهز ومنوّع."156 157 #: includes/class-madc-admin.php: 89158 msgid "24 articles "159 msgstr "٢٤ مقالة "160 161 #: includes/class-madc-admin.php: 89162 msgid "28 products "163 msgstr "٢٨ منتجًا "164 165 #: includes/class-madc-admin.php: 89158 #: includes/class-madc-admin.php:98 159 msgid "Build a realistic demo with ready-made Arabic or English content." 160 msgstr "جهّز موقعك التجريبي بمحتوى جاهز بالعربية أو الإنجليزية." 161 162 #: includes/class-madc-admin.php:99 163 msgid "24 articles per language" 164 msgstr "٢٤ مقالة لكل لغة" 165 166 #: includes/class-madc-admin.php:99 167 msgid "28 products per language" 168 msgstr "٢٨ منتجًا لكل لغة" 169 170 #: includes/class-madc-admin.php:99 166 171 msgid "60 product images" 167 172 msgstr "٦٠ صورة للمنتجات" 168 173 169 #: includes/class-madc-admin.php: 89174 #: includes/class-madc-admin.php:99 170 175 msgid "Works offline" 171 176 msgstr "يعمل دون اتصال خارجي" 172 177 173 #: includes/class-madc-admin.php: 90178 #: includes/class-madc-admin.php:100 174 179 msgid "Import settings" 175 180 msgstr "إعدادات الاستيراد" 176 181 177 #: includes/class-madc-admin.php:91 178 msgid "" 179 "Expanded Arabic articles with featured images, categories, tags, and " 180 "excerpts. Images are reused from the product library." 181 msgstr "" 182 "مقالات عربية موسّعة مع صور بارزة وتصنيفات ووسوم ومقتطفات. الصور معاد " 183 "استخدامها من مكتبة المنتجات." 184 185 #: includes/class-madc-admin.php:92 182 #: includes/class-madc-admin.php:101 183 msgid "Demo content language" 184 msgstr "لغة المحتوى التجريبي" 185 186 #: includes/class-madc-admin.php:101 187 msgid "Arabic" 188 msgstr "العربية" 189 190 #: includes/class-madc-admin.php:101 191 msgid "English" 192 msgstr "الإنجليزية" 193 194 #: includes/class-madc-admin.php:101 195 msgid "" 196 "Choose the language of imported content. The admin interface keeps your " 197 "WordPress user language." 198 msgstr "اختر لغة المحتوى المستورد. تبقى لغة الواجهة حسب لغة مستخدم ووردبريس." 199 200 #: includes/class-madc-admin.php:102 201 msgid "" 202 "Expanded articles in your selected language with featured images, " 203 "categories, tags, and excerpts. Images come from the bundled product " 204 "library." 205 msgstr "" 206 "مقالات موسّعة باللغة المختارة مع صور بارزة وتصنيفات ووسوم ومقتطفات. الصور من" 207 " مكتبة المنتجات المرفقة." 208 209 #: includes/class-madc-admin.php:103 186 210 msgid "WooCommerce products" 187 211 msgstr "منتجات ووكومرس" 188 212 189 #: includes/class-madc-admin.php: 92213 #: includes/class-madc-admin.php:103 190 214 msgid "" 191 215 "Simple, variable, grouped, digital, and service products with dedicated " … … 194 218 "منتجات بسيطة ومتغيرة ومجمّعة ورقمية وخدمات، مع صور خاصة وملفات PDF للتنزيل." 195 219 196 #: includes/class-madc-admin.php: 92220 #: includes/class-madc-admin.php:103 197 221 msgid "Activate WooCommerce to import products." 198 222 msgstr "فعّل ووكومرس لاستيراد المنتجات." 199 223 200 #: includes/class-madc-admin.php: 93224 #: includes/class-madc-admin.php:104 201 225 msgid "Customize your import" 202 226 msgstr "خصّص عملية الاستيراد" 203 227 204 #: includes/class-madc-admin.php: 93228 #: includes/class-madc-admin.php:104 205 229 msgid "Number of articles" 206 230 msgstr "عدد المقالات" 207 231 208 #: includes/class-madc-admin.php: 93232 #: includes/class-madc-admin.php:104 209 233 msgid "Content status" 210 234 msgstr "حالة المحتوى" 211 235 212 #: includes/class-madc-admin.php: 93236 #: includes/class-madc-admin.php:104 213 237 msgid "Draft — review before publishing" 214 238 msgstr "مسودة — راجع المحتوى قبل النشر" 215 239 216 #: includes/class-madc-admin.php: 93240 #: includes/class-madc-admin.php:104 217 241 msgid "Published — visible immediately" 218 242 msgstr "منشور — يظهر مباشرة" 219 243 220 #: includes/class-madc-admin.php: 94244 #: includes/class-madc-admin.php:105 221 245 msgid "" 222 246 "Replace text and featured images of previously imported articles. Existing " … … 226 250 "بالعناوين وحالة النشر الحالية." 227 251 228 #: includes/class-madc-admin.php: 95229 msgid "" 230 " Content stays Arabic in either interface language. Existing imports are"231 " skipped unless article updates are selected. Items in the trash are always"252 #: includes/class-madc-admin.php:106 253 msgid "" 254 "Arabic and English content can coexist. Existing imports in the selected " 255 "language are skipped unless article updates are selected. Trashed items are " 232 256 "skipped. Prices use your store currency." 233 257 msgstr "" 234 "يبقى المحتوى عربيًا في الواجهتين. يُتجاوز المحتوى الموجود ما لم تختر تحديث " 235 "المقالات. تُتجاوز عناصر سلة المهملات دائمًا. الأسعار بعملة متجرك." 236 237 #: includes/class-madc-admin.php:96 258 "يمكن استيراد المحتوى العربي والإنجليزي معًا. يُتجاوز المحتوى الموجود باللغة " 259 "المختارة ما لم تختر تحديث المقالات، وتُتجاوز عناصر سلة المهملات. الأسعار " 260 "بعملة متجرك." 261 262 #: includes/class-madc-admin.php:107 238 263 msgid "Import demo content" 239 264 msgstr "استيراد المحتوى التجريبي" 240 265 241 #: includes/class-madc-admin.php: 97266 #: includes/class-madc-admin.php:108 242 267 msgid "Import progress" 243 268 msgstr "تقدم الاستيراد" 244 269 245 #: includes/class-madc-admin.php: 98270 #: includes/class-madc-admin.php:109 246 271 msgid "Finished building your demo?" 247 272 msgstr "انتهيت من تطوير موقعك التجريبي؟" 248 273 249 #: includes/class-madc-admin.php: 98274 #: includes/class-madc-admin.php:109 250 275 msgid "" 251 276 "Delete all tracked demo articles, products, variations, images, PDFs, and " 252 "unused categories created by this plugin. Deletion is permanent, including"253 " any editsyou made to these demo items."254 msgstr "" 255 "احذف المقالات والمنتجات والمتغيرات والصور وملفات PDF والتصنيفات غير "256 "المستخدمة التي أنشأتها الإضافة وسجّلتها. الحذف نهائي ويشمل التعديلات التي"257 " أجريتها على هذهالعناصر التجريبية."258 259 #: includes/class-madc-admin.php: 98277 "unused categories in both languages. Deletion is permanent, including edits " 278 "you made to these demo items." 279 msgstr "" 280 "احذف جميع المقالات والمنتجات والمتغيرات والصور وملفات PDF والتصنيفات غير " 281 "المستخدمة التي تتعقبها الإضافة باللغتين. الحذف نهائي ويشمل تعديلاتك على هذه " 282 "العناصر التجريبية." 283 284 #: includes/class-madc-admin.php:109 260 285 msgid "" 261 286 "Other content is kept. Media referenced by remaining content and categories " … … 267 292 " تكن مسجّلة." 268 293 269 #: includes/class-madc-admin.php: 98294 #: includes/class-madc-admin.php:109 270 295 msgid "Delete imported demo content" 271 296 msgstr "حذف المحتوى التجريبي المستورد" 272 297 273 #: includes/class-madc-admin.php: 98298 #: includes/class-madc-admin.php:109 274 299 msgid "Cleanup progress" 275 300 msgstr "تقدم الحذف" 276 301 277 #: includes/class-madc-admin.php: 99302 #: includes/class-madc-admin.php:110 278 303 msgid "" 279 304 "By Majed Bannani. Imported content and media remain available when the " … … 283 308 "حذفها." 284 309 285 #: includes/class-madc-admin.php:1 00310 #: includes/class-madc-admin.php:111 286 311 msgid "Made with care, sustained by your support" 287 312 msgstr "صُنعت بعناية، وتستمر بدعمك" 288 313 289 #: includes/class-madc-admin.php:1 00314 #: includes/class-madc-admin.php:111 290 315 msgid "" 291 316 "This plugin is free and grows with the support of its users. If it has " … … 296 321 "موقعك، يمكنك المساهمة في استمرار تطويرها وإضافة أدوات جديدة." 297 322 298 #: includes/class-madc-admin.php:1 00323 #: includes/class-madc-admin.php:111 299 324 msgid "Support via PayPal" 300 325 msgstr "الدعم عبر PayPal" … … 312 337 msgstr "فعّل ووكومرس قبل حذف المنتجات المستوردة." 313 338 314 #: includes/class-madc-cleanup.php:1 25339 #: includes/class-madc-cleanup.php:148 315 340 msgid "The cleanup preview expired. Preview the cleanup again." 316 341 msgstr "انتهت صلاحية معاينة الحذف. اعرض المعاينة من جديد." … … 324 349 msgstr "أحد ملفات التنزيل المرفقة غير موجود." 325 350 326 #: includes/class-madc-importer.php:7 2351 #: includes/class-madc-importer.php:73 327 352 msgid "You cannot edit this imported item." 328 353 msgstr "لا تملك صلاحية تعديل هذا العنصر المستورد." 329 354 330 #: includes/class-madc-importer.php:8 2355 #: includes/class-madc-importer.php:83 331 356 msgid "The featured image could not be assigned." 332 357 msgstr "تعذر تعيين الصورة البارزة." 333 358 334 #: includes/class-madc-importer.php:12 4359 #: includes/class-madc-importer.php:125 335 360 msgid "" 336 361 "A grouped product needs its child products. Restore any trashed demo " -
majed-arabic-demo-content/tags/1.2.0/languages/majed-arabic-demo-content.pot
r3685065 r3685614 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Majed Arabic Demo Content 1. 1.2\n"5 "Project-Id-Version: Majed Arabic Demo Content 1.2.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/majed-arabic-demo-content\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026-09-0 5T16:08:38+00:00\n"12 "POT-Creation-Date: 2026-09-07T20:08:27+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 22 22 #. Description of the plugin 23 23 #: majed-arabic-demo-content.php 24 msgid "Import ready-made Arabic articles and WooCommerce demo products with local images and downloads."24 msgid "Import ready-made Arabic or English articles and WooCommerce demo products with local images and downloads." 25 25 msgstr "" 26 26 … … 36 36 37 37 #: includes/class-madc-admin.php:10 38 #: includes/class-madc-admin.php:9 738 #: includes/class-madc-admin.php:98 39 39 msgid "Arabic Demo Content" 40 40 msgstr "" … … 65 65 66 66 #: includes/class-madc-admin.php:23 67 msgid "Permanently delete the following imported demo items ? This includes edits made to demo posts and products. Shared media and used categories are kept. This cannot be undone."67 msgid "Permanently delete the following imported demo items in both languages? This includes edits made to demo posts and products. Shared media and used categories are kept. This cannot be undone." 68 68 msgstr "" 69 69 … … 73 73 74 74 #: includes/class-madc-admin.php:25 75 #: includes/class-madc-admin.php:10 075 #: includes/class-madc-admin.php:102 76 76 msgid "Articles" 77 77 msgstr "" … … 117 117 msgstr "" 118 118 119 #: includes/class-madc-admin.php:5 2120 #: includes/class-madc-admin.php:7 4119 #: includes/class-madc-admin.php:53 120 #: includes/class-madc-admin.php:75 121 121 msgid "Another import is running. Please retry shortly." 122 122 msgstr "" 123 123 124 #: includes/class-madc-admin.php:5 8124 #: includes/class-madc-admin.php:59 125 125 msgid "Cleanup could not finish. Check file permissions and ensure WooCommerce is active, then retry." 126 126 msgstr "" 127 127 128 #: includes/class-madc-admin.php:6 3128 #: includes/class-madc-admin.php:64 129 129 msgid "Finish the current cleanup before importing content." 130 130 msgstr "" 131 131 132 #: includes/class-madc-admin.php:6 6132 #: includes/class-madc-admin.php:67 133 133 msgid "You cannot import this content. Products require WooCommerce and the appropriate permissions." 134 134 msgstr "" 135 135 136 #: includes/class-madc-admin.php:7 0136 #: includes/class-madc-admin.php:71 137 137 msgid "Invalid import item." 138 138 msgstr "" 139 139 140 #: includes/class-madc-admin.php:8 1140 #: includes/class-madc-admin.php:82 141 141 msgid "Import failed. Check upload permissions, available storage, and any trashed demo products, then retry." 142 142 msgstr "" 143 143 144 #: includes/class-madc-admin.php:97145 msgid "Build a realistic demo with ready-made Arabic content."146 msgstr ""147 148 144 #: includes/class-madc-admin.php:98 149 msgid "24 articles" 150 msgstr "" 151 152 #: includes/class-madc-admin.php:98 153 msgid "28 products" 154 msgstr "" 155 156 #: includes/class-madc-admin.php:98 145 msgid "Build a realistic demo with ready-made Arabic or English content." 146 msgstr "" 147 148 #: includes/class-madc-admin.php:99 149 msgid "24 articles per language" 150 msgstr "" 151 152 #: includes/class-madc-admin.php:99 153 msgid "28 products per language" 154 msgstr "" 155 156 #: includes/class-madc-admin.php:99 157 157 msgid "60 product images" 158 158 msgstr "" 159 159 160 #: includes/class-madc-admin.php:9 8160 #: includes/class-madc-admin.php:99 161 161 msgid "Works offline" 162 162 msgstr "" 163 163 164 #: includes/class-madc-admin.php: 99164 #: includes/class-madc-admin.php:100 165 165 msgid "Import settings" 166 166 msgstr "" 167 167 168 #: includes/class-madc-admin.php:100169 msgid "Expanded Arabic articles with featured images, categories, tags, and excerpts. Images are reused from the product library."170 msgstr ""171 172 168 #: includes/class-madc-admin.php:101 169 msgid "Demo content language" 170 msgstr "" 171 172 #: includes/class-madc-admin.php:101 173 msgid "Arabic" 174 msgstr "" 175 176 #: includes/class-madc-admin.php:101 177 msgid "English" 178 msgstr "" 179 180 #: includes/class-madc-admin.php:101 181 msgid "Choose the language of imported content. The admin interface keeps your WordPress user language." 182 msgstr "" 183 184 #: includes/class-madc-admin.php:102 185 msgid "Expanded articles in your selected language with featured images, categories, tags, and excerpts. Images come from the bundled product library." 186 msgstr "" 187 188 #: includes/class-madc-admin.php:103 173 189 msgid "WooCommerce products" 174 190 msgstr "" 175 191 176 #: includes/class-madc-admin.php:10 1192 #: includes/class-madc-admin.php:103 177 193 msgid "Simple, variable, grouped, digital, and service products with dedicated images and PDF downloads." 178 194 msgstr "" 179 195 180 #: includes/class-madc-admin.php:10 1196 #: includes/class-madc-admin.php:103 181 197 msgid "Activate WooCommerce to import products." 182 198 msgstr "" 183 199 184 #: includes/class-madc-admin.php:10 2200 #: includes/class-madc-admin.php:104 185 201 msgid "Customize your import" 186 202 msgstr "" 187 203 188 #: includes/class-madc-admin.php:10 2204 #: includes/class-madc-admin.php:104 189 205 msgid "Number of articles" 190 206 msgstr "" 191 207 192 #: includes/class-madc-admin.php:10 2208 #: includes/class-madc-admin.php:104 193 209 msgid "Content status" 194 210 msgstr "" 195 211 196 #: includes/class-madc-admin.php:10 2212 #: includes/class-madc-admin.php:104 197 213 msgid "Draft — review before publishing" 198 214 msgstr "" 199 215 200 #: includes/class-madc-admin.php:10 2216 #: includes/class-madc-admin.php:104 201 217 msgid "Published — visible immediately" 202 218 msgstr "" 203 219 204 #: includes/class-madc-admin.php:10 3220 #: includes/class-madc-admin.php:105 205 221 msgid "Replace text and featured images of previously imported articles. Existing titles and publication status are preserved." 206 222 msgstr "" 207 223 208 #: includes/class-madc-admin.php:10 4209 msgid " Content stays Arabic in either interface language. Existing imports are skipped unless article updates are selected. Items in the trash are alwaysskipped. Prices use your store currency."210 msgstr "" 211 212 #: includes/class-madc-admin.php:10 5224 #: includes/class-madc-admin.php:106 225 msgid "Arabic and English content can coexist. Existing imports in the selected language are skipped unless article updates are selected. Trashed items are skipped. Prices use your store currency." 226 msgstr "" 227 228 #: includes/class-madc-admin.php:107 213 229 msgid "Import demo content" 214 230 msgstr "" 215 231 216 #: includes/class-madc-admin.php:10 6232 #: includes/class-madc-admin.php:108 217 233 msgid "Import progress" 218 234 msgstr "" 219 235 220 #: includes/class-madc-admin.php:10 7236 #: includes/class-madc-admin.php:109 221 237 msgid "Finished building your demo?" 222 238 msgstr "" 223 239 224 #: includes/class-madc-admin.php:10 7225 msgid "Delete all tracked demo articles, products, variations, images, PDFs, and unused categories created by this plugin. Deletion is permanent, including anyedits you made to these demo items."226 msgstr "" 227 228 #: includes/class-madc-admin.php:10 7240 #: includes/class-madc-admin.php:109 241 msgid "Delete all tracked demo articles, products, variations, images, PDFs, and unused categories in both languages. Deletion is permanent, including edits you made to these demo items." 242 msgstr "" 243 244 #: includes/class-madc-admin.php:109 229 245 msgid "Other content is kept. Media referenced by remaining content and categories still in use are retained. Categories from versions before 1.1.0 are retained because their original ownership was not recorded." 230 246 msgstr "" 231 247 232 #: includes/class-madc-admin.php:10 7248 #: includes/class-madc-admin.php:109 233 249 msgid "Delete imported demo content" 234 250 msgstr "" 235 251 236 #: includes/class-madc-admin.php:10 7252 #: includes/class-madc-admin.php:109 237 253 msgid "Cleanup progress" 238 254 msgstr "" 239 255 240 #: includes/class-madc-admin.php:1 08256 #: includes/class-madc-admin.php:110 241 257 msgid "By Majed Bannani. Imported content and media remain available when the plugin is deactivated or removed." 242 258 msgstr "" 243 259 244 #: includes/class-madc-admin.php:1 09260 #: includes/class-madc-admin.php:111 245 261 msgid "Made with care, sustained by your support" 246 262 msgstr "" 247 263 248 #: includes/class-madc-admin.php:1 09264 #: includes/class-madc-admin.php:111 249 265 msgid "This plugin is free and grows with the support of its users. If it has helped you manage your site, you can contribute to its continued development and new tools." 250 266 msgstr "" 251 267 252 #: includes/class-madc-admin.php:1 09268 #: includes/class-madc-admin.php:111 253 269 msgid "Support via PayPal" 254 270 msgstr "" … … 274 290 msgstr "" 275 291 276 #: includes/class-madc-importer.php:7 2292 #: includes/class-madc-importer.php:73 277 293 msgid "You cannot edit this imported item." 278 294 msgstr "" 279 295 280 #: includes/class-madc-importer.php:8 2296 #: includes/class-madc-importer.php:83 281 297 msgid "The featured image could not be assigned." 282 298 msgstr "" 283 299 284 #: includes/class-madc-importer.php:12 4300 #: includes/class-madc-importer.php:125 285 301 msgid "A grouped product needs its child products. Restore any trashed demo products and retry." 286 302 msgstr "" -
majed-arabic-demo-content/tags/1.2.0/licenses/THIRD-PARTY-NOTICES.txt
r3685065 r3685614 1 1 Majed Arabic Demo Content - asset provenance and licensing 2 2 3 Original plugin PHP, JavaScript, CSS, Arabic demo text, worksheet layouts,3 Original plugin PHP, JavaScript, CSS, Arabic and English demo text, worksheet layouts, 4 4 and project-generated demo images are distributed under GPL version 2 or 5 5 (at your option) any later version, to the extent copyright applies. … … 13 13 14 14 PDF typography 15 The PDF worksheets in data/downloads embed subsets of Amiri Regular. 15 The Arabic PDF worksheets in data/downloads embed subsets of Amiri Regular. 16 English worksheets use standard PDF Helvetica without bundling a font file. 16 17 Copyright 2010-2022 The Amiri Project Authors. 17 18 Font license: SIL Open Font License, Version 1.1. … … 32 33 arabic-reshaper. Those Python libraries are not installed or executed by 33 34 the WordPress plugin. The readable worksheet source text is included in 34 data/download-texts.json . Release-kit sources include the build script.35 data/download-texts.json and data/en/download-texts.json. Release-kit sources include the build script. -
majed-arabic-demo-content/tags/1.2.0/majed-arabic-demo-content.php
r3685065 r3685614 2 2 /** 3 3 * Plugin Name: Majed Arabic Demo Content 4 * Description: Import ready-made Arabic articles and WooCommerce demo products with local images and downloads.5 * Version: 1. 1.24 * Description: Import ready-made Arabic or English articles and WooCommerce demo products with local images and downloads. 5 * Version: 1.2.0 6 6 * Author: Majed Bannani 7 7 * Author URI: https://profiles.wordpress.org/majedbannani/ … … 16 16 define( 'MADC_PATH', plugin_dir_path( __FILE__ ) ); 17 17 define( 'MADC_URL', plugin_dir_url( __FILE__ ) ); 18 define( 'MADC_VERSION', '1. 1.2' );18 define( 'MADC_VERSION', '1.2.0' ); 19 19 require_once MADC_PATH . 'includes/class-madc-importer.php'; 20 20 require_once MADC_PATH . 'includes/class-madc-cleanup.php'; -
majed-arabic-demo-content/tags/1.2.0/readme.txt
r3685065 r3685614 6 6 Tested up to: 7.1 7 7 Requires PHP: 7.4 8 Stable tag: 1. 1.28 Stable tag: 1.2.0 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Import ready-made Arabic articles and WooCommerce demo products with local images, PDF downloads, and optional cleanup.12 Import ready-made Arabic or English articles and WooCommerce demo products with local images, PDF downloads, and optional cleanup. 13 13 14 14 == Description == 15 15 16 Majed Arabic Demo Content helps you populate a development or demonstration site with realistic Arabic content. Choose a collection, keep the default draft status or explicitly publish it, and import in small batches from one admin screen.16 Majed Arabic Demo Content helps you populate a development or demonstration site with realistic Arabic or English content. Choose a collection, keep the default draft status or explicitly publish it, and import in small batches from one admin screen. 17 17 18 The English and Arabic admin interface follows your WordPress user language and supports both LTR and RTL layouts. The imported demo content remains Arabic in either interface language.18 The English and Arabic admin interface follows your WordPress user language and supports both LTR and RTL layouts. Select Arabic or English independently of the admin language. Both libraries can coexist; this is not a multilingual translation-linking integration. 19 19 20 = Ready-made Arabic articles =20 = Ready-made articles in two languages = 21 21 22 * Choose 12 or 24 articles across home, fashion, coffee, and stationery topics.23 * Each article contains approximately 394 to 452 Arabicwords, with an introduction, section headings, and practical examples.22 * Choose 12 or 24 articles per language across home, fashion, coffee, and stationery topics. 23 * Arabic articles contain approximately 394 to 452 words; English articles contain approximately 307 to 328 words, with an introduction, section headings, and practical examples. 24 24 * Includes excerpts, categories, tags, and featured images reused from the bundled product image library. 25 25 * Optionally update the text, excerpt, and featured image of previously imported articles while preserving their titles and publication status. … … 27 27 = WooCommerce demo products = 28 28 29 Import 28 parent products :29 Import 28 parent products per language: 30 30 31 31 * 12 physical simple products. 32 32 * 4 variable products with 24 size/color variations in total, individual prices, stock quantities, and images. 33 33 * 4 native grouped products linked to their individually purchasable child products. 34 * 4 virtual, downloadable products with printable Arabic PDF worksheets.34 * 4 virtual, downloadable products with printable PDF worksheets in the selected language. 35 35 * 4 virtual service products. 36 36 37 Includes 60 local WebP images for main product images, galleries, and variations. Images are shared with articles rather than duplicated on repeated imports. Prices use the store currency; these are sample products and prices, not a real product catalog or fulfillment service.37 Includes 60 local WebP images for main product images, galleries, and variations. Within each language, articles and products reuse imported images. Arabic and English use separate attachment records to preserve their own image titles and alt text, while the plugin bundles each source image only once. Prices use the store currency; these are sample products and prices, not a real product catalog or fulfillment service. 38 38 39 39 WooCommerce is optional for articles and required for importing or cleaning up products. No paid WooCommerce extensions are required. External/affiliate products, custom post types, and custom field integrations are not included. … … 57 57 = Bundled media and licensing = 58 58 59 The demo images were AI-generated for this project and are illustrative, without real customer data. Images accompanying digital products are not exact previews of the PDF worksheets. The four PDFseach contain four printable pages for handwritten planning; they are not interactive forms or confidential files.59 The demo images were AI-generated for this project and are illustrative, without real customer data. Images accompanying digital products are not exact previews of the PDF worksheets. The eight PDFs (four per language) each contain four printable pages for handwritten planning; they are not interactive forms or confidential files. 60 60 61 Original plugin code and demo assets are distributed under GPLv2 or later to the extent copyright applies. The PDFs embed a subset of Amiri, licensed under the SIL Open Font License 1.1. See LICENSE.txt and licenses/THIRD-PARTY-NOTICES.txt for attribution and source information.61 Original plugin code and demo assets are distributed under GPLv2 or later to the extent copyright applies. The Arabic PDFs embed a subset of Amiri, licensed under the SIL Open Font License 1.1. See LICENSE.txt and licenses/THIRD-PARTY-NOTICES.txt for attribution and source information. 62 62 63 63 == Installation == … … 66 66 2. Activate Majed Arabic Demo Content. 67 67 3. Open Arabic Demo Content in the admin menu with an administrator account. 68 4. Choose articles or products. Activate WooCommerce first if you want products.68 4. Choose Arabic or English content, then articles or products. Activate WooCommerce first if you want products. 69 69 5. Select draft or published status. For articles, choose 12 or 24. 70 70 6. Click Import demo content and keep the page open until completion. … … 82 82 = Are the articles and products translated to English? = 83 83 84 The administration interface is available in English and Arabic. The bundled demo articles and product descriptions are Arabic.84 The administration interface is available in English and Arabic. The bundled demo articles, product descriptions, categories, tags, variations and PDFs are available in Arabic and English. Choose the content language before importing. 85 85 86 86 = Will repeated imports create duplicates or overwrite my edits? = … … 90 90 = Can I delete everything imported by the plugin? = 91 91 92 The cleanup action previews the tracked items and asks you to confirm permanent deletion. It includes user edits to the demo posts/products. Shared media, used categories, unowned child variations and their parents, and items without sufficient delete permission may be retained. Older untracked terms and references in third-party custom tables are subject to the limitations described above.92 The cleanup action covers both languages and previews the tracked items and asks you to confirm permanent deletion. It includes user edits to the demo posts/products. Shared media, used categories, unowned child variations and their parents, and items without sufficient delete permission may be retained. Older untracked terms and references in third-party custom tables are subject to the limitations described above. 93 93 94 94 = Are grouped products the same as product bundles? = … … 108 108 1. English administration: choose articles or products, set the quantity and status, and optionally update previously imported articles. 109 109 2. Arabic administration with RTL layout and translated import and cleanup controls. 110 3. A bundled Arabicarticle imported into WordPress with a featured image and expanded text. Its appearance depends on the active theme.110 3. A bundled article imported into WordPress with a featured image and expanded text. Its appearance depends on the active theme. 111 111 112 112 == Changelog == 113 114 = 1.2.0 = 115 * Add a primary content-language selector and complete local English library: 24 articles, 28 products, 24 variations, categories, tags and four PDFs. 116 * Keep both libraries independently importable while preserving legacy Arabic ownership keys. 117 * Clean up both libraries, retaining shared and unowned content. 118 * Avoid mistaking known non-media core/WooCommerce settings for attachment references. 113 119 114 120 = 1.1.2 = … … 134 140 == Upgrade Notice == 135 141 142 = 1.2.0 = 143 Adds local English content alongside Arabic. Existing Arabic imports remain tracked; cleanup covers both languages. 144 136 145 = 1.1.2 = 137 146 Safer diagnostics and reviewed static-analysis exceptions. Import and cleanup protections are preserved. -
majed-arabic-demo-content/trunk/assets/admin.css
r3685065 r3685614 67 67 .madc-support-card{border:1px solid #fdba74}.madc-support-button.button{border-radius:10px;font-weight:700;white-space:nowrap}@media(max-width:640px){.madc-support-card{flex-direction:column;align-items:stretch;gap:18px}.madc-support-button.button{width:100%}} 68 68 .madc-cleanup{margin-block-start:24px;border-color:#fecaca}.madc-admin .madc-danger{border:1px solid #dc2626;color:#b91c1c;background:#fff;border-radius:10px;padding:7px 18px;font-weight:600}.madc-admin .madc-danger:hover{background:#fef2f2}.madc-admin #madc-cleanup-progress{margin-block-start:18px}.madc-admin #madc-refresh{max-inline-size:800px} 69 .madc-admin #madc-language{min-width:180px;min-height:42px;border:1px solid #e2e8f0;border-radius:10px;padding-inline:12px;background-color:#fff;color:#0f172a} -
majed-arabic-demo-content/trunk/assets/admin.js
r3685065 r3685614 28 28 event.preventDefault(); 29 29 if (running) return; 30 const payload = { kind: form.elements.kind.value, quantity: Number(form.elements.quantity.value), status: form.elements.status.value, refresh: form.elements.refresh.checked};30 const payload = {language: form.elements.language.value, kind: form.elements.kind.value, quantity: Number(form.elements.quantity.value), status: form.elements.status.value, refresh: form.elements.refresh.checked}; 31 31 const result = document.querySelector('#madc-result'); 32 32 const progress = document.querySelector('#madc-progress'); -
majed-arabic-demo-content/trunk/includes/class-madc-admin.php
r3685065 r3685614 21 21 'cleanupFailed' => __( 'Cleanup stopped. Retry to continue.', 'majed-arabic-demo-content' ), 22 22 'deleted' => __( 'Deleted', 'majed-arabic-demo-content' ), 'kept' => __( 'Kept for safety or permissions', 'majed-arabic-demo-content' ), 23 'cleanupConfirm' => __( 'Permanently delete the following imported demo items ? This includes edits made to demo posts and products. Shared media and used categories are kept. This cannot be undone.', 'majed-arabic-demo-content' ),23 'cleanupConfirm' => __( 'Permanently delete the following imported demo items in both languages? This includes edits made to demo posts and products. Shared media and used categories are kept. This cannot be undone.', 'majed-arabic-demo-content' ), 24 24 'nothing' => __( 'There is no tracked demo content to delete.', 'majed-arabic-demo-content' ), 25 25 'cleanupLabels' => array( 'post' => __( 'Articles', 'majed-arabic-demo-content' ), 'product' => __( 'Products', 'majed-arabic-demo-content' ), 'product_variation' => __( 'Variations', 'majed-arabic-demo-content' ), 'attachment' => __( 'Images', 'majed-arabic-demo-content' ), 'term' => __( 'Categories and tags', 'majed-arabic-demo-content' ), 'download' => __( 'PDF files', 'majed-arabic-demo-content' ) ), … … 41 41 register_rest_route( 'madc/v1', '/import', array( 'methods' => 'POST', 'callback' => array( $this, 'step' ), 'permission_callback' => static function () { return current_user_can( 'manage_options' ); }, 'args' => array( 42 42 'kind' => array( 'required' => true, 'type' => 'string', 'enum' => array( 'posts', 'products' ) ), 43 'language' => array( 'type' => 'string', 'enum' => array( 'ar', 'en' ), 'default' => 'ar' ), 43 44 'refresh' => array( 'type' => 'boolean', 'default' => false ), 44 45 'quantity' => array( 'required' => true, 'type' => 'integer', 'enum' => array( 12, 24 ) ), … … 66 67 return new WP_Error( 'madc_permission', __( 'You cannot import this content. Products require WooCommerce and the appropriate permissions.', 'majed-arabic-demo-content' ), array( 'status' => 403 ) ); 67 68 } 68 $items = MADC_Importer::items( $kind, (int) $request['quantity'] );69 $items = MADC_Importer::items( $kind, (int) $request['quantity'], $request['language'] ); 69 70 $index = (int) $request['index']; 70 71 if ( ! isset( $items[ $index ] ) ) { return new WP_Error( 'madc_index', __( 'Invalid import item.', 'majed-arabic-demo-content' ), array( 'status' => 400 ) ); } … … 95 96 ?> 96 97 <div class="wrap madc-admin" dir="<?php echo is_rtl() ? 'rtl' : 'ltr'; ?>"><div class="madc-shell"> 97 <header class="madc-header"><span class="madc-mark dashicons dashicons-welcome-write-blog" aria-hidden="true"></span><div><span class="madc-eyebrow">Majed <span class="madc-badge">v<?php echo esc_html( MADC_VERSION ); ?></span></span><h1><?php esc_html_e( 'Arabic Demo Content', 'majed-arabic-demo-content' ); ?></h1><p><?php esc_html_e( 'Build a realistic demo with ready-made Arabic content.', 'majed-arabic-demo-content' ); ?></p></div></header><hr class="wp-header-end">98 <div class="madc-summary"><span><?php esc_html_e( '24 articles ', 'majed-arabic-demo-content' ); ?></span><span><?php esc_html_e( '28 products', 'majed-arabic-demo-content' ); ?></span><span><?php esc_html_e( '60 product images', 'majed-arabic-demo-content' ); ?></span><span><?php esc_html_e( 'Works offline', 'majed-arabic-demo-content' ); ?></span></div>98 <header class="madc-header"><span class="madc-mark dashicons dashicons-welcome-write-blog" aria-hidden="true"></span><div><span class="madc-eyebrow">Majed <span class="madc-badge">v<?php echo esc_html( MADC_VERSION ); ?></span></span><h1><?php esc_html_e( 'Arabic Demo Content', 'majed-arabic-demo-content' ); ?></h1><p><?php esc_html_e( 'Build a realistic demo with ready-made Arabic or English content.', 'majed-arabic-demo-content' ); ?></p></div></header><hr class="wp-header-end"> 99 <div class="madc-summary"><span><?php esc_html_e( '24 articles per language', 'majed-arabic-demo-content' ); ?></span><span><?php esc_html_e( '28 products per language', 'majed-arabic-demo-content' ); ?></span><span><?php esc_html_e( '60 product images', 'majed-arabic-demo-content' ); ?></span><span><?php esc_html_e( 'Works offline', 'majed-arabic-demo-content' ); ?></span></div> 99 100 <form id="madc-form"><fieldset id="madc-controls"><legend class="screen-reader-text"><?php esc_html_e( 'Import settings', 'majed-arabic-demo-content' ); ?></legend> 100 <div class="madc-grid"><label class="madc-card madc-choice"><input type="radio" name="kind" value="posts" checked><span class="dashicons dashicons-admin-post" aria-hidden="true"></span><strong><?php esc_html_e( 'Articles', 'majed-arabic-demo-content' ); ?></strong><span><?php esc_html_e( 'Expanded Arabic articles with featured images, categories, tags, and excerpts. Images are reused from the product library.', 'majed-arabic-demo-content' ); ?></span></label> 101 <section class="madc-card"><h2><label for="madc-language"><?php esc_html_e( 'Demo content language', 'majed-arabic-demo-content' ); ?></label></h2><select id="madc-language" name="language"><option value="ar"><?php esc_html_e( 'Arabic', 'majed-arabic-demo-content' ); ?></option><option value="en"><?php esc_html_e( 'English', 'majed-arabic-demo-content' ); ?></option></select><p class="madc-muted"><?php esc_html_e( 'Choose the language of imported content. The admin interface keeps your WordPress user language.', 'majed-arabic-demo-content' ); ?></p></section> 102 <div class="madc-grid"><label class="madc-card madc-choice"><input type="radio" name="kind" value="posts" checked><span class="dashicons dashicons-admin-post" aria-hidden="true"></span><strong><?php esc_html_e( 'Articles', 'majed-arabic-demo-content' ); ?></strong><span><?php esc_html_e( 'Expanded articles in your selected language with featured images, categories, tags, and excerpts. Images come from the bundled product library.', 'majed-arabic-demo-content' ); ?></span></label> 101 103 <label class="madc-card madc-choice"><input type="radio" name="kind" value="products" <?php disabled( ! class_exists( 'WooCommerce' ) ); ?>><span class="dashicons dashicons-cart" aria-hidden="true"></span><strong><?php esc_html_e( 'WooCommerce products', 'majed-arabic-demo-content' ); ?></strong><span><?php esc_html_e( 'Simple, variable, grouped, digital, and service products with dedicated images and PDF downloads.', 'majed-arabic-demo-content' ); ?></span><?php if ( ! class_exists( 'WooCommerce' ) ) : ?><small><?php esc_html_e( 'Activate WooCommerce to import products.', 'majed-arabic-demo-content' ); ?></small><?php endif; ?></label></div> 102 104 <section class="madc-card"><h2><?php esc_html_e( 'Customize your import', 'majed-arabic-demo-content' ); ?></h2><div class="madc-fields"><div id="madc-quantity"><label for="quantity"><?php esc_html_e( 'Number of articles', 'majed-arabic-demo-content' ); ?></label><select id="quantity" name="quantity"><option value="12">12</option><option value="24">24</option></select></div><div><label for="madc-status"><?php esc_html_e( 'Content status', 'majed-arabic-demo-content' ); ?></label><select name="status" id="madc-status"><option value="draft"><?php esc_html_e( 'Draft — review before publishing', 'majed-arabic-demo-content' ); ?></option><option value="publish"><?php esc_html_e( 'Published — visible immediately', 'majed-arabic-demo-content' ); ?></option></select></div></div> 103 105 <p id="madc-refresh"><label><input type="checkbox" name="refresh" value="1"> <?php esc_html_e( 'Replace text and featured images of previously imported articles. Existing titles and publication status are preserved.', 'majed-arabic-demo-content' ); ?></label></p> 104 <p class="madc-muted"><?php esc_html_e( ' Content stays Arabic in either interface language. Existing imports are skipped unless article updates are selected. Items in the trash are alwaysskipped. Prices use your store currency.', 'majed-arabic-demo-content' ); ?></p>106 <p class="madc-muted"><?php esc_html_e( 'Arabic and English content can coexist. Existing imports in the selected language are skipped unless article updates are selected. Trashed items are skipped. Prices use your store currency.', 'majed-arabic-demo-content' ); ?></p> 105 107 <button type="submit" class="button button-primary"><?php esc_html_e( 'Import demo content', 'majed-arabic-demo-content' ); ?></button></section></fieldset></form> 106 108 <section class="madc-card" id="madc-progress-panel" hidden><h2><?php esc_html_e( 'Import progress', 'majed-arabic-demo-content' ); ?></h2><progress id="madc-progress" max="100" value="0" aria-label="<?php esc_attr_e( 'Import progress', 'majed-arabic-demo-content' ); ?>"></progress><p id="madc-result" role="status" aria-live="polite"></p><p id="madc-item" dir="auto"></p></section> 107 <section class="madc-card madc-cleanup" aria-labelledby="madc-cleanup-title"><h2 id="madc-cleanup-title"><?php esc_html_e( 'Finished building your demo?', 'majed-arabic-demo-content' ); ?></h2><p><?php esc_html_e( 'Delete all tracked demo articles, products, variations, images, PDFs, and unused categories created by this plugin. Deletion is permanent, including anyedits you made to these demo items.', 'majed-arabic-demo-content' ); ?></p><p class="madc-muted"><?php esc_html_e( 'Other content is kept. Media referenced by remaining content and categories still in use are retained. Categories from versions before 1.1.0 are retained because their original ownership was not recorded.', 'majed-arabic-demo-content' ); ?></p><button type="button" id="madc-cleanup-button" class="button madc-danger"><?php esc_html_e( 'Delete imported demo content', 'majed-arabic-demo-content' ); ?></button><div id="madc-cleanup-progress" hidden><progress id="madc-cleanup-bar" value="0" max="100" aria-label="<?php esc_attr_e( 'Cleanup progress', 'majed-arabic-demo-content' ); ?>"></progress><p id="madc-cleanup-result" role="status" aria-live="polite"></p></div></section>109 <section class="madc-card madc-cleanup" aria-labelledby="madc-cleanup-title"><h2 id="madc-cleanup-title"><?php esc_html_e( 'Finished building your demo?', 'majed-arabic-demo-content' ); ?></h2><p><?php esc_html_e( 'Delete all tracked demo articles, products, variations, images, PDFs, and unused categories in both languages. Deletion is permanent, including edits you made to these demo items.', 'majed-arabic-demo-content' ); ?></p><p class="madc-muted"><?php esc_html_e( 'Other content is kept. Media referenced by remaining content and categories still in use are retained. Categories from versions before 1.1.0 are retained because their original ownership was not recorded.', 'majed-arabic-demo-content' ); ?></p><button type="button" id="madc-cleanup-button" class="button madc-danger"><?php esc_html_e( 'Delete imported demo content', 'majed-arabic-demo-content' ); ?></button><div id="madc-cleanup-progress" hidden><progress id="madc-cleanup-bar" value="0" max="100" aria-label="<?php esc_attr_e( 'Cleanup progress', 'majed-arabic-demo-content' ); ?>"></progress><p id="madc-cleanup-result" role="status" aria-live="polite"></p></div></section> 108 110 <footer class="madc-muted"><?php esc_html_e( 'By Majed Bannani. Imported content and media remain available when the plugin is deactivated or removed.', 'majed-arabic-demo-content' ); ?></footer> 109 111 <aside class="madc-support-card" aria-labelledby="madc-support-title"><div class="madc-support-copy"><h2 id="madc-support-title"><?php esc_html_e( 'Made with care, sustained by your support', 'majed-arabic-demo-content' ); ?> <span class="madc-support-heart" aria-hidden="true">♥</span></h2><p><?php esc_html_e( 'This plugin is free and grows with the support of its users. If it has helped you manage your site, you can contribute to its continued development and new tools.', 'majed-arabic-demo-content' ); ?></p></div><a class="button madc-support-button" href="https://www.paypal.com/ncp/payment/2C3DDKHKMPMLC" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Support via PayPal', 'majed-arabic-demo-content' ); ?></a></aside></div></div> -
majed-arabic-demo-content/trunk/includes/class-madc-cleanup.php
r3685065 r3685614 11 11 12 12 private static function owned_posts() { 13 $allowed = array( 'post' => array_column( MADC_Importer::data( 'articles'), 'id' ), 'product' => array(), 'product_variation' => array(), 'attachment' => array() );14 foreach ( MADC_Importer::data( 'products') as $p ) {13 $allowed = array( 'post' => array_column( array_merge( MADC_Importer::data( 'articles' ), MADC_Importer::data( 'articles', 'en' ) ), 'id' ), 'product' => array(), 'product_variation' => array(), 'attachment' => array() ); 14 foreach ( array_merge( MADC_Importer::data( 'products' ), MADC_Importer::data( 'products', 'en' ) ) as $p ) { 15 15 $allowed['product'][] = $p['id']; 16 16 foreach ( $p['variations'] ?? array() as $v ) { $allowed['product_variation'][] = $v['id']; } 17 17 } 18 foreach ( glob( MADC_PATH . 'data/images/*.webp' ) as $image ) { $allowed['attachment'][] = 'media:' . basename( $image ); }18 foreach ( glob( MADC_PATH . 'data/images/*.webp' ) as $image ) { $allowed['attachment'][] = 'media:' . basename( $image ); $allowed['attachment'][] = 'en:media:' . basename( $image ); } 19 19 $items = array(); 20 20 // A fixed bundled catalog limits which ownership markers are accepted, including older releases. … … 49 49 foreach ( $terms as $id ) { $items[] = array( 'kind' => 'term', 'id' => (int) $id, 'taxonomy' => $taxonomy ); } 50 50 } 51 foreach ( MADC_Importer::data( 'download-texts') as $download ) {51 foreach ( array_merge( MADC_Importer::data( 'download-texts' ), MADC_Importer::data( 'download-texts', 'en' ) ) as $download ) { 52 52 if ( get_option( 'madc_download_' . $download['id'] ) ) { $items[] = array( 'kind' => 'download', 'key' => $download['id'] ); } 53 53 } … … 88 88 $values = $wpdb->get_col( $wpdb->prepare( "SELECT pm.meta_value FROM {$wpdb->postmeta} pm INNER JOIN {$wpdb->posts} p ON p.ID = pm.post_id WHERE pm.post_id <> %d AND pm.meta_key NOT IN ('_edit_last','_edit_lock','_price','_regular_price','_sale_price','_stock','_wp_attachment_metadata','_wp_attached_file','_wp_attachment_image_alt') AND pm.meta_key NOT LIKE %s AND pm.meta_value REGEXP %s", $id, $wpdb->esc_like( '_madc_' ) . '%', $pattern ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- Prepared read-only cross-content reference check immediately before deletion; no equivalent core API, and cached results could delete newly shared media. 89 89 foreach ( $values as $value ) { if ( self::contains_id( $value, $id ) ) { return true; } } 90 $options = $wpdb->get_col( $wpdb->prepare( "SELECT option_value FROM {$wpdb->options} WHERE option_name NOT LIKE %s AND option_name NOT REGEXP '(size_[wh]$|image_width$|image_height$)' AND option_value REGEXP %s", 'madc' . '%', $pattern ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- Prepared read-only cross-content reference check immediately before deletion; no equivalent core API, and cached results could delete newly shared media.90 $options = $wpdb->get_col( $wpdb->prepare( "SELECT option_value FROM {$wpdb->options} WHERE option_name NOT LIKE %s AND option_name NOT IN ('comments_per_page','close_comments_days_old','woocommerce_schema_version') AND option_name NOT REGEXP '^_site_transient_wp_theme_files_patterns-' AND option_name NOT REGEXP '(size_[wh]$|image_width$|image_height$)' AND option_value REGEXP %s", 'madc' . '%', $pattern ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- Prepared read-only cross-content reference check immediately before deletion; no equivalent core API, and cached results could delete newly shared media. 91 91 foreach ( $options as $value ) { if ( self::contains_id( $value, $id ) ) { return true; } } 92 92 $block = '%"id":' . absint( $id ) . '%'; -
majed-arabic-demo-content/trunk/includes/class-madc-importer.php
r3685065 r3685614 3 3 4 4 final class MADC_Importer { 5 public static function data( $name ) {6 return json_decode( file_get_contents( MADC_PATH . 'data/' . $name . '.json' ), true );5 public static function data( $name, $language = 'ar' ) { 6 return json_decode( file_get_contents( MADC_PATH . 'data/' . ( 'en' === $language ? 'en/' : '' ) . $name . '.json' ), true ); 7 7 } 8 public static function items( $kind, $quantity ) {8 public static function items( $kind, $quantity, $language = 'ar' ) { 9 9 if ( 'posts' === $kind ) { 10 $presets = self::data( 'article-presets' );10 $presets = self::data( 'article-presets', $language ); 11 11 $ids = $presets['options'][ 24 === $quantity ? 1 : 0 ]['article_ids']; 12 return array_values( array_filter( self::data( 'articles' ), static function ( $a ) use ( $ids ) { return in_array( $a['id'], $ids, true ); } ) );12 return array_values( array_filter( self::data( 'articles', $language ), static function ( $a ) use ( $ids ) { return in_array( $a['id'], $ids, true ); } ) ); 13 13 } 14 $products = self::data( 'products' );14 $products = self::data( 'products', $language ); 15 15 usort( $products, static function ( $a, $b ) { return (int) ( 'grouped' === $a['type'] ) <=> (int) ( 'grouped' === $b['type'] ); } ); 16 16 return $products; … … 24 24 return $result; 25 25 } 26 private static function terms( $ids, $taxonomy ) {27 $data = self::data( 'taxonomies' );26 private static function terms( $ids, $taxonomy, $language ) { 27 $data = self::data( 'taxonomies', $language ); 28 28 $out = array(); 29 29 foreach ( array_merge( $data['categories'], $data['tags'] ) as $term ) { … … 38 38 return $out; 39 39 } 40 private static function media( $path, $alt, $parent ) {41 $key = 'media:' . basename( $path );40 private static function media( $path, $alt, $parent, $language ) { 41 $key = ( 'en' === $language ? 'en:' : '' ) . 'media:' . basename( $path ); 42 42 $id = self::existing( $key, 'attachment' ); 43 43 if ( $id && is_file( (string) get_attached_file( $id ) ) ) { return $id; } … … 65 65 } 66 66 public static function run( $kind, $item, $status, $refresh = false ) { 67 $language = isset( $item['language'] ) && 'en' === $item['language'] ? 'en' : 'ar'; 67 68 $type = 'posts' === $kind ? 'post' : 'product'; 68 69 $id = self::existing( $item['id'], $type ); … … 78 79 self::checked( wp_update_post( array( 'ID' => $id, 'post_content' => wp_kses_post( $item['content_html'] ), 'post_excerpt' => $item['excerpt'] ), true ) ); 79 80 } 80 $image_id = self::media( $item['image_path'], $item['image_text']['alt'], $id );81 $image_id = self::media( $item['image_path'], $item['image_text']['alt'], $id, $language ); 81 82 set_post_thumbnail( $id, $image_id ); 82 83 if ( (int) get_post_thumbnail_id( $id ) !== (int) $image_id ) { throw new RuntimeException( esc_html__( 'The featured image could not be assigned.', 'majed-arabic-demo-content' ) ); } 83 update_post_meta( $id, '_madc_content_version', '1. 1.0' );84 update_post_meta( $id, '_madc_content_version', '1.2.0' ); 84 85 if ( ! $updating ) { 85 self::checked( wp_set_object_terms( $id, self::terms( $item['category_ids'], 'category' ), 'category' ) );86 self::checked( wp_set_object_terms( $id, self::terms( $item['tag_ids'], 'post_tag' ), 'post_tag' ) );86 self::checked( wp_set_object_terms( $id, self::terms( $item['category_ids'], 'category', $language ), 'category' ) ); 87 self::checked( wp_set_object_terms( $id, self::terms( $item['tag_ids'], 'post_tag', $language ), 'post_tag' ) ); 87 88 self::checked( wp_update_post( array( 'ID' => $id, 'post_status' => $status ), true ) ); 88 89 } … … 103 104 $p->set_virtual( $item['virtual'] ); 104 105 $p->set_downloadable( $item['downloadable'] ); 105 $p->set_category_ids( self::terms( $item['category_ids'], 'product_cat' ) );106 $p->set_tag_ids( self::terms( $item['tag_ids'], 'product_tag' ) );106 $p->set_category_ids( self::terms( $item['category_ids'], 'product_cat', $language ) ); 107 $p->set_tag_ids( self::terms( $item['tag_ids'], 'product_tag', $language ) ); 107 108 if ( isset( $item['regular_price'] ) ) { $p->set_regular_price( (string) $item['regular_price'] ); } 108 109 if ( isset( $item['stock_quantity'] ) ) { … … 110 111 $p->set_stock_status( $item['stock_quantity'] > 0 ? 'instock' : 'outofstock' ); 111 112 } 112 $p->set_image_id( self::media( $item['image_path'], $item['image_text']['alt'], $id ) );113 $p->set_image_id( self::media( $item['image_path'], $item['image_text']['alt'], $id, $language ) ); 113 114 $gallery = array(); 114 foreach ( $item['gallery_image_paths'] as $path ) { $gallery[] = self::media( $path, $item['name'], $id ); }115 foreach ( $item['gallery_image_paths'] as $path ) { $gallery[] = self::media( $path, $item['name'], $id, $language ); } 115 116 $p->set_gallery_image_ids( $gallery ); 116 117 if ( $item['downloadable'] ) { … … 145 146 $variation->set_description( $v['description'] ); $variation->set_status( 'publish' ); 146 147 $variation->set_sku( 'MADC-' . strtoupper( $v['id'] ) . '-' . $id ); 147 $variation->set_image_id( self::media( $v['image_path'], $v['image_alt'], $id ) );148 $variation->set_image_id( self::media( $v['image_path'], $v['image_alt'], $id, $language ) ); 148 149 $variation->update_meta_data( '_madc_key', $v['id'] ); $variation->save(); 149 150 } -
majed-arabic-demo-content/trunk/languages/majed-arabic-demo-content-ar.po
r3685065 r3685614 2 2 msgid "" 3 3 msgstr "" 4 "Project-Id-Version: Majed Arabic Demo Content 1. 1.2\n"4 "Project-Id-Version: Majed Arabic Demo Content 1.2.0\n" 5 5 "Last-Translator: Majed Bannani\n" 6 6 "Language-Team: Arabic\n" … … 11 11 "Plural-Forms: nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5);\n" 12 12 13 #. Plugin Name of the plugin 13 14 #: majed-arabic-demo-content.php 14 15 msgid "Majed Arabic Demo Content" 15 16 msgstr "محتوى عربي تجريبي من ماجد" 16 17 18 #. Description of the plugin 17 19 #: majed-arabic-demo-content.php 18 20 msgid "" 19 "Import ready-made Arabic articles and WooCommerce demo products with local " 20 "images and downloads." 21 msgstr "" 22 "استورد مقالات عربية ومنتجات ووكومرس تجريبية جاهزة مع صور وملفات تنزيل محلية." 23 21 "Import ready-made Arabic or English articles and WooCommerce demo products " 22 "with local images and downloads." 23 msgstr "" 24 "استورد مقالات جاهزة بالعربية أو الإنجليزية ومنتجات ووكومرس تجريبية مع صور " 25 "وملفات تنزيل محلية." 26 27 #. Author of the plugin 24 28 #: majed-arabic-demo-content.php 25 29 msgid "Majed Bannani" 26 30 msgstr "ماجد بناني" 27 31 32 #. Author URI of the plugin 28 33 #: majed-arabic-demo-content.php 29 34 msgid "https://profiles.wordpress.org/majedbannani/" 30 35 msgstr "https://profiles.wordpress.org/majedbannani/" 31 36 32 #: includes/class-madc-admin.php:10 includes/class-madc-admin.php: 8837 #: includes/class-madc-admin.php:10 includes/class-madc-admin.php:98 33 38 msgid "Arabic Demo Content" 34 39 msgstr "محتوى عربي تجريبي" … … 60 65 #: includes/class-madc-admin.php:23 61 66 msgid "" 62 "Permanently delete the following imported demo items ? This includes edits"63 " made to demo posts and products. Shared media and used categories are kept."64 " This cannot be undone."65 msgstr "" 66 "هل تريد حذف العناصر التجريبية ال تالية نهائيًا؟ يشمل ذلك التعديلات التي"67 " أجريتها علىالمقالات والمنتجات التجريبية. تُحفظ الوسائط المشتركة والتصنيفات "68 "المستخدمة. لا يمكن التراجع عن هذاالحذف."67 "Permanently delete the following imported demo items in both languages? This" 68 " includes edits made to demo posts and products. Shared media and used " 69 "categories are kept. This cannot be undone." 70 msgstr "" 71 "هل تريد حذف العناصر التجريبية المستوردة التالية باللغتين نهائيًا؟ يشمل ذلك " 72 "تعديلات المقالات والمنتجات التجريبية. تُحفظ الوسائط المشتركة والتصنيفات " 73 "المستخدمة. لا يمكن التراجع عن الحذف." 69 74 70 75 #: includes/class-madc-admin.php:24 … … 72 77 msgstr "لا يوجد محتوى تجريبي مسجّل لحذفه." 73 78 74 #: includes/class-madc-admin.php:25 includes/class-madc-admin.php: 9179 #: includes/class-madc-admin.php:25 includes/class-madc-admin.php:102 75 80 msgid "Articles" 76 81 msgstr "المقالات" … … 116 121 msgstr "مستورد مسبقًا" 117 122 118 #: includes/class-madc-admin.php:5 2 includes/class-madc-admin.php:74123 #: includes/class-madc-admin.php:53 includes/class-madc-admin.php:75 119 124 msgid "Another import is running. Please retry shortly." 120 125 msgstr "توجد عملية استيراد قيد التنفيذ. أعد المحاولة بعد قليل." 121 126 122 #: includes/class-madc-admin.php:5 8127 #: includes/class-madc-admin.php:59 123 128 msgid "" 124 129 "Cleanup could not finish. Check file permissions and ensure WooCommerce is " … … 127 132 "تعذر إكمال الحذف. تحقق من صلاحيات الملفات وتفعيل ووكومرس، ثم أعد المحاولة." 128 133 129 #: includes/class-madc-admin.php:6 3134 #: includes/class-madc-admin.php:64 130 135 msgid "Finish the current cleanup before importing content." 131 136 msgstr "أكمل عملية الحذف الحالية قبل استيراد المحتوى." 132 137 133 #: includes/class-madc-admin.php:6 6138 #: includes/class-madc-admin.php:67 134 139 msgid "" 135 140 "You cannot import this content. Products require WooCommerce and the " … … 139 144 "المناسبة." 140 145 141 #: includes/class-madc-admin.php:7 0146 #: includes/class-madc-admin.php:71 142 147 msgid "Invalid import item." 143 148 msgstr "عنصر الاستيراد غير صالح." 144 149 145 #: includes/class-madc-admin.php:8 1150 #: includes/class-madc-admin.php:82 146 151 msgid "" 147 152 "Import failed. Check upload permissions, available storage, and any trashed " … … 151 156 "التجريبية في سلة المهملات، ثم أعد المحاولة." 152 157 153 #: includes/class-madc-admin.php: 88154 msgid "Build a realistic demo with ready-made Arabic content."155 msgstr "جهّز موقعك التجريبي بمحتوى عربي جاهز ومنوّع."156 157 #: includes/class-madc-admin.php: 89158 msgid "24 articles "159 msgstr "٢٤ مقالة "160 161 #: includes/class-madc-admin.php: 89162 msgid "28 products "163 msgstr "٢٨ منتجًا "164 165 #: includes/class-madc-admin.php: 89158 #: includes/class-madc-admin.php:98 159 msgid "Build a realistic demo with ready-made Arabic or English content." 160 msgstr "جهّز موقعك التجريبي بمحتوى جاهز بالعربية أو الإنجليزية." 161 162 #: includes/class-madc-admin.php:99 163 msgid "24 articles per language" 164 msgstr "٢٤ مقالة لكل لغة" 165 166 #: includes/class-madc-admin.php:99 167 msgid "28 products per language" 168 msgstr "٢٨ منتجًا لكل لغة" 169 170 #: includes/class-madc-admin.php:99 166 171 msgid "60 product images" 167 172 msgstr "٦٠ صورة للمنتجات" 168 173 169 #: includes/class-madc-admin.php: 89174 #: includes/class-madc-admin.php:99 170 175 msgid "Works offline" 171 176 msgstr "يعمل دون اتصال خارجي" 172 177 173 #: includes/class-madc-admin.php: 90178 #: includes/class-madc-admin.php:100 174 179 msgid "Import settings" 175 180 msgstr "إعدادات الاستيراد" 176 181 177 #: includes/class-madc-admin.php:91 178 msgid "" 179 "Expanded Arabic articles with featured images, categories, tags, and " 180 "excerpts. Images are reused from the product library." 181 msgstr "" 182 "مقالات عربية موسّعة مع صور بارزة وتصنيفات ووسوم ومقتطفات. الصور معاد " 183 "استخدامها من مكتبة المنتجات." 184 185 #: includes/class-madc-admin.php:92 182 #: includes/class-madc-admin.php:101 183 msgid "Demo content language" 184 msgstr "لغة المحتوى التجريبي" 185 186 #: includes/class-madc-admin.php:101 187 msgid "Arabic" 188 msgstr "العربية" 189 190 #: includes/class-madc-admin.php:101 191 msgid "English" 192 msgstr "الإنجليزية" 193 194 #: includes/class-madc-admin.php:101 195 msgid "" 196 "Choose the language of imported content. The admin interface keeps your " 197 "WordPress user language." 198 msgstr "اختر لغة المحتوى المستورد. تبقى لغة الواجهة حسب لغة مستخدم ووردبريس." 199 200 #: includes/class-madc-admin.php:102 201 msgid "" 202 "Expanded articles in your selected language with featured images, " 203 "categories, tags, and excerpts. Images come from the bundled product " 204 "library." 205 msgstr "" 206 "مقالات موسّعة باللغة المختارة مع صور بارزة وتصنيفات ووسوم ومقتطفات. الصور من" 207 " مكتبة المنتجات المرفقة." 208 209 #: includes/class-madc-admin.php:103 186 210 msgid "WooCommerce products" 187 211 msgstr "منتجات ووكومرس" 188 212 189 #: includes/class-madc-admin.php: 92213 #: includes/class-madc-admin.php:103 190 214 msgid "" 191 215 "Simple, variable, grouped, digital, and service products with dedicated " … … 194 218 "منتجات بسيطة ومتغيرة ومجمّعة ورقمية وخدمات، مع صور خاصة وملفات PDF للتنزيل." 195 219 196 #: includes/class-madc-admin.php: 92220 #: includes/class-madc-admin.php:103 197 221 msgid "Activate WooCommerce to import products." 198 222 msgstr "فعّل ووكومرس لاستيراد المنتجات." 199 223 200 #: includes/class-madc-admin.php: 93224 #: includes/class-madc-admin.php:104 201 225 msgid "Customize your import" 202 226 msgstr "خصّص عملية الاستيراد" 203 227 204 #: includes/class-madc-admin.php: 93228 #: includes/class-madc-admin.php:104 205 229 msgid "Number of articles" 206 230 msgstr "عدد المقالات" 207 231 208 #: includes/class-madc-admin.php: 93232 #: includes/class-madc-admin.php:104 209 233 msgid "Content status" 210 234 msgstr "حالة المحتوى" 211 235 212 #: includes/class-madc-admin.php: 93236 #: includes/class-madc-admin.php:104 213 237 msgid "Draft — review before publishing" 214 238 msgstr "مسودة — راجع المحتوى قبل النشر" 215 239 216 #: includes/class-madc-admin.php: 93240 #: includes/class-madc-admin.php:104 217 241 msgid "Published — visible immediately" 218 242 msgstr "منشور — يظهر مباشرة" 219 243 220 #: includes/class-madc-admin.php: 94244 #: includes/class-madc-admin.php:105 221 245 msgid "" 222 246 "Replace text and featured images of previously imported articles. Existing " … … 226 250 "بالعناوين وحالة النشر الحالية." 227 251 228 #: includes/class-madc-admin.php: 95229 msgid "" 230 " Content stays Arabic in either interface language. Existing imports are"231 " skipped unless article updates are selected. Items in the trash are always"252 #: includes/class-madc-admin.php:106 253 msgid "" 254 "Arabic and English content can coexist. Existing imports in the selected " 255 "language are skipped unless article updates are selected. Trashed items are " 232 256 "skipped. Prices use your store currency." 233 257 msgstr "" 234 "يبقى المحتوى عربيًا في الواجهتين. يُتجاوز المحتوى الموجود ما لم تختر تحديث " 235 "المقالات. تُتجاوز عناصر سلة المهملات دائمًا. الأسعار بعملة متجرك." 236 237 #: includes/class-madc-admin.php:96 258 "يمكن استيراد المحتوى العربي والإنجليزي معًا. يُتجاوز المحتوى الموجود باللغة " 259 "المختارة ما لم تختر تحديث المقالات، وتُتجاوز عناصر سلة المهملات. الأسعار " 260 "بعملة متجرك." 261 262 #: includes/class-madc-admin.php:107 238 263 msgid "Import demo content" 239 264 msgstr "استيراد المحتوى التجريبي" 240 265 241 #: includes/class-madc-admin.php: 97266 #: includes/class-madc-admin.php:108 242 267 msgid "Import progress" 243 268 msgstr "تقدم الاستيراد" 244 269 245 #: includes/class-madc-admin.php: 98270 #: includes/class-madc-admin.php:109 246 271 msgid "Finished building your demo?" 247 272 msgstr "انتهيت من تطوير موقعك التجريبي؟" 248 273 249 #: includes/class-madc-admin.php: 98274 #: includes/class-madc-admin.php:109 250 275 msgid "" 251 276 "Delete all tracked demo articles, products, variations, images, PDFs, and " 252 "unused categories created by this plugin. Deletion is permanent, including"253 " any editsyou made to these demo items."254 msgstr "" 255 "احذف المقالات والمنتجات والمتغيرات والصور وملفات PDF والتصنيفات غير "256 "المستخدمة التي أنشأتها الإضافة وسجّلتها. الحذف نهائي ويشمل التعديلات التي"257 " أجريتها على هذهالعناصر التجريبية."258 259 #: includes/class-madc-admin.php: 98277 "unused categories in both languages. Deletion is permanent, including edits " 278 "you made to these demo items." 279 msgstr "" 280 "احذف جميع المقالات والمنتجات والمتغيرات والصور وملفات PDF والتصنيفات غير " 281 "المستخدمة التي تتعقبها الإضافة باللغتين. الحذف نهائي ويشمل تعديلاتك على هذه " 282 "العناصر التجريبية." 283 284 #: includes/class-madc-admin.php:109 260 285 msgid "" 261 286 "Other content is kept. Media referenced by remaining content and categories " … … 267 292 " تكن مسجّلة." 268 293 269 #: includes/class-madc-admin.php: 98294 #: includes/class-madc-admin.php:109 270 295 msgid "Delete imported demo content" 271 296 msgstr "حذف المحتوى التجريبي المستورد" 272 297 273 #: includes/class-madc-admin.php: 98298 #: includes/class-madc-admin.php:109 274 299 msgid "Cleanup progress" 275 300 msgstr "تقدم الحذف" 276 301 277 #: includes/class-madc-admin.php: 99302 #: includes/class-madc-admin.php:110 278 303 msgid "" 279 304 "By Majed Bannani. Imported content and media remain available when the " … … 283 308 "حذفها." 284 309 285 #: includes/class-madc-admin.php:1 00310 #: includes/class-madc-admin.php:111 286 311 msgid "Made with care, sustained by your support" 287 312 msgstr "صُنعت بعناية، وتستمر بدعمك" 288 313 289 #: includes/class-madc-admin.php:1 00314 #: includes/class-madc-admin.php:111 290 315 msgid "" 291 316 "This plugin is free and grows with the support of its users. If it has " … … 296 321 "موقعك، يمكنك المساهمة في استمرار تطويرها وإضافة أدوات جديدة." 297 322 298 #: includes/class-madc-admin.php:1 00323 #: includes/class-madc-admin.php:111 299 324 msgid "Support via PayPal" 300 325 msgstr "الدعم عبر PayPal" … … 312 337 msgstr "فعّل ووكومرس قبل حذف المنتجات المستوردة." 313 338 314 #: includes/class-madc-cleanup.php:1 25339 #: includes/class-madc-cleanup.php:148 315 340 msgid "The cleanup preview expired. Preview the cleanup again." 316 341 msgstr "انتهت صلاحية معاينة الحذف. اعرض المعاينة من جديد." … … 324 349 msgstr "أحد ملفات التنزيل المرفقة غير موجود." 325 350 326 #: includes/class-madc-importer.php:7 2351 #: includes/class-madc-importer.php:73 327 352 msgid "You cannot edit this imported item." 328 353 msgstr "لا تملك صلاحية تعديل هذا العنصر المستورد." 329 354 330 #: includes/class-madc-importer.php:8 2355 #: includes/class-madc-importer.php:83 331 356 msgid "The featured image could not be assigned." 332 357 msgstr "تعذر تعيين الصورة البارزة." 333 358 334 #: includes/class-madc-importer.php:12 4359 #: includes/class-madc-importer.php:125 335 360 msgid "" 336 361 "A grouped product needs its child products. Restore any trashed demo " -
majed-arabic-demo-content/trunk/languages/majed-arabic-demo-content.pot
r3685065 r3685614 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Majed Arabic Demo Content 1. 1.2\n"5 "Project-Id-Version: Majed Arabic Demo Content 1.2.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/majed-arabic-demo-content\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026-09-0 5T16:08:38+00:00\n"12 "POT-Creation-Date: 2026-09-07T20:08:27+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 22 22 #. Description of the plugin 23 23 #: majed-arabic-demo-content.php 24 msgid "Import ready-made Arabic articles and WooCommerce demo products with local images and downloads."24 msgid "Import ready-made Arabic or English articles and WooCommerce demo products with local images and downloads." 25 25 msgstr "" 26 26 … … 36 36 37 37 #: includes/class-madc-admin.php:10 38 #: includes/class-madc-admin.php:9 738 #: includes/class-madc-admin.php:98 39 39 msgid "Arabic Demo Content" 40 40 msgstr "" … … 65 65 66 66 #: includes/class-madc-admin.php:23 67 msgid "Permanently delete the following imported demo items ? This includes edits made to demo posts and products. Shared media and used categories are kept. This cannot be undone."67 msgid "Permanently delete the following imported demo items in both languages? This includes edits made to demo posts and products. Shared media and used categories are kept. This cannot be undone." 68 68 msgstr "" 69 69 … … 73 73 74 74 #: includes/class-madc-admin.php:25 75 #: includes/class-madc-admin.php:10 075 #: includes/class-madc-admin.php:102 76 76 msgid "Articles" 77 77 msgstr "" … … 117 117 msgstr "" 118 118 119 #: includes/class-madc-admin.php:5 2120 #: includes/class-madc-admin.php:7 4119 #: includes/class-madc-admin.php:53 120 #: includes/class-madc-admin.php:75 121 121 msgid "Another import is running. Please retry shortly." 122 122 msgstr "" 123 123 124 #: includes/class-madc-admin.php:5 8124 #: includes/class-madc-admin.php:59 125 125 msgid "Cleanup could not finish. Check file permissions and ensure WooCommerce is active, then retry." 126 126 msgstr "" 127 127 128 #: includes/class-madc-admin.php:6 3128 #: includes/class-madc-admin.php:64 129 129 msgid "Finish the current cleanup before importing content." 130 130 msgstr "" 131 131 132 #: includes/class-madc-admin.php:6 6132 #: includes/class-madc-admin.php:67 133 133 msgid "You cannot import this content. Products require WooCommerce and the appropriate permissions." 134 134 msgstr "" 135 135 136 #: includes/class-madc-admin.php:7 0136 #: includes/class-madc-admin.php:71 137 137 msgid "Invalid import item." 138 138 msgstr "" 139 139 140 #: includes/class-madc-admin.php:8 1140 #: includes/class-madc-admin.php:82 141 141 msgid "Import failed. Check upload permissions, available storage, and any trashed demo products, then retry." 142 142 msgstr "" 143 143 144 #: includes/class-madc-admin.php:97145 msgid "Build a realistic demo with ready-made Arabic content."146 msgstr ""147 148 144 #: includes/class-madc-admin.php:98 149 msgid "24 articles" 150 msgstr "" 151 152 #: includes/class-madc-admin.php:98 153 msgid "28 products" 154 msgstr "" 155 156 #: includes/class-madc-admin.php:98 145 msgid "Build a realistic demo with ready-made Arabic or English content." 146 msgstr "" 147 148 #: includes/class-madc-admin.php:99 149 msgid "24 articles per language" 150 msgstr "" 151 152 #: includes/class-madc-admin.php:99 153 msgid "28 products per language" 154 msgstr "" 155 156 #: includes/class-madc-admin.php:99 157 157 msgid "60 product images" 158 158 msgstr "" 159 159 160 #: includes/class-madc-admin.php:9 8160 #: includes/class-madc-admin.php:99 161 161 msgid "Works offline" 162 162 msgstr "" 163 163 164 #: includes/class-madc-admin.php: 99164 #: includes/class-madc-admin.php:100 165 165 msgid "Import settings" 166 166 msgstr "" 167 167 168 #: includes/class-madc-admin.php:100169 msgid "Expanded Arabic articles with featured images, categories, tags, and excerpts. Images are reused from the product library."170 msgstr ""171 172 168 #: includes/class-madc-admin.php:101 169 msgid "Demo content language" 170 msgstr "" 171 172 #: includes/class-madc-admin.php:101 173 msgid "Arabic" 174 msgstr "" 175 176 #: includes/class-madc-admin.php:101 177 msgid "English" 178 msgstr "" 179 180 #: includes/class-madc-admin.php:101 181 msgid "Choose the language of imported content. The admin interface keeps your WordPress user language." 182 msgstr "" 183 184 #: includes/class-madc-admin.php:102 185 msgid "Expanded articles in your selected language with featured images, categories, tags, and excerpts. Images come from the bundled product library." 186 msgstr "" 187 188 #: includes/class-madc-admin.php:103 173 189 msgid "WooCommerce products" 174 190 msgstr "" 175 191 176 #: includes/class-madc-admin.php:10 1192 #: includes/class-madc-admin.php:103 177 193 msgid "Simple, variable, grouped, digital, and service products with dedicated images and PDF downloads." 178 194 msgstr "" 179 195 180 #: includes/class-madc-admin.php:10 1196 #: includes/class-madc-admin.php:103 181 197 msgid "Activate WooCommerce to import products." 182 198 msgstr "" 183 199 184 #: includes/class-madc-admin.php:10 2200 #: includes/class-madc-admin.php:104 185 201 msgid "Customize your import" 186 202 msgstr "" 187 203 188 #: includes/class-madc-admin.php:10 2204 #: includes/class-madc-admin.php:104 189 205 msgid "Number of articles" 190 206 msgstr "" 191 207 192 #: includes/class-madc-admin.php:10 2208 #: includes/class-madc-admin.php:104 193 209 msgid "Content status" 194 210 msgstr "" 195 211 196 #: includes/class-madc-admin.php:10 2212 #: includes/class-madc-admin.php:104 197 213 msgid "Draft — review before publishing" 198 214 msgstr "" 199 215 200 #: includes/class-madc-admin.php:10 2216 #: includes/class-madc-admin.php:104 201 217 msgid "Published — visible immediately" 202 218 msgstr "" 203 219 204 #: includes/class-madc-admin.php:10 3220 #: includes/class-madc-admin.php:105 205 221 msgid "Replace text and featured images of previously imported articles. Existing titles and publication status are preserved." 206 222 msgstr "" 207 223 208 #: includes/class-madc-admin.php:10 4209 msgid " Content stays Arabic in either interface language. Existing imports are skipped unless article updates are selected. Items in the trash are alwaysskipped. Prices use your store currency."210 msgstr "" 211 212 #: includes/class-madc-admin.php:10 5224 #: includes/class-madc-admin.php:106 225 msgid "Arabic and English content can coexist. Existing imports in the selected language are skipped unless article updates are selected. Trashed items are skipped. Prices use your store currency." 226 msgstr "" 227 228 #: includes/class-madc-admin.php:107 213 229 msgid "Import demo content" 214 230 msgstr "" 215 231 216 #: includes/class-madc-admin.php:10 6232 #: includes/class-madc-admin.php:108 217 233 msgid "Import progress" 218 234 msgstr "" 219 235 220 #: includes/class-madc-admin.php:10 7236 #: includes/class-madc-admin.php:109 221 237 msgid "Finished building your demo?" 222 238 msgstr "" 223 239 224 #: includes/class-madc-admin.php:10 7225 msgid "Delete all tracked demo articles, products, variations, images, PDFs, and unused categories created by this plugin. Deletion is permanent, including anyedits you made to these demo items."226 msgstr "" 227 228 #: includes/class-madc-admin.php:10 7240 #: includes/class-madc-admin.php:109 241 msgid "Delete all tracked demo articles, products, variations, images, PDFs, and unused categories in both languages. Deletion is permanent, including edits you made to these demo items." 242 msgstr "" 243 244 #: includes/class-madc-admin.php:109 229 245 msgid "Other content is kept. Media referenced by remaining content and categories still in use are retained. Categories from versions before 1.1.0 are retained because their original ownership was not recorded." 230 246 msgstr "" 231 247 232 #: includes/class-madc-admin.php:10 7248 #: includes/class-madc-admin.php:109 233 249 msgid "Delete imported demo content" 234 250 msgstr "" 235 251 236 #: includes/class-madc-admin.php:10 7252 #: includes/class-madc-admin.php:109 237 253 msgid "Cleanup progress" 238 254 msgstr "" 239 255 240 #: includes/class-madc-admin.php:1 08256 #: includes/class-madc-admin.php:110 241 257 msgid "By Majed Bannani. Imported content and media remain available when the plugin is deactivated or removed." 242 258 msgstr "" 243 259 244 #: includes/class-madc-admin.php:1 09260 #: includes/class-madc-admin.php:111 245 261 msgid "Made with care, sustained by your support" 246 262 msgstr "" 247 263 248 #: includes/class-madc-admin.php:1 09264 #: includes/class-madc-admin.php:111 249 265 msgid "This plugin is free and grows with the support of its users. If it has helped you manage your site, you can contribute to its continued development and new tools." 250 266 msgstr "" 251 267 252 #: includes/class-madc-admin.php:1 09268 #: includes/class-madc-admin.php:111 253 269 msgid "Support via PayPal" 254 270 msgstr "" … … 274 290 msgstr "" 275 291 276 #: includes/class-madc-importer.php:7 2292 #: includes/class-madc-importer.php:73 277 293 msgid "You cannot edit this imported item." 278 294 msgstr "" 279 295 280 #: includes/class-madc-importer.php:8 2296 #: includes/class-madc-importer.php:83 281 297 msgid "The featured image could not be assigned." 282 298 msgstr "" 283 299 284 #: includes/class-madc-importer.php:12 4300 #: includes/class-madc-importer.php:125 285 301 msgid "A grouped product needs its child products. Restore any trashed demo products and retry." 286 302 msgstr "" -
majed-arabic-demo-content/trunk/licenses/THIRD-PARTY-NOTICES.txt
r3685065 r3685614 1 1 Majed Arabic Demo Content - asset provenance and licensing 2 2 3 Original plugin PHP, JavaScript, CSS, Arabic demo text, worksheet layouts,3 Original plugin PHP, JavaScript, CSS, Arabic and English demo text, worksheet layouts, 4 4 and project-generated demo images are distributed under GPL version 2 or 5 5 (at your option) any later version, to the extent copyright applies. … … 13 13 14 14 PDF typography 15 The PDF worksheets in data/downloads embed subsets of Amiri Regular. 15 The Arabic PDF worksheets in data/downloads embed subsets of Amiri Regular. 16 English worksheets use standard PDF Helvetica without bundling a font file. 16 17 Copyright 2010-2022 The Amiri Project Authors. 17 18 Font license: SIL Open Font License, Version 1.1. … … 32 33 arabic-reshaper. Those Python libraries are not installed or executed by 33 34 the WordPress plugin. The readable worksheet source text is included in 34 data/download-texts.json . Release-kit sources include the build script.35 data/download-texts.json and data/en/download-texts.json. Release-kit sources include the build script. -
majed-arabic-demo-content/trunk/majed-arabic-demo-content.php
r3685065 r3685614 2 2 /** 3 3 * Plugin Name: Majed Arabic Demo Content 4 * Description: Import ready-made Arabic articles and WooCommerce demo products with local images and downloads.5 * Version: 1. 1.24 * Description: Import ready-made Arabic or English articles and WooCommerce demo products with local images and downloads. 5 * Version: 1.2.0 6 6 * Author: Majed Bannani 7 7 * Author URI: https://profiles.wordpress.org/majedbannani/ … … 16 16 define( 'MADC_PATH', plugin_dir_path( __FILE__ ) ); 17 17 define( 'MADC_URL', plugin_dir_url( __FILE__ ) ); 18 define( 'MADC_VERSION', '1. 1.2' );18 define( 'MADC_VERSION', '1.2.0' ); 19 19 require_once MADC_PATH . 'includes/class-madc-importer.php'; 20 20 require_once MADC_PATH . 'includes/class-madc-cleanup.php'; -
majed-arabic-demo-content/trunk/readme.txt
r3685065 r3685614 6 6 Tested up to: 7.1 7 7 Requires PHP: 7.4 8 Stable tag: 1. 1.28 Stable tag: 1.2.0 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Import ready-made Arabic articles and WooCommerce demo products with local images, PDF downloads, and optional cleanup.12 Import ready-made Arabic or English articles and WooCommerce demo products with local images, PDF downloads, and optional cleanup. 13 13 14 14 == Description == 15 15 16 Majed Arabic Demo Content helps you populate a development or demonstration site with realistic Arabic content. Choose a collection, keep the default draft status or explicitly publish it, and import in small batches from one admin screen.16 Majed Arabic Demo Content helps you populate a development or demonstration site with realistic Arabic or English content. Choose a collection, keep the default draft status or explicitly publish it, and import in small batches from one admin screen. 17 17 18 The English and Arabic admin interface follows your WordPress user language and supports both LTR and RTL layouts. The imported demo content remains Arabic in either interface language.18 The English and Arabic admin interface follows your WordPress user language and supports both LTR and RTL layouts. Select Arabic or English independently of the admin language. Both libraries can coexist; this is not a multilingual translation-linking integration. 19 19 20 = Ready-made Arabic articles =20 = Ready-made articles in two languages = 21 21 22 * Choose 12 or 24 articles across home, fashion, coffee, and stationery topics.23 * Each article contains approximately 394 to 452 Arabicwords, with an introduction, section headings, and practical examples.22 * Choose 12 or 24 articles per language across home, fashion, coffee, and stationery topics. 23 * Arabic articles contain approximately 394 to 452 words; English articles contain approximately 307 to 328 words, with an introduction, section headings, and practical examples. 24 24 * Includes excerpts, categories, tags, and featured images reused from the bundled product image library. 25 25 * Optionally update the text, excerpt, and featured image of previously imported articles while preserving their titles and publication status. … … 27 27 = WooCommerce demo products = 28 28 29 Import 28 parent products :29 Import 28 parent products per language: 30 30 31 31 * 12 physical simple products. 32 32 * 4 variable products with 24 size/color variations in total, individual prices, stock quantities, and images. 33 33 * 4 native grouped products linked to their individually purchasable child products. 34 * 4 virtual, downloadable products with printable Arabic PDF worksheets.34 * 4 virtual, downloadable products with printable PDF worksheets in the selected language. 35 35 * 4 virtual service products. 36 36 37 Includes 60 local WebP images for main product images, galleries, and variations. Images are shared with articles rather than duplicated on repeated imports. Prices use the store currency; these are sample products and prices, not a real product catalog or fulfillment service.37 Includes 60 local WebP images for main product images, galleries, and variations. Within each language, articles and products reuse imported images. Arabic and English use separate attachment records to preserve their own image titles and alt text, while the plugin bundles each source image only once. Prices use the store currency; these are sample products and prices, not a real product catalog or fulfillment service. 38 38 39 39 WooCommerce is optional for articles and required for importing or cleaning up products. No paid WooCommerce extensions are required. External/affiliate products, custom post types, and custom field integrations are not included. … … 57 57 = Bundled media and licensing = 58 58 59 The demo images were AI-generated for this project and are illustrative, without real customer data. Images accompanying digital products are not exact previews of the PDF worksheets. The four PDFseach contain four printable pages for handwritten planning; they are not interactive forms or confidential files.59 The demo images were AI-generated for this project and are illustrative, without real customer data. Images accompanying digital products are not exact previews of the PDF worksheets. The eight PDFs (four per language) each contain four printable pages for handwritten planning; they are not interactive forms or confidential files. 60 60 61 Original plugin code and demo assets are distributed under GPLv2 or later to the extent copyright applies. The PDFs embed a subset of Amiri, licensed under the SIL Open Font License 1.1. See LICENSE.txt and licenses/THIRD-PARTY-NOTICES.txt for attribution and source information.61 Original plugin code and demo assets are distributed under GPLv2 or later to the extent copyright applies. The Arabic PDFs embed a subset of Amiri, licensed under the SIL Open Font License 1.1. See LICENSE.txt and licenses/THIRD-PARTY-NOTICES.txt for attribution and source information. 62 62 63 63 == Installation == … … 66 66 2. Activate Majed Arabic Demo Content. 67 67 3. Open Arabic Demo Content in the admin menu with an administrator account. 68 4. Choose articles or products. Activate WooCommerce first if you want products.68 4. Choose Arabic or English content, then articles or products. Activate WooCommerce first if you want products. 69 69 5. Select draft or published status. For articles, choose 12 or 24. 70 70 6. Click Import demo content and keep the page open until completion. … … 82 82 = Are the articles and products translated to English? = 83 83 84 The administration interface is available in English and Arabic. The bundled demo articles and product descriptions are Arabic.84 The administration interface is available in English and Arabic. The bundled demo articles, product descriptions, categories, tags, variations and PDFs are available in Arabic and English. Choose the content language before importing. 85 85 86 86 = Will repeated imports create duplicates or overwrite my edits? = … … 90 90 = Can I delete everything imported by the plugin? = 91 91 92 The cleanup action previews the tracked items and asks you to confirm permanent deletion. It includes user edits to the demo posts/products. Shared media, used categories, unowned child variations and their parents, and items without sufficient delete permission may be retained. Older untracked terms and references in third-party custom tables are subject to the limitations described above.92 The cleanup action covers both languages and previews the tracked items and asks you to confirm permanent deletion. It includes user edits to the demo posts/products. Shared media, used categories, unowned child variations and their parents, and items without sufficient delete permission may be retained. Older untracked terms and references in third-party custom tables are subject to the limitations described above. 93 93 94 94 = Are grouped products the same as product bundles? = … … 108 108 1. English administration: choose articles or products, set the quantity and status, and optionally update previously imported articles. 109 109 2. Arabic administration with RTL layout and translated import and cleanup controls. 110 3. A bundled Arabicarticle imported into WordPress with a featured image and expanded text. Its appearance depends on the active theme.110 3. A bundled article imported into WordPress with a featured image and expanded text. Its appearance depends on the active theme. 111 111 112 112 == Changelog == 113 114 = 1.2.0 = 115 * Add a primary content-language selector and complete local English library: 24 articles, 28 products, 24 variations, categories, tags and four PDFs. 116 * Keep both libraries independently importable while preserving legacy Arabic ownership keys. 117 * Clean up both libraries, retaining shared and unowned content. 118 * Avoid mistaking known non-media core/WooCommerce settings for attachment references. 113 119 114 120 = 1.1.2 = … … 134 140 == Upgrade Notice == 135 141 142 = 1.2.0 = 143 Adds local English content alongside Arabic. Existing Arabic imports remain tracked; cleanup covers both languages. 144 136 145 = 1.1.2 = 137 146 Safer diagnostics and reviewed static-analysis exceptions. Import and cleanup protections are preserved.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)