{"id":16056006,"url":"https://github.com/varunsridharan/wp-plugin-version-management","last_synced_at":"2025-08-13T14:32:50.894Z","repository":{"id":57077000,"uuid":"195497250","full_name":"varunsridharan/wp-plugin-version-management","owner":"varunsridharan","description":"Simple WordPress Plugin Library To Handle Version Management To Provide Easy Upgrade Handling.","archived":false,"fork":false,"pushed_at":"2021-04-11T07:31:28.000Z","size":112,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-15T02:47:44.279Z","etag":null,"topics":["vsp-libs","wordpress","wordpress-development","wordpress-php-library","wordpress-plugin","wordpress-plugin-api","wordpress-plugin-development","wordpress-plugin-library","wordpress-plugins","wp","wp-developers","wp-library","wp-plugin","wp-plugins"],"latest_commit_sha":null,"homepage":"https://varunsridharan.github.io/wp-plugin-version-management/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/varunsridharan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-06T04:27:33.000Z","updated_at":"2024-10-08T14:33:36.000Z","dependencies_parsed_at":"2022-08-24T13:00:46.294Z","dependency_job_id":null,"html_url":"https://github.com/varunsridharan/wp-plugin-version-management","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":"varunsridharan/git-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fwp-plugin-version-management","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fwp-plugin-version-management/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fwp-plugin-version-management/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fwp-plugin-version-management/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/varunsridharan","download_url":"https://codeload.github.com/varunsridharan/wp-plugin-version-management/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229767188,"owners_count":18121042,"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":["vsp-libs","wordpress","wordpress-development","wordpress-php-library","wordpress-plugin","wordpress-plugin-api","wordpress-plugin-development","wordpress-plugin-library","wordpress-plugins","wp","wp-developers","wp-library","wp-plugin","wp-plugins"],"created_at":"2024-10-09T02:23:27.116Z","updated_at":"2024-12-14T23:32:40.536Z","avatar_url":"https://github.com/varunsridharan.png","language":"PHP","readme":"# WP Plugin Version Management\nSimple WordPress Plugin Library To Handle Version Management To Provide Easy Upgrade Handling.\n\n[![Latest Stable Version][latest-stable-version-img]][latest-stable-version-link]\n[![Latest Unstable Version][latest-Unstable-version-img]][latest-Unstable-version-link]\n[![Total Downloads][total-downloads-img]][total-downloads-link]\n[![WP][wpcs-img]][wpcs-link]\n[![License][license-img]][license-link]\n[![composer.lock available][composerlock-img]][composerlock-link]\n\n## Installation\nThe preferred way to install this extension is through [Composer][composer].\n\nTo install **WP Plugin Version Management library**, simply:\n\n    $ composer require varunsridharan/wp-plugin-version-management\n\nThe previous command will only install the necessary files, if you prefer to **download the entire source code** you can use:\n\n    $ composer require varunsridharan/wp-plugin-version-management --prefer-source\n\nYou can also **clone the complete repository** with Git:\n\n    $ git clone https://github.com/varunsridharan/wp-plugin-version-management.git\n\nOr **install it manually**:\n\n[Download WP Plugin Version Management.zip][downloadzip]:\n\n    $ wget https://github.com/varunsridharan/wp-plugin-version-management/archive/master.zip\n\n## Arguments / Options\n### `slug`\nUnique Key for your plugin\n### `version`\nYou Should Pass your plugins version.\n### `logs`\nIf its set to true then it saves update / install logs in database\n#### Example Log\n```php\narray(\n\t'1.0' =\u003e array(\n\t\t'user_id' =\u003e 1, // Stores Current User ID who install / upgrades the plugin\n\t\t'time'    =\u003e 2999391, // Stores Upgrade As Timestamp using `current_time('timestamp')`\n\t\t'from'    =\u003e false, // Which Version is upgraded from | false means its a fresh install\n\t),\n\t'1.1' =\u003e array(\n\t\t'user_id' =\u003e 1, // Stores Current User ID who install / upgrades the plugin\n\t\t'time'    =\u003e 3949391, // Stores Upgrade As Timestamp using `current_time('timestamp')`\n\t\t'from'    =\u003e '1.0', // Which Version is upgraded from | false means its a fresh install\n\t),\n);\n```\n\n### `option_name`\nCustom database key on where to save your plugins version and logs.\nby default it stores all plugins version in database using \n\n#### Example of Common Storage\n```php\narray(\n\t'your-plugin-slug'    =\u003e array(\n\t\t'version' =\u003e '',\n\t\t'logs'    =\u003e '',\n\t),\n\t'another-plugin-slug' =\u003e array(\n\t\t'version' =\u003e '',\n\t\t'logs'    =\u003e array(),\n\t),\n);\n```\n\nThe above example are stored in `wp_options` table with a common database key `_vs_wp_plugin_upgrader`\n\n## Activation Usage\n\n```php\n\u003c?php\n\nregister_activation_hook( __FILE__, 'your_plugin_activation' );\n\nif ( ! function_exists( 'your_plugin_install_v1' ) ) {\n\tfunction your_plugin_install_v1( $from_version = false, $to_version = false ) {\n\t\t// do your stuff.\n\t\treturn true; // should return something | return true if update is sucess / return false\n\t}\n}\n\nif ( ! function_exists( 'your_plugin_install_v1_1' ) ) {\n\tfunction your_plugin_install_v1_1( $from_version = false, $to_version = false ) {\n\t\t// do your stuff.\n\t\treturn true; // should return something | return true if update is sucess / return false\n\t}\n}\n\nif ( ! function_exists( 'your_plugin_activation' ) ) {\n\tfunction your_plugin_activation() {\n\t\t$upgrader = new Varunsridharan\\WordPress\\Plugin_Version_Management( array(\n\t\t\t'slug'    =\u003e 'your-plugin-slug', // Uniquq Slug For Your Plugin.\n\t\t\t'logs'    =\u003e true, // Set True to save upgrade logs.\n\t\t\t'version' =\u003e '1.2', // Your Plugins New Version\n\t\t), array(\n\t\t\t'1.0' =\u003e 'your_plugin_install_v1',\n\t\t\t'1.1' =\u003e 'your_plugin_install_v1_1',\n\t\t) );\n\n\t\t$upgrader-\u003erun(); // Run Function Should Be Called.\n\t}\n}\n\n```\n\n## Methods\n### `version()`\nReturn current plugins version stored in database\n\n### `logs()`\nReturns Current Plugins Logs\n\n## Method Usage Example\n\n```php\n$upgrader = new Varunsridharan\\WordPress\\Plugin_Version_Management( array(\n    'slug'    =\u003e 'your-plugin-slug', // Uniquq Slug For Your Plugin.\n    'option_name'=\u003e true,// use the same value which is used in register_plugin_activation if not set it to true\n));\n\n\n// Returns Current Version\n$upgrader-\u003eversion();\n\n// Returns Logs\n$upgrader-\u003elogs();\n```\n\n---\n\n\u003c!-- START common-footer.mustache  --\u003e\n## 📝 Changelog\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n[Checkout CHANGELOG.md](https://github.com/varunsridharan/wp-plugin-version-management/blob/main/CHANGELOG.md)\n\n\n## 🤝 Contributing\nIf you would like to help, please take a look at the list of [issues](https://github.com/varunsridharan/wp-plugin-version-management/issues/).\n\n\n## 📜  License \u0026 Conduct\n- [**GNU General Public License v3.0**](https://github.com/varunsridharan/wp-plugin-version-management/blob/main/LICENSE) © [Varun Sridharan](website)\n- [Code of Conduct](https://github.com/varunsridharan/wp-plugin-version-management/blob/main/.github/CODE_OF_CONDUCT.md)\n\n\n## 📣 Feedback\n- ⭐ This repository if this project helped you! :wink:\n- Create An [🔧 Issue](https://github.com/varunsridharan/wp-plugin-version-management/issues/) if you need help / found a bug\n\n\n## 💰 Sponsor\n[I][twitter] fell in love with open-source in 2013 and there has been no looking back since! You can read more about me [here][website].\nIf you, or your company, use any of my projects or like what I’m doing, kindly consider backing me. I'm in this for the long run.\n\n- ☕ How about we get to know each other over coffee? Buy me a cup for just [**$9.99**][buymeacoffee]\n- ☕️☕️ How about buying me just 2 cups of coffee each month? You can do that for as little as [**$9.99**][buymeacoffee]\n- 🔰         We love bettering open-source projects. Support 1-hour of open-source maintenance for [**$24.99 one-time?**][paypal]\n- 🚀         Love open-source tools? Me too! How about supporting one hour of open-source development for just [**$49.99 one-time ?**][paypal]\n\n\u003c!-- Personl Links --\u003e\n[paypal]: https://sva.onl/paypal\n[buymeacoffee]: https://sva.onl/buymeacoffee\n[twitter]: https://sva.onl/twitter/\n[website]: https://sva.onl/website/\n\n\n## Connect \u0026 Say 👋\n- **Follow** me on [👨‍💻 Github][github] and stay updated on free and open-source software\n- **Follow** me on [🐦 Twitter][twitter] to get updates on my latest open source projects\n- **Message** me on [📠 Telegram][telegram]\n- **Follow** my pet on [Instagram][sofythelabrador] for some _dog-tastic_ updates!\n\n\u003c!-- Personl Links --\u003e\n[sofythelabrador]: https://www.instagram.com/sofythelabrador/\n[github]: https://sva.onl/github/\n[twitter]: https://sva.onl/twitter/\n[telegram]: https://sva.onl/telegram/\n\n\n---\n\n\u003cp align=\"center\"\u003e\n\u003ci\u003eBuilt With ♥ By \u003ca href=\"https://sva.onl/twitter\"  target=\"_blank\" rel=\"noopener noreferrer\"\u003eVarun Sridharan\u003c/a\u003e \u003ca href=\"https://en.wikipedia.org/wiki/India\"\u003e\n   \u003cimg src=\"https://cdn.svarun.dev/flag-india.jpg\" width=\"20px\"/\u003e\u003c/a\u003e \u003c/i\u003e \u003cbr/\u003e\u003cbr/\u003e\n   \u003cimg src=\"https://cdn.svarun.dev/codeispoetry.png\"/\u003e\n\u003c/p\u003e\n\n---\n\n\n\u003c!-- END common-footer.mustache  --\u003e\n\n\n[composer]: http://getcomposer.org/download/\n[downloadzip]:https://github.com/varunsridharan/wp-plugin-version-management/archive/master.zip\n\n\n\n[latest-stable-version-img]: https://poser.pugx.org/varunsridharan/wp-plugin-version-management/version\n[latest-Unstable-version-img]: https://poser.pugx.org/varunsridharan/wp-plugin-version-management/v/unstable\n[total-downloads-img]: https://poser.pugx.org/varunsridharan/wp-plugin-version-management/downloads\n[Latest-Unstable-version-img]: https://poser.pugx.org/varunsridharan/wp-plugin-version-management/v/unstable\n[wpcs-img]: https://img.shields.io/badge/WordPress-Standar-1abc9c.svg\n[license-img]: https://poser.pugx.org/varunsridharan/wp-plugin-version-management/license\n[composerlock-img]: https://poser.pugx.org/varunsridharan/wp-plugin-version-management/composerlock\n\n[latest-stable-version-link]: https://packagist.org/packages/varunsridharan/wp-plugin-version-management\n[latest-Unstable-version-link]: https://packagist.org/packages/varunsridharan/wp-plugin-version-management\n[total-downloads-link]: https://packagist.org/packages/varunsridharan/wp-plugin-version-management\n[Latest-Unstable-Version-link]: https://packagist.org/packages/varunsridharan/wp-plugin-version-management\n[wpcs-link]: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/\n[license-link]: https://packagist.org/packages/varunsridharan/wp-plugin-version-management\n[composerlock-link]: https://packagist.org/packages/varunsridharan/wp-plugin-version-management\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvarunsridharan%2Fwp-plugin-version-management","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvarunsridharan%2Fwp-plugin-version-management","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvarunsridharan%2Fwp-plugin-version-management/lists"}