{"id":37262517,"url":"https://github.com/aginev/wp-glide","last_synced_at":"2026-01-15T23:21:43.944Z","repository":{"id":56942068,"uuid":"126174083","full_name":"aginev/wp-glide","owner":"aginev","description":"PHP Glide for WordPress","archived":false,"fork":false,"pushed_at":"2023-10-17T03:06:48.000Z","size":9,"stargazers_count":7,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-02T01:41:22.545Z","etag":null,"topics":["glide","php","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aginev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-21T12:18:27.000Z","updated_at":"2025-03-24T08:27:58.000Z","dependencies_parsed_at":"2022-08-21T07:50:35.881Z","dependency_job_id":null,"html_url":"https://github.com/aginev/wp-glide","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/aginev/wp-glide","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aginev%2Fwp-glide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aginev%2Fwp-glide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aginev%2Fwp-glide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aginev%2Fwp-glide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aginev","download_url":"https://codeload.github.com/aginev/wp-glide/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aginev%2Fwp-glide/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["glide","php","wordpress"],"created_at":"2026-01-15T23:21:43.245Z","updated_at":"2026-01-15T23:21:43.939Z","avatar_url":"https://github.com/aginev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Glide (http://glide.thephpleague.com/) for WordPress\n\n## Install\n\n```bash\ncomposer require aginev/wp-glide\n```\n\n## Usage\n\nGeneral configuration could be made at your function.php file in your theme.\n\n\n### Get instance of the WpGlide.\n\nIt's a singleton instance, so you will get just the same object everywhere in your application.\n\n```php\n$wpGlide = \\WpGlide\\WpGlide::getInstance();\n// Or\n$wpGlide = wp_glide();\n```\n\n### Glide server config\n\nYou should config WpGlide at least once in your application. The init method could have four parameters and all of them are not required.\n\n```php\n$wpGlide-\u003einit(\n    // Glide server config. See: http://glide.thephpleague.com/1.0/config/setup/\n    [\n        // Image driver\n        'driver'     =\u003e 'imagick',\n        // Watermarks path\n        'watermarks' =\u003e new \\League\\Flysystem\\Filesystem(new \\League\\Flysystem\\Adapter\\Local(get_template_directory() . '/assets/img')),\n    ],\n    \n    // Base path. By default set to 'img/' and the final URL will look like so: http://example.com/BASE-PATH/SIZE-SLUG/image.jpg.\n    'img/',\n    \n    // Path to WordPress upload directory. If not set the default upload directory will be used.\n    'upload_path',\n    \n    // Cache path. If not set the cache will be placed in cache directory at the root of the default upload path.\n    'cache_path'\n);\n\n// Or\n$wpGlide = wp_glide()-\u003einit([...]);\n```\n\n### Register image sizes\n\nYou should register image sizes that will be handled by Glide like so:\n\n```php\n$wpGlide-\u003eaddSize('w128', [\n    'w'  =\u003e 128,\n    'q'  =\u003e 75,\n    'fm' =\u003e 'pjpg',\n\n    'mark'      =\u003e 'watermark.png',\n    'markw'     =\u003e 512,\n    'markh'     =\u003e 512,\n    'markalpha' =\u003e 75,\n    'markfit'   =\u003e 'fill',\n    'markpos'   =\u003e 'center',\n])-\u003eaddSize('w512', [\n    'w'  =\u003e 512,\n    'q'  =\u003e 75,\n    'fm' =\u003e 'pjpg',\n])-\u003eaddSize('16x9', [\n    'w'   =\u003e 16 * 10 * 2,\n    'h'   =\u003e 9 * 10 * 2,\n    'fit' =\u003e 'crop',\n    'q'   =\u003e 75,\n    'fm'  =\u003e 'pjpg',\n]);\n```\n\n### Usage in templates\n\nThen you can get Glide image URL in your views/templates like so: \n\n```html\n\u003c!-- Get Glide image URL by it's original URL --\u003e\n\u003cimg src=\"\u003c?php echo wp_glide_image('http://example.com/wp-content/2018/01/image.jpg', 'w128'); ?\u003e\" /\u003e\n\n\u003c!-- Get Glide image URL by it's ID in the WordPress media library --\u003e\n\u003cimg src=\"\u003c?php echo wp_glide_image(1, 'w128'); ?\u003e\" /\u003e\n\n\u003c!-- Result: \u003cimg src=\"//example.com/img/w128/2018/01/image.jpg\" /\u003e --\u003e\n\u003c!-- Note that protocol will be stripped and you do not need to care about it. --\u003e\n```\n\nYou can get Glide image base64 encoded version in your views/templates like so: \n\n```html\n\u003c!-- Get Glide image URL by it's original URL --\u003e\n\u003cimg src=\"\u003c?php echo wp_glide_base64('http://example.com/image.jpg', 'w128'); ?\u003e\" /\u003e\n\n\u003c!-- Get Glide image URL by it's ID in the WordPress media library --\u003e\n\u003cimg src=\"\u003c?php echo wp_glide_base64(1, 'w128'); ?\u003e\" /\u003e\n\n\u003c!-- Result: \u003cimg src=\"data:image/jpeg;base64...\" /\u003e --\u003e\n```\n\n## License\nEverything in this repository is MIT License unless otherwise specified.\n\nMIT © 2018 Atanas Ginev\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faginev%2Fwp-glide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faginev%2Fwp-glide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faginev%2Fwp-glide/lists"}