Plugin Directory

Changeset 3232920


Ignore:
Timestamp:
01/31/2025 08:56:16 PM (14 months ago)
Author:
devbook
Message:

update to v.1.1

Location:
quick-embed-pdf
Files:
40 added
4 edited

Legend:

Unmodified
Added
Removed
  • quick-embed-pdf/trunk/includes/class-qepw-admin.php

    r3215305 r3232920  
    4242    }
    4343
     44    public static function render_usage_instructions() {
     45        ?>
     46        <div>
     47            <h3>1. Embedding in Classic Editor</h3>
     48            <p>To embed a PDF file in a post or page using the plugin, use the following shortcode. Example:</p>
     49            <code>[qepw_pdf_viewer file="YOUR_PDF_FILE_URL"]</code>
     50            <p>Replace <code>YOUR_PDF_FILE_URL</code> with the actual URL of your PDF file.</p>
     51
     52            <h3>2. Embedding in Gutenberg Editor</h3>
     53            <p>In the Gutenberg editor, use the "Quick Embed PDF" block. It is available in the "Embed" category in the block menu. After adding the block, select a PDF from your media library or upload a new one.</p>
     54
     55            <h3>3. Manually Embedding the Shortcode</h3>
     56            <p>If you want to manually embed a PDF file at any place in the content, use the following shortcode:</p>
     57            <code>[qepw_pdf_viewer file="YOUR_PDF_FILE_URL"]</code>
     58            <p>Replace <code>YOUR_PDF_FILE_URL</code> with the link to your PDF file.</p>
     59        </div>
     60        <?php
     61    }
     62
    4463    public static function settings_page() {
    4564        ?>
     
    4968                <?php
    5069                settings_fields( 'qepw_settings' );
    51                 do_settings_sections( 'qepw_settings' );
    5270                ?>
    5371                <table class="form-table">
     
    7492                <?php submit_button(); ?>
    7593            </form>
     94
     95            <h2>Plugin Usage</h2>
     96            <div>
     97                <?php self::render_usage_instructions(); ?>
     98            </div>
    7699        </div>
    77100        <?php
  • quick-embed-pdf/trunk/includes/class-qepw-viewer.php

    r3215305 r3232920  
    99        add_action( 'wp_enqueue_scripts', [ self::class, 'conditionally_enqueue_assets' ] );
    1010        add_filter( 'media_send_to_editor', [ self::class, 'replace_pdf_with_shortcode' ], 10, 3 );
     11       
     12       
     13        add_action( 'enqueue_block_editor_assets', [ self::class, 'enqueue_block_editor_assets' ] );
     14    }
     15
     16    public static function enqueue_block_editor_assets() {
     17       
     18        wp_enqueue_script(
     19            'qepw-gutenberg-block',
     20            QEPW_PLUGIN_URL . 'assets/js/block.js', 
     21            [ 'wp-blocks', 'wp-element', 'wp-editor', 'wp-components' ],
     22            QEPW_VERSION,
     23            true
     24        );
     25
     26       
     27        wp_enqueue_style(
     28            'qepw-gutenberg-block-style',
     29            QEPW_PLUGIN_URL . 'assets/css/block.css',
     30            [],
     31            QEPW_VERSION
     32        );
    1133    }
    1234
     
    1840        global $post;
    1941        if ( has_shortcode( $post->post_content, 'qepw_pdf_viewer' ) ) {
    20            
    21            
    2242            wp_register_style(
    2343                'qepw-viewer-css',
     
    2848            wp_enqueue_style( 'qepw-viewer-css' );
    2949
    30          
    3150            wp_register_script(
    3251                'qepw-pdfjs-lib',
     
    3857            wp_enqueue_script( 'qepw-pdfjs-lib' );
    3958
    40            
    4159            wp_register_script(
    4260                'qepw-viewer-js',
     
    4765            );
    4866
    49            
    5067            wp_localize_script(
    5168                'qepw-viewer-js',
     
    5673            );
    5774
    58            
    5975            wp_enqueue_script( 'qepw-viewer-js' );
    6076
    61            
    6277            $pdf_width = intval( get_option( 'qepw_width', 800 ) );
    6378            add_action( 'wp_head', function () use ( $pdf_width ) {
  • quick-embed-pdf/trunk/quick-embed-pdf.php

    r3215305 r3232920  
    33 * Plugin Name: Quick Embed PDF
    44 * Description: A lightweight plugin to embed and display PDF files directly in WordPress posts and pages using a shortcode.
    5  * Version: 1.0
     5 * Version: 1.1
    66 * Author: Mark
    77 * License: GPL-2.0+
     
    1313}
    1414
    15 define( 'QEPW_VERSION', '1.0.1' );
     15define( 'QEPW_VERSION', '1.1' );
    1616define( 'QEPW_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    1717define( 'QEPW_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
  • quick-embed-pdf/trunk/readme.txt

    r3215305 r3232920  
    1 === Quick Embed PDF ===
     1=== Quick Embed PDF - PDF viewer, PDF embeds, PDF Reader, PDF Embedder ===
    22Contributors: devbook
    3 Tags: pdf, pdf embed, pdf viewer, PDF Embedder, pdf download
    4 Requires at least: 5.0
    5 Tested up to: 6.7.1
    6 Requires PHP: 7.2
    7 Stable tag: 1.0
     3Tags: pdf reader, pdf embed, pdf viewer, PDF, pdf download, pdf
     4Tested up to: 6.7
     5Stable tag: 1.1
    86License: GPLv2 or later
    97License URI: https://www.gnu.org/licenses/gpl-2.0.html
    108
    11 Quickly embed and display (viewer) PDF files in WordPress posts and pages using a simple shortcode.
     9Quickly embed and display (viewer) PDF files in WordPress posts and pages using a simple shortcode or Gutenberg block.
    1210
    1311== Description ==
    1412
    15 Quick Embed PDF is a lightweight WordPress plugin that allows you to embed PDF files directly into your posts and pages using a simple shortcode. This plugin uses the PDF.js library to render PDF files and provides an easy-to-use admin interface for customizing the display.
     13**100% FREE**
     14
     15Quick Embed PDF is a lightweight WordPress plugin that allows you to embed PDF files directly into your posts and pages using a simple shortcode or a Gutenberg block.
    1616
    1717== Features ==
    1818
    19 * Embed PDF files using the `[qepw_pdf_viewer file="..."]` shortcode.
     19* Embed PDF files using the `[qepw_pdf_viewer file="..."]` shortcode or the "Quick Embed PDF" block in Gutenberg.
    2020* Customizable PDF viewer width through the admin settings.
    2121* Supports media library integration for automatic shortcode insertion.
     
    2323* Optional download button for users to download the PDF file.
    2424* Lightweight and responsive design.
    25 * Using [Mozilla's PDF.js](https://mozilla.github.io/pdf.js/)
     25* Improved Gutenberg support with a custom block for embedding PDFs.
     26* Option to disable the download button in the settings.
     27* Using [Mozilla's PDF.js](https://mozilla.github.io/pdf.js/).
     28* Best pdf reader wordpress plugin
    2629
     30== Usage ==
     31
     32### Embedding a PDF using the Shortcode:
     33To embed a PDF file into your post or page using the plugin, use the following shortcode:
     34`[qepw_pdf_viewer file="YOUR_PDF_FILE_URL"]`
     35
     36Replace `YOUR_PDF_FILE_URL` with the actual URL of the PDF file.
     37
     38### Embedding a PDF using the Gutenberg Block:
     391. In the Gutenberg editor, add the "Quick Embed PDF" block from the "Embed" category.
     402. Select the PDF file from your media library or upload a new one.
     413. The PDF will be embedded and displayed directly in your post or page.
     42
     43### Customizing the PDF Viewer:
     44You can customize the width of the PDF viewer in the plugin's settings page. There, you can also enable or disable the download button.
    2745
    2846== Installation ==
     
    31492. Activate the plugin through the 'Plugins' menu in WordPress.
    32503. Go to the settings page under 'Settings > Quick Embed PDF' to configure options.
    33 4. Use the `[qepw_pdf_viewer file="URL"]` shortcode to embed a PDF in your posts or pages.
     514. Use the `[qepw_pdf_viewer file="YOUR_PDF_FILE_URL"]` shortcode to embed a PDF in your posts or pages.
     525. Alternatively, use the "Quick Embed PDF" block in Gutenberg to insert PDF files directly.
    3453
    3554== Frequently Asked Questions ==
    3655
    3756= How do I use the plugin? =
    38 Use the `[pdf_viewer file="URL"]` shortcode in your post or page content, replacing `URL` with the URL of the PDF file you want to embed.
     57Use the `[qepw_pdf_viewer file="YOUR_PDF_FILE_URL"]` shortcode in your post or page content, replacing `YOUR_PDF_FILE_URL` with the URL of the PDF file you want to embed. Alternatively, use the "Quick Embed PDF" block in Gutenberg for easier embedding.
     58
     59= How do I embed a PDF into WordPress? =
     60To embed a PDF into WordPress, you can use either the `[qepw_pdf_viewer file="YOUR_PDF_FILE_URL"]` shortcode or the "Quick Embed PDF" block in the Gutenberg editor. Replace `YOUR_PDF_FILE_URL` with the actual URL of your PDF file.
    3961
    4062= Can I customize the PDF viewer's width? =
     
    4971== Screenshots ==
    50721. Admin page Quick Embed PDF
    51 2. Example on the page
     732. Gutenberg block for embedding PDF files.
    5274
    5375== Changelog ==
    5476
    55 = 1.0.0 =
     77= 1.1 – January 31, 2025 =
     78* Added Gutenberg block for embedding PDF files directly.
     79* Improved functionality for embedding PDFs through the block.
     80* Updated the settings page to allow disabling the download button.
     81* Minor bug fixes and performance improvements.
     82
     83= 1.0 =
    5684* Initial release.
    5785* Added shortcode functionality to embed PDF files.
     
    5987* Provided admin settings for customizing viewer width.
    6088* Automatic shortcode insertion for PDFs added through the media library.
    61 
    62 
     89* Added Gutenberg block for embedding PDF files easily.
Note: See TracChangeset for help on using the changeset viewer.