Plugin Directory

Changeset 2770818


Ignore:
Timestamp:
08/16/2022 02:09:23 AM (4 years ago)
Author:
sophidev
Message:

Update to version 1.2.0 from GitHub

Location:
sophi
Files:
2 added
2 deleted
24 edited
1 copied

Legend:

Unmodified
Added
Removed
  • sophi/tags/1.2.0/includes/blocks/site-automation-block/register.php

    r2725617 r2770818  
    4141    $widget_name = sanitize_title( $attributes['widgetName'] );
    4242
    43     $curated_posts_transient_key = 'sophi_curated_posts_' . $page_name . '_' . $widget_name;
    44 
    4543    /**
    4644     * Whether to bypass caching.
     
    5755    $bypass_cache = apply_filters( 'sophi_bypass_curated_posts_cache', false, $page_name, $widget_name );
    5856
    59     $curated_posts = get_transient( $curated_posts_transient_key );
     57    $curated_posts = false;
    6058
    61     if ( $bypass_cache || false === $curated_posts ) {
     59    if ( ! $bypass_cache ) {
     60        $sophi_cached_response = new \WP_Query(
     61            [
     62                'post_name__in'          => [ "sophi-site-automation-data-{$page_name}-{$widget_name}" ],
     63                'post_type'              => 'sophi-response',
     64                'post_status'            => 'any',
     65                'posts_per_page'         => 1,
     66                'fields'                 => 'ids',
     67                'no_found_rows'          => true,
     68                'update_post_term_cache' => false
     69            ]
     70        );
     71
     72        if ( $sophi_cached_response->have_posts() ) {
     73            $last_update = get_post_meta( $sophi_cached_response->posts[0], 'sophi_site_automation_last_updated', true );
     74
     75            if ( $last_update + 5 * MINUTE_IN_SECONDS > time() ) {
     76                $curated_posts = get_post_meta( $sophi_cached_response->posts[0], 'sophi_site_automation_data', true );
     77            }
     78        }
     79    }
     80
     81    if ( $bypass_cache || ! $curated_posts ) {
     82
    6283        // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.get_posts_get_posts
    6384        $curated_posts = get_posts(
     
    7293        }
    7394
    74         set_transient( $curated_posts_transient_key, $curated_posts, 5 * MINUTE_IN_SECONDS );
    7595    }
    7696
  • sophi/tags/1.2.0/includes/classes/SiteAutomation/Request.php

    r2732874 r2770818  
    1616
    1717    /**
    18      * Auth object which manages access_token.
    19      *
    20      * @var Auth $auth
    21      */
    22     private $auth;
    23 
    24     /**
    2518     * Site Automation API URL.
    2619     *
     
    5346     * Class constructor.
    5447     *
    55      * @param Auth $auth Authentication object.
    56      */
    57     public function __construct( $auth ) {
    58         $this->auth    = $auth;
    59 
     48     */
     49    public function __construct() {
    6050        add_action(
    6151            'sophi_retry_get_curated_data',
     
    8272        $this->status         = $this->get_status();
    8373        $site_automation_data = false;
     74        $post_id = false;
    8475
    8576        /**
     
    9889
    9990        if ( ! $bypass_cache ) {
    100             $site_automation_data = get_option( "sophi_site_automation_data_{$page}_{$widget}" );
     91            $query = new \WP_Query(
     92                [
     93                    'post_name__in'          => [ "sophi-site-automation-data-{$page}-{$widget}" ],
     94                    'post_type'              => 'sophi-response',
     95                    'posts_per_page'         => 1,
     96                    'fields'                 => 'ids',
     97                    'post_status'            => 'any',
     98                    'no_found_rows'          => true,
     99                    'update_post_term_cache' => false
     100                ]
     101            );
     102
     103            if ( $query->have_posts() ) {
     104                $post_id = $query->posts[0];
     105                $last_update = get_post_meta( $post_id, 'sophi_site_automation_last_updated', true );
     106
     107                if ( $last_update + 5 * MINUTE_IN_SECONDS > time() ) {
     108                    $site_automation_data = get_post_meta( $post_id, 'sophi_site_automation_data', true );
     109                }
     110            }
    101111        }
    102112
     
    126136
    127137        $this->set_status( [ 'success' => true ] );
    128         return $this->process( $response, $bypass_cache );
     138        return $this->process( $response, $bypass_cache, $post_id );
    129139    }
    130140
     
    194204     */
    195205    private function request( $timeout ) {
    196         $access_token = $this->auth->get_access_token();
    197 
    198         if ( is_wp_error( $access_token ) ) {
    199             return $access_token;
    200         }
    201206
    202207        $args = [
    203208            'headers' => [
    204209                'Content-Type'  => 'application/json',
    205                 'Authorization' => 'Bearer ' . $access_token,
     210                'Cache-Control' => 'no-cache',
    206211            ],
    207212        ];
     
    255260     * Process response from Sophi.
    256261     *
    257      * @param array $response Response of Site Automation API.
    258      * @param bool  $bypass_cache Whether to bypass cache or not.
     262     * @param array    $response Response of Site Automation API.
     263     * @param bool     $bypass_cache Whether to bypass cache or not.
     264     * @param int|bool $post_id The post id to update the post meta with response or false.
    259265     *
    260266     * @return array
    261267     */
    262     private function process( $response, $bypass_cache ) {
     268    private function process( $response, $bypass_cache, $post_id ) {
    263269        if ( ! $response ) {
    264270            return [];
     
    266272
    267273        if ( ! $bypass_cache ) {
    268             update_option( "sophi_site_automation_data_{$this->page}_{$this->widget}", $response );
     274            if ( ! $post_id ) {
     275                $post_id = wp_insert_post(
     276                    [
     277                        'post_type'  => 'sophi-response',
     278                        'post_title' => "sophi-site-automation-data-{$this->page}-{$this->widget}",
     279                        'post_name'  => "sophi-site-automation-data-{$this->page}-{$this->widget}",
     280                    ]
     281                );
     282            }
     283            update_post_meta( $post_id, 'sophi_site_automation_data', $response );
     284            update_post_meta( $post_id, 'sophi_site_automation_last_updated', time() );
    269285        }
    270286        return $response;
     
    279295     * @return string
    280296     */
    281     private function set_api_url( $page, $widget ) {
     297    private function set_api_url( $page = '', $widget = '' ) {
    282298        $site_automation_url = get_sophi_settings( 'site_automation_url' );
    283299        $site_automation_url = untrailingslashit( $site_automation_url );
    284 
    285         $host = wp_parse_url( get_home_url(), PHP_URL_HOST );
    286 
    287         return sprintf( '%1$s/curatedHosts/%2$s/curator?page=%3$s&widget=%4$s', $site_automation_url, $host, $page, $widget );
     300        $host                = get_sophi_settings( 'host' );
     301        $tenant_id           = get_sophi_settings( 'tenant_id' );
     302
     303        $url = sprintf(
     304            '%1$s/%2$s/hosts/%3$s/pages/%4$s',
     305            $site_automation_url,
     306            $tenant_id,
     307            $host,
     308            $page
     309        );
     310
     311        if ( ! empty ( $widget ) ) {
     312            $url = sprintf(
     313                '%1$s/widgets/%2$s',
     314                $url,
     315                $widget
     316            );
     317        }
     318
     319        return $url . '.json';
    288320    }
    289321
  • sophi/tags/1.2.0/includes/classes/SiteAutomation/Services.php

    r2521616 r2770818  
    2323     */
    2424    public function register() {
    25         $this->auth        = new Auth();
    26         $this->request     = new Request( $this->auth );
     25        $this->request     = new Request();
    2726        $this->integration = new Integration( $this->request );
    2827    }
  • sophi/tags/1.2.0/includes/functions/settings.php

    r2648442 r2770818  
    88namespace SophiWP\Settings;
    99
    10 use SophiWP\SiteAutomation\Auth;
    1110use function SophiWP\Utils\get_domain;
    1211use function SophiWP\Utils\is_configured;
     
    157156
    158157    add_settings_field(
    159         'client_id',
    160         __( 'Client ID', 'sophi-wp' ),
     158        'host',
     159        __( 'Host', 'sophi-wp' ),
    161160        __NAMESPACE__ . '\render_input',
    162161        SETTINGS_GROUP,
    163162        'sophi_api',
    164163        [
    165             'label_for' => 'client_id',
    166         ]
    167     );
    168 
    169     add_settings_field(
    170         'client_secret',
    171         __( 'Client Secret', 'sophi-wp' ),
     164            'label_for' => 'host',
     165        ]
     166    );
     167
     168    add_settings_field(
     169        'tenant_id',
     170        __( 'Tenant ID', 'sophi-wp' ),
    172171        __NAMESPACE__ . '\render_input',
    173172        SETTINGS_GROUP,
    174173        'sophi_api',
    175174        [
    176             'label_for' => 'client_secret',
     175            'label_for' => 'tenant_id',
    177176        ]
    178177    );
     
    233232        'collector_url'       => 'collector.sophi.io',
    234233        'tracker_client_id'   => get_domain(),
    235         'client_id'           => '',
    236         'client_secret'       => '',
     234        'host'                => '',
     235        'tenant_id'           => '',
    237236        'site_automation_url' => '',
    238237        'query_integration'   => 1,
     
    258257    if ( empty( $settings['query_integration'] ) ) {
    259258        $settings['query_integration'] = 0;
    260     }
    261 
    262     $prev_settings = get_option( SETTINGS_GROUP );
    263 
    264     // Delete the option that holds the access token when the environment is changed
    265     if ( ! empty( $prev_settings['environment'] ) && ! empty( $settings['environment'] ) && $prev_settings['environment'] !== $settings['environment'] ) {
    266         delete_option( 'sophi_site_automation_access_token' );
    267     }
    268 
    269     if ( ! empty( $settings['client_id'] && ! empty( $settings['client_secret'] ) ) ) {
    270         $auth = new Auth();
    271         $auth->set_environment( $settings['environment'] );
    272         $response = $auth->request_access_token( $settings['client_id'], $settings['client_secret'] );
    273         if ( is_wp_error( $response ) ) {
    274             add_settings_error(
    275                 SETTINGS_GROUP,
    276                 SETTINGS_GROUP,
    277                 $response->get_error_message()
    278             );
    279         }
    280     } else {
    281         add_settings_error(
    282             SETTINGS_GROUP,
    283             SETTINGS_GROUP,
    284             __( 'Both Client ID and Client Secret are required for Site Automation integration.', 'sophi-wp' )
    285         );
    286259    }
    287260
     
    311284
    312285        $settings['collector_url'] = $url;
     286    }
     287
     288    if ( empty( $settings['host'] ) || empty( $settings['tenant_id'] ) ) {
     289        add_settings_error(
     290            SETTINGS_GROUP,
     291            SETTINGS_GROUP,
     292            __( 'Both Host and Tenant ID are required for Site Automation integration.', 'sophi-wp' )
     293        );
     294    }
     295
     296    if ( isset( $settings['client_id'] ) ) {
     297        unset( $settings['client_id'] );
     298    }
     299
     300    if ( isset( $settings['client_secret'] ) ) {
     301        unset( $settings['client_secret'] );
    313302    }
    314303
  • sophi/tags/1.2.0/readme.txt

    r2732874 r2770818  
    33Tags:              Sophi, Site Automation, Curator, Collector, AI, Artifical Intelligence, ML, Machine Learning, Content Curation
    44Tested up to:      6.0
    5 Stable tag:        1.1.3
     5Stable tag:        1.2.0
    66License:           GPLv2 or later
    77License URI:       http://www.gnu.org/licenses/gpl-2.0.html
     
    5151== Usage ==
    5252
    53 There are two potential ways to integrate Sophi Site Automation results with your WordPress site. The default approach includes a Sophi Site Automation block that integrates with `WP_Query` by injecting Posts IDs via the `posts_pre_query` filter that gets fetched later to return the actual Posts. In the same fashion, you can integrate Sophi results with your `WP_Query` object by setting the `sophi_curated_page` and `sophi_curated_widget` query parameters.
     53There are two potential ways to integrate Sophi Site Automation results with your WordPress site. The default approach includes a Sophi Site Automation block that integrates with `get_posts` by injecting Posts IDs via the `posts_pre_query` filter that gets fetched later to return the actual Posts. In the same fashion, you can integrate Sophi results with your `WP_Query` object by setting the `sophi_curated_page` and `sophi_curated_widget` query parameters.
    5454
    5555More details on each of these two options are described below.  If you are not certain on the best integration approach, considering the following:
     
    110110== Caveats ==
    111111
     112=== WordPress VIP and `WP_Query` ===
     113
    112114While the above query integration works just fine, it has been observed on [WordPress VIP](https://wpvip.com/) infrastructure that `WP_Query` may return latest posts instead of the posts curated by Sophi due to the [Advanced Post Cache](https://github.com/Automattic/advanced-post-cache) plugin used by the VIP platform. A workaround for this is to use [`get_posts()`](https://developer.wordpress.org/reference/functions/get_posts/) instead and as good practice to add a comment explaining the usage of it so that developers new to it don't swap it for `WP_Query`. Also remember to whitelist `get_posts` by adding the following inline comment so that PHPCS doesn't throw a warning:
    113115
     
    145147Object caching is encouraged, as the plugin saves Sophi data as a transient.  If you do not have object caching, then the data will be saved as a transient in the options table but note that these will eventually expire.
    146148
     149The default caching period is five minutes. This can be modified with the `sophi_cache_duration` hook.
     150
     151= Sophi API empty response =
     152
     153If the Sophi API returns an empty Post ID array, the plugin will result in a "no results" response.  The `sophi_curated_post_list` filter can be used to modify the Sophi API response to allow manual posts to be injected into the final array previous to returning the filterable value from `posts_pre_query` (e.g., via a fallback method to inject posts that would be a good fit).
     154
    147155== Documentation ==
    148156
     
    179187== Changelog ==
    180188
     189= 1.2.0 - 2022-08-15 =
     190* **Added:** New Curator API (props [@Sidsector9](https://github.com/Sidsector9), [@dinhtungdu](https://github.com/dinhtungdu) via [#310](https://github.com/globeandmail/sophi-for-wordpress/pull/310).
     191* **Added:** Documentation on default handling of Sophi API empty array response (props [@jeffpaul](https://github.com/jeffpaul), [@oscarssanchez](https://github.com/oscarssanchez) via [#307](https://github.com/globeandmail/sophi-for-wordpress/pull/307).
     192* **Added:** New tutorial sections added to the documentation site (props [@dkotter](https://github.com/dkotter), [@YMufleh](https://github.com/YMufleh) via [#318](https://github.com/globeandmail/sophi-for-wordpress/pull/318).
     193* **Changed:** Instead of storing responses from Sophi in an option, store that in a new CPT, `sophi-response` (props [@oscarssanchez](https://github.com/oscarssanchez), [@cadic](https://github.com/cadic), [@felipeelia](https://github.com/felipeelia) via [#298](https://github.com/globeandmail/sophi-for-wordpress/pull/298).
     194* **Changed:** Replaces `WP_Query` with `get_posts` in details about the Sophi Automation block (props [@Sidsector9](https://github.com/Sidsector9), [@jeffpaul](https://github.com/jeffpaul) via [#300](https://github.com/globeandmail/sophi-for-wordpress/pull/300).
     195* **Removed:** Dependency on Auth0 and replaced with the new Curator API (props [@Sidsector9](https://github.com/Sidsector9), [@dinhtungdu](https://github.com/dinhtungdu) via [#310](https://github.com/globeandmail/sophi-for-wordpress/pull/310).
     196* **Fixed:** Ensure we are properly getting cached responses (props [@oscarssanchez](https://github.com/oscarssanchez), [@Sidsector9](https://github.com/Sidsector9), [@felipeelia](https://github.com/felipeelia) via [#305](https://github.com/globeandmail/sophi-for-wordpress/pull/305).
     197* **Security:** Added PHP compatibility checker (props [@Sidsector9](https://github.com/Sidsector9), [@dkotter](https://github.com/dkotter) via [#317](https://github.com/globeandmail/sophi-for-wordpress/pull/317).
     198* **Security:** Update dependency `10up-toolkit` from v4.0.0 to v4.1.2 (props [@renovate](https://github.com/apps/renovate), [@Sidsector9](https://github.com/Sidsector9) via [#299](https://github.com/globeandmail/sophi-for-wordpress/pull/299), [#303](https://github.com/globeandmail/sophi-for-wordpress/pull/303).
     199* **Security:** Update dependency `phpunit/phpunit` from v8.5.26 to v8.5.27 (props [@renovate](https://github.com/apps/renovate) via [#304](https://github.com/globeandmail/sophi-for-wordpress/pull/304).
     200
    181201= 1.1.3 - 2022-05-27 =
    182 * **Added: WordPress and Sophi plugin versions to Javascript and AMP Tracking (props [@oscarssanchez](https://github.com/oscarssanchez), [@jeffpaul](https://github.com/jeffpaul), [@YMufleh](https://github.com/YMufleh) via [#287](https://github.com/globeandmail/sophi-for-wordpress/pull/287)).
    183 * **Added: Documentation for `sophi_cache_duration` filter (props [@Sidsector9](https://github.com/Sidsector9), [@barryceelen](https://github.com/barryceelen), [@jeffpaul](https://github.com/jeffpaul) via [#285](https://github.com/globeandmail/sophi-for-wordpress/pull/285)).
    184 * **Added: Unit tests (props [@cadic](https://github.com/cadic) via [#291](https://github.com/globeandmail/sophi-for-wordpress/pull/291)).
     202* **Added:** WordPress and Sophi plugin versions to Javascript and AMP Tracking (props [@oscarssanchez](https://github.com/oscarssanchez), [@jeffpaul](https://github.com/jeffpaul), [@YMufleh](https://github.com/YMufleh) via [#287](https://github.com/globeandmail/sophi-for-wordpress/pull/287)).
     203* **Added:** Documentation for `sophi_cache_duration` filter (props [@Sidsector9](https://github.com/Sidsector9), [@barryceelen](https://github.com/barryceelen), [@jeffpaul](https://github.com/jeffpaul) via [#285](https://github.com/globeandmail/sophi-for-wordpress/pull/285)).
     204* **Added:** Unit tests (props [@cadic](https://github.com/cadic) via [#291](https://github.com/globeandmail/sophi-for-wordpress/pull/291)).
    185205* **Changed:** Reverted response saving back to options table from post meta field (props [@oscarssanchez](https://github.com/oscarssanchez) via [#280](https://github.com/globeandmail/sophi-for-wordpress/pull/280)).
    186206* **Changed:** Replace deprecated `block_categories` filter with `block_categories_all` (props [@Sidsector9](https://github.com/Sidsector9), [@cadic](https://github.com/cadic), [@jeffpaul](https://github.com/jeffpaul) via [#292](https://github.com/globeandmail/sophi-for-wordpress/pull/292)).
     
    242262= 1.0.9 - 2022-02-18 =
    243263* **Added:** `hostname` and `path` fields to schema (props [@Rahmon](https://github.com/Rahmon), [@dinhtungdu](https://github.com/dinhtungdu)).
    244 * **Fixed:** Return empty post list from Sophi response (props [@oscarssanchez](https://github.com/oscarssanchez), [@barryceelen](https://github.com/barryceelen), [@felipeelia](https://github.com/felipeelia)).
     264* **Added:** - `sophi_curated_post_list` filter to modify the Sophi API response to allow manual posts to be injected previous to returning the filterable value from `posts_pre_query` (e.g., via a fallback method to inject posts that would be a good fit) (props [@oscarssanchez](https://github.com/oscarssanchez), [@barryceelen](https://github.com/barryceelen), [@felipeelia](https://github.com/felipeelia)).
     265* **Fixed:** Sophi API empty Post ID array response changed from using `WP_Query` default results to a "no results" response (props [@oscarssanchez](https://github.com/oscarssanchez), [@barryceelen](https://github.com/barryceelen), [@felipeelia](https://github.com/felipeelia)).
    245266* **Security:** Update dependency `phpunit/phpunit` from 8.5.21 to 8.5.23 (props [@renovate](https://github.com/apps/renovate)).
    246267* **Security:** Update dependency `prop-types` from 15.8.0 to 15.8.1 (props [@renovate](https://github.com/apps/renovate)).
  • sophi/tags/1.2.0/sophi.php

    r2732874 r2770818  
    44 * Plugin URI:        https://github.com/globeandmail/sophi-for-wordpress
    55 * Description:       WordPress VIP-compatible plugin for the Sophi.io Site Automation service.
    6  * Version:           1.1.3
     6 * Version:           1.2.0
    77 * Requires at least: 5.6
    88 * Requires PHP:      7.4
     
    1717
    1818// Useful global constants.
    19 define( 'SOPHI_WP_VERSION', '1.1.3' );
     19define( 'SOPHI_WP_VERSION', '1.2.0' );
    2020define( 'SOPHI_WP_URL', plugin_dir_url( __FILE__ ) );
    2121define( 'SOPHI_WP_PATH', plugin_dir_path( __FILE__ ) );
     
    3636require_once SOPHI_WP_INC . 'functions/content-sync.php';
    3737require_once SOPHI_WP_INC . 'functions/blocks.php';
     38require_once SOPHI_WP_INC . 'functions/post-type.php';
    3839
    3940// phpcs:enable WordPressVIPMinimum.Files.IncludingFile.UsingCustomConstant
     
    6162            SophiWP\Core\setup();
    6263            SophiWP\Settings\setup();
     64            SophiWP\PostType\setup();
    6365
    6466            if ( ! SophiWP\Utils\is_configured() ) {
  • sophi/tags/1.2.0/vendor/autoload.php

    r2732874 r2770818  
    1010require_once __DIR__ . '/composer/autoload_real.php';
    1111
    12 return ComposerAutoloaderInitbf93bab2113570afc5e28efe35def6f9::getLoader();
     12return ComposerAutoloaderInit31b3b6f4e914ea7285135ebc79ce32d5::getLoader();
  • sophi/tags/1.2.0/vendor/composer/InstalledVersions.php

    r2712442 r2770818  
    2929    /**
    3030     * @var mixed[]|null
    31      * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
     31     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
    3232     */
    3333    private static $installed;
     
    4040    /**
    4141     * @var array[]
    42      * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     42     * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    4343     */
    4444    private static $installedByVendor = array();
     
    244244    /**
    245245     * @return array
    246      * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
     246     * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
    247247     */
    248248    public static function getRootPackage()
     
    258258     * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
    259259     * @return array[]
    260      * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
     260     * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
    261261     */
    262262    public static function getRawData()
     
    281281     *
    282282     * @return array[]
    283      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     283     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    284284     */
    285285    public static function getAllRawData()
     
    304304     * @return void
    305305     *
    306      * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
     306     * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
    307307     */
    308308    public static function reload($data)
     
    314314    /**
    315315     * @return array[]
    316      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     316     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    317317     */
    318318    private static function getInstalled()
  • sophi/tags/1.2.0/vendor/composer/autoload_real.php

    r2732874 r2770818  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitbf93bab2113570afc5e28efe35def6f9
     5class ComposerAutoloaderInit31b3b6f4e914ea7285135ebc79ce32d5
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInitbf93bab2113570afc5e28efe35def6f9', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit31b3b6f4e914ea7285135ebc79ce32d5', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInitbf93bab2113570afc5e28efe35def6f9', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit31b3b6f4e914ea7285135ebc79ce32d5', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInitbf93bab2113570afc5e28efe35def6f9::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit31b3b6f4e914ea7285135ebc79ce32d5::getInitializer($loader));
    3333
    3434        $loader->register(true);
    3535
    36         $includeFiles = \Composer\Autoload\ComposerStaticInitbf93bab2113570afc5e28efe35def6f9::$files;
     36        $includeFiles = \Composer\Autoload\ComposerStaticInit31b3b6f4e914ea7285135ebc79ce32d5::$files;
    3737        foreach ($includeFiles as $fileIdentifier => $file) {
    38             composerRequirebf93bab2113570afc5e28efe35def6f9($fileIdentifier, $file);
     38            composerRequire31b3b6f4e914ea7285135ebc79ce32d5($fileIdentifier, $file);
    3939        }
    4040
     
    4848 * @return void
    4949 */
    50 function composerRequirebf93bab2113570afc5e28efe35def6f9($fileIdentifier, $file)
     50function composerRequire31b3b6f4e914ea7285135ebc79ce32d5($fileIdentifier, $file)
    5151{
    5252    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • sophi/tags/1.2.0/vendor/composer/autoload_static.php

    r2732874 r2770818  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitbf93bab2113570afc5e28efe35def6f9
     7class ComposerStaticInit31b3b6f4e914ea7285135ebc79ce32d5
    88{
    99    public static $files = array (
     
    8181    {
    8282        return \Closure::bind(function () use ($loader) {
    83             $loader->prefixLengthsPsr4 = ComposerStaticInitbf93bab2113570afc5e28efe35def6f9::$prefixLengthsPsr4;
    84             $loader->prefixDirsPsr4 = ComposerStaticInitbf93bab2113570afc5e28efe35def6f9::$prefixDirsPsr4;
    85             $loader->classMap = ComposerStaticInitbf93bab2113570afc5e28efe35def6f9::$classMap;
     83            $loader->prefixLengthsPsr4 = ComposerStaticInit31b3b6f4e914ea7285135ebc79ce32d5::$prefixLengthsPsr4;
     84            $loader->prefixDirsPsr4 = ComposerStaticInit31b3b6f4e914ea7285135ebc79ce32d5::$prefixDirsPsr4;
     85            $loader->classMap = ComposerStaticInit31b3b6f4e914ea7285135ebc79ce32d5::$classMap;
    8686
    8787        }, null, ClassLoader::class);
  • sophi/tags/1.2.0/vendor/composer/installed.json

    r2698689 r2770818  
    304304        {
    305305            "name": "symfony/polyfill-ctype",
    306             "version": "v1.25.0",
    307             "version_normalized": "1.25.0.0",
     306            "version": "v1.26.0",
     307            "version_normalized": "1.26.0.0",
    308308            "source": {
    309309                "type": "git",
    310310                "url": "https://github.com/symfony/polyfill-ctype.git",
    311                 "reference": "30885182c981ab175d4d034db0f6f469898070ab"
    312             },
    313             "dist": {
    314                 "type": "zip",
    315                 "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab",
    316                 "reference": "30885182c981ab175d4d034db0f6f469898070ab",
     311                "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4"
     312            },
     313            "dist": {
     314                "type": "zip",
     315                "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
     316                "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
    317317                "shasum": ""
    318318            },
     
    326326                "ext-ctype": "For best performance"
    327327            },
    328             "time": "2021-10-20T20:35:02+00:00",
     328            "time": "2022-05-24T11:49:31+00:00",
    329329            "type": "library",
    330330            "extra": {
    331331                "branch-alias": {
    332                     "dev-main": "1.23-dev"
     332                    "dev-main": "1.26-dev"
    333333                },
    334334                "thanks": {
     
    369369            ],
    370370            "support": {
    371                 "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0"
     371                "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0"
    372372            },
    373373            "funding": [
  • sophi/tags/1.2.0/vendor/composer/installed.php

    r2732874 r2770818  
    11<?php return array(
    22    'root' => array(
    3         'pretty_version' => '1.1.3',
    4         'version' => '1.1.3.0',
     3        'name' => 'globeandmail/sophi-for-wordpress',
     4        'pretty_version' => '1.2.0',
     5        'version' => '1.2.0.0',
     6        'reference' => 'b2d273ae1e4bc8dd95dd47158f41e40d9f161a89',
    57        'type' => 'wordpress-plugin',
    68        'install_path' => __DIR__ . '/../../',
    79        'aliases' => array(),
    8         'reference' => '1f21f00d23cad5ee77de7e7ef50050134f15dcb8',
    9         'name' => 'globeandmail/sophi-for-wordpress',
    1010        'dev' => false,
    1111    ),
     
    1414            'pretty_version' => '0.9.3',
    1515            'version' => '0.9.3.0',
     16            'reference' => 'ca57d18f028f84f777b2168cd1911b0dee2343ae',
    1617            'type' => 'library',
    1718            'install_path' => __DIR__ . '/../brick/math',
    1819            'aliases' => array(),
    19             'reference' => 'ca57d18f028f84f777b2168cd1911b0dee2343ae',
    2020            'dev_requirement' => false,
    2121        ),
    2222        'globeandmail/sophi-for-wordpress' => array(
    23             'pretty_version' => '1.1.3',
    24             'version' => '1.1.3.0',
     23            'pretty_version' => '1.2.0',
     24            'version' => '1.2.0.0',
     25            'reference' => 'b2d273ae1e4bc8dd95dd47158f41e40d9f161a89',
    2526            'type' => 'wordpress-plugin',
    2627            'install_path' => __DIR__ . '/../../',
    2728            'aliases' => array(),
    28             'reference' => '1f21f00d23cad5ee77de7e7ef50050134f15dcb8',
    2929            'dev_requirement' => false,
    3030        ),
     
    3232            'pretty_version' => '1.2.2',
    3333            'version' => '1.2.2.0',
     34            'reference' => 'cccc74ee5e328031b15640b51056ee8d3bb66c0a',
    3435            'type' => 'library',
    3536            'install_path' => __DIR__ . '/../ramsey/collection',
    3637            'aliases' => array(),
    37             'reference' => 'cccc74ee5e328031b15640b51056ee8d3bb66c0a',
    3838            'dev_requirement' => false,
    3939        ),
     
    4141            'pretty_version' => '4.2.3',
    4242            'version' => '4.2.3.0',
     43            'reference' => 'fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df',
    4344            'type' => 'library',
    4445            'install_path' => __DIR__ . '/../ramsey/uuid',
    4546            'aliases' => array(),
    46             'reference' => 'fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df',
    4747            'dev_requirement' => false,
    4848        ),
     
    5656            'pretty_version' => '0.5.0',
    5757            'version' => '0.5.0.0',
     58            'reference' => '32a08e9a7c25d1c51621751e1cdfcffcdef6cfe5',
    5859            'type' => 'library',
    5960            'install_path' => __DIR__ . '/../snowplow/snowplow-tracker',
    6061            'aliases' => array(),
    61             'reference' => '32a08e9a7c25d1c51621751e1cdfcffcdef6cfe5',
    6262            'dev_requirement' => false,
    6363        ),
    6464        'symfony/polyfill-ctype' => array(
    65             'pretty_version' => 'v1.25.0',
    66             'version' => '1.25.0.0',
     65            'pretty_version' => 'v1.26.0',
     66            'version' => '1.26.0.0',
     67            'reference' => '6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4',
    6768            'type' => 'library',
    6869            'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
    6970            'aliases' => array(),
    70             'reference' => '30885182c981ab175d4d034db0f6f469898070ab',
    7171            'dev_requirement' => false,
    7272        ),
     
    7474            'pretty_version' => 'v1.24.0',
    7575            'version' => '1.24.0.0',
     76            'reference' => '57b712b08eddb97c762a8caa32c84e037892d2e9',
    7677            'type' => 'library',
    7778            'install_path' => __DIR__ . '/../symfony/polyfill-php80',
    7879            'aliases' => array(),
    79             'reference' => '57b712b08eddb97c762a8caa32c84e037892d2e9',
    8080            'dev_requirement' => false,
    8181        ),
     
    8383            'pretty_version' => 'v1.24.0',
    8484            'version' => '1.24.0.0',
     85            'reference' => '5de4ba2d41b15f9bd0e19b2ab9674135813ec98f',
    8586            'type' => 'library',
    8687            'install_path' => __DIR__ . '/../symfony/polyfill-php81',
    8788            'aliases' => array(),
    88             'reference' => '5de4ba2d41b15f9bd0e19b2ab9674135813ec98f',
    8989            'dev_requirement' => false,
    9090        ),
  • sophi/trunk/includes/blocks/site-automation-block/register.php

    r2725617 r2770818  
    4141    $widget_name = sanitize_title( $attributes['widgetName'] );
    4242
    43     $curated_posts_transient_key = 'sophi_curated_posts_' . $page_name . '_' . $widget_name;
    44 
    4543    /**
    4644     * Whether to bypass caching.
     
    5755    $bypass_cache = apply_filters( 'sophi_bypass_curated_posts_cache', false, $page_name, $widget_name );
    5856
    59     $curated_posts = get_transient( $curated_posts_transient_key );
     57    $curated_posts = false;
    6058
    61     if ( $bypass_cache || false === $curated_posts ) {
     59    if ( ! $bypass_cache ) {
     60        $sophi_cached_response = new \WP_Query(
     61            [
     62                'post_name__in'          => [ "sophi-site-automation-data-{$page_name}-{$widget_name}" ],
     63                'post_type'              => 'sophi-response',
     64                'post_status'            => 'any',
     65                'posts_per_page'         => 1,
     66                'fields'                 => 'ids',
     67                'no_found_rows'          => true,
     68                'update_post_term_cache' => false
     69            ]
     70        );
     71
     72        if ( $sophi_cached_response->have_posts() ) {
     73            $last_update = get_post_meta( $sophi_cached_response->posts[0], 'sophi_site_automation_last_updated', true );
     74
     75            if ( $last_update + 5 * MINUTE_IN_SECONDS > time() ) {
     76                $curated_posts = get_post_meta( $sophi_cached_response->posts[0], 'sophi_site_automation_data', true );
     77            }
     78        }
     79    }
     80
     81    if ( $bypass_cache || ! $curated_posts ) {
     82
    6283        // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.get_posts_get_posts
    6384        $curated_posts = get_posts(
     
    7293        }
    7394
    74         set_transient( $curated_posts_transient_key, $curated_posts, 5 * MINUTE_IN_SECONDS );
    7595    }
    7696
  • sophi/trunk/includes/classes/SiteAutomation/Request.php

    r2732874 r2770818  
    1616
    1717    /**
    18      * Auth object which manages access_token.
    19      *
    20      * @var Auth $auth
    21      */
    22     private $auth;
    23 
    24     /**
    2518     * Site Automation API URL.
    2619     *
     
    5346     * Class constructor.
    5447     *
    55      * @param Auth $auth Authentication object.
    56      */
    57     public function __construct( $auth ) {
    58         $this->auth    = $auth;
    59 
     48     */
     49    public function __construct() {
    6050        add_action(
    6151            'sophi_retry_get_curated_data',
     
    8272        $this->status         = $this->get_status();
    8373        $site_automation_data = false;
     74        $post_id = false;
    8475
    8576        /**
     
    9889
    9990        if ( ! $bypass_cache ) {
    100             $site_automation_data = get_option( "sophi_site_automation_data_{$page}_{$widget}" );
     91            $query = new \WP_Query(
     92                [
     93                    'post_name__in'          => [ "sophi-site-automation-data-{$page}-{$widget}" ],
     94                    'post_type'              => 'sophi-response',
     95                    'posts_per_page'         => 1,
     96                    'fields'                 => 'ids',
     97                    'post_status'            => 'any',
     98                    'no_found_rows'          => true,
     99                    'update_post_term_cache' => false
     100                ]
     101            );
     102
     103            if ( $query->have_posts() ) {
     104                $post_id = $query->posts[0];
     105                $last_update = get_post_meta( $post_id, 'sophi_site_automation_last_updated', true );
     106
     107                if ( $last_update + 5 * MINUTE_IN_SECONDS > time() ) {
     108                    $site_automation_data = get_post_meta( $post_id, 'sophi_site_automation_data', true );
     109                }
     110            }
    101111        }
    102112
     
    126136
    127137        $this->set_status( [ 'success' => true ] );
    128         return $this->process( $response, $bypass_cache );
     138        return $this->process( $response, $bypass_cache, $post_id );
    129139    }
    130140
     
    194204     */
    195205    private function request( $timeout ) {
    196         $access_token = $this->auth->get_access_token();
    197 
    198         if ( is_wp_error( $access_token ) ) {
    199             return $access_token;
    200         }
    201206
    202207        $args = [
    203208            'headers' => [
    204209                'Content-Type'  => 'application/json',
    205                 'Authorization' => 'Bearer ' . $access_token,
     210                'Cache-Control' => 'no-cache',
    206211            ],
    207212        ];
     
    255260     * Process response from Sophi.
    256261     *
    257      * @param array $response Response of Site Automation API.
    258      * @param bool  $bypass_cache Whether to bypass cache or not.
     262     * @param array    $response Response of Site Automation API.
     263     * @param bool     $bypass_cache Whether to bypass cache or not.
     264     * @param int|bool $post_id The post id to update the post meta with response or false.
    259265     *
    260266     * @return array
    261267     */
    262     private function process( $response, $bypass_cache ) {
     268    private function process( $response, $bypass_cache, $post_id ) {
    263269        if ( ! $response ) {
    264270            return [];
     
    266272
    267273        if ( ! $bypass_cache ) {
    268             update_option( "sophi_site_automation_data_{$this->page}_{$this->widget}", $response );
     274            if ( ! $post_id ) {
     275                $post_id = wp_insert_post(
     276                    [
     277                        'post_type'  => 'sophi-response',
     278                        'post_title' => "sophi-site-automation-data-{$this->page}-{$this->widget}",
     279                        'post_name'  => "sophi-site-automation-data-{$this->page}-{$this->widget}",
     280                    ]
     281                );
     282            }
     283            update_post_meta( $post_id, 'sophi_site_automation_data', $response );
     284            update_post_meta( $post_id, 'sophi_site_automation_last_updated', time() );
    269285        }
    270286        return $response;
     
    279295     * @return string
    280296     */
    281     private function set_api_url( $page, $widget ) {
     297    private function set_api_url( $page = '', $widget = '' ) {
    282298        $site_automation_url = get_sophi_settings( 'site_automation_url' );
    283299        $site_automation_url = untrailingslashit( $site_automation_url );
    284 
    285         $host = wp_parse_url( get_home_url(), PHP_URL_HOST );
    286 
    287         return sprintf( '%1$s/curatedHosts/%2$s/curator?page=%3$s&widget=%4$s', $site_automation_url, $host, $page, $widget );
     300        $host                = get_sophi_settings( 'host' );
     301        $tenant_id           = get_sophi_settings( 'tenant_id' );
     302
     303        $url = sprintf(
     304            '%1$s/%2$s/hosts/%3$s/pages/%4$s',
     305            $site_automation_url,
     306            $tenant_id,
     307            $host,
     308            $page
     309        );
     310
     311        if ( ! empty ( $widget ) ) {
     312            $url = sprintf(
     313                '%1$s/widgets/%2$s',
     314                $url,
     315                $widget
     316            );
     317        }
     318
     319        return $url . '.json';
    288320    }
    289321
  • sophi/trunk/includes/classes/SiteAutomation/Services.php

    r2521616 r2770818  
    2323     */
    2424    public function register() {
    25         $this->auth        = new Auth();
    26         $this->request     = new Request( $this->auth );
     25        $this->request     = new Request();
    2726        $this->integration = new Integration( $this->request );
    2827    }
  • sophi/trunk/includes/functions/settings.php

    r2648442 r2770818  
    88namespace SophiWP\Settings;
    99
    10 use SophiWP\SiteAutomation\Auth;
    1110use function SophiWP\Utils\get_domain;
    1211use function SophiWP\Utils\is_configured;
     
    157156
    158157    add_settings_field(
    159         'client_id',
    160         __( 'Client ID', 'sophi-wp' ),
     158        'host',
     159        __( 'Host', 'sophi-wp' ),
    161160        __NAMESPACE__ . '\render_input',
    162161        SETTINGS_GROUP,
    163162        'sophi_api',
    164163        [
    165             'label_for' => 'client_id',
    166         ]
    167     );
    168 
    169     add_settings_field(
    170         'client_secret',
    171         __( 'Client Secret', 'sophi-wp' ),
     164            'label_for' => 'host',
     165        ]
     166    );
     167
     168    add_settings_field(
     169        'tenant_id',
     170        __( 'Tenant ID', 'sophi-wp' ),
    172171        __NAMESPACE__ . '\render_input',
    173172        SETTINGS_GROUP,
    174173        'sophi_api',
    175174        [
    176             'label_for' => 'client_secret',
     175            'label_for' => 'tenant_id',
    177176        ]
    178177    );
     
    233232        'collector_url'       => 'collector.sophi.io',
    234233        'tracker_client_id'   => get_domain(),
    235         'client_id'           => '',
    236         'client_secret'       => '',
     234        'host'                => '',
     235        'tenant_id'           => '',
    237236        'site_automation_url' => '',
    238237        'query_integration'   => 1,
     
    258257    if ( empty( $settings['query_integration'] ) ) {
    259258        $settings['query_integration'] = 0;
    260     }
    261 
    262     $prev_settings = get_option( SETTINGS_GROUP );
    263 
    264     // Delete the option that holds the access token when the environment is changed
    265     if ( ! empty( $prev_settings['environment'] ) && ! empty( $settings['environment'] ) && $prev_settings['environment'] !== $settings['environment'] ) {
    266         delete_option( 'sophi_site_automation_access_token' );
    267     }
    268 
    269     if ( ! empty( $settings['client_id'] && ! empty( $settings['client_secret'] ) ) ) {
    270         $auth = new Auth();
    271         $auth->set_environment( $settings['environment'] );
    272         $response = $auth->request_access_token( $settings['client_id'], $settings['client_secret'] );
    273         if ( is_wp_error( $response ) ) {
    274             add_settings_error(
    275                 SETTINGS_GROUP,
    276                 SETTINGS_GROUP,
    277                 $response->get_error_message()
    278             );
    279         }
    280     } else {
    281         add_settings_error(
    282             SETTINGS_GROUP,
    283             SETTINGS_GROUP,
    284             __( 'Both Client ID and Client Secret are required for Site Automation integration.', 'sophi-wp' )
    285         );
    286259    }
    287260
     
    311284
    312285        $settings['collector_url'] = $url;
     286    }
     287
     288    if ( empty( $settings['host'] ) || empty( $settings['tenant_id'] ) ) {
     289        add_settings_error(
     290            SETTINGS_GROUP,
     291            SETTINGS_GROUP,
     292            __( 'Both Host and Tenant ID are required for Site Automation integration.', 'sophi-wp' )
     293        );
     294    }
     295
     296    if ( isset( $settings['client_id'] ) ) {
     297        unset( $settings['client_id'] );
     298    }
     299
     300    if ( isset( $settings['client_secret'] ) ) {
     301        unset( $settings['client_secret'] );
    313302    }
    314303
  • sophi/trunk/readme.txt

    r2732874 r2770818  
    33Tags:              Sophi, Site Automation, Curator, Collector, AI, Artifical Intelligence, ML, Machine Learning, Content Curation
    44Tested up to:      6.0
    5 Stable tag:        1.1.3
     5Stable tag:        1.2.0
    66License:           GPLv2 or later
    77License URI:       http://www.gnu.org/licenses/gpl-2.0.html
     
    5151== Usage ==
    5252
    53 There are two potential ways to integrate Sophi Site Automation results with your WordPress site. The default approach includes a Sophi Site Automation block that integrates with `WP_Query` by injecting Posts IDs via the `posts_pre_query` filter that gets fetched later to return the actual Posts. In the same fashion, you can integrate Sophi results with your `WP_Query` object by setting the `sophi_curated_page` and `sophi_curated_widget` query parameters.
     53There are two potential ways to integrate Sophi Site Automation results with your WordPress site. The default approach includes a Sophi Site Automation block that integrates with `get_posts` by injecting Posts IDs via the `posts_pre_query` filter that gets fetched later to return the actual Posts. In the same fashion, you can integrate Sophi results with your `WP_Query` object by setting the `sophi_curated_page` and `sophi_curated_widget` query parameters.
    5454
    5555More details on each of these two options are described below.  If you are not certain on the best integration approach, considering the following:
     
    110110== Caveats ==
    111111
     112=== WordPress VIP and `WP_Query` ===
     113
    112114While the above query integration works just fine, it has been observed on [WordPress VIP](https://wpvip.com/) infrastructure that `WP_Query` may return latest posts instead of the posts curated by Sophi due to the [Advanced Post Cache](https://github.com/Automattic/advanced-post-cache) plugin used by the VIP platform. A workaround for this is to use [`get_posts()`](https://developer.wordpress.org/reference/functions/get_posts/) instead and as good practice to add a comment explaining the usage of it so that developers new to it don't swap it for `WP_Query`. Also remember to whitelist `get_posts` by adding the following inline comment so that PHPCS doesn't throw a warning:
    113115
     
    145147Object caching is encouraged, as the plugin saves Sophi data as a transient.  If you do not have object caching, then the data will be saved as a transient in the options table but note that these will eventually expire.
    146148
     149The default caching period is five minutes. This can be modified with the `sophi_cache_duration` hook.
     150
     151= Sophi API empty response =
     152
     153If the Sophi API returns an empty Post ID array, the plugin will result in a "no results" response.  The `sophi_curated_post_list` filter can be used to modify the Sophi API response to allow manual posts to be injected into the final array previous to returning the filterable value from `posts_pre_query` (e.g., via a fallback method to inject posts that would be a good fit).
     154
    147155== Documentation ==
    148156
     
    179187== Changelog ==
    180188
     189= 1.2.0 - 2022-08-15 =
     190* **Added:** New Curator API (props [@Sidsector9](https://github.com/Sidsector9), [@dinhtungdu](https://github.com/dinhtungdu) via [#310](https://github.com/globeandmail/sophi-for-wordpress/pull/310).
     191* **Added:** Documentation on default handling of Sophi API empty array response (props [@jeffpaul](https://github.com/jeffpaul), [@oscarssanchez](https://github.com/oscarssanchez) via [#307](https://github.com/globeandmail/sophi-for-wordpress/pull/307).
     192* **Added:** New tutorial sections added to the documentation site (props [@dkotter](https://github.com/dkotter), [@YMufleh](https://github.com/YMufleh) via [#318](https://github.com/globeandmail/sophi-for-wordpress/pull/318).
     193* **Changed:** Instead of storing responses from Sophi in an option, store that in a new CPT, `sophi-response` (props [@oscarssanchez](https://github.com/oscarssanchez), [@cadic](https://github.com/cadic), [@felipeelia](https://github.com/felipeelia) via [#298](https://github.com/globeandmail/sophi-for-wordpress/pull/298).
     194* **Changed:** Replaces `WP_Query` with `get_posts` in details about the Sophi Automation block (props [@Sidsector9](https://github.com/Sidsector9), [@jeffpaul](https://github.com/jeffpaul) via [#300](https://github.com/globeandmail/sophi-for-wordpress/pull/300).
     195* **Removed:** Dependency on Auth0 and replaced with the new Curator API (props [@Sidsector9](https://github.com/Sidsector9), [@dinhtungdu](https://github.com/dinhtungdu) via [#310](https://github.com/globeandmail/sophi-for-wordpress/pull/310).
     196* **Fixed:** Ensure we are properly getting cached responses (props [@oscarssanchez](https://github.com/oscarssanchez), [@Sidsector9](https://github.com/Sidsector9), [@felipeelia](https://github.com/felipeelia) via [#305](https://github.com/globeandmail/sophi-for-wordpress/pull/305).
     197* **Security:** Added PHP compatibility checker (props [@Sidsector9](https://github.com/Sidsector9), [@dkotter](https://github.com/dkotter) via [#317](https://github.com/globeandmail/sophi-for-wordpress/pull/317).
     198* **Security:** Update dependency `10up-toolkit` from v4.0.0 to v4.1.2 (props [@renovate](https://github.com/apps/renovate), [@Sidsector9](https://github.com/Sidsector9) via [#299](https://github.com/globeandmail/sophi-for-wordpress/pull/299), [#303](https://github.com/globeandmail/sophi-for-wordpress/pull/303).
     199* **Security:** Update dependency `phpunit/phpunit` from v8.5.26 to v8.5.27 (props [@renovate](https://github.com/apps/renovate) via [#304](https://github.com/globeandmail/sophi-for-wordpress/pull/304).
     200
    181201= 1.1.3 - 2022-05-27 =
    182 * **Added: WordPress and Sophi plugin versions to Javascript and AMP Tracking (props [@oscarssanchez](https://github.com/oscarssanchez), [@jeffpaul](https://github.com/jeffpaul), [@YMufleh](https://github.com/YMufleh) via [#287](https://github.com/globeandmail/sophi-for-wordpress/pull/287)).
    183 * **Added: Documentation for `sophi_cache_duration` filter (props [@Sidsector9](https://github.com/Sidsector9), [@barryceelen](https://github.com/barryceelen), [@jeffpaul](https://github.com/jeffpaul) via [#285](https://github.com/globeandmail/sophi-for-wordpress/pull/285)).
    184 * **Added: Unit tests (props [@cadic](https://github.com/cadic) via [#291](https://github.com/globeandmail/sophi-for-wordpress/pull/291)).
     202* **Added:** WordPress and Sophi plugin versions to Javascript and AMP Tracking (props [@oscarssanchez](https://github.com/oscarssanchez), [@jeffpaul](https://github.com/jeffpaul), [@YMufleh](https://github.com/YMufleh) via [#287](https://github.com/globeandmail/sophi-for-wordpress/pull/287)).
     203* **Added:** Documentation for `sophi_cache_duration` filter (props [@Sidsector9](https://github.com/Sidsector9), [@barryceelen](https://github.com/barryceelen), [@jeffpaul](https://github.com/jeffpaul) via [#285](https://github.com/globeandmail/sophi-for-wordpress/pull/285)).
     204* **Added:** Unit tests (props [@cadic](https://github.com/cadic) via [#291](https://github.com/globeandmail/sophi-for-wordpress/pull/291)).
    185205* **Changed:** Reverted response saving back to options table from post meta field (props [@oscarssanchez](https://github.com/oscarssanchez) via [#280](https://github.com/globeandmail/sophi-for-wordpress/pull/280)).
    186206* **Changed:** Replace deprecated `block_categories` filter with `block_categories_all` (props [@Sidsector9](https://github.com/Sidsector9), [@cadic](https://github.com/cadic), [@jeffpaul](https://github.com/jeffpaul) via [#292](https://github.com/globeandmail/sophi-for-wordpress/pull/292)).
     
    242262= 1.0.9 - 2022-02-18 =
    243263* **Added:** `hostname` and `path` fields to schema (props [@Rahmon](https://github.com/Rahmon), [@dinhtungdu](https://github.com/dinhtungdu)).
    244 * **Fixed:** Return empty post list from Sophi response (props [@oscarssanchez](https://github.com/oscarssanchez), [@barryceelen](https://github.com/barryceelen), [@felipeelia](https://github.com/felipeelia)).
     264* **Added:** - `sophi_curated_post_list` filter to modify the Sophi API response to allow manual posts to be injected previous to returning the filterable value from `posts_pre_query` (e.g., via a fallback method to inject posts that would be a good fit) (props [@oscarssanchez](https://github.com/oscarssanchez), [@barryceelen](https://github.com/barryceelen), [@felipeelia](https://github.com/felipeelia)).
     265* **Fixed:** Sophi API empty Post ID array response changed from using `WP_Query` default results to a "no results" response (props [@oscarssanchez](https://github.com/oscarssanchez), [@barryceelen](https://github.com/barryceelen), [@felipeelia](https://github.com/felipeelia)).
    245266* **Security:** Update dependency `phpunit/phpunit` from 8.5.21 to 8.5.23 (props [@renovate](https://github.com/apps/renovate)).
    246267* **Security:** Update dependency `prop-types` from 15.8.0 to 15.8.1 (props [@renovate](https://github.com/apps/renovate)).
  • sophi/trunk/sophi.php

    r2732874 r2770818  
    44 * Plugin URI:        https://github.com/globeandmail/sophi-for-wordpress
    55 * Description:       WordPress VIP-compatible plugin for the Sophi.io Site Automation service.
    6  * Version:           1.1.3
     6 * Version:           1.2.0
    77 * Requires at least: 5.6
    88 * Requires PHP:      7.4
     
    1717
    1818// Useful global constants.
    19 define( 'SOPHI_WP_VERSION', '1.1.3' );
     19define( 'SOPHI_WP_VERSION', '1.2.0' );
    2020define( 'SOPHI_WP_URL', plugin_dir_url( __FILE__ ) );
    2121define( 'SOPHI_WP_PATH', plugin_dir_path( __FILE__ ) );
     
    3636require_once SOPHI_WP_INC . 'functions/content-sync.php';
    3737require_once SOPHI_WP_INC . 'functions/blocks.php';
     38require_once SOPHI_WP_INC . 'functions/post-type.php';
    3839
    3940// phpcs:enable WordPressVIPMinimum.Files.IncludingFile.UsingCustomConstant
     
    6162            SophiWP\Core\setup();
    6263            SophiWP\Settings\setup();
     64            SophiWP\PostType\setup();
    6365
    6466            if ( ! SophiWP\Utils\is_configured() ) {
  • sophi/trunk/vendor/autoload.php

    r2732874 r2770818  
    1010require_once __DIR__ . '/composer/autoload_real.php';
    1111
    12 return ComposerAutoloaderInitbf93bab2113570afc5e28efe35def6f9::getLoader();
     12return ComposerAutoloaderInit31b3b6f4e914ea7285135ebc79ce32d5::getLoader();
  • sophi/trunk/vendor/composer/InstalledVersions.php

    r2712442 r2770818  
    2929    /**
    3030     * @var mixed[]|null
    31      * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
     31     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
    3232     */
    3333    private static $installed;
     
    4040    /**
    4141     * @var array[]
    42      * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     42     * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    4343     */
    4444    private static $installedByVendor = array();
     
    244244    /**
    245245     * @return array
    246      * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
     246     * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
    247247     */
    248248    public static function getRootPackage()
     
    258258     * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
    259259     * @return array[]
    260      * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
     260     * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
    261261     */
    262262    public static function getRawData()
     
    281281     *
    282282     * @return array[]
    283      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     283     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    284284     */
    285285    public static function getAllRawData()
     
    304304     * @return void
    305305     *
    306      * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
     306     * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
    307307     */
    308308    public static function reload($data)
     
    314314    /**
    315315     * @return array[]
    316      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     316     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    317317     */
    318318    private static function getInstalled()
  • sophi/trunk/vendor/composer/autoload_real.php

    r2732874 r2770818  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitbf93bab2113570afc5e28efe35def6f9
     5class ComposerAutoloaderInit31b3b6f4e914ea7285135ebc79ce32d5
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInitbf93bab2113570afc5e28efe35def6f9', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit31b3b6f4e914ea7285135ebc79ce32d5', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInitbf93bab2113570afc5e28efe35def6f9', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit31b3b6f4e914ea7285135ebc79ce32d5', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInitbf93bab2113570afc5e28efe35def6f9::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit31b3b6f4e914ea7285135ebc79ce32d5::getInitializer($loader));
    3333
    3434        $loader->register(true);
    3535
    36         $includeFiles = \Composer\Autoload\ComposerStaticInitbf93bab2113570afc5e28efe35def6f9::$files;
     36        $includeFiles = \Composer\Autoload\ComposerStaticInit31b3b6f4e914ea7285135ebc79ce32d5::$files;
    3737        foreach ($includeFiles as $fileIdentifier => $file) {
    38             composerRequirebf93bab2113570afc5e28efe35def6f9($fileIdentifier, $file);
     38            composerRequire31b3b6f4e914ea7285135ebc79ce32d5($fileIdentifier, $file);
    3939        }
    4040
     
    4848 * @return void
    4949 */
    50 function composerRequirebf93bab2113570afc5e28efe35def6f9($fileIdentifier, $file)
     50function composerRequire31b3b6f4e914ea7285135ebc79ce32d5($fileIdentifier, $file)
    5151{
    5252    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • sophi/trunk/vendor/composer/autoload_static.php

    r2732874 r2770818  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitbf93bab2113570afc5e28efe35def6f9
     7class ComposerStaticInit31b3b6f4e914ea7285135ebc79ce32d5
    88{
    99    public static $files = array (
     
    8181    {
    8282        return \Closure::bind(function () use ($loader) {
    83             $loader->prefixLengthsPsr4 = ComposerStaticInitbf93bab2113570afc5e28efe35def6f9::$prefixLengthsPsr4;
    84             $loader->prefixDirsPsr4 = ComposerStaticInitbf93bab2113570afc5e28efe35def6f9::$prefixDirsPsr4;
    85             $loader->classMap = ComposerStaticInitbf93bab2113570afc5e28efe35def6f9::$classMap;
     83            $loader->prefixLengthsPsr4 = ComposerStaticInit31b3b6f4e914ea7285135ebc79ce32d5::$prefixLengthsPsr4;
     84            $loader->prefixDirsPsr4 = ComposerStaticInit31b3b6f4e914ea7285135ebc79ce32d5::$prefixDirsPsr4;
     85            $loader->classMap = ComposerStaticInit31b3b6f4e914ea7285135ebc79ce32d5::$classMap;
    8686
    8787        }, null, ClassLoader::class);
  • sophi/trunk/vendor/composer/installed.json

    r2698689 r2770818  
    304304        {
    305305            "name": "symfony/polyfill-ctype",
    306             "version": "v1.25.0",
    307             "version_normalized": "1.25.0.0",
     306            "version": "v1.26.0",
     307            "version_normalized": "1.26.0.0",
    308308            "source": {
    309309                "type": "git",
    310310                "url": "https://github.com/symfony/polyfill-ctype.git",
    311                 "reference": "30885182c981ab175d4d034db0f6f469898070ab"
    312             },
    313             "dist": {
    314                 "type": "zip",
    315                 "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab",
    316                 "reference": "30885182c981ab175d4d034db0f6f469898070ab",
     311                "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4"
     312            },
     313            "dist": {
     314                "type": "zip",
     315                "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
     316                "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
    317317                "shasum": ""
    318318            },
     
    326326                "ext-ctype": "For best performance"
    327327            },
    328             "time": "2021-10-20T20:35:02+00:00",
     328            "time": "2022-05-24T11:49:31+00:00",
    329329            "type": "library",
    330330            "extra": {
    331331                "branch-alias": {
    332                     "dev-main": "1.23-dev"
     332                    "dev-main": "1.26-dev"
    333333                },
    334334                "thanks": {
     
    369369            ],
    370370            "support": {
    371                 "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0"
     371                "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0"
    372372            },
    373373            "funding": [
  • sophi/trunk/vendor/composer/installed.php

    r2732874 r2770818  
    11<?php return array(
    22    'root' => array(
    3         'pretty_version' => '1.1.3',
    4         'version' => '1.1.3.0',
     3        'name' => 'globeandmail/sophi-for-wordpress',
     4        'pretty_version' => '1.2.0',
     5        'version' => '1.2.0.0',
     6        'reference' => 'b2d273ae1e4bc8dd95dd47158f41e40d9f161a89',
    57        'type' => 'wordpress-plugin',
    68        'install_path' => __DIR__ . '/../../',
    79        'aliases' => array(),
    8         'reference' => '1f21f00d23cad5ee77de7e7ef50050134f15dcb8',
    9         'name' => 'globeandmail/sophi-for-wordpress',
    1010        'dev' => false,
    1111    ),
     
    1414            'pretty_version' => '0.9.3',
    1515            'version' => '0.9.3.0',
     16            'reference' => 'ca57d18f028f84f777b2168cd1911b0dee2343ae',
    1617            'type' => 'library',
    1718            'install_path' => __DIR__ . '/../brick/math',
    1819            'aliases' => array(),
    19             'reference' => 'ca57d18f028f84f777b2168cd1911b0dee2343ae',
    2020            'dev_requirement' => false,
    2121        ),
    2222        'globeandmail/sophi-for-wordpress' => array(
    23             'pretty_version' => '1.1.3',
    24             'version' => '1.1.3.0',
     23            'pretty_version' => '1.2.0',
     24            'version' => '1.2.0.0',
     25            'reference' => 'b2d273ae1e4bc8dd95dd47158f41e40d9f161a89',
    2526            'type' => 'wordpress-plugin',
    2627            'install_path' => __DIR__ . '/../../',
    2728            'aliases' => array(),
    28             'reference' => '1f21f00d23cad5ee77de7e7ef50050134f15dcb8',
    2929            'dev_requirement' => false,
    3030        ),
     
    3232            'pretty_version' => '1.2.2',
    3333            'version' => '1.2.2.0',
     34            'reference' => 'cccc74ee5e328031b15640b51056ee8d3bb66c0a',
    3435            'type' => 'library',
    3536            'install_path' => __DIR__ . '/../ramsey/collection',
    3637            'aliases' => array(),
    37             'reference' => 'cccc74ee5e328031b15640b51056ee8d3bb66c0a',
    3838            'dev_requirement' => false,
    3939        ),
     
    4141            'pretty_version' => '4.2.3',
    4242            'version' => '4.2.3.0',
     43            'reference' => 'fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df',
    4344            'type' => 'library',
    4445            'install_path' => __DIR__ . '/../ramsey/uuid',
    4546            'aliases' => array(),
    46             'reference' => 'fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df',
    4747            'dev_requirement' => false,
    4848        ),
     
    5656            'pretty_version' => '0.5.0',
    5757            'version' => '0.5.0.0',
     58            'reference' => '32a08e9a7c25d1c51621751e1cdfcffcdef6cfe5',
    5859            'type' => 'library',
    5960            'install_path' => __DIR__ . '/../snowplow/snowplow-tracker',
    6061            'aliases' => array(),
    61             'reference' => '32a08e9a7c25d1c51621751e1cdfcffcdef6cfe5',
    6262            'dev_requirement' => false,
    6363        ),
    6464        'symfony/polyfill-ctype' => array(
    65             'pretty_version' => 'v1.25.0',
    66             'version' => '1.25.0.0',
     65            'pretty_version' => 'v1.26.0',
     66            'version' => '1.26.0.0',
     67            'reference' => '6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4',
    6768            'type' => 'library',
    6869            'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
    6970            'aliases' => array(),
    70             'reference' => '30885182c981ab175d4d034db0f6f469898070ab',
    7171            'dev_requirement' => false,
    7272        ),
     
    7474            'pretty_version' => 'v1.24.0',
    7575            'version' => '1.24.0.0',
     76            'reference' => '57b712b08eddb97c762a8caa32c84e037892d2e9',
    7677            'type' => 'library',
    7778            'install_path' => __DIR__ . '/../symfony/polyfill-php80',
    7879            'aliases' => array(),
    79             'reference' => '57b712b08eddb97c762a8caa32c84e037892d2e9',
    8080            'dev_requirement' => false,
    8181        ),
     
    8383            'pretty_version' => 'v1.24.0',
    8484            'version' => '1.24.0.0',
     85            'reference' => '5de4ba2d41b15f9bd0e19b2ab9674135813ec98f',
    8586            'type' => 'library',
    8687            'install_path' => __DIR__ . '/../symfony/polyfill-php81',
    8788            'aliases' => array(),
    88             'reference' => '5de4ba2d41b15f9bd0e19b2ab9674135813ec98f',
    8989            'dev_requirement' => false,
    9090        ),
Note: See TracChangeset for help on using the changeset viewer.