| @@ -6,12 +6,19 @@ | ||
| 6 | 6 | if ( ! defined( 'ABSPATH' ) ) { |
| 7 | 7 | exit; |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | -if ( ! function_exists( 'rc_dynamic_init' ) ) { | |
| 11 | - // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound -- established function name relied on across the plugin family / feedback SDK; renaming would break integration. | |
| 12 | - function rc_dynamic_init( $params ) { | |
| 10 | +if ( ! function_exists( 'ultimate_post_kit_reviews_init' ) ) { | |
| 11 | + function ultimate_post_kit_reviews_init( $params ) { | |
| 13 | 12 | |
| 13 | + // is_admin() is also true on admin-ajax.php, which fires admin_init before any | |
| 14 | + // authentication, so without this the SDK's constructor (and its option writes) | |
| 15 | + // would run for anonymous callers. Logged-in requests must still reach it during | |
| 16 | + // AJAX, because the constructor is what registers this SDK's own ajax handlers. | |
| 17 | + if ( ! is_user_logged_in() ) { | |
| 18 | + return; | |
| 19 | + } | |
| 20 | + | |
| 14 | 21 | if ( is_admin() ) : |
| 15 | 22 | |
| 16 | 23 | $menu_slug = isset( $params['menu']['slug'] ) ? $params['menu']['slug'] : false; |
| 17 | 24 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only check of the current admin page slug for display routing, no form data processed. |
| @@ -26,11 +33,9 @@ | ||
| 26 | 33 | /** |
| 27 | 34 | * Include SDK |
| 28 | 35 | */ |
| 29 | 36 | require_once dirname( __FILE__ ) . '/notice.php'; |
| 30 | - if ( function_exists( 'rc_sdk_automate' ) ) { | |
| 31 | - rc_sdk_automate( $params ); | |
| 32 | - } | |
| 37 | + ultimate_post_kit_reviews_automate( $params ); | |
| 33 | 38 | |
| 34 | 39 | endif; |
| 35 | 40 | } |
| 36 | 41 | } |