| @@ -190,20 +190,27 @@ | ||
| 190 | 190 | function ( $c ) { |
| 191 | 191 | return new Options( $c->get( 'option_prefix' ) ); |
| 192 | 192 | }; |
| 193 | 193 | |
| 194 | - if ( $this->is_legacy_pro_active() ) { | |
| 195 | - $this->container['license'] = | |
| 194 | + $this->container['connect'] = | |
| 196 | 195 | /** |
| 197 | - * Get the temporary old-Pro license bridge. | |
| 196 | + * Get plugin connect. | |
| 198 | 197 | * |
| 198 | + * @return Connect | |
| 199 | + */ | |
| 200 | + function ( $c ) { | |
| 201 | + return new \ContentControl\Plugin\Connect( $c ); | |
| 202 | + }; | |
| 203 | + | |
| 204 | + $this->container['license'] = | |
| 205 | + /** | |
| 206 | + * Get plugin license. | |
| 207 | + * | |
| 199 | 208 | * @return License |
| 200 | - * @deprecated 2.7.0 Content Control Pro 1.3.0+ owns licensing. | |
| 201 | 209 | */ |
| 202 | - function () { | |
| 203 | - return new \ContentControl\Plugin\License(); | |
| 204 | - }; | |
| 205 | - } | |
| 210 | + function () { | |
| 211 | + return new \ContentControl\Plugin\License(); | |
| 212 | + }; | |
| 206 | 213 | |
| 207 | 214 | $this->container['logging'] = |
| 208 | 215 | /** |
| 209 | 216 | * Get plugin logging. |
| @@ -213,8 +220,18 @@ | ||
| 213 | 220 | function () { |
| 214 | 221 | return new \ContentControl\Plugin\Logging(); |
| 215 | 222 | }; |
| 216 | 223 | |
| 224 | + $this->container['upgrader'] = | |
| 225 | + /** | |
| 226 | + * Get plugin upgrader. | |
| 227 | + * | |
| 228 | + * @return Upgrader | |
| 229 | + */ | |
| 230 | + function ( $c ) { | |
| 231 | + return new \ContentControl\Plugin\Upgrader( $c ); | |
| 232 | + }; | |
| 233 | + | |
| 217 | 234 | $this->container['rules'] = |
| 218 | 235 | /** |
| 219 | 236 | * Get plugin rules. |
| 220 | 237 | * |
| @@ -283,10 +300,8 @@ | ||
| 283 | 300 | * @return void |
| 284 | 301 | */ |
| 285 | 302 | public function register_controllers( $controllers = [] ) { |
| 286 | 303 | foreach ( $controllers as $name => $controller ) { |
| 287 | - // Sanity check to ensure controller implements Controller interface. | |
| 288 | - // @phpstan-ignore-next-line . | |
| 289 | 304 | if ( $controller instanceof Controller ) { |
| 290 | 305 | if ( $controller->controller_enabled() ) { |
| 291 | 306 | $controller->init(); |
| 292 | 307 | } |
| @@ -456,34 +471,12 @@ | ||
| 456 | 471 | return $this->is_pro_installed() && function_exists( '\ContentControl\Pro\plugin' ); |
| 457 | 472 | } |
| 458 | 473 | |
| 459 | 474 | /** |
| 460 | - * Whether an active Pro release still depends on Core's license provider. | |
| 461 | - * | |
| 462 | - * This version gate is the only reason Core retains its deprecated license | |
| 463 | - * bridge. Pro 1.3.0 and later register their own provider before use. | |
| 464 | - * | |
| 465 | - * @return boolean | |
| 466 | - */ | |
| 467 | - public function is_legacy_pro_active() { | |
| 468 | - if ( ! $this->is_pro_active() || ! function_exists( '\ContentControl\Pro\config' ) ) { | |
| 469 | - return false; | |
| 470 | - } | |
| 471 | - | |
| 472 | - $version = \ContentControl\Pro\config( 'version' ); | |
| 473 | - | |
| 474 | - return is_string( $version ) && '' !== $version && version_compare( $version, '1.3.0', '<' ); | |
| 475 | - } | |
| 476 | - | |
| 477 | - /** | |
| 478 | 475 | * Check if license is active. |
| 479 | 476 | * |
| 480 | 477 | * @return boolean |
| 481 | 478 | */ |
| 482 | 479 | public function is_license_active() { |
| 483 | - $license = $this->get( 'license' ); | |
| 484 | - | |
| 485 | - return is_object( $license ) && method_exists( $license, 'is_license_active' ) | |
| 486 | - ? $license->is_license_active() | |
| 487 | - : false; | |
| 480 | + return $this->get( 'license' )->is_license_active(); | |
| 488 | 481 | } |
| 489 | 482 | } |