Repository navigation
4.0
New features
- Theme updates.
- BitBucket support.
Breaking changes
-
Renamed
PucFactorytoPuc_v4_Factory. UsePuc_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_ywas removed. UsePuc_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. UsesetAuthentication('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
examplesdirectory. - 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()oradd_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.
- Plugins: