Download the PHP package objectivco/cgd_eddsl_magic without Composer

On this page you can find all versions of the php package objectivco/cgd_eddsl_magic. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cgd_eddsl_magic

CGD_EDDSL_Magic

A drop-in class that magically manages your EDD SL plugin licensing.

What is magic and why do I need it?

EDD's brilliant Software Licensing add-on is awesome, but its implementation examples are thin. Managing the various activation and licensing states takes a good amount of research and setup.

Once you have it setup, it can be a major pain in the tucus to manage across your various plugins.

For example, I have 8 plugins. Everytime I find a bug in my licensing code, I have to update 8 plugins that have 8 slightly different implementations. It's a major headache.

CGD_EDDSL_Magic fixes all of this. With as little as a single line of code, you can add a fully functioning licensing settings page to your plugin.

Installing

The best way to install is with composer: composer require objectivco/cgd_eddsl_magic

Alternative method

1) Copy or clone CGD_EDDSL_Magic into your plugin project. Put it in a lib or inc folder.

2) At the top of your main plugin file, or wherever you do your includes, add some code like:

Instantiating

In your plugin constructor (or in the main plugin file if you're not using classes for some reason), instantiate CGD_EDDSL_Magic.

Note: The last parameter, $plugin_file is technically optional, but it's better to pass it in. This should be the main file for your plugin, the one with the plugin header. If you're in the main plugin file, use __FILE__, otherwise, define it as a constant in your main plugin file and pass it in when you instantiate the class.

The parameters:

$prefix

This is a unique prefix for your instance. It's used for saving settings and hooking up various behaviors. Keep it short, and no spaces or weird symbols or other funny business. Example: myplugin

$menu_slug

Assuming your plugin has a menu page, you would set the slug of that menu here so that CGD_EDDSL_Magic can add a submenu called "License" to this menu. If you'd rather control this yourself, set to false.

$host_url

The URL of the site that hosts your plugins.

$plugin_version

The version of the plugin.

$plugin_name

The name of the plugin as setup in EDD.

$plugin_author

The author of the plugin.

$plugin_file

The main plugin file.

$theme

Set to true for theme updates.

$beta

Set to true to enable beta versions.

$home_url

Defaults to false. If false, it uses home_url() for activation checks. Otherwise, you can pass in a URL to check.


If you're using a class, it's probably a good idea to set a class variable called updater and then assign the new CGD_EDDSL_Magic instance to that. It will make it easier to access later.

In a basic setup, you're done at this point. Your plugin will now have a fully functioning license settings page, added to whatever your parent menu is. For more advanced options, continue below.

What about updating themes?

If your project is a theme, you simply need to set the $theme parameter above to true. This makes the $plugin_file parameter uneccessary, so you can simply set this parameter to false. Either way, it will not be used.

Advanced Implementation

Controlling the licensing settings page

By default, a menu item called "License" is added to the parent menu of your choice. If you would like to have full control of where the license settings page is, that's actually really easy to do too.

Just set $menu_slug to false in your instantation, and then drop this line in your admin page, wherever you prefer:

Obviously, the exact syntax will vary depending on how you implement it. This is one reason I find it easier to set the updater instance as a class variable.

One important note: Do not place this line in another HTML form. It will screw things up. Browsers hate nested forms. (and HTML standards do not permit them)

Cronning license checks

If you want it, CGD_EDDSL_Magic includes a way to force regular license checks. To do this, you'd add the following code to your activation or deactivation hooks:

Activation hook

Deactivation hook

This will create daily checks that keep your key_status variable up-to-date.

Really Advanced Implementation

If this does not satisfy you, and you want to add some type of nag to the plugin listing on the plugins page in WP admin, here's a quick example of how you might do that. This is just a starting point, so you'll have to parse through it to figure out how it works.

Changelog

Version 0.5.3

Version 0.5.2

Version 0.5.1

Version 0.5.0

Version 0.4.0

Version 0.3.2

Version 0.3.1

Version 0.3

Version 0.2

Version 0.1


All versions of cgd_eddsl_magic with dependencies

PHP Build Version
Package Version
Requires php Version >=5.2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package objectivco/cgd_eddsl_magic contains the following files

Loading the files please wait ....