{"id":23899321,"url":"https://github.com/alexanderprod/wp-pdf-gallery-block","last_synced_at":"2025-10-06T09:14:00.961Z","repository":{"id":269425558,"uuid":"907371918","full_name":"AlexanderProd/wp-pdf-gallery-block","owner":"AlexanderProd","description":"WordPress PDF Gallery Block","archived":false,"fork":false,"pushed_at":"2024-12-23T14:43:58.000Z","size":209,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-04T18:18:12.547Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexanderProd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-23T12:37:59.000Z","updated_at":"2024-12-23T14:34:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"bc20601c-904a-4ec9-ac4e-a72744efabb8","html_url":"https://github.com/AlexanderProd/wp-pdf-gallery-block","commit_stats":null,"previous_names":["alexanderprod/wp-pdf-gallery-block"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderProd%2Fwp-pdf-gallery-block","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderProd%2Fwp-pdf-gallery-block/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderProd%2Fwp-pdf-gallery-block/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderProd%2Fwp-pdf-gallery-block/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexanderProd","download_url":"https://codeload.github.com/AlexanderProd/wp-pdf-gallery-block/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240288758,"owners_count":19777728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-04T18:18:14.515Z","updated_at":"2025-10-06T09:14:00.854Z","avatar_url":"https://github.com/AlexanderProd.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PDF Gallery Block - WordPress Plugin\n\n## Description\n\nThis WordPress plugin creates a custom block that displays PDF files in a responsive grid layout. Each PDF is shown with a thumbnail preview (generated from its first page) and a download link.\n\n## Requirements\n\n- WordPress 5.0 or higher\n- PHP 7.0 or higher\n- ImageMagick PHP extension\n- Write permissions in the WordPress upload directory\n\n## Installation\n\n1. Create Plugin Directory\n   Create the following directory structure in your WordPress installation:\n\n```\nwp-content/plugins/pdf-gallery-block/\n├── pdf-gallery-block.php\n├── css/\n│   └── style.css\n└── build/\n    └── index.js\n```\n\n2. Upload Files\n\n1. Copy the main plugin file `pdf-gallery-block.php` to the plugin directory\n1. Create a `css` folder and copy `style.css` into it\n1. Create a `build` folder and copy `index.js` into it\n\n### 3. Create Required Directories\n\nCreate two directories in your WordPress uploads folder:\n\n```\nwp-content/uploads/pdf-gallery/      # For storing PDF files\nwp-content/uploads/pdf-thumbnails/   # For storing generated thumbnails\n```\n\n4. Set Permissions\n   Ensure booth directories have the necessary write permissions in the WordPress upload directory.\n\n```bash\nchmod 755 wp-content/uploads/pdf-gallery\nchmod 755 wp-content/uploads/pdf-thumbnails\n```\n\n5. Activate the Plugin\n   Navigate to the WordPress admin dashboard, go to Plugins \u003e Installed Plugins, and activate the \"PDF Gallery Block\" plugin.\n\n## Usage\n\nTo use the PDF Gallery Block, add it to any post or page where you want to display the PDF gallery.\n\n## Customization\n\nYou can customize the block's appearance and behavior by editing the `style.css` file in the `css` directory.\n\n## Troubleshooting\n\n### Thumbnail Generation Not Working\n\n- Verify ImageMagick is installed:\n\n```php\n\u003c?php echo exec('convert -version'); ?\u003e\n```\n\nor\n\n```php\n\u003c?php phpinfo(); ?\u003e\n```\n\n- Check directory permissions\n- Ensure PHP has enough memory allocated for thumbnail generation\n\n### ImageMagick PDF Security Policy\n\nIf you're seeing an error like \"attempt to perform an operation not allowed by the security policy `PDF'\", this is due to ImageMagick's security settings. You have two options:\n\n1. **Default Setup (Recommended)**\n   The plugin will automatically fall back to using a generic PDF icon if thumbnail generation fails. No action required.\n\n2. **Enable PDF Processing in ImageMagick**\n   If you have server access and want actual PDF thumbnails, you can modify ImageMagick's policy:\n   - Locate the policy file (usually at `/etc/ImageMagick-6/policy.xml` or `/etc/ImageMagick-7/policy.xml`)\n   - Find: `\u003cpolicy domain=\"coder\" rights=\"none\" pattern=\"PDF\" /\u003e`\n   - Change to: `\u003cpolicy domain=\"coder\" rights=\"read|write\" pattern=\"PDF\" /\u003e`\n   - Restart your web server\n\n## Development\n\nFor developers who want to modify the JavaScript code, you'll need to set up the development environment:\n\n1. Install Node.js\n2. Run npm commands\n\n```bash\nnpm install\nnpm run build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexanderprod%2Fwp-pdf-gallery-block","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexanderprod%2Fwp-pdf-gallery-block","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexanderprod%2Fwp-pdf-gallery-block/lists"}