| @@ -106,8 +106,9 @@ | ||
| 106 | 106 | add_filter( 'optimole_wp_feedback_review_message', [ __CLASS__, 'change_review_message' ] ); |
| 107 | 107 | add_filter( 'optimole_wp_logger_heading', [ __CLASS__, 'change_review_message' ] ); |
| 108 | 108 | add_filter( 'optml_register_conflicts', [ __CLASS__, 'register_conflicts' ] ); |
| 109 | 109 | add_filter( 'optimole_wp_logger_data', [ __CLASS__, 'add_settings' ] ); |
| 110 | + add_filter( 'optimole_wp_ai_connect_metadata', [ __CLASS__, 'add_ai_connect_metadata' ] ); | |
| 110 | 111 | self::$_instance = new self(); |
| 111 | 112 | self::$_instance->manager = Optml_Manager::instance(); |
| 112 | 113 | self::$_instance->rest = new Optml_Rest(); |
| 113 | 114 | self::$_instance->admin = new Optml_Admin(); |
| @@ -113,8 +114,9 @@ | ||
| 113 | 114 | self::$_instance->admin = new Optml_Admin(); |
| 114 | 115 | self::$_instance->dam = new Optml_Dam(); |
| 115 | 116 | self::$_instance->media_offload = Optml_Media_Offload::instance(); |
| 116 | 117 | self::$_instance->video_player = new Optml_Video_Player(); |
| 118 | + new Optml_Abilities(); | |
| 117 | 119 | if ( class_exists( 'WP_CLI' ) ) { |
| 118 | 120 | self::$_instance->cli = new Optml_Cli(); |
| 119 | 121 | } |
| 120 | 122 | } |
| @@ -173,8 +175,30 @@ | ||
| 173 | 175 | * @return string New review message. |
| 174 | 176 | */ |
| 175 | 177 | public static function change_review_message( $message ) { |
| 176 | 178 | return str_replace( '{product}', 'Optimole', $message ); |
| 179 | + } | |
| 180 | + | |
| 181 | + /** | |
| 182 | + * Opt in to the SDK AI Connect module. | |
| 183 | + * | |
| 184 | + * @return array<string, mixed> AI Connect metadata. | |
| 185 | + */ | |
| 186 | + public static function add_ai_connect_metadata() { | |
| 187 | + return [ | |
| 188 | + 'name' => 'Optimole', | |
| 189 | + 'notice_cases' => [ | |
| 190 | + __( 'make your images load faster', 'optimole-wp' ), | |
| 191 | + __( 'purge cached images', 'optimole-wp' ), | |
| 192 | + __( 'offload media to the cloud', 'optimole-wp' ), | |
| 193 | + ], | |
| 194 | + 'prompts' => [ | |
| 195 | + __( 'Make my images load faster: turn on lazy loading and serve them at quality 80.', 'optimole-wp' ), | |
| 196 | + __( 'Offload my media library to the Optimole cloud to free up disk space.', 'optimole-wp' ), | |
| 197 | + __( 'I changed my logo. Purge the cached versions so visitors get the new one.', 'optimole-wp' ), | |
| 198 | + ], | |
| 199 | + 'ability_prefix' => 'optimole', | |
| 200 | + ]; | |
| 177 | 201 | } |
| 178 | 202 | |
| 179 | 203 | /** |
| 180 | 204 | * Register product into SDK. |