Index of /wp-content/plugins/entry-reports-pro-for-gravity-forms/plugin-update-checker/

NameLast ModifiedSize
UpParent Directory
Directorycss2024-01-17 16:01-
Directoryexamples2024-01-17 16:01-
Directoryjs2024-01-17 16:01-
Directorylanguages2024-01-17 16:01-
DirectoryPuc2024-01-17 16:01-
Directoryvendor2024-01-17 16:01-
Filecomposer.json2024-01-17 16:01 1k
[TXT]license.txt2024-01-17 16:01 2k
[TXT]load-v4p11.php2024-01-17 16:01 2k
[TXT]plugin-update-checker.php2024-01-17 16:01 1k
<html> <head> <meta charset="UTF-8"> <title>README.md</title> </head> <body> <h1 id="plugin-update-checker">Plugin Update Checker</h1> <p>This is a custom update checker library for WordPress plugins and themes. It lets you add automatic update notifications and one-click upgrades to your commercial plugins, private themes, and so on. All you need to do is put your plugin/theme details in a JSON file, place the file on your server, and pass the URL to the library. The library periodically checks the URL to see if there&#39;s a new version available and displays an update notification to the user if necessary.</p> <p>From the users&#39; perspective, it works just like with plugins and themes hosted on WordPress.org. The update checker uses the default upgrade UI that is familiar to most WordPress users.</p> <!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> <p><strong>Table of Contents</strong></p> <ul> <li><a href="#getting-started">Getting Started</a><ul> <li><a href="#self-hosted-plugins-and-themes">Self-hosted Plugins and Themes</a><ul> <li><a href="#how-to-release-an-update">How to Release an Update</a></li> <li><a href="#notes">Notes</a></li> </ul> </li> <li><a href="#github-integration">GitHub Integration</a><ul> <li><a href="#how-to-release-an-update-1">How to Release an Update</a></li> <li><a href="#notes-1">Notes</a></li> </ul> </li> <li><a href="#bitbucket-integration">BitBucket Integration</a><ul> <li><a href="#how-to-release-an-update-2">How to Release an Update</a></li> </ul> </li> <li><a href="#gitlab-integration">GitLab Integration</a><ul> <li><a href="#how-to-release-an-update-3">How to Release an Update</a></li> </ul> </li> </ul> </li> <li><a href="#license-management">License Management</a></li> <li><a href="#resources">Resources</a></li> </ul> <!-- END doctoc generated TOC please keep comment here to allow auto update --> <h2 id="getting-started">Getting Started</h2> <p><em>Note:</em> In each of the below examples, part of the instructions are to create an instance of the update checker class. It&#39;s recommended to do this either during the <code>plugins_loaded</code> action or outside of any hooks. If you do it only during an <code>admin_*</code> action, then updates will not be visible to a wide variety of WordPress maanagement tools; they will only be visible to logged-in users on dashboard pages.</p> <h3 id="self-hosted-plugins-and-themes">Self-hosted Plugins and Themes</h3> <ol> <li>Download <a href="https://github.com/YahnisElsts/plugin-update-checker/releases/latest">the latest release</a> and copy the <code>plugin-update-checker</code> directory to your plugin or theme.</li> <li><p>Go to the <code>examples</code> subdirectory and open the .json file that fits your project type. Replace the placeholder data with your plugin/theme details. </p> <ul> <li><p>Plugin example:</p> <pre><code class="lang-json"> { &quot;name&quot; : &quot;Plugin Name&quot;, &quot;version&quot; : &quot;2.0&quot;, &quot;download_url&quot; : &quot;http://example.com/plugin-name-2.0.zip&quot;, &quot;sections&quot; : { &quot;description&quot; : &quot;Plugin description here. You can use HTML.&quot; } } </code></pre> <p> This is a minimal example that leaves out optional fields. See <a href="https://docs.google.com/spreadsheets/d/1eOBbW7Go2qEQXReOOCdidMTf_tDYRq4JfegcO1CBPIs/edit?usp=sharing">this table</a> for a full list of supported fields and their descriptions.</p> </li> <li><p>Theme example:</p> <pre><code class="lang-json"> { &quot;version&quot;: &quot;2.0&quot;, &quot;details_url&quot;: &quot;http://example.com/version-2.0-details.html&quot;, &quot;download_url&quot;: &quot;http://example.com/example-theme-2.0.zip&quot; } </code></pre> <p> This is actually a complete example that shows all theme-related fields. <code>version</code> and <code>download_url</code> should be self-explanatory. The <code>details_url</code> key specifies the page that the user will see if they click the &quot;View version 1.2.3 details&quot; link in an update notification. </p> </li> </ul> </li> <li>Upload the JSON file to a publicly accessible location.</li> <li><p>Add the following code to the main plugin file or to the <code>functions.php</code> file:</p> <pre><code class="lang-php"> require &#39;path/to/plugin-update-checker/plugin-update-checker.php&#39;; $myUpdateChecker = Puc_v4_Factory::buildUpdateChecker( &#39;http://example.com/path/to/details.json&#39;, __FILE__, //Full path to the main plugin file or functions.php. &#39;unique-plugin-or-theme-slug&#39; ); </code></pre> <p> Note: If you&#39;re using the Composer autoloader, you don&#39;t need to explicitly <code>require</code> the library.</p> </li> </ol> <h4 id="how-to-release-an-update">How to Release an Update</h4> <p>Change the <code>version</code> number in the JSON file and make sure that <code>download_url</code> points to the latest version. Update the other fields if necessary. Tip: You can use <a href="https://github.com/YahnisElsts/wp-update-server">wp-update-server</a> to automate this process.</p> <p>By default, the library will check the specified URL for changes every 12 hours. You can force it to check immediately by clicking the &quot;Check for updates&quot; link on the &quot;Plugins&quot; page (it&#39;s next to the &quot;Visit plugin site&quot; link). Themes don&#39;t have that link, but you can also trigger an update check like this:</p> <ol> <li>Install <a href="https://srd.wordpress.org/plugins/debug-bar/">Debug Bar</a>.</li> <li>Click the &quot;Debug&quot; menu in the Admin Bar (a.k.a Toolbar).</li> <li>Open the &quot;PUC (your-slug)&quot; panel. </li> <li>Click the &quot;Check Now&quot; button. </li> </ol> <h4 id="notes">Notes</h4> <ul> <li>The second argument passed to <code>buildUpdateChecker</code> must be the absolute path to the main plugin file or any file in the theme directory. If you followed the &quot;getting started&quot; instructions, you can just use the <code>__FILE__</code> constant.</li> <li><p>The third argument - i.e. the slug - is optional but recommended. In most cases, the slug should be the same as the name of your plugin directory. For example, if your plugin lives in <code>/wp-content/plugins/my-plugin</code>, set the slug to <code>my-plugin</code>. If the slug is omitted, the update checker will use the name of the main plugin file as the slug (e.g. <code>my-cool-plugin.php</code> &rarr; <code>my-cool-plugin</code>). This can lead to conflicts if your plugin has a generic file name like <code>plugin.php</code>. </p> <p> This doesn&#39;t affect themes because PUC uses the theme directory name as the default slug. Still, if you&#39;re planning to use the slug in your own code - e.g. to filter updates or override update checker behaviour - it can be a good idea to set it explicitly. </p> </li> </ul> <h3 id="github-integration">GitHub Integration</h3> <ol> <li>Download <a href="https://github.com/YahnisElsts/plugin-update-checker/releases/latest">the latest release</a> and copy the <code>plugin-update-checker</code> directory to your plugin or theme.</li> <li><p>Add the following code to the main plugin file or <code>functions.php</code>:</p> <pre><code class="lang-php"> require &#39;plugin-update-checker/plugin-update-checker.php&#39;; $myUpdateChecker = Puc_v4_Factory::buildUpdateChecker( &#39;https://github.com/user-name/repo-name/&#39;, __FILE__, &#39;unique-plugin-or-theme-slug&#39; ); //Set the branch that contains the stable release. $myUpdateChecker-&gt;setBranch(&#39;stable-branch-name&#39;); //Optional: If you&#39;re using a private repository, specify the access token like this: $myUpdateChecker-&gt;setAuthentication(&#39;your-token-here&#39;); </code></pre> </li> <li>Plugins only: Add a <code>readme.txt</code> file formatted according to the <a href="https://wordpress.org/plugins/readme.txt">WordPress.org plugin readme standard</a> to your repository. The contents of this file will be shown when the user clicks the &quot;View version 1.2.3 details&quot; link.</li> </ol> <h4 id="how-to-release-an-update">How to Release an Update</h4> <p>This library supports a couple of different ways to release updates on GitHub. Pick the one that best fits your workflow.</p> <ul> <li><p><strong>GitHub releases</strong> </p> <p> Create a new release using the &quot;Releases&quot; feature on GitHub. The tag name and release title don&#39;t matter. The description is optional, but if you do provide one, it will be displayed when the user clicks the &quot;View version x.y.z details&quot; link on the &quot;Plugins&quot; page. Note that PUC ignores releases marked as &quot;This is a pre-release&quot;.</p> <p> If you want to use release assets, call the <code>enableReleaseAssets()</code> method after creating the update checker instance:</p> <pre><code class="lang-php"> $myUpdateChecker-&gt;getVcsApi()-&gt;enableReleaseAssets(); </code></pre> </li> <li><p><strong>Tags</strong> </p> <p> To release version 1.2.3, create a new Git tag named <code>v1.2.3</code> or <code>1.2.3</code>. That&#39;s it.</p> <p> PUC doesn&#39;t require strict adherence to <a href="http://semver.org/">SemVer</a>. These are all valid tag names: <code>v1.2.3</code>, <code>v1.2-foo</code>, <code>1.2.3_rc1-ABC</code>, <code>1.2.3.4.5</code>. However, be warned that it&#39;s not smart enough to filter out alpha/beta/RC versions. If that&#39;s a problem, you might want to use GitHub releases or branches instead.</p> </li> <li><p><strong>Stable branch</strong> </p> <p> Point the update checker at a stable, production-ready branch: </p> <pre><code class="lang-php"> $updateChecker-&gt;setBranch(&#39;branch-name&#39;); </code></pre> <p> PUC will periodically check the <code>Version</code> header in the main plugin file or <code>style.css</code> and display a notification if it&#39;s greater than the installed version.</p> <p> Caveat: If you set the branch to <code>master</code> (the default), the update checker will look for recent releases and tags first. It&#39;ll only use the <code>master</code> branch if it doesn&#39;t find anything else suitable.</p> </li> </ul> <h4 id="notes">Notes</h4> <p>The library will pull update details from the following parts of a release/tag/branch:</p> <ul> <li>Version number<ul> <li>The &quot;Version&quot; plugin header.</li> <li>The latest GitHub release or tag name.</li> </ul> </li> <li>Changelog<ul> <li>The &quot;Changelog&quot; section of <code>readme.txt</code>.</li> <li>One of the following files: CHANGES.md, CHANGELOG.md, changes.md, changelog.md</li> <li>GitHub release notes.</li> </ul> </li> <li>Required and tested WordPress versions<ul> <li>The &quot;Requires at least&quot; and &quot;Tested up to&quot; fields in <code>readme.txt</code>.</li> <li>The following plugin headers: <code>Required WP</code>, <code>Tested WP</code>, <code>Requires at least</code>, <code>Tested up to</code></li> </ul> </li> <li>&quot;Last updated&quot; timestamp<ul> <li>The creation timestamp of the latest GitHub release.</li> <li>The latest commit in the selected tag or branch.</li> </ul> </li> <li>Number of downloads<ul> <li>The <code>download_count</code> statistic of the latest release.</li> <li>If you&#39;re not using GitHub releases, there will be no download stats.</li> </ul> </li> <li>Other plugin details - author, homepage URL, description<ul> <li>The &quot;Description&quot; section of <code>readme.txt</code>.</li> <li>Remote plugin headers (i.e. the latest version on GitHub).</li> <li>Local plugin headers (i.e. the currently installed version).</li> </ul> </li> <li>Ratings, banners, screenshots<ul> <li>Not supported.</li> </ul> </li> </ul> <h3 id="bitbucket-integration">BitBucket Integration</h3> <ol> <li>Download <a href="https://github.com/YahnisElsts/plugin-update-checker/releases/latest">the latest release</a> and copy the <code>plugin-update-checker</code> directory to your plugin or theme.</li> <li><p>Add the following code to the main plugin file or <code>functions.php</code>:</p> <pre><code class="lang-php"> require &#39;plugin-update-checker/plugin-update-checker.php&#39;; $myUpdateChecker = Puc_v4_Factory::buildUpdateChecker( &#39;https://bitbucket.org/user-name/repo-name&#39;, __FILE__, &#39;unique-plugin-or-theme-slug&#39; ); //Optional: If you&#39;re using a private repository, create an OAuth consumer //and set the authentication credentials like this: //Note: For now you need to check &quot;This is a private consumer&quot; when //creating the consumer to work around #134: // https://github.com/YahnisElsts/plugin-update-checker/issues/134 $myUpdateChecker-&gt;setAuthentication(array( &#39;consumer_key&#39; =&gt; &#39;...&#39;, &#39;consumer_secret&#39; =&gt; &#39;...&#39;, )); //Optional: Set the branch that contains the stable release. $myUpdateChecker-&gt;setBranch(&#39;stable-branch-name&#39;); </code></pre> </li> <li>Optional: Add a <code>readme.txt</code> file formatted according to the <a href="https://wordpress.org/plugins/readme.txt">WordPress.org plugin readme standard</a> to your repository. For plugins, the contents of this file will be shown when the user clicks the &quot;View version 1.2.3 details&quot; link.</li> </ol> <h4 id="how-to-release-an-update">How to Release an Update</h4> <p>BitBucket doesn&#39;t have an equivalent to GitHub&#39;s releases, so the process is slightly different. You can use any of the following approaches: </p> <ul> <li><p><strong><code>Stable tag</code> header</strong> </p> <p> This is the recommended approach if you&#39;re using tags to mark each version. Add a <code>readme.txt</code> file formatted according to the <a href="https://wordpress.org/plugins/readme.txt">WordPress.org plugin readme standard</a> to your repository. Set the &quot;stable tag&quot; header to the tag that represents the latest release. Example:</p> <pre><code class="lang-text"> Stable tag: v1.2.3 </code></pre> <p> The tag doesn&#39;t have to start with a &quot;v&quot; or follow any particular format. You can use any name you like as long as it&#39;s a valid Git tag.</p> <p> Tip: If you explicitly set a stable branch, the update checker will look for a <code>readme.txt</code> in that branch. Otherwise it will only look at the <code>master</code> branch.</p> </li> <li><p><strong>Tags</strong> </p> <p> You can skip the &quot;stable tag&quot; bit and just create a new Git tag named <code>v1.2.3</code> or <code>1.2.3</code>. The update checker will look at the most recent tags and pick the one that looks like the highest version number.</p> <p> PUC doesn&#39;t require strict adherence to <a href="http://semver.org/">SemVer</a>. These are all valid tag names: <code>v1.2.3</code>, <code>v1.2-foo</code>, <code>1.2.3_rc1-ABC</code>, <code>1.2.3.4.5</code>. However, be warned that it&#39;s not smart enough to filter out alpha/beta/RC versions.</p> </li> <li><p><strong>Stable branch</strong> </p> <p> Point the update checker at a stable, production-ready branch: </p> <pre><code class="lang-php"> $updateChecker-&gt;setBranch(&#39;branch-name&#39;); </code></pre> <p> PUC will periodically check the <code>Version</code> header in the main plugin file or <code>style.css</code> and display a notification if it&#39;s greater than the installed version. Caveat: If you set the branch to <code>master</code>, the update checker will still look for tags first.</p> </li> </ul> <h3 id="gitlab-integration">GitLab Integration</h3> <ol> <li>Download <a href="https://github.com/YahnisElsts/plugin-update-checker/releases/latest">the latest release</a> and copy the <code>plugin-update-checker</code> directory to your plugin or theme.</li> <li><p>Add the following code to the main plugin file or <code>functions.php</code>:</p> <pre><code class="lang-php"> require &#39;plugin-update-checker/plugin-update-checker.php&#39;; $myUpdateChecker = Puc_v4_Factory::buildUpdateChecker( &#39;https://gitlab.com/user-name/repo-name/&#39;, __FILE__, &#39;unique-plugin-or-theme-slug&#39; ); //Optional: If you&#39;re using a private repository, specify the access token like this: $myUpdateChecker-&gt;setAuthentication(&#39;your-token-here&#39;); //Optional: Set the branch that contains the stable release. $myUpdateChecker-&gt;setBranch(&#39;stable-branch-name&#39;); </code></pre> <p> Alternatively, if you&#39;re using a self-hosted GitLab instance, initialize the update checker like this:</p> <pre><code class="lang-php"> $myUpdateChecker = new Puc_v4p11_Vcs_PluginUpdateChecker( new Puc_v4p11_Vcs_GitLabApi(&#39;https://myserver.com/user-name/repo-name/&#39;), __FILE__, &#39;unique-plugin-or-theme-slug&#39; ); //Optional: Add setAuthentication(...) and setBranch(...) as shown above. </code></pre> <p>If you&#39;re using a self-hosted GitLab instance and <a href="https://docs.gitlab.com/ce/user/group/subgroups/index.html">subgroups or nested groups</a>, you have to tell the update checker which parts of the URL are subgroups:</p> <pre><code class="lang-php"> $myUpdateChecker = new Puc_v4p11_Vcs_PluginUpdateChecker( new Puc_v4p11_Vcs_GitLabApi(&#39;https://myserver.com/group-name/subgroup-level1/subgroup-level2/subgroup-level3/repo-name/&#39;, null, &#39;subgroup-level1/subgroup-level2/subgroup-level3&#39;), __FILE__, &#39;unique-plugin-or-theme-slug&#39; ); </code></pre> </li> <li><p>Plugins only: Add a <code>readme.txt</code> file formatted according to the <a href="https://wordpress.org/plugins/readme.txt">WordPress.org plugin readme standard</a> to your repository. The contents of this file will be shown when the user clicks the &quot;View version 1.2.3 details&quot; link.</p> </li> </ol> <h4 id="how-to-release-an-update">How to Release an Update</h4> <p>GitLab doesn&#39;t have an equivalent to GitHub&#39;s releases, so the process is slightly different. You can use any of the following approaches: </p> <ul> <li><p><strong>Tags</strong> </p> <p> To release version 1.2.3, create a new Git tag named <code>v1.2.3</code> or <code>1.2.3</code>. That&#39;s it.</p> <p> PUC doesn&#39;t require strict adherence to <a href="http://semver.org/">SemVer</a>. These are all valid tag names: <code>v1.2.3</code>, <code>v1.2-foo</code>, <code>1.2.3_rc1-ABC</code>, <code>1.2.3.4.5</code>. However, be warned that it&#39;s not smart enough to filter out alpha/beta/RC versions. If that&#39;s a problem, you might want to use GitLab branches instead.</p> </li> <li><p><strong>Stable branch</strong> </p> <p> Point the update checker at a stable, production-ready branch: </p> <pre><code class="lang-php"> $updateChecker-&gt;setBranch(&#39;branch-name&#39;); </code></pre> <p> PUC will periodically check the <code>Version</code> header in the main plugin file or <code>style.css</code> and display a notification if it&#39;s greater than the installed version.</p> <p> Caveat: If you set the branch to <code>master</code> (the default), the update checker will look for recent releases and tags first. It&#39;ll only use the <code>master</code> branch if it doesn&#39;t find anything else suitable.</p> </li> </ul> <h2 id="license-management">License Management</h2> <p>Currently, the update checker doesn&#39;t have any built-in license management features. It only provides some hooks that you can use to, for example, append license keys to update requests (<code>$updateChecker-&gt;addQueryArgFilter()</code>). If you&#39;re looking for ways to manage and verify licenses, please post your feedback in <a href="https://github.com/YahnisElsts/plugin-update-checker/issues/222">this issue</a>. </p> <h2 id="resources">Resources</h2> <ul> <li><a href="http://w-shadow.com/blog/2010/09/02/automatic-updates-for-any-plugin/">This blog post</a> has more information about the update checker API. <em>Slightly out of date.</em></li> <li><a href="https://wordpress.org/plugins/debug-bar/">Debug Bar</a> - useful for testing and debugging the update checker.</li> <li><a href="https://docs.google.com/spreadsheets/d/1eOBbW7Go2qEQXReOOCdidMTf_tDYRq4JfegcO1CBPIs/edit?usp=sharing">Update format reference</a> - describes all fields supported by the JSON-based update information format used by the update checker. Only covers plugins. Themes use a similar but more limited format.</li> <li><a href="http://w-shadow.com/blog/2013/03/19/plugin-updates-securing-download-links/">Securing download links</a> - a general overview.</li> <li><a href="http://open-tools.net/documentation/tutorial-automatic-updates.html#wordpress">A GUI for entering download credentials</a></li> <li><a href="http://w-shadow.com/blog/2011/06/02/automatic-updates-for-commercial-themes/">Theme Update Checker</a> - an older, theme-only variant of this update checker.</li> </ul> </body> </html>
Proudly Served by LiteSpeed Web Server at personal-tutors.co.uk Port 443