PluginProbe
Parse.ly / 3.14.1
Parse.ly v3.14.1
3.24.1 3.24.0 3.23.7 3.23.6 3.23.5 3.23.4 3.23.3 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.17.0 3.18.0 3.18.1 3.19.0 3.19.1 3.19.2 3.19.3 3.2.0 3.2.1 3.20.0 3.20.1 3.20.2 3.20.3 All 105 releases
← All changes | src/class-parsely.php +1 -76 3.16.13.14.1 View file →
@@ -26,9 +26,8 @@
26 26 * api_secret: string,
27 27 * use_top_level_cats: bool,
28 28 * custom_taxonomy_section: string,
29 29 * cats_as_tags: bool,
30 - * content_helper: Parsely_Options_Content_Helper,
31 30 * track_authenticated_users: bool,
32 31 * lowercase_tags: bool,
33 32 * force_https_canonicals: bool,
34 33 * track_post_types: string[],
@@ -33,9 +32,9 @@
33 32 * force_https_canonicals: bool,
34 33 * track_post_types: string[],
35 34 * track_page_types: string[],
36 35 * track_post_types_as?: array<string, string>,
37 - * full_metadata_in_non_posts: bool,
36 + * full_metadata_in_non_posts: ?bool,
38 37 * disable_javascript: bool,
39 38 * disable_amp: bool,
40 39 * meta_type: string,
41 40 * logo: string,
@@ -43,20 +42,8 @@
43 42 * disable_autotrack: bool,
44 43 * plugin_version: string,
45 44 * }
46 45 *
47 - * @phpstan-type Parsely_Options_Content_Helper array{
48 - * ai_features_enabled: bool,
49 - * smart_linking: Parsely_Options_Content_Helper_Feature,
50 - * title_suggestions: Parsely_Options_Content_Helper_Feature,
51 - * excerpt_suggestions: Parsely_Options_Content_Helper_Feature,
52 - * }
53 - *
54 - * @phpstan-type Parsely_Options_Content_Helper_Feature array{
55 - * enabled: bool,
56 - * allowed_user_roles: string[],
57 - * }
58 - *
59 46 * @phpstan-type WP_HTTP_Request_Args array{
60 47 * method: string,
61 48 * timeout: float,
62 49 * blocking: bool,
@@ -90,23 +77,8 @@
90 77 'api_secret' => '',
91 78 'use_top_level_cats' => false,
92 79 'custom_taxonomy_section' => 'category',
93 80 'cats_as_tags' => false,
94 - 'content_helper' => array(
95 - 'ai_features_enabled' => true,
96 - 'smart_linking' => array(
97 - 'enabled' => true,
98 - 'allowed_user_roles' => array( 'administrator' ),
99 - ),
100 - 'title_suggestions' => array(
101 - 'enabled' => true,
102 - 'allowed_user_roles' => array( 'administrator' ),
103 - ),
104 - 'excerpt_suggestions' => array(
105 - 'enabled' => true,
106 - 'allowed_user_roles' => array( 'administrator' ),
107 - ),
108 - ),
109 81 'track_authenticated_users' => false,
110 82 'lowercase_tags' => true,
111 83 'force_https_canonicals' => false,
112 84 'track_post_types' => array(),
@@ -432,21 +404,12 @@
432 404 * @var Parsely_Options|null
433 405 */
434 406 $options = get_option( self::OPTIONS_KEY, null );
435 407
436 - // @phpstan-ignore isset.offset, booleanAnd.alwaysFalse
437 408 if ( is_array( $options ) && ! isset( $options['full_metadata_in_non_posts'] ) ) {
438 - // Existing plugin installation without full metadata option.
439 409 $this->set_default_full_metadata_in_non_posts();
440 410 }
441 411
442 - // @phpstan-ignore isset.offset, booleanAnd.alwaysFalse
443 - if ( is_array( $options ) && ! isset( $options['content_helper'] ) ) {
444 - // Existing plugin installation without Content Helper options.
445 - $this->set_default_content_helper_settings_values();
446 - }
447 -
448 - // New plugin installation that hasn't saved its options yet.
449 412 if ( ! is_array( $options ) ) {
450 413 $this->set_default_track_as_values();
451 414 $this->set_default_full_metadata_in_non_posts();
452 415 $options = $this->option_defaults;
@@ -465,30 +428,8 @@
465 428 );
466 429 }
467 430
468 431 /**
469 - * Returns the value of a nested option.
470 - *
471 - * @since 3.16.0
472 - *
473 - * @param string $option The option to get.
474 - * @param Parsely_Options $options The options to get the value from.
475 - * @return mixed The value of the nested option.
476 - */
477 - public static function get_nested_option_value( $option, $options ) {
478 - $keys = explode( '[', str_replace( ']', '', $option ) );
479 - $value = $options;
480 -
481 - foreach ( $keys as $key ) {
482 - if ( isset( $value[ $key ] ) ) {
483 - $value = $value[ $key ];
484 - }
485 - }
486 -
487 - return $value;
488 - }
489 -
490 - /**
491 432 * Sets the default values for the track_post_types and track_page_types
492 433 * options.
493 434 *
494 435 * @since 3.9.0
@@ -538,24 +479,8 @@
538 479 $this->option_defaults['full_metadata_in_non_posts'] = false;
539 480 break;
540 481 }
541 482 }
542 - }
543 -
544 - /**
545 - * Sets the default values for Content Helper options.
546 - *
547 - * Gives PCH access to all users having the edit_posts capability, to keep
548 - * consistent behavior with plugin versions prior to 3.16.0.
549 - *
550 - * @since 3.16.0
551 - */
552 - public function set_default_content_helper_settings_values(): void {
553 - $this->option_defaults['content_helper'] =
554 - Permissions::build_pch_permissions_settings_array(
555 - true,
556 - array_keys( Permissions::get_user_roles_with_edit_posts_cap() )
557 - );
558 483 }
559 484
560 485 /**
561 486 * Gets the URL of the plugin's settings page.