Notice: require(): read of 2076 bytes failed with errno=12 Cannot allocate memory in /home/samwafoo/public_html/wp-content/plugins/jetpack/vendor/jetpack-autoloader/class-php-autoloader.php on line 90

Notice: require(): read of 12105 bytes failed with errno=12 Cannot allocate memory in /home/samwafoo/public_html/wp-content/plugins/jetpack/vendor/jetpack-autoloader/class-php-autoloader.php on line 90

Notice: require(): read of 8009 bytes failed with errno=12 Cannot allocate memory in /home/samwafoo/public_html/wp-content/plugins/jetpack/vendor/jetpack-autoloader/class-php-autoloader.php on line 90

Notice: require(): read of 8009 bytes failed with errno=12 Cannot allocate memory in /home/samwafoo/public_html/wp-content/plugins/jetpack/vendor/jetpack-autoloader/class-php-autoloader.php on line 90
_tier( $tier ) { if ( $tier === null ) { return array(); } $product = Wpcom_Products::get_product( static::get_wpcom_product_slug() ); if ( empty( $product ) ) { return array(); } // get info about the feature. $info = self::get_ai_assistant_feature(); // flag to indicate if the tiers are enabled, case the info is available. $tier_plans_enabled = ( ! is_wp_error( $info ) && isset( $info['tier-plans-enabled'] ) ) ? boolval( $info['tier-plans-enabled'] ) : false; /* * when tiers are enabled and the price tier list is empty, * we may need to renew the cache for the product data so * we get the new price tier list. * * if the list is still empty after the fresh data, we will * default to empty pricing (by returning an empty array). */ if ( empty( $product->price_tier_list ) && $tier_plans_enabled ) { $product = Wpcom_Products::get_product( static::get_wpcom_product_slug(), true ); } // get the base pricing for the unlimited plan, for compatibility $base_pricing = Wpcom_Products::get_product_pricing( static::get_wpcom_product_slug() ); $price_tier_list = $product->price_tier_list; $yearly_prices = array(); foreach ( $price_tier_list as $price_tier ) { if ( isset( $price_tier->maximum_units ) && isset( $price_tier->maximum_price ) ) { // The prices are in cents $yearly_prices[ $price_tier->maximum_units ] = $price_tier->maximum_price / 100; } } // add the base pricing to the list $prices = array( 1 => $base_pricing ); foreach ( $yearly_prices as $units => $price ) { $prices[ $units ] = array_merge( $base_pricing, array( 'full_price' => $price, 'discount_price' => $price, 'is_introductory_offer' => false, 'introductory_offer' => null, ) ); } return isset( $prices[ $tier ] ) ? $prices[ $tier ] : array(); } /** * Get the product pricing details * * @return array Pricing details */ public static function get_pricing_for_ui() { $next_tier = self::get_next_usage_tier(); $current_tier = self::get_current_usage_tier(); $current_call_to_action = $current_tier === 0 ? __( 'Continue for free', 'jetpack-my-jetpack' ) : __( 'I\'m fine with my plan, thanks', 'jetpack-my-jetpack' ); $next_call_to_action = $next_tier === null ? __( 'Contact Us', 'jetpack-my-jetpack' ) : __( 'Upgrade', 'jetpack-my-jetpack' ); return array( 'tiers' => array( self::CURRENT_TIER_SLUG => array_merge( self::get_pricing_for_ui_by_usage_tier( $current_tier ), array( 'available' => true, 'is_free' => true, 'call_to_action' => $current_call_to_action, ) ), self::UPGRADED_TIER_SLUG => array_merge( self::get_pricing_for_ui_by_usage_tier( $next_tier ), array( 'wpcom_product_slug' => static::get_wpcom_product_slug(), 'quantity' => $next_tier, 'call_to_action' => $next_call_to_action, ) ), ), ); } /** * Get the WPCOM product slug used to make the purchase * * @return string */ public static function get_wpcom_product_slug() { return 'jetpack_ai_yearly'; } /** * Get the WPCOM monthly product slug used to make the purchase * * @return string */ public static function get_wpcom_monthly_product_slug() { return 'jetpack_ai_monthly'; } /** * Get the WPCOM bi-yearly product slug used to make the purchase * * @return string */ public static function get_wpcom_bi_yearly_product_slug() { return 'jetpack_ai_bi_yearly'; } /** * Checks whether the current plan (or purchases) of the site already supports the product * * @return boolean */ public static function has_required_plan() { return static::does_site_have_feature( 'ai-assistant' ); } /** * Checks whether the product can be upgraded to a different product. * * @return boolean */ public static function is_upgradable() { $has_required_plan = self::has_required_plan(); $current_tier = self::get_current_usage_tier(); // Mark as not upgradable if user is on unlimited tier or does not have any plan. if ( ! $has_required_plan || null === $current_tier || 1 === $current_tier ) { return false; } return true; } /** * Get the URL the user is taken after purchasing the product through the checkout * * @return ?string */ public static function get_post_checkout_url() { return '/wp-admin/admin.php?page=my-jetpack#/jetpack-ai'; } /** * Get the URL the user is taken after activating the product through the checkout * * @return ?string */ public static function get_post_activation_url() { return '/wp-admin/admin.php?page=my-jetpack#/jetpack-ai'; } /** * Get the URL where the user manages the product * * @return ?string */ public static function get_manage_url() { return '/wp-admin/admin.php?page=my-jetpack#/add-jetpack-ai'; } /** * Checks whether the plugin is installed * * @return boolean */ public static function is_plugin_installed() { return self::is_jetpack_plugin_installed(); } /** * Checks whether the plugin is active * * @return boolean */ public static function is_plugin_active() { return (bool) static::is_jetpack_plugin_active(); } /** * Get data about the AI Assistant feature * * @return array */ public static function get_ai_assistant_feature() { // Bail early if the plugin is not active. if ( ! self::is_jetpack_plugin_installed() ) { return array(); } // Check if the global constant is defined. if ( ! defined( 'JETPACK__PLUGIN_DIR' ) ) { return array(); } // Bail early if the site is not connected. if ( ! self::is_site_connected() ) { return array(); } // Check if class exists. If not, try to require it once. if ( ! class_exists( 'Jetpack_AI_Helper' ) ) { $class_file_path = JETPACK__PLUGIN_DIR . '_inc/lib/class-jetpack-ai-helper.php'; // Check whether the file exists if ( ! file_exists( $class_file_path ) ) { return array(); } require_once $class_file_path; } return \Jetpack_AI_Helper::get_ai_assistance_feature(); } /** * Checks whether the site is connected to WordPress.com. * * @return boolean */ private static function is_site_connected() { return ( new Connection_Manager() )->is_connected(); } /** * Get the URL where the user manages the product * * NOTE: this method is the only thing that resembles an initialization for the product. * * @return void */ public static function extend_plugin_action_links() { add_action( 'admin_enqueue_scripts', array( static::class, 'admin_enqueue_scripts' ) ); add_filter( 'default_content', array( static::class, 'add_ai_block' ), 10, 2 ); } /** * Enqueue the AI Assistant script * * The script is just a global variable used for the nonce, needed for the create post link. * * @return void */ public static function admin_enqueue_scripts() { wp_register_script( 'my_jetpack_ai_app', false, array(), Initializer::PACKAGE_VERSION, array( 'in_footer' => true ) ); wp_localize_script( 'my_jetpack_ai_app', 'jetpackAi', array( 'nonce' => wp_create_nonce( 'ai-assistant-content-nonce' ), ) ); wp_enqueue_script( 'my_jetpack_ai_app' ); } /** * Add AI block to the post content * * Used only from the link on the product page, the filter will insert an AI Assistant block in the post content. * * @param string $content The post content. * @param WP_Post $post The post object. * @return string */ public static function add_ai_block( $content, WP_Post $post ) { if ( isset( $_GET['use_ai_block'] ) && isset( $_GET['_wpnonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ), 'ai-assistant-content-nonce' ) && current_user_can( 'edit_post', $post->ID ) && '' === $content ) { return ''; } return $content; } }
Fatal error: Uncaught Error: Class 'Automattic\Jetpack\My_Jetpack\Products\Jetpack_Ai' not found in /home/samwafoo/public_html/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-products.php:192 Stack trace: #0 /home/samwafoo/public_html/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php(80): Automattic\Jetpack\My_Jetpack\Products::extend_plugins_action_links() #1 /home/samwafoo/public_html/wp-content/plugins/jetpack/class.jetpack.php(975): Automattic\Jetpack\My_Jetpack\Initializer::init() #2 /home/samwafoo/public_html/wp-includes/class-wp-hook.php(324): Jetpack->late_initialization('') #3 /home/samwafoo/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #4 /home/samwafoo/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #5 /home/samwafoo/public_html/wp-settings.php(550): do_action('plugins_loaded') #6 /home/samwafoo/public_html/wp-config.php(96): require_once('/home/samwafoo/...') #7 /home/samwa in /home/samwafoo/public_html/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-products.php on line 192