Skip to content

4.0

Choose a tag to compare

@YahnisElsts YahnisElsts released this 11 Jan 14:17
· 391 commits to master since this release

New features

  • Theme updates.
  • BitBucket support.

Breaking changes

  • Renamed PucFactory to Puc_v4_Factory. Use Puc_v4_Factory::buildUpdateChecker() to initialize the update checker.

  • Renamed all classes to comply with the PSR-0 autoloading standard.

  • Changed how the factory deals with multiple versions of the library being loaded at the same time. Instead of simply choosing the highest available version, it now uses the highest minor version. For example, version 4.0 of the factory class can build version 4.5 or 4.9.1 instances, but not version 5.0. The goal of this change is to reduce the risk that future releases could accidentally break plugins that are using old versions of the library.

  • GitHub support: The class PucGitHubChecker_x_y was removed. Use Puc_v4_Factory::buildUpdateChecker() instead and pass the repository URL as the first argument. Example:

    $updateChecker = Puc_v4_Factory::buildUpdateChecker(
        'https://github.com/username/repository',
        __FILE__
    );
  • GitHub support: The setAccessToken() method was deprecated. Use setAuthentication('token_here') instead.

  • As part of theme support, the plugin info and update container classes were refactored and two base classes (Puc_v4_Metadata, Puc_v4_Update) were introduced. If your plugin extends the update class, review the changes to see if you need to update your code.

Minor changes

  • Switched to using autoloading instead of require.
  • Added example metadata files (JSON) for plugins and themes. Look for them in the examples directory.
  • Added lots of new classes. There are many minor differences between how plugins and themes work, so PUC has several cases of "general base class + two specialized subclasses".
  • The names of internal filters are slightly different for plugins and themes. This only matters if you're setting hooks via add_filter() or add_action(). I recommend using the $updateChecker->addFilter() method instead which will automatically append the right suffix and slug.
    • Plugins: puc_something-$slug.
    • Themes: puc_something_theme-$slug.