Plugin Directory

Changeset 3685614


Ignore:
Timestamp:
09/07/2026 09:24:00 PM (7 weeks ago)
Author:
majedbannani
Message:

Release 1.2.0: add local English demo content and content language selection

Location:
majed-arabic-demo-content
Files:
20 added
24 edited
1 copied

Legend:

Unmodified
Added
Removed
  • majed-arabic-demo-content/tags/1.2.0/assets/admin.css

    r3685065 r3685614  
    6767.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%}}
    6868.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  
    2828        event.preventDefault();
    2929        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};
    3131        const result = document.querySelector('#madc-result');
    3232        const progress = document.querySelector('#madc-progress');
  • majed-arabic-demo-content/tags/1.2.0/includes/class-madc-admin.php

    r3685065 r3685614  
    2121            'cleanupFailed' => __( 'Cleanup stopped. Retry to continue.', 'majed-arabic-demo-content' ),
    2222            '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' ),
    2424            'nothing' => __( 'There is no tracked demo content to delete.', 'majed-arabic-demo-content' ),
    2525            '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' ) ),
    … …  
    4141        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(
    4242            'kind' => array( 'required' => true, 'type' => 'string', 'enum' => array( 'posts', 'products' ) ),
     43            'language' => array( 'type' => 'string', 'enum' => array( 'ar', 'en' ), 'default' => 'ar' ),
    4344            'refresh' => array( 'type' => 'boolean', 'default' => false ),
    4445            'quantity' => array( 'required' => true, 'type' => 'integer', 'enum' => array( 12, 24 ) ),
    … …  
    6667            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 ) );
    6768        }
    68         $items = MADC_Importer::items( $kind, (int) $request['quantity'] );
     69        $items = MADC_Importer::items( $kind, (int) $request['quantity'], $request['language'] );
    6970        $index = (int) $request['index'];
    7071        if ( ! isset( $items[ $index ] ) ) { return new WP_Error( 'madc_index', __( 'Invalid import item.', 'majed-arabic-demo-content' ), array( 'status' => 400 ) ); }
    … …  
    9596        ?>
    9697        <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>
    99100        <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>
    101103        <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>
    102104        <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>
    103105        <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 always skipped. 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>
    105107        <button type="submit" class="button button-primary"><?php esc_html_e( 'Import demo content', 'majed-arabic-demo-content' ); ?></button></section></fieldset></form>
    106108        <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 any 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>
     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>
    108110        <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>
    109111        <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  
    1111
    1212    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 ) {
    1515            $allowed['product'][] = $p['id'];
    1616            foreach ( $p['variations'] ?? array() as $v ) { $allowed['product_variation'][] = $v['id']; }
    1717        }
    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 ); }
    1919        $items = array();
    2020        // A fixed bundled catalog limits which ownership markers are accepted, including older releases.
    … …  
    4949            foreach ( $terms as $id ) { $items[] = array( 'kind' => 'term', 'id' => (int) $id, 'taxonomy' => $taxonomy ); }
    5050        }
    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 ) {
    5252            if ( get_option( 'madc_download_' . $download['id'] ) ) { $items[] = array( 'kind' => 'download', 'key' => $download['id'] ); }
    5353        }
    … …  
    8888            $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.
    8989            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.
    9191            foreach ( $options as $value ) { if ( self::contains_id( $value, $id ) ) { return true; } }
    9292            $block = '%"id":' . absint( $id ) . '%';
  • majed-arabic-demo-content/tags/1.2.0/includes/class-madc-importer.php

    r3685065 r3685614  
    33
    44final 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 );
    77    }
    8     public static function items( $kind, $quantity ) {
     8    public static function items( $kind, $quantity, $language = 'ar' ) {
    99        if ( 'posts' === $kind ) {
    10             $presets = self::data( 'article-presets' );
     10            $presets = self::data( 'article-presets', $language );
    1111            $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 ); } ) );
    1313        }
    14         $products = self::data( 'products' );
     14        $products = self::data( 'products', $language );
    1515        usort( $products, static function ( $a, $b ) { return (int) ( 'grouped' === $a['type'] ) <=> (int) ( 'grouped' === $b['type'] ); } );
    1616        return $products;
    … …  
    2424        return $result;
    2525    }
    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 );
    2828        $out = array();
    2929        foreach ( array_merge( $data['categories'], $data['tags'] ) as $term ) {
    … …  
    3838        return $out;
    3939    }
    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 );
    4242        $id = self::existing( $key, 'attachment' );
    4343        if ( $id && is_file( (string) get_attached_file( $id ) ) ) { return $id; }
    … …  
    6565    }
    6666    public static function run( $kind, $item, $status, $refresh = false ) {
     67        $language = isset( $item['language'] ) && 'en' === $item['language'] ? 'en' : 'ar';
    6768        $type = 'posts' === $kind ? 'post' : 'product';
    6869        $id = self::existing( $item['id'], $type );
    … …  
    7879                self::checked( wp_update_post( array( 'ID' => $id, 'post_content' => wp_kses_post( $item['content_html'] ), 'post_excerpt' => $item['excerpt'] ), true ) );
    7980            }
    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 );
    8182            set_post_thumbnail( $id, $image_id );
    8283            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' );
    8485            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' ) );
    8788            self::checked( wp_update_post( array( 'ID' => $id, 'post_status' => $status ), true ) );
    8889            }
    … …  
    103104            $p->set_virtual( $item['virtual'] );
    104105            $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 ) );
    107108            if ( isset( $item['regular_price'] ) ) { $p->set_regular_price( (string) $item['regular_price'] ); }
    108109            if ( isset( $item['stock_quantity'] ) ) {
    … …  
    110111                $p->set_stock_status( $item['stock_quantity'] > 0 ? 'instock' : 'outofstock' );
    111112            }
    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 ) );
    113114            $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 ); }
    115116            $p->set_gallery_image_ids( $gallery );
    116117            if ( $item['downloadable'] ) {
    … …  
    145146                    $variation->set_description( $v['description'] ); $variation->set_status( 'publish' );
    146147                    $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 ) );
    148149                    $variation->update_meta_data( '_madc_key', $v['id'] ); $variation->save();
    149150                }
  • majed-arabic-demo-content/tags/1.2.0/languages/majed-arabic-demo-content-ar.po

    r3685065 r3685614  
    22msgid ""
    33msgstr ""
    4 "Project-Id-Version: Majed Arabic Demo Content 1.1.2\n"
     4"Project-Id-Version: Majed Arabic Demo Content 1.2.0\n"
    55"Last-Translator: Majed Bannani\n"
    66"Language-Team: Arabic\n"
    … …  
    1111"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"
    1212
     13#. Plugin Name of the plugin
    1314#: majed-arabic-demo-content.php
    1415msgid "Majed Arabic Demo Content"
    1516msgstr "محتوى عربي تجريبي من ماجد"
    1617
     18#. Description of the plugin
    1719#: majed-arabic-demo-content.php
    1820msgid ""
    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."
     23msgstr ""
     24"استورد مقالات جاهزة بالعربية أو الإنجليزية ومنتجات ووكومرس تجريبية مع صور "
     25"وملفات تنزيل محلية."
     26
     27#. Author of the plugin
    2428#: majed-arabic-demo-content.php
    2529msgid "Majed Bannani"
    2630msgstr "ماجد بناني"
    2731
     32#. Author URI of the plugin
    2833#: majed-arabic-demo-content.php
    2934msgid "https://profiles.wordpress.org/majedbannani/"
    3035msgstr "https://profiles.wordpress.org/majedbannani/"
    3136
    32 #: includes/class-madc-admin.php:10 includes/class-madc-admin.php:88
     37#: includes/class-madc-admin.php:10 includes/class-madc-admin.php:98
    3338msgid "Arabic Demo Content"
    3439msgstr "محتوى عربي تجريبي"
    … …  
    6065#: includes/class-madc-admin.php:23
    6166msgid ""
    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."
     70msgstr ""
     71"هل تريد حذف العناصر التجريبية المستوردة التالية باللغتين نهائيًا؟ يشمل ذلك "
     72"تعديلات المقالات والمنتجات التجريبية. تُحفظ الوسائط المشتركة والتصنيفات "
     73"المستخدمة. لا يمكن التراجع عن الحذف."
    6974
    7075#: includes/class-madc-admin.php:24
    … …  
    7277msgstr "لا يوجد محتوى تجريبي مسجّل لحذفه."
    7378
    74 #: includes/class-madc-admin.php:25 includes/class-madc-admin.php:91
     79#: includes/class-madc-admin.php:25 includes/class-madc-admin.php:102
    7580msgid "Articles"
    7681msgstr "المقالات"
    … …  
    116121msgstr "مستورد مسبقًا"
    117122
    118 #: includes/class-madc-admin.php:52 includes/class-madc-admin.php:74
     123#: includes/class-madc-admin.php:53 includes/class-madc-admin.php:75
    119124msgid "Another import is running. Please retry shortly."
    120125msgstr "توجد عملية استيراد قيد التنفيذ. أعد المحاولة بعد قليل."
    121126
    122 #: includes/class-madc-admin.php:58
     127#: includes/class-madc-admin.php:59
    123128msgid ""
    124129"Cleanup could not finish. Check file permissions and ensure WooCommerce is "
    … …  
    127132"تعذر إكمال الحذف. تحقق من صلاحيات الملفات وتفعيل ووكومرس، ثم أعد المحاولة."
    128133
    129 #: includes/class-madc-admin.php:63
     134#: includes/class-madc-admin.php:64
    130135msgid "Finish the current cleanup before importing content."
    131136msgstr "أكمل عملية الحذف الحالية قبل استيراد المحتوى."
    132137
    133 #: includes/class-madc-admin.php:66
     138#: includes/class-madc-admin.php:67
    134139msgid ""
    135140"You cannot import this content. Products require WooCommerce and the "
    … …  
    139144"المناسبة."
    140145
    141 #: includes/class-madc-admin.php:70
     146#: includes/class-madc-admin.php:71
    142147msgid "Invalid import item."
    143148msgstr "عنصر الاستيراد غير صالح."
    144149
    145 #: includes/class-madc-admin.php:81
     150#: includes/class-madc-admin.php:82
    146151msgid ""
    147152"Import failed. Check upload permissions, available storage, and any trashed "
    … …  
    151156"التجريبية في سلة المهملات، ثم أعد المحاولة."
    152157
    153 #: includes/class-madc-admin.php:88
    154 msgid "Build a realistic demo with ready-made Arabic content."
    155 msgstr "جهّز موقعك التجريبي بمحتوى عربي جاهز ومنوّع."
    156 
    157 #: includes/class-madc-admin.php:89
    158 msgid "24 articles"
    159 msgstr "٢٤ مقالة"
    160 
    161 #: includes/class-madc-admin.php:89
    162 msgid "28 products"
    163 msgstr "٢٨ منتجًا"
    164 
    165 #: includes/class-madc-admin.php:89
     158#: includes/class-madc-admin.php:98
     159msgid "Build a realistic demo with ready-made Arabic or English content."
     160msgstr "جهّز موقعك التجريبي بمحتوى جاهز بالعربية أو الإنجليزية."
     161
     162#: includes/class-madc-admin.php:99
     163msgid "24 articles per language"
     164msgstr "٢٤ مقالة لكل لغة"
     165
     166#: includes/class-madc-admin.php:99
     167msgid "28 products per language"
     168msgstr "٢٨ منتجًا لكل لغة"
     169
     170#: includes/class-madc-admin.php:99
    166171msgid "60 product images"
    167172msgstr "٦٠ صورة للمنتجات"
    168173
    169 #: includes/class-madc-admin.php:89
     174#: includes/class-madc-admin.php:99
    170175msgid "Works offline"
    171176msgstr "يعمل دون اتصال خارجي"
    172177
    173 #: includes/class-madc-admin.php:90
     178#: includes/class-madc-admin.php:100
    174179msgid "Import settings"
    175180msgstr "إعدادات الاستيراد"
    176181
    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
     183msgid "Demo content language"
     184msgstr "لغة المحتوى التجريبي"
     185
     186#: includes/class-madc-admin.php:101
     187msgid "Arabic"
     188msgstr "العربية"
     189
     190#: includes/class-madc-admin.php:101
     191msgid "English"
     192msgstr "الإنجليزية"
     193
     194#: includes/class-madc-admin.php:101
     195msgid ""
     196"Choose the language of imported content. The admin interface keeps your "
     197"WordPress user language."
     198msgstr "اختر لغة المحتوى المستورد. تبقى لغة الواجهة حسب لغة مستخدم ووردبريس."
     199
     200#: includes/class-madc-admin.php:102
     201msgid ""
     202"Expanded articles in your selected language with featured images, "
     203"categories, tags, and excerpts. Images come from the bundled product "
     204"library."
     205msgstr ""
     206"مقالات موسّعة باللغة المختارة مع صور بارزة وتصنيفات ووسوم ومقتطفات. الصور من"
     207" مكتبة المنتجات المرفقة."
     208
     209#: includes/class-madc-admin.php:103
    186210msgid "WooCommerce products"
    187211msgstr "منتجات ووكومرس"
    188212
    189 #: includes/class-madc-admin.php:92
     213#: includes/class-madc-admin.php:103
    190214msgid ""
    191215"Simple, variable, grouped, digital, and service products with dedicated "
    … …  
    194218"منتجات بسيطة ومتغيرة ومجمّعة ورقمية وخدمات، مع صور خاصة وملفات PDF للتنزيل."
    195219
    196 #: includes/class-madc-admin.php:92
     220#: includes/class-madc-admin.php:103
    197221msgid "Activate WooCommerce to import products."
    198222msgstr "فعّل ووكومرس لاستيراد المنتجات."
    199223
    200 #: includes/class-madc-admin.php:93
     224#: includes/class-madc-admin.php:104
    201225msgid "Customize your import"
    202226msgstr "خصّص عملية الاستيراد"
    203227
    204 #: includes/class-madc-admin.php:93
     228#: includes/class-madc-admin.php:104
    205229msgid "Number of articles"
    206230msgstr "عدد المقالات"
    207231
    208 #: includes/class-madc-admin.php:93
     232#: includes/class-madc-admin.php:104
    209233msgid "Content status"
    210234msgstr "حالة المحتوى"
    211235
    212 #: includes/class-madc-admin.php:93
     236#: includes/class-madc-admin.php:104
    213237msgid "Draft — review before publishing"
    214238msgstr "مسودة — راجع المحتوى قبل النشر"
    215239
    216 #: includes/class-madc-admin.php:93
     240#: includes/class-madc-admin.php:104
    217241msgid "Published — visible immediately"
    218242msgstr "منشور — يظهر مباشرة"
    219243
    220 #: includes/class-madc-admin.php:94
     244#: includes/class-madc-admin.php:105
    221245msgid ""
    222246"Replace text and featured images of previously imported articles. Existing "
    … …  
    226250"بالعناوين وحالة النشر الحالية."
    227251
    228 #: includes/class-madc-admin.php:95
    229 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
     253msgid ""
     254"Arabic and English content can coexist. Existing imports in the selected "
     255"language are skipped unless article updates are selected. Trashed items are "
    232256"skipped. Prices use your store currency."
    233257msgstr ""
    234 "يبقى المحتوى عربيًا في الواجهتين. يُتجاوز المحتوى الموجود ما لم تختر تحديث "
    235 "المقالات. تُتجاوز عناصر سلة المهملات دائمًا. الأسعار بعملة متجرك."
    236 
    237 #: includes/class-madc-admin.php:96
     258"يمكن استيراد المحتوى العربي والإنجليزي معًا. يُتجاوز المحتوى الموجود باللغة "
     259"المختارة ما لم تختر تحديث المقالات، وتُتجاوز عناصر سلة المهملات. الأسعار "
     260"بعملة متجرك."
     261
     262#: includes/class-madc-admin.php:107
    238263msgid "Import demo content"
    239264msgstr "استيراد المحتوى التجريبي"
    240265
    241 #: includes/class-madc-admin.php:97
     266#: includes/class-madc-admin.php:108
    242267msgid "Import progress"
    243268msgstr "تقدم الاستيراد"
    244269
    245 #: includes/class-madc-admin.php:98
     270#: includes/class-madc-admin.php:109
    246271msgid "Finished building your demo?"
    247272msgstr "انتهيت من تطوير موقعك التجريبي؟"
    248273
    249 #: includes/class-madc-admin.php:98
     274#: includes/class-madc-admin.php:109
    250275msgid ""
    251276"Delete all tracked demo articles, products, variations, images, PDFs, and "
    252 "unused categories created by this plugin. Deletion is permanent, including "
    253 "any edits you made to these demo items."
    254 msgstr ""
    255 "احذف المقالات والمنتجات والمتغيرات والصور وملفات PDF والتصنيفات غير "
    256 "المستخدمة التي أنشأتها الإضافة وسجّلتها. الحذف نهائي ويشمل التعديلات التي "
    257 "أجريتها على هذه العناصر التجريبية."
    258 
    259 #: includes/class-madc-admin.php:98
     277"unused categories in both languages. Deletion is permanent, including edits "
     278"you made to these demo items."
     279msgstr ""
     280"احذف جميع المقالات والمنتجات والمتغيرات والصور وملفات PDF والتصنيفات غير "
     281"المستخدمة التي تتعقبها الإضافة باللغتين. الحذف نهائي ويشمل تعديلاتك على هذه "
     282"العناصر التجريبية."
     283
     284#: includes/class-madc-admin.php:109
    260285msgid ""
    261286"Other content is kept. Media referenced by remaining content and categories "
    … …  
    267292" تكن مسجّلة."
    268293
    269 #: includes/class-madc-admin.php:98
     294#: includes/class-madc-admin.php:109
    270295msgid "Delete imported demo content"
    271296msgstr "حذف المحتوى التجريبي المستورد"
    272297
    273 #: includes/class-madc-admin.php:98
     298#: includes/class-madc-admin.php:109
    274299msgid "Cleanup progress"
    275300msgstr "تقدم الحذف"
    276301
    277 #: includes/class-madc-admin.php:99
     302#: includes/class-madc-admin.php:110
    278303msgid ""
    279304"By Majed Bannani. Imported content and media remain available when the "
    … …  
    283308"حذفها."
    284309
    285 #: includes/class-madc-admin.php:100
     310#: includes/class-madc-admin.php:111
    286311msgid "Made with care, sustained by your support"
    287312msgstr "صُنعت بعناية، وتستمر بدعمك"
    288313
    289 #: includes/class-madc-admin.php:100
     314#: includes/class-madc-admin.php:111
    290315msgid ""
    291316"This plugin is free and grows with the support of its users. If it has "
    … …  
    296321"موقعك، يمكنك المساهمة في استمرار تطويرها وإضافة أدوات جديدة."
    297322
    298 #: includes/class-madc-admin.php:100
     323#: includes/class-madc-admin.php:111
    299324msgid "Support via PayPal"
    300325msgstr "الدعم عبر PayPal"
    … …  
    312337msgstr "فعّل ووكومرس قبل حذف المنتجات المستوردة."
    313338
    314 #: includes/class-madc-cleanup.php:125
     339#: includes/class-madc-cleanup.php:148
    315340msgid "The cleanup preview expired. Preview the cleanup again."
    316341msgstr "انتهت صلاحية معاينة الحذف. اعرض المعاينة من جديد."
    … …  
    324349msgstr "أحد ملفات التنزيل المرفقة غير موجود."
    325350
    326 #: includes/class-madc-importer.php:72
     351#: includes/class-madc-importer.php:73
    327352msgid "You cannot edit this imported item."
    328353msgstr "لا تملك صلاحية تعديل هذا العنصر المستورد."
    329354
    330 #: includes/class-madc-importer.php:82
     355#: includes/class-madc-importer.php:83
    331356msgid "The featured image could not be assigned."
    332357msgstr "تعذر تعيين الصورة البارزة."
    333358
    334 #: includes/class-madc-importer.php:124
     359#: includes/class-madc-importer.php:125
    335360msgid ""
    336361"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  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Majed Arabic Demo Content 1.1.2\n"
     5"Project-Id-Version: Majed Arabic Demo Content 1.2.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/majed-arabic-demo-content\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-09-05T16:08:38+00:00\n"
     12"POT-Creation-Date: 2026-09-07T20:08:27+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    2222#. Description of the plugin
    2323#: majed-arabic-demo-content.php
    24 msgid "Import ready-made Arabic articles and WooCommerce demo products with local images and downloads."
     24msgid "Import ready-made Arabic or English articles and WooCommerce demo products with local images and downloads."
    2525msgstr ""
    2626
    … …  
    3636
    3737#: includes/class-madc-admin.php:10
    38 #: includes/class-madc-admin.php:97
     38#: includes/class-madc-admin.php:98
    3939msgid "Arabic Demo Content"
    4040msgstr ""
    … …  
    6565
    6666#: 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."
     67msgid "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."
    6868msgstr ""
    6969
    … …  
    7373
    7474#: includes/class-madc-admin.php:25
    75 #: includes/class-madc-admin.php:100
     75#: includes/class-madc-admin.php:102
    7676msgid "Articles"
    7777msgstr ""
    … …  
    117117msgstr ""
    118118
    119 #: includes/class-madc-admin.php:52
    120 #: includes/class-madc-admin.php:74
     119#: includes/class-madc-admin.php:53
     120#: includes/class-madc-admin.php:75
    121121msgid "Another import is running. Please retry shortly."
    122122msgstr ""
    123123
    124 #: includes/class-madc-admin.php:58
     124#: includes/class-madc-admin.php:59
    125125msgid "Cleanup could not finish. Check file permissions and ensure WooCommerce is active, then retry."
    126126msgstr ""
    127127
    128 #: includes/class-madc-admin.php:63
     128#: includes/class-madc-admin.php:64
    129129msgid "Finish the current cleanup before importing content."
    130130msgstr ""
    131131
    132 #: includes/class-madc-admin.php:66
     132#: includes/class-madc-admin.php:67
    133133msgid "You cannot import this content. Products require WooCommerce and the appropriate permissions."
    134134msgstr ""
    135135
    136 #: includes/class-madc-admin.php:70
     136#: includes/class-madc-admin.php:71
    137137msgid "Invalid import item."
    138138msgstr ""
    139139
    140 #: includes/class-madc-admin.php:81
     140#: includes/class-madc-admin.php:82
    141141msgid "Import failed. Check upload permissions, available storage, and any trashed demo products, then retry."
    142142msgstr ""
    143143
    144 #: includes/class-madc-admin.php:97
    145 msgid "Build a realistic demo with ready-made Arabic content."
    146 msgstr ""
    147 
    148144#: 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
     145msgid "Build a realistic demo with ready-made Arabic or English content."
     146msgstr ""
     147
     148#: includes/class-madc-admin.php:99
     149msgid "24 articles per language"
     150msgstr ""
     151
     152#: includes/class-madc-admin.php:99
     153msgid "28 products per language"
     154msgstr ""
     155
     156#: includes/class-madc-admin.php:99
    157157msgid "60 product images"
    158158msgstr ""
    159159
    160 #: includes/class-madc-admin.php:98
     160#: includes/class-madc-admin.php:99
    161161msgid "Works offline"
    162162msgstr ""
    163163
    164 #: includes/class-madc-admin.php:99
     164#: includes/class-madc-admin.php:100
    165165msgid "Import settings"
    166166msgstr ""
    167167
    168 #: includes/class-madc-admin.php:100
    169 msgid "Expanded Arabic articles with featured images, categories, tags, and excerpts. Images are reused from the product library."
    170 msgstr ""
    171 
    172168#: includes/class-madc-admin.php:101
     169msgid "Demo content language"
     170msgstr ""
     171
     172#: includes/class-madc-admin.php:101
     173msgid "Arabic"
     174msgstr ""
     175
     176#: includes/class-madc-admin.php:101
     177msgid "English"
     178msgstr ""
     179
     180#: includes/class-madc-admin.php:101
     181msgid "Choose the language of imported content. The admin interface keeps your WordPress user language."
     182msgstr ""
     183
     184#: includes/class-madc-admin.php:102
     185msgid "Expanded articles in your selected language with featured images, categories, tags, and excerpts. Images come from the bundled product library."
     186msgstr ""
     187
     188#: includes/class-madc-admin.php:103
    173189msgid "WooCommerce products"
    174190msgstr ""
    175191
    176 #: includes/class-madc-admin.php:101
     192#: includes/class-madc-admin.php:103
    177193msgid "Simple, variable, grouped, digital, and service products with dedicated images and PDF downloads."
    178194msgstr ""
    179195
    180 #: includes/class-madc-admin.php:101
     196#: includes/class-madc-admin.php:103
    181197msgid "Activate WooCommerce to import products."
    182198msgstr ""
    183199
    184 #: includes/class-madc-admin.php:102
     200#: includes/class-madc-admin.php:104
    185201msgid "Customize your import"
    186202msgstr ""
    187203
    188 #: includes/class-madc-admin.php:102
     204#: includes/class-madc-admin.php:104
    189205msgid "Number of articles"
    190206msgstr ""
    191207
    192 #: includes/class-madc-admin.php:102
     208#: includes/class-madc-admin.php:104
    193209msgid "Content status"
    194210msgstr ""
    195211
    196 #: includes/class-madc-admin.php:102
     212#: includes/class-madc-admin.php:104
    197213msgid "Draft — review before publishing"
    198214msgstr ""
    199215
    200 #: includes/class-madc-admin.php:102
     216#: includes/class-madc-admin.php:104
    201217msgid "Published — visible immediately"
    202218msgstr ""
    203219
    204 #: includes/class-madc-admin.php:103
     220#: includes/class-madc-admin.php:105
    205221msgid "Replace text and featured images of previously imported articles. Existing titles and publication status are preserved."
    206222msgstr ""
    207223
    208 #: includes/class-madc-admin.php:104
    209 msgid "Content stays Arabic in either interface language. Existing imports are skipped unless article updates are selected. Items in the trash are always skipped. Prices use your store currency."
    210 msgstr ""
    211 
    212 #: includes/class-madc-admin.php:105
     224#: includes/class-madc-admin.php:106
     225msgid "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."
     226msgstr ""
     227
     228#: includes/class-madc-admin.php:107
    213229msgid "Import demo content"
    214230msgstr ""
    215231
    216 #: includes/class-madc-admin.php:106
     232#: includes/class-madc-admin.php:108
    217233msgid "Import progress"
    218234msgstr ""
    219235
    220 #: includes/class-madc-admin.php:107
     236#: includes/class-madc-admin.php:109
    221237msgid "Finished building your demo?"
    222238msgstr ""
    223239
    224 #: includes/class-madc-admin.php:107
    225 msgid "Delete all tracked demo articles, products, variations, images, PDFs, and unused categories created by this plugin. Deletion is permanent, including any edits you made to these demo items."
    226 msgstr ""
    227 
    228 #: includes/class-madc-admin.php:107
     240#: includes/class-madc-admin.php:109
     241msgid "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."
     242msgstr ""
     243
     244#: includes/class-madc-admin.php:109
    229245msgid "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."
    230246msgstr ""
    231247
    232 #: includes/class-madc-admin.php:107
     248#: includes/class-madc-admin.php:109
    233249msgid "Delete imported demo content"
    234250msgstr ""
    235251
    236 #: includes/class-madc-admin.php:107
     252#: includes/class-madc-admin.php:109
    237253msgid "Cleanup progress"
    238254msgstr ""
    239255
    240 #: includes/class-madc-admin.php:108
     256#: includes/class-madc-admin.php:110
    241257msgid "By Majed Bannani. Imported content and media remain available when the plugin is deactivated or removed."
    242258msgstr ""
    243259
    244 #: includes/class-madc-admin.php:109
     260#: includes/class-madc-admin.php:111
    245261msgid "Made with care, sustained by your support"
    246262msgstr ""
    247263
    248 #: includes/class-madc-admin.php:109
     264#: includes/class-madc-admin.php:111
    249265msgid "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."
    250266msgstr ""
    251267
    252 #: includes/class-madc-admin.php:109
     268#: includes/class-madc-admin.php:111
    253269msgid "Support via PayPal"
    254270msgstr ""
    … …  
    274290msgstr ""
    275291
    276 #: includes/class-madc-importer.php:72
     292#: includes/class-madc-importer.php:73
    277293msgid "You cannot edit this imported item."
    278294msgstr ""
    279295
    280 #: includes/class-madc-importer.php:82
     296#: includes/class-madc-importer.php:83
    281297msgid "The featured image could not be assigned."
    282298msgstr ""
    283299
    284 #: includes/class-madc-importer.php:124
     300#: includes/class-madc-importer.php:125
    285301msgid "A grouped product needs its child products. Restore any trashed demo products and retry."
    286302msgstr ""
  • majed-arabic-demo-content/tags/1.2.0/licenses/THIRD-PARTY-NOTICES.txt

    r3685065 r3685614  
    11Majed Arabic Demo Content - asset provenance and licensing
    22
    3 Original plugin PHP, JavaScript, CSS, Arabic demo text, worksheet layouts,
     3Original plugin PHP, JavaScript, CSS, Arabic and English demo text, worksheet layouts,
    44and project-generated demo images are distributed under GPL version 2 or
    55(at your option) any later version, to the extent copyright applies.
    … …  
    1313
    1414PDF typography
    15 The PDF worksheets in data/downloads embed subsets of Amiri Regular.
     15The Arabic PDF worksheets in data/downloads embed subsets of Amiri Regular.
     16English worksheets use standard PDF Helvetica without bundling a font file.
    1617Copyright 2010-2022 The Amiri Project Authors.
    1718Font license: SIL Open Font License, Version 1.1.
    … …  
    3233arabic-reshaper. Those Python libraries are not installed or executed by
    3334the WordPress plugin. The readable worksheet source text is included in
    34 data/download-texts.json. Release-kit sources include the build script.
     35data/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  
    22/**
    33 * 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.2
     4 * Description: Import ready-made Arabic or English articles and WooCommerce demo products with local images and downloads.
     5 * Version: 1.2.0
    66 * Author: Majed Bannani
    77 * Author URI: https://profiles.wordpress.org/majedbannani/
    … …  
    1616define( 'MADC_PATH', plugin_dir_path( __FILE__ ) );
    1717define( 'MADC_URL', plugin_dir_url( __FILE__ ) );
    18 define( 'MADC_VERSION', '1.1.2' );
     18define( 'MADC_VERSION', '1.2.0' );
    1919require_once MADC_PATH . 'includes/class-madc-importer.php';
    2020require_once MADC_PATH . 'includes/class-madc-cleanup.php';
  • majed-arabic-demo-content/tags/1.2.0/readme.txt

    r3685065 r3685614  
    66Tested up to: 7.1
    77Requires PHP: 7.4
    8 Stable tag: 1.1.2
     8Stable tag: 1.2.0
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1111
    12 Import ready-made Arabic articles and WooCommerce demo products with local images, PDF downloads, and optional cleanup.
     12Import ready-made Arabic or English articles and WooCommerce demo products with local images, PDF downloads, and optional cleanup.
    1313
    1414== Description ==
    1515
    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.
     16Majed 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.
    1717
    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.
     18The 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.
    1919
    20 = Ready-made Arabic articles =
     20= Ready-made articles in two languages =
    2121
    22 * Choose 12 or 24 articles across home, fashion, coffee, and stationery topics.
    23 * Each article contains approximately 394 to 452 Arabic words, 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.
    2424* Includes excerpts, categories, tags, and featured images reused from the bundled product image library.
    2525* Optionally update the text, excerpt, and featured image of previously imported articles while preserving their titles and publication status.
    … …  
    2727= WooCommerce demo products =
    2828
    29 Import 28 parent products:
     29Import 28 parent products per language:
    3030
    3131* 12 physical simple products.
    3232* 4 variable products with 24 size/color variations in total, individual prices, stock quantities, and images.
    3333* 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.
    3535* 4 virtual service products.
    3636
    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.
     37Includes 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.
    3838
    3939WooCommerce 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.
    … …  
    5757= Bundled media and licensing =
    5858
    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 PDFs each contain four printable pages for handwritten planning; they are not interactive forms or confidential files.
     59The 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.
    6060
    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.
     61Original 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.
    6262
    6363== Installation ==
    … …  
    66662. Activate Majed Arabic Demo Content.
    67673. 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.
     684. Choose Arabic or English content, then articles or products. Activate WooCommerce first if you want products.
    69695. Select draft or published status. For articles, choose 12 or 24.
    70706. Click Import demo content and keep the page open until completion.
    … …  
    8282= Are the articles and products translated to English? =
    8383
    84 The administration interface is available in English and Arabic. The bundled demo articles and product descriptions are Arabic.
     84The 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.
    8585
    8686= Will repeated imports create duplicates or overwrite my edits? =
    … …  
    9090= Can I delete everything imported by the plugin? =
    9191
    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.
     92The 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.
    9393
    9494= Are grouped products the same as product bundles? =
    … …  
    1081081. English administration: choose articles or products, set the quantity and status, and optionally update previously imported articles.
    1091092. Arabic administration with RTL layout and translated import and cleanup controls.
    110 3. A bundled Arabic article imported into WordPress with a featured image and expanded text. Its appearance depends on the active theme.
     1103. A bundled article imported into WordPress with a featured image and expanded text. Its appearance depends on the active theme.
    111111
    112112== 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.
    113119
    114120= 1.1.2 =
    … …  
    134140== Upgrade Notice ==
    135141
     142= 1.2.0 =
     143Adds local English content alongside Arabic. Existing Arabic imports remain tracked; cleanup covers both languages.
     144
    136145= 1.1.2 =
    137146Safer diagnostics and reviewed static-analysis exceptions. Import and cleanup protections are preserved.
  • majed-arabic-demo-content/trunk/assets/admin.css

    r3685065 r3685614  
    6767.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%}}
    6868.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  
    2828        event.preventDefault();
    2929        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};
    3131        const result = document.querySelector('#madc-result');
    3232        const progress = document.querySelector('#madc-progress');
  • majed-arabic-demo-content/trunk/includes/class-madc-admin.php

    r3685065 r3685614  
    2121            'cleanupFailed' => __( 'Cleanup stopped. Retry to continue.', 'majed-arabic-demo-content' ),
    2222            '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' ),
    2424            'nothing' => __( 'There is no tracked demo content to delete.', 'majed-arabic-demo-content' ),
    2525            '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' ) ),
    … …  
    4141        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(
    4242            'kind' => array( 'required' => true, 'type' => 'string', 'enum' => array( 'posts', 'products' ) ),
     43            'language' => array( 'type' => 'string', 'enum' => array( 'ar', 'en' ), 'default' => 'ar' ),
    4344            'refresh' => array( 'type' => 'boolean', 'default' => false ),
    4445            'quantity' => array( 'required' => true, 'type' => 'integer', 'enum' => array( 12, 24 ) ),
    … …  
    6667            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 ) );
    6768        }
    68         $items = MADC_Importer::items( $kind, (int) $request['quantity'] );
     69        $items = MADC_Importer::items( $kind, (int) $request['quantity'], $request['language'] );
    6970        $index = (int) $request['index'];
    7071        if ( ! isset( $items[ $index ] ) ) { return new WP_Error( 'madc_index', __( 'Invalid import item.', 'majed-arabic-demo-content' ), array( 'status' => 400 ) ); }
    … …  
    9596        ?>
    9697        <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>
    99100        <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>
    101103        <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>
    102104        <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>
    103105        <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 always skipped. 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>
    105107        <button type="submit" class="button button-primary"><?php esc_html_e( 'Import demo content', 'majed-arabic-demo-content' ); ?></button></section></fieldset></form>
    106108        <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 any 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>
     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>
    108110        <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>
    109111        <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  
    1111
    1212    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 ) {
    1515            $allowed['product'][] = $p['id'];
    1616            foreach ( $p['variations'] ?? array() as $v ) { $allowed['product_variation'][] = $v['id']; }
    1717        }
    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 ); }
    1919        $items = array();
    2020        // A fixed bundled catalog limits which ownership markers are accepted, including older releases.
    … …  
    4949            foreach ( $terms as $id ) { $items[] = array( 'kind' => 'term', 'id' => (int) $id, 'taxonomy' => $taxonomy ); }
    5050        }
    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 ) {
    5252            if ( get_option( 'madc_download_' . $download['id'] ) ) { $items[] = array( 'kind' => 'download', 'key' => $download['id'] ); }
    5353        }
    … …  
    8888            $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.
    8989            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.
    9191            foreach ( $options as $value ) { if ( self::contains_id( $value, $id ) ) { return true; } }
    9292            $block = '%"id":' . absint( $id ) . '%';
  • majed-arabic-demo-content/trunk/includes/class-madc-importer.php

    r3685065 r3685614  
    33
    44final 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 );
    77    }
    8     public static function items( $kind, $quantity ) {
     8    public static function items( $kind, $quantity, $language = 'ar' ) {
    99        if ( 'posts' === $kind ) {
    10             $presets = self::data( 'article-presets' );
     10            $presets = self::data( 'article-presets', $language );
    1111            $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 ); } ) );
    1313        }
    14         $products = self::data( 'products' );
     14        $products = self::data( 'products', $language );
    1515        usort( $products, static function ( $a, $b ) { return (int) ( 'grouped' === $a['type'] ) <=> (int) ( 'grouped' === $b['type'] ); } );
    1616        return $products;
    … …  
    2424        return $result;
    2525    }
    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 );
    2828        $out = array();
    2929        foreach ( array_merge( $data['categories'], $data['tags'] ) as $term ) {
    … …  
    3838        return $out;
    3939    }
    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 );
    4242        $id = self::existing( $key, 'attachment' );
    4343        if ( $id && is_file( (string) get_attached_file( $id ) ) ) { return $id; }
    … …  
    6565    }
    6666    public static function run( $kind, $item, $status, $refresh = false ) {
     67        $language = isset( $item['language'] ) && 'en' === $item['language'] ? 'en' : 'ar';
    6768        $type = 'posts' === $kind ? 'post' : 'product';
    6869        $id = self::existing( $item['id'], $type );
    … …  
    7879                self::checked( wp_update_post( array( 'ID' => $id, 'post_content' => wp_kses_post( $item['content_html'] ), 'post_excerpt' => $item['excerpt'] ), true ) );
    7980            }
    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 );
    8182            set_post_thumbnail( $id, $image_id );
    8283            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' );
    8485            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' ) );
    8788            self::checked( wp_update_post( array( 'ID' => $id, 'post_status' => $status ), true ) );
    8889            }
    … …  
    103104            $p->set_virtual( $item['virtual'] );
    104105            $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 ) );
    107108            if ( isset( $item['regular_price'] ) ) { $p->set_regular_price( (string) $item['regular_price'] ); }
    108109            if ( isset( $item['stock_quantity'] ) ) {
    … …  
    110111                $p->set_stock_status( $item['stock_quantity'] > 0 ? 'instock' : 'outofstock' );
    111112            }
    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 ) );
    113114            $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 ); }
    115116            $p->set_gallery_image_ids( $gallery );
    116117            if ( $item['downloadable'] ) {
    … …  
    145146                    $variation->set_description( $v['description'] ); $variation->set_status( 'publish' );
    146147                    $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 ) );
    148149                    $variation->update_meta_data( '_madc_key', $v['id'] ); $variation->save();
    149150                }
  • majed-arabic-demo-content/trunk/languages/majed-arabic-demo-content-ar.po

    r3685065 r3685614  
    22msgid ""
    33msgstr ""
    4 "Project-Id-Version: Majed Arabic Demo Content 1.1.2\n"
     4"Project-Id-Version: Majed Arabic Demo Content 1.2.0\n"
    55"Last-Translator: Majed Bannani\n"
    66"Language-Team: Arabic\n"
    … …  
    1111"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"
    1212
     13#. Plugin Name of the plugin
    1314#: majed-arabic-demo-content.php
    1415msgid "Majed Arabic Demo Content"
    1516msgstr "محتوى عربي تجريبي من ماجد"
    1617
     18#. Description of the plugin
    1719#: majed-arabic-demo-content.php
    1820msgid ""
    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."
     23msgstr ""
     24"استورد مقالات جاهزة بالعربية أو الإنجليزية ومنتجات ووكومرس تجريبية مع صور "
     25"وملفات تنزيل محلية."
     26
     27#. Author of the plugin
    2428#: majed-arabic-demo-content.php
    2529msgid "Majed Bannani"
    2630msgstr "ماجد بناني"
    2731
     32#. Author URI of the plugin
    2833#: majed-arabic-demo-content.php
    2934msgid "https://profiles.wordpress.org/majedbannani/"
    3035msgstr "https://profiles.wordpress.org/majedbannani/"
    3136
    32 #: includes/class-madc-admin.php:10 includes/class-madc-admin.php:88
     37#: includes/class-madc-admin.php:10 includes/class-madc-admin.php:98
    3338msgid "Arabic Demo Content"
    3439msgstr "محتوى عربي تجريبي"
    … …  
    6065#: includes/class-madc-admin.php:23
    6166msgid ""
    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."
     70msgstr ""
     71"هل تريد حذف العناصر التجريبية المستوردة التالية باللغتين نهائيًا؟ يشمل ذلك "
     72"تعديلات المقالات والمنتجات التجريبية. تُحفظ الوسائط المشتركة والتصنيفات "
     73"المستخدمة. لا يمكن التراجع عن الحذف."
    6974
    7075#: includes/class-madc-admin.php:24
    … …  
    7277msgstr "لا يوجد محتوى تجريبي مسجّل لحذفه."
    7378
    74 #: includes/class-madc-admin.php:25 includes/class-madc-admin.php:91
     79#: includes/class-madc-admin.php:25 includes/class-madc-admin.php:102
    7580msgid "Articles"
    7681msgstr "المقالات"
    … …  
    116121msgstr "مستورد مسبقًا"
    117122
    118 #: includes/class-madc-admin.php:52 includes/class-madc-admin.php:74
     123#: includes/class-madc-admin.php:53 includes/class-madc-admin.php:75
    119124msgid "Another import is running. Please retry shortly."
    120125msgstr "توجد عملية استيراد قيد التنفيذ. أعد المحاولة بعد قليل."
    121126
    122 #: includes/class-madc-admin.php:58
     127#: includes/class-madc-admin.php:59
    123128msgid ""
    124129"Cleanup could not finish. Check file permissions and ensure WooCommerce is "
    … …  
    127132"تعذر إكمال الحذف. تحقق من صلاحيات الملفات وتفعيل ووكومرس، ثم أعد المحاولة."
    128133
    129 #: includes/class-madc-admin.php:63
     134#: includes/class-madc-admin.php:64
    130135msgid "Finish the current cleanup before importing content."
    131136msgstr "أكمل عملية الحذف الحالية قبل استيراد المحتوى."
    132137
    133 #: includes/class-madc-admin.php:66
     138#: includes/class-madc-admin.php:67
    134139msgid ""
    135140"You cannot import this content. Products require WooCommerce and the "
    … …  
    139144"المناسبة."
    140145
    141 #: includes/class-madc-admin.php:70
     146#: includes/class-madc-admin.php:71
    142147msgid "Invalid import item."
    143148msgstr "عنصر الاستيراد غير صالح."
    144149
    145 #: includes/class-madc-admin.php:81
     150#: includes/class-madc-admin.php:82
    146151msgid ""
    147152"Import failed. Check upload permissions, available storage, and any trashed "
    … …  
    151156"التجريبية في سلة المهملات، ثم أعد المحاولة."
    152157
    153 #: includes/class-madc-admin.php:88
    154 msgid "Build a realistic demo with ready-made Arabic content."
    155 msgstr "جهّز موقعك التجريبي بمحتوى عربي جاهز ومنوّع."
    156 
    157 #: includes/class-madc-admin.php:89
    158 msgid "24 articles"
    159 msgstr "٢٤ مقالة"
    160 
    161 #: includes/class-madc-admin.php:89
    162 msgid "28 products"
    163 msgstr "٢٨ منتجًا"
    164 
    165 #: includes/class-madc-admin.php:89
     158#: includes/class-madc-admin.php:98
     159msgid "Build a realistic demo with ready-made Arabic or English content."
     160msgstr "جهّز موقعك التجريبي بمحتوى جاهز بالعربية أو الإنجليزية."
     161
     162#: includes/class-madc-admin.php:99
     163msgid "24 articles per language"
     164msgstr "٢٤ مقالة لكل لغة"
     165
     166#: includes/class-madc-admin.php:99
     167msgid "28 products per language"
     168msgstr "٢٨ منتجًا لكل لغة"
     169
     170#: includes/class-madc-admin.php:99
    166171msgid "60 product images"
    167172msgstr "٦٠ صورة للمنتجات"
    168173
    169 #: includes/class-madc-admin.php:89
     174#: includes/class-madc-admin.php:99
    170175msgid "Works offline"
    171176msgstr "يعمل دون اتصال خارجي"
    172177
    173 #: includes/class-madc-admin.php:90
     178#: includes/class-madc-admin.php:100
    174179msgid "Import settings"
    175180msgstr "إعدادات الاستيراد"
    176181
    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
     183msgid "Demo content language"
     184msgstr "لغة المحتوى التجريبي"
     185
     186#: includes/class-madc-admin.php:101
     187msgid "Arabic"
     188msgstr "العربية"
     189
     190#: includes/class-madc-admin.php:101
     191msgid "English"
     192msgstr "الإنجليزية"
     193
     194#: includes/class-madc-admin.php:101
     195msgid ""
     196"Choose the language of imported content. The admin interface keeps your "
     197"WordPress user language."
     198msgstr "اختر لغة المحتوى المستورد. تبقى لغة الواجهة حسب لغة مستخدم ووردبريس."
     199
     200#: includes/class-madc-admin.php:102
     201msgid ""
     202"Expanded articles in your selected language with featured images, "
     203"categories, tags, and excerpts. Images come from the bundled product "
     204"library."
     205msgstr ""
     206"مقالات موسّعة باللغة المختارة مع صور بارزة وتصنيفات ووسوم ومقتطفات. الصور من"
     207" مكتبة المنتجات المرفقة."
     208
     209#: includes/class-madc-admin.php:103
    186210msgid "WooCommerce products"
    187211msgstr "منتجات ووكومرس"
    188212
    189 #: includes/class-madc-admin.php:92
     213#: includes/class-madc-admin.php:103
    190214msgid ""
    191215"Simple, variable, grouped, digital, and service products with dedicated "
    … …  
    194218"منتجات بسيطة ومتغيرة ومجمّعة ورقمية وخدمات، مع صور خاصة وملفات PDF للتنزيل."
    195219
    196 #: includes/class-madc-admin.php:92
     220#: includes/class-madc-admin.php:103
    197221msgid "Activate WooCommerce to import products."
    198222msgstr "فعّل ووكومرس لاستيراد المنتجات."
    199223
    200 #: includes/class-madc-admin.php:93
     224#: includes/class-madc-admin.php:104
    201225msgid "Customize your import"
    202226msgstr "خصّص عملية الاستيراد"
    203227
    204 #: includes/class-madc-admin.php:93
     228#: includes/class-madc-admin.php:104
    205229msgid "Number of articles"
    206230msgstr "عدد المقالات"
    207231
    208 #: includes/class-madc-admin.php:93
     232#: includes/class-madc-admin.php:104
    209233msgid "Content status"
    210234msgstr "حالة المحتوى"
    211235
    212 #: includes/class-madc-admin.php:93
     236#: includes/class-madc-admin.php:104
    213237msgid "Draft — review before publishing"
    214238msgstr "مسودة — راجع المحتوى قبل النشر"
    215239
    216 #: includes/class-madc-admin.php:93
     240#: includes/class-madc-admin.php:104
    217241msgid "Published — visible immediately"
    218242msgstr "منشور — يظهر مباشرة"
    219243
    220 #: includes/class-madc-admin.php:94
     244#: includes/class-madc-admin.php:105
    221245msgid ""
    222246"Replace text and featured images of previously imported articles. Existing "
    … …  
    226250"بالعناوين وحالة النشر الحالية."
    227251
    228 #: includes/class-madc-admin.php:95
    229 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
     253msgid ""
     254"Arabic and English content can coexist. Existing imports in the selected "
     255"language are skipped unless article updates are selected. Trashed items are "
    232256"skipped. Prices use your store currency."
    233257msgstr ""
    234 "يبقى المحتوى عربيًا في الواجهتين. يُتجاوز المحتوى الموجود ما لم تختر تحديث "
    235 "المقالات. تُتجاوز عناصر سلة المهملات دائمًا. الأسعار بعملة متجرك."
    236 
    237 #: includes/class-madc-admin.php:96
     258"يمكن استيراد المحتوى العربي والإنجليزي معًا. يُتجاوز المحتوى الموجود باللغة "
     259"المختارة ما لم تختر تحديث المقالات، وتُتجاوز عناصر سلة المهملات. الأسعار "
     260"بعملة متجرك."
     261
     262#: includes/class-madc-admin.php:107
    238263msgid "Import demo content"
    239264msgstr "استيراد المحتوى التجريبي"
    240265
    241 #: includes/class-madc-admin.php:97
     266#: includes/class-madc-admin.php:108
    242267msgid "Import progress"
    243268msgstr "تقدم الاستيراد"
    244269
    245 #: includes/class-madc-admin.php:98
     270#: includes/class-madc-admin.php:109
    246271msgid "Finished building your demo?"
    247272msgstr "انتهيت من تطوير موقعك التجريبي؟"
    248273
    249 #: includes/class-madc-admin.php:98
     274#: includes/class-madc-admin.php:109
    250275msgid ""
    251276"Delete all tracked demo articles, products, variations, images, PDFs, and "
    252 "unused categories created by this plugin. Deletion is permanent, including "
    253 "any edits you made to these demo items."
    254 msgstr ""
    255 "احذف المقالات والمنتجات والمتغيرات والصور وملفات PDF والتصنيفات غير "
    256 "المستخدمة التي أنشأتها الإضافة وسجّلتها. الحذف نهائي ويشمل التعديلات التي "
    257 "أجريتها على هذه العناصر التجريبية."
    258 
    259 #: includes/class-madc-admin.php:98
     277"unused categories in both languages. Deletion is permanent, including edits "
     278"you made to these demo items."
     279msgstr ""
     280"احذف جميع المقالات والمنتجات والمتغيرات والصور وملفات PDF والتصنيفات غير "
     281"المستخدمة التي تتعقبها الإضافة باللغتين. الحذف نهائي ويشمل تعديلاتك على هذه "
     282"العناصر التجريبية."
     283
     284#: includes/class-madc-admin.php:109
    260285msgid ""
    261286"Other content is kept. Media referenced by remaining content and categories "
    … …  
    267292" تكن مسجّلة."
    268293
    269 #: includes/class-madc-admin.php:98
     294#: includes/class-madc-admin.php:109
    270295msgid "Delete imported demo content"
    271296msgstr "حذف المحتوى التجريبي المستورد"
    272297
    273 #: includes/class-madc-admin.php:98
     298#: includes/class-madc-admin.php:109
    274299msgid "Cleanup progress"
    275300msgstr "تقدم الحذف"
    276301
    277 #: includes/class-madc-admin.php:99
     302#: includes/class-madc-admin.php:110
    278303msgid ""
    279304"By Majed Bannani. Imported content and media remain available when the "
    … …  
    283308"حذفها."
    284309
    285 #: includes/class-madc-admin.php:100
     310#: includes/class-madc-admin.php:111
    286311msgid "Made with care, sustained by your support"
    287312msgstr "صُنعت بعناية، وتستمر بدعمك"
    288313
    289 #: includes/class-madc-admin.php:100
     314#: includes/class-madc-admin.php:111
    290315msgid ""
    291316"This plugin is free and grows with the support of its users. If it has "
    … …  
    296321"موقعك، يمكنك المساهمة في استمرار تطويرها وإضافة أدوات جديدة."
    297322
    298 #: includes/class-madc-admin.php:100
     323#: includes/class-madc-admin.php:111
    299324msgid "Support via PayPal"
    300325msgstr "الدعم عبر PayPal"
    … …  
    312337msgstr "فعّل ووكومرس قبل حذف المنتجات المستوردة."
    313338
    314 #: includes/class-madc-cleanup.php:125
     339#: includes/class-madc-cleanup.php:148
    315340msgid "The cleanup preview expired. Preview the cleanup again."
    316341msgstr "انتهت صلاحية معاينة الحذف. اعرض المعاينة من جديد."
    … …  
    324349msgstr "أحد ملفات التنزيل المرفقة غير موجود."
    325350
    326 #: includes/class-madc-importer.php:72
     351#: includes/class-madc-importer.php:73
    327352msgid "You cannot edit this imported item."
    328353msgstr "لا تملك صلاحية تعديل هذا العنصر المستورد."
    329354
    330 #: includes/class-madc-importer.php:82
     355#: includes/class-madc-importer.php:83
    331356msgid "The featured image could not be assigned."
    332357msgstr "تعذر تعيين الصورة البارزة."
    333358
    334 #: includes/class-madc-importer.php:124
     359#: includes/class-madc-importer.php:125
    335360msgid ""
    336361"A grouped product needs its child products. Restore any trashed demo "
  • majed-arabic-demo-content/trunk/languages/majed-arabic-demo-content.pot

    r3685065 r3685614  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Majed Arabic Demo Content 1.1.2\n"
     5"Project-Id-Version: Majed Arabic Demo Content 1.2.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/majed-arabic-demo-content\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-09-05T16:08:38+00:00\n"
     12"POT-Creation-Date: 2026-09-07T20:08:27+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    2222#. Description of the plugin
    2323#: majed-arabic-demo-content.php
    24 msgid "Import ready-made Arabic articles and WooCommerce demo products with local images and downloads."
     24msgid "Import ready-made Arabic or English articles and WooCommerce demo products with local images and downloads."
    2525msgstr ""
    2626
    … …  
    3636
    3737#: includes/class-madc-admin.php:10
    38 #: includes/class-madc-admin.php:97
     38#: includes/class-madc-admin.php:98
    3939msgid "Arabic Demo Content"
    4040msgstr ""
    … …  
    6565
    6666#: 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."
     67msgid "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."
    6868msgstr ""
    6969
    … …  
    7373
    7474#: includes/class-madc-admin.php:25
    75 #: includes/class-madc-admin.php:100
     75#: includes/class-madc-admin.php:102
    7676msgid "Articles"
    7777msgstr ""
    … …  
    117117msgstr ""
    118118
    119 #: includes/class-madc-admin.php:52
    120 #: includes/class-madc-admin.php:74
     119#: includes/class-madc-admin.php:53
     120#: includes/class-madc-admin.php:75
    121121msgid "Another import is running. Please retry shortly."
    122122msgstr ""
    123123
    124 #: includes/class-madc-admin.php:58
     124#: includes/class-madc-admin.php:59
    125125msgid "Cleanup could not finish. Check file permissions and ensure WooCommerce is active, then retry."
    126126msgstr ""
    127127
    128 #: includes/class-madc-admin.php:63
     128#: includes/class-madc-admin.php:64
    129129msgid "Finish the current cleanup before importing content."
    130130msgstr ""
    131131
    132 #: includes/class-madc-admin.php:66
     132#: includes/class-madc-admin.php:67
    133133msgid "You cannot import this content. Products require WooCommerce and the appropriate permissions."
    134134msgstr ""
    135135
    136 #: includes/class-madc-admin.php:70
     136#: includes/class-madc-admin.php:71
    137137msgid "Invalid import item."
    138138msgstr ""
    139139
    140 #: includes/class-madc-admin.php:81
     140#: includes/class-madc-admin.php:82
    141141msgid "Import failed. Check upload permissions, available storage, and any trashed demo products, then retry."
    142142msgstr ""
    143143
    144 #: includes/class-madc-admin.php:97
    145 msgid "Build a realistic demo with ready-made Arabic content."
    146 msgstr ""
    147 
    148144#: 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
     145msgid "Build a realistic demo with ready-made Arabic or English content."
     146msgstr ""
     147
     148#: includes/class-madc-admin.php:99
     149msgid "24 articles per language"
     150msgstr ""
     151
     152#: includes/class-madc-admin.php:99
     153msgid "28 products per language"
     154msgstr ""
     155
     156#: includes/class-madc-admin.php:99
    157157msgid "60 product images"
    158158msgstr ""
    159159
    160 #: includes/class-madc-admin.php:98
     160#: includes/class-madc-admin.php:99
    161161msgid "Works offline"
    162162msgstr ""
    163163
    164 #: includes/class-madc-admin.php:99
     164#: includes/class-madc-admin.php:100
    165165msgid "Import settings"
    166166msgstr ""
    167167
    168 #: includes/class-madc-admin.php:100
    169 msgid "Expanded Arabic articles with featured images, categories, tags, and excerpts. Images are reused from the product library."
    170 msgstr ""
    171 
    172168#: includes/class-madc-admin.php:101
     169msgid "Demo content language"
     170msgstr ""
     171
     172#: includes/class-madc-admin.php:101
     173msgid "Arabic"
     174msgstr ""
     175
     176#: includes/class-madc-admin.php:101
     177msgid "English"
     178msgstr ""
     179
     180#: includes/class-madc-admin.php:101
     181msgid "Choose the language of imported content. The admin interface keeps your WordPress user language."
     182msgstr ""
     183
     184#: includes/class-madc-admin.php:102
     185msgid "Expanded articles in your selected language with featured images, categories, tags, and excerpts. Images come from the bundled product library."
     186msgstr ""
     187
     188#: includes/class-madc-admin.php:103
    173189msgid "WooCommerce products"
    174190msgstr ""
    175191
    176 #: includes/class-madc-admin.php:101
     192#: includes/class-madc-admin.php:103
    177193msgid "Simple, variable, grouped, digital, and service products with dedicated images and PDF downloads."
    178194msgstr ""
    179195
    180 #: includes/class-madc-admin.php:101
     196#: includes/class-madc-admin.php:103
    181197msgid "Activate WooCommerce to import products."
    182198msgstr ""
    183199
    184 #: includes/class-madc-admin.php:102
     200#: includes/class-madc-admin.php:104
    185201msgid "Customize your import"
    186202msgstr ""
    187203
    188 #: includes/class-madc-admin.php:102
     204#: includes/class-madc-admin.php:104
    189205msgid "Number of articles"
    190206msgstr ""
    191207
    192 #: includes/class-madc-admin.php:102
     208#: includes/class-madc-admin.php:104
    193209msgid "Content status"
    194210msgstr ""
    195211
    196 #: includes/class-madc-admin.php:102
     212#: includes/class-madc-admin.php:104
    197213msgid "Draft — review before publishing"
    198214msgstr ""
    199215
    200 #: includes/class-madc-admin.php:102
     216#: includes/class-madc-admin.php:104
    201217msgid "Published — visible immediately"
    202218msgstr ""
    203219
    204 #: includes/class-madc-admin.php:103
     220#: includes/class-madc-admin.php:105
    205221msgid "Replace text and featured images of previously imported articles. Existing titles and publication status are preserved."
    206222msgstr ""
    207223
    208 #: includes/class-madc-admin.php:104
    209 msgid "Content stays Arabic in either interface language. Existing imports are skipped unless article updates are selected. Items in the trash are always skipped. Prices use your store currency."
    210 msgstr ""
    211 
    212 #: includes/class-madc-admin.php:105
     224#: includes/class-madc-admin.php:106
     225msgid "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."
     226msgstr ""
     227
     228#: includes/class-madc-admin.php:107
    213229msgid "Import demo content"
    214230msgstr ""
    215231
    216 #: includes/class-madc-admin.php:106
     232#: includes/class-madc-admin.php:108
    217233msgid "Import progress"
    218234msgstr ""
    219235
    220 #: includes/class-madc-admin.php:107
     236#: includes/class-madc-admin.php:109
    221237msgid "Finished building your demo?"
    222238msgstr ""
    223239
    224 #: includes/class-madc-admin.php:107
    225 msgid "Delete all tracked demo articles, products, variations, images, PDFs, and unused categories created by this plugin. Deletion is permanent, including any edits you made to these demo items."
    226 msgstr ""
    227 
    228 #: includes/class-madc-admin.php:107
     240#: includes/class-madc-admin.php:109
     241msgid "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."
     242msgstr ""
     243
     244#: includes/class-madc-admin.php:109
    229245msgid "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."
    230246msgstr ""
    231247
    232 #: includes/class-madc-admin.php:107
     248#: includes/class-madc-admin.php:109
    233249msgid "Delete imported demo content"
    234250msgstr ""
    235251
    236 #: includes/class-madc-admin.php:107
     252#: includes/class-madc-admin.php:109
    237253msgid "Cleanup progress"
    238254msgstr ""
    239255
    240 #: includes/class-madc-admin.php:108
     256#: includes/class-madc-admin.php:110
    241257msgid "By Majed Bannani. Imported content and media remain available when the plugin is deactivated or removed."
    242258msgstr ""
    243259
    244 #: includes/class-madc-admin.php:109
     260#: includes/class-madc-admin.php:111
    245261msgid "Made with care, sustained by your support"
    246262msgstr ""
    247263
    248 #: includes/class-madc-admin.php:109
     264#: includes/class-madc-admin.php:111
    249265msgid "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."
    250266msgstr ""
    251267
    252 #: includes/class-madc-admin.php:109
     268#: includes/class-madc-admin.php:111
    253269msgid "Support via PayPal"
    254270msgstr ""
    … …  
    274290msgstr ""
    275291
    276 #: includes/class-madc-importer.php:72
     292#: includes/class-madc-importer.php:73
    277293msgid "You cannot edit this imported item."
    278294msgstr ""
    279295
    280 #: includes/class-madc-importer.php:82
     296#: includes/class-madc-importer.php:83
    281297msgid "The featured image could not be assigned."
    282298msgstr ""
    283299
    284 #: includes/class-madc-importer.php:124
     300#: includes/class-madc-importer.php:125
    285301msgid "A grouped product needs its child products. Restore any trashed demo products and retry."
    286302msgstr ""
  • majed-arabic-demo-content/trunk/licenses/THIRD-PARTY-NOTICES.txt

    r3685065 r3685614  
    11Majed Arabic Demo Content - asset provenance and licensing
    22
    3 Original plugin PHP, JavaScript, CSS, Arabic demo text, worksheet layouts,
     3Original plugin PHP, JavaScript, CSS, Arabic and English demo text, worksheet layouts,
    44and project-generated demo images are distributed under GPL version 2 or
    55(at your option) any later version, to the extent copyright applies.
    … …  
    1313
    1414PDF typography
    15 The PDF worksheets in data/downloads embed subsets of Amiri Regular.
     15The Arabic PDF worksheets in data/downloads embed subsets of Amiri Regular.
     16English worksheets use standard PDF Helvetica without bundling a font file.
    1617Copyright 2010-2022 The Amiri Project Authors.
    1718Font license: SIL Open Font License, Version 1.1.
    … …  
    3233arabic-reshaper. Those Python libraries are not installed or executed by
    3334the WordPress plugin. The readable worksheet source text is included in
    34 data/download-texts.json. Release-kit sources include the build script.
     35data/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  
    22/**
    33 * 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.2
     4 * Description: Import ready-made Arabic or English articles and WooCommerce demo products with local images and downloads.
     5 * Version: 1.2.0
    66 * Author: Majed Bannani
    77 * Author URI: https://profiles.wordpress.org/majedbannani/
    … …  
    1616define( 'MADC_PATH', plugin_dir_path( __FILE__ ) );
    1717define( 'MADC_URL', plugin_dir_url( __FILE__ ) );
    18 define( 'MADC_VERSION', '1.1.2' );
     18define( 'MADC_VERSION', '1.2.0' );
    1919require_once MADC_PATH . 'includes/class-madc-importer.php';
    2020require_once MADC_PATH . 'includes/class-madc-cleanup.php';
  • majed-arabic-demo-content/trunk/readme.txt

    r3685065 r3685614  
    66Tested up to: 7.1
    77Requires PHP: 7.4
    8 Stable tag: 1.1.2
     8Stable tag: 1.2.0
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1111
    12 Import ready-made Arabic articles and WooCommerce demo products with local images, PDF downloads, and optional cleanup.
     12Import ready-made Arabic or English articles and WooCommerce demo products with local images, PDF downloads, and optional cleanup.
    1313
    1414== Description ==
    1515
    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.
     16Majed 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.
    1717
    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.
     18The 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.
    1919
    20 = Ready-made Arabic articles =
     20= Ready-made articles in two languages =
    2121
    22 * Choose 12 or 24 articles across home, fashion, coffee, and stationery topics.
    23 * Each article contains approximately 394 to 452 Arabic words, 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.
    2424* Includes excerpts, categories, tags, and featured images reused from the bundled product image library.
    2525* Optionally update the text, excerpt, and featured image of previously imported articles while preserving their titles and publication status.
    … …  
    2727= WooCommerce demo products =
    2828
    29 Import 28 parent products:
     29Import 28 parent products per language:
    3030
    3131* 12 physical simple products.
    3232* 4 variable products with 24 size/color variations in total, individual prices, stock quantities, and images.
    3333* 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.
    3535* 4 virtual service products.
    3636
    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.
     37Includes 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.
    3838
    3939WooCommerce 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.
    … …  
    5757= Bundled media and licensing =
    5858
    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 PDFs each contain four printable pages for handwritten planning; they are not interactive forms or confidential files.
     59The 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.
    6060
    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.
     61Original 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.
    6262
    6363== Installation ==
    … …  
    66662. Activate Majed Arabic Demo Content.
    67673. 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.
     684. Choose Arabic or English content, then articles or products. Activate WooCommerce first if you want products.
    69695. Select draft or published status. For articles, choose 12 or 24.
    70706. Click Import demo content and keep the page open until completion.
    … …  
    8282= Are the articles and products translated to English? =
    8383
    84 The administration interface is available in English and Arabic. The bundled demo articles and product descriptions are Arabic.
     84The 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.
    8585
    8686= Will repeated imports create duplicates or overwrite my edits? =
    … …  
    9090= Can I delete everything imported by the plugin? =
    9191
    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.
     92The 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.
    9393
    9494= Are grouped products the same as product bundles? =
    … …  
    1081081. English administration: choose articles or products, set the quantity and status, and optionally update previously imported articles.
    1091092. Arabic administration with RTL layout and translated import and cleanup controls.
    110 3. A bundled Arabic article imported into WordPress with a featured image and expanded text. Its appearance depends on the active theme.
     1103. A bundled article imported into WordPress with a featured image and expanded text. Its appearance depends on the active theme.
    111111
    112112== 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.
    113119
    114120= 1.1.2 =
    … …  
    134140== Upgrade Notice ==
    135141
     142= 1.2.0 =
     143Adds local English content alongside Arabic. Existing Arabic imports remain tracked; cleanup covers both languages.
     144
    136145= 1.1.2 =
    137146Safer diagnostics and reviewed static-analysis exceptions. Import and cleanup protections are preserved.
Note: See TracChangeset for help on using the changeset viewer.